diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java index 17dc8f9d060..77fc3a7064d 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java @@ -52,7 +52,7 @@ import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.ICompositeType; import org.hl7.fhir.instance.model.api.IPrimitiveType; -import org.hl7.fhir.instance.model.api.IRefImplResource; +import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBaseBackboneElement; import org.hl7.fhir.instance.model.api.IBaseDatatype; import org.hl7.fhir.instance.model.api.IBaseEnumFactory; @@ -510,7 +510,7 @@ class ModelScanner { RuntimeChildContainedResources def = new RuntimeChildContainedResources(next, childAnnotation, descriptionAnnotation, elementName); orderMap.put(order, def); - } else if (IRefImplResource.class.isAssignableFrom(nextElementType) || IResource.class.equals(nextElementType)) { + } else if (IAnyResource.class.isAssignableFrom(nextElementType) || IResource.class.equals(nextElementType)) { /* * Child is a resource as a direct child, as in Bundle.entry.resource */ diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeResourceDefinition.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeResourceDefinition.java index 629d6845781..cf57a3fbd81 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeResourceDefinition.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeResourceDefinition.java @@ -29,7 +29,7 @@ import java.util.Map; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseResource; -import org.hl7.fhir.instance.model.api.IRefImplResource; +import org.hl7.fhir.instance.model.api.IAnyResource; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.api.annotation.ResourceDef; @@ -58,7 +58,7 @@ public class RuntimeResourceDefinition extends BaseRuntimeElementCompositeDefini try { IBaseResource instance = theClass.newInstance(); - if (instance instanceof IRefImplResource) { + if (instance instanceof IAnyResource) { myStructureVersion = FhirVersionEnum.DSTU2_HL7ORG; } else { myStructureVersion = ((IResource)instance).getStructureFhirVersionEnum(); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeResourceReferenceDefinition.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeResourceReferenceDefinition.java index bae9ec367a2..3dd683adcc1 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeResourceReferenceDefinition.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeResourceReferenceDefinition.java @@ -26,7 +26,7 @@ import java.util.Map; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseResource; -import org.hl7.fhir.instance.model.api.IRefImplResource; +import org.hl7.fhir.instance.model.api.IAnyResource; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.base.composite.BaseResourceReferenceDt; @@ -56,7 +56,7 @@ public class RuntimeResourceReferenceDefinition extends BaseRuntimeElementDefini void sealAndInitialize(FhirContext theContext, Map, BaseRuntimeElementDefinition> theClassToElementDefinitions) { myResourceTypeToDefinition = new HashMap, RuntimeResourceDefinition>(); for (Class next : myResourceTypes) { - if (next.equals(IResource.class) || next.equals(IRefImplResource.class) || next.equals(IBaseResource.class)) { + if (next.equals(IResource.class) || next.equals(IAnyResource.class) || next.equals(IBaseResource.class)) { continue; } RuntimeResourceDefinition definition = (RuntimeResourceDefinition) theClassToElementDefinitions.get(next); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/IdDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/IdDt.java index bad9d79a106..b8d64324543 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/IdDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/IdDt.java @@ -29,7 +29,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.hl7.fhir.instance.model.api.IBaseResource; -import org.hl7.fhir.instance.model.api.IRefImplResource; +import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IIdType; import ca.uhn.fhir.model.api.IPrimitiveDatatype; @@ -546,8 +546,8 @@ public class IdDt extends UriDt implements IPrimitiveDatatype, IIdType { throw new NullPointerException("theResource can not be null"); } else if (theResouce instanceof IResource) { ((IResource) theResouce).setId(new IdDt(getValue())); - } else if (theResouce instanceof IRefImplResource) { - ((IRefImplResource) theResouce).setId(getValue()); + } else if (theResouce instanceof IAnyResource) { + ((IAnyResource) theResouce).setId(getValue()); } else { throw new IllegalArgumentException("Unknown resource class type, does not implement IResource or extend Resource"); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/BaseParser.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/BaseParser.java index c950646a65a..04acc4efe2a 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/BaseParser.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/BaseParser.java @@ -40,7 +40,7 @@ import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IPrimitiveType; -import org.hl7.fhir.instance.model.api.IRefImplResource; +import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IDomainResource; import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.instance.model.api.IBaseReference; @@ -95,8 +95,8 @@ public abstract class BaseParser implements IParser { } } } else if (theTarget instanceof IDomainResource) { - List containedResources = ((IDomainResource) theTarget).getContained(); - for (IRefImplResource next : containedResources) { + List containedResources = ((IDomainResource) theTarget).getContained(); + for (IAnyResource next : containedResources) { String nextId = next.getIdElement().getValue(); if (StringUtils.isNotBlank(nextId)) { if (!nextId.startsWith("#")) { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/JsonParser.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/JsonParser.java index 51b997fb182..51d79672356 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/JsonParser.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/JsonParser.java @@ -54,7 +54,7 @@ import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IPrimitiveType; -import org.hl7.fhir.instance.model.api.IRefImplResource; +import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBaseBinary; import org.hl7.fhir.instance.model.api.IBaseBooleanDatatype; import org.hl7.fhir.instance.model.api.IBaseDatatype; @@ -676,8 +676,8 @@ public class JsonParser extends BaseParser implements IParser { resourceId = res.getId().getIdPart(); } } - } else if (theResource instanceof IRefImplResource) { - IRefImplResource res = (IRefImplResource) theResource; + } else if (theResource instanceof IAnyResource) { + IAnyResource res = (IAnyResource) theResource; if (/*theContainedResource && */ StringUtils.isNotBlank(res.getIdElement().getIdPart())) { resourceId = res.getIdElement().getIdPart(); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/XmlParser.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/XmlParser.java index 361c7fbb70d..209b7170a6a 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/XmlParser.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/XmlParser.java @@ -50,7 +50,7 @@ import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IPrimitiveType; -import org.hl7.fhir.instance.model.api.IRefImplResource; +import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBaseBinary; import org.hl7.fhir.instance.model.api.IBaseDatatype; import org.hl7.fhir.instance.model.api.IBaseExtension; @@ -751,7 +751,7 @@ public class XmlParser extends BaseParser implements IParser { } } else { // HL7 structs - IRefImplResource resource = (IRefImplResource) theResource; + IAnyResource resource = (IAnyResource) theResource; if (StringUtils.isNotBlank(resource.getIdElement().getIdPart())) { resourceId = resource.getIdElement().getIdPart(); } @@ -777,7 +777,7 @@ public class XmlParser extends BaseParser implements IParser { theEventWriter.writeStartElement(resDef.getName()); theEventWriter.writeDefaultNamespace(FHIR_NS); - if (theResource instanceof IRefImplResource) { + if (theResource instanceof IAnyResource) { // HL7.org Structures writeOptionalTagWithValue(theEventWriter, "id", theResourceId); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/MethodUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/MethodUtil.java index b3af190688c..a2fb14c21d8 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/MethodUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/MethodUtil.java @@ -28,7 +28,7 @@ import org.apache.http.client.utils.DateUtils; import org.hl7.fhir.instance.model.api.IBaseMetaType; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; -import org.hl7.fhir.instance.model.api.IRefImplResource; +import org.hl7.fhir.instance.model.api.IAnyResource; import ca.uhn.fhir.context.ConfigurationException; import ca.uhn.fhir.context.FhirContext; @@ -460,8 +460,8 @@ public class MethodUtil { if (resource instanceof IResource) { InstantDt lmValue = new InstantDt(headerDateValue); ((IResource) resource).getResourceMetadata().put(ResourceMetadataKeyEnum.UPDATED, lmValue); - } else if (resource instanceof IRefImplResource) { - ((IRefImplResource) resource).getMeta().setLastUpdated(headerDateValue); + } else if (resource instanceof IAnyResource) { + ((IAnyResource) resource).getMeta().setLastUpdated(headerDateValue); } } catch (Exception e) { ourLog.warn("Unable to parse date string '{}'. Error is: {}", headerValue, e.toString()); @@ -505,8 +505,8 @@ public class MethodUtil { } if (resource instanceof IResource) { ResourceMetadataKeyEnum.TAG_LIST.put((IResource) resource, tagList); - } else if (resource instanceof IRefImplResource) { - IBaseMetaType meta = ((IRefImplResource) resource).getMeta(); + } else if (resource instanceof IAnyResource) { + IBaseMetaType meta = ((IAnyResource) resource).getMeta(); for (Tag next : tagList) { meta.addTag().setSystem(next.getScheme()).setCode(next.getTerm()).setDisplay(next.getLabel()); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServerUtils.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServerUtils.java index e10dbe149cf..e21744e7d83 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServerUtils.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServerUtils.java @@ -41,7 +41,7 @@ import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang3.StringUtils; import org.apache.http.client.utils.DateUtils; import org.hl7.fhir.instance.model.api.IBaseResource; -import org.hl7.fhir.instance.model.api.IRefImplResource; +import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBaseBinary; import org.hl7.fhir.instance.model.api.IIdType; @@ -148,7 +148,7 @@ public class RestfulServerUtils { } } } else { - Date lastUpdated = ((IRefImplResource)theResource).getMeta().getLastUpdated(); + Date lastUpdated = ((IAnyResource)theResource).getMeta().getLastUpdated(); if (lastUpdated != null) { theHttpResponse.addHeader(Constants.HEADER_LAST_MODIFIED, DateUtils.formatDate(lastUpdated)); } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IRefImplResource.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IAnyResource.java similarity index 89% rename from hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IRefImplResource.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IAnyResource.java index ba5c892c2f4..2a05373aa41 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IRefImplResource.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IAnyResource.java @@ -21,11 +21,11 @@ package org.hl7.fhir.instance.model.api; */ -public interface IRefImplResource extends IBaseResource { +public interface IAnyResource extends IBaseResource { String getId(); - IRefImplResource setId(String theId); + IAnyResource setId(String theId); IIdType getIdElement(); diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBackboneElement.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBackboneElement.java new file mode 100644 index 00000000000..19c2d5ca764 --- /dev/null +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBackboneElement.java @@ -0,0 +1,26 @@ +package org.hl7.fhir.instance.model.api; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 - 2015 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + + +public interface IBackboneElement extends IBase { + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseBundle.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseBundle.java index b557f1e3b9e..f3094f3825f 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseBundle.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseBundle.java @@ -43,5 +43,5 @@ public interface IBaseBundle extends IBaseResource { * this bundle. */ public static final String LINK_SELF = "self"; - + } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseConformance.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseConformance.java index 21cf10d5c39..320eb4ee123 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseConformance.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseConformance.java @@ -1,25 +1,5 @@ package org.hl7.fhir.instance.model.api; -/* - * #%L - * HAPI FHIR - Core Library - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - public interface IBaseConformance extends IBaseResource { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseXhtml.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseXhtml.java index 9ce67695516..03f6a65758d 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseXhtml.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseXhtml.java @@ -1,25 +1,5 @@ package org.hl7.fhir.instance.model.api; -/* - * #%L - * HAPI FHIR - Core Library - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - public interface IBaseXhtml extends IPrimitiveType { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IDomainResource.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IDomainResource.java index f8314ac3340..24ab6d8e11a 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IDomainResource.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IDomainResource.java @@ -22,9 +22,9 @@ package org.hl7.fhir.instance.model.api; import java.util.List; -public interface IDomainResource extends IRefImplResource { +public interface IDomainResource extends IAnyResource { - List getContained(); + List getContained(); INarrative getText(); diff --git a/hapi-fhir-structures-hl7org-dstu2/pom.xml b/hapi-fhir-structures-hl7org-dstu2/pom.xml index feb449dc44f..6d3099258f5 100644 --- a/hapi-fhir-structures-hl7org-dstu2/pom.xml +++ b/hapi-fhir-structures-hl7org-dstu2/pom.xml @@ -27,26 +27,21 @@ ${servlet_api_version} provided - - - + + + xpp3 + xpp3_min + 1.1.4c + net.sf.saxon - saxon - 8.7 + Saxon-HE + 9.6.0-4 - --> - - - xpp3 - xpp3_min - 1.1.4c - - - net.sf.saxon - Saxon-HE - 9.6.0-4 - @@ -192,6 +187,15 @@ + + org.codehaus.mojo + license-maven-plugin + ${maven_license_plugin_version} + + + true + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2hl7org/Dstu2Hl7OrgBundleFactory.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2hl7org/Dstu2Hl7OrgBundleFactory.java index 7fd1242b860..11e4666678f 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2hl7org/Dstu2Hl7OrgBundleFactory.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2hl7org/Dstu2Hl7OrgBundleFactory.java @@ -40,7 +40,7 @@ import org.hl7.fhir.instance.model.InstantType; import org.hl7.fhir.instance.model.OperationOutcome; import org.hl7.fhir.instance.model.Resource; import org.hl7.fhir.instance.model.api.IBaseResource; -import org.hl7.fhir.instance.model.api.IRefImplResource; +import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IDomainResource; import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.instance.model.api.IBaseReference; @@ -93,7 +93,7 @@ public class Dstu2Hl7OrgBundleFactory implements IVersionSpecificBundleFactory { IDomainResource next = (IDomainResource) nextBaseRes; Set containedIds = new HashSet(); - for (IRefImplResource nextContained : next.getContained()) { + for (IAnyResource nextContained : next.getContained()) { if (nextContained.getId().isEmpty() == false) { containedIds.add(nextContained.getIdElement().getValue()); } diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Address.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Address.java index 5544b5d449d..7d0b0d25e34 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Address.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Address.java @@ -1,678 +1,657 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * There is a variety of postal address formats defined around the world. This format defines a superset that is the basis for all addresses around the world. - */ -@DatatypeDef(name="Address") -public class Address extends Type implements ICompositeType { - - public enum AddressUse { - /** - * A communication address at a home. - */ - HOME, - /** - * An office address. First choice for business related contacts during business hours. - */ - WORK, - /** - * A temporary address. The period can provide more detailed information. - */ - TEMP, - /** - * This address is no longer in use (or was never correct, but retained for records). - */ - OLD, - /** - * added to help the parsers - */ - NULL; - public static AddressUse fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("home".equals(codeString)) - return HOME; - if ("work".equals(codeString)) - return WORK; - if ("temp".equals(codeString)) - return TEMP; - if ("old".equals(codeString)) - return OLD; - throw new Exception("Unknown AddressUse code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case HOME: return "home"; - case WORK: return "work"; - case TEMP: return "temp"; - case OLD: return "old"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case HOME: return ""; - case WORK: return ""; - case TEMP: return ""; - case OLD: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case HOME: return "A communication address at a home."; - case WORK: return "An office address. First choice for business related contacts during business hours."; - case TEMP: return "A temporary address. The period can provide more detailed information."; - case OLD: return "This address is no longer in use (or was never correct, but retained for records)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case HOME: return "Home"; - case WORK: return "Work"; - case TEMP: return "Temp"; - case OLD: return "Old"; - default: return "?"; - } - } - } - - public static class AddressUseEnumFactory implements EnumFactory { - public AddressUse fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("home".equals(codeString)) - return AddressUse.HOME; - if ("work".equals(codeString)) - return AddressUse.WORK; - if ("temp".equals(codeString)) - return AddressUse.TEMP; - if ("old".equals(codeString)) - return AddressUse.OLD; - throw new IllegalArgumentException("Unknown AddressUse code '"+codeString+"'"); - } - public String toCode(AddressUse code) { - if (code == AddressUse.HOME) - return "home"; - if (code == AddressUse.WORK) - return "work"; - if (code == AddressUse.TEMP) - return "temp"; - if (code == AddressUse.OLD) - return "old"; - return "?"; - } - } - - /** - * The purpose of this address. - */ - @Child(name = "use", type = {CodeType.class}, order=0, min=0, max=1) - @Description(shortDefinition="home | work | temp | old - purpose of this address", formalDefinition="The purpose of this address." ) - protected Enumeration use; - - /** - * A full text representation of the address. - */ - @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Text representation of the address", formalDefinition="A full text representation of the address." ) - protected StringType text; - - /** +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * There is a variety of postal address formats defined around the world. This format defines a superset that is the basis for all addresses around the world. + */ +@DatatypeDef(name="Address") +public class Address extends Type implements ICompositeType { + + public enum AddressUse { + /** + * A communication address at a home. + */ + HOME, + /** + * An office address. First choice for business related contacts during business hours. + */ + WORK, + /** + * A temporary address. The period can provide more detailed information. + */ + TEMP, + /** + * This address is no longer in use (or was never correct, but retained for records). + */ + OLD, + /** + * added to help the parsers + */ + NULL; + public static AddressUse fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("home".equals(codeString)) + return HOME; + if ("work".equals(codeString)) + return WORK; + if ("temp".equals(codeString)) + return TEMP; + if ("old".equals(codeString)) + return OLD; + throw new Exception("Unknown AddressUse code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case HOME: return "home"; + case WORK: return "work"; + case TEMP: return "temp"; + case OLD: return "old"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case HOME: return ""; + case WORK: return ""; + case TEMP: return ""; + case OLD: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case HOME: return "A communication address at a home."; + case WORK: return "An office address. First choice for business related contacts during business hours."; + case TEMP: return "A temporary address. The period can provide more detailed information."; + case OLD: return "This address is no longer in use (or was never correct, but retained for records)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case HOME: return "Home"; + case WORK: return "Work"; + case TEMP: return "Temp"; + case OLD: return "Old"; + default: return "?"; + } + } + } + + public static class AddressUseEnumFactory implements EnumFactory { + public AddressUse fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("home".equals(codeString)) + return AddressUse.HOME; + if ("work".equals(codeString)) + return AddressUse.WORK; + if ("temp".equals(codeString)) + return AddressUse.TEMP; + if ("old".equals(codeString)) + return AddressUse.OLD; + throw new IllegalArgumentException("Unknown AddressUse code '"+codeString+"'"); + } + public String toCode(AddressUse code) { + if (code == AddressUse.HOME) + return "home"; + if (code == AddressUse.WORK) + return "work"; + if (code == AddressUse.TEMP) + return "temp"; + if (code == AddressUse.OLD) + return "old"; + return "?"; + } + } + + /** + * The purpose of this address. + */ + @Child(name = "use", type = {CodeType.class}, order=0, min=0, max=1) + @Description(shortDefinition="home | work | temp | old - purpose of this address", formalDefinition="The purpose of this address." ) + protected Enumeration use; + + /** + * A full text representation of the address. + */ + @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Text representation of the address", formalDefinition="A full text representation of the address." ) + protected StringType text; + + /** * This component contains the house number, apartment number, street name, street direction, -P.O. Box number, delivery hints, and similar address information. - */ - @Child(name = "line", type = {StringType.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Street name, number, direction & P.O. Box etc", formalDefinition="This component contains the house number, apartment number, street name, street direction, \nP.O. Box number, delivery hints, and similar address information." ) - protected List line; - - /** - * The name of the city, town, village or other community or delivery center. - */ - @Child(name = "city", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Name of city, town etc.", formalDefinition="The name of the city, town, village or other community or delivery center." ) - protected StringType city; - - /** - * Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). - */ - @Child(name = "state", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Sub-unit of country (abreviations ok)", formalDefinition="Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes)." ) - protected StringType state; - - /** - * A postal code designating a region defined by the postal service. - */ - @Child(name = "postalCode", type = {StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Postal code for area", formalDefinition="A postal code designating a region defined by the postal service." ) - protected StringType postalCode; - - /** - * Country - a nation as commonly understood or generally accepted. - */ - @Child(name = "country", type = {StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Country (can be ISO 3166 3 letter code)", formalDefinition="Country - a nation as commonly understood or generally accepted." ) - protected StringType country; - - /** - * Time period when address was/is in use. - */ - @Child(name = "period", type = {Period.class}, order=7, min=0, max=1) - @Description(shortDefinition="Time period when address was/is in use", formalDefinition="Time period when address was/is in use." ) - protected Period period; - - private static final long serialVersionUID = -470351694L; - - /* - * Constructor - */ - public Address() { - super(); - } - - /** - * @return {@link #use} (The purpose of this address.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(new AddressUseEnumFactory()); // bb - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (The purpose of this address.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Address setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return The purpose of this address. - */ - public AddressUse getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value The purpose of this address. - */ - public Address setUse(AddressUse value) { - if (value == null) - this.use = null; - else { - if (this.use == null) - this.use = new Enumeration(new AddressUseEnumFactory()); - this.use.setValue(value); - } - return this; - } - - /** - * @return {@link #text} (A full text representation of the address.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (A full text representation of the address.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public Address setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return A full text representation of the address. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value A full text representation of the address. - */ - public Address setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** +P.O. Box number, delivery hints, and similar address information. + */ + @Child(name = "line", type = {StringType.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Street name, number, direction & P.O. Box etc", formalDefinition="This component contains the house number, apartment number, street name, street direction, \nP.O. Box number, delivery hints, and similar address information." ) + protected List line; + + /** + * The name of the city, town, village or other community or delivery center. + */ + @Child(name = "city", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Name of city, town etc.", formalDefinition="The name of the city, town, village or other community or delivery center." ) + protected StringType city; + + /** + * Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). + */ + @Child(name = "state", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Sub-unit of country (abreviations ok)", formalDefinition="Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes)." ) + protected StringType state; + + /** + * A postal code designating a region defined by the postal service. + */ + @Child(name = "postalCode", type = {StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Postal code for area", formalDefinition="A postal code designating a region defined by the postal service." ) + protected StringType postalCode; + + /** + * Country - a nation as commonly understood or generally accepted. + */ + @Child(name = "country", type = {StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Country (can be ISO 3166 3 letter code)", formalDefinition="Country - a nation as commonly understood or generally accepted." ) + protected StringType country; + + /** + * Time period when address was/is in use. + */ + @Child(name = "period", type = {Period.class}, order=7, min=0, max=1) + @Description(shortDefinition="Time period when address was/is in use", formalDefinition="Time period when address was/is in use." ) + protected Period period; + + private static final long serialVersionUID = -470351694L; + + /* + * Constructor + */ + public Address() { + super(); + } + + /** + * @return {@link #use} (The purpose of this address.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Enumeration getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Address.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(new AddressUseEnumFactory()); // bb + return this.use; + } + + public boolean hasUseElement() { + return this.use != null && !this.use.isEmpty(); + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (The purpose of this address.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Address setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return The purpose of this address. + */ + public AddressUse getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value The purpose of this address. + */ + public Address setUse(AddressUse value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(new AddressUseEnumFactory()); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #text} (A full text representation of the address.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Address.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (A full text representation of the address.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public Address setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return A full text representation of the address. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value A full text representation of the address. + */ + public Address setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** * @return {@link #line} (This component contains the house number, apartment number, street name, street direction, -P.O. Box number, delivery hints, and similar address information.) - */ - public List getLine() { - if (this.line == null) - this.line = new ArrayList(); - return this.line; - } - - public boolean hasLine() { - if (this.line == null) - return false; - for (StringType item : this.line) - if (!item.isEmpty()) - return true; - return false; - } - - /** +P.O. Box number, delivery hints, and similar address information.) + */ + public List getLine() { + if (this.line == null) + this.line = new ArrayList(); + return this.line; + } + + public boolean hasLine() { + if (this.line == null) + return false; + for (StringType item : this.line) + if (!item.isEmpty()) + return true; + return false; + } + + /** * @return {@link #line} (This component contains the house number, apartment number, street name, street direction, -P.O. Box number, delivery hints, and similar address information.) - */ - // syntactic sugar - public StringType addLineElement() {//2 - StringType t = new StringType(); - if (this.line == null) - this.line = new ArrayList(); - this.line.add(t); - return t; - } - - /** +P.O. Box number, delivery hints, and similar address information.) + */ + // syntactic sugar + public StringType addLineElement() {//2 + StringType t = new StringType(); + if (this.line == null) + this.line = new ArrayList(); + this.line.add(t); + return t; + } + + /** * @param value {@link #line} (This component contains the house number, apartment number, street name, street direction, -P.O. Box number, delivery hints, and similar address information.) - */ - public Address addLine(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.line == null) - this.line = new ArrayList(); - this.line.add(t); - return this; - } - - /** +P.O. Box number, delivery hints, and similar address information.) + */ + public Address addLine(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.line == null) + this.line = new ArrayList(); + this.line.add(t); + return this; + } + + /** * @param value {@link #line} (This component contains the house number, apartment number, street name, street direction, -P.O. Box number, delivery hints, and similar address information.) - */ - public boolean hasLine(String value) { - if (this.line == null) - return false; - for (StringType v : this.line) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #city} (The name of the city, town, village or other community or delivery center.). This is the underlying object with id, value and extensions. The accessor "getCity" gives direct access to the value - */ - public StringType getCityElement() { - if (this.city == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.city"); - else if (Configuration.doAutoCreate()) - this.city = new StringType(); // bb - return this.city; - } - - public boolean hasCityElement() { - return this.city != null && !this.city.isEmpty(); - } - - public boolean hasCity() { - return this.city != null && !this.city.isEmpty(); - } - - /** - * @param value {@link #city} (The name of the city, town, village or other community or delivery center.). This is the underlying object with id, value and extensions. The accessor "getCity" gives direct access to the value - */ - public Address setCityElement(StringType value) { - this.city = value; - return this; - } - - /** - * @return The name of the city, town, village or other community or delivery center. - */ - public String getCity() { - return this.city == null ? null : this.city.getValue(); - } - - /** - * @param value The name of the city, town, village or other community or delivery center. - */ - public Address setCity(String value) { - if (Utilities.noString(value)) - this.city = null; - else { - if (this.city == null) - this.city = new StringType(); - this.city.setValue(value); - } - return this; - } - - /** - * @return {@link #state} (Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value - */ - public StringType getStateElement() { - if (this.state == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.state"); - else if (Configuration.doAutoCreate()) - this.state = new StringType(); // bb - return this.state; - } - - public boolean hasStateElement() { - return this.state != null && !this.state.isEmpty(); - } - - public boolean hasState() { - return this.state != null && !this.state.isEmpty(); - } - - /** - * @param value {@link #state} (Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value - */ - public Address setStateElement(StringType value) { - this.state = value; - return this; - } - - /** - * @return Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). - */ - public String getState() { - return this.state == null ? null : this.state.getValue(); - } - - /** - * @param value Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). - */ - public Address setState(String value) { - if (Utilities.noString(value)) - this.state = null; - else { - if (this.state == null) - this.state = new StringType(); - this.state.setValue(value); - } - return this; - } - - /** - * @return {@link #postalCode} (A postal code designating a region defined by the postal service.). This is the underlying object with id, value and extensions. The accessor "getPostalCode" gives direct access to the value - */ - public StringType getPostalCodeElement() { - if (this.postalCode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.postalCode"); - else if (Configuration.doAutoCreate()) - this.postalCode = new StringType(); // bb - return this.postalCode; - } - - public boolean hasPostalCodeElement() { - return this.postalCode != null && !this.postalCode.isEmpty(); - } - - public boolean hasPostalCode() { - return this.postalCode != null && !this.postalCode.isEmpty(); - } - - /** - * @param value {@link #postalCode} (A postal code designating a region defined by the postal service.). This is the underlying object with id, value and extensions. The accessor "getPostalCode" gives direct access to the value - */ - public Address setPostalCodeElement(StringType value) { - this.postalCode = value; - return this; - } - - /** - * @return A postal code designating a region defined by the postal service. - */ - public String getPostalCode() { - return this.postalCode == null ? null : this.postalCode.getValue(); - } - - /** - * @param value A postal code designating a region defined by the postal service. - */ - public Address setPostalCode(String value) { - if (Utilities.noString(value)) - this.postalCode = null; - else { - if (this.postalCode == null) - this.postalCode = new StringType(); - this.postalCode.setValue(value); - } - return this; - } - - /** - * @return {@link #country} (Country - a nation as commonly understood or generally accepted.). This is the underlying object with id, value and extensions. The accessor "getCountry" gives direct access to the value - */ - public StringType getCountryElement() { - if (this.country == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.country"); - else if (Configuration.doAutoCreate()) - this.country = new StringType(); // bb - return this.country; - } - - public boolean hasCountryElement() { - return this.country != null && !this.country.isEmpty(); - } - - public boolean hasCountry() { - return this.country != null && !this.country.isEmpty(); - } - - /** - * @param value {@link #country} (Country - a nation as commonly understood or generally accepted.). This is the underlying object with id, value and extensions. The accessor "getCountry" gives direct access to the value - */ - public Address setCountryElement(StringType value) { - this.country = value; - return this; - } - - /** - * @return Country - a nation as commonly understood or generally accepted. - */ - public String getCountry() { - return this.country == null ? null : this.country.getValue(); - } - - /** - * @param value Country - a nation as commonly understood or generally accepted. - */ - public Address setCountry(String value) { - if (Utilities.noString(value)) - this.country = null; - else { - if (this.country == null) - this.country = new StringType(); - this.country.setValue(value); - } - return this; - } - - /** - * @return {@link #period} (Time period when address was/is in use.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (Time period when address was/is in use.) - */ - public Address setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("use", "code", "The purpose of this address.", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("text", "string", "A full text representation of the address.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("line", "string", "This component contains the house number, apartment number, street name, street direction, \nP.O. Box number, delivery hints, and similar address information.", 0, java.lang.Integer.MAX_VALUE, line)); - childrenList.add(new Property("city", "string", "The name of the city, town, village or other community or delivery center.", 0, java.lang.Integer.MAX_VALUE, city)); - childrenList.add(new Property("state", "string", "Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).", 0, java.lang.Integer.MAX_VALUE, state)); - childrenList.add(new Property("postalCode", "string", "A postal code designating a region defined by the postal service.", 0, java.lang.Integer.MAX_VALUE, postalCode)); - childrenList.add(new Property("country", "string", "Country - a nation as commonly understood or generally accepted.", 0, java.lang.Integer.MAX_VALUE, country)); - childrenList.add(new Property("period", "Period", "Time period when address was/is in use.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - public Address copy() { - Address dst = new Address(); - copyValues(dst); - dst.use = use == null ? null : use.copy(); - dst.text = text == null ? null : text.copy(); - if (line != null) { - dst.line = new ArrayList(); - for (StringType i : line) - dst.line.add(i.copy()); - }; - dst.city = city == null ? null : city.copy(); - dst.state = state == null ? null : state.copy(); - dst.postalCode = postalCode == null ? null : postalCode.copy(); - dst.country = country == null ? null : country.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - protected Address typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Address)) - return false; - Address o = (Address) other; - return compareDeep(use, o.use, true) && compareDeep(text, o.text, true) && compareDeep(line, o.line, true) - && compareDeep(city, o.city, true) && compareDeep(state, o.state, true) && compareDeep(postalCode, o.postalCode, true) - && compareDeep(country, o.country, true) && compareDeep(period, o.period, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Address)) - return false; - Address o = (Address) other; - return compareValues(use, o.use, true) && compareValues(text, o.text, true) && compareValues(line, o.line, true) - && compareValues(city, o.city, true) && compareValues(state, o.state, true) && compareValues(postalCode, o.postalCode, true) - && compareValues(country, o.country, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (use == null || use.isEmpty()) && (text == null || text.isEmpty()) - && (line == null || line.isEmpty()) && (city == null || city.isEmpty()) && (state == null || state.isEmpty()) - && (postalCode == null || postalCode.isEmpty()) && (country == null || country.isEmpty()) - && (period == null || period.isEmpty()); - } - - -} - +P.O. Box number, delivery hints, and similar address information.) + */ + public boolean hasLine(String value) { + if (this.line == null) + return false; + for (StringType v : this.line) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #city} (The name of the city, town, village or other community or delivery center.). This is the underlying object with id, value and extensions. The accessor "getCity" gives direct access to the value + */ + public StringType getCityElement() { + if (this.city == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Address.city"); + else if (Configuration.doAutoCreate()) + this.city = new StringType(); // bb + return this.city; + } + + public boolean hasCityElement() { + return this.city != null && !this.city.isEmpty(); + } + + public boolean hasCity() { + return this.city != null && !this.city.isEmpty(); + } + + /** + * @param value {@link #city} (The name of the city, town, village or other community or delivery center.). This is the underlying object with id, value and extensions. The accessor "getCity" gives direct access to the value + */ + public Address setCityElement(StringType value) { + this.city = value; + return this; + } + + /** + * @return The name of the city, town, village or other community or delivery center. + */ + public String getCity() { + return this.city == null ? null : this.city.getValue(); + } + + /** + * @param value The name of the city, town, village or other community or delivery center. + */ + public Address setCity(String value) { + if (Utilities.noString(value)) + this.city = null; + else { + if (this.city == null) + this.city = new StringType(); + this.city.setValue(value); + } + return this; + } + + /** + * @return {@link #state} (Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value + */ + public StringType getStateElement() { + if (this.state == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Address.state"); + else if (Configuration.doAutoCreate()) + this.state = new StringType(); // bb + return this.state; + } + + public boolean hasStateElement() { + return this.state != null && !this.state.isEmpty(); + } + + public boolean hasState() { + return this.state != null && !this.state.isEmpty(); + } + + /** + * @param value {@link #state} (Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value + */ + public Address setStateElement(StringType value) { + this.state = value; + return this; + } + + /** + * @return Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). + */ + public String getState() { + return this.state == null ? null : this.state.getValue(); + } + + /** + * @param value Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). + */ + public Address setState(String value) { + if (Utilities.noString(value)) + this.state = null; + else { + if (this.state == null) + this.state = new StringType(); + this.state.setValue(value); + } + return this; + } + + /** + * @return {@link #postalCode} (A postal code designating a region defined by the postal service.). This is the underlying object with id, value and extensions. The accessor "getPostalCode" gives direct access to the value + */ + public StringType getPostalCodeElement() { + if (this.postalCode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Address.postalCode"); + else if (Configuration.doAutoCreate()) + this.postalCode = new StringType(); // bb + return this.postalCode; + } + + public boolean hasPostalCodeElement() { + return this.postalCode != null && !this.postalCode.isEmpty(); + } + + public boolean hasPostalCode() { + return this.postalCode != null && !this.postalCode.isEmpty(); + } + + /** + * @param value {@link #postalCode} (A postal code designating a region defined by the postal service.). This is the underlying object with id, value and extensions. The accessor "getPostalCode" gives direct access to the value + */ + public Address setPostalCodeElement(StringType value) { + this.postalCode = value; + return this; + } + + /** + * @return A postal code designating a region defined by the postal service. + */ + public String getPostalCode() { + return this.postalCode == null ? null : this.postalCode.getValue(); + } + + /** + * @param value A postal code designating a region defined by the postal service. + */ + public Address setPostalCode(String value) { + if (Utilities.noString(value)) + this.postalCode = null; + else { + if (this.postalCode == null) + this.postalCode = new StringType(); + this.postalCode.setValue(value); + } + return this; + } + + /** + * @return {@link #country} (Country - a nation as commonly understood or generally accepted.). This is the underlying object with id, value and extensions. The accessor "getCountry" gives direct access to the value + */ + public StringType getCountryElement() { + if (this.country == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Address.country"); + else if (Configuration.doAutoCreate()) + this.country = new StringType(); // bb + return this.country; + } + + public boolean hasCountryElement() { + return this.country != null && !this.country.isEmpty(); + } + + public boolean hasCountry() { + return this.country != null && !this.country.isEmpty(); + } + + /** + * @param value {@link #country} (Country - a nation as commonly understood or generally accepted.). This is the underlying object with id, value and extensions. The accessor "getCountry" gives direct access to the value + */ + public Address setCountryElement(StringType value) { + this.country = value; + return this; + } + + /** + * @return Country - a nation as commonly understood or generally accepted. + */ + public String getCountry() { + return this.country == null ? null : this.country.getValue(); + } + + /** + * @param value Country - a nation as commonly understood or generally accepted. + */ + public Address setCountry(String value) { + if (Utilities.noString(value)) + this.country = null; + else { + if (this.country == null) + this.country = new StringType(); + this.country.setValue(value); + } + return this; + } + + /** + * @return {@link #period} (Time period when address was/is in use.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Address.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Time period when address was/is in use.) + */ + public Address setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("use", "code", "The purpose of this address.", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("text", "string", "A full text representation of the address.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("line", "string", "This component contains the house number, apartment number, street name, street direction, \nP.O. Box number, delivery hints, and similar address information.", 0, java.lang.Integer.MAX_VALUE, line)); + childrenList.add(new Property("city", "string", "The name of the city, town, village or other community or delivery center.", 0, java.lang.Integer.MAX_VALUE, city)); + childrenList.add(new Property("state", "string", "Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).", 0, java.lang.Integer.MAX_VALUE, state)); + childrenList.add(new Property("postalCode", "string", "A postal code designating a region defined by the postal service.", 0, java.lang.Integer.MAX_VALUE, postalCode)); + childrenList.add(new Property("country", "string", "Country - a nation as commonly understood or generally accepted.", 0, java.lang.Integer.MAX_VALUE, country)); + childrenList.add(new Property("period", "Period", "Time period when address was/is in use.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + public Address copy() { + Address dst = new Address(); + copyValues(dst); + dst.use = use == null ? null : use.copy(); + dst.text = text == null ? null : text.copy(); + if (line != null) { + dst.line = new ArrayList(); + for (StringType i : line) + dst.line.add(i.copy()); + }; + dst.city = city == null ? null : city.copy(); + dst.state = state == null ? null : state.copy(); + dst.postalCode = postalCode == null ? null : postalCode.copy(); + dst.country = country == null ? null : country.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + protected Address typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Address)) + return false; + Address o = (Address) other; + return compareDeep(use, o.use, true) && compareDeep(text, o.text, true) && compareDeep(line, o.line, true) + && compareDeep(city, o.city, true) && compareDeep(state, o.state, true) && compareDeep(postalCode, o.postalCode, true) + && compareDeep(country, o.country, true) && compareDeep(period, o.period, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Address)) + return false; + Address o = (Address) other; + return compareValues(use, o.use, true) && compareValues(text, o.text, true) && compareValues(line, o.line, true) + && compareValues(city, o.city, true) && compareValues(state, o.state, true) && compareValues(postalCode, o.postalCode, true) + && compareValues(country, o.country, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (use == null || use.isEmpty()) && (text == null || text.isEmpty()) + && (line == null || line.isEmpty()) && (city == null || city.isEmpty()) && (state == null || state.isEmpty()) + && (postalCode == null || postalCode.isEmpty()) && (country == null || country.isEmpty()) + && (period == null || period.isEmpty()); + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Age.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Age.java index e356a62769f..98e6571b629 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Age.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Age.java @@ -1,111 +1,90 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * 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(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Age)) - return false; - Age o = (Age) other; - return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(units, o.units, true) - && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Age)) - return false; - Age o = (Age) other; - return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(units, o.units, true) - && compareValues(system, o.system, true) && compareValues(code, o.code, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) - && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * 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(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Age)) + return false; + Age o = (Age) other; + return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(units, o.units, true) + && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Age)) + return false; + Age o = (Age) other; + return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(units, o.units, true) + && compareValues(system, o.system, true) && compareValues(code, o.code, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) + && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/AllergyIntolerance.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/AllergyIntolerance.java index 94fabbec287..cd7ca034562 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/AllergyIntolerance.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/AllergyIntolerance.java @@ -1,1912 +1,1891 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. - */ -@ResourceDef(name="AllergyIntolerance", profile="http://hl7.org/fhir/Profile/AllergyIntolerance") -public class AllergyIntolerance extends DomainResource { - - public enum AllergyIntoleranceStatus { - /** - * A low level of certainty about the propensity for a reaction to the identified Substance. - */ - UNCONFIRMED, - /** - * A high level of certainty about the propensity for a reaction to the identified Substance, which may include clinical evidence by testing or rechallenge. - */ - CONFIRMED, - /** - * A reaction to the identified Substance has been clinically reassessed by testing or rechallenge and considered to be resolved. - */ - RESOLVED, - /** - * A propensity for a reaction to the identified Substance has been disproven with a high level of clinical certainty, which may include testing or rechallenge, and is refuted. - */ - REFUTED, - /** - * The statement was entered in error and Is not valid. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static AllergyIntoleranceStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("unconfirmed".equals(codeString)) - return UNCONFIRMED; - if ("confirmed".equals(codeString)) - return CONFIRMED; - if ("resolved".equals(codeString)) - return RESOLVED; - if ("refuted".equals(codeString)) - return REFUTED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new Exception("Unknown AllergyIntoleranceStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case UNCONFIRMED: return "unconfirmed"; - case CONFIRMED: return "confirmed"; - case RESOLVED: return "resolved"; - case REFUTED: return "refuted"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case UNCONFIRMED: return ""; - case CONFIRMED: return ""; - case RESOLVED: return ""; - case REFUTED: return ""; - case ENTEREDINERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case UNCONFIRMED: return "A low level of certainty about the propensity for a reaction to the identified Substance."; - case CONFIRMED: return "A high level of certainty about the propensity for a reaction to the identified Substance, which may include clinical evidence by testing or rechallenge."; - case RESOLVED: return "A reaction to the identified Substance has been clinically reassessed by testing or rechallenge and considered to be resolved."; - case REFUTED: return "A propensity for a reaction to the identified Substance has been disproven with a high level of clinical certainty, which may include testing or rechallenge, and is refuted."; - case ENTEREDINERROR: return "The statement was entered in error and Is not valid."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case UNCONFIRMED: return "Unconfirmed"; - case CONFIRMED: return "Confirmed"; - case RESOLVED: return "Resolved"; - case REFUTED: return "Refuted"; - case ENTEREDINERROR: return "Entered In Error"; - default: return "?"; - } - } - } - - public static class AllergyIntoleranceStatusEnumFactory implements EnumFactory { - public AllergyIntoleranceStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("unconfirmed".equals(codeString)) - return AllergyIntoleranceStatus.UNCONFIRMED; - if ("confirmed".equals(codeString)) - return AllergyIntoleranceStatus.CONFIRMED; - if ("resolved".equals(codeString)) - return AllergyIntoleranceStatus.RESOLVED; - if ("refuted".equals(codeString)) - return AllergyIntoleranceStatus.REFUTED; - if ("entered-in-error".equals(codeString)) - return AllergyIntoleranceStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown AllergyIntoleranceStatus code '"+codeString+"'"); - } - public String toCode(AllergyIntoleranceStatus code) { - if (code == AllergyIntoleranceStatus.UNCONFIRMED) - return "unconfirmed"; - if (code == AllergyIntoleranceStatus.CONFIRMED) - return "confirmed"; - if (code == AllergyIntoleranceStatus.RESOLVED) - return "resolved"; - if (code == AllergyIntoleranceStatus.REFUTED) - return "refuted"; - if (code == AllergyIntoleranceStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - } - - public enum AllergyIntoleranceCriticality { - /** - * The potential clinical impact of a future reaction is estimated as low risk: exposure to substance is unlikely to result in a life threatening or organ system threatening outcome. Future exposure to the Substance is considered a relative contra-indication. - */ - LOW, - /** - * The potential clinical impact of a future reaction is estimated as high risk: exposure to substance may result in a life threatening or organ system threatening outcome. Future exposure to the Substance may be considered an absolute contra-indication. - */ - HIGH, - /** - * Unable to assess the potential clinical impact with the information available. - */ - UNASSESSIBLE, - /** - * added to help the parsers - */ - NULL; - public static AllergyIntoleranceCriticality fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("low".equals(codeString)) - return LOW; - if ("high".equals(codeString)) - return HIGH; - if ("unassessible".equals(codeString)) - return UNASSESSIBLE; - throw new Exception("Unknown AllergyIntoleranceCriticality code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case LOW: return "low"; - case HIGH: return "high"; - case UNASSESSIBLE: return "unassessible"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case LOW: return ""; - case HIGH: return ""; - case UNASSESSIBLE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case LOW: return "The potential clinical impact of a future reaction is estimated as low risk: exposure to substance is unlikely to result in a life threatening or organ system threatening outcome. Future exposure to the Substance is considered a relative contra-indication."; - case HIGH: return "The potential clinical impact of a future reaction is estimated as high risk: exposure to substance may result in a life threatening or organ system threatening outcome. Future exposure to the Substance may be considered an absolute contra-indication."; - case UNASSESSIBLE: return "Unable to assess the potential clinical impact with the information available."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case LOW: return "Low Risk"; - case HIGH: return "High Risk"; - case UNASSESSIBLE: return "Unable to determine"; - default: return "?"; - } - } - } - - public static class AllergyIntoleranceCriticalityEnumFactory implements EnumFactory { - public AllergyIntoleranceCriticality fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("low".equals(codeString)) - return AllergyIntoleranceCriticality.LOW; - if ("high".equals(codeString)) - return AllergyIntoleranceCriticality.HIGH; - if ("unassessible".equals(codeString)) - return AllergyIntoleranceCriticality.UNASSESSIBLE; - throw new IllegalArgumentException("Unknown AllergyIntoleranceCriticality code '"+codeString+"'"); - } - public String toCode(AllergyIntoleranceCriticality code) { - if (code == AllergyIntoleranceCriticality.LOW) - return "low"; - if (code == AllergyIntoleranceCriticality.HIGH) - return "high"; - if (code == AllergyIntoleranceCriticality.UNASSESSIBLE) - return "unassessible"; - return "?"; - } - } - - public enum AllergyIntoleranceType { - /** - * Immune mediated reaction, including allergic reactions and hypersensitivities. - */ - IMMUNE, - /** - * A non-immune mediated reaction, which can include pseudoallergic reactions, side effects, intolerances, drug toxicities (eg to Gentamicin), drug-drug interactions, food-drug interactions, and drug-disease interactions. - */ - NONIMMUNE, - /** - * added to help the parsers - */ - NULL; - public static AllergyIntoleranceType fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("immune".equals(codeString)) - return IMMUNE; - if ("non-immune".equals(codeString)) - return NONIMMUNE; - throw new Exception("Unknown AllergyIntoleranceType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case IMMUNE: return "immune"; - case NONIMMUNE: return "non-immune"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case IMMUNE: return ""; - case NONIMMUNE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case IMMUNE: return "Immune mediated reaction, including allergic reactions and hypersensitivities."; - case NONIMMUNE: return "A non-immune mediated reaction, which can include pseudoallergic reactions, side effects, intolerances, drug toxicities (eg to Gentamicin), drug-drug interactions, food-drug interactions, and drug-disease interactions."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case IMMUNE: return "Immune Mediated"; - case NONIMMUNE: return "Non-immune mediated"; - default: return "?"; - } - } - } - - public static class AllergyIntoleranceTypeEnumFactory implements EnumFactory { - public AllergyIntoleranceType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("immune".equals(codeString)) - return AllergyIntoleranceType.IMMUNE; - if ("non-immune".equals(codeString)) - return AllergyIntoleranceType.NONIMMUNE; - throw new IllegalArgumentException("Unknown AllergyIntoleranceType code '"+codeString+"'"); - } - public String toCode(AllergyIntoleranceType code) { - if (code == AllergyIntoleranceType.IMMUNE) - return "immune"; - if (code == AllergyIntoleranceType.NONIMMUNE) - return "non-immune"; - return "?"; - } - } - - public enum AllergyIntoleranceCategory { - /** - * Any substance consumed to provide nutritional support for the body. - */ - FOOD, - /** - * Substances administered to achieve a physiological effect. - */ - MEDICATION, - /** - * Substances that are encountered in the environment. - */ - ENVIRONMENT, - /** - * added to help the parsers - */ - NULL; - public static AllergyIntoleranceCategory fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("food".equals(codeString)) - return FOOD; - if ("medication".equals(codeString)) - return MEDICATION; - if ("environment".equals(codeString)) - return ENVIRONMENT; - throw new Exception("Unknown AllergyIntoleranceCategory code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case FOOD: return "food"; - case MEDICATION: return "medication"; - case ENVIRONMENT: return "environment"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case FOOD: return ""; - case MEDICATION: return ""; - case ENVIRONMENT: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case FOOD: return "Any substance consumed to provide nutritional support for the body."; - case MEDICATION: return "Substances administered to achieve a physiological effect."; - case ENVIRONMENT: return "Substances that are encountered in the environment."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case FOOD: return "Food"; - case MEDICATION: return "Medication"; - case ENVIRONMENT: return "Environment"; - default: return "?"; - } - } - } - - public static class AllergyIntoleranceCategoryEnumFactory implements EnumFactory { - public AllergyIntoleranceCategory fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("food".equals(codeString)) - return AllergyIntoleranceCategory.FOOD; - if ("medication".equals(codeString)) - return AllergyIntoleranceCategory.MEDICATION; - if ("environment".equals(codeString)) - return AllergyIntoleranceCategory.ENVIRONMENT; - throw new IllegalArgumentException("Unknown AllergyIntoleranceCategory code '"+codeString+"'"); - } - public String toCode(AllergyIntoleranceCategory code) { - if (code == AllergyIntoleranceCategory.FOOD) - return "food"; - if (code == AllergyIntoleranceCategory.MEDICATION) - return "medication"; - if (code == AllergyIntoleranceCategory.ENVIRONMENT) - return "environment"; - return "?"; - } - } - - public enum ReactionEventCertainty { - /** - * There is a low level of clinical certainty that the reaction was caused by the identified Substance. - */ - UNLIKELY, - /** - * There is a high level of clinical certainty that the reaction was caused by the identified Substance. - */ - LIKELY, - /** - * There is a very high level of clinical certainty that the reaction was due to the identified Substance, which may include clinical evidence by testing or rechallenge. - */ - CONFIRMED, - /** - * added to help the parsers - */ - NULL; - public static ReactionEventCertainty fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("unlikely".equals(codeString)) - return UNLIKELY; - if ("likely".equals(codeString)) - return LIKELY; - if ("confirmed".equals(codeString)) - return CONFIRMED; - throw new Exception("Unknown ReactionEventCertainty code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case UNLIKELY: return "unlikely"; - case LIKELY: return "likely"; - case CONFIRMED: return "confirmed"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case UNLIKELY: return ""; - case LIKELY: return ""; - case CONFIRMED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case UNLIKELY: return "There is a low level of clinical certainty that the reaction was caused by the identified Substance."; - case LIKELY: return "There is a high level of clinical certainty that the reaction was caused by the identified Substance."; - case CONFIRMED: return "There is a very high level of clinical certainty that the reaction was due to the identified Substance, which may include clinical evidence by testing or rechallenge."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case UNLIKELY: return "Unlikely"; - case LIKELY: return "Likely"; - case CONFIRMED: return "Confirmed"; - default: return "?"; - } - } - } - - public static class ReactionEventCertaintyEnumFactory implements EnumFactory { - public ReactionEventCertainty fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("unlikely".equals(codeString)) - return ReactionEventCertainty.UNLIKELY; - if ("likely".equals(codeString)) - return ReactionEventCertainty.LIKELY; - if ("confirmed".equals(codeString)) - return ReactionEventCertainty.CONFIRMED; - throw new IllegalArgumentException("Unknown ReactionEventCertainty code '"+codeString+"'"); - } - public String toCode(ReactionEventCertainty code) { - if (code == ReactionEventCertainty.UNLIKELY) - return "unlikely"; - if (code == ReactionEventCertainty.LIKELY) - return "likely"; - if (code == ReactionEventCertainty.CONFIRMED) - return "confirmed"; - return "?"; - } - } - - public enum ReactionEventSeverity { - /** - * Causes mild physiological effects. - */ - MILD, - /** - * Causes moderate physiological effects. - */ - MODERATE, - /** - * Causes severe physiological effects. - */ - SEVERE, - /** - * added to help the parsers - */ - NULL; - public static ReactionEventSeverity fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("mild".equals(codeString)) - return MILD; - if ("moderate".equals(codeString)) - return MODERATE; - if ("severe".equals(codeString)) - return SEVERE; - throw new Exception("Unknown ReactionEventSeverity code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case MILD: return "mild"; - case MODERATE: return "moderate"; - case SEVERE: return "severe"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MILD: return ""; - case MODERATE: return ""; - case SEVERE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MILD: return "Causes mild physiological effects."; - case MODERATE: return "Causes moderate physiological effects."; - case SEVERE: return "Causes severe physiological effects."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MILD: return "Mild"; - case MODERATE: return "Moderate"; - case SEVERE: return "Severe"; - default: return "?"; - } - } - } - - public static class ReactionEventSeverityEnumFactory implements EnumFactory { - public ReactionEventSeverity fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("mild".equals(codeString)) - return ReactionEventSeverity.MILD; - if ("moderate".equals(codeString)) - return ReactionEventSeverity.MODERATE; - if ("severe".equals(codeString)) - return ReactionEventSeverity.SEVERE; - throw new IllegalArgumentException("Unknown ReactionEventSeverity code '"+codeString+"'"); - } - public String toCode(ReactionEventSeverity code) { - if (code == ReactionEventSeverity.MILD) - return "mild"; - if (code == ReactionEventSeverity.MODERATE) - return "moderate"; - if (code == ReactionEventSeverity.SEVERE) - return "severe"; - return "?"; - } - } - - @Block() - public static class AllergyIntoleranceEventComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance. - */ - @Child(name = "substance", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Specific substance considered to be responsible for event", formalDefinition="Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance." ) - protected CodeableConcept substance; - - /** - * Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event. - */ - @Child(name = "certainty", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="unlikely | likely | confirmed - clinical certainty about the specific substance", formalDefinition="Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event." ) - protected Enumeration certainty; - - /** - * Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event. - */ - @Child(name = "manifestation", type = {CodeableConcept.class}, order=3, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Clinical symptoms/signs associated with the Event", formalDefinition="Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event." ) - protected List manifestation; - - /** - * Text description about the Reaction as a whole, including details of the manifestation if required. - */ - @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Description of the event as a whole", formalDefinition="Text description about the Reaction as a whole, including details of the manifestation if required." ) - protected StringType description; - - /** - * Record of the date and/or time of the onset of the Reaction. - */ - @Child(name = "onset", type = {DateTimeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Date(/time) when manifestations showed", formalDefinition="Record of the date and/or time of the onset of the Reaction." ) - protected DateTimeType onset; - - /** - * The amount of time that the Adverse Reaction persisted. - */ - @Child(name = "duration", type = {Duration.class}, order=6, min=0, max=1) - @Description(shortDefinition="How long Manifestations persisted", formalDefinition="The amount of time that the Adverse Reaction persisted." ) - protected Duration duration; - - /** - * Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. - */ - @Child(name = "severity", type = {CodeType.class}, order=7, min=0, max=1) - @Description(shortDefinition="mild | moderate | severe (of event as a whole)", formalDefinition="Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations." ) - protected Enumeration severity; - - /** - * Identification of the route by which the subject was exposed to the substance. - */ - @Child(name = "exposureRoute", type = {CodeableConcept.class}, order=8, min=0, max=1) - @Description(shortDefinition="How the subject was exposed to the substance", formalDefinition="Identification of the route by which the subject was exposed to the substance." ) - protected CodeableConcept exposureRoute; - - /** - * Additional text about the Adverse Reaction event not captured in other fields. - */ - @Child(name = "comment", type = {StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Text about event not captured in other fields", formalDefinition="Additional text about the Adverse Reaction event not captured in other fields." ) - protected StringType comment; - - private static final long serialVersionUID = -1773271720L; - - /* - * Constructor - */ - public AllergyIntoleranceEventComponent() { - super(); - } - - /** - * @return {@link #substance} (Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance.) - */ - public CodeableConcept getSubstance() { - if (this.substance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.substance"); - else if (Configuration.doAutoCreate()) - this.substance = new CodeableConcept(); // cc - return this.substance; - } - - public boolean hasSubstance() { - return this.substance != null && !this.substance.isEmpty(); - } - - /** - * @param value {@link #substance} (Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance.) - */ - public AllergyIntoleranceEventComponent setSubstance(CodeableConcept value) { - this.substance = value; - return this; - } - - /** - * @return {@link #certainty} (Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event.). This is the underlying object with id, value and extensions. The accessor "getCertainty" gives direct access to the value - */ - public Enumeration getCertaintyElement() { - if (this.certainty == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.certainty"); - else if (Configuration.doAutoCreate()) - this.certainty = new Enumeration(new ReactionEventCertaintyEnumFactory()); // bb - return this.certainty; - } - - public boolean hasCertaintyElement() { - return this.certainty != null && !this.certainty.isEmpty(); - } - - public boolean hasCertainty() { - return this.certainty != null && !this.certainty.isEmpty(); - } - - /** - * @param value {@link #certainty} (Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event.). This is the underlying object with id, value and extensions. The accessor "getCertainty" gives direct access to the value - */ - public AllergyIntoleranceEventComponent setCertaintyElement(Enumeration value) { - this.certainty = value; - return this; - } - - /** - * @return Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event. - */ - public ReactionEventCertainty getCertainty() { - return this.certainty == null ? null : this.certainty.getValue(); - } - - /** - * @param value Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event. - */ - public AllergyIntoleranceEventComponent setCertainty(ReactionEventCertainty value) { - if (value == null) - this.certainty = null; - else { - if (this.certainty == null) - this.certainty = new Enumeration(new ReactionEventCertaintyEnumFactory()); - this.certainty.setValue(value); - } - return this; - } - - /** - * @return {@link #manifestation} (Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event.) - */ - public List getManifestation() { - if (this.manifestation == null) - this.manifestation = new ArrayList(); - return this.manifestation; - } - - public boolean hasManifestation() { - if (this.manifestation == null) - return false; - for (CodeableConcept item : this.manifestation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #manifestation} (Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event.) - */ - // syntactic sugar - public CodeableConcept addManifestation() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.manifestation == null) - this.manifestation = new ArrayList(); - this.manifestation.add(t); - return t; - } - - // syntactic sugar - public AllergyIntoleranceEventComponent addManifestation(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.manifestation == null) - this.manifestation = new ArrayList(); - this.manifestation.add(t); - return this; - } - - /** - * @return {@link #description} (Text description about the Reaction as a whole, including details of the manifestation if required.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Text description about the Reaction as a whole, including details of the manifestation if required.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public AllergyIntoleranceEventComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Text description about the Reaction as a whole, including details of the manifestation if required. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Text description about the Reaction as a whole, including details of the manifestation if required. - */ - public AllergyIntoleranceEventComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #onset} (Record of the date and/or time of the onset of the Reaction.). This is the underlying object with id, value and extensions. The accessor "getOnset" gives direct access to the value - */ - public DateTimeType getOnsetElement() { - if (this.onset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.onset"); - else if (Configuration.doAutoCreate()) - this.onset = new DateTimeType(); // bb - return this.onset; - } - - public boolean hasOnsetElement() { - return this.onset != null && !this.onset.isEmpty(); - } - - public boolean hasOnset() { - return this.onset != null && !this.onset.isEmpty(); - } - - /** - * @param value {@link #onset} (Record of the date and/or time of the onset of the Reaction.). This is the underlying object with id, value and extensions. The accessor "getOnset" gives direct access to the value - */ - public AllergyIntoleranceEventComponent setOnsetElement(DateTimeType value) { - this.onset = value; - return this; - } - - /** - * @return Record of the date and/or time of the onset of the Reaction. - */ - public Date getOnset() { - return this.onset == null ? null : this.onset.getValue(); - } - - /** - * @param value Record of the date and/or time of the onset of the Reaction. - */ - public AllergyIntoleranceEventComponent setOnset(Date value) { - if (value == null) - this.onset = null; - else { - if (this.onset == null) - this.onset = new DateTimeType(); - this.onset.setValue(value); - } - return this; - } - - /** - * @return {@link #duration} (The amount of time that the Adverse Reaction persisted.) - */ - public Duration getDuration() { - if (this.duration == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.duration"); - else if (Configuration.doAutoCreate()) - this.duration = new Duration(); // cc - return this.duration; - } - - public boolean hasDuration() { - return this.duration != null && !this.duration.isEmpty(); - } - - /** - * @param value {@link #duration} (The amount of time that the Adverse Reaction persisted.) - */ - public AllergyIntoleranceEventComponent setDuration(Duration value) { - this.duration = value; - return this; - } - - /** - * @return {@link #severity} (Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public Enumeration getSeverityElement() { - if (this.severity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.severity"); - else if (Configuration.doAutoCreate()) - this.severity = new Enumeration(new ReactionEventSeverityEnumFactory()); // bb - return this.severity; - } - - public boolean hasSeverityElement() { - return this.severity != null && !this.severity.isEmpty(); - } - - public boolean hasSeverity() { - return this.severity != null && !this.severity.isEmpty(); - } - - /** - * @param value {@link #severity} (Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public AllergyIntoleranceEventComponent setSeverityElement(Enumeration value) { - this.severity = value; - return this; - } - - /** - * @return Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. - */ - public ReactionEventSeverity getSeverity() { - return this.severity == null ? null : this.severity.getValue(); - } - - /** - * @param value Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. - */ - public AllergyIntoleranceEventComponent setSeverity(ReactionEventSeverity value) { - if (value == null) - this.severity = null; - else { - if (this.severity == null) - this.severity = new Enumeration(new ReactionEventSeverityEnumFactory()); - this.severity.setValue(value); - } - return this; - } - - /** - * @return {@link #exposureRoute} (Identification of the route by which the subject was exposed to the substance.) - */ - public CodeableConcept getExposureRoute() { - if (this.exposureRoute == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.exposureRoute"); - else if (Configuration.doAutoCreate()) - this.exposureRoute = new CodeableConcept(); // cc - return this.exposureRoute; - } - - public boolean hasExposureRoute() { - return this.exposureRoute != null && !this.exposureRoute.isEmpty(); - } - - /** - * @param value {@link #exposureRoute} (Identification of the route by which the subject was exposed to the substance.) - */ - public AllergyIntoleranceEventComponent setExposureRoute(CodeableConcept value) { - this.exposureRoute = value; - return this; - } - - /** - * @return {@link #comment} (Additional text about the Adverse Reaction event not captured in other fields.). 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 AllergyIntoleranceEventComponent.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); // bb - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (Additional text about the Adverse Reaction event not captured in other fields.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public AllergyIntoleranceEventComponent setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return Additional text about the Adverse Reaction event not captured in other fields. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value Additional text about the Adverse Reaction event not captured in other fields. - */ - public AllergyIntoleranceEventComponent setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("substance", "CodeableConcept", "Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance.", 0, java.lang.Integer.MAX_VALUE, substance)); - childrenList.add(new Property("certainty", "code", "Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event.", 0, java.lang.Integer.MAX_VALUE, certainty)); - childrenList.add(new Property("manifestation", "CodeableConcept", "Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event.", 0, java.lang.Integer.MAX_VALUE, manifestation)); - childrenList.add(new Property("description", "string", "Text description about the Reaction as a whole, including details of the manifestation if required.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("onset", "dateTime", "Record of the date and/or time of the onset of the Reaction.", 0, java.lang.Integer.MAX_VALUE, onset)); - childrenList.add(new Property("duration", "Duration", "The amount of time that the Adverse Reaction persisted.", 0, java.lang.Integer.MAX_VALUE, duration)); - childrenList.add(new Property("severity", "code", "Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.", 0, java.lang.Integer.MAX_VALUE, severity)); - childrenList.add(new Property("exposureRoute", "CodeableConcept", "Identification of the route by which the subject was exposed to the substance.", 0, java.lang.Integer.MAX_VALUE, exposureRoute)); - childrenList.add(new Property("comment", "string", "Additional text about the Adverse Reaction event not captured in other fields.", 0, java.lang.Integer.MAX_VALUE, comment)); - } - - public AllergyIntoleranceEventComponent copy() { - AllergyIntoleranceEventComponent dst = new AllergyIntoleranceEventComponent(); - copyValues(dst); - dst.substance = substance == null ? null : substance.copy(); - dst.certainty = certainty == null ? null : certainty.copy(); - if (manifestation != null) { - dst.manifestation = new ArrayList(); - for (CodeableConcept i : manifestation) - dst.manifestation.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - dst.onset = onset == null ? null : onset.copy(); - dst.duration = duration == null ? null : duration.copy(); - dst.severity = severity == null ? null : severity.copy(); - dst.exposureRoute = exposureRoute == null ? null : exposureRoute.copy(); - dst.comment = comment == null ? null : comment.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AllergyIntoleranceEventComponent)) - return false; - AllergyIntoleranceEventComponent o = (AllergyIntoleranceEventComponent) other; - return compareDeep(substance, o.substance, true) && compareDeep(certainty, o.certainty, true) && compareDeep(manifestation, o.manifestation, true) - && compareDeep(description, o.description, true) && compareDeep(onset, o.onset, true) && compareDeep(duration, o.duration, true) - && compareDeep(severity, o.severity, true) && compareDeep(exposureRoute, o.exposureRoute, true) - && compareDeep(comment, o.comment, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AllergyIntoleranceEventComponent)) - return false; - AllergyIntoleranceEventComponent o = (AllergyIntoleranceEventComponent) other; - return compareValues(certainty, o.certainty, true) && compareValues(description, o.description, true) - && compareValues(onset, o.onset, true) && compareValues(severity, o.severity, true) && compareValues(comment, o.comment, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (substance == null || substance.isEmpty()) && (certainty == null || certainty.isEmpty()) - && (manifestation == null || manifestation.isEmpty()) && (description == null || description.isEmpty()) - && (onset == null || onset.isEmpty()) && (duration == null || duration.isEmpty()) && (severity == null || severity.isEmpty()) - && (exposureRoute == null || exposureRoute.isEmpty()) && (comment == null || comment.isEmpty()) - ; - } - - } - - /** - * This records identifiers associated with this allergy/intolerance concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External Ids for this item", formalDefinition="This records identifiers associated with this allergy/intolerance concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) - protected List identifier; - - /** - * Date when the sensitivity was recorded. - */ - @Child(name = "recordedDate", type = {DateTimeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="When recorded", formalDefinition="Date when the sensitivity was recorded." ) - protected DateTimeType recordedDate; - - /** - * Individual who recorded the record and takes responsibility for its conten. - */ - @Child(name = "recorder", type = {Practitioner.class, Patient.class}, order=2, min=0, max=1) - @Description(shortDefinition="Who recorded the sensitivity", formalDefinition="Individual who recorded the record and takes responsibility for its conten." ) - protected Reference recorder; - - /** - * The actual object that is the target of the reference (Individual who recorded the record and takes responsibility for its conten.) - */ - protected Resource recorderTarget; - - /** - * The patient who has the allergy or intolerance. - */ - @Child(name = "patient", type = {Patient.class}, order=3, min=1, max=1) - @Description(shortDefinition="Who the sensitivity is for", formalDefinition="The patient who has the allergy or intolerance." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient who has the allergy or intolerance.) - */ - protected Patient patientTarget; - - /** - * The source of the information about the allergy that is recorded. - */ - @Child(name = "reporter", type = {Patient.class, RelatedPerson.class, Practitioner.class}, order=4, min=0, max=1) - @Description(shortDefinition="Source of the information about the allergy", formalDefinition="The source of the information about the allergy that is recorded." ) - protected Reference reporter; - - /** - * The actual object that is the target of the reference (The source of the information about the allergy that is recorded.) - */ - protected Resource reporterTarget; - - /** - * Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk. - */ - @Child(name = "substance", type = {CodeableConcept.class}, order=5, min=1, max=1) - @Description(shortDefinition="Substance, (or class) considered to be responsible for risk", formalDefinition="Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk." ) - protected CodeableConcept substance; - - /** - * Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance. - */ - @Child(name = "status", type = {CodeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="unconfirmed | confirmed | resolved | refuted | entered-in-error", formalDefinition="Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance." ) - protected Enumeration status; - - /** - * Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance. - */ - @Child(name = "criticality", type = {CodeType.class}, order=7, min=0, max=1) - @Description(shortDefinition="low | high | unassessible - Estimated potential clinical harm", formalDefinition="Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance." ) - protected Enumeration criticality; - - /** - * Identification of the underlying physiological mechanism for the Reaction Risk. - */ - @Child(name = "type", type = {CodeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="immune | non-immune - Underlying mechanism (if known)", formalDefinition="Identification of the underlying physiological mechanism for the Reaction Risk." ) - protected Enumeration type; - - /** - * Category of the identified Substance. - */ - @Child(name = "category", type = {CodeType.class}, order=9, min=0, max=1) - @Description(shortDefinition="food | medication | environment - Category of Substance", formalDefinition="Category of the identified Substance." ) - protected Enumeration category; - - /** - * Represents the date and/or time of the last known occurence of a reaction event. - */ - @Child(name = "lastOccurence", type = {DateTimeType.class}, order=10, min=0, max=1) - @Description(shortDefinition="Date(/time) of last known occurence of a reaction", formalDefinition="Represents the date and/or time of the last known occurence of a reaction event." ) - protected DateTimeType lastOccurence; - - /** - * Additional narrative about the propensity for the Adverse Reaction, not captured in other fields. - */ - @Child(name = "comment", type = {StringType.class}, order=11, min=0, max=1) - @Description(shortDefinition="Additional text not captured in other fields", formalDefinition="Additional narrative about the propensity for the Adverse Reaction, not captured in other fields." ) - protected StringType comment; - - /** - * Details about each Adverse Reaction Event linked to exposure to the identified Substance. - */ - @Child(name = "event", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Adverse Reaction Events linked to exposure to substance", formalDefinition="Details about each Adverse Reaction Event linked to exposure to the identified Substance." ) - protected List event; - - private static final long serialVersionUID = 410225544L; - - /* - * Constructor - */ - public AllergyIntolerance() { - super(); - } - - /* - * Constructor - */ - public AllergyIntolerance(Reference patient, CodeableConcept substance) { - super(); - this.patient = patient; - this.substance = substance; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this allergy/intolerance concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this allergy/intolerance concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public AllergyIntolerance addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #recordedDate} (Date when the sensitivity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedDate" gives direct access to the value - */ - public DateTimeType getRecordedDateElement() { - if (this.recordedDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.recordedDate"); - else if (Configuration.doAutoCreate()) - this.recordedDate = new DateTimeType(); // bb - return this.recordedDate; - } - - public boolean hasRecordedDateElement() { - return this.recordedDate != null && !this.recordedDate.isEmpty(); - } - - public boolean hasRecordedDate() { - return this.recordedDate != null && !this.recordedDate.isEmpty(); - } - - /** - * @param value {@link #recordedDate} (Date when the sensitivity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedDate" gives direct access to the value - */ - public AllergyIntolerance setRecordedDateElement(DateTimeType value) { - this.recordedDate = value; - return this; - } - - /** - * @return Date when the sensitivity was recorded. - */ - public Date getRecordedDate() { - return this.recordedDate == null ? null : this.recordedDate.getValue(); - } - - /** - * @param value Date when the sensitivity was recorded. - */ - public AllergyIntolerance setRecordedDate(Date value) { - if (value == null) - this.recordedDate = null; - else { - if (this.recordedDate == null) - this.recordedDate = new DateTimeType(); - this.recordedDate.setValue(value); - } - return this; - } - - /** - * @return {@link #recorder} (Individual who recorded the record and takes responsibility for its conten.) - */ - public Reference getRecorder() { - if (this.recorder == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.recorder"); - else if (Configuration.doAutoCreate()) - this.recorder = new Reference(); // cc - return this.recorder; - } - - public boolean hasRecorder() { - return this.recorder != null && !this.recorder.isEmpty(); - } - - /** - * @param value {@link #recorder} (Individual who recorded the record and takes responsibility for its conten.) - */ - public AllergyIntolerance setRecorder(Reference value) { - this.recorder = value; - return this; - } - - /** - * @return {@link #recorder} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Individual who recorded the record and takes responsibility for its conten.) - */ - public Resource getRecorderTarget() { - return this.recorderTarget; - } - - /** - * @param value {@link #recorder} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Individual who recorded the record and takes responsibility for its conten.) - */ - public AllergyIntolerance setRecorderTarget(Resource value) { - this.recorderTarget = value; - return this; - } - - /** - * @return {@link #patient} (The patient who has the allergy or intolerance.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The patient who has the allergy or intolerance.) - */ - public AllergyIntolerance setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who has the allergy or intolerance.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who has the allergy or intolerance.) - */ - public AllergyIntolerance setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #reporter} (The source of the information about the allergy that is recorded.) - */ - public Reference getReporter() { - if (this.reporter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.reporter"); - else if (Configuration.doAutoCreate()) - this.reporter = new Reference(); // cc - return this.reporter; - } - - public boolean hasReporter() { - return this.reporter != null && !this.reporter.isEmpty(); - } - - /** - * @param value {@link #reporter} (The source of the information about the allergy that is recorded.) - */ - public AllergyIntolerance setReporter(Reference value) { - this.reporter = value; - return this; - } - - /** - * @return {@link #reporter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The source of the information about the allergy that is recorded.) - */ - public Resource getReporterTarget() { - return this.reporterTarget; - } - - /** - * @param value {@link #reporter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The source of the information about the allergy that is recorded.) - */ - public AllergyIntolerance setReporterTarget(Resource value) { - this.reporterTarget = value; - return this; - } - - /** - * @return {@link #substance} (Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk.) - */ - public CodeableConcept getSubstance() { - if (this.substance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.substance"); - else if (Configuration.doAutoCreate()) - this.substance = new CodeableConcept(); // cc - return this.substance; - } - - public boolean hasSubstance() { - return this.substance != null && !this.substance.isEmpty(); - } - - /** - * @param value {@link #substance} (Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk.) - */ - public AllergyIntolerance setSubstance(CodeableConcept value) { - this.substance = value; - return this; - } - - /** - * @return {@link #status} (Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new AllergyIntoleranceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public AllergyIntolerance setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance. - */ - public AllergyIntoleranceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance. - */ - public AllergyIntolerance setStatus(AllergyIntoleranceStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new AllergyIntoleranceStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #criticality} (Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCriticality" gives direct access to the value - */ - public Enumeration getCriticalityElement() { - if (this.criticality == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.criticality"); - else if (Configuration.doAutoCreate()) - this.criticality = new Enumeration(new AllergyIntoleranceCriticalityEnumFactory()); // bb - return this.criticality; - } - - public boolean hasCriticalityElement() { - return this.criticality != null && !this.criticality.isEmpty(); - } - - public boolean hasCriticality() { - return this.criticality != null && !this.criticality.isEmpty(); - } - - /** - * @param value {@link #criticality} (Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCriticality" gives direct access to the value - */ - public AllergyIntolerance setCriticalityElement(Enumeration value) { - this.criticality = value; - return this; - } - - /** - * @return Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance. - */ - public AllergyIntoleranceCriticality getCriticality() { - return this.criticality == null ? null : this.criticality.getValue(); - } - - /** - * @param value Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance. - */ - public AllergyIntolerance setCriticality(AllergyIntoleranceCriticality value) { - if (value == null) - this.criticality = null; - else { - if (this.criticality == null) - this.criticality = new Enumeration(new AllergyIntoleranceCriticalityEnumFactory()); - this.criticality.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (Identification of the underlying physiological mechanism for the Reaction Risk.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new AllergyIntoleranceTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Identification of the underlying physiological mechanism for the Reaction Risk.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public AllergyIntolerance setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Identification of the underlying physiological mechanism for the Reaction Risk. - */ - public AllergyIntoleranceType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Identification of the underlying physiological mechanism for the Reaction Risk. - */ - public AllergyIntolerance setType(AllergyIntoleranceType value) { - if (value == null) - this.type = null; - else { - if (this.type == null) - this.type = new Enumeration(new AllergyIntoleranceTypeEnumFactory()); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #category} (Category of the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public Enumeration getCategoryElement() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.category"); - else if (Configuration.doAutoCreate()) - this.category = new Enumeration(new AllergyIntoleranceCategoryEnumFactory()); // bb - return this.category; - } - - public boolean hasCategoryElement() { - return this.category != null && !this.category.isEmpty(); - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Category of the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public AllergyIntolerance setCategoryElement(Enumeration value) { - this.category = value; - return this; - } - - /** - * @return Category of the identified Substance. - */ - public AllergyIntoleranceCategory getCategory() { - return this.category == null ? null : this.category.getValue(); - } - - /** - * @param value Category of the identified Substance. - */ - public AllergyIntolerance setCategory(AllergyIntoleranceCategory value) { - if (value == null) - this.category = null; - else { - if (this.category == null) - this.category = new Enumeration(new AllergyIntoleranceCategoryEnumFactory()); - this.category.setValue(value); - } - return this; - } - - /** - * @return {@link #lastOccurence} (Represents the date and/or time of the last known occurence of a reaction event.). This is the underlying object with id, value and extensions. The accessor "getLastOccurence" gives direct access to the value - */ - public DateTimeType getLastOccurenceElement() { - if (this.lastOccurence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.lastOccurence"); - else if (Configuration.doAutoCreate()) - this.lastOccurence = new DateTimeType(); // bb - return this.lastOccurence; - } - - public boolean hasLastOccurenceElement() { - return this.lastOccurence != null && !this.lastOccurence.isEmpty(); - } - - public boolean hasLastOccurence() { - return this.lastOccurence != null && !this.lastOccurence.isEmpty(); - } - - /** - * @param value {@link #lastOccurence} (Represents the date and/or time of the last known occurence of a reaction event.). This is the underlying object with id, value and extensions. The accessor "getLastOccurence" gives direct access to the value - */ - public AllergyIntolerance setLastOccurenceElement(DateTimeType value) { - this.lastOccurence = value; - return this; - } - - /** - * @return Represents the date and/or time of the last known occurence of a reaction event. - */ - public Date getLastOccurence() { - return this.lastOccurence == null ? null : this.lastOccurence.getValue(); - } - - /** - * @param value Represents the date and/or time of the last known occurence of a reaction event. - */ - public AllergyIntolerance setLastOccurence(Date value) { - if (value == null) - this.lastOccurence = null; - else { - if (this.lastOccurence == null) - this.lastOccurence = new DateTimeType(); - this.lastOccurence.setValue(value); - } - return this; - } - - /** - * @return {@link #comment} (Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.). 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 AllergyIntolerance.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); // bb - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public AllergyIntolerance setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return Additional narrative about the propensity for the Adverse Reaction, not captured in other fields. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value Additional narrative about the propensity for the Adverse Reaction, not captured in other fields. - */ - public AllergyIntolerance 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 #event} (Details about each Adverse Reaction Event linked to exposure to the identified Substance.) - */ - public List getEvent() { - if (this.event == null) - this.event = new ArrayList(); - return this.event; - } - - public boolean hasEvent() { - if (this.event == null) - return false; - for (AllergyIntoleranceEventComponent item : this.event) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #event} (Details about each Adverse Reaction Event linked to exposure to the identified Substance.) - */ - // syntactic sugar - public AllergyIntoleranceEventComponent addEvent() { //3 - AllergyIntoleranceEventComponent t = new AllergyIntoleranceEventComponent(); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return t; - } - - // syntactic sugar - public AllergyIntolerance addEvent(AllergyIntoleranceEventComponent t) { //3 - if (t == null) - return this; - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this allergy/intolerance concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("recordedDate", "dateTime", "Date when the sensitivity was recorded.", 0, java.lang.Integer.MAX_VALUE, recordedDate)); - childrenList.add(new Property("recorder", "Reference(Practitioner|Patient)", "Individual who recorded the record and takes responsibility for its conten.", 0, java.lang.Integer.MAX_VALUE, recorder)); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient who has the allergy or intolerance.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("reporter", "Reference(Patient|RelatedPerson|Practitioner)", "The source of the information about the allergy that is recorded.", 0, java.lang.Integer.MAX_VALUE, reporter)); - childrenList.add(new Property("substance", "CodeableConcept", "Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk.", 0, java.lang.Integer.MAX_VALUE, substance)); - childrenList.add(new Property("status", "code", "Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("criticality", "code", "Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance.", 0, java.lang.Integer.MAX_VALUE, criticality)); - childrenList.add(new Property("type", "code", "Identification of the underlying physiological mechanism for the Reaction Risk.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("category", "code", "Category of the identified Substance.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("lastOccurence", "dateTime", "Represents the date and/or time of the last known occurence of a reaction event.", 0, java.lang.Integer.MAX_VALUE, lastOccurence)); - childrenList.add(new Property("comment", "string", "Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.", 0, java.lang.Integer.MAX_VALUE, comment)); - childrenList.add(new Property("event", "", "Details about each Adverse Reaction Event linked to exposure to the identified Substance.", 0, java.lang.Integer.MAX_VALUE, event)); - } - - public AllergyIntolerance copy() { - AllergyIntolerance dst = new AllergyIntolerance(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.recordedDate = recordedDate == null ? null : recordedDate.copy(); - dst.recorder = recorder == null ? null : recorder.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.reporter = reporter == null ? null : reporter.copy(); - dst.substance = substance == null ? null : substance.copy(); - dst.status = status == null ? null : status.copy(); - dst.criticality = criticality == null ? null : criticality.copy(); - dst.type = type == null ? null : type.copy(); - dst.category = category == null ? null : category.copy(); - dst.lastOccurence = lastOccurence == null ? null : lastOccurence.copy(); - dst.comment = comment == null ? null : comment.copy(); - if (event != null) { - dst.event = new ArrayList(); - for (AllergyIntoleranceEventComponent i : event) - dst.event.add(i.copy()); - }; - return dst; - } - - protected AllergyIntolerance typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AllergyIntolerance)) - return false; - AllergyIntolerance o = (AllergyIntolerance) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(recordedDate, o.recordedDate, true) - && compareDeep(recorder, o.recorder, true) && compareDeep(patient, o.patient, true) && compareDeep(reporter, o.reporter, true) - && compareDeep(substance, o.substance, true) && compareDeep(status, o.status, true) && compareDeep(criticality, o.criticality, true) - && compareDeep(type, o.type, true) && compareDeep(category, o.category, true) && compareDeep(lastOccurence, o.lastOccurence, true) - && compareDeep(comment, o.comment, true) && compareDeep(event, o.event, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AllergyIntolerance)) - return false; - AllergyIntolerance o = (AllergyIntolerance) other; - return compareValues(recordedDate, o.recordedDate, true) && compareValues(status, o.status, true) && compareValues(criticality, o.criticality, true) - && compareValues(type, o.type, true) && compareValues(category, o.category, true) && compareValues(lastOccurence, o.lastOccurence, true) - && compareValues(comment, o.comment, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (recordedDate == null || recordedDate.isEmpty()) - && (recorder == null || recorder.isEmpty()) && (patient == null || patient.isEmpty()) && (reporter == null || reporter.isEmpty()) - && (substance == null || substance.isEmpty()) && (status == null || status.isEmpty()) && (criticality == null || criticality.isEmpty()) - && (type == null || type.isEmpty()) && (category == null || category.isEmpty()) && (lastOccurence == null || lastOccurence.isEmpty()) - && (comment == null || comment.isEmpty()) && (event == null || event.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.AllergyIntolerance; - } - - @SearchParamDefinition(name="status", path="AllergyIntolerance.status", description="unconfirmed | confirmed | resolved | refuted | entered-in-error", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="onset", path="AllergyIntolerance.event.onset", description="Date(/time) when manifestations showed", type="date" ) - public static final String SP_ONSET = "onset"; - @SearchParamDefinition(name="last-date", path="AllergyIntolerance.lastOccurence", description="Date(/time) of last known occurence of a reaction", type="date" ) - public static final String SP_LASTDATE = "last-date"; - @SearchParamDefinition(name="severity", path="AllergyIntolerance.event.severity", description="mild | moderate | severe (of event as a whole)", type="token" ) - public static final String SP_SEVERITY = "severity"; - @SearchParamDefinition(name="date", path="AllergyIntolerance.recordedDate", description="When recorded", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="type", path="AllergyIntolerance.type", description="immune | non-immune - Underlying mechanism (if known)", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="reporter", path="AllergyIntolerance.reporter", description="Source of the information about the allergy", type="reference" ) - public static final String SP_REPORTER = "reporter"; - @SearchParamDefinition(name="substance", path="AllergyIntolerance.substance|AllergyIntolerance.event.substance", description="Substance, (or class) considered to be responsible for risk", type="token" ) - public static final String SP_SUBSTANCE = "substance"; - @SearchParamDefinition(name="criticality", path="AllergyIntolerance.criticality", description="low | high | unassessible - Estimated potential clinical harm", type="token" ) - public static final String SP_CRITICALITY = "criticality"; - @SearchParamDefinition(name="category", path="AllergyIntolerance.category", description="food | medication | environment - Category of Substance", type="token" ) - public static final String SP_CATEGORY = "category"; - @SearchParamDefinition(name="duration", path="AllergyIntolerance.event.duration", description="How long Manifestations persisted", type="quantity" ) - public static final String SP_DURATION = "duration"; - @SearchParamDefinition(name="patient", path="AllergyIntolerance.patient", description="Who the sensitivity is for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="recorder", path="AllergyIntolerance.recorder", description="Who recorded the sensitivity", type="reference" ) - public static final String SP_RECORDER = "recorder"; - @SearchParamDefinition(name="route", path="AllergyIntolerance.event.exposureRoute", description="How the subject was exposed to the substance", type="token" ) - public static final String SP_ROUTE = "route"; - @SearchParamDefinition(name="identifier", path="AllergyIntolerance.identifier", description="External Ids for this item", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="manifestation", path="AllergyIntolerance.event.manifestation", description="Clinical symptoms/signs associated with the Event", type="token" ) - public static final String SP_MANIFESTATION = "manifestation"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. + */ +@ResourceDef(name="AllergyIntolerance", profile="http://hl7.org/fhir/Profile/AllergyIntolerance") +public class AllergyIntolerance extends DomainResource { + + public enum AllergyIntoleranceStatus { + /** + * A low level of certainty about the propensity for a reaction to the identified Substance. + */ + UNCONFIRMED, + /** + * A high level of certainty about the propensity for a reaction to the identified Substance, which may include clinical evidence by testing or rechallenge. + */ + CONFIRMED, + /** + * A reaction to the identified Substance has been clinically reassessed by testing or rechallenge and considered to be resolved. + */ + RESOLVED, + /** + * A propensity for a reaction to the identified Substance has been disproven with a high level of clinical certainty, which may include testing or rechallenge, and is refuted. + */ + REFUTED, + /** + * The statement was entered in error and Is not valid. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static AllergyIntoleranceStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("unconfirmed".equals(codeString)) + return UNCONFIRMED; + if ("confirmed".equals(codeString)) + return CONFIRMED; + if ("resolved".equals(codeString)) + return RESOLVED; + if ("refuted".equals(codeString)) + return REFUTED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new Exception("Unknown AllergyIntoleranceStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case UNCONFIRMED: return "unconfirmed"; + case CONFIRMED: return "confirmed"; + case RESOLVED: return "resolved"; + case REFUTED: return "refuted"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case UNCONFIRMED: return ""; + case CONFIRMED: return ""; + case RESOLVED: return ""; + case REFUTED: return ""; + case ENTEREDINERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case UNCONFIRMED: return "A low level of certainty about the propensity for a reaction to the identified Substance."; + case CONFIRMED: return "A high level of certainty about the propensity for a reaction to the identified Substance, which may include clinical evidence by testing or rechallenge."; + case RESOLVED: return "A reaction to the identified Substance has been clinically reassessed by testing or rechallenge and considered to be resolved."; + case REFUTED: return "A propensity for a reaction to the identified Substance has been disproven with a high level of clinical certainty, which may include testing or rechallenge, and is refuted."; + case ENTEREDINERROR: return "The statement was entered in error and Is not valid."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case UNCONFIRMED: return "Unconfirmed"; + case CONFIRMED: return "Confirmed"; + case RESOLVED: return "Resolved"; + case REFUTED: return "Refuted"; + case ENTEREDINERROR: return "Entered In Error"; + default: return "?"; + } + } + } + + public static class AllergyIntoleranceStatusEnumFactory implements EnumFactory { + public AllergyIntoleranceStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("unconfirmed".equals(codeString)) + return AllergyIntoleranceStatus.UNCONFIRMED; + if ("confirmed".equals(codeString)) + return AllergyIntoleranceStatus.CONFIRMED; + if ("resolved".equals(codeString)) + return AllergyIntoleranceStatus.RESOLVED; + if ("refuted".equals(codeString)) + return AllergyIntoleranceStatus.REFUTED; + if ("entered-in-error".equals(codeString)) + return AllergyIntoleranceStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown AllergyIntoleranceStatus code '"+codeString+"'"); + } + public String toCode(AllergyIntoleranceStatus code) { + if (code == AllergyIntoleranceStatus.UNCONFIRMED) + return "unconfirmed"; + if (code == AllergyIntoleranceStatus.CONFIRMED) + return "confirmed"; + if (code == AllergyIntoleranceStatus.RESOLVED) + return "resolved"; + if (code == AllergyIntoleranceStatus.REFUTED) + return "refuted"; + if (code == AllergyIntoleranceStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + } + + public enum AllergyIntoleranceCriticality { + /** + * The potential clinical impact of a future reaction is estimated as low risk: exposure to substance is unlikely to result in a life threatening or organ system threatening outcome. Future exposure to the Substance is considered a relative contra-indication. + */ + LOW, + /** + * The potential clinical impact of a future reaction is estimated as high risk: exposure to substance may result in a life threatening or organ system threatening outcome. Future exposure to the Substance may be considered an absolute contra-indication. + */ + HIGH, + /** + * Unable to assess the potential clinical impact with the information available. + */ + UNASSESSIBLE, + /** + * added to help the parsers + */ + NULL; + public static AllergyIntoleranceCriticality fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("low".equals(codeString)) + return LOW; + if ("high".equals(codeString)) + return HIGH; + if ("unassessible".equals(codeString)) + return UNASSESSIBLE; + throw new Exception("Unknown AllergyIntoleranceCriticality code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case LOW: return "low"; + case HIGH: return "high"; + case UNASSESSIBLE: return "unassessible"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case LOW: return ""; + case HIGH: return ""; + case UNASSESSIBLE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case LOW: return "The potential clinical impact of a future reaction is estimated as low risk: exposure to substance is unlikely to result in a life threatening or organ system threatening outcome. Future exposure to the Substance is considered a relative contra-indication."; + case HIGH: return "The potential clinical impact of a future reaction is estimated as high risk: exposure to substance may result in a life threatening or organ system threatening outcome. Future exposure to the Substance may be considered an absolute contra-indication."; + case UNASSESSIBLE: return "Unable to assess the potential clinical impact with the information available."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case LOW: return "Low Risk"; + case HIGH: return "High Risk"; + case UNASSESSIBLE: return "Unable to determine"; + default: return "?"; + } + } + } + + public static class AllergyIntoleranceCriticalityEnumFactory implements EnumFactory { + public AllergyIntoleranceCriticality fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("low".equals(codeString)) + return AllergyIntoleranceCriticality.LOW; + if ("high".equals(codeString)) + return AllergyIntoleranceCriticality.HIGH; + if ("unassessible".equals(codeString)) + return AllergyIntoleranceCriticality.UNASSESSIBLE; + throw new IllegalArgumentException("Unknown AllergyIntoleranceCriticality code '"+codeString+"'"); + } + public String toCode(AllergyIntoleranceCriticality code) { + if (code == AllergyIntoleranceCriticality.LOW) + return "low"; + if (code == AllergyIntoleranceCriticality.HIGH) + return "high"; + if (code == AllergyIntoleranceCriticality.UNASSESSIBLE) + return "unassessible"; + return "?"; + } + } + + public enum AllergyIntoleranceType { + /** + * Immune mediated reaction, including allergic reactions and hypersensitivities. + */ + IMMUNE, + /** + * A non-immune mediated reaction, which can include pseudoallergic reactions, side effects, intolerances, drug toxicities (eg to Gentamicin), drug-drug interactions, food-drug interactions, and drug-disease interactions. + */ + NONIMMUNE, + /** + * added to help the parsers + */ + NULL; + public static AllergyIntoleranceType fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("immune".equals(codeString)) + return IMMUNE; + if ("non-immune".equals(codeString)) + return NONIMMUNE; + throw new Exception("Unknown AllergyIntoleranceType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case IMMUNE: return "immune"; + case NONIMMUNE: return "non-immune"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case IMMUNE: return ""; + case NONIMMUNE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case IMMUNE: return "Immune mediated reaction, including allergic reactions and hypersensitivities."; + case NONIMMUNE: return "A non-immune mediated reaction, which can include pseudoallergic reactions, side effects, intolerances, drug toxicities (eg to Gentamicin), drug-drug interactions, food-drug interactions, and drug-disease interactions."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case IMMUNE: return "Immune Mediated"; + case NONIMMUNE: return "Non-immune mediated"; + default: return "?"; + } + } + } + + public static class AllergyIntoleranceTypeEnumFactory implements EnumFactory { + public AllergyIntoleranceType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("immune".equals(codeString)) + return AllergyIntoleranceType.IMMUNE; + if ("non-immune".equals(codeString)) + return AllergyIntoleranceType.NONIMMUNE; + throw new IllegalArgumentException("Unknown AllergyIntoleranceType code '"+codeString+"'"); + } + public String toCode(AllergyIntoleranceType code) { + if (code == AllergyIntoleranceType.IMMUNE) + return "immune"; + if (code == AllergyIntoleranceType.NONIMMUNE) + return "non-immune"; + return "?"; + } + } + + public enum AllergyIntoleranceCategory { + /** + * Any substance consumed to provide nutritional support for the body. + */ + FOOD, + /** + * Substances administered to achieve a physiological effect. + */ + MEDICATION, + /** + * Substances that are encountered in the environment. + */ + ENVIRONMENT, + /** + * added to help the parsers + */ + NULL; + public static AllergyIntoleranceCategory fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("food".equals(codeString)) + return FOOD; + if ("medication".equals(codeString)) + return MEDICATION; + if ("environment".equals(codeString)) + return ENVIRONMENT; + throw new Exception("Unknown AllergyIntoleranceCategory code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case FOOD: return "food"; + case MEDICATION: return "medication"; + case ENVIRONMENT: return "environment"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case FOOD: return ""; + case MEDICATION: return ""; + case ENVIRONMENT: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case FOOD: return "Any substance consumed to provide nutritional support for the body."; + case MEDICATION: return "Substances administered to achieve a physiological effect."; + case ENVIRONMENT: return "Substances that are encountered in the environment."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case FOOD: return "Food"; + case MEDICATION: return "Medication"; + case ENVIRONMENT: return "Environment"; + default: return "?"; + } + } + } + + public static class AllergyIntoleranceCategoryEnumFactory implements EnumFactory { + public AllergyIntoleranceCategory fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("food".equals(codeString)) + return AllergyIntoleranceCategory.FOOD; + if ("medication".equals(codeString)) + return AllergyIntoleranceCategory.MEDICATION; + if ("environment".equals(codeString)) + return AllergyIntoleranceCategory.ENVIRONMENT; + throw new IllegalArgumentException("Unknown AllergyIntoleranceCategory code '"+codeString+"'"); + } + public String toCode(AllergyIntoleranceCategory code) { + if (code == AllergyIntoleranceCategory.FOOD) + return "food"; + if (code == AllergyIntoleranceCategory.MEDICATION) + return "medication"; + if (code == AllergyIntoleranceCategory.ENVIRONMENT) + return "environment"; + return "?"; + } + } + + public enum ReactionEventCertainty { + /** + * There is a low level of clinical certainty that the reaction was caused by the identified Substance. + */ + UNLIKELY, + /** + * There is a high level of clinical certainty that the reaction was caused by the identified Substance. + */ + LIKELY, + /** + * There is a very high level of clinical certainty that the reaction was due to the identified Substance, which may include clinical evidence by testing or rechallenge. + */ + CONFIRMED, + /** + * added to help the parsers + */ + NULL; + public static ReactionEventCertainty fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("unlikely".equals(codeString)) + return UNLIKELY; + if ("likely".equals(codeString)) + return LIKELY; + if ("confirmed".equals(codeString)) + return CONFIRMED; + throw new Exception("Unknown ReactionEventCertainty code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case UNLIKELY: return "unlikely"; + case LIKELY: return "likely"; + case CONFIRMED: return "confirmed"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case UNLIKELY: return ""; + case LIKELY: return ""; + case CONFIRMED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case UNLIKELY: return "There is a low level of clinical certainty that the reaction was caused by the identified Substance."; + case LIKELY: return "There is a high level of clinical certainty that the reaction was caused by the identified Substance."; + case CONFIRMED: return "There is a very high level of clinical certainty that the reaction was due to the identified Substance, which may include clinical evidence by testing or rechallenge."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case UNLIKELY: return "Unlikely"; + case LIKELY: return "Likely"; + case CONFIRMED: return "Confirmed"; + default: return "?"; + } + } + } + + public static class ReactionEventCertaintyEnumFactory implements EnumFactory { + public ReactionEventCertainty fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("unlikely".equals(codeString)) + return ReactionEventCertainty.UNLIKELY; + if ("likely".equals(codeString)) + return ReactionEventCertainty.LIKELY; + if ("confirmed".equals(codeString)) + return ReactionEventCertainty.CONFIRMED; + throw new IllegalArgumentException("Unknown ReactionEventCertainty code '"+codeString+"'"); + } + public String toCode(ReactionEventCertainty code) { + if (code == ReactionEventCertainty.UNLIKELY) + return "unlikely"; + if (code == ReactionEventCertainty.LIKELY) + return "likely"; + if (code == ReactionEventCertainty.CONFIRMED) + return "confirmed"; + return "?"; + } + } + + public enum ReactionEventSeverity { + /** + * Causes mild physiological effects. + */ + MILD, + /** + * Causes moderate physiological effects. + */ + MODERATE, + /** + * Causes severe physiological effects. + */ + SEVERE, + /** + * added to help the parsers + */ + NULL; + public static ReactionEventSeverity fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("mild".equals(codeString)) + return MILD; + if ("moderate".equals(codeString)) + return MODERATE; + if ("severe".equals(codeString)) + return SEVERE; + throw new Exception("Unknown ReactionEventSeverity code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case MILD: return "mild"; + case MODERATE: return "moderate"; + case SEVERE: return "severe"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MILD: return ""; + case MODERATE: return ""; + case SEVERE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MILD: return "Causes mild physiological effects."; + case MODERATE: return "Causes moderate physiological effects."; + case SEVERE: return "Causes severe physiological effects."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MILD: return "Mild"; + case MODERATE: return "Moderate"; + case SEVERE: return "Severe"; + default: return "?"; + } + } + } + + public static class ReactionEventSeverityEnumFactory implements EnumFactory { + public ReactionEventSeverity fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("mild".equals(codeString)) + return ReactionEventSeverity.MILD; + if ("moderate".equals(codeString)) + return ReactionEventSeverity.MODERATE; + if ("severe".equals(codeString)) + return ReactionEventSeverity.SEVERE; + throw new IllegalArgumentException("Unknown ReactionEventSeverity code '"+codeString+"'"); + } + public String toCode(ReactionEventSeverity code) { + if (code == ReactionEventSeverity.MILD) + return "mild"; + if (code == ReactionEventSeverity.MODERATE) + return "moderate"; + if (code == ReactionEventSeverity.SEVERE) + return "severe"; + return "?"; + } + } + + @Block() + public static class AllergyIntoleranceEventComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance. + */ + @Child(name = "substance", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Specific substance considered to be responsible for event", formalDefinition="Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance." ) + protected CodeableConcept substance; + + /** + * Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event. + */ + @Child(name = "certainty", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="unlikely | likely | confirmed - clinical certainty about the specific substance", formalDefinition="Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event." ) + protected Enumeration certainty; + + /** + * Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event. + */ + @Child(name = "manifestation", type = {CodeableConcept.class}, order=3, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Clinical symptoms/signs associated with the Event", formalDefinition="Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event." ) + protected List manifestation; + + /** + * Text description about the Reaction as a whole, including details of the manifestation if required. + */ + @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Description of the event as a whole", formalDefinition="Text description about the Reaction as a whole, including details of the manifestation if required." ) + protected StringType description; + + /** + * Record of the date and/or time of the onset of the Reaction. + */ + @Child(name = "onset", type = {DateTimeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Date(/time) when manifestations showed", formalDefinition="Record of the date and/or time of the onset of the Reaction." ) + protected DateTimeType onset; + + /** + * The amount of time that the Adverse Reaction persisted. + */ + @Child(name = "duration", type = {Duration.class}, order=6, min=0, max=1) + @Description(shortDefinition="How long Manifestations persisted", formalDefinition="The amount of time that the Adverse Reaction persisted." ) + protected Duration duration; + + /** + * Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. + */ + @Child(name = "severity", type = {CodeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="mild | moderate | severe (of event as a whole)", formalDefinition="Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations." ) + protected Enumeration severity; + + /** + * Identification of the route by which the subject was exposed to the substance. + */ + @Child(name = "exposureRoute", type = {CodeableConcept.class}, order=8, min=0, max=1) + @Description(shortDefinition="How the subject was exposed to the substance", formalDefinition="Identification of the route by which the subject was exposed to the substance." ) + protected CodeableConcept exposureRoute; + + /** + * Additional text about the Adverse Reaction event not captured in other fields. + */ + @Child(name = "comment", type = {StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Text about event not captured in other fields", formalDefinition="Additional text about the Adverse Reaction event not captured in other fields." ) + protected StringType comment; + + private static final long serialVersionUID = -1773271720L; + + /* + * Constructor + */ + public AllergyIntoleranceEventComponent() { + super(); + } + + /** + * @return {@link #substance} (Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance.) + */ + public CodeableConcept getSubstance() { + if (this.substance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.substance"); + else if (Configuration.doAutoCreate()) + this.substance = new CodeableConcept(); // cc + return this.substance; + } + + public boolean hasSubstance() { + return this.substance != null && !this.substance.isEmpty(); + } + + /** + * @param value {@link #substance} (Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance.) + */ + public AllergyIntoleranceEventComponent setSubstance(CodeableConcept value) { + this.substance = value; + return this; + } + + /** + * @return {@link #certainty} (Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event.). This is the underlying object with id, value and extensions. The accessor "getCertainty" gives direct access to the value + */ + public Enumeration getCertaintyElement() { + if (this.certainty == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.certainty"); + else if (Configuration.doAutoCreate()) + this.certainty = new Enumeration(new ReactionEventCertaintyEnumFactory()); // bb + return this.certainty; + } + + public boolean hasCertaintyElement() { + return this.certainty != null && !this.certainty.isEmpty(); + } + + public boolean hasCertainty() { + return this.certainty != null && !this.certainty.isEmpty(); + } + + /** + * @param value {@link #certainty} (Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event.). This is the underlying object with id, value and extensions. The accessor "getCertainty" gives direct access to the value + */ + public AllergyIntoleranceEventComponent setCertaintyElement(Enumeration value) { + this.certainty = value; + return this; + } + + /** + * @return Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event. + */ + public ReactionEventCertainty getCertainty() { + return this.certainty == null ? null : this.certainty.getValue(); + } + + /** + * @param value Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event. + */ + public AllergyIntoleranceEventComponent setCertainty(ReactionEventCertainty value) { + if (value == null) + this.certainty = null; + else { + if (this.certainty == null) + this.certainty = new Enumeration(new ReactionEventCertaintyEnumFactory()); + this.certainty.setValue(value); + } + return this; + } + + /** + * @return {@link #manifestation} (Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event.) + */ + public List getManifestation() { + if (this.manifestation == null) + this.manifestation = new ArrayList(); + return this.manifestation; + } + + public boolean hasManifestation() { + if (this.manifestation == null) + return false; + for (CodeableConcept item : this.manifestation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #manifestation} (Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event.) + */ + // syntactic sugar + public CodeableConcept addManifestation() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.manifestation == null) + this.manifestation = new ArrayList(); + this.manifestation.add(t); + return t; + } + + // syntactic sugar + public AllergyIntoleranceEventComponent addManifestation(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.manifestation == null) + this.manifestation = new ArrayList(); + this.manifestation.add(t); + return this; + } + + /** + * @return {@link #description} (Text description about the Reaction as a whole, including details of the manifestation if required.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Text description about the Reaction as a whole, including details of the manifestation if required.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public AllergyIntoleranceEventComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Text description about the Reaction as a whole, including details of the manifestation if required. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Text description about the Reaction as a whole, including details of the manifestation if required. + */ + public AllergyIntoleranceEventComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #onset} (Record of the date and/or time of the onset of the Reaction.). This is the underlying object with id, value and extensions. The accessor "getOnset" gives direct access to the value + */ + public DateTimeType getOnsetElement() { + if (this.onset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.onset"); + else if (Configuration.doAutoCreate()) + this.onset = new DateTimeType(); // bb + return this.onset; + } + + public boolean hasOnsetElement() { + return this.onset != null && !this.onset.isEmpty(); + } + + public boolean hasOnset() { + return this.onset != null && !this.onset.isEmpty(); + } + + /** + * @param value {@link #onset} (Record of the date and/or time of the onset of the Reaction.). This is the underlying object with id, value and extensions. The accessor "getOnset" gives direct access to the value + */ + public AllergyIntoleranceEventComponent setOnsetElement(DateTimeType value) { + this.onset = value; + return this; + } + + /** + * @return Record of the date and/or time of the onset of the Reaction. + */ + public Date getOnset() { + return this.onset == null ? null : this.onset.getValue(); + } + + /** + * @param value Record of the date and/or time of the onset of the Reaction. + */ + public AllergyIntoleranceEventComponent setOnset(Date value) { + if (value == null) + this.onset = null; + else { + if (this.onset == null) + this.onset = new DateTimeType(); + this.onset.setValue(value); + } + return this; + } + + /** + * @return {@link #duration} (The amount of time that the Adverse Reaction persisted.) + */ + public Duration getDuration() { + if (this.duration == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.duration"); + else if (Configuration.doAutoCreate()) + this.duration = new Duration(); // cc + return this.duration; + } + + public boolean hasDuration() { + return this.duration != null && !this.duration.isEmpty(); + } + + /** + * @param value {@link #duration} (The amount of time that the Adverse Reaction persisted.) + */ + public AllergyIntoleranceEventComponent setDuration(Duration value) { + this.duration = value; + return this; + } + + /** + * @return {@link #severity} (Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public Enumeration getSeverityElement() { + if (this.severity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.severity"); + else if (Configuration.doAutoCreate()) + this.severity = new Enumeration(new ReactionEventSeverityEnumFactory()); // bb + return this.severity; + } + + public boolean hasSeverityElement() { + return this.severity != null && !this.severity.isEmpty(); + } + + public boolean hasSeverity() { + return this.severity != null && !this.severity.isEmpty(); + } + + /** + * @param value {@link #severity} (Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public AllergyIntoleranceEventComponent setSeverityElement(Enumeration value) { + this.severity = value; + return this; + } + + /** + * @return Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. + */ + public ReactionEventSeverity getSeverity() { + return this.severity == null ? null : this.severity.getValue(); + } + + /** + * @param value Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. + */ + public AllergyIntoleranceEventComponent setSeverity(ReactionEventSeverity value) { + if (value == null) + this.severity = null; + else { + if (this.severity == null) + this.severity = new Enumeration(new ReactionEventSeverityEnumFactory()); + this.severity.setValue(value); + } + return this; + } + + /** + * @return {@link #exposureRoute} (Identification of the route by which the subject was exposed to the substance.) + */ + public CodeableConcept getExposureRoute() { + if (this.exposureRoute == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.exposureRoute"); + else if (Configuration.doAutoCreate()) + this.exposureRoute = new CodeableConcept(); // cc + return this.exposureRoute; + } + + public boolean hasExposureRoute() { + return this.exposureRoute != null && !this.exposureRoute.isEmpty(); + } + + /** + * @param value {@link #exposureRoute} (Identification of the route by which the subject was exposed to the substance.) + */ + public AllergyIntoleranceEventComponent setExposureRoute(CodeableConcept value) { + this.exposureRoute = value; + return this; + } + + /** + * @return {@link #comment} (Additional text about the Adverse Reaction event not captured in other fields.). 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 AllergyIntoleranceEventComponent.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); // bb + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (Additional text about the Adverse Reaction event not captured in other fields.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public AllergyIntoleranceEventComponent setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return Additional text about the Adverse Reaction event not captured in other fields. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value Additional text about the Adverse Reaction event not captured in other fields. + */ + public AllergyIntoleranceEventComponent setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("substance", "CodeableConcept", "Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance.", 0, java.lang.Integer.MAX_VALUE, substance)); + childrenList.add(new Property("certainty", "code", "Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event.", 0, java.lang.Integer.MAX_VALUE, certainty)); + childrenList.add(new Property("manifestation", "CodeableConcept", "Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event.", 0, java.lang.Integer.MAX_VALUE, manifestation)); + childrenList.add(new Property("description", "string", "Text description about the Reaction as a whole, including details of the manifestation if required.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("onset", "dateTime", "Record of the date and/or time of the onset of the Reaction.", 0, java.lang.Integer.MAX_VALUE, onset)); + childrenList.add(new Property("duration", "Duration", "The amount of time that the Adverse Reaction persisted.", 0, java.lang.Integer.MAX_VALUE, duration)); + childrenList.add(new Property("severity", "code", "Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.", 0, java.lang.Integer.MAX_VALUE, severity)); + childrenList.add(new Property("exposureRoute", "CodeableConcept", "Identification of the route by which the subject was exposed to the substance.", 0, java.lang.Integer.MAX_VALUE, exposureRoute)); + childrenList.add(new Property("comment", "string", "Additional text about the Adverse Reaction event not captured in other fields.", 0, java.lang.Integer.MAX_VALUE, comment)); + } + + public AllergyIntoleranceEventComponent copy() { + AllergyIntoleranceEventComponent dst = new AllergyIntoleranceEventComponent(); + copyValues(dst); + dst.substance = substance == null ? null : substance.copy(); + dst.certainty = certainty == null ? null : certainty.copy(); + if (manifestation != null) { + dst.manifestation = new ArrayList(); + for (CodeableConcept i : manifestation) + dst.manifestation.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + dst.onset = onset == null ? null : onset.copy(); + dst.duration = duration == null ? null : duration.copy(); + dst.severity = severity == null ? null : severity.copy(); + dst.exposureRoute = exposureRoute == null ? null : exposureRoute.copy(); + dst.comment = comment == null ? null : comment.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AllergyIntoleranceEventComponent)) + return false; + AllergyIntoleranceEventComponent o = (AllergyIntoleranceEventComponent) other; + return compareDeep(substance, o.substance, true) && compareDeep(certainty, o.certainty, true) && compareDeep(manifestation, o.manifestation, true) + && compareDeep(description, o.description, true) && compareDeep(onset, o.onset, true) && compareDeep(duration, o.duration, true) + && compareDeep(severity, o.severity, true) && compareDeep(exposureRoute, o.exposureRoute, true) + && compareDeep(comment, o.comment, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AllergyIntoleranceEventComponent)) + return false; + AllergyIntoleranceEventComponent o = (AllergyIntoleranceEventComponent) other; + return compareValues(certainty, o.certainty, true) && compareValues(description, o.description, true) + && compareValues(onset, o.onset, true) && compareValues(severity, o.severity, true) && compareValues(comment, o.comment, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (substance == null || substance.isEmpty()) && (certainty == null || certainty.isEmpty()) + && (manifestation == null || manifestation.isEmpty()) && (description == null || description.isEmpty()) + && (onset == null || onset.isEmpty()) && (duration == null || duration.isEmpty()) && (severity == null || severity.isEmpty()) + && (exposureRoute == null || exposureRoute.isEmpty()) && (comment == null || comment.isEmpty()) + ; + } + + } + + /** + * This records identifiers associated with this allergy/intolerance concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Ids for this item", formalDefinition="This records identifiers associated with this allergy/intolerance concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) + protected List identifier; + + /** + * Date when the sensitivity was recorded. + */ + @Child(name = "recordedDate", type = {DateTimeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="When recorded", formalDefinition="Date when the sensitivity was recorded." ) + protected DateTimeType recordedDate; + + /** + * Individual who recorded the record and takes responsibility for its conten. + */ + @Child(name = "recorder", type = {Practitioner.class, Patient.class}, order=2, min=0, max=1) + @Description(shortDefinition="Who recorded the sensitivity", formalDefinition="Individual who recorded the record and takes responsibility for its conten." ) + protected Reference recorder; + + /** + * The actual object that is the target of the reference (Individual who recorded the record and takes responsibility for its conten.) + */ + protected Resource recorderTarget; + + /** + * The patient who has the allergy or intolerance. + */ + @Child(name = "patient", type = {Patient.class}, order=3, min=1, max=1) + @Description(shortDefinition="Who the sensitivity is for", formalDefinition="The patient who has the allergy or intolerance." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient who has the allergy or intolerance.) + */ + protected Patient patientTarget; + + /** + * The source of the information about the allergy that is recorded. + */ + @Child(name = "reporter", type = {Patient.class, RelatedPerson.class, Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="Source of the information about the allergy", formalDefinition="The source of the information about the allergy that is recorded." ) + protected Reference reporter; + + /** + * The actual object that is the target of the reference (The source of the information about the allergy that is recorded.) + */ + protected Resource reporterTarget; + + /** + * Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk. + */ + @Child(name = "substance", type = {CodeableConcept.class}, order=5, min=1, max=1) + @Description(shortDefinition="Substance, (or class) considered to be responsible for risk", formalDefinition="Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk." ) + protected CodeableConcept substance; + + /** + * Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance. + */ + @Child(name = "status", type = {CodeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="unconfirmed | confirmed | resolved | refuted | entered-in-error", formalDefinition="Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance." ) + protected Enumeration status; + + /** + * Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance. + */ + @Child(name = "criticality", type = {CodeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="low | high | unassessible - Estimated potential clinical harm", formalDefinition="Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance." ) + protected Enumeration criticality; + + /** + * Identification of the underlying physiological mechanism for the Reaction Risk. + */ + @Child(name = "type", type = {CodeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="immune | non-immune - Underlying mechanism (if known)", formalDefinition="Identification of the underlying physiological mechanism for the Reaction Risk." ) + protected Enumeration type; + + /** + * Category of the identified Substance. + */ + @Child(name = "category", type = {CodeType.class}, order=9, min=0, max=1) + @Description(shortDefinition="food | medication | environment - Category of Substance", formalDefinition="Category of the identified Substance." ) + protected Enumeration category; + + /** + * Represents the date and/or time of the last known occurence of a reaction event. + */ + @Child(name = "lastOccurence", type = {DateTimeType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Date(/time) of last known occurence of a reaction", formalDefinition="Represents the date and/or time of the last known occurence of a reaction event." ) + protected DateTimeType lastOccurence; + + /** + * Additional narrative about the propensity for the Adverse Reaction, not captured in other fields. + */ + @Child(name = "comment", type = {StringType.class}, order=11, min=0, max=1) + @Description(shortDefinition="Additional text not captured in other fields", formalDefinition="Additional narrative about the propensity for the Adverse Reaction, not captured in other fields." ) + protected StringType comment; + + /** + * Details about each Adverse Reaction Event linked to exposure to the identified Substance. + */ + @Child(name = "event", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Adverse Reaction Events linked to exposure to substance", formalDefinition="Details about each Adverse Reaction Event linked to exposure to the identified Substance." ) + protected List event; + + private static final long serialVersionUID = 410225544L; + + /* + * Constructor + */ + public AllergyIntolerance() { + super(); + } + + /* + * Constructor + */ + public AllergyIntolerance(Reference patient, CodeableConcept substance) { + super(); + this.patient = patient; + this.substance = substance; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this allergy/intolerance concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this allergy/intolerance concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public AllergyIntolerance addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #recordedDate} (Date when the sensitivity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedDate" gives direct access to the value + */ + public DateTimeType getRecordedDateElement() { + if (this.recordedDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.recordedDate"); + else if (Configuration.doAutoCreate()) + this.recordedDate = new DateTimeType(); // bb + return this.recordedDate; + } + + public boolean hasRecordedDateElement() { + return this.recordedDate != null && !this.recordedDate.isEmpty(); + } + + public boolean hasRecordedDate() { + return this.recordedDate != null && !this.recordedDate.isEmpty(); + } + + /** + * @param value {@link #recordedDate} (Date when the sensitivity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedDate" gives direct access to the value + */ + public AllergyIntolerance setRecordedDateElement(DateTimeType value) { + this.recordedDate = value; + return this; + } + + /** + * @return Date when the sensitivity was recorded. + */ + public Date getRecordedDate() { + return this.recordedDate == null ? null : this.recordedDate.getValue(); + } + + /** + * @param value Date when the sensitivity was recorded. + */ + public AllergyIntolerance setRecordedDate(Date value) { + if (value == null) + this.recordedDate = null; + else { + if (this.recordedDate == null) + this.recordedDate = new DateTimeType(); + this.recordedDate.setValue(value); + } + return this; + } + + /** + * @return {@link #recorder} (Individual who recorded the record and takes responsibility for its conten.) + */ + public Reference getRecorder() { + if (this.recorder == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.recorder"); + else if (Configuration.doAutoCreate()) + this.recorder = new Reference(); // cc + return this.recorder; + } + + public boolean hasRecorder() { + return this.recorder != null && !this.recorder.isEmpty(); + } + + /** + * @param value {@link #recorder} (Individual who recorded the record and takes responsibility for its conten.) + */ + public AllergyIntolerance setRecorder(Reference value) { + this.recorder = value; + return this; + } + + /** + * @return {@link #recorder} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Individual who recorded the record and takes responsibility for its conten.) + */ + public Resource getRecorderTarget() { + return this.recorderTarget; + } + + /** + * @param value {@link #recorder} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Individual who recorded the record and takes responsibility for its conten.) + */ + public AllergyIntolerance setRecorderTarget(Resource value) { + this.recorderTarget = value; + return this; + } + + /** + * @return {@link #patient} (The patient who has the allergy or intolerance.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The patient who has the allergy or intolerance.) + */ + public AllergyIntolerance setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who has the allergy or intolerance.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who has the allergy or intolerance.) + */ + public AllergyIntolerance setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #reporter} (The source of the information about the allergy that is recorded.) + */ + public Reference getReporter() { + if (this.reporter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.reporter"); + else if (Configuration.doAutoCreate()) + this.reporter = new Reference(); // cc + return this.reporter; + } + + public boolean hasReporter() { + return this.reporter != null && !this.reporter.isEmpty(); + } + + /** + * @param value {@link #reporter} (The source of the information about the allergy that is recorded.) + */ + public AllergyIntolerance setReporter(Reference value) { + this.reporter = value; + return this; + } + + /** + * @return {@link #reporter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The source of the information about the allergy that is recorded.) + */ + public Resource getReporterTarget() { + return this.reporterTarget; + } + + /** + * @param value {@link #reporter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The source of the information about the allergy that is recorded.) + */ + public AllergyIntolerance setReporterTarget(Resource value) { + this.reporterTarget = value; + return this; + } + + /** + * @return {@link #substance} (Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk.) + */ + public CodeableConcept getSubstance() { + if (this.substance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.substance"); + else if (Configuration.doAutoCreate()) + this.substance = new CodeableConcept(); // cc + return this.substance; + } + + public boolean hasSubstance() { + return this.substance != null && !this.substance.isEmpty(); + } + + /** + * @param value {@link #substance} (Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk.) + */ + public AllergyIntolerance setSubstance(CodeableConcept value) { + this.substance = value; + return this; + } + + /** + * @return {@link #status} (Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new AllergyIntoleranceStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public AllergyIntolerance setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance. + */ + public AllergyIntoleranceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance. + */ + public AllergyIntolerance setStatus(AllergyIntoleranceStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new AllergyIntoleranceStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #criticality} (Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCriticality" gives direct access to the value + */ + public Enumeration getCriticalityElement() { + if (this.criticality == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.criticality"); + else if (Configuration.doAutoCreate()) + this.criticality = new Enumeration(new AllergyIntoleranceCriticalityEnumFactory()); // bb + return this.criticality; + } + + public boolean hasCriticalityElement() { + return this.criticality != null && !this.criticality.isEmpty(); + } + + public boolean hasCriticality() { + return this.criticality != null && !this.criticality.isEmpty(); + } + + /** + * @param value {@link #criticality} (Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCriticality" gives direct access to the value + */ + public AllergyIntolerance setCriticalityElement(Enumeration value) { + this.criticality = value; + return this; + } + + /** + * @return Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance. + */ + public AllergyIntoleranceCriticality getCriticality() { + return this.criticality == null ? null : this.criticality.getValue(); + } + + /** + * @param value Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance. + */ + public AllergyIntolerance setCriticality(AllergyIntoleranceCriticality value) { + if (value == null) + this.criticality = null; + else { + if (this.criticality == null) + this.criticality = new Enumeration(new AllergyIntoleranceCriticalityEnumFactory()); + this.criticality.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (Identification of the underlying physiological mechanism for the Reaction Risk.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new AllergyIntoleranceTypeEnumFactory()); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Identification of the underlying physiological mechanism for the Reaction Risk.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public AllergyIntolerance setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Identification of the underlying physiological mechanism for the Reaction Risk. + */ + public AllergyIntoleranceType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Identification of the underlying physiological mechanism for the Reaction Risk. + */ + public AllergyIntolerance setType(AllergyIntoleranceType value) { + if (value == null) + this.type = null; + else { + if (this.type == null) + this.type = new Enumeration(new AllergyIntoleranceTypeEnumFactory()); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #category} (Category of the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public Enumeration getCategoryElement() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.category"); + else if (Configuration.doAutoCreate()) + this.category = new Enumeration(new AllergyIntoleranceCategoryEnumFactory()); // bb + return this.category; + } + + public boolean hasCategoryElement() { + return this.category != null && !this.category.isEmpty(); + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Category of the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public AllergyIntolerance setCategoryElement(Enumeration value) { + this.category = value; + return this; + } + + /** + * @return Category of the identified Substance. + */ + public AllergyIntoleranceCategory getCategory() { + return this.category == null ? null : this.category.getValue(); + } + + /** + * @param value Category of the identified Substance. + */ + public AllergyIntolerance setCategory(AllergyIntoleranceCategory value) { + if (value == null) + this.category = null; + else { + if (this.category == null) + this.category = new Enumeration(new AllergyIntoleranceCategoryEnumFactory()); + this.category.setValue(value); + } + return this; + } + + /** + * @return {@link #lastOccurence} (Represents the date and/or time of the last known occurence of a reaction event.). This is the underlying object with id, value and extensions. The accessor "getLastOccurence" gives direct access to the value + */ + public DateTimeType getLastOccurenceElement() { + if (this.lastOccurence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.lastOccurence"); + else if (Configuration.doAutoCreate()) + this.lastOccurence = new DateTimeType(); // bb + return this.lastOccurence; + } + + public boolean hasLastOccurenceElement() { + return this.lastOccurence != null && !this.lastOccurence.isEmpty(); + } + + public boolean hasLastOccurence() { + return this.lastOccurence != null && !this.lastOccurence.isEmpty(); + } + + /** + * @param value {@link #lastOccurence} (Represents the date and/or time of the last known occurence of a reaction event.). This is the underlying object with id, value and extensions. The accessor "getLastOccurence" gives direct access to the value + */ + public AllergyIntolerance setLastOccurenceElement(DateTimeType value) { + this.lastOccurence = value; + return this; + } + + /** + * @return Represents the date and/or time of the last known occurence of a reaction event. + */ + public Date getLastOccurence() { + return this.lastOccurence == null ? null : this.lastOccurence.getValue(); + } + + /** + * @param value Represents the date and/or time of the last known occurence of a reaction event. + */ + public AllergyIntolerance setLastOccurence(Date value) { + if (value == null) + this.lastOccurence = null; + else { + if (this.lastOccurence == null) + this.lastOccurence = new DateTimeType(); + this.lastOccurence.setValue(value); + } + return this; + } + + /** + * @return {@link #comment} (Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.). 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 AllergyIntolerance.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); // bb + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public AllergyIntolerance setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return Additional narrative about the propensity for the Adverse Reaction, not captured in other fields. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value Additional narrative about the propensity for the Adverse Reaction, not captured in other fields. + */ + public AllergyIntolerance 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 #event} (Details about each Adverse Reaction Event linked to exposure to the identified Substance.) + */ + public List getEvent() { + if (this.event == null) + this.event = new ArrayList(); + return this.event; + } + + public boolean hasEvent() { + if (this.event == null) + return false; + for (AllergyIntoleranceEventComponent item : this.event) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #event} (Details about each Adverse Reaction Event linked to exposure to the identified Substance.) + */ + // syntactic sugar + public AllergyIntoleranceEventComponent addEvent() { //3 + AllergyIntoleranceEventComponent t = new AllergyIntoleranceEventComponent(); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return t; + } + + // syntactic sugar + public AllergyIntolerance addEvent(AllergyIntoleranceEventComponent t) { //3 + if (t == null) + return this; + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this allergy/intolerance concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("recordedDate", "dateTime", "Date when the sensitivity was recorded.", 0, java.lang.Integer.MAX_VALUE, recordedDate)); + childrenList.add(new Property("recorder", "Reference(Practitioner|Patient)", "Individual who recorded the record and takes responsibility for its conten.", 0, java.lang.Integer.MAX_VALUE, recorder)); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient who has the allergy or intolerance.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("reporter", "Reference(Patient|RelatedPerson|Practitioner)", "The source of the information about the allergy that is recorded.", 0, java.lang.Integer.MAX_VALUE, reporter)); + childrenList.add(new Property("substance", "CodeableConcept", "Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk.", 0, java.lang.Integer.MAX_VALUE, substance)); + childrenList.add(new Property("status", "code", "Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("criticality", "code", "Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance.", 0, java.lang.Integer.MAX_VALUE, criticality)); + childrenList.add(new Property("type", "code", "Identification of the underlying physiological mechanism for the Reaction Risk.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("category", "code", "Category of the identified Substance.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("lastOccurence", "dateTime", "Represents the date and/or time of the last known occurence of a reaction event.", 0, java.lang.Integer.MAX_VALUE, lastOccurence)); + childrenList.add(new Property("comment", "string", "Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.", 0, java.lang.Integer.MAX_VALUE, comment)); + childrenList.add(new Property("event", "", "Details about each Adverse Reaction Event linked to exposure to the identified Substance.", 0, java.lang.Integer.MAX_VALUE, event)); + } + + public AllergyIntolerance copy() { + AllergyIntolerance dst = new AllergyIntolerance(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.recordedDate = recordedDate == null ? null : recordedDate.copy(); + dst.recorder = recorder == null ? null : recorder.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.reporter = reporter == null ? null : reporter.copy(); + dst.substance = substance == null ? null : substance.copy(); + dst.status = status == null ? null : status.copy(); + dst.criticality = criticality == null ? null : criticality.copy(); + dst.type = type == null ? null : type.copy(); + dst.category = category == null ? null : category.copy(); + dst.lastOccurence = lastOccurence == null ? null : lastOccurence.copy(); + dst.comment = comment == null ? null : comment.copy(); + if (event != null) { + dst.event = new ArrayList(); + for (AllergyIntoleranceEventComponent i : event) + dst.event.add(i.copy()); + }; + return dst; + } + + protected AllergyIntolerance typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AllergyIntolerance)) + return false; + AllergyIntolerance o = (AllergyIntolerance) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(recordedDate, o.recordedDate, true) + && compareDeep(recorder, o.recorder, true) && compareDeep(patient, o.patient, true) && compareDeep(reporter, o.reporter, true) + && compareDeep(substance, o.substance, true) && compareDeep(status, o.status, true) && compareDeep(criticality, o.criticality, true) + && compareDeep(type, o.type, true) && compareDeep(category, o.category, true) && compareDeep(lastOccurence, o.lastOccurence, true) + && compareDeep(comment, o.comment, true) && compareDeep(event, o.event, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AllergyIntolerance)) + return false; + AllergyIntolerance o = (AllergyIntolerance) other; + return compareValues(recordedDate, o.recordedDate, true) && compareValues(status, o.status, true) && compareValues(criticality, o.criticality, true) + && compareValues(type, o.type, true) && compareValues(category, o.category, true) && compareValues(lastOccurence, o.lastOccurence, true) + && compareValues(comment, o.comment, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (recordedDate == null || recordedDate.isEmpty()) + && (recorder == null || recorder.isEmpty()) && (patient == null || patient.isEmpty()) && (reporter == null || reporter.isEmpty()) + && (substance == null || substance.isEmpty()) && (status == null || status.isEmpty()) && (criticality == null || criticality.isEmpty()) + && (type == null || type.isEmpty()) && (category == null || category.isEmpty()) && (lastOccurence == null || lastOccurence.isEmpty()) + && (comment == null || comment.isEmpty()) && (event == null || event.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.AllergyIntolerance; + } + + @SearchParamDefinition(name="severity", path="AllergyIntolerance.event.severity", description="mild | moderate | severe (of event as a whole)", type="token" ) + public static final String SP_SEVERITY = "severity"; + @SearchParamDefinition(name="date", path="AllergyIntolerance.recordedDate", description="When recorded", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="AllergyIntolerance.identifier", description="External Ids for this item", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="manifestation", path="AllergyIntolerance.event.manifestation", description="Clinical symptoms/signs associated with the Event", type="token" ) + public static final String SP_MANIFESTATION = "manifestation"; + @SearchParamDefinition(name="recorder", path="AllergyIntolerance.recorder", description="Who recorded the sensitivity", type="reference" ) + public static final String SP_RECORDER = "recorder"; + @SearchParamDefinition(name="substance", path="AllergyIntolerance.substance|AllergyIntolerance.event.substance", description="Substance, (or class) considered to be responsible for risk", type="token" ) + public static final String SP_SUBSTANCE = "substance"; + @SearchParamDefinition(name="criticality", path="AllergyIntolerance.criticality", description="low | high | unassessible - Estimated potential clinical harm", type="token" ) + public static final String SP_CRITICALITY = "criticality"; + @SearchParamDefinition(name="reporter", path="AllergyIntolerance.reporter", description="Source of the information about the allergy", type="reference" ) + public static final String SP_REPORTER = "reporter"; + @SearchParamDefinition(name="type", path="AllergyIntolerance.type", description="immune | non-immune - Underlying mechanism (if known)", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="onset", path="AllergyIntolerance.event.onset", description="Date(/time) when manifestations showed", type="date" ) + public static final String SP_ONSET = "onset"; + @SearchParamDefinition(name="duration", path="AllergyIntolerance.event.duration", description="How long Manifestations persisted", type="quantity" ) + public static final String SP_DURATION = "duration"; + @SearchParamDefinition(name="route", path="AllergyIntolerance.event.exposureRoute", description="How the subject was exposed to the substance", type="token" ) + public static final String SP_ROUTE = "route"; + @SearchParamDefinition(name="patient", path="AllergyIntolerance.patient", description="Who the sensitivity is for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="category", path="AllergyIntolerance.category", description="food | medication | environment - Category of Substance", type="token" ) + public static final String SP_CATEGORY = "category"; + @SearchParamDefinition(name="last-date", path="AllergyIntolerance.lastOccurence", description="Date(/time) of last known occurence of a reaction", type="date" ) + public static final String SP_LASTDATE = "last-date"; + @SearchParamDefinition(name="status", path="AllergyIntolerance.status", description="unconfirmed | confirmed | resolved | refuted | entered-in-error", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Appointment.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Appointment.java index 0f13ab8fde6..dc25788fef3 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Appointment.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Appointment.java @@ -1,1388 +1,1367 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). - */ -@ResourceDef(name="Appointment", profile="http://hl7.org/fhir/Profile/Appointment") -public class Appointment extends DomainResource { - - public enum Appointmentstatus { - /** - * Some or all of the participant(s) have not finalized their acceptance of the appointment request. - */ - PENDING, - /** - * All participant(s) have been considered and the appointment is confirmed to go ahead at the date/times specified. - */ - BOOKED, - /** - * Some of the patients have arrived. - */ - ARRIVED, - /** - * This appointment has completed and may have resulted in an encounter. - */ - FULFILLED, - /** - * The appointment has been cancelled. - */ - CANCELLED, - /** - * Some or all of the participant(s) have not/did not appear for the appointment (usually the patient). - */ - NOSHOW, - /** - * added to help the parsers - */ - NULL; - public static Appointmentstatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("pending".equals(codeString)) - return PENDING; - if ("booked".equals(codeString)) - return BOOKED; - if ("arrived".equals(codeString)) - return ARRIVED; - if ("fulfilled".equals(codeString)) - return FULFILLED; - if ("cancelled".equals(codeString)) - return CANCELLED; - if ("noshow".equals(codeString)) - return NOSHOW; - throw new Exception("Unknown Appointmentstatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PENDING: return "pending"; - case BOOKED: return "booked"; - case ARRIVED: return "arrived"; - case FULFILLED: return "fulfilled"; - case CANCELLED: return "cancelled"; - case NOSHOW: return "noshow"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PENDING: return ""; - case BOOKED: return ""; - case ARRIVED: return ""; - case FULFILLED: return ""; - case CANCELLED: return ""; - case NOSHOW: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PENDING: return "Some or all of the participant(s) have not finalized their acceptance of the appointment request."; - case BOOKED: return "All participant(s) have been considered and the appointment is confirmed to go ahead at the date/times specified."; - case ARRIVED: return "Some of the patients have arrived."; - case FULFILLED: return "This appointment has completed and may have resulted in an encounter."; - case CANCELLED: return "The appointment has been cancelled."; - case NOSHOW: return "Some or all of the participant(s) have not/did not appear for the appointment (usually the patient)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PENDING: return "Pending"; - case BOOKED: return "Booked"; - case ARRIVED: return "Arrived"; - case FULFILLED: return "Fulfilled"; - case CANCELLED: return "Cancelled"; - case NOSHOW: return "No Show"; - default: return "?"; - } - } - } - - public static class AppointmentstatusEnumFactory implements EnumFactory { - public Appointmentstatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("pending".equals(codeString)) - return Appointmentstatus.PENDING; - if ("booked".equals(codeString)) - return Appointmentstatus.BOOKED; - if ("arrived".equals(codeString)) - return Appointmentstatus.ARRIVED; - if ("fulfilled".equals(codeString)) - return Appointmentstatus.FULFILLED; - if ("cancelled".equals(codeString)) - return Appointmentstatus.CANCELLED; - if ("noshow".equals(codeString)) - return Appointmentstatus.NOSHOW; - throw new IllegalArgumentException("Unknown Appointmentstatus code '"+codeString+"'"); - } - public String toCode(Appointmentstatus code) { - if (code == Appointmentstatus.PENDING) - return "pending"; - if (code == Appointmentstatus.BOOKED) - return "booked"; - if (code == Appointmentstatus.ARRIVED) - return "arrived"; - if (code == Appointmentstatus.FULFILLED) - return "fulfilled"; - if (code == Appointmentstatus.CANCELLED) - return "cancelled"; - if (code == Appointmentstatus.NOSHOW) - return "noshow"; - return "?"; - } - } - - public enum Participantrequired { - /** - * The participant is required to attend the appointment. - */ - REQUIRED, - /** - * The participant may optionally attend the appointment. - */ - OPTIONAL, - /** - * The participant is excluded from the appointment, and may not be informed of the appointment taking place. (appointment is about them, not for them - such as 2 doctors discussing results about a patient's test). - */ - INFORMATIONONLY, - /** - * added to help the parsers - */ - NULL; - public static Participantrequired fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("required".equals(codeString)) - return REQUIRED; - if ("optional".equals(codeString)) - return OPTIONAL; - if ("information-only".equals(codeString)) - return INFORMATIONONLY; - throw new Exception("Unknown Participantrequired code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case REQUIRED: return "required"; - case OPTIONAL: return "optional"; - case INFORMATIONONLY: return "information-only"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REQUIRED: return ""; - case OPTIONAL: return ""; - case INFORMATIONONLY: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REQUIRED: return "The participant is required to attend the appointment."; - case OPTIONAL: return "The participant may optionally attend the appointment."; - case INFORMATIONONLY: return "The participant is excluded from the appointment, and may not be informed of the appointment taking place. (appointment is about them, not for them - such as 2 doctors discussing results about a patient's test)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REQUIRED: return "Required"; - case OPTIONAL: return "Optional"; - case INFORMATIONONLY: return "Information Only"; - default: return "?"; - } - } - } - - public static class ParticipantrequiredEnumFactory implements EnumFactory { - public Participantrequired fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("required".equals(codeString)) - return Participantrequired.REQUIRED; - if ("optional".equals(codeString)) - return Participantrequired.OPTIONAL; - if ("information-only".equals(codeString)) - return Participantrequired.INFORMATIONONLY; - throw new IllegalArgumentException("Unknown Participantrequired code '"+codeString+"'"); - } - public String toCode(Participantrequired code) { - if (code == Participantrequired.REQUIRED) - return "required"; - if (code == Participantrequired.OPTIONAL) - return "optional"; - if (code == Participantrequired.INFORMATIONONLY) - return "information-only"; - return "?"; - } - } - - public enum Participationstatus { - /** - * The participant has accepted the appointment. - */ - ACCEPTED, - /** - * The participant has declined the appointment and will not participate in the appointment. - */ - DECLINED, - /** - * The participant has tentatively accepted the appointment. This could be automatically created by a system and requires further processing before it can be accepted. There is no commitment that attendance will occur. - */ - TENTATIVE, - /** - * The participant needs to indicate if they accept the appointment by changing this status to one of the other statuses. - */ - NEEDSACTION, - /** - * added to help the parsers - */ - NULL; - public static Participationstatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("declined".equals(codeString)) - return DECLINED; - if ("tentative".equals(codeString)) - return TENTATIVE; - if ("needs-action".equals(codeString)) - return NEEDSACTION; - throw new Exception("Unknown Participationstatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ACCEPTED: return "accepted"; - case DECLINED: return "declined"; - case TENTATIVE: return "tentative"; - case NEEDSACTION: return "needs-action"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ACCEPTED: return ""; - case DECLINED: return ""; - case TENTATIVE: return ""; - case NEEDSACTION: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ACCEPTED: return "The participant has accepted the appointment."; - case DECLINED: return "The participant has declined the appointment and will not participate in the appointment."; - case TENTATIVE: return "The participant has tentatively accepted the appointment. This could be automatically created by a system and requires further processing before it can be accepted. There is no commitment that attendance will occur."; - case NEEDSACTION: return "The participant needs to indicate if they accept the appointment by changing this status to one of the other statuses."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ACCEPTED: return "Accepted"; - case DECLINED: return "Declined"; - case TENTATIVE: return "Tentative"; - case NEEDSACTION: return "Needs Action"; - default: return "?"; - } - } - } - - public static class ParticipationstatusEnumFactory implements EnumFactory { - public Participationstatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("accepted".equals(codeString)) - return Participationstatus.ACCEPTED; - if ("declined".equals(codeString)) - return Participationstatus.DECLINED; - if ("tentative".equals(codeString)) - return Participationstatus.TENTATIVE; - if ("needs-action".equals(codeString)) - return Participationstatus.NEEDSACTION; - throw new IllegalArgumentException("Unknown Participationstatus code '"+codeString+"'"); - } - public String toCode(Participationstatus code) { - if (code == Participationstatus.ACCEPTED) - return "accepted"; - if (code == Participationstatus.DECLINED) - return "declined"; - if (code == Participationstatus.TENTATIVE) - return "tentative"; - if (code == Participationstatus.NEEDSACTION) - return "needs-action"; - return "?"; - } - } - - @Block() - public static class AppointmentParticipantComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Role of participant in the appointment. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Role of participant in the appointment", formalDefinition="Role of participant in the appointment." ) - protected List type; - - /** - * A Person, Location/HealthcareService or Device that is participating in the appointment. - */ - @Child(name = "actor", type = {Patient.class, Practitioner.class, RelatedPerson.class, Device.class, HealthcareService.class, Location.class}, order=2, min=0, max=1) - @Description(shortDefinition="A Person, Location/HealthcareService or Device that is participating in the appointment", formalDefinition="A Person, Location/HealthcareService or Device that is participating in the appointment." ) - protected Reference actor; - - /** - * The actual object that is the target of the reference (A Person, Location/HealthcareService or Device that is participating in the appointment.) - */ - protected Resource actorTarget; - - /** - * Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present. - */ - @Child(name = "required", type = {CodeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="required | optional | information-only", formalDefinition="Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present." ) - protected Enumeration required; - - /** - * Participation status of the Patient. - */ - @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1) - @Description(shortDefinition="accepted | declined | tentative | needs-action", formalDefinition="Participation status of the Patient." ) - protected Enumeration status; - - private static final long serialVersionUID = -1009855227L; - - /* - * Constructor - */ - public AppointmentParticipantComponent() { - super(); - } - - /* - * Constructor - */ - public AppointmentParticipantComponent(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #type} (Role of participant in the appointment.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (CodeableConcept item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (Role of participant in the appointment.) - */ - // syntactic sugar - public CodeableConcept addType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - // syntactic sugar - public AppointmentParticipantComponent addType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - /** - * @return {@link #actor} (A Person, Location/HealthcareService or Device that is participating in the appointment.) - */ - public Reference getActor() { - if (this.actor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentParticipantComponent.actor"); - else if (Configuration.doAutoCreate()) - this.actor = new Reference(); // cc - return this.actor; - } - - public boolean hasActor() { - return this.actor != null && !this.actor.isEmpty(); - } - - /** - * @param value {@link #actor} (A Person, Location/HealthcareService or Device that is participating in the appointment.) - */ - public AppointmentParticipantComponent setActor(Reference value) { - this.actor = value; - return this; - } - - /** - * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A Person, Location/HealthcareService or Device that is participating in the appointment.) - */ - public Resource getActorTarget() { - return this.actorTarget; - } - - /** - * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A Person, Location/HealthcareService or Device that is participating in the appointment.) - */ - public AppointmentParticipantComponent setActorTarget(Resource value) { - this.actorTarget = value; - return this; - } - - /** - * @return {@link #required} (Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value - */ - public Enumeration getRequiredElement() { - if (this.required == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentParticipantComponent.required"); - else if (Configuration.doAutoCreate()) - this.required = new Enumeration(new ParticipantrequiredEnumFactory()); // bb - return this.required; - } - - public boolean hasRequiredElement() { - return this.required != null && !this.required.isEmpty(); - } - - public boolean hasRequired() { - return this.required != null && !this.required.isEmpty(); - } - - /** - * @param value {@link #required} (Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value - */ - public AppointmentParticipantComponent setRequiredElement(Enumeration value) { - this.required = value; - return this; - } - - /** - * @return Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present. - */ - public Participantrequired getRequired() { - return this.required == null ? null : this.required.getValue(); - } - - /** - * @param value Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present. - */ - public AppointmentParticipantComponent setRequired(Participantrequired value) { - if (value == null) - this.required = null; - else { - if (this.required == null) - this.required = new Enumeration(new ParticipantrequiredEnumFactory()); - this.required.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (Participation status of the Patient.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentParticipantComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ParticipationstatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Participation status of the Patient.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public AppointmentParticipantComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Participation status of the Patient. - */ - public Participationstatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Participation status of the Patient. - */ - public AppointmentParticipantComponent setStatus(Participationstatus value) { - if (this.status == null) - this.status = new Enumeration(new ParticipationstatusEnumFactory()); - this.status.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "Role of participant in the appointment.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("actor", "Reference(Patient|Practitioner|RelatedPerson|Device|HealthcareService|Location)", "A Person, Location/HealthcareService or Device that is participating in the appointment.", 0, java.lang.Integer.MAX_VALUE, actor)); - childrenList.add(new Property("required", "code", "Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.", 0, java.lang.Integer.MAX_VALUE, required)); - childrenList.add(new Property("status", "code", "Participation status of the Patient.", 0, java.lang.Integer.MAX_VALUE, status)); - } - - public AppointmentParticipantComponent copy() { - AppointmentParticipantComponent dst = new AppointmentParticipantComponent(); - copyValues(dst); - if (type != null) { - dst.type = new ArrayList(); - for (CodeableConcept i : type) - dst.type.add(i.copy()); - }; - dst.actor = actor == null ? null : actor.copy(); - dst.required = required == null ? null : required.copy(); - dst.status = status == null ? null : status.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AppointmentParticipantComponent)) - return false; - AppointmentParticipantComponent o = (AppointmentParticipantComponent) other; - return compareDeep(type, o.type, true) && compareDeep(actor, o.actor, true) && compareDeep(required, o.required, true) - && compareDeep(status, o.status, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AppointmentParticipantComponent)) - return false; - AppointmentParticipantComponent o = (AppointmentParticipantComponent) other; - return compareValues(required, o.required, true) && compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (actor == null || actor.isEmpty()) - && (required == null || required.isEmpty()) && (status == null || status.isEmpty()); - } - - } - - /** - * This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External Ids for this item", formalDefinition="This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) - protected List identifier; - - /** - * The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="pending | booked | arrived | fulfilled | cancelled | noshow", formalDefinition="The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status." ) - protected Enumeration status; - - /** - * The type of appointment that is being booked (This may also be associated with participants for location, and/or a HealthcareService). - */ - @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="The type of appointment that is being booked", formalDefinition="The type of appointment that is being booked (This may also be associated with participants for location, and/or a HealthcareService)." ) - protected CodeableConcept type; - - /** - * The reason that this appointment is being scheduled, this is more clinical than administrative. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="The reason that this appointment is being scheduled, this is more clinical than administrative", formalDefinition="The reason that this appointment is being scheduled, this is more clinical than administrative." ) - protected CodeableConcept reason; - - /** - * The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority). - */ - @Child(name = "priority", type = {UnsignedIntType.class}, order=4, min=0, max=1) - @Description(shortDefinition="The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority)", formalDefinition="The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority)." ) - protected UnsignedIntType priority; - - /** - * The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field. - */ - @Child(name = "description", type = {StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field", formalDefinition="The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field." ) - protected StringType description; - - /** - * Date/Time that the appointment is to take place. - */ - @Child(name = "start", type = {InstantType.class}, order=6, min=1, max=1) - @Description(shortDefinition="Date/Time that the appointment is to take place", formalDefinition="Date/Time that the appointment is to take place." ) - protected InstantType start; - - /** - * Date/Time that the appointment is to conclude. - */ - @Child(name = "end", type = {InstantType.class}, order=7, min=1, max=1) - @Description(shortDefinition="Date/Time that the appointment is to conclude", formalDefinition="Date/Time that the appointment is to conclude." ) - protected InstantType end; - - /** - * The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot. - */ - @Child(name = "slot", type = {Slot.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot", formalDefinition="The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot." ) - protected List slot; - /** - * The actual objects that are the target of the reference (The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) - */ - protected List slotTarget; - - - /** - * Additional comments about the appointment. - */ - @Child(name = "comment", type = {StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Additional comments about the appointment", formalDefinition="Additional comments about the appointment." ) - protected StringType comment; - - /** - * An Order that lead to the creation of this appointment. - */ - @Child(name = "order", type = {Order.class}, order=10, min=0, max=1) - @Description(shortDefinition="An Order that lead to the creation of this appointment", formalDefinition="An Order that lead to the creation of this appointment." ) - protected Reference order; - - /** - * The actual object that is the target of the reference (An Order that lead to the creation of this appointment.) - */ - protected Order orderTarget; - - /** - * List of participants involved in the appointment. - */ - @Child(name = "participant", type = {}, order=11, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of participants involved in the appointment", formalDefinition="List of participants involved in the appointment." ) - protected List participant; - - private static final long serialVersionUID = -1809603254L; - - /* - * Constructor - */ - public Appointment() { - super(); - } - - /* - * Constructor - */ - public Appointment(Enumeration status, InstantType start, InstantType end) { - super(); - this.status = status; - this.start = start; - this.end = end; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Appointment addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #status} (The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new AppointmentstatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Appointment setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status. - */ - public Appointmentstatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status. - */ - public Appointment setStatus(Appointmentstatus value) { - if (this.status == null) - this.status = new Enumeration(new AppointmentstatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of appointment that is being booked (This may also be associated with participants for location, and/or a HealthcareService).) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of appointment that is being booked (This may also be associated with participants for location, and/or a HealthcareService).) - */ - public Appointment setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #reason} (The reason that this appointment is being scheduled, this is more clinical than administrative.) - */ - public CodeableConcept getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new CodeableConcept(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (The reason that this appointment is being scheduled, this is more clinical than administrative.) - */ - public Appointment setReason(CodeableConcept value) { - this.reason = value; - return this; - } - - /** - * @return {@link #priority} (The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority).). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public UnsignedIntType getPriorityElement() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new UnsignedIntType(); // bb - return this.priority; - } - - public boolean hasPriorityElement() { - return this.priority != null && !this.priority.isEmpty(); - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority).). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public Appointment setPriorityElement(UnsignedIntType value) { - this.priority = value; - return this; - } - - /** - * @return The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority). - */ - public int getPriority() { - return this.priority == null || this.priority.isEmpty() ? 0 : this.priority.getValue(); - } - - /** - * @param value The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority). - */ - public Appointment setPriority(int value) { - if (this.priority == null) - this.priority = new UnsignedIntType(); - this.priority.setValue(value); - return this; - } - - /** - * @return {@link #description} (The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public Appointment setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field. - */ - public Appointment setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #start} (Date/Time that the appointment is to take place.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public InstantType getStartElement() { - if (this.start == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.start"); - else if (Configuration.doAutoCreate()) - this.start = new InstantType(); // bb - return this.start; - } - - public boolean hasStartElement() { - return this.start != null && !this.start.isEmpty(); - } - - public boolean hasStart() { - return this.start != null && !this.start.isEmpty(); - } - - /** - * @param value {@link #start} (Date/Time that the appointment is to take place.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public Appointment setStartElement(InstantType value) { - this.start = value; - return this; - } - - /** - * @return Date/Time that the appointment is to take place. - */ - public Date getStart() { - return this.start == null ? null : this.start.getValue(); - } - - /** - * @param value Date/Time that the appointment is to take place. - */ - public Appointment setStart(Date value) { - if (this.start == null) - this.start = new InstantType(); - this.start.setValue(value); - return this; - } - - /** - * @return {@link #end} (Date/Time that the appointment is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public InstantType getEndElement() { - if (this.end == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.end"); - else if (Configuration.doAutoCreate()) - this.end = new InstantType(); // bb - return this.end; - } - - public boolean hasEndElement() { - return this.end != null && !this.end.isEmpty(); - } - - public boolean hasEnd() { - return this.end != null && !this.end.isEmpty(); - } - - /** - * @param value {@link #end} (Date/Time that the appointment is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public Appointment setEndElement(InstantType value) { - this.end = value; - return this; - } - - /** - * @return Date/Time that the appointment is to conclude. - */ - public Date getEnd() { - return this.end == null ? null : this.end.getValue(); - } - - /** - * @param value Date/Time that the appointment is to conclude. - */ - public Appointment setEnd(Date value) { - if (this.end == null) - this.end = new InstantType(); - this.end.setValue(value); - return this; - } - - /** - * @return {@link #slot} (The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) - */ - public List getSlot() { - if (this.slot == null) - this.slot = new ArrayList(); - return this.slot; - } - - public boolean hasSlot() { - if (this.slot == null) - return false; - for (Reference item : this.slot) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #slot} (The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) - */ - // syntactic sugar - public Reference addSlot() { //3 - Reference t = new Reference(); - if (this.slot == null) - this.slot = new ArrayList(); - this.slot.add(t); - return t; - } - - // syntactic sugar - public Appointment addSlot(Reference t) { //3 - if (t == null) - return this; - if (this.slot == null) - this.slot = new ArrayList(); - this.slot.add(t); - return this; - } - - /** - * @return {@link #slot} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) - */ - public List getSlotTarget() { - if (this.slotTarget == null) - this.slotTarget = new ArrayList(); - return this.slotTarget; - } - - // syntactic sugar - /** - * @return {@link #slot} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) - */ - public Slot addSlotTarget() { - Slot r = new Slot(); - if (this.slotTarget == null) - this.slotTarget = new ArrayList(); - this.slotTarget.add(r); - return r; - } - - /** - * @return {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); // bb - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public Appointment setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return Additional comments about the appointment. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value Additional comments about the appointment. - */ - public Appointment setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - /** - * @return {@link #order} (An Order that lead to the creation of this appointment.) - */ - public Reference getOrder() { - if (this.order == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.order"); - else if (Configuration.doAutoCreate()) - this.order = new Reference(); // cc - return this.order; - } - - public boolean hasOrder() { - return this.order != null && !this.order.isEmpty(); - } - - /** - * @param value {@link #order} (An Order that lead to the creation of this appointment.) - */ - public Appointment setOrder(Reference value) { - this.order = value; - return this; - } - - /** - * @return {@link #order} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An Order that lead to the creation of this appointment.) - */ - public Order getOrderTarget() { - if (this.orderTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.order"); - else if (Configuration.doAutoCreate()) - this.orderTarget = new Order(); // aa - return this.orderTarget; - } - - /** - * @param value {@link #order} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An Order that lead to the creation of this appointment.) - */ - public Appointment setOrderTarget(Order value) { - this.orderTarget = value; - return this; - } - - /** - * @return {@link #participant} (List of participants involved in the appointment.) - */ - public List getParticipant() { - if (this.participant == null) - this.participant = new ArrayList(); - return this.participant; - } - - public boolean hasParticipant() { - if (this.participant == null) - return false; - for (AppointmentParticipantComponent item : this.participant) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #participant} (List of participants involved in the appointment.) - */ - // syntactic sugar - public AppointmentParticipantComponent addParticipant() { //3 - AppointmentParticipantComponent t = new AppointmentParticipantComponent(); - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return t; - } - - // syntactic sugar - public Appointment addParticipant(AppointmentParticipantComponent t) { //3 - if (t == null) - return this; - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("type", "CodeableConcept", "The type of appointment that is being booked (This may also be associated with participants for location, and/or a HealthcareService).", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("reason", "CodeableConcept", "The reason that this appointment is being scheduled, this is more clinical than administrative.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("priority", "unsignedInt", "The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority).", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("description", "string", "The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("start", "instant", "Date/Time that the appointment is to take place.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("end", "instant", "Date/Time that the appointment is to conclude.", 0, java.lang.Integer.MAX_VALUE, end)); - childrenList.add(new Property("slot", "Reference(Slot)", "The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.", 0, java.lang.Integer.MAX_VALUE, slot)); - childrenList.add(new Property("comment", "string", "Additional comments about the appointment.", 0, java.lang.Integer.MAX_VALUE, comment)); - childrenList.add(new Property("order", "Reference(Order)", "An Order that lead to the creation of this appointment.", 0, java.lang.Integer.MAX_VALUE, order)); - childrenList.add(new Property("participant", "", "List of participants involved in the appointment.", 0, java.lang.Integer.MAX_VALUE, participant)); - } - - public Appointment copy() { - Appointment dst = new Appointment(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.type = type == null ? null : type.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.priority = priority == null ? null : priority.copy(); - dst.description = description == null ? null : description.copy(); - dst.start = start == null ? null : start.copy(); - dst.end = end == null ? null : end.copy(); - if (slot != null) { - dst.slot = new ArrayList(); - for (Reference i : slot) - dst.slot.add(i.copy()); - }; - dst.comment = comment == null ? null : comment.copy(); - dst.order = order == null ? null : order.copy(); - if (participant != null) { - dst.participant = new ArrayList(); - for (AppointmentParticipantComponent i : participant) - dst.participant.add(i.copy()); - }; - return dst; - } - - protected Appointment typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Appointment)) - return false; - Appointment o = (Appointment) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(type, o.type, true) - && compareDeep(reason, o.reason, true) && compareDeep(priority, o.priority, true) && compareDeep(description, o.description, true) - && compareDeep(start, o.start, true) && compareDeep(end, o.end, true) && compareDeep(slot, o.slot, true) - && compareDeep(comment, o.comment, true) && compareDeep(order, o.order, true) && compareDeep(participant, o.participant, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Appointment)) - return false; - Appointment o = (Appointment) other; - return compareValues(status, o.status, true) && compareValues(priority, o.priority, true) && compareValues(description, o.description, true) - && compareValues(start, o.start, true) && compareValues(end, o.end, true) && compareValues(comment, o.comment, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (type == null || type.isEmpty()) && (reason == null || reason.isEmpty()) && (priority == null || priority.isEmpty()) - && (description == null || description.isEmpty()) && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) - && (slot == null || slot.isEmpty()) && (comment == null || comment.isEmpty()) && (order == null || order.isEmpty()) - && (participant == null || participant.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Appointment; - } - - @SearchParamDefinition(name="partstatus", path="Appointment.participant.status", description="The Participation status of the subject, or other participant on the appointment. Can be used to locate participants that have not responded to meeting requests.", type="token" ) - public static final String SP_PARTSTATUS = "partstatus"; - @SearchParamDefinition(name="patient", path="Appointment.participant.actor", description="One of the individuals of the appointment is this patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="practitioner", path="Appointment.participant.actor", description="One of the individuals of the appointment is this practitioner", type="reference" ) - public static final String SP_PRACTITIONER = "practitioner"; - @SearchParamDefinition(name="location", path="Appointment.participant.actor", description="This location is listed in the participants of the appointment", type="reference" ) - public static final String SP_LOCATION = "location"; - @SearchParamDefinition(name="status", path="Appointment.status", description="The overall status of the appointment", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="actor", path="Appointment.participant.actor", description="Any one of the individuals participating in the appointment", type="reference" ) - public static final String SP_ACTOR = "actor"; - @SearchParamDefinition(name="date", path="Appointment.start", description="Appointment date/time.", type="date" ) - public static final String SP_DATE = "date"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). + */ +@ResourceDef(name="Appointment", profile="http://hl7.org/fhir/Profile/Appointment") +public class Appointment extends DomainResource { + + public enum Appointmentstatus { + /** + * Some or all of the participant(s) have not finalized their acceptance of the appointment request. + */ + PENDING, + /** + * All participant(s) have been considered and the appointment is confirmed to go ahead at the date/times specified. + */ + BOOKED, + /** + * Some of the patients have arrived. + */ + ARRIVED, + /** + * This appointment has completed and may have resulted in an encounter. + */ + FULFILLED, + /** + * The appointment has been cancelled. + */ + CANCELLED, + /** + * Some or all of the participant(s) have not/did not appear for the appointment (usually the patient). + */ + NOSHOW, + /** + * added to help the parsers + */ + NULL; + public static Appointmentstatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("pending".equals(codeString)) + return PENDING; + if ("booked".equals(codeString)) + return BOOKED; + if ("arrived".equals(codeString)) + return ARRIVED; + if ("fulfilled".equals(codeString)) + return FULFILLED; + if ("cancelled".equals(codeString)) + return CANCELLED; + if ("noshow".equals(codeString)) + return NOSHOW; + throw new Exception("Unknown Appointmentstatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PENDING: return "pending"; + case BOOKED: return "booked"; + case ARRIVED: return "arrived"; + case FULFILLED: return "fulfilled"; + case CANCELLED: return "cancelled"; + case NOSHOW: return "noshow"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PENDING: return ""; + case BOOKED: return ""; + case ARRIVED: return ""; + case FULFILLED: return ""; + case CANCELLED: return ""; + case NOSHOW: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PENDING: return "Some or all of the participant(s) have not finalized their acceptance of the appointment request."; + case BOOKED: return "All participant(s) have been considered and the appointment is confirmed to go ahead at the date/times specified."; + case ARRIVED: return "Some of the patients have arrived."; + case FULFILLED: return "This appointment has completed and may have resulted in an encounter."; + case CANCELLED: return "The appointment has been cancelled."; + case NOSHOW: return "Some or all of the participant(s) have not/did not appear for the appointment (usually the patient)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PENDING: return "Pending"; + case BOOKED: return "Booked"; + case ARRIVED: return "Arrived"; + case FULFILLED: return "Fulfilled"; + case CANCELLED: return "Cancelled"; + case NOSHOW: return "No Show"; + default: return "?"; + } + } + } + + public static class AppointmentstatusEnumFactory implements EnumFactory { + public Appointmentstatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("pending".equals(codeString)) + return Appointmentstatus.PENDING; + if ("booked".equals(codeString)) + return Appointmentstatus.BOOKED; + if ("arrived".equals(codeString)) + return Appointmentstatus.ARRIVED; + if ("fulfilled".equals(codeString)) + return Appointmentstatus.FULFILLED; + if ("cancelled".equals(codeString)) + return Appointmentstatus.CANCELLED; + if ("noshow".equals(codeString)) + return Appointmentstatus.NOSHOW; + throw new IllegalArgumentException("Unknown Appointmentstatus code '"+codeString+"'"); + } + public String toCode(Appointmentstatus code) { + if (code == Appointmentstatus.PENDING) + return "pending"; + if (code == Appointmentstatus.BOOKED) + return "booked"; + if (code == Appointmentstatus.ARRIVED) + return "arrived"; + if (code == Appointmentstatus.FULFILLED) + return "fulfilled"; + if (code == Appointmentstatus.CANCELLED) + return "cancelled"; + if (code == Appointmentstatus.NOSHOW) + return "noshow"; + return "?"; + } + } + + public enum Participantrequired { + /** + * The participant is required to attend the appointment. + */ + REQUIRED, + /** + * The participant may optionally attend the appointment. + */ + OPTIONAL, + /** + * The participant is excluded from the appointment, and may not be informed of the appointment taking place. (appointment is about them, not for them - such as 2 doctors discussing results about a patient's test). + */ + INFORMATIONONLY, + /** + * added to help the parsers + */ + NULL; + public static Participantrequired fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("required".equals(codeString)) + return REQUIRED; + if ("optional".equals(codeString)) + return OPTIONAL; + if ("information-only".equals(codeString)) + return INFORMATIONONLY; + throw new Exception("Unknown Participantrequired code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case REQUIRED: return "required"; + case OPTIONAL: return "optional"; + case INFORMATIONONLY: return "information-only"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REQUIRED: return ""; + case OPTIONAL: return ""; + case INFORMATIONONLY: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REQUIRED: return "The participant is required to attend the appointment."; + case OPTIONAL: return "The participant may optionally attend the appointment."; + case INFORMATIONONLY: return "The participant is excluded from the appointment, and may not be informed of the appointment taking place. (appointment is about them, not for them - such as 2 doctors discussing results about a patient's test)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REQUIRED: return "Required"; + case OPTIONAL: return "Optional"; + case INFORMATIONONLY: return "Information Only"; + default: return "?"; + } + } + } + + public static class ParticipantrequiredEnumFactory implements EnumFactory { + public Participantrequired fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("required".equals(codeString)) + return Participantrequired.REQUIRED; + if ("optional".equals(codeString)) + return Participantrequired.OPTIONAL; + if ("information-only".equals(codeString)) + return Participantrequired.INFORMATIONONLY; + throw new IllegalArgumentException("Unknown Participantrequired code '"+codeString+"'"); + } + public String toCode(Participantrequired code) { + if (code == Participantrequired.REQUIRED) + return "required"; + if (code == Participantrequired.OPTIONAL) + return "optional"; + if (code == Participantrequired.INFORMATIONONLY) + return "information-only"; + return "?"; + } + } + + public enum Participationstatus { + /** + * The participant has accepted the appointment. + */ + ACCEPTED, + /** + * The participant has declined the appointment and will not participate in the appointment. + */ + DECLINED, + /** + * The participant has tentatively accepted the appointment. This could be automatically created by a system and requires further processing before it can be accepted. There is no commitment that attendance will occur. + */ + TENTATIVE, + /** + * The participant needs to indicate if they accept the appointment by changing this status to one of the other statuses. + */ + NEEDSACTION, + /** + * added to help the parsers + */ + NULL; + public static Participationstatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("accepted".equals(codeString)) + return ACCEPTED; + if ("declined".equals(codeString)) + return DECLINED; + if ("tentative".equals(codeString)) + return TENTATIVE; + if ("needs-action".equals(codeString)) + return NEEDSACTION; + throw new Exception("Unknown Participationstatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ACCEPTED: return "accepted"; + case DECLINED: return "declined"; + case TENTATIVE: return "tentative"; + case NEEDSACTION: return "needs-action"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACCEPTED: return ""; + case DECLINED: return ""; + case TENTATIVE: return ""; + case NEEDSACTION: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACCEPTED: return "The participant has accepted the appointment."; + case DECLINED: return "The participant has declined the appointment and will not participate in the appointment."; + case TENTATIVE: return "The participant has tentatively accepted the appointment. This could be automatically created by a system and requires further processing before it can be accepted. There is no commitment that attendance will occur."; + case NEEDSACTION: return "The participant needs to indicate if they accept the appointment by changing this status to one of the other statuses."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACCEPTED: return "Accepted"; + case DECLINED: return "Declined"; + case TENTATIVE: return "Tentative"; + case NEEDSACTION: return "Needs Action"; + default: return "?"; + } + } + } + + public static class ParticipationstatusEnumFactory implements EnumFactory { + public Participationstatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("accepted".equals(codeString)) + return Participationstatus.ACCEPTED; + if ("declined".equals(codeString)) + return Participationstatus.DECLINED; + if ("tentative".equals(codeString)) + return Participationstatus.TENTATIVE; + if ("needs-action".equals(codeString)) + return Participationstatus.NEEDSACTION; + throw new IllegalArgumentException("Unknown Participationstatus code '"+codeString+"'"); + } + public String toCode(Participationstatus code) { + if (code == Participationstatus.ACCEPTED) + return "accepted"; + if (code == Participationstatus.DECLINED) + return "declined"; + if (code == Participationstatus.TENTATIVE) + return "tentative"; + if (code == Participationstatus.NEEDSACTION) + return "needs-action"; + return "?"; + } + } + + @Block() + public static class AppointmentParticipantComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Role of participant in the appointment. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Role of participant in the appointment", formalDefinition="Role of participant in the appointment." ) + protected List type; + + /** + * A Person, Location/HealthcareService or Device that is participating in the appointment. + */ + @Child(name = "actor", type = {Patient.class, Practitioner.class, RelatedPerson.class, Device.class, HealthcareService.class, Location.class}, order=2, min=0, max=1) + @Description(shortDefinition="A Person, Location/HealthcareService or Device that is participating in the appointment", formalDefinition="A Person, Location/HealthcareService or Device that is participating in the appointment." ) + protected Reference actor; + + /** + * The actual object that is the target of the reference (A Person, Location/HealthcareService or Device that is participating in the appointment.) + */ + protected Resource actorTarget; + + /** + * Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present. + */ + @Child(name = "required", type = {CodeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="required | optional | information-only", formalDefinition="Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present." ) + protected Enumeration required; + + /** + * Participation status of the Patient. + */ + @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1) + @Description(shortDefinition="accepted | declined | tentative | needs-action", formalDefinition="Participation status of the Patient." ) + protected Enumeration status; + + private static final long serialVersionUID = -1009855227L; + + /* + * Constructor + */ + public AppointmentParticipantComponent() { + super(); + } + + /* + * Constructor + */ + public AppointmentParticipantComponent(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #type} (Role of participant in the appointment.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (CodeableConcept item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (Role of participant in the appointment.) + */ + // syntactic sugar + public CodeableConcept addType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + // syntactic sugar + public AppointmentParticipantComponent addType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + /** + * @return {@link #actor} (A Person, Location/HealthcareService or Device that is participating in the appointment.) + */ + public Reference getActor() { + if (this.actor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentParticipantComponent.actor"); + else if (Configuration.doAutoCreate()) + this.actor = new Reference(); // cc + return this.actor; + } + + public boolean hasActor() { + return this.actor != null && !this.actor.isEmpty(); + } + + /** + * @param value {@link #actor} (A Person, Location/HealthcareService or Device that is participating in the appointment.) + */ + public AppointmentParticipantComponent setActor(Reference value) { + this.actor = value; + return this; + } + + /** + * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A Person, Location/HealthcareService or Device that is participating in the appointment.) + */ + public Resource getActorTarget() { + return this.actorTarget; + } + + /** + * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A Person, Location/HealthcareService or Device that is participating in the appointment.) + */ + public AppointmentParticipantComponent setActorTarget(Resource value) { + this.actorTarget = value; + return this; + } + + /** + * @return {@link #required} (Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value + */ + public Enumeration getRequiredElement() { + if (this.required == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentParticipantComponent.required"); + else if (Configuration.doAutoCreate()) + this.required = new Enumeration(new ParticipantrequiredEnumFactory()); // bb + return this.required; + } + + public boolean hasRequiredElement() { + return this.required != null && !this.required.isEmpty(); + } + + public boolean hasRequired() { + return this.required != null && !this.required.isEmpty(); + } + + /** + * @param value {@link #required} (Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value + */ + public AppointmentParticipantComponent setRequiredElement(Enumeration value) { + this.required = value; + return this; + } + + /** + * @return Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present. + */ + public Participantrequired getRequired() { + return this.required == null ? null : this.required.getValue(); + } + + /** + * @param value Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present. + */ + public AppointmentParticipantComponent setRequired(Participantrequired value) { + if (value == null) + this.required = null; + else { + if (this.required == null) + this.required = new Enumeration(new ParticipantrequiredEnumFactory()); + this.required.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (Participation status of the Patient.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentParticipantComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ParticipationstatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (Participation status of the Patient.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public AppointmentParticipantComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Participation status of the Patient. + */ + public Participationstatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Participation status of the Patient. + */ + public AppointmentParticipantComponent setStatus(Participationstatus value) { + if (this.status == null) + this.status = new Enumeration(new ParticipationstatusEnumFactory()); + this.status.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "Role of participant in the appointment.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("actor", "Reference(Patient|Practitioner|RelatedPerson|Device|HealthcareService|Location)", "A Person, Location/HealthcareService or Device that is participating in the appointment.", 0, java.lang.Integer.MAX_VALUE, actor)); + childrenList.add(new Property("required", "code", "Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.", 0, java.lang.Integer.MAX_VALUE, required)); + childrenList.add(new Property("status", "code", "Participation status of the Patient.", 0, java.lang.Integer.MAX_VALUE, status)); + } + + public AppointmentParticipantComponent copy() { + AppointmentParticipantComponent dst = new AppointmentParticipantComponent(); + copyValues(dst); + if (type != null) { + dst.type = new ArrayList(); + for (CodeableConcept i : type) + dst.type.add(i.copy()); + }; + dst.actor = actor == null ? null : actor.copy(); + dst.required = required == null ? null : required.copy(); + dst.status = status == null ? null : status.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AppointmentParticipantComponent)) + return false; + AppointmentParticipantComponent o = (AppointmentParticipantComponent) other; + return compareDeep(type, o.type, true) && compareDeep(actor, o.actor, true) && compareDeep(required, o.required, true) + && compareDeep(status, o.status, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AppointmentParticipantComponent)) + return false; + AppointmentParticipantComponent o = (AppointmentParticipantComponent) other; + return compareValues(required, o.required, true) && compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (actor == null || actor.isEmpty()) + && (required == null || required.isEmpty()) && (status == null || status.isEmpty()); + } + + } + + /** + * This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Ids for this item", formalDefinition="This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) + protected List identifier; + + /** + * The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="pending | booked | arrived | fulfilled | cancelled | noshow", formalDefinition="The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status." ) + protected Enumeration status; + + /** + * The type of appointment that is being booked (This may also be associated with participants for location, and/or a HealthcareService). + */ + @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="The type of appointment that is being booked", formalDefinition="The type of appointment that is being booked (This may also be associated with participants for location, and/or a HealthcareService)." ) + protected CodeableConcept type; + + /** + * The reason that this appointment is being scheduled, this is more clinical than administrative. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="The reason that this appointment is being scheduled, this is more clinical than administrative", formalDefinition="The reason that this appointment is being scheduled, this is more clinical than administrative." ) + protected CodeableConcept reason; + + /** + * The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority). + */ + @Child(name = "priority", type = {UnsignedIntType.class}, order=4, min=0, max=1) + @Description(shortDefinition="The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority)", formalDefinition="The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority)." ) + protected UnsignedIntType priority; + + /** + * The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field. + */ + @Child(name = "description", type = {StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field", formalDefinition="The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field." ) + protected StringType description; + + /** + * Date/Time that the appointment is to take place. + */ + @Child(name = "start", type = {InstantType.class}, order=6, min=1, max=1) + @Description(shortDefinition="Date/Time that the appointment is to take place", formalDefinition="Date/Time that the appointment is to take place." ) + protected InstantType start; + + /** + * Date/Time that the appointment is to conclude. + */ + @Child(name = "end", type = {InstantType.class}, order=7, min=1, max=1) + @Description(shortDefinition="Date/Time that the appointment is to conclude", formalDefinition="Date/Time that the appointment is to conclude." ) + protected InstantType end; + + /** + * The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot. + */ + @Child(name = "slot", type = {Slot.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot", formalDefinition="The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot." ) + protected List slot; + /** + * The actual objects that are the target of the reference (The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) + */ + protected List slotTarget; + + + /** + * Additional comments about the appointment. + */ + @Child(name = "comment", type = {StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Additional comments about the appointment", formalDefinition="Additional comments about the appointment." ) + protected StringType comment; + + /** + * An Order that lead to the creation of this appointment. + */ + @Child(name = "order", type = {Order.class}, order=10, min=0, max=1) + @Description(shortDefinition="An Order that lead to the creation of this appointment", formalDefinition="An Order that lead to the creation of this appointment." ) + protected Reference order; + + /** + * The actual object that is the target of the reference (An Order that lead to the creation of this appointment.) + */ + protected Order orderTarget; + + /** + * List of participants involved in the appointment. + */ + @Child(name = "participant", type = {}, order=11, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of participants involved in the appointment", formalDefinition="List of participants involved in the appointment." ) + protected List participant; + + private static final long serialVersionUID = -1809603254L; + + /* + * Constructor + */ + public Appointment() { + super(); + } + + /* + * Constructor + */ + public Appointment(Enumeration status, InstantType start, InstantType end) { + super(); + this.status = status; + this.start = start; + this.end = end; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Appointment addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #status} (The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new AppointmentstatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Appointment setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status. + */ + public Appointmentstatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status. + */ + public Appointment setStatus(Appointmentstatus value) { + if (this.status == null) + this.status = new Enumeration(new AppointmentstatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of appointment that is being booked (This may also be associated with participants for location, and/or a HealthcareService).) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of appointment that is being booked (This may also be associated with participants for location, and/or a HealthcareService).) + */ + public Appointment setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #reason} (The reason that this appointment is being scheduled, this is more clinical than administrative.) + */ + public CodeableConcept getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new CodeableConcept(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (The reason that this appointment is being scheduled, this is more clinical than administrative.) + */ + public Appointment setReason(CodeableConcept value) { + this.reason = value; + return this; + } + + /** + * @return {@link #priority} (The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority).). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public UnsignedIntType getPriorityElement() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new UnsignedIntType(); // bb + return this.priority; + } + + public boolean hasPriorityElement() { + return this.priority != null && !this.priority.isEmpty(); + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority).). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public Appointment setPriorityElement(UnsignedIntType value) { + this.priority = value; + return this; + } + + /** + * @return The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority). + */ + public int getPriority() { + return this.priority == null || this.priority.isEmpty() ? 0 : this.priority.getValue(); + } + + /** + * @param value The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority). + */ + public Appointment setPriority(int value) { + if (this.priority == null) + this.priority = new UnsignedIntType(); + this.priority.setValue(value); + return this; + } + + /** + * @return {@link #description} (The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public Appointment setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field. + */ + public Appointment setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #start} (Date/Time that the appointment is to take place.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public InstantType getStartElement() { + if (this.start == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.start"); + else if (Configuration.doAutoCreate()) + this.start = new InstantType(); // bb + return this.start; + } + + public boolean hasStartElement() { + return this.start != null && !this.start.isEmpty(); + } + + public boolean hasStart() { + return this.start != null && !this.start.isEmpty(); + } + + /** + * @param value {@link #start} (Date/Time that the appointment is to take place.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public Appointment setStartElement(InstantType value) { + this.start = value; + return this; + } + + /** + * @return Date/Time that the appointment is to take place. + */ + public Date getStart() { + return this.start == null ? null : this.start.getValue(); + } + + /** + * @param value Date/Time that the appointment is to take place. + */ + public Appointment setStart(Date value) { + if (this.start == null) + this.start = new InstantType(); + this.start.setValue(value); + return this; + } + + /** + * @return {@link #end} (Date/Time that the appointment is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public InstantType getEndElement() { + if (this.end == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.end"); + else if (Configuration.doAutoCreate()) + this.end = new InstantType(); // bb + return this.end; + } + + public boolean hasEndElement() { + return this.end != null && !this.end.isEmpty(); + } + + public boolean hasEnd() { + return this.end != null && !this.end.isEmpty(); + } + + /** + * @param value {@link #end} (Date/Time that the appointment is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public Appointment setEndElement(InstantType value) { + this.end = value; + return this; + } + + /** + * @return Date/Time that the appointment is to conclude. + */ + public Date getEnd() { + return this.end == null ? null : this.end.getValue(); + } + + /** + * @param value Date/Time that the appointment is to conclude. + */ + public Appointment setEnd(Date value) { + if (this.end == null) + this.end = new InstantType(); + this.end.setValue(value); + return this; + } + + /** + * @return {@link #slot} (The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) + */ + public List getSlot() { + if (this.slot == null) + this.slot = new ArrayList(); + return this.slot; + } + + public boolean hasSlot() { + if (this.slot == null) + return false; + for (Reference item : this.slot) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #slot} (The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) + */ + // syntactic sugar + public Reference addSlot() { //3 + Reference t = new Reference(); + if (this.slot == null) + this.slot = new ArrayList(); + this.slot.add(t); + return t; + } + + // syntactic sugar + public Appointment addSlot(Reference t) { //3 + if (t == null) + return this; + if (this.slot == null) + this.slot = new ArrayList(); + this.slot.add(t); + return this; + } + + /** + * @return {@link #slot} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) + */ + public List getSlotTarget() { + if (this.slotTarget == null) + this.slotTarget = new ArrayList(); + return this.slotTarget; + } + + // syntactic sugar + /** + * @return {@link #slot} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) + */ + public Slot addSlotTarget() { + Slot r = new Slot(); + if (this.slotTarget == null) + this.slotTarget = new ArrayList(); + this.slotTarget.add(r); + return r; + } + + /** + * @return {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); // bb + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public Appointment setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return Additional comments about the appointment. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value Additional comments about the appointment. + */ + public Appointment setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + /** + * @return {@link #order} (An Order that lead to the creation of this appointment.) + */ + public Reference getOrder() { + if (this.order == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.order"); + else if (Configuration.doAutoCreate()) + this.order = new Reference(); // cc + return this.order; + } + + public boolean hasOrder() { + return this.order != null && !this.order.isEmpty(); + } + + /** + * @param value {@link #order} (An Order that lead to the creation of this appointment.) + */ + public Appointment setOrder(Reference value) { + this.order = value; + return this; + } + + /** + * @return {@link #order} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An Order that lead to the creation of this appointment.) + */ + public Order getOrderTarget() { + if (this.orderTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.order"); + else if (Configuration.doAutoCreate()) + this.orderTarget = new Order(); // aa + return this.orderTarget; + } + + /** + * @param value {@link #order} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An Order that lead to the creation of this appointment.) + */ + public Appointment setOrderTarget(Order value) { + this.orderTarget = value; + return this; + } + + /** + * @return {@link #participant} (List of participants involved in the appointment.) + */ + public List getParticipant() { + if (this.participant == null) + this.participant = new ArrayList(); + return this.participant; + } + + public boolean hasParticipant() { + if (this.participant == null) + return false; + for (AppointmentParticipantComponent item : this.participant) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #participant} (List of participants involved in the appointment.) + */ + // syntactic sugar + public AppointmentParticipantComponent addParticipant() { //3 + AppointmentParticipantComponent t = new AppointmentParticipantComponent(); + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return t; + } + + // syntactic sugar + public Appointment addParticipant(AppointmentParticipantComponent t) { //3 + if (t == null) + return this; + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("type", "CodeableConcept", "The type of appointment that is being booked (This may also be associated with participants for location, and/or a HealthcareService).", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("reason", "CodeableConcept", "The reason that this appointment is being scheduled, this is more clinical than administrative.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("priority", "unsignedInt", "The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority).", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("description", "string", "The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("start", "instant", "Date/Time that the appointment is to take place.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("end", "instant", "Date/Time that the appointment is to conclude.", 0, java.lang.Integer.MAX_VALUE, end)); + childrenList.add(new Property("slot", "Reference(Slot)", "The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.", 0, java.lang.Integer.MAX_VALUE, slot)); + childrenList.add(new Property("comment", "string", "Additional comments about the appointment.", 0, java.lang.Integer.MAX_VALUE, comment)); + childrenList.add(new Property("order", "Reference(Order)", "An Order that lead to the creation of this appointment.", 0, java.lang.Integer.MAX_VALUE, order)); + childrenList.add(new Property("participant", "", "List of participants involved in the appointment.", 0, java.lang.Integer.MAX_VALUE, participant)); + } + + public Appointment copy() { + Appointment dst = new Appointment(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.type = type == null ? null : type.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.priority = priority == null ? null : priority.copy(); + dst.description = description == null ? null : description.copy(); + dst.start = start == null ? null : start.copy(); + dst.end = end == null ? null : end.copy(); + if (slot != null) { + dst.slot = new ArrayList(); + for (Reference i : slot) + dst.slot.add(i.copy()); + }; + dst.comment = comment == null ? null : comment.copy(); + dst.order = order == null ? null : order.copy(); + if (participant != null) { + dst.participant = new ArrayList(); + for (AppointmentParticipantComponent i : participant) + dst.participant.add(i.copy()); + }; + return dst; + } + + protected Appointment typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Appointment)) + return false; + Appointment o = (Appointment) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(type, o.type, true) + && compareDeep(reason, o.reason, true) && compareDeep(priority, o.priority, true) && compareDeep(description, o.description, true) + && compareDeep(start, o.start, true) && compareDeep(end, o.end, true) && compareDeep(slot, o.slot, true) + && compareDeep(comment, o.comment, true) && compareDeep(order, o.order, true) && compareDeep(participant, o.participant, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Appointment)) + return false; + Appointment o = (Appointment) other; + return compareValues(status, o.status, true) && compareValues(priority, o.priority, true) && compareValues(description, o.description, true) + && compareValues(start, o.start, true) && compareValues(end, o.end, true) && compareValues(comment, o.comment, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (type == null || type.isEmpty()) && (reason == null || reason.isEmpty()) && (priority == null || priority.isEmpty()) + && (description == null || description.isEmpty()) && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) + && (slot == null || slot.isEmpty()) && (comment == null || comment.isEmpty()) && (order == null || order.isEmpty()) + && (participant == null || participant.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Appointment; + } + + @SearchParamDefinition(name="date", path="Appointment.start", description="Appointment date/time.", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="actor", path="Appointment.participant.actor", description="Any one of the individuals participating in the appointment", type="reference" ) + public static final String SP_ACTOR = "actor"; + @SearchParamDefinition(name="partstatus", path="Appointment.participant.status", description="The Participation status of the subject, or other participant on the appointment. Can be used to locate participants that have not responded to meeting requests.", type="token" ) + public static final String SP_PARTSTATUS = "partstatus"; + @SearchParamDefinition(name="practitioner", path="Appointment.participant.actor", description="One of the individuals of the appointment is this practitioner", type="reference" ) + public static final String SP_PRACTITIONER = "practitioner"; + @SearchParamDefinition(name="patient", path="Appointment.participant.actor", description="One of the individuals of the appointment is this patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="location", path="Appointment.participant.actor", description="This location is listed in the participants of the appointment", type="reference" ) + public static final String SP_LOCATION = "location"; + @SearchParamDefinition(name="status", path="Appointment.status", description="The overall status of the appointment", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/AppointmentResponse.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/AppointmentResponse.java index a2b9f986d6e..9aea79e3887 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/AppointmentResponse.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/AppointmentResponse.java @@ -1,725 +1,704 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. - */ -@ResourceDef(name="AppointmentResponse", profile="http://hl7.org/fhir/Profile/AppointmentResponse") -public class AppointmentResponse extends DomainResource { - - public enum Participantstatus { - /** - * The appointment participant has accepted that they can attend the appointment at the time specified in the AppointmentResponse. - */ - ACCEPTED, - /** - * The appointment participant has declined the appointment. - */ - DECLINED, - /** - * The appointment participant has tentatively accepted the appointment. - */ - TENTATIVE, - /** - * The participant has in-process the appointment. - */ - INPROCESS, - /** - * The participant has completed the appointment. - */ - COMPLETED, - /** - * This is the intitial status of an appointment participant until a participant has replied. It implies that there is no commitment for the appointment. - */ - NEEDSACTION, - /** - * added to help the parsers - */ - NULL; - public static Participantstatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("declined".equals(codeString)) - return DECLINED; - if ("tentative".equals(codeString)) - return TENTATIVE; - if ("in-process".equals(codeString)) - return INPROCESS; - if ("completed".equals(codeString)) - return COMPLETED; - if ("needs-action".equals(codeString)) - return NEEDSACTION; - throw new Exception("Unknown Participantstatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ACCEPTED: return "accepted"; - case DECLINED: return "declined"; - case TENTATIVE: return "tentative"; - case INPROCESS: return "in-process"; - case COMPLETED: return "completed"; - case NEEDSACTION: return "needs-action"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ACCEPTED: return ""; - case DECLINED: return ""; - case TENTATIVE: return ""; - case INPROCESS: return ""; - case COMPLETED: return ""; - case NEEDSACTION: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ACCEPTED: return "The appointment participant has accepted that they can attend the appointment at the time specified in the AppointmentResponse."; - case DECLINED: return "The appointment participant has declined the appointment."; - case TENTATIVE: return "The appointment participant has tentatively accepted the appointment."; - case INPROCESS: return "The participant has in-process the appointment."; - case COMPLETED: return "The participant has completed the appointment."; - case NEEDSACTION: return "This is the intitial status of an appointment participant until a participant has replied. It implies that there is no commitment for the appointment."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ACCEPTED: return "Accepted"; - case DECLINED: return "Declined"; - case TENTATIVE: return "Tentative"; - case INPROCESS: return "In Process"; - case COMPLETED: return "Completed"; - case NEEDSACTION: return "Needs Action"; - default: return "?"; - } - } - } - - public static class ParticipantstatusEnumFactory implements EnumFactory { - public Participantstatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("accepted".equals(codeString)) - return Participantstatus.ACCEPTED; - if ("declined".equals(codeString)) - return Participantstatus.DECLINED; - if ("tentative".equals(codeString)) - return Participantstatus.TENTATIVE; - if ("in-process".equals(codeString)) - return Participantstatus.INPROCESS; - if ("completed".equals(codeString)) - return Participantstatus.COMPLETED; - if ("needs-action".equals(codeString)) - return Participantstatus.NEEDSACTION; - throw new IllegalArgumentException("Unknown Participantstatus code '"+codeString+"'"); - } - public String toCode(Participantstatus code) { - if (code == Participantstatus.ACCEPTED) - return "accepted"; - if (code == Participantstatus.DECLINED) - return "declined"; - if (code == Participantstatus.TENTATIVE) - return "tentative"; - if (code == Participantstatus.INPROCESS) - return "in-process"; - if (code == Participantstatus.COMPLETED) - return "completed"; - if (code == Participantstatus.NEEDSACTION) - return "needs-action"; - return "?"; - } - } - - /** - * This records identifiers associated with this appointment response concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External Ids for this item", formalDefinition="This records identifiers associated with this appointment response concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate." ) - protected List identifier; - - /** - * Parent appointment that this response is replying to. - */ - @Child(name = "appointment", type = {Appointment.class}, order=1, min=1, max=1) - @Description(shortDefinition="Parent appointment that this response is replying to", formalDefinition="Parent appointment that this response is replying to." ) - protected Reference appointment; - - /** - * The actual object that is the target of the reference (Parent appointment that this response is replying to.) - */ - protected Appointment appointmentTarget; - - /** - * Role of participant in the appointment. - */ - @Child(name = "participantType", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Role of participant in the appointment", formalDefinition="Role of participant in the appointment." ) - protected List participantType; - - /** - * A Person, Location/HealthcareService or Device that is participating in the appointment. - */ - @Child(name = "actor", type = {Patient.class, Practitioner.class, RelatedPerson.class, Device.class, HealthcareService.class, Location.class}, order=3, min=0, max=1) - @Description(shortDefinition="A Person, Location/HealthcareService or Device that is participating in the appointment", formalDefinition="A Person, Location/HealthcareService or Device that is participating in the appointment." ) - protected Reference actor; - - /** - * The actual object that is the target of the reference (A Person, Location/HealthcareService or Device that is participating in the appointment.) - */ - protected Resource actorTarget; - - /** - * Participation status of the Participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty. - */ - @Child(name = "participantStatus", type = {CodeType.class}, order=4, min=1, max=1) - @Description(shortDefinition="accepted | declined | tentative | in-process | completed | needs-action", formalDefinition="Participation status of the Participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty." ) - protected Enumeration participantStatus; - - /** - * This comment is particularly important when the responder is declining, tentative or requesting another time to indicate the reasons why. - */ - @Child(name = "comment", type = {StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Additional comments about the appointment", formalDefinition="This comment is particularly important when the responder is declining, tentative or requesting another time to indicate the reasons why." ) - protected StringType comment; - - /** - * This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the start time. - */ - @Child(name = "start", type = {InstantType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Date/Time that the appointment is to take place, or requested new start time", formalDefinition="This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the start time." ) - protected InstantType start; - - /** - * This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time. - */ - @Child(name = "end", type = {InstantType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Date/Time that the appointment is to conclude, or requested new end time", formalDefinition="This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time." ) - protected InstantType end; - - private static final long serialVersionUID = 152413469L; - - /* - * Constructor - */ - public AppointmentResponse() { - super(); - } - - /* - * Constructor - */ - public AppointmentResponse(Reference appointment, Enumeration participantStatus) { - super(); - this.appointment = appointment; - this.participantStatus = participantStatus; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this appointment response concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this appointment response concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public AppointmentResponse addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #appointment} (Parent appointment that this response is replying to.) - */ - public Reference getAppointment() { - if (this.appointment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.appointment"); - else if (Configuration.doAutoCreate()) - this.appointment = new Reference(); // cc - return this.appointment; - } - - public boolean hasAppointment() { - return this.appointment != null && !this.appointment.isEmpty(); - } - - /** - * @param value {@link #appointment} (Parent appointment that this response is replying to.) - */ - public AppointmentResponse setAppointment(Reference value) { - this.appointment = value; - return this; - } - - /** - * @return {@link #appointment} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Parent appointment that this response is replying to.) - */ - public Appointment getAppointmentTarget() { - if (this.appointmentTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.appointment"); - else if (Configuration.doAutoCreate()) - this.appointmentTarget = new Appointment(); // aa - return this.appointmentTarget; - } - - /** - * @param value {@link #appointment} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Parent appointment that this response is replying to.) - */ - public AppointmentResponse setAppointmentTarget(Appointment value) { - this.appointmentTarget = value; - return this; - } - - /** - * @return {@link #participantType} (Role of participant in the appointment.) - */ - public List getParticipantType() { - if (this.participantType == null) - this.participantType = new ArrayList(); - return this.participantType; - } - - public boolean hasParticipantType() { - if (this.participantType == null) - return false; - for (CodeableConcept item : this.participantType) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #participantType} (Role of participant in the appointment.) - */ - // syntactic sugar - public CodeableConcept addParticipantType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.participantType == null) - this.participantType = new ArrayList(); - this.participantType.add(t); - return t; - } - - // syntactic sugar - public AppointmentResponse addParticipantType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.participantType == null) - this.participantType = new ArrayList(); - this.participantType.add(t); - return this; - } - - /** - * @return {@link #actor} (A Person, Location/HealthcareService or Device that is participating in the appointment.) - */ - public Reference getActor() { - if (this.actor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.actor"); - else if (Configuration.doAutoCreate()) - this.actor = new Reference(); // cc - return this.actor; - } - - public boolean hasActor() { - return this.actor != null && !this.actor.isEmpty(); - } - - /** - * @param value {@link #actor} (A Person, Location/HealthcareService or Device that is participating in the appointment.) - */ - public AppointmentResponse setActor(Reference value) { - this.actor = value; - return this; - } - - /** - * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A Person, Location/HealthcareService or Device that is participating in the appointment.) - */ - public Resource getActorTarget() { - return this.actorTarget; - } - - /** - * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A Person, Location/HealthcareService or Device that is participating in the appointment.) - */ - public AppointmentResponse setActorTarget(Resource value) { - this.actorTarget = value; - return this; - } - - /** - * @return {@link #participantStatus} (Participation status of the Participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.). This is the underlying object with id, value and extensions. The accessor "getParticipantStatus" gives direct access to the value - */ - public Enumeration getParticipantStatusElement() { - if (this.participantStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.participantStatus"); - else if (Configuration.doAutoCreate()) - this.participantStatus = new Enumeration(new ParticipantstatusEnumFactory()); // bb - return this.participantStatus; - } - - public boolean hasParticipantStatusElement() { - return this.participantStatus != null && !this.participantStatus.isEmpty(); - } - - public boolean hasParticipantStatus() { - return this.participantStatus != null && !this.participantStatus.isEmpty(); - } - - /** - * @param value {@link #participantStatus} (Participation status of the Participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.). This is the underlying object with id, value and extensions. The accessor "getParticipantStatus" gives direct access to the value - */ - public AppointmentResponse setParticipantStatusElement(Enumeration value) { - this.participantStatus = value; - return this; - } - - /** - * @return Participation status of the Participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty. - */ - public Participantstatus getParticipantStatus() { - return this.participantStatus == null ? null : this.participantStatus.getValue(); - } - - /** - * @param value Participation status of the Participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty. - */ - public AppointmentResponse setParticipantStatus(Participantstatus value) { - if (this.participantStatus == null) - this.participantStatus = new Enumeration(new ParticipantstatusEnumFactory()); - this.participantStatus.setValue(value); - return this; - } - - /** - * @return {@link #comment} (This comment is particularly important when the responder is declining, tentative or requesting another time to indicate the reasons why.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); // bb - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (This comment is particularly important when the responder is declining, tentative or requesting another time to indicate the reasons why.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public AppointmentResponse setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return This comment is particularly important when the responder is declining, tentative or requesting another time to indicate the reasons why. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value This comment is particularly important when the responder is declining, tentative or requesting another time to indicate the reasons why. - */ - public AppointmentResponse setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - /** - * @return {@link #start} (This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the start time.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public InstantType getStartElement() { - if (this.start == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.start"); - else if (Configuration.doAutoCreate()) - this.start = new InstantType(); // bb - return this.start; - } - - public boolean hasStartElement() { - return this.start != null && !this.start.isEmpty(); - } - - public boolean hasStart() { - return this.start != null && !this.start.isEmpty(); - } - - /** - * @param value {@link #start} (This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the start time.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public AppointmentResponse setStartElement(InstantType value) { - this.start = value; - return this; - } - - /** - * @return This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the start time. - */ - public Date getStart() { - return this.start == null ? null : this.start.getValue(); - } - - /** - * @param value This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the start time. - */ - public AppointmentResponse setStart(Date value) { - if (value == null) - this.start = null; - else { - if (this.start == null) - this.start = new InstantType(); - this.start.setValue(value); - } - return this; - } - - /** - * @return {@link #end} (This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public InstantType getEndElement() { - if (this.end == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.end"); - else if (Configuration.doAutoCreate()) - this.end = new InstantType(); // bb - return this.end; - } - - public boolean hasEndElement() { - return this.end != null && !this.end.isEmpty(); - } - - public boolean hasEnd() { - return this.end != null && !this.end.isEmpty(); - } - - /** - * @param value {@link #end} (This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public AppointmentResponse setEndElement(InstantType value) { - this.end = value; - return this; - } - - /** - * @return This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time. - */ - public Date getEnd() { - return this.end == null ? null : this.end.getValue(); - } - - /** - * @param value This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time. - */ - public AppointmentResponse setEnd(Date value) { - if (value == null) - this.end = null; - else { - if (this.end == null) - this.end = new InstantType(); - this.end.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this appointment response concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("appointment", "Reference(Appointment)", "Parent appointment that this response is replying to.", 0, java.lang.Integer.MAX_VALUE, appointment)); - childrenList.add(new Property("participantType", "CodeableConcept", "Role of participant in the appointment.", 0, java.lang.Integer.MAX_VALUE, participantType)); - childrenList.add(new Property("actor", "Reference(Patient|Practitioner|RelatedPerson|Device|HealthcareService|Location)", "A Person, Location/HealthcareService or Device that is participating in the appointment.", 0, java.lang.Integer.MAX_VALUE, actor)); - childrenList.add(new Property("participantStatus", "code", "Participation status of the Participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.", 0, java.lang.Integer.MAX_VALUE, participantStatus)); - childrenList.add(new Property("comment", "string", "This comment is particularly important when the responder is declining, tentative or requesting another time to indicate the reasons why.", 0, java.lang.Integer.MAX_VALUE, comment)); - childrenList.add(new Property("start", "instant", "This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the start time.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("end", "instant", "This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.", 0, java.lang.Integer.MAX_VALUE, end)); - } - - public AppointmentResponse copy() { - AppointmentResponse dst = new AppointmentResponse(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.appointment = appointment == null ? null : appointment.copy(); - if (participantType != null) { - dst.participantType = new ArrayList(); - for (CodeableConcept i : participantType) - dst.participantType.add(i.copy()); - }; - dst.actor = actor == null ? null : actor.copy(); - dst.participantStatus = participantStatus == null ? null : participantStatus.copy(); - dst.comment = comment == null ? null : comment.copy(); - dst.start = start == null ? null : start.copy(); - dst.end = end == null ? null : end.copy(); - return dst; - } - - protected AppointmentResponse typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AppointmentResponse)) - return false; - AppointmentResponse o = (AppointmentResponse) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(appointment, o.appointment, true) - && compareDeep(participantType, o.participantType, true) && compareDeep(actor, o.actor, true) && compareDeep(participantStatus, o.participantStatus, true) - && compareDeep(comment, o.comment, true) && compareDeep(start, o.start, true) && compareDeep(end, o.end, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AppointmentResponse)) - return false; - AppointmentResponse o = (AppointmentResponse) other; - return compareValues(participantStatus, o.participantStatus, true) && compareValues(comment, o.comment, true) - && compareValues(start, o.start, true) && compareValues(end, o.end, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (appointment == null || appointment.isEmpty()) - && (participantType == null || participantType.isEmpty()) && (actor == null || actor.isEmpty()) - && (participantStatus == null || participantStatus.isEmpty()) && (comment == null || comment.isEmpty()) - && (start == null || start.isEmpty()) && (end == null || end.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.AppointmentResponse; - } - - @SearchParamDefinition(name="partstatus", path="AppointmentResponse.participantStatus", description="The participants acceptance status for this appointment", type="token" ) - public static final String SP_PARTSTATUS = "partstatus"; - @SearchParamDefinition(name="patient", path="AppointmentResponse.actor", description="This Response is for this Patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="practitioner", path="AppointmentResponse.actor", description="This Response is for this Practitioner", type="reference" ) - public static final String SP_PRACTITIONER = "practitioner"; - @SearchParamDefinition(name="location", path="AppointmentResponse.actor", description="This Response is for this Location", type="reference" ) - public static final String SP_LOCATION = "location"; - @SearchParamDefinition(name="actor", path="AppointmentResponse.actor", description="The Person, Location/HealthcareService or Device that this appointment response replies for", type="reference" ) - public static final String SP_ACTOR = "actor"; - @SearchParamDefinition(name="appointment", path="AppointmentResponse.appointment", description="The appointment that the response is attached to", type="reference" ) - public static final String SP_APPOINTMENT = "appointment"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. + */ +@ResourceDef(name="AppointmentResponse", profile="http://hl7.org/fhir/Profile/AppointmentResponse") +public class AppointmentResponse extends DomainResource { + + public enum Participantstatus { + /** + * The appointment participant has accepted that they can attend the appointment at the time specified in the AppointmentResponse. + */ + ACCEPTED, + /** + * The appointment participant has declined the appointment. + */ + DECLINED, + /** + * The appointment participant has tentatively accepted the appointment. + */ + TENTATIVE, + /** + * The participant has in-process the appointment. + */ + INPROCESS, + /** + * The participant has completed the appointment. + */ + COMPLETED, + /** + * This is the intitial status of an appointment participant until a participant has replied. It implies that there is no commitment for the appointment. + */ + NEEDSACTION, + /** + * added to help the parsers + */ + NULL; + public static Participantstatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("accepted".equals(codeString)) + return ACCEPTED; + if ("declined".equals(codeString)) + return DECLINED; + if ("tentative".equals(codeString)) + return TENTATIVE; + if ("in-process".equals(codeString)) + return INPROCESS; + if ("completed".equals(codeString)) + return COMPLETED; + if ("needs-action".equals(codeString)) + return NEEDSACTION; + throw new Exception("Unknown Participantstatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ACCEPTED: return "accepted"; + case DECLINED: return "declined"; + case TENTATIVE: return "tentative"; + case INPROCESS: return "in-process"; + case COMPLETED: return "completed"; + case NEEDSACTION: return "needs-action"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACCEPTED: return ""; + case DECLINED: return ""; + case TENTATIVE: return ""; + case INPROCESS: return ""; + case COMPLETED: return ""; + case NEEDSACTION: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACCEPTED: return "The appointment participant has accepted that they can attend the appointment at the time specified in the AppointmentResponse."; + case DECLINED: return "The appointment participant has declined the appointment."; + case TENTATIVE: return "The appointment participant has tentatively accepted the appointment."; + case INPROCESS: return "The participant has in-process the appointment."; + case COMPLETED: return "The participant has completed the appointment."; + case NEEDSACTION: return "This is the intitial status of an appointment participant until a participant has replied. It implies that there is no commitment for the appointment."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACCEPTED: return "Accepted"; + case DECLINED: return "Declined"; + case TENTATIVE: return "Tentative"; + case INPROCESS: return "In Process"; + case COMPLETED: return "Completed"; + case NEEDSACTION: return "Needs Action"; + default: return "?"; + } + } + } + + public static class ParticipantstatusEnumFactory implements EnumFactory { + public Participantstatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("accepted".equals(codeString)) + return Participantstatus.ACCEPTED; + if ("declined".equals(codeString)) + return Participantstatus.DECLINED; + if ("tentative".equals(codeString)) + return Participantstatus.TENTATIVE; + if ("in-process".equals(codeString)) + return Participantstatus.INPROCESS; + if ("completed".equals(codeString)) + return Participantstatus.COMPLETED; + if ("needs-action".equals(codeString)) + return Participantstatus.NEEDSACTION; + throw new IllegalArgumentException("Unknown Participantstatus code '"+codeString+"'"); + } + public String toCode(Participantstatus code) { + if (code == Participantstatus.ACCEPTED) + return "accepted"; + if (code == Participantstatus.DECLINED) + return "declined"; + if (code == Participantstatus.TENTATIVE) + return "tentative"; + if (code == Participantstatus.INPROCESS) + return "in-process"; + if (code == Participantstatus.COMPLETED) + return "completed"; + if (code == Participantstatus.NEEDSACTION) + return "needs-action"; + return "?"; + } + } + + /** + * This records identifiers associated with this appointment response concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Ids for this item", formalDefinition="This records identifiers associated with this appointment response concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate." ) + protected List identifier; + + /** + * Parent appointment that this response is replying to. + */ + @Child(name = "appointment", type = {Appointment.class}, order=1, min=1, max=1) + @Description(shortDefinition="Parent appointment that this response is replying to", formalDefinition="Parent appointment that this response is replying to." ) + protected Reference appointment; + + /** + * The actual object that is the target of the reference (Parent appointment that this response is replying to.) + */ + protected Appointment appointmentTarget; + + /** + * Role of participant in the appointment. + */ + @Child(name = "participantType", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Role of participant in the appointment", formalDefinition="Role of participant in the appointment." ) + protected List participantType; + + /** + * A Person, Location/HealthcareService or Device that is participating in the appointment. + */ + @Child(name = "actor", type = {Patient.class, Practitioner.class, RelatedPerson.class, Device.class, HealthcareService.class, Location.class}, order=3, min=0, max=1) + @Description(shortDefinition="A Person, Location/HealthcareService or Device that is participating in the appointment", formalDefinition="A Person, Location/HealthcareService or Device that is participating in the appointment." ) + protected Reference actor; + + /** + * The actual object that is the target of the reference (A Person, Location/HealthcareService or Device that is participating in the appointment.) + */ + protected Resource actorTarget; + + /** + * Participation status of the Participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty. + */ + @Child(name = "participantStatus", type = {CodeType.class}, order=4, min=1, max=1) + @Description(shortDefinition="accepted | declined | tentative | in-process | completed | needs-action", formalDefinition="Participation status of the Participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty." ) + protected Enumeration participantStatus; + + /** + * This comment is particularly important when the responder is declining, tentative or requesting another time to indicate the reasons why. + */ + @Child(name = "comment", type = {StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Additional comments about the appointment", formalDefinition="This comment is particularly important when the responder is declining, tentative or requesting another time to indicate the reasons why." ) + protected StringType comment; + + /** + * This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the start time. + */ + @Child(name = "start", type = {InstantType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Date/Time that the appointment is to take place, or requested new start time", formalDefinition="This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the start time." ) + protected InstantType start; + + /** + * This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time. + */ + @Child(name = "end", type = {InstantType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Date/Time that the appointment is to conclude, or requested new end time", formalDefinition="This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time." ) + protected InstantType end; + + private static final long serialVersionUID = 152413469L; + + /* + * Constructor + */ + public AppointmentResponse() { + super(); + } + + /* + * Constructor + */ + public AppointmentResponse(Reference appointment, Enumeration participantStatus) { + super(); + this.appointment = appointment; + this.participantStatus = participantStatus; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this appointment response concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this appointment response concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public AppointmentResponse addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #appointment} (Parent appointment that this response is replying to.) + */ + public Reference getAppointment() { + if (this.appointment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.appointment"); + else if (Configuration.doAutoCreate()) + this.appointment = new Reference(); // cc + return this.appointment; + } + + public boolean hasAppointment() { + return this.appointment != null && !this.appointment.isEmpty(); + } + + /** + * @param value {@link #appointment} (Parent appointment that this response is replying to.) + */ + public AppointmentResponse setAppointment(Reference value) { + this.appointment = value; + return this; + } + + /** + * @return {@link #appointment} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Parent appointment that this response is replying to.) + */ + public Appointment getAppointmentTarget() { + if (this.appointmentTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.appointment"); + else if (Configuration.doAutoCreate()) + this.appointmentTarget = new Appointment(); // aa + return this.appointmentTarget; + } + + /** + * @param value {@link #appointment} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Parent appointment that this response is replying to.) + */ + public AppointmentResponse setAppointmentTarget(Appointment value) { + this.appointmentTarget = value; + return this; + } + + /** + * @return {@link #participantType} (Role of participant in the appointment.) + */ + public List getParticipantType() { + if (this.participantType == null) + this.participantType = new ArrayList(); + return this.participantType; + } + + public boolean hasParticipantType() { + if (this.participantType == null) + return false; + for (CodeableConcept item : this.participantType) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #participantType} (Role of participant in the appointment.) + */ + // syntactic sugar + public CodeableConcept addParticipantType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.participantType == null) + this.participantType = new ArrayList(); + this.participantType.add(t); + return t; + } + + // syntactic sugar + public AppointmentResponse addParticipantType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.participantType == null) + this.participantType = new ArrayList(); + this.participantType.add(t); + return this; + } + + /** + * @return {@link #actor} (A Person, Location/HealthcareService or Device that is participating in the appointment.) + */ + public Reference getActor() { + if (this.actor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.actor"); + else if (Configuration.doAutoCreate()) + this.actor = new Reference(); // cc + return this.actor; + } + + public boolean hasActor() { + return this.actor != null && !this.actor.isEmpty(); + } + + /** + * @param value {@link #actor} (A Person, Location/HealthcareService or Device that is participating in the appointment.) + */ + public AppointmentResponse setActor(Reference value) { + this.actor = value; + return this; + } + + /** + * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A Person, Location/HealthcareService or Device that is participating in the appointment.) + */ + public Resource getActorTarget() { + return this.actorTarget; + } + + /** + * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A Person, Location/HealthcareService or Device that is participating in the appointment.) + */ + public AppointmentResponse setActorTarget(Resource value) { + this.actorTarget = value; + return this; + } + + /** + * @return {@link #participantStatus} (Participation status of the Participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.). This is the underlying object with id, value and extensions. The accessor "getParticipantStatus" gives direct access to the value + */ + public Enumeration getParticipantStatusElement() { + if (this.participantStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.participantStatus"); + else if (Configuration.doAutoCreate()) + this.participantStatus = new Enumeration(new ParticipantstatusEnumFactory()); // bb + return this.participantStatus; + } + + public boolean hasParticipantStatusElement() { + return this.participantStatus != null && !this.participantStatus.isEmpty(); + } + + public boolean hasParticipantStatus() { + return this.participantStatus != null && !this.participantStatus.isEmpty(); + } + + /** + * @param value {@link #participantStatus} (Participation status of the Participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.). This is the underlying object with id, value and extensions. The accessor "getParticipantStatus" gives direct access to the value + */ + public AppointmentResponse setParticipantStatusElement(Enumeration value) { + this.participantStatus = value; + return this; + } + + /** + * @return Participation status of the Participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty. + */ + public Participantstatus getParticipantStatus() { + return this.participantStatus == null ? null : this.participantStatus.getValue(); + } + + /** + * @param value Participation status of the Participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty. + */ + public AppointmentResponse setParticipantStatus(Participantstatus value) { + if (this.participantStatus == null) + this.participantStatus = new Enumeration(new ParticipantstatusEnumFactory()); + this.participantStatus.setValue(value); + return this; + } + + /** + * @return {@link #comment} (This comment is particularly important when the responder is declining, tentative or requesting another time to indicate the reasons why.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); // bb + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (This comment is particularly important when the responder is declining, tentative or requesting another time to indicate the reasons why.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public AppointmentResponse setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return This comment is particularly important when the responder is declining, tentative or requesting another time to indicate the reasons why. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value This comment is particularly important when the responder is declining, tentative or requesting another time to indicate the reasons why. + */ + public AppointmentResponse setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + /** + * @return {@link #start} (This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the start time.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public InstantType getStartElement() { + if (this.start == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.start"); + else if (Configuration.doAutoCreate()) + this.start = new InstantType(); // bb + return this.start; + } + + public boolean hasStartElement() { + return this.start != null && !this.start.isEmpty(); + } + + public boolean hasStart() { + return this.start != null && !this.start.isEmpty(); + } + + /** + * @param value {@link #start} (This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the start time.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public AppointmentResponse setStartElement(InstantType value) { + this.start = value; + return this; + } + + /** + * @return This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the start time. + */ + public Date getStart() { + return this.start == null ? null : this.start.getValue(); + } + + /** + * @param value This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the start time. + */ + public AppointmentResponse setStart(Date value) { + if (value == null) + this.start = null; + else { + if (this.start == null) + this.start = new InstantType(); + this.start.setValue(value); + } + return this; + } + + /** + * @return {@link #end} (This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public InstantType getEndElement() { + if (this.end == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.end"); + else if (Configuration.doAutoCreate()) + this.end = new InstantType(); // bb + return this.end; + } + + public boolean hasEndElement() { + return this.end != null && !this.end.isEmpty(); + } + + public boolean hasEnd() { + return this.end != null && !this.end.isEmpty(); + } + + /** + * @param value {@link #end} (This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public AppointmentResponse setEndElement(InstantType value) { + this.end = value; + return this; + } + + /** + * @return This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time. + */ + public Date getEnd() { + return this.end == null ? null : this.end.getValue(); + } + + /** + * @param value This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time. + */ + public AppointmentResponse setEnd(Date value) { + if (value == null) + this.end = null; + else { + if (this.end == null) + this.end = new InstantType(); + this.end.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this appointment response concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("appointment", "Reference(Appointment)", "Parent appointment that this response is replying to.", 0, java.lang.Integer.MAX_VALUE, appointment)); + childrenList.add(new Property("participantType", "CodeableConcept", "Role of participant in the appointment.", 0, java.lang.Integer.MAX_VALUE, participantType)); + childrenList.add(new Property("actor", "Reference(Patient|Practitioner|RelatedPerson|Device|HealthcareService|Location)", "A Person, Location/HealthcareService or Device that is participating in the appointment.", 0, java.lang.Integer.MAX_VALUE, actor)); + childrenList.add(new Property("participantStatus", "code", "Participation status of the Participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.", 0, java.lang.Integer.MAX_VALUE, participantStatus)); + childrenList.add(new Property("comment", "string", "This comment is particularly important when the responder is declining, tentative or requesting another time to indicate the reasons why.", 0, java.lang.Integer.MAX_VALUE, comment)); + childrenList.add(new Property("start", "instant", "This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the start time.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("end", "instant", "This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.", 0, java.lang.Integer.MAX_VALUE, end)); + } + + public AppointmentResponse copy() { + AppointmentResponse dst = new AppointmentResponse(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.appointment = appointment == null ? null : appointment.copy(); + if (participantType != null) { + dst.participantType = new ArrayList(); + for (CodeableConcept i : participantType) + dst.participantType.add(i.copy()); + }; + dst.actor = actor == null ? null : actor.copy(); + dst.participantStatus = participantStatus == null ? null : participantStatus.copy(); + dst.comment = comment == null ? null : comment.copy(); + dst.start = start == null ? null : start.copy(); + dst.end = end == null ? null : end.copy(); + return dst; + } + + protected AppointmentResponse typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AppointmentResponse)) + return false; + AppointmentResponse o = (AppointmentResponse) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(appointment, o.appointment, true) + && compareDeep(participantType, o.participantType, true) && compareDeep(actor, o.actor, true) && compareDeep(participantStatus, o.participantStatus, true) + && compareDeep(comment, o.comment, true) && compareDeep(start, o.start, true) && compareDeep(end, o.end, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AppointmentResponse)) + return false; + AppointmentResponse o = (AppointmentResponse) other; + return compareValues(participantStatus, o.participantStatus, true) && compareValues(comment, o.comment, true) + && compareValues(start, o.start, true) && compareValues(end, o.end, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (appointment == null || appointment.isEmpty()) + && (participantType == null || participantType.isEmpty()) && (actor == null || actor.isEmpty()) + && (participantStatus == null || participantStatus.isEmpty()) && (comment == null || comment.isEmpty()) + && (start == null || start.isEmpty()) && (end == null || end.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.AppointmentResponse; + } + + @SearchParamDefinition(name="actor", path="AppointmentResponse.actor", description="The Person, Location/HealthcareService or Device that this appointment response replies for", type="reference" ) + public static final String SP_ACTOR = "actor"; + @SearchParamDefinition(name="partstatus", path="AppointmentResponse.participantStatus", description="The participants acceptance status for this appointment", type="token" ) + public static final String SP_PARTSTATUS = "partstatus"; + @SearchParamDefinition(name="practitioner", path="AppointmentResponse.actor", description="This Response is for this Practitioner", type="reference" ) + public static final String SP_PRACTITIONER = "practitioner"; + @SearchParamDefinition(name="patient", path="AppointmentResponse.actor", description="This Response is for this Patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="appointment", path="AppointmentResponse.appointment", description="The appointment that the response is attached to", type="reference" ) + public static final String SP_APPOINTMENT = "appointment"; + @SearchParamDefinition(name="location", path="AppointmentResponse.actor", description="This Response is for this Location", type="reference" ) + public static final String SP_LOCATION = "location"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Attachment.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Attachment.java index 8f933c01d67..dfda4963381 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Attachment.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Attachment.java @@ -1,587 +1,566 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * For referring to data content defined in other formats. - */ -@DatatypeDef(name="Attachment") -public class Attachment extends Type implements ICompositeType { - - /** - * Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. - */ - @Child(name = "contentType", type = {CodeType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Mime type of the content, with charset etc.", formalDefinition="Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate." ) - protected CodeType contentType; - - /** - * The human language of the content. The value can be any valid value according to BCP 47. - */ - @Child(name = "language", type = {CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Human language of the content (BCP-47)", formalDefinition="The human language of the content. The value can be any valid value according to BCP 47." ) - protected CodeType language; - - /** - * The actual data of the attachment - a sequence of bytes. In XML, represented using base64. - */ - @Child(name = "data", type = {Base64BinaryType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Data inline, base64ed", formalDefinition="The actual data of the attachment - a sequence of bytes. In XML, represented using base64." ) - protected Base64BinaryType data; - - /** - * An alternative location where the data can be accessed. - */ - @Child(name = "url", type = {UriType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Uri where the data can be found", formalDefinition="An alternative location where the data can be accessed." ) - protected UriType url; - - /** - * The number of bytes of data that make up this attachment. - */ - @Child(name = "size", type = {UnsignedIntType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Number of bytes of content (if url provided)", formalDefinition="The number of bytes of data that make up this attachment." ) - protected UnsignedIntType size; - - /** - * The calculated hash of the data using SHA-1. Represented using base64. - */ - @Child(name = "hash", type = {Base64BinaryType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Hash of the data (sha-1, base64ed )", formalDefinition="The calculated hash of the data using SHA-1. Represented using base64." ) - protected Base64BinaryType hash; - - /** - * A label or set of text to display in place of the data. - */ - @Child(name = "title", type = {StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Label to display in place of the data", formalDefinition="A label or set of text to display in place of the data." ) - protected StringType title; - - /** - * The date that the attachment was first created. - */ - @Child(name = "creation", type = {DateTimeType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Date attachment was first created", formalDefinition="The date that the attachment was first created." ) - protected DateTimeType creation; - - private static final long serialVersionUID = 581007080L; - - /* - * Constructor - */ - public Attachment() { - super(); - } - - /** - * @return {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value - */ - public CodeType getContentTypeElement() { - if (this.contentType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.contentType"); - else if (Configuration.doAutoCreate()) - this.contentType = new CodeType(); // bb - return this.contentType; - } - - public boolean hasContentTypeElement() { - return this.contentType != null && !this.contentType.isEmpty(); - } - - public boolean hasContentType() { - return this.contentType != null && !this.contentType.isEmpty(); - } - - /** - * @param value {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value - */ - public Attachment setContentTypeElement(CodeType value) { - this.contentType = value; - return this; - } - - /** - * @return Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. - */ - public String getContentType() { - return this.contentType == null ? null : this.contentType.getValue(); - } - - /** - * @param value Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. - */ - public Attachment setContentType(String value) { - if (Utilities.noString(value)) - this.contentType = null; - else { - if (this.contentType == null) - this.contentType = new CodeType(); - this.contentType.setValue(value); - } - return this; - } - - /** - * @return {@link #language} (The human language of the content. The value can be any valid value according to BCP 47.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public CodeType getLanguageElement() { - if (this.language == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.language"); - else if (Configuration.doAutoCreate()) - this.language = new CodeType(); // bb - return this.language; - } - - public boolean hasLanguageElement() { - return this.language != null && !this.language.isEmpty(); - } - - public boolean hasLanguage() { - return this.language != null && !this.language.isEmpty(); - } - - /** - * @param value {@link #language} (The human language of the content. The value can be any valid value according to BCP 47.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public Attachment setLanguageElement(CodeType value) { - this.language = value; - return this; - } - - /** - * @return The human language of the content. The value can be any valid value according to BCP 47. - */ - public String getLanguage() { - return this.language == null ? null : this.language.getValue(); - } - - /** - * @param value The human language of the content. The value can be any valid value according to BCP 47. - */ - public Attachment setLanguage(String value) { - if (Utilities.noString(value)) - this.language = null; - else { - if (this.language == null) - this.language = new CodeType(); - this.language.setValue(value); - } - return this; - } - - /** - * @return {@link #data} (The actual data of the attachment - a sequence of bytes. In XML, represented using base64.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value - */ - public Base64BinaryType getDataElement() { - if (this.data == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.data"); - else if (Configuration.doAutoCreate()) - this.data = new Base64BinaryType(); // bb - return this.data; - } - - public boolean hasDataElement() { - return this.data != null && !this.data.isEmpty(); - } - - public boolean hasData() { - return this.data != null && !this.data.isEmpty(); - } - - /** - * @param value {@link #data} (The actual data of the attachment - a sequence of bytes. In XML, represented using base64.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value - */ - public Attachment setDataElement(Base64BinaryType value) { - this.data = value; - return this; - } - - /** - * @return The actual data of the attachment - a sequence of bytes. In XML, represented using base64. - */ - public byte[] getData() { - return this.data == null ? null : this.data.getValue(); - } - - /** - * @param value The actual data of the attachment - a sequence of bytes. In XML, represented using base64. - */ - public Attachment setData(byte[] value) { - if (value == null) - this.data = null; - else { - if (this.data == null) - this.data = new Base64BinaryType(); - this.data.setValue(value); - } - return this; - } - - /** - * @return {@link #url} (An alternative location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An alternative location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public Attachment setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An alternative location where the data can be accessed. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An alternative location where the data can be accessed. - */ - public Attachment setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value - */ - public UnsignedIntType getSizeElement() { - if (this.size == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.size"); - else if (Configuration.doAutoCreate()) - this.size = new UnsignedIntType(); // bb - return this.size; - } - - public boolean hasSizeElement() { - return this.size != null && !this.size.isEmpty(); - } - - public boolean hasSize() { - return this.size != null && !this.size.isEmpty(); - } - - /** - * @param value {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value - */ - public Attachment setSizeElement(UnsignedIntType value) { - this.size = value; - return this; - } - - /** - * @return The number of bytes of data that make up this attachment. - */ - public int getSize() { - return this.size == null || this.size.isEmpty() ? 0 : this.size.getValue(); - } - - /** - * @param value The number of bytes of data that make up this attachment. - */ - public Attachment setSize(int value) { - if (this.size == null) - this.size = new UnsignedIntType(); - this.size.setValue(value); - return this; - } - - /** - * @return {@link #hash} (The calculated hash of the data using SHA-1. Represented using base64.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value - */ - public Base64BinaryType getHashElement() { - if (this.hash == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.hash"); - else if (Configuration.doAutoCreate()) - this.hash = new Base64BinaryType(); // bb - return this.hash; - } - - public boolean hasHashElement() { - return this.hash != null && !this.hash.isEmpty(); - } - - public boolean hasHash() { - return this.hash != null && !this.hash.isEmpty(); - } - - /** - * @param value {@link #hash} (The calculated hash of the data using SHA-1. Represented using base64.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value - */ - public Attachment setHashElement(Base64BinaryType value) { - this.hash = value; - return this; - } - - /** - * @return The calculated hash of the data using SHA-1. Represented using base64. - */ - public byte[] getHash() { - return this.hash == null ? null : this.hash.getValue(); - } - - /** - * @param value The calculated hash of the data using SHA-1. Represented using base64. - */ - public Attachment setHash(byte[] value) { - if (value == null) - this.hash = null; - else { - if (this.hash == null) - this.hash = new Base64BinaryType(); - this.hash.setValue(value); - } - return this; - } - - /** - * @return {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); // bb - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public Attachment setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return A label or set of text to display in place of the data. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value A label or set of text to display in place of the data. - */ - public Attachment setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #creation} (The date that the attachment was first created.). This is the underlying object with id, value and extensions. The accessor "getCreation" gives direct access to the value - */ - public DateTimeType getCreationElement() { - if (this.creation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.creation"); - else if (Configuration.doAutoCreate()) - this.creation = new DateTimeType(); // bb - return this.creation; - } - - public boolean hasCreationElement() { - return this.creation != null && !this.creation.isEmpty(); - } - - public boolean hasCreation() { - return this.creation != null && !this.creation.isEmpty(); - } - - /** - * @param value {@link #creation} (The date that the attachment was first created.). This is the underlying object with id, value and extensions. The accessor "getCreation" gives direct access to the value - */ - public Attachment setCreationElement(DateTimeType value) { - this.creation = value; - return this; - } - - /** - * @return The date that the attachment was first created. - */ - public Date getCreation() { - return this.creation == null ? null : this.creation.getValue(); - } - - /** - * @param value The date that the attachment was first created. - */ - public Attachment setCreation(Date value) { - if (value == null) - this.creation = null; - else { - if (this.creation == null) - this.creation = new DateTimeType(); - this.creation.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("contentType", "code", "Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.", 0, java.lang.Integer.MAX_VALUE, contentType)); - childrenList.add(new Property("language", "code", "The human language of the content. The value can be any valid value according to BCP 47.", 0, java.lang.Integer.MAX_VALUE, language)); - childrenList.add(new Property("data", "base64Binary", "The actual data of the attachment - a sequence of bytes. In XML, represented using base64.", 0, java.lang.Integer.MAX_VALUE, data)); - childrenList.add(new Property("url", "uri", "An alternative location where the data can be accessed.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("size", "unsignedInt", "The number of bytes of data that make up this attachment.", 0, java.lang.Integer.MAX_VALUE, size)); - childrenList.add(new Property("hash", "base64Binary", "The calculated hash of the data using SHA-1. Represented using base64.", 0, java.lang.Integer.MAX_VALUE, hash)); - childrenList.add(new Property("title", "string", "A label or set of text to display in place of the data.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("creation", "dateTime", "The date that the attachment was first created.", 0, java.lang.Integer.MAX_VALUE, creation)); - } - - public Attachment copy() { - Attachment dst = new Attachment(); - copyValues(dst); - dst.contentType = contentType == null ? null : contentType.copy(); - dst.language = language == null ? null : language.copy(); - dst.data = data == null ? null : data.copy(); - dst.url = url == null ? null : url.copy(); - dst.size = size == null ? null : size.copy(); - dst.hash = hash == null ? null : hash.copy(); - dst.title = title == null ? null : title.copy(); - dst.creation = creation == null ? null : creation.copy(); - return dst; - } - - protected Attachment typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Attachment)) - return false; - Attachment o = (Attachment) other; - return compareDeep(contentType, o.contentType, true) && compareDeep(language, o.language, true) - && compareDeep(data, o.data, true) && compareDeep(url, o.url, true) && compareDeep(size, o.size, true) - && compareDeep(hash, o.hash, true) && compareDeep(title, o.title, true) && compareDeep(creation, o.creation, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Attachment)) - return false; - Attachment o = (Attachment) other; - return compareValues(contentType, o.contentType, true) && compareValues(language, o.language, true) - && compareValues(data, o.data, true) && compareValues(url, o.url, true) && compareValues(size, o.size, true) - && compareValues(hash, o.hash, true) && compareValues(title, o.title, true) && compareValues(creation, o.creation, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (contentType == null || contentType.isEmpty()) && (language == null || language.isEmpty()) - && (data == null || data.isEmpty()) && (url == null || url.isEmpty()) && (size == null || size.isEmpty()) - && (hash == null || hash.isEmpty()) && (title == null || title.isEmpty()) && (creation == null || creation.isEmpty()) - ; - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * For referring to data content defined in other formats. + */ +@DatatypeDef(name="Attachment") +public class Attachment extends Type implements ICompositeType { + + /** + * Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. + */ + @Child(name = "contentType", type = {CodeType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Mime type of the content, with charset etc.", formalDefinition="Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate." ) + protected CodeType contentType; + + /** + * The human language of the content. The value can be any valid value according to BCP 47. + */ + @Child(name = "language", type = {CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Human language of the content (BCP-47)", formalDefinition="The human language of the content. The value can be any valid value according to BCP 47." ) + protected CodeType language; + + /** + * The actual data of the attachment - a sequence of bytes. In XML, represented using base64. + */ + @Child(name = "data", type = {Base64BinaryType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Data inline, base64ed", formalDefinition="The actual data of the attachment - a sequence of bytes. In XML, represented using base64." ) + protected Base64BinaryType data; + + /** + * An alternative location where the data can be accessed. + */ + @Child(name = "url", type = {UriType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Uri where the data can be found", formalDefinition="An alternative location where the data can be accessed." ) + protected UriType url; + + /** + * The number of bytes of data that make up this attachment. + */ + @Child(name = "size", type = {UnsignedIntType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Number of bytes of content (if url provided)", formalDefinition="The number of bytes of data that make up this attachment." ) + protected UnsignedIntType size; + + /** + * The calculated hash of the data using SHA-1. Represented using base64. + */ + @Child(name = "hash", type = {Base64BinaryType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Hash of the data (sha-1, base64ed )", formalDefinition="The calculated hash of the data using SHA-1. Represented using base64." ) + protected Base64BinaryType hash; + + /** + * A label or set of text to display in place of the data. + */ + @Child(name = "title", type = {StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Label to display in place of the data", formalDefinition="A label or set of text to display in place of the data." ) + protected StringType title; + + /** + * The date that the attachment was first created. + */ + @Child(name = "creation", type = {DateTimeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Date attachment was first created", formalDefinition="The date that the attachment was first created." ) + protected DateTimeType creation; + + private static final long serialVersionUID = 581007080L; + + /* + * Constructor + */ + public Attachment() { + super(); + } + + /** + * @return {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public CodeType getContentTypeElement() { + if (this.contentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.contentType"); + else if (Configuration.doAutoCreate()) + this.contentType = new CodeType(); // bb + return this.contentType; + } + + public boolean hasContentTypeElement() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + public boolean hasContentType() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + /** + * @param value {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public Attachment setContentTypeElement(CodeType value) { + this.contentType = value; + return this; + } + + /** + * @return Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. + */ + public String getContentType() { + return this.contentType == null ? null : this.contentType.getValue(); + } + + /** + * @param value Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. + */ + public Attachment setContentType(String value) { + if (Utilities.noString(value)) + this.contentType = null; + else { + if (this.contentType == null) + this.contentType = new CodeType(); + this.contentType.setValue(value); + } + return this; + } + + /** + * @return {@link #language} (The human language of the content. The value can be any valid value according to BCP 47.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public CodeType getLanguageElement() { + if (this.language == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.language"); + else if (Configuration.doAutoCreate()) + this.language = new CodeType(); // bb + return this.language; + } + + public boolean hasLanguageElement() { + return this.language != null && !this.language.isEmpty(); + } + + public boolean hasLanguage() { + return this.language != null && !this.language.isEmpty(); + } + + /** + * @param value {@link #language} (The human language of the content. The value can be any valid value according to BCP 47.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public Attachment setLanguageElement(CodeType value) { + this.language = value; + return this; + } + + /** + * @return The human language of the content. The value can be any valid value according to BCP 47. + */ + public String getLanguage() { + return this.language == null ? null : this.language.getValue(); + } + + /** + * @param value The human language of the content. The value can be any valid value according to BCP 47. + */ + public Attachment setLanguage(String value) { + if (Utilities.noString(value)) + this.language = null; + else { + if (this.language == null) + this.language = new CodeType(); + this.language.setValue(value); + } + return this; + } + + /** + * @return {@link #data} (The actual data of the attachment - a sequence of bytes. In XML, represented using base64.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value + */ + public Base64BinaryType getDataElement() { + if (this.data == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.data"); + else if (Configuration.doAutoCreate()) + this.data = new Base64BinaryType(); // bb + return this.data; + } + + public boolean hasDataElement() { + return this.data != null && !this.data.isEmpty(); + } + + public boolean hasData() { + return this.data != null && !this.data.isEmpty(); + } + + /** + * @param value {@link #data} (The actual data of the attachment - a sequence of bytes. In XML, represented using base64.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value + */ + public Attachment setDataElement(Base64BinaryType value) { + this.data = value; + return this; + } + + /** + * @return The actual data of the attachment - a sequence of bytes. In XML, represented using base64. + */ + public byte[] getData() { + return this.data == null ? null : this.data.getValue(); + } + + /** + * @param value The actual data of the attachment - a sequence of bytes. In XML, represented using base64. + */ + public Attachment setData(byte[] value) { + if (value == null) + this.data = null; + else { + if (this.data == null) + this.data = new Base64BinaryType(); + this.data.setValue(value); + } + return this; + } + + /** + * @return {@link #url} (An alternative location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An alternative location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public Attachment setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An alternative location where the data can be accessed. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An alternative location where the data can be accessed. + */ + public Attachment setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value + */ + public UnsignedIntType getSizeElement() { + if (this.size == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.size"); + else if (Configuration.doAutoCreate()) + this.size = new UnsignedIntType(); // bb + return this.size; + } + + public boolean hasSizeElement() { + return this.size != null && !this.size.isEmpty(); + } + + public boolean hasSize() { + return this.size != null && !this.size.isEmpty(); + } + + /** + * @param value {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value + */ + public Attachment setSizeElement(UnsignedIntType value) { + this.size = value; + return this; + } + + /** + * @return The number of bytes of data that make up this attachment. + */ + public int getSize() { + return this.size == null || this.size.isEmpty() ? 0 : this.size.getValue(); + } + + /** + * @param value The number of bytes of data that make up this attachment. + */ + public Attachment setSize(int value) { + if (this.size == null) + this.size = new UnsignedIntType(); + this.size.setValue(value); + return this; + } + + /** + * @return {@link #hash} (The calculated hash of the data using SHA-1. Represented using base64.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value + */ + public Base64BinaryType getHashElement() { + if (this.hash == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.hash"); + else if (Configuration.doAutoCreate()) + this.hash = new Base64BinaryType(); // bb + return this.hash; + } + + public boolean hasHashElement() { + return this.hash != null && !this.hash.isEmpty(); + } + + public boolean hasHash() { + return this.hash != null && !this.hash.isEmpty(); + } + + /** + * @param value {@link #hash} (The calculated hash of the data using SHA-1. Represented using base64.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value + */ + public Attachment setHashElement(Base64BinaryType value) { + this.hash = value; + return this; + } + + /** + * @return The calculated hash of the data using SHA-1. Represented using base64. + */ + public byte[] getHash() { + return this.hash == null ? null : this.hash.getValue(); + } + + /** + * @param value The calculated hash of the data using SHA-1. Represented using base64. + */ + public Attachment setHash(byte[] value) { + if (value == null) + this.hash = null; + else { + if (this.hash == null) + this.hash = new Base64BinaryType(); + this.hash.setValue(value); + } + return this; + } + + /** + * @return {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); // bb + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public Attachment setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return A label or set of text to display in place of the data. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value A label or set of text to display in place of the data. + */ + public Attachment setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #creation} (The date that the attachment was first created.). This is the underlying object with id, value and extensions. The accessor "getCreation" gives direct access to the value + */ + public DateTimeType getCreationElement() { + if (this.creation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.creation"); + else if (Configuration.doAutoCreate()) + this.creation = new DateTimeType(); // bb + return this.creation; + } + + public boolean hasCreationElement() { + return this.creation != null && !this.creation.isEmpty(); + } + + public boolean hasCreation() { + return this.creation != null && !this.creation.isEmpty(); + } + + /** + * @param value {@link #creation} (The date that the attachment was first created.). This is the underlying object with id, value and extensions. The accessor "getCreation" gives direct access to the value + */ + public Attachment setCreationElement(DateTimeType value) { + this.creation = value; + return this; + } + + /** + * @return The date that the attachment was first created. + */ + public Date getCreation() { + return this.creation == null ? null : this.creation.getValue(); + } + + /** + * @param value The date that the attachment was first created. + */ + public Attachment setCreation(Date value) { + if (value == null) + this.creation = null; + else { + if (this.creation == null) + this.creation = new DateTimeType(); + this.creation.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("contentType", "code", "Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.", 0, java.lang.Integer.MAX_VALUE, contentType)); + childrenList.add(new Property("language", "code", "The human language of the content. The value can be any valid value according to BCP 47.", 0, java.lang.Integer.MAX_VALUE, language)); + childrenList.add(new Property("data", "base64Binary", "The actual data of the attachment - a sequence of bytes. In XML, represented using base64.", 0, java.lang.Integer.MAX_VALUE, data)); + childrenList.add(new Property("url", "uri", "An alternative location where the data can be accessed.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("size", "unsignedInt", "The number of bytes of data that make up this attachment.", 0, java.lang.Integer.MAX_VALUE, size)); + childrenList.add(new Property("hash", "base64Binary", "The calculated hash of the data using SHA-1. Represented using base64.", 0, java.lang.Integer.MAX_VALUE, hash)); + childrenList.add(new Property("title", "string", "A label or set of text to display in place of the data.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("creation", "dateTime", "The date that the attachment was first created.", 0, java.lang.Integer.MAX_VALUE, creation)); + } + + public Attachment copy() { + Attachment dst = new Attachment(); + copyValues(dst); + dst.contentType = contentType == null ? null : contentType.copy(); + dst.language = language == null ? null : language.copy(); + dst.data = data == null ? null : data.copy(); + dst.url = url == null ? null : url.copy(); + dst.size = size == null ? null : size.copy(); + dst.hash = hash == null ? null : hash.copy(); + dst.title = title == null ? null : title.copy(); + dst.creation = creation == null ? null : creation.copy(); + return dst; + } + + protected Attachment typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Attachment)) + return false; + Attachment o = (Attachment) other; + return compareDeep(contentType, o.contentType, true) && compareDeep(language, o.language, true) + && compareDeep(data, o.data, true) && compareDeep(url, o.url, true) && compareDeep(size, o.size, true) + && compareDeep(hash, o.hash, true) && compareDeep(title, o.title, true) && compareDeep(creation, o.creation, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Attachment)) + return false; + Attachment o = (Attachment) other; + return compareValues(contentType, o.contentType, true) && compareValues(language, o.language, true) + && compareValues(data, o.data, true) && compareValues(url, o.url, true) && compareValues(size, o.size, true) + && compareValues(hash, o.hash, true) && compareValues(title, o.title, true) && compareValues(creation, o.creation, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (contentType == null || contentType.isEmpty()) && (language == null || language.isEmpty()) + && (data == null || data.isEmpty()) && (url == null || url.isEmpty()) && (size == null || size.isEmpty()) + && (hash == null || hash.isEmpty()) && (title == null || title.isEmpty()) && (creation == null || creation.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/AuditEvent.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/AuditEvent.java index 291be76084c..40bdecc71cc 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/AuditEvent.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/AuditEvent.java @@ -1,3601 +1,3580 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. - */ -@ResourceDef(name="AuditEvent", profile="http://hl7.org/fhir/Profile/AuditEvent") -public class AuditEvent extends DomainResource { - - public enum AuditEventAction { - /** - * Create a new database object, such as Placing an Order. - */ - C, - /** - * Display or print data, such as a Doctor Census. - */ - R, - /** - * Update data, such as Revise Patient Information. - */ - U, - /** - * Delete items, such as a doctor master file record. - */ - D, - /** - * Perform a system or application function such as log-on, program execution or use of an object's method, or perform a query/search operation. - */ - E, - /** - * added to help the parsers - */ - NULL; - public static AuditEventAction fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("C".equals(codeString)) - return C; - if ("R".equals(codeString)) - return R; - if ("U".equals(codeString)) - return U; - if ("D".equals(codeString)) - return D; - if ("E".equals(codeString)) - return E; - throw new Exception("Unknown AuditEventAction code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case C: return "C"; - case R: return "R"; - case U: return "U"; - case D: return "D"; - case E: return "E"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case C: return ""; - case R: return ""; - case U: return ""; - case D: return ""; - case E: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case C: return "Create a new database object, such as Placing an Order."; - case R: return "Display or print data, such as a Doctor Census."; - case U: return "Update data, such as Revise Patient Information."; - case D: return "Delete items, such as a doctor master file record."; - case E: return "Perform a system or application function such as log-on, program execution or use of an object's method, or perform a query/search operation."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case C: return "Create"; - case R: return "Read/View/Print"; - case U: return "Update"; - case D: return "Delete"; - case E: return "Execute"; - default: return "?"; - } - } - } - - public static class AuditEventActionEnumFactory implements EnumFactory { - public AuditEventAction fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("C".equals(codeString)) - return AuditEventAction.C; - if ("R".equals(codeString)) - return AuditEventAction.R; - if ("U".equals(codeString)) - return AuditEventAction.U; - if ("D".equals(codeString)) - return AuditEventAction.D; - if ("E".equals(codeString)) - return AuditEventAction.E; - throw new IllegalArgumentException("Unknown AuditEventAction code '"+codeString+"'"); - } - public String toCode(AuditEventAction code) { - if (code == AuditEventAction.C) - return "C"; - if (code == AuditEventAction.R) - return "R"; - if (code == AuditEventAction.U) - return "U"; - if (code == AuditEventAction.D) - return "D"; - if (code == AuditEventAction.E) - return "E"; - return "?"; - } - } - - public enum AuditEventOutcome { - /** - * The operation completed successfully (whether with warnings or not). - */ - _0, - /** - * The action was not successful due to some kind of catered for error (often equivalent to an HTTP 400 response). - */ - _4, - /** - * The action was not successful due to some kind of unexpected error (often equivalent to an HTTP 500 response). - */ - _8, - /** - * An error of such magnitude occurred that the system is not longer available for use (i.e. the system died). - */ - _12, - /** - * added to help the parsers - */ - NULL; - public static AuditEventOutcome fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("0".equals(codeString)) - return _0; - if ("4".equals(codeString)) - return _4; - if ("8".equals(codeString)) - return _8; - if ("12".equals(codeString)) - return _12; - throw new Exception("Unknown AuditEventOutcome code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case _0: return "0"; - case _4: return "4"; - case _8: return "8"; - case _12: return "12"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case _0: return ""; - case _4: return ""; - case _8: return ""; - case _12: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case _0: return "The operation completed successfully (whether with warnings or not)."; - case _4: return "The action was not successful due to some kind of catered for error (often equivalent to an HTTP 400 response)."; - case _8: return "The action was not successful due to some kind of unexpected error (often equivalent to an HTTP 500 response)."; - case _12: return "An error of such magnitude occurred that the system is not longer available for use (i.e. the system died)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case _0: return "Success"; - case _4: return "Minor failure"; - case _8: return "Serious failure"; - case _12: return "Major failure"; - default: return "?"; - } - } - } - - public static class AuditEventOutcomeEnumFactory implements EnumFactory { - public AuditEventOutcome fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("0".equals(codeString)) - return AuditEventOutcome._0; - if ("4".equals(codeString)) - return AuditEventOutcome._4; - if ("8".equals(codeString)) - return AuditEventOutcome._8; - if ("12".equals(codeString)) - return AuditEventOutcome._12; - throw new IllegalArgumentException("Unknown AuditEventOutcome code '"+codeString+"'"); - } - public String toCode(AuditEventOutcome code) { - if (code == AuditEventOutcome._0) - return "0"; - if (code == AuditEventOutcome._4) - return "4"; - if (code == AuditEventOutcome._8) - return "8"; - if (code == AuditEventOutcome._12) - return "12"; - return "?"; - } - } - - public enum NetworkType { - /** - * Machine Name, including DNS name. - */ - _1, - /** - * IP Address. - */ - _2, - /** - * Telephone Number. - */ - _3, - /** - * Email address. - */ - _4, - /** - * URI (User directory, HTTP-PUT, ftp, etc.). - */ - _5, - /** - * added to help the parsers - */ - NULL; - public static NetworkType fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("1".equals(codeString)) - return _1; - if ("2".equals(codeString)) - return _2; - if ("3".equals(codeString)) - return _3; - if ("4".equals(codeString)) - return _4; - if ("5".equals(codeString)) - return _5; - throw new Exception("Unknown NetworkType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case _1: return "1"; - case _2: return "2"; - case _3: return "3"; - case _4: return "4"; - case _5: return "5"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case _1: return ""; - case _2: return ""; - case _3: return ""; - case _4: return ""; - case _5: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case _1: return "Machine Name, including DNS name."; - case _2: return "IP Address."; - case _3: return "Telephone Number."; - case _4: return "Email address."; - case _5: return "URI (User directory, HTTP-PUT, ftp, etc.)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case _1: return " "; - case _2: return " "; - case _3: return " "; - case _4: return " "; - case _5: return " "; - default: return "?"; - } - } - } - - public static class NetworkTypeEnumFactory implements EnumFactory { - public NetworkType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("1".equals(codeString)) - return NetworkType._1; - if ("2".equals(codeString)) - return NetworkType._2; - if ("3".equals(codeString)) - return NetworkType._3; - if ("4".equals(codeString)) - return NetworkType._4; - if ("5".equals(codeString)) - return NetworkType._5; - throw new IllegalArgumentException("Unknown NetworkType code '"+codeString+"'"); - } - public String toCode(NetworkType code) { - if (code == NetworkType._1) - return "1"; - if (code == NetworkType._2) - return "2"; - if (code == NetworkType._3) - return "3"; - if (code == NetworkType._4) - return "4"; - if (code == NetworkType._5) - return "5"; - return "?"; - } - } - - public enum ObjectType { - /** - * Person. - */ - _1, - /** - * System Object. - */ - _2, - /** - * Organization. - */ - _3, - /** - * Other. - */ - _4, - /** - * added to help the parsers - */ - NULL; - public static ObjectType fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("1".equals(codeString)) - return _1; - if ("2".equals(codeString)) - return _2; - if ("3".equals(codeString)) - return _3; - if ("4".equals(codeString)) - return _4; - throw new Exception("Unknown ObjectType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case _1: return "1"; - case _2: return "2"; - case _3: return "3"; - case _4: return "4"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case _1: return ""; - case _2: return ""; - case _3: return ""; - case _4: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case _1: return "Person."; - case _2: return "System Object."; - case _3: return "Organization."; - case _4: return "Other."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case _1: return " "; - case _2: return " "; - case _3: return " "; - case _4: return " "; - default: return "?"; - } - } - } - - public static class ObjectTypeEnumFactory implements EnumFactory { - public ObjectType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("1".equals(codeString)) - return ObjectType._1; - if ("2".equals(codeString)) - return ObjectType._2; - if ("3".equals(codeString)) - return ObjectType._3; - if ("4".equals(codeString)) - return ObjectType._4; - throw new IllegalArgumentException("Unknown ObjectType code '"+codeString+"'"); - } - public String toCode(ObjectType code) { - if (code == ObjectType._1) - return "1"; - if (code == ObjectType._2) - return "2"; - if (code == ObjectType._3) - return "3"; - if (code == ObjectType._4) - return "4"; - return "?"; - } - } - - public enum ObjectRole { - /** - * This object is the patient that is the subject of care related to this event. It is identifiable by patient ID or equivalent. The patient may be either human or animal. - */ - _1, - /** - * This is a location identified as related to the event. This is usually the location where the event took place. Note that for shipping, the usual events are arrival at a location or departure from a location. - */ - _2, - /** - * This object is any kind of persistent document created as a result of the event. This could be a paper report, film, electronic report, DICOM Study, etc. Issues related to medical records life cycle management are conveyed elsewhere. - */ - _3, - /** - * A logical object related to a health record event. This is any healthcare specific resource (object) not restricted to FHIR defined Resources. - */ - _4, - /** - * This is any configurable file used to control creation of documents. Examples include the objects maintained by the HL7 Master File transactions, Value Sets, etc. - */ - _5, - /** - * A human participant not otherwise identified by some other category. - */ - _6, - /** - * (deprecated). - */ - _7, - /** - * Typically a licensed person who is providing or performing care related to the event, generally a physician. The key distinction between doctor and practitioner is with regards to their role, not the licensing. The doctor is the human who actually performed the work. The practitioner is the human or organization that is responsible for the work. - */ - _8, - /** - * A person or system that is being notified as part of the event. This is relevant in situations where automated systems provide notifications to other parties when an event took place. - */ - _9, - /** - * Insurance company, or any other organization who accepts responsibility for paying for the healthcare event. - */ - _10, - /** - * A person or active system object involved in the event with a security role. - */ - _11, - /** - * A person or system object involved in the event with the authority to modify security roles of other objects. - */ - _12, - /** - * A passive object, such as a role table, that is relevant to the event. - */ - _13, - /** - * (deprecated) Relevant to certain RBAC security methodologies. - */ - _14, - /** - * Any person or organization responsible for providing care. This encompasses all forms of care, licensed or otherwise, and all sorts of teams and care groups. Note, the distinction between practitioners and the doctor that actually provided the care to the patient. - */ - _15, - /** - * The source or destination for data transfer, when it does not match some other role. - */ - _16, - /** - * A source or destination for data transfer, that acts as an archive, database, or similar role. - */ - _17, - /** - * An object that holds schedule information. This could be an appointment book, availability information, etc. - */ - _18, - /** - * An organization or person that is the recipient of services. This could be an organization that is buying services for a patient, or a person that is buying services for an animal. - */ - _19, - /** - * An order, task, work item, procedure step, or other description of work to be performed. E.g., a particular instance of an MPPS. - */ - _20, - /** - * A list of jobs or a system that provides lists of jobs. E.g., an MWL SCP. - */ - _21, - /** - * (Deprecated). - */ - _22, - /** - * An object that specifies or controls the routing or delivery of items. For example, a distribution list is the routing criteria for mail. The items delivered may be documents, jobs, or other objects. - */ - _23, - /** - * The contents of a query. This is used to capture the contents of any kind of query. For security surveillance purposes knowing the queries being made is very important. - */ - _24, - /** - * added to help the parsers - */ - NULL; - public static ObjectRole fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("1".equals(codeString)) - return _1; - if ("2".equals(codeString)) - return _2; - if ("3".equals(codeString)) - return _3; - if ("4".equals(codeString)) - return _4; - if ("5".equals(codeString)) - return _5; - if ("6".equals(codeString)) - return _6; - if ("7".equals(codeString)) - return _7; - if ("8".equals(codeString)) - return _8; - if ("9".equals(codeString)) - return _9; - if ("10".equals(codeString)) - return _10; - if ("11".equals(codeString)) - return _11; - if ("12".equals(codeString)) - return _12; - if ("13".equals(codeString)) - return _13; - if ("14".equals(codeString)) - return _14; - if ("15".equals(codeString)) - return _15; - if ("16".equals(codeString)) - return _16; - if ("17".equals(codeString)) - return _17; - if ("18".equals(codeString)) - return _18; - if ("19".equals(codeString)) - return _19; - if ("20".equals(codeString)) - return _20; - if ("21".equals(codeString)) - return _21; - if ("22".equals(codeString)) - return _22; - if ("23".equals(codeString)) - return _23; - if ("24".equals(codeString)) - return _24; - throw new Exception("Unknown ObjectRole code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case _1: return "1"; - case _2: return "2"; - case _3: return "3"; - case _4: return "4"; - case _5: return "5"; - case _6: return "6"; - case _7: return "7"; - case _8: return "8"; - case _9: return "9"; - case _10: return "10"; - case _11: return "11"; - case _12: return "12"; - case _13: return "13"; - case _14: return "14"; - case _15: return "15"; - case _16: return "16"; - case _17: return "17"; - case _18: return "18"; - case _19: return "19"; - case _20: return "20"; - case _21: return "21"; - case _22: return "22"; - case _23: return "23"; - case _24: return "24"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case _1: return ""; - case _2: return ""; - case _3: return ""; - case _4: return ""; - case _5: return ""; - case _6: return ""; - case _7: return ""; - case _8: return ""; - case _9: return ""; - case _10: return ""; - case _11: return ""; - case _12: return ""; - case _13: return ""; - case _14: return ""; - case _15: return ""; - case _16: return ""; - case _17: return ""; - case _18: return ""; - case _19: return ""; - case _20: return ""; - case _21: return ""; - case _22: return ""; - case _23: return ""; - case _24: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case _1: return "This object is the patient that is the subject of care related to this event. It is identifiable by patient ID or equivalent. The patient may be either human or animal."; - case _2: return "This is a location identified as related to the event. This is usually the location where the event took place. Note that for shipping, the usual events are arrival at a location or departure from a location."; - case _3: return "This object is any kind of persistent document created as a result of the event. This could be a paper report, film, electronic report, DICOM Study, etc. Issues related to medical records life cycle management are conveyed elsewhere."; - case _4: return "A logical object related to a health record event. This is any healthcare specific resource (object) not restricted to FHIR defined Resources."; - case _5: return "This is any configurable file used to control creation of documents. Examples include the objects maintained by the HL7 Master File transactions, Value Sets, etc."; - case _6: return "A human participant not otherwise identified by some other category."; - case _7: return "(deprecated)."; - case _8: return "Typically a licensed person who is providing or performing care related to the event, generally a physician. The key distinction between doctor and practitioner is with regards to their role, not the licensing. The doctor is the human who actually performed the work. The practitioner is the human or organization that is responsible for the work."; - case _9: return "A person or system that is being notified as part of the event. This is relevant in situations where automated systems provide notifications to other parties when an event took place."; - case _10: return "Insurance company, or any other organization who accepts responsibility for paying for the healthcare event."; - case _11: return "A person or active system object involved in the event with a security role."; - case _12: return "A person or system object involved in the event with the authority to modify security roles of other objects."; - case _13: return "A passive object, such as a role table, that is relevant to the event."; - case _14: return "(deprecated) Relevant to certain RBAC security methodologies."; - case _15: return "Any person or organization responsible for providing care. This encompasses all forms of care, licensed or otherwise, and all sorts of teams and care groups. Note, the distinction between practitioners and the doctor that actually provided the care to the patient."; - case _16: return "The source or destination for data transfer, when it does not match some other role."; - case _17: return "A source or destination for data transfer, that acts as an archive, database, or similar role."; - case _18: return "An object that holds schedule information. This could be an appointment book, availability information, etc."; - case _19: return "An organization or person that is the recipient of services. This could be an organization that is buying services for a patient, or a person that is buying services for an animal."; - case _20: return "An order, task, work item, procedure step, or other description of work to be performed. E.g., a particular instance of an MPPS."; - case _21: return "A list of jobs or a system that provides lists of jobs. E.g., an MWL SCP."; - case _22: return "(Deprecated)."; - case _23: return "An object that specifies or controls the routing or delivery of items. For example, a distribution list is the routing criteria for mail. The items delivered may be documents, jobs, or other objects."; - case _24: return "The contents of a query. This is used to capture the contents of any kind of query. For security surveillance purposes knowing the queries being made is very important."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case _1: return "Patient"; - case _2: return "Location"; - case _3: return "Report"; - case _4: return "DomainResource"; - case _5: return "Master file"; - case _6: return "User"; - case _7: return "List"; - case _8: return "Doctor"; - case _9: return "Subscriber"; - case _10: return "Guarantor"; - case _11: return "Security User Entity"; - case _12: return "Security User Group"; - case _13: return "Security Resource"; - case _14: return "Security Granularity Definition"; - case _15: return "Practitioner"; - case _16: return "Data Destination"; - case _17: return "Data Repository"; - case _18: return "Schedule"; - case _19: return "Customer"; - case _20: return "Job"; - case _21: return "Job Stream"; - case _22: return "Table"; - case _23: return "Routing Criteria"; - case _24: return "Query"; - default: return "?"; - } - } - } - - public static class ObjectRoleEnumFactory implements EnumFactory { - public ObjectRole fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("1".equals(codeString)) - return ObjectRole._1; - if ("2".equals(codeString)) - return ObjectRole._2; - if ("3".equals(codeString)) - return ObjectRole._3; - if ("4".equals(codeString)) - return ObjectRole._4; - if ("5".equals(codeString)) - return ObjectRole._5; - if ("6".equals(codeString)) - return ObjectRole._6; - if ("7".equals(codeString)) - return ObjectRole._7; - if ("8".equals(codeString)) - return ObjectRole._8; - if ("9".equals(codeString)) - return ObjectRole._9; - if ("10".equals(codeString)) - return ObjectRole._10; - if ("11".equals(codeString)) - return ObjectRole._11; - if ("12".equals(codeString)) - return ObjectRole._12; - if ("13".equals(codeString)) - return ObjectRole._13; - if ("14".equals(codeString)) - return ObjectRole._14; - if ("15".equals(codeString)) - return ObjectRole._15; - if ("16".equals(codeString)) - return ObjectRole._16; - if ("17".equals(codeString)) - return ObjectRole._17; - if ("18".equals(codeString)) - return ObjectRole._18; - if ("19".equals(codeString)) - return ObjectRole._19; - if ("20".equals(codeString)) - return ObjectRole._20; - if ("21".equals(codeString)) - return ObjectRole._21; - if ("22".equals(codeString)) - return ObjectRole._22; - if ("23".equals(codeString)) - return ObjectRole._23; - if ("24".equals(codeString)) - return ObjectRole._24; - throw new IllegalArgumentException("Unknown ObjectRole code '"+codeString+"'"); - } - public String toCode(ObjectRole code) { - if (code == ObjectRole._1) - return "1"; - if (code == ObjectRole._2) - return "2"; - if (code == ObjectRole._3) - return "3"; - if (code == ObjectRole._4) - return "4"; - if (code == ObjectRole._5) - return "5"; - if (code == ObjectRole._6) - return "6"; - if (code == ObjectRole._7) - return "7"; - if (code == ObjectRole._8) - return "8"; - if (code == ObjectRole._9) - return "9"; - if (code == ObjectRole._10) - return "10"; - if (code == ObjectRole._11) - return "11"; - if (code == ObjectRole._12) - return "12"; - if (code == ObjectRole._13) - return "13"; - if (code == ObjectRole._14) - return "14"; - if (code == ObjectRole._15) - return "15"; - if (code == ObjectRole._16) - return "16"; - if (code == ObjectRole._17) - return "17"; - if (code == ObjectRole._18) - return "18"; - if (code == ObjectRole._19) - return "19"; - if (code == ObjectRole._20) - return "20"; - if (code == ObjectRole._21) - return "21"; - if (code == ObjectRole._22) - return "22"; - if (code == ObjectRole._23) - return "23"; - if (code == ObjectRole._24) - return "24"; - return "?"; - } - } - - public enum ObjectLifecycle { - /** - * Origination / Creation. - */ - _1, - /** - * Import / Copy from original. - */ - _2, - /** - * Amendment. - */ - _3, - /** - * Verification. - */ - _4, - /** - * Translation. - */ - _5, - /** - * Access / Use. - */ - _6, - /** - * De-identification. - */ - _7, - /** - * Aggregation, summarization, derivation. - */ - _8, - /** - * Report. - */ - _9, - /** - * Export / Copy to target. - */ - _10, - /** - * Disclosure. - */ - _11, - /** - * Receipt of disclosure. - */ - _12, - /** - * Archiving. - */ - _13, - /** - * Logical deletion. - */ - _14, - /** - * Permanent erasure / Physical destruction. - */ - _15, - /** - * added to help the parsers - */ - NULL; - public static ObjectLifecycle fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("1".equals(codeString)) - return _1; - if ("2".equals(codeString)) - return _2; - if ("3".equals(codeString)) - return _3; - if ("4".equals(codeString)) - return _4; - if ("5".equals(codeString)) - return _5; - if ("6".equals(codeString)) - return _6; - if ("7".equals(codeString)) - return _7; - if ("8".equals(codeString)) - return _8; - if ("9".equals(codeString)) - return _9; - if ("10".equals(codeString)) - return _10; - if ("11".equals(codeString)) - return _11; - if ("12".equals(codeString)) - return _12; - if ("13".equals(codeString)) - return _13; - if ("14".equals(codeString)) - return _14; - if ("15".equals(codeString)) - return _15; - throw new Exception("Unknown ObjectLifecycle code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case _1: return "1"; - case _2: return "2"; - case _3: return "3"; - case _4: return "4"; - case _5: return "5"; - case _6: return "6"; - case _7: return "7"; - case _8: return "8"; - case _9: return "9"; - case _10: return "10"; - case _11: return "11"; - case _12: return "12"; - case _13: return "13"; - case _14: return "14"; - case _15: return "15"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case _1: return ""; - case _2: return ""; - case _3: return ""; - case _4: return ""; - case _5: return ""; - case _6: return ""; - case _7: return ""; - case _8: return ""; - case _9: return ""; - case _10: return ""; - case _11: return ""; - case _12: return ""; - case _13: return ""; - case _14: return ""; - case _15: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case _1: return "Origination / Creation."; - case _2: return "Import / Copy from original."; - case _3: return "Amendment."; - case _4: return "Verification."; - case _5: return "Translation."; - case _6: return "Access / Use."; - case _7: return "De-identification."; - case _8: return "Aggregation, summarization, derivation."; - case _9: return "Report."; - case _10: return "Export / Copy to target."; - case _11: return "Disclosure."; - case _12: return "Receipt of disclosure."; - case _13: return "Archiving."; - case _14: return "Logical deletion."; - case _15: return "Permanent erasure / Physical destruction."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case _1: return " "; - case _2: return " "; - case _3: return " "; - case _4: return " "; - case _5: return " "; - case _6: return " "; - case _7: return " "; - case _8: return " "; - case _9: return " "; - case _10: return " "; - case _11: return " "; - case _12: return " "; - case _13: return " "; - case _14: return " "; - case _15: return " "; - default: return "?"; - } - } - } - - public static class ObjectLifecycleEnumFactory implements EnumFactory { - public ObjectLifecycle fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("1".equals(codeString)) - return ObjectLifecycle._1; - if ("2".equals(codeString)) - return ObjectLifecycle._2; - if ("3".equals(codeString)) - return ObjectLifecycle._3; - if ("4".equals(codeString)) - return ObjectLifecycle._4; - if ("5".equals(codeString)) - return ObjectLifecycle._5; - if ("6".equals(codeString)) - return ObjectLifecycle._6; - if ("7".equals(codeString)) - return ObjectLifecycle._7; - if ("8".equals(codeString)) - return ObjectLifecycle._8; - if ("9".equals(codeString)) - return ObjectLifecycle._9; - if ("10".equals(codeString)) - return ObjectLifecycle._10; - if ("11".equals(codeString)) - return ObjectLifecycle._11; - if ("12".equals(codeString)) - return ObjectLifecycle._12; - if ("13".equals(codeString)) - return ObjectLifecycle._13; - if ("14".equals(codeString)) - return ObjectLifecycle._14; - if ("15".equals(codeString)) - return ObjectLifecycle._15; - throw new IllegalArgumentException("Unknown ObjectLifecycle code '"+codeString+"'"); - } - public String toCode(ObjectLifecycle code) { - if (code == ObjectLifecycle._1) - return "1"; - if (code == ObjectLifecycle._2) - return "2"; - if (code == ObjectLifecycle._3) - return "3"; - if (code == ObjectLifecycle._4) - return "4"; - if (code == ObjectLifecycle._5) - return "5"; - if (code == ObjectLifecycle._6) - return "6"; - if (code == ObjectLifecycle._7) - return "7"; - if (code == ObjectLifecycle._8) - return "8"; - if (code == ObjectLifecycle._9) - return "9"; - if (code == ObjectLifecycle._10) - return "10"; - if (code == ObjectLifecycle._11) - return "11"; - if (code == ObjectLifecycle._12) - return "12"; - if (code == ObjectLifecycle._13) - return "13"; - if (code == ObjectLifecycle._14) - return "14"; - if (code == ObjectLifecycle._15) - return "15"; - return "?"; - } - } - - @Block() - public static class AuditEventEventComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifier for a family of the event. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Type/identifier of event", formalDefinition="Identifier for a family of the event." ) - protected CodeableConcept type; - - /** - * Identifier for the category of event. - */ - @Child(name = "subtype", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="More specific type/id for the event", formalDefinition="Identifier for the category of event." ) - protected List subtype; - - /** - * Indicator for type of action performed during the event that generated the audit. - */ - @Child(name = "action", type = {CodeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Type of action performed during the event", formalDefinition="Indicator for type of action performed during the event that generated the audit." ) - protected Enumeration action; - - /** - * The time when the event occurred on the source. - */ - @Child(name = "dateTime", type = {InstantType.class}, order=4, min=1, max=1) - @Description(shortDefinition="Time when the event occurred on source", formalDefinition="The time when the event occurred on the source." ) - protected InstantType dateTime; - - /** - * Indicates whether the event succeeded or failed. - */ - @Child(name = "outcome", type = {CodeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Whether the event succeeded or failed", formalDefinition="Indicates whether the event succeeded or failed." ) - protected Enumeration outcome; - - /** - * A free text description of the outcome of the event. - */ - @Child(name = "outcomeDesc", type = {StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Description of the event outcome", formalDefinition="A free text description of the outcome of the event." ) - protected StringType outcomeDesc; - - /** - * The purposeOfUse (reason) that was used during the event being recorded. - */ - @Child(name = "purposeOfEvent", type = {Coding.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The purposeOfUse of the event", formalDefinition="The purposeOfUse (reason) that was used during the event being recorded." ) - protected List purposeOfEvent; - - private static final long serialVersionUID = 339035171L; - - /* - * Constructor - */ - public AuditEventEventComponent() { - super(); - } - - /* - * Constructor - */ - public AuditEventEventComponent(CodeableConcept type, InstantType dateTime) { - super(); - this.type = type; - this.dateTime = dateTime; - } - - /** - * @return {@link #type} (Identifier for a family of the event.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventEventComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Identifier for a family of the event.) - */ - public AuditEventEventComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #subtype} (Identifier for the category of event.) - */ - public List getSubtype() { - if (this.subtype == null) - this.subtype = new ArrayList(); - return this.subtype; - } - - public boolean hasSubtype() { - if (this.subtype == null) - return false; - for (CodeableConcept item : this.subtype) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subtype} (Identifier for the category of event.) - */ - // syntactic sugar - public CodeableConcept addSubtype() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.subtype == null) - this.subtype = new ArrayList(); - this.subtype.add(t); - return t; - } - - // syntactic sugar - public AuditEventEventComponent addSubtype(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.subtype == null) - this.subtype = new ArrayList(); - this.subtype.add(t); - return this; - } - - /** - * @return {@link #action} (Indicator for type of action performed during the event that generated the audit.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value - */ - public Enumeration getActionElement() { - if (this.action == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventEventComponent.action"); - else if (Configuration.doAutoCreate()) - this.action = new Enumeration(new AuditEventActionEnumFactory()); // bb - return this.action; - } - - public boolean hasActionElement() { - return this.action != null && !this.action.isEmpty(); - } - - public boolean hasAction() { - return this.action != null && !this.action.isEmpty(); - } - - /** - * @param value {@link #action} (Indicator for type of action performed during the event that generated the audit.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value - */ - public AuditEventEventComponent setActionElement(Enumeration value) { - this.action = value; - return this; - } - - /** - * @return Indicator for type of action performed during the event that generated the audit. - */ - public AuditEventAction getAction() { - return this.action == null ? null : this.action.getValue(); - } - - /** - * @param value Indicator for type of action performed during the event that generated the audit. - */ - public AuditEventEventComponent setAction(AuditEventAction value) { - if (value == null) - this.action = null; - else { - if (this.action == null) - this.action = new Enumeration(new AuditEventActionEnumFactory()); - this.action.setValue(value); - } - return this; - } - - /** - * @return {@link #dateTime} (The time when the event occurred on the source.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public InstantType getDateTimeElement() { - if (this.dateTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventEventComponent.dateTime"); - else if (Configuration.doAutoCreate()) - this.dateTime = new InstantType(); // bb - return this.dateTime; - } - - public boolean hasDateTimeElement() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - public boolean hasDateTime() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - /** - * @param value {@link #dateTime} (The time when the event occurred on the source.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public AuditEventEventComponent setDateTimeElement(InstantType value) { - this.dateTime = value; - return this; - } - - /** - * @return The time when the event occurred on the source. - */ - public Date getDateTime() { - return this.dateTime == null ? null : this.dateTime.getValue(); - } - - /** - * @param value The time when the event occurred on the source. - */ - public AuditEventEventComponent setDateTime(Date value) { - if (this.dateTime == null) - this.dateTime = new InstantType(); - this.dateTime.setValue(value); - return this; - } - - /** - * @return {@link #outcome} (Indicates whether the event succeeded or failed.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public Enumeration getOutcomeElement() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventEventComponent.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Enumeration(new AuditEventOutcomeEnumFactory()); // bb - return this.outcome; - } - - public boolean hasOutcomeElement() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Indicates whether the event succeeded or failed.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public AuditEventEventComponent setOutcomeElement(Enumeration value) { - this.outcome = value; - return this; - } - - /** - * @return Indicates whether the event succeeded or failed. - */ - public AuditEventOutcome getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value Indicates whether the event succeeded or failed. - */ - public AuditEventEventComponent setOutcome(AuditEventOutcome value) { - if (value == null) - this.outcome = null; - else { - if (this.outcome == null) - this.outcome = new Enumeration(new AuditEventOutcomeEnumFactory()); - this.outcome.setValue(value); - } - return this; - } - - /** - * @return {@link #outcomeDesc} (A free text description of the outcome of the event.). This is the underlying object with id, value and extensions. The accessor "getOutcomeDesc" gives direct access to the value - */ - public StringType getOutcomeDescElement() { - if (this.outcomeDesc == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventEventComponent.outcomeDesc"); - else if (Configuration.doAutoCreate()) - this.outcomeDesc = new StringType(); // bb - return this.outcomeDesc; - } - - public boolean hasOutcomeDescElement() { - return this.outcomeDesc != null && !this.outcomeDesc.isEmpty(); - } - - public boolean hasOutcomeDesc() { - return this.outcomeDesc != null && !this.outcomeDesc.isEmpty(); - } - - /** - * @param value {@link #outcomeDesc} (A free text description of the outcome of the event.). This is the underlying object with id, value and extensions. The accessor "getOutcomeDesc" gives direct access to the value - */ - public AuditEventEventComponent setOutcomeDescElement(StringType value) { - this.outcomeDesc = value; - return this; - } - - /** - * @return A free text description of the outcome of the event. - */ - public String getOutcomeDesc() { - return this.outcomeDesc == null ? null : this.outcomeDesc.getValue(); - } - - /** - * @param value A free text description of the outcome of the event. - */ - public AuditEventEventComponent setOutcomeDesc(String value) { - if (Utilities.noString(value)) - this.outcomeDesc = null; - else { - if (this.outcomeDesc == null) - this.outcomeDesc = new StringType(); - this.outcomeDesc.setValue(value); - } - return this; - } - - /** - * @return {@link #purposeOfEvent} (The purposeOfUse (reason) that was used during the event being recorded.) - */ - public List getPurposeOfEvent() { - if (this.purposeOfEvent == null) - this.purposeOfEvent = new ArrayList(); - return this.purposeOfEvent; - } - - public boolean hasPurposeOfEvent() { - if (this.purposeOfEvent == null) - return false; - for (Coding item : this.purposeOfEvent) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #purposeOfEvent} (The purposeOfUse (reason) that was used during the event being recorded.) - */ - // syntactic sugar - public Coding addPurposeOfEvent() { //3 - Coding t = new Coding(); - if (this.purposeOfEvent == null) - this.purposeOfEvent = new ArrayList(); - this.purposeOfEvent.add(t); - return t; - } - - // syntactic sugar - public AuditEventEventComponent addPurposeOfEvent(Coding t) { //3 - if (t == null) - return this; - if (this.purposeOfEvent == null) - this.purposeOfEvent = new ArrayList(); - this.purposeOfEvent.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "Identifier for a family of the event.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("subtype", "CodeableConcept", "Identifier for the category of event.", 0, java.lang.Integer.MAX_VALUE, subtype)); - childrenList.add(new Property("action", "code", "Indicator for type of action performed during the event that generated the audit.", 0, java.lang.Integer.MAX_VALUE, action)); - childrenList.add(new Property("dateTime", "instant", "The time when the event occurred on the source.", 0, java.lang.Integer.MAX_VALUE, dateTime)); - childrenList.add(new Property("outcome", "code", "Indicates whether the event succeeded or failed.", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("outcomeDesc", "string", "A free text description of the outcome of the event.", 0, java.lang.Integer.MAX_VALUE, outcomeDesc)); - childrenList.add(new Property("purposeOfEvent", "Coding", "The purposeOfUse (reason) that was used during the event being recorded.", 0, java.lang.Integer.MAX_VALUE, purposeOfEvent)); - } - - public AuditEventEventComponent copy() { - AuditEventEventComponent dst = new AuditEventEventComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - if (subtype != null) { - dst.subtype = new ArrayList(); - for (CodeableConcept i : subtype) - dst.subtype.add(i.copy()); - }; - dst.action = action == null ? null : action.copy(); - dst.dateTime = dateTime == null ? null : dateTime.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.outcomeDesc = outcomeDesc == null ? null : outcomeDesc.copy(); - if (purposeOfEvent != null) { - dst.purposeOfEvent = new ArrayList(); - for (Coding i : purposeOfEvent) - dst.purposeOfEvent.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AuditEventEventComponent)) - return false; - AuditEventEventComponent o = (AuditEventEventComponent) other; - return compareDeep(type, o.type, true) && compareDeep(subtype, o.subtype, true) && compareDeep(action, o.action, true) - && compareDeep(dateTime, o.dateTime, true) && compareDeep(outcome, o.outcome, true) && compareDeep(outcomeDesc, o.outcomeDesc, true) - && compareDeep(purposeOfEvent, o.purposeOfEvent, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AuditEventEventComponent)) - return false; - AuditEventEventComponent o = (AuditEventEventComponent) other; - return compareValues(action, o.action, true) && compareValues(dateTime, o.dateTime, true) && compareValues(outcome, o.outcome, true) - && compareValues(outcomeDesc, o.outcomeDesc, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (subtype == null || subtype.isEmpty()) - && (action == null || action.isEmpty()) && (dateTime == null || dateTime.isEmpty()) && (outcome == null || outcome.isEmpty()) - && (outcomeDesc == null || outcomeDesc.isEmpty()) && (purposeOfEvent == null || purposeOfEvent.isEmpty()) - ; - } - - } - - @Block() - public static class AuditEventParticipantComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context. - */ - @Child(name = "role", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="User roles (e.g. local RBAC codes)", formalDefinition="Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context." ) - protected List role; - - /** - * Direct reference to a resource that identifies the participant. - */ - @Child(name = "reference", type = {Practitioner.class, Organization.class, Device.class, Patient.class, RelatedPerson.class}, order=2, min=0, max=1) - @Description(shortDefinition="Direct reference to resource", formalDefinition="Direct reference to a resource that identifies the participant." ) - protected Reference reference; - - /** - * The actual object that is the target of the reference (Direct reference to a resource that identifies the participant.) - */ - protected Resource referenceTarget; - - /** - * Unique identifier for the user actively participating in the event. - */ - @Child(name = "userId", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Unique identifier for the user", formalDefinition="Unique identifier for the user actively participating in the event." ) - protected StringType userId; - - /** - * Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available. - */ - @Child(name = "altId", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Alternative User id e.g. authentication", formalDefinition="Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available." ) - protected StringType altId; - - /** - * Human-meaningful name for the user. - */ - @Child(name = "name", type = {StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Human-meaningful name for the user", formalDefinition="Human-meaningful name for the user." ) - protected StringType name; - - /** - * Indicator that the user is or is not the requestor, or initiator, for the event being audited. - */ - @Child(name = "requestor", type = {BooleanType.class}, order=6, min=1, max=1) - @Description(shortDefinition="Whether user is initiator", formalDefinition="Indicator that the user is or is not the requestor, or initiator, for the event being audited." ) - protected BooleanType requestor; - - /** - * Where the event occurred. - */ - @Child(name = "location", type = {Location.class}, order=7, min=0, max=1) - @Description(shortDefinition="Where", formalDefinition="Where the event occurred." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (Where the event occurred.) - */ - protected Location locationTarget; - - /** - * The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used. - */ - @Child(name = "policy", type = {UriType.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Policy that authorized event", formalDefinition="The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used." ) - protected List policy; - - /** - * Type of media involved. Used when the event is about exporting/importing onto media. - */ - @Child(name = "media", type = {Coding.class}, order=9, min=0, max=1) - @Description(shortDefinition="Type of media", formalDefinition="Type of media involved. Used when the event is about exporting/importing onto media." ) - protected Coding media; - - /** - * Logical network location for application activity, if the activity has a network location. - */ - @Child(name = "network", type = {}, order=10, min=0, max=1) - @Description(shortDefinition="Logical network location for application activity", formalDefinition="Logical network location for application activity, if the activity has a network location." ) - protected AuditEventParticipantNetworkComponent network; - - /** - * The purposeOfUse (reason) specific to this participant that was used during the event being recorded. - */ - @Child(name = "purposeOfUse", type = {Coding.class}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Participant purposeOfUse", formalDefinition="The purposeOfUse (reason) specific to this participant that was used during the event being recorded." ) - protected List purposeOfUse; - - private static final long serialVersionUID = -1555724321L; - - /* - * Constructor - */ - public AuditEventParticipantComponent() { - super(); - } - - /* - * Constructor - */ - public AuditEventParticipantComponent(BooleanType requestor) { - super(); - this.requestor = requestor; - } - - /** - * @return {@link #role} (Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context.) - */ - public List getRole() { - if (this.role == null) - this.role = new ArrayList(); - return this.role; - } - - public boolean hasRole() { - if (this.role == null) - return false; - for (CodeableConcept item : this.role) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #role} (Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context.) - */ - // syntactic sugar - public CodeableConcept addRole() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.role == null) - this.role = new ArrayList(); - this.role.add(t); - return t; - } - - // syntactic sugar - public AuditEventParticipantComponent addRole(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.role == null) - this.role = new ArrayList(); - this.role.add(t); - return this; - } - - /** - * @return {@link #reference} (Direct reference to a resource that identifies the participant.) - */ - public Reference getReference() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventParticipantComponent.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new Reference(); // cc - return this.reference; - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (Direct reference to a resource that identifies the participant.) - */ - public AuditEventParticipantComponent setReference(Reference value) { - this.reference = value; - return this; - } - - /** - * @return {@link #reference} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Direct reference to a resource that identifies the participant.) - */ - public Resource getReferenceTarget() { - return this.referenceTarget; - } - - /** - * @param value {@link #reference} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Direct reference to a resource that identifies the participant.) - */ - public AuditEventParticipantComponent setReferenceTarget(Resource value) { - this.referenceTarget = value; - return this; - } - - /** - * @return {@link #userId} (Unique identifier for the user actively participating in the event.). This is the underlying object with id, value and extensions. The accessor "getUserId" gives direct access to the value - */ - public StringType getUserIdElement() { - if (this.userId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventParticipantComponent.userId"); - else if (Configuration.doAutoCreate()) - this.userId = new StringType(); // bb - return this.userId; - } - - public boolean hasUserIdElement() { - return this.userId != null && !this.userId.isEmpty(); - } - - public boolean hasUserId() { - return this.userId != null && !this.userId.isEmpty(); - } - - /** - * @param value {@link #userId} (Unique identifier for the user actively participating in the event.). This is the underlying object with id, value and extensions. The accessor "getUserId" gives direct access to the value - */ - public AuditEventParticipantComponent setUserIdElement(StringType value) { - this.userId = value; - return this; - } - - /** - * @return Unique identifier for the user actively participating in the event. - */ - public String getUserId() { - return this.userId == null ? null : this.userId.getValue(); - } - - /** - * @param value Unique identifier for the user actively participating in the event. - */ - public AuditEventParticipantComponent setUserId(String value) { - if (Utilities.noString(value)) - this.userId = null; - else { - if (this.userId == null) - this.userId = new StringType(); - this.userId.setValue(value); - } - return this; - } - - /** - * @return {@link #altId} (Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available.). This is the underlying object with id, value and extensions. The accessor "getAltId" gives direct access to the value - */ - public StringType getAltIdElement() { - if (this.altId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventParticipantComponent.altId"); - else if (Configuration.doAutoCreate()) - this.altId = new StringType(); // bb - return this.altId; - } - - public boolean hasAltIdElement() { - return this.altId != null && !this.altId.isEmpty(); - } - - public boolean hasAltId() { - return this.altId != null && !this.altId.isEmpty(); - } - - /** - * @param value {@link #altId} (Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available.). This is the underlying object with id, value and extensions. The accessor "getAltId" gives direct access to the value - */ - public AuditEventParticipantComponent setAltIdElement(StringType value) { - this.altId = value; - return this; - } - - /** - * @return Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available. - */ - public String getAltId() { - return this.altId == null ? null : this.altId.getValue(); - } - - /** - * @param value Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available. - */ - public AuditEventParticipantComponent setAltId(String value) { - if (Utilities.noString(value)) - this.altId = null; - else { - if (this.altId == null) - this.altId = new StringType(); - this.altId.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (Human-meaningful name for the user.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventParticipantComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Human-meaningful name for the user.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public AuditEventParticipantComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Human-meaningful name for the user. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Human-meaningful name for the user. - */ - public AuditEventParticipantComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #requestor} (Indicator that the user is or is not the requestor, or initiator, for the event being audited.). This is the underlying object with id, value and extensions. The accessor "getRequestor" gives direct access to the value - */ - public BooleanType getRequestorElement() { - if (this.requestor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventParticipantComponent.requestor"); - else if (Configuration.doAutoCreate()) - this.requestor = new BooleanType(); // bb - return this.requestor; - } - - public boolean hasRequestorElement() { - return this.requestor != null && !this.requestor.isEmpty(); - } - - public boolean hasRequestor() { - return this.requestor != null && !this.requestor.isEmpty(); - } - - /** - * @param value {@link #requestor} (Indicator that the user is or is not the requestor, or initiator, for the event being audited.). This is the underlying object with id, value and extensions. The accessor "getRequestor" gives direct access to the value - */ - public AuditEventParticipantComponent setRequestorElement(BooleanType value) { - this.requestor = value; - return this; - } - - /** - * @return Indicator that the user is or is not the requestor, or initiator, for the event being audited. - */ - public boolean getRequestor() { - return this.requestor == null || this.requestor.isEmpty() ? false : this.requestor.getValue(); - } - - /** - * @param value Indicator that the user is or is not the requestor, or initiator, for the event being audited. - */ - public AuditEventParticipantComponent setRequestor(boolean value) { - if (this.requestor == null) - this.requestor = new BooleanType(); - this.requestor.setValue(value); - return this; - } - - /** - * @return {@link #location} (Where the event occurred.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventParticipantComponent.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); // cc - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (Where the event occurred.) - */ - public AuditEventParticipantComponent setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Where the event occurred.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventParticipantComponent.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); // aa - return this.locationTarget; - } - - /** - * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Where the event occurred.) - */ - public AuditEventParticipantComponent setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #policy} (The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.) - */ - public List getPolicy() { - if (this.policy == null) - this.policy = new ArrayList(); - return this.policy; - } - - public boolean hasPolicy() { - if (this.policy == null) - return false; - for (UriType item : this.policy) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #policy} (The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.) - */ - // syntactic sugar - public UriType addPolicyElement() {//2 - UriType t = new UriType(); - if (this.policy == null) - this.policy = new ArrayList(); - this.policy.add(t); - return t; - } - - /** - * @param value {@link #policy} (The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.) - */ - public AuditEventParticipantComponent addPolicy(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.policy == null) - this.policy = new ArrayList(); - this.policy.add(t); - return this; - } - - /** - * @param value {@link #policy} (The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.) - */ - public boolean hasPolicy(String value) { - if (this.policy == null) - return false; - for (UriType v : this.policy) - if (v.equals(value)) // uri - return true; - return false; - } - - /** - * @return {@link #media} (Type of media involved. Used when the event is about exporting/importing onto media.) - */ - public Coding getMedia() { - if (this.media == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventParticipantComponent.media"); - else if (Configuration.doAutoCreate()) - this.media = new Coding(); // cc - return this.media; - } - - public boolean hasMedia() { - return this.media != null && !this.media.isEmpty(); - } - - /** - * @param value {@link #media} (Type of media involved. Used when the event is about exporting/importing onto media.) - */ - public AuditEventParticipantComponent setMedia(Coding value) { - this.media = value; - return this; - } - - /** - * @return {@link #network} (Logical network location for application activity, if the activity has a network location.) - */ - public AuditEventParticipantNetworkComponent getNetwork() { - if (this.network == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventParticipantComponent.network"); - else if (Configuration.doAutoCreate()) - this.network = new AuditEventParticipantNetworkComponent(); // cc - return this.network; - } - - public boolean hasNetwork() { - return this.network != null && !this.network.isEmpty(); - } - - /** - * @param value {@link #network} (Logical network location for application activity, if the activity has a network location.) - */ - public AuditEventParticipantComponent setNetwork(AuditEventParticipantNetworkComponent value) { - this.network = value; - return this; - } - - /** - * @return {@link #purposeOfUse} (The purposeOfUse (reason) specific to this participant that was used during the event being recorded.) - */ - public List getPurposeOfUse() { - if (this.purposeOfUse == null) - this.purposeOfUse = new ArrayList(); - return this.purposeOfUse; - } - - public boolean hasPurposeOfUse() { - if (this.purposeOfUse == null) - return false; - for (Coding item : this.purposeOfUse) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #purposeOfUse} (The purposeOfUse (reason) specific to this participant that was used during the event being recorded.) - */ - // syntactic sugar - public Coding addPurposeOfUse() { //3 - Coding t = new Coding(); - if (this.purposeOfUse == null) - this.purposeOfUse = new ArrayList(); - this.purposeOfUse.add(t); - return t; - } - - // syntactic sugar - public AuditEventParticipantComponent addPurposeOfUse(Coding t) { //3 - if (t == null) - return this; - if (this.purposeOfUse == null) - this.purposeOfUse = new ArrayList(); - this.purposeOfUse.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("role", "CodeableConcept", "Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("reference", "Reference(Practitioner|Organization|Device|Patient|RelatedPerson)", "Direct reference to a resource that identifies the participant.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("userId", "string", "Unique identifier for the user actively participating in the event.", 0, java.lang.Integer.MAX_VALUE, userId)); - childrenList.add(new Property("altId", "string", "Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available.", 0, java.lang.Integer.MAX_VALUE, altId)); - childrenList.add(new Property("name", "string", "Human-meaningful name for the user.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("requestor", "boolean", "Indicator that the user is or is not the requestor, or initiator, for the event being audited.", 0, java.lang.Integer.MAX_VALUE, requestor)); - childrenList.add(new Property("location", "Reference(Location)", "Where the event occurred.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("policy", "uri", "The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.", 0, java.lang.Integer.MAX_VALUE, policy)); - childrenList.add(new Property("media", "Coding", "Type of media involved. Used when the event is about exporting/importing onto media.", 0, java.lang.Integer.MAX_VALUE, media)); - childrenList.add(new Property("network", "", "Logical network location for application activity, if the activity has a network location.", 0, java.lang.Integer.MAX_VALUE, network)); - childrenList.add(new Property("purposeOfUse", "Coding", "The purposeOfUse (reason) specific to this participant that was used during the event being recorded.", 0, java.lang.Integer.MAX_VALUE, purposeOfUse)); - } - - public AuditEventParticipantComponent copy() { - AuditEventParticipantComponent dst = new AuditEventParticipantComponent(); - copyValues(dst); - if (role != null) { - dst.role = new ArrayList(); - for (CodeableConcept i : role) - dst.role.add(i.copy()); - }; - dst.reference = reference == null ? null : reference.copy(); - dst.userId = userId == null ? null : userId.copy(); - dst.altId = altId == null ? null : altId.copy(); - dst.name = name == null ? null : name.copy(); - dst.requestor = requestor == null ? null : requestor.copy(); - dst.location = location == null ? null : location.copy(); - if (policy != null) { - dst.policy = new ArrayList(); - for (UriType i : policy) - dst.policy.add(i.copy()); - }; - dst.media = media == null ? null : media.copy(); - dst.network = network == null ? null : network.copy(); - if (purposeOfUse != null) { - dst.purposeOfUse = new ArrayList(); - for (Coding i : purposeOfUse) - dst.purposeOfUse.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AuditEventParticipantComponent)) - return false; - AuditEventParticipantComponent o = (AuditEventParticipantComponent) other; - return compareDeep(role, o.role, true) && compareDeep(reference, o.reference, true) && compareDeep(userId, o.userId, true) - && compareDeep(altId, o.altId, true) && compareDeep(name, o.name, true) && compareDeep(requestor, o.requestor, true) - && compareDeep(location, o.location, true) && compareDeep(policy, o.policy, true) && compareDeep(media, o.media, true) - && compareDeep(network, o.network, true) && compareDeep(purposeOfUse, o.purposeOfUse, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AuditEventParticipantComponent)) - return false; - AuditEventParticipantComponent o = (AuditEventParticipantComponent) other; - return compareValues(userId, o.userId, true) && compareValues(altId, o.altId, true) && compareValues(name, o.name, true) - && compareValues(requestor, o.requestor, true) && compareValues(policy, o.policy, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (role == null || role.isEmpty()) && (reference == null || reference.isEmpty()) - && (userId == null || userId.isEmpty()) && (altId == null || altId.isEmpty()) && (name == null || name.isEmpty()) - && (requestor == null || requestor.isEmpty()) && (location == null || location.isEmpty()) - && (policy == null || policy.isEmpty()) && (media == null || media.isEmpty()) && (network == null || network.isEmpty()) - && (purposeOfUse == null || purposeOfUse.isEmpty()); - } - - } - - @Block() - public static class AuditEventParticipantNetworkComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An identifier for the network access point of the user device for the audit event. - */ - @Child(name = "identifier", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Identifier for the network access point of the user device", formalDefinition="An identifier for the network access point of the user device for the audit event." ) - protected StringType identifier; - - /** - * An identifier for the type of network access point that originated the audit event. - */ - @Child(name = "type", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="The type of network access point", formalDefinition="An identifier for the type of network access point that originated the audit event." ) - protected Enumeration type; - - private static final long serialVersionUID = -1946856025L; - - /* - * Constructor - */ - public AuditEventParticipantNetworkComponent() { - super(); - } - - /** - * @return {@link #identifier} (An identifier for the network access point of the user device for the audit event.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public StringType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventParticipantNetworkComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new StringType(); // bb - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (An identifier for the network access point of the user device for the audit event.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public AuditEventParticipantNetworkComponent setIdentifierElement(StringType value) { - this.identifier = value; - return this; - } - - /** - * @return An identifier for the network access point of the user device for the audit event. - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value An identifier for the network access point of the user device for the audit event. - */ - public AuditEventParticipantNetworkComponent setIdentifier(String value) { - if (Utilities.noString(value)) - this.identifier = null; - else { - if (this.identifier == null) - this.identifier = new StringType(); - this.identifier.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (An identifier for the type of network access point that originated the audit event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventParticipantNetworkComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new NetworkTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (An identifier for the type of network access point that originated the audit event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public AuditEventParticipantNetworkComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return An identifier for the type of network access point that originated the audit event. - */ - public NetworkType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value An identifier for the type of network access point that originated the audit event. - */ - public AuditEventParticipantNetworkComponent setType(NetworkType value) { - if (value == null) - this.type = null; - else { - if (this.type == null) - this.type = new Enumeration(new NetworkTypeEnumFactory()); - this.type.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "string", "An identifier for the network access point of the user device for the audit event.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("type", "code", "An identifier for the type of network access point that originated the audit event.", 0, java.lang.Integer.MAX_VALUE, type)); - } - - public AuditEventParticipantNetworkComponent copy() { - AuditEventParticipantNetworkComponent dst = new AuditEventParticipantNetworkComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.type = type == null ? null : type.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AuditEventParticipantNetworkComponent)) - return false; - AuditEventParticipantNetworkComponent o = (AuditEventParticipantNetworkComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AuditEventParticipantNetworkComponent)) - return false; - AuditEventParticipantNetworkComponent o = (AuditEventParticipantNetworkComponent) other; - return compareValues(identifier, o.identifier, true) && compareValues(type, o.type, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) - ; - } - - } - - @Block() - public static class AuditEventSourceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Logical source location within the healthcare enterprise network. - */ - @Child(name = "site", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Logical source location within the enterprise", formalDefinition="Logical source location within the healthcare enterprise network." ) - protected StringType site; - - /** - * Identifier of the source where the event originated. - */ - @Child(name = "identifier", type = {StringType.class}, order=2, min=1, max=1) - @Description(shortDefinition="The id of source where event originated", formalDefinition="Identifier of the source where the event originated." ) - protected StringType identifier; - - /** - * Code specifying the type of source where event originated. - */ - @Child(name = "type", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The type of source where event originated", formalDefinition="Code specifying the type of source where event originated." ) - protected List type; - - private static final long serialVersionUID = -382040480L; - - /* - * Constructor - */ - public AuditEventSourceComponent() { - super(); - } - - /* - * Constructor - */ - public AuditEventSourceComponent(StringType identifier) { - super(); - this.identifier = identifier; - } - - /** - * @return {@link #site} (Logical source location within the healthcare enterprise network.). This is the underlying object with id, value and extensions. The accessor "getSite" gives direct access to the value - */ - public StringType getSiteElement() { - if (this.site == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventSourceComponent.site"); - else if (Configuration.doAutoCreate()) - this.site = new StringType(); // bb - return this.site; - } - - public boolean hasSiteElement() { - return this.site != null && !this.site.isEmpty(); - } - - public boolean hasSite() { - return this.site != null && !this.site.isEmpty(); - } - - /** - * @param value {@link #site} (Logical source location within the healthcare enterprise network.). This is the underlying object with id, value and extensions. The accessor "getSite" gives direct access to the value - */ - public AuditEventSourceComponent setSiteElement(StringType value) { - this.site = value; - return this; - } - - /** - * @return Logical source location within the healthcare enterprise network. - */ - public String getSite() { - return this.site == null ? null : this.site.getValue(); - } - - /** - * @param value Logical source location within the healthcare enterprise network. - */ - public AuditEventSourceComponent setSite(String value) { - if (Utilities.noString(value)) - this.site = null; - else { - if (this.site == null) - this.site = new StringType(); - this.site.setValue(value); - } - return this; - } - - /** - * @return {@link #identifier} (Identifier of the source where the event originated.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public StringType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventSourceComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new StringType(); // bb - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifier of the source where the event originated.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public AuditEventSourceComponent setIdentifierElement(StringType value) { - this.identifier = value; - return this; - } - - /** - * @return Identifier of the source where the event originated. - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value Identifier of the source where the event originated. - */ - public AuditEventSourceComponent setIdentifier(String value) { - if (this.identifier == null) - this.identifier = new StringType(); - this.identifier.setValue(value); - return this; - } - - /** - * @return {@link #type} (Code specifying the type of source where event originated.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (Coding item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (Code specifying the type of source where event originated.) - */ - // syntactic sugar - public Coding addType() { //3 - Coding t = new Coding(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - // syntactic sugar - public AuditEventSourceComponent addType(Coding t) { //3 - if (t == null) - return this; - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("site", "string", "Logical source location within the healthcare enterprise network.", 0, java.lang.Integer.MAX_VALUE, site)); - childrenList.add(new Property("identifier", "string", "Identifier of the source where the event originated.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("type", "Coding", "Code specifying the type of source where event originated.", 0, java.lang.Integer.MAX_VALUE, type)); - } - - public AuditEventSourceComponent copy() { - AuditEventSourceComponent dst = new AuditEventSourceComponent(); - copyValues(dst); - dst.site = site == null ? null : site.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - if (type != null) { - dst.type = new ArrayList(); - for (Coding i : type) - dst.type.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AuditEventSourceComponent)) - return false; - AuditEventSourceComponent o = (AuditEventSourceComponent) other; - return compareDeep(site, o.site, true) && compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AuditEventSourceComponent)) - return false; - AuditEventSourceComponent o = (AuditEventSourceComponent) other; - return compareValues(site, o.site, true) && compareValues(identifier, o.identifier, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (site == null || site.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (type == null || type.isEmpty()); - } - - } - - @Block() - public static class AuditEventObjectComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifies a specific instance of the participant object. The reference should always be version specific. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) - @Description(shortDefinition="Specific instance of object (e.g. versioned)", formalDefinition="Identifies a specific instance of the participant object. The reference should always be version specific." ) - protected Identifier identifier; - - /** - * Identifies a specific instance of the participant object. The reference should always be version specific. - */ - @Child(name = "reference", type = {}, order=2, min=0, max=1) - @Description(shortDefinition="Specific instance of resource (e.g. versioned)", formalDefinition="Identifies a specific instance of the participant object. The reference should always be version specific." ) - protected Reference reference; - - /** - * The actual object that is the target of the reference (Identifies a specific instance of the participant object. The reference should always be version specific.) - */ - protected Resource referenceTarget; - - /** - * The type of the object that was involved in this audit event. - */ - @Child(name = "type", type = {CodeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Type of object involved", formalDefinition="The type of the object that was involved in this audit event." ) - protected Enumeration type; - - /** - * Code representing the functional application role of Participant Object being audited. - */ - @Child(name = "role", type = {CodeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="What role the Object played", formalDefinition="Code representing the functional application role of Participant Object being audited." ) - protected Enumeration role; - - /** - * Identifier for the data life-cycle stage for the participant object. - */ - @Child(name = "lifecycle", type = {CodeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Life-cycle stage for the object", formalDefinition="Identifier for the data life-cycle stage for the participant object." ) - protected Enumeration lifecycle; - - /** - * Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics. - */ - @Child(name = "sensitivity", type = {CodeableConcept.class}, order=6, min=0, max=1) - @Description(shortDefinition="Policy-defined sensitivity for the object", formalDefinition="Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics." ) - protected CodeableConcept sensitivity; - - /** - * An instance-specific descriptor of the Participant Object ID audited, such as a person's name. - */ - @Child(name = "name", type = {StringType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Instance-specific descriptor for Object", formalDefinition="An instance-specific descriptor of the Participant Object ID audited, such as a person's name." ) - protected StringType name; - - /** - * Text that describes the object in more detail. - */ - @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Descriptive text", formalDefinition="Text that describes the object in more detail." ) - protected StringType description; - - /** - * The actual query for a query-type participant object. - */ - @Child(name = "query", type = {Base64BinaryType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Actual query for object", formalDefinition="The actual query for a query-type participant object." ) - protected Base64BinaryType query; - - /** - * Additional Information about the Object. - */ - @Child(name = "detail", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Additional Information about the Object", formalDefinition="Additional Information about the Object." ) - protected List detail; - - private static final long serialVersionUID = 618775596L; - - /* - * Constructor - */ - public AuditEventObjectComponent() { - super(); - } - - /** - * @return {@link #identifier} (Identifies a specific instance of the participant object. The reference should always be version specific.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventObjectComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifies a specific instance of the participant object. The reference should always be version specific.) - */ - public AuditEventObjectComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #reference} (Identifies a specific instance of the participant object. The reference should always be version specific.) - */ - public Reference getReference() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventObjectComponent.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new Reference(); // cc - return this.reference; - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (Identifies a specific instance of the participant object. The reference should always be version specific.) - */ - public AuditEventObjectComponent setReference(Reference value) { - this.reference = value; - return this; - } - - /** - * @return {@link #reference} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies a specific instance of the participant object. The reference should always be version specific.) - */ - public Resource getReferenceTarget() { - return this.referenceTarget; - } - - /** - * @param value {@link #reference} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies a specific instance of the participant object. The reference should always be version specific.) - */ - public AuditEventObjectComponent setReferenceTarget(Resource value) { - this.referenceTarget = value; - return this; - } - - /** - * @return {@link #type} (The type of the object that was involved in this audit event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventObjectComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new ObjectTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of the object that was involved in this audit event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public AuditEventObjectComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The type of the object that was involved in this audit event. - */ - public ObjectType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of the object that was involved in this audit event. - */ - public AuditEventObjectComponent setType(ObjectType value) { - if (value == null) - this.type = null; - else { - if (this.type == null) - this.type = new Enumeration(new ObjectTypeEnumFactory()); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #role} (Code representing the functional application role of Participant Object being audited.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value - */ - public Enumeration getRoleElement() { - if (this.role == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventObjectComponent.role"); - else if (Configuration.doAutoCreate()) - this.role = new Enumeration(new ObjectRoleEnumFactory()); // bb - return this.role; - } - - public boolean hasRoleElement() { - return this.role != null && !this.role.isEmpty(); - } - - public boolean hasRole() { - return this.role != null && !this.role.isEmpty(); - } - - /** - * @param value {@link #role} (Code representing the functional application role of Participant Object being audited.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value - */ - public AuditEventObjectComponent setRoleElement(Enumeration value) { - this.role = value; - return this; - } - - /** - * @return Code representing the functional application role of Participant Object being audited. - */ - public ObjectRole getRole() { - return this.role == null ? null : this.role.getValue(); - } - - /** - * @param value Code representing the functional application role of Participant Object being audited. - */ - public AuditEventObjectComponent setRole(ObjectRole value) { - if (value == null) - this.role = null; - else { - if (this.role == null) - this.role = new Enumeration(new ObjectRoleEnumFactory()); - this.role.setValue(value); - } - return this; - } - - /** - * @return {@link #lifecycle} (Identifier for the data life-cycle stage for the participant object.). This is the underlying object with id, value and extensions. The accessor "getLifecycle" gives direct access to the value - */ - public Enumeration getLifecycleElement() { - if (this.lifecycle == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventObjectComponent.lifecycle"); - else if (Configuration.doAutoCreate()) - this.lifecycle = new Enumeration(new ObjectLifecycleEnumFactory()); // bb - return this.lifecycle; - } - - public boolean hasLifecycleElement() { - return this.lifecycle != null && !this.lifecycle.isEmpty(); - } - - public boolean hasLifecycle() { - return this.lifecycle != null && !this.lifecycle.isEmpty(); - } - - /** - * @param value {@link #lifecycle} (Identifier for the data life-cycle stage for the participant object.). This is the underlying object with id, value and extensions. The accessor "getLifecycle" gives direct access to the value - */ - public AuditEventObjectComponent setLifecycleElement(Enumeration value) { - this.lifecycle = value; - return this; - } - - /** - * @return Identifier for the data life-cycle stage for the participant object. - */ - public ObjectLifecycle getLifecycle() { - return this.lifecycle == null ? null : this.lifecycle.getValue(); - } - - /** - * @param value Identifier for the data life-cycle stage for the participant object. - */ - public AuditEventObjectComponent setLifecycle(ObjectLifecycle value) { - if (value == null) - this.lifecycle = null; - else { - if (this.lifecycle == null) - this.lifecycle = new Enumeration(new ObjectLifecycleEnumFactory()); - this.lifecycle.setValue(value); - } - return this; - } - - /** - * @return {@link #sensitivity} (Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics.) - */ - public CodeableConcept getSensitivity() { - if (this.sensitivity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventObjectComponent.sensitivity"); - else if (Configuration.doAutoCreate()) - this.sensitivity = new CodeableConcept(); // cc - return this.sensitivity; - } - - public boolean hasSensitivity() { - return this.sensitivity != null && !this.sensitivity.isEmpty(); - } - - /** - * @param value {@link #sensitivity} (Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics.) - */ - public AuditEventObjectComponent setSensitivity(CodeableConcept value) { - this.sensitivity = value; - return this; - } - - /** - * @return {@link #name} (An instance-specific descriptor of the Participant Object ID audited, such as a person's name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventObjectComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (An instance-specific descriptor of the Participant Object ID audited, such as a person's name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public AuditEventObjectComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return An instance-specific descriptor of the Participant Object ID audited, such as a person's name. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value An instance-specific descriptor of the Participant Object ID audited, such as a person's name. - */ - public AuditEventObjectComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (Text that describes the object in more detail.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventObjectComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Text that describes the object in more detail.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public AuditEventObjectComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Text that describes the object in more detail. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Text that describes the object in more detail. - */ - public AuditEventObjectComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #query} (The actual query for a query-type participant object.). This is the underlying object with id, value and extensions. The accessor "getQuery" gives direct access to the value - */ - public Base64BinaryType getQueryElement() { - if (this.query == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventObjectComponent.query"); - else if (Configuration.doAutoCreate()) - this.query = new Base64BinaryType(); // bb - return this.query; - } - - public boolean hasQueryElement() { - return this.query != null && !this.query.isEmpty(); - } - - public boolean hasQuery() { - return this.query != null && !this.query.isEmpty(); - } - - /** - * @param value {@link #query} (The actual query for a query-type participant object.). This is the underlying object with id, value and extensions. The accessor "getQuery" gives direct access to the value - */ - public AuditEventObjectComponent setQueryElement(Base64BinaryType value) { - this.query = value; - return this; - } - - /** - * @return The actual query for a query-type participant object. - */ - public byte[] getQuery() { - return this.query == null ? null : this.query.getValue(); - } - - /** - * @param value The actual query for a query-type participant object. - */ - public AuditEventObjectComponent setQuery(byte[] value) { - if (value == null) - this.query = null; - else { - if (this.query == null) - this.query = new Base64BinaryType(); - this.query.setValue(value); - } - return this; - } - - /** - * @return {@link #detail} (Additional Information about the Object.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (AuditEventObjectDetailComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (Additional Information about the Object.) - */ - // syntactic sugar - public AuditEventObjectDetailComponent addDetail() { //3 - AuditEventObjectDetailComponent t = new AuditEventObjectDetailComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - // syntactic sugar - public AuditEventObjectComponent addDetail(AuditEventObjectDetailComponent t) { //3 - if (t == null) - return this; - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifies a specific instance of the participant object. The reference should always be version specific.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("reference", "Reference(Any)", "Identifies a specific instance of the participant object. The reference should always be version specific.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("type", "code", "The type of the object that was involved in this audit event.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("role", "code", "Code representing the functional application role of Participant Object being audited.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("lifecycle", "code", "Identifier for the data life-cycle stage for the participant object.", 0, java.lang.Integer.MAX_VALUE, lifecycle)); - childrenList.add(new Property("sensitivity", "CodeableConcept", "Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics.", 0, java.lang.Integer.MAX_VALUE, sensitivity)); - childrenList.add(new Property("name", "string", "An instance-specific descriptor of the Participant Object ID audited, such as a person's name.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("description", "string", "Text that describes the object in more detail.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("query", "base64Binary", "The actual query for a query-type participant object.", 0, java.lang.Integer.MAX_VALUE, query)); - childrenList.add(new Property("detail", "", "Additional Information about the Object.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - public AuditEventObjectComponent copy() { - AuditEventObjectComponent dst = new AuditEventObjectComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.reference = reference == null ? null : reference.copy(); - dst.type = type == null ? null : type.copy(); - dst.role = role == null ? null : role.copy(); - dst.lifecycle = lifecycle == null ? null : lifecycle.copy(); - dst.sensitivity = sensitivity == null ? null : sensitivity.copy(); - dst.name = name == null ? null : name.copy(); - dst.description = description == null ? null : description.copy(); - dst.query = query == null ? null : query.copy(); - if (detail != null) { - dst.detail = new ArrayList(); - for (AuditEventObjectDetailComponent i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AuditEventObjectComponent)) - return false; - AuditEventObjectComponent o = (AuditEventObjectComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(reference, o.reference, true) - && compareDeep(type, o.type, true) && compareDeep(role, o.role, true) && compareDeep(lifecycle, o.lifecycle, true) - && compareDeep(sensitivity, o.sensitivity, true) && compareDeep(name, o.name, true) && compareDeep(description, o.description, true) - && compareDeep(query, o.query, true) && compareDeep(detail, o.detail, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AuditEventObjectComponent)) - return false; - AuditEventObjectComponent o = (AuditEventObjectComponent) other; - return compareValues(type, o.type, true) && compareValues(role, o.role, true) && compareValues(lifecycle, o.lifecycle, true) - && compareValues(name, o.name, true) && compareValues(description, o.description, true) && compareValues(query, o.query, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (reference == null || reference.isEmpty()) - && (type == null || type.isEmpty()) && (role == null || role.isEmpty()) && (lifecycle == null || lifecycle.isEmpty()) - && (sensitivity == null || sensitivity.isEmpty()) && (name == null || name.isEmpty()) && (description == null || description.isEmpty()) - && (query == null || query.isEmpty()) && (detail == null || detail.isEmpty()); - } - - } - - @Block() - public static class AuditEventObjectDetailComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Name of the property. - */ - @Child(name = "type", type = {StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Name of the property", formalDefinition="Name of the property." ) - protected StringType type; - - /** - * Property value. - */ - @Child(name = "value", type = {Base64BinaryType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Property value", formalDefinition="Property value." ) - protected Base64BinaryType value; - - private static final long serialVersionUID = 11139504L; - - /* - * Constructor - */ - public AuditEventObjectDetailComponent() { - super(); - } - - /* - * Constructor - */ - public AuditEventObjectDetailComponent(StringType type, Base64BinaryType value) { - super(); - this.type = type; - this.value = value; - } - - /** - * @return {@link #type} (Name of the property.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public StringType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventObjectDetailComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new StringType(); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Name of the property.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public AuditEventObjectDetailComponent setTypeElement(StringType value) { - this.type = value; - return this; - } - - /** - * @return Name of the property. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Name of the property. - */ - public AuditEventObjectDetailComponent setType(String value) { - if (this.type == null) - this.type = new StringType(); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #value} (Property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public Base64BinaryType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventObjectDetailComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new Base64BinaryType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (Property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public AuditEventObjectDetailComponent setValueElement(Base64BinaryType value) { - this.value = value; - return this; - } - - /** - * @return Property value. - */ - public byte[] getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value Property value. - */ - public AuditEventObjectDetailComponent setValue(byte[] value) { - if (this.value == null) - this.value = new Base64BinaryType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "string", "Name of the property.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("value", "base64Binary", "Property value.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public AuditEventObjectDetailComponent copy() { - AuditEventObjectDetailComponent dst = new AuditEventObjectDetailComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AuditEventObjectDetailComponent)) - return false; - AuditEventObjectDetailComponent o = (AuditEventObjectDetailComponent) other; - return compareDeep(type, o.type, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AuditEventObjectDetailComponent)) - return false; - AuditEventObjectDetailComponent o = (AuditEventObjectDetailComponent) other; - return compareValues(type, o.type, true) && compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - } - - /** - * Identifies the name, action type, time, and disposition of the audited event. - */ - @Child(name = "event", type = {}, order=0, min=1, max=1) - @Description(shortDefinition="What was done", formalDefinition="Identifies the name, action type, time, and disposition of the audited event." ) - protected AuditEventEventComponent event; - - /** - * A person, a hardware device or software process. - */ - @Child(name = "participant", type = {}, order=1, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A person, a hardware device or software process", formalDefinition="A person, a hardware device or software process." ) - protected List participant; - - /** - * Application systems and processes. - */ - @Child(name = "source", type = {}, order=2, min=1, max=1) - @Description(shortDefinition="Application systems and processes", formalDefinition="Application systems and processes." ) - protected AuditEventSourceComponent source; - - /** - * Specific instances of data or objects that have been accessed. - */ - @Child(name = "object", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Specific instances of data or objects that have been accessed", formalDefinition="Specific instances of data or objects that have been accessed." ) - protected List object; - - private static final long serialVersionUID = -1495151000L; - - /* - * Constructor - */ - public AuditEvent() { - super(); - } - - /* - * Constructor - */ - public AuditEvent(AuditEventEventComponent event, AuditEventSourceComponent source) { - super(); - this.event = event; - this.source = source; - } - - /** - * @return {@link #event} (Identifies the name, action type, time, and disposition of the audited event.) - */ - public AuditEventEventComponent getEvent() { - if (this.event == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEvent.event"); - else if (Configuration.doAutoCreate()) - this.event = new AuditEventEventComponent(); // cc - return this.event; - } - - public boolean hasEvent() { - return this.event != null && !this.event.isEmpty(); - } - - /** - * @param value {@link #event} (Identifies the name, action type, time, and disposition of the audited event.) - */ - public AuditEvent setEvent(AuditEventEventComponent value) { - this.event = value; - return this; - } - - /** - * @return {@link #participant} (A person, a hardware device or software process.) - */ - public List getParticipant() { - if (this.participant == null) - this.participant = new ArrayList(); - return this.participant; - } - - public boolean hasParticipant() { - if (this.participant == null) - return false; - for (AuditEventParticipantComponent item : this.participant) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #participant} (A person, a hardware device or software process.) - */ - // syntactic sugar - public AuditEventParticipantComponent addParticipant() { //3 - AuditEventParticipantComponent t = new AuditEventParticipantComponent(); - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return t; - } - - // syntactic sugar - public AuditEvent addParticipant(AuditEventParticipantComponent t) { //3 - if (t == null) - return this; - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return this; - } - - /** - * @return {@link #source} (Application systems and processes.) - */ - public AuditEventSourceComponent getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEvent.source"); - else if (Configuration.doAutoCreate()) - this.source = new AuditEventSourceComponent(); // cc - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (Application systems and processes.) - */ - public AuditEvent setSource(AuditEventSourceComponent value) { - this.source = value; - return this; - } - - /** - * @return {@link #object} (Specific instances of data or objects that have been accessed.) - */ - public List getObject() { - if (this.object == null) - this.object = new ArrayList(); - return this.object; - } - - public boolean hasObject() { - if (this.object == null) - return false; - for (AuditEventObjectComponent item : this.object) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #object} (Specific instances of data or objects that have been accessed.) - */ - // syntactic sugar - public AuditEventObjectComponent addObject() { //3 - AuditEventObjectComponent t = new AuditEventObjectComponent(); - if (this.object == null) - this.object = new ArrayList(); - this.object.add(t); - return t; - } - - // syntactic sugar - public AuditEvent addObject(AuditEventObjectComponent t) { //3 - if (t == null) - return this; - if (this.object == null) - this.object = new ArrayList(); - this.object.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("event", "", "Identifies the name, action type, time, and disposition of the audited event.", 0, java.lang.Integer.MAX_VALUE, event)); - childrenList.add(new Property("participant", "", "A person, a hardware device or software process.", 0, java.lang.Integer.MAX_VALUE, participant)); - childrenList.add(new Property("source", "", "Application systems and processes.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("object", "", "Specific instances of data or objects that have been accessed.", 0, java.lang.Integer.MAX_VALUE, object)); - } - - public AuditEvent copy() { - AuditEvent dst = new AuditEvent(); - copyValues(dst); - dst.event = event == null ? null : event.copy(); - if (participant != null) { - dst.participant = new ArrayList(); - for (AuditEventParticipantComponent i : participant) - dst.participant.add(i.copy()); - }; - dst.source = source == null ? null : source.copy(); - if (object != null) { - dst.object = new ArrayList(); - for (AuditEventObjectComponent i : object) - dst.object.add(i.copy()); - }; - return dst; - } - - protected AuditEvent typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AuditEvent)) - return false; - AuditEvent o = (AuditEvent) other; - return compareDeep(event, o.event, true) && compareDeep(participant, o.participant, true) && compareDeep(source, o.source, true) - && compareDeep(object, o.object, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AuditEvent)) - return false; - AuditEvent o = (AuditEvent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (event == null || event.isEmpty()) && (participant == null || participant.isEmpty()) - && (source == null || source.isEmpty()) && (object == null || object.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.AuditEvent; - } - - @SearchParamDefinition(name="site", path="AuditEvent.source.site", description="Logical source location within the enterprise", type="token" ) - public static final String SP_SITE = "site"; - @SearchParamDefinition(name="desc", path="AuditEvent.object.name", description="Instance-specific descriptor for Object", type="string" ) - public static final String SP_DESC = "desc"; - @SearchParamDefinition(name="type", path="AuditEvent.event.type", description="Type/identifier of event", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="date", path="AuditEvent.event.dateTime", description="Time when the event occurred on source", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="reference", path="AuditEvent.object.reference", description="Specific instance of resource (e.g. versioned)", type="reference" ) - public static final String SP_REFERENCE = "reference"; - @SearchParamDefinition(name="identity", path="AuditEvent.object.identifier", description="Specific instance of object (e.g. versioned)", type="token" ) - public static final String SP_IDENTITY = "identity"; - @SearchParamDefinition(name="patient", path="", description="A patient that the .object.reference refers to", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="altid", path="AuditEvent.participant.altId", description="Alternative User id e.g. authentication", type="token" ) - public static final String SP_ALTID = "altid"; - @SearchParamDefinition(name="patientid", path="", description="The id of the patient (one of multiple kinds of participations)", type="token" ) - public static final String SP_PATIENTID = "patientid"; - @SearchParamDefinition(name="source", path="AuditEvent.source.identifier", description="The id of source where event originated", type="token" ) - public static final String SP_SOURCE = "source"; - @SearchParamDefinition(name="address", path="AuditEvent.participant.network.identifier", description="Identifier for the network access point of the user device", type="token" ) - public static final String SP_ADDRESS = "address"; - @SearchParamDefinition(name="subtype", path="AuditEvent.event.subtype", description="More specific type/id for the event", type="token" ) - public static final String SP_SUBTYPE = "subtype"; - @SearchParamDefinition(name="name", path="AuditEvent.participant.name", description="Human-meaningful name for the user", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="action", path="AuditEvent.event.action", description="Type of action performed during the event", type="token" ) - public static final String SP_ACTION = "action"; - @SearchParamDefinition(name="participant", path="AuditEvent.participant.reference", description="Direct reference to resource", type="reference" ) - public static final String SP_PARTICIPANT = "participant"; - @SearchParamDefinition(name="policy", path="AuditEvent.participant.policy", description="Policy that authorized event", type="uri" ) - public static final String SP_POLICY = "policy"; - @SearchParamDefinition(name="object-type", path="AuditEvent.object.type", description="Type of object involved", type="token" ) - public static final String SP_OBJECTTYPE = "object-type"; - @SearchParamDefinition(name="user", path="AuditEvent.participant.userId", description="Unique identifier for the user", type="token" ) - public static final String SP_USER = "user"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. + */ +@ResourceDef(name="AuditEvent", profile="http://hl7.org/fhir/Profile/AuditEvent") +public class AuditEvent extends DomainResource { + + public enum AuditEventAction { + /** + * Create a new database object, such as Placing an Order. + */ + C, + /** + * Display or print data, such as a Doctor Census. + */ + R, + /** + * Update data, such as Revise Patient Information. + */ + U, + /** + * Delete items, such as a doctor master file record. + */ + D, + /** + * Perform a system or application function such as log-on, program execution or use of an object's method, or perform a query/search operation. + */ + E, + /** + * added to help the parsers + */ + NULL; + public static AuditEventAction fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("C".equals(codeString)) + return C; + if ("R".equals(codeString)) + return R; + if ("U".equals(codeString)) + return U; + if ("D".equals(codeString)) + return D; + if ("E".equals(codeString)) + return E; + throw new Exception("Unknown AuditEventAction code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case C: return "C"; + case R: return "R"; + case U: return "U"; + case D: return "D"; + case E: return "E"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case C: return ""; + case R: return ""; + case U: return ""; + case D: return ""; + case E: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case C: return "Create a new database object, such as Placing an Order."; + case R: return "Display or print data, such as a Doctor Census."; + case U: return "Update data, such as Revise Patient Information."; + case D: return "Delete items, such as a doctor master file record."; + case E: return "Perform a system or application function such as log-on, program execution or use of an object's method, or perform a query/search operation."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case C: return "Create"; + case R: return "Read/View/Print"; + case U: return "Update"; + case D: return "Delete"; + case E: return "Execute"; + default: return "?"; + } + } + } + + public static class AuditEventActionEnumFactory implements EnumFactory { + public AuditEventAction fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("C".equals(codeString)) + return AuditEventAction.C; + if ("R".equals(codeString)) + return AuditEventAction.R; + if ("U".equals(codeString)) + return AuditEventAction.U; + if ("D".equals(codeString)) + return AuditEventAction.D; + if ("E".equals(codeString)) + return AuditEventAction.E; + throw new IllegalArgumentException("Unknown AuditEventAction code '"+codeString+"'"); + } + public String toCode(AuditEventAction code) { + if (code == AuditEventAction.C) + return "C"; + if (code == AuditEventAction.R) + return "R"; + if (code == AuditEventAction.U) + return "U"; + if (code == AuditEventAction.D) + return "D"; + if (code == AuditEventAction.E) + return "E"; + return "?"; + } + } + + public enum AuditEventOutcome { + /** + * The operation completed successfully (whether with warnings or not). + */ + _0, + /** + * The action was not successful due to some kind of catered for error (often equivalent to an HTTP 400 response). + */ + _4, + /** + * The action was not successful due to some kind of unexpected error (often equivalent to an HTTP 500 response). + */ + _8, + /** + * An error of such magnitude occurred that the system is not longer available for use (i.e. the system died). + */ + _12, + /** + * added to help the parsers + */ + NULL; + public static AuditEventOutcome fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("0".equals(codeString)) + return _0; + if ("4".equals(codeString)) + return _4; + if ("8".equals(codeString)) + return _8; + if ("12".equals(codeString)) + return _12; + throw new Exception("Unknown AuditEventOutcome code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case _0: return "0"; + case _4: return "4"; + case _8: return "8"; + case _12: return "12"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case _0: return ""; + case _4: return ""; + case _8: return ""; + case _12: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case _0: return "The operation completed successfully (whether with warnings or not)."; + case _4: return "The action was not successful due to some kind of catered for error (often equivalent to an HTTP 400 response)."; + case _8: return "The action was not successful due to some kind of unexpected error (often equivalent to an HTTP 500 response)."; + case _12: return "An error of such magnitude occurred that the system is not longer available for use (i.e. the system died)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case _0: return "Success"; + case _4: return "Minor failure"; + case _8: return "Serious failure"; + case _12: return "Major failure"; + default: return "?"; + } + } + } + + public static class AuditEventOutcomeEnumFactory implements EnumFactory { + public AuditEventOutcome fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("0".equals(codeString)) + return AuditEventOutcome._0; + if ("4".equals(codeString)) + return AuditEventOutcome._4; + if ("8".equals(codeString)) + return AuditEventOutcome._8; + if ("12".equals(codeString)) + return AuditEventOutcome._12; + throw new IllegalArgumentException("Unknown AuditEventOutcome code '"+codeString+"'"); + } + public String toCode(AuditEventOutcome code) { + if (code == AuditEventOutcome._0) + return "0"; + if (code == AuditEventOutcome._4) + return "4"; + if (code == AuditEventOutcome._8) + return "8"; + if (code == AuditEventOutcome._12) + return "12"; + return "?"; + } + } + + public enum NetworkType { + /** + * Machine Name, including DNS name. + */ + _1, + /** + * IP Address. + */ + _2, + /** + * Telephone Number. + */ + _3, + /** + * Email address. + */ + _4, + /** + * URI (User directory, HTTP-PUT, ftp, etc.). + */ + _5, + /** + * added to help the parsers + */ + NULL; + public static NetworkType fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("1".equals(codeString)) + return _1; + if ("2".equals(codeString)) + return _2; + if ("3".equals(codeString)) + return _3; + if ("4".equals(codeString)) + return _4; + if ("5".equals(codeString)) + return _5; + throw new Exception("Unknown NetworkType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case _1: return "1"; + case _2: return "2"; + case _3: return "3"; + case _4: return "4"; + case _5: return "5"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case _1: return ""; + case _2: return ""; + case _3: return ""; + case _4: return ""; + case _5: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case _1: return "Machine Name, including DNS name."; + case _2: return "IP Address."; + case _3: return "Telephone Number."; + case _4: return "Email address."; + case _5: return "URI (User directory, HTTP-PUT, ftp, etc.)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case _1: return " "; + case _2: return " "; + case _3: return " "; + case _4: return " "; + case _5: return " "; + default: return "?"; + } + } + } + + public static class NetworkTypeEnumFactory implements EnumFactory { + public NetworkType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("1".equals(codeString)) + return NetworkType._1; + if ("2".equals(codeString)) + return NetworkType._2; + if ("3".equals(codeString)) + return NetworkType._3; + if ("4".equals(codeString)) + return NetworkType._4; + if ("5".equals(codeString)) + return NetworkType._5; + throw new IllegalArgumentException("Unknown NetworkType code '"+codeString+"'"); + } + public String toCode(NetworkType code) { + if (code == NetworkType._1) + return "1"; + if (code == NetworkType._2) + return "2"; + if (code == NetworkType._3) + return "3"; + if (code == NetworkType._4) + return "4"; + if (code == NetworkType._5) + return "5"; + return "?"; + } + } + + public enum ObjectType { + /** + * Person. + */ + _1, + /** + * System Object. + */ + _2, + /** + * Organization. + */ + _3, + /** + * Other. + */ + _4, + /** + * added to help the parsers + */ + NULL; + public static ObjectType fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("1".equals(codeString)) + return _1; + if ("2".equals(codeString)) + return _2; + if ("3".equals(codeString)) + return _3; + if ("4".equals(codeString)) + return _4; + throw new Exception("Unknown ObjectType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case _1: return "1"; + case _2: return "2"; + case _3: return "3"; + case _4: return "4"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case _1: return ""; + case _2: return ""; + case _3: return ""; + case _4: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case _1: return "Person."; + case _2: return "System Object."; + case _3: return "Organization."; + case _4: return "Other."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case _1: return " "; + case _2: return " "; + case _3: return " "; + case _4: return " "; + default: return "?"; + } + } + } + + public static class ObjectTypeEnumFactory implements EnumFactory { + public ObjectType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("1".equals(codeString)) + return ObjectType._1; + if ("2".equals(codeString)) + return ObjectType._2; + if ("3".equals(codeString)) + return ObjectType._3; + if ("4".equals(codeString)) + return ObjectType._4; + throw new IllegalArgumentException("Unknown ObjectType code '"+codeString+"'"); + } + public String toCode(ObjectType code) { + if (code == ObjectType._1) + return "1"; + if (code == ObjectType._2) + return "2"; + if (code == ObjectType._3) + return "3"; + if (code == ObjectType._4) + return "4"; + return "?"; + } + } + + public enum ObjectRole { + /** + * This object is the patient that is the subject of care related to this event. It is identifiable by patient ID or equivalent. The patient may be either human or animal. + */ + _1, + /** + * This is a location identified as related to the event. This is usually the location where the event took place. Note that for shipping, the usual events are arrival at a location or departure from a location. + */ + _2, + /** + * This object is any kind of persistent document created as a result of the event. This could be a paper report, film, electronic report, DICOM Study, etc. Issues related to medical records life cycle management are conveyed elsewhere. + */ + _3, + /** + * A logical object related to a health record event. This is any healthcare specific resource (object) not restricted to FHIR defined Resources. + */ + _4, + /** + * This is any configurable file used to control creation of documents. Examples include the objects maintained by the HL7 Master File transactions, Value Sets, etc. + */ + _5, + /** + * A human participant not otherwise identified by some other category. + */ + _6, + /** + * (deprecated). + */ + _7, + /** + * Typically a licensed person who is providing or performing care related to the event, generally a physician. The key distinction between doctor and practitioner is with regards to their role, not the licensing. The doctor is the human who actually performed the work. The practitioner is the human or organization that is responsible for the work. + */ + _8, + /** + * A person or system that is being notified as part of the event. This is relevant in situations where automated systems provide notifications to other parties when an event took place. + */ + _9, + /** + * Insurance company, or any other organization who accepts responsibility for paying for the healthcare event. + */ + _10, + /** + * A person or active system object involved in the event with a security role. + */ + _11, + /** + * A person or system object involved in the event with the authority to modify security roles of other objects. + */ + _12, + /** + * A passive object, such as a role table, that is relevant to the event. + */ + _13, + /** + * (deprecated) Relevant to certain RBAC security methodologies. + */ + _14, + /** + * Any person or organization responsible for providing care. This encompasses all forms of care, licensed or otherwise, and all sorts of teams and care groups. Note, the distinction between practitioners and the doctor that actually provided the care to the patient. + */ + _15, + /** + * The source or destination for data transfer, when it does not match some other role. + */ + _16, + /** + * A source or destination for data transfer, that acts as an archive, database, or similar role. + */ + _17, + /** + * An object that holds schedule information. This could be an appointment book, availability information, etc. + */ + _18, + /** + * An organization or person that is the recipient of services. This could be an organization that is buying services for a patient, or a person that is buying services for an animal. + */ + _19, + /** + * An order, task, work item, procedure step, or other description of work to be performed. E.g., a particular instance of an MPPS. + */ + _20, + /** + * A list of jobs or a system that provides lists of jobs. E.g., an MWL SCP. + */ + _21, + /** + * (Deprecated). + */ + _22, + /** + * An object that specifies or controls the routing or delivery of items. For example, a distribution list is the routing criteria for mail. The items delivered may be documents, jobs, or other objects. + */ + _23, + /** + * The contents of a query. This is used to capture the contents of any kind of query. For security surveillance purposes knowing the queries being made is very important. + */ + _24, + /** + * added to help the parsers + */ + NULL; + public static ObjectRole fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("1".equals(codeString)) + return _1; + if ("2".equals(codeString)) + return _2; + if ("3".equals(codeString)) + return _3; + if ("4".equals(codeString)) + return _4; + if ("5".equals(codeString)) + return _5; + if ("6".equals(codeString)) + return _6; + if ("7".equals(codeString)) + return _7; + if ("8".equals(codeString)) + return _8; + if ("9".equals(codeString)) + return _9; + if ("10".equals(codeString)) + return _10; + if ("11".equals(codeString)) + return _11; + if ("12".equals(codeString)) + return _12; + if ("13".equals(codeString)) + return _13; + if ("14".equals(codeString)) + return _14; + if ("15".equals(codeString)) + return _15; + if ("16".equals(codeString)) + return _16; + if ("17".equals(codeString)) + return _17; + if ("18".equals(codeString)) + return _18; + if ("19".equals(codeString)) + return _19; + if ("20".equals(codeString)) + return _20; + if ("21".equals(codeString)) + return _21; + if ("22".equals(codeString)) + return _22; + if ("23".equals(codeString)) + return _23; + if ("24".equals(codeString)) + return _24; + throw new Exception("Unknown ObjectRole code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case _1: return "1"; + case _2: return "2"; + case _3: return "3"; + case _4: return "4"; + case _5: return "5"; + case _6: return "6"; + case _7: return "7"; + case _8: return "8"; + case _9: return "9"; + case _10: return "10"; + case _11: return "11"; + case _12: return "12"; + case _13: return "13"; + case _14: return "14"; + case _15: return "15"; + case _16: return "16"; + case _17: return "17"; + case _18: return "18"; + case _19: return "19"; + case _20: return "20"; + case _21: return "21"; + case _22: return "22"; + case _23: return "23"; + case _24: return "24"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case _1: return ""; + case _2: return ""; + case _3: return ""; + case _4: return ""; + case _5: return ""; + case _6: return ""; + case _7: return ""; + case _8: return ""; + case _9: return ""; + case _10: return ""; + case _11: return ""; + case _12: return ""; + case _13: return ""; + case _14: return ""; + case _15: return ""; + case _16: return ""; + case _17: return ""; + case _18: return ""; + case _19: return ""; + case _20: return ""; + case _21: return ""; + case _22: return ""; + case _23: return ""; + case _24: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case _1: return "This object is the patient that is the subject of care related to this event. It is identifiable by patient ID or equivalent. The patient may be either human or animal."; + case _2: return "This is a location identified as related to the event. This is usually the location where the event took place. Note that for shipping, the usual events are arrival at a location or departure from a location."; + case _3: return "This object is any kind of persistent document created as a result of the event. This could be a paper report, film, electronic report, DICOM Study, etc. Issues related to medical records life cycle management are conveyed elsewhere."; + case _4: return "A logical object related to a health record event. This is any healthcare specific resource (object) not restricted to FHIR defined Resources."; + case _5: return "This is any configurable file used to control creation of documents. Examples include the objects maintained by the HL7 Master File transactions, Value Sets, etc."; + case _6: return "A human participant not otherwise identified by some other category."; + case _7: return "(deprecated)."; + case _8: return "Typically a licensed person who is providing or performing care related to the event, generally a physician. The key distinction between doctor and practitioner is with regards to their role, not the licensing. The doctor is the human who actually performed the work. The practitioner is the human or organization that is responsible for the work."; + case _9: return "A person or system that is being notified as part of the event. This is relevant in situations where automated systems provide notifications to other parties when an event took place."; + case _10: return "Insurance company, or any other organization who accepts responsibility for paying for the healthcare event."; + case _11: return "A person or active system object involved in the event with a security role."; + case _12: return "A person or system object involved in the event with the authority to modify security roles of other objects."; + case _13: return "A passive object, such as a role table, that is relevant to the event."; + case _14: return "(deprecated) Relevant to certain RBAC security methodologies."; + case _15: return "Any person or organization responsible for providing care. This encompasses all forms of care, licensed or otherwise, and all sorts of teams and care groups. Note, the distinction between practitioners and the doctor that actually provided the care to the patient."; + case _16: return "The source or destination for data transfer, when it does not match some other role."; + case _17: return "A source or destination for data transfer, that acts as an archive, database, or similar role."; + case _18: return "An object that holds schedule information. This could be an appointment book, availability information, etc."; + case _19: return "An organization or person that is the recipient of services. This could be an organization that is buying services for a patient, or a person that is buying services for an animal."; + case _20: return "An order, task, work item, procedure step, or other description of work to be performed. E.g., a particular instance of an MPPS."; + case _21: return "A list of jobs or a system that provides lists of jobs. E.g., an MWL SCP."; + case _22: return "(Deprecated)."; + case _23: return "An object that specifies or controls the routing or delivery of items. For example, a distribution list is the routing criteria for mail. The items delivered may be documents, jobs, or other objects."; + case _24: return "The contents of a query. This is used to capture the contents of any kind of query. For security surveillance purposes knowing the queries being made is very important."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case _1: return "Patient"; + case _2: return "Location"; + case _3: return "Report"; + case _4: return "DomainResource"; + case _5: return "Master file"; + case _6: return "User"; + case _7: return "List"; + case _8: return "Doctor"; + case _9: return "Subscriber"; + case _10: return "Guarantor"; + case _11: return "Security User Entity"; + case _12: return "Security User Group"; + case _13: return "Security Resource"; + case _14: return "Security Granularity Definition"; + case _15: return "Practitioner"; + case _16: return "Data Destination"; + case _17: return "Data Repository"; + case _18: return "Schedule"; + case _19: return "Customer"; + case _20: return "Job"; + case _21: return "Job Stream"; + case _22: return "Table"; + case _23: return "Routing Criteria"; + case _24: return "Query"; + default: return "?"; + } + } + } + + public static class ObjectRoleEnumFactory implements EnumFactory { + public ObjectRole fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("1".equals(codeString)) + return ObjectRole._1; + if ("2".equals(codeString)) + return ObjectRole._2; + if ("3".equals(codeString)) + return ObjectRole._3; + if ("4".equals(codeString)) + return ObjectRole._4; + if ("5".equals(codeString)) + return ObjectRole._5; + if ("6".equals(codeString)) + return ObjectRole._6; + if ("7".equals(codeString)) + return ObjectRole._7; + if ("8".equals(codeString)) + return ObjectRole._8; + if ("9".equals(codeString)) + return ObjectRole._9; + if ("10".equals(codeString)) + return ObjectRole._10; + if ("11".equals(codeString)) + return ObjectRole._11; + if ("12".equals(codeString)) + return ObjectRole._12; + if ("13".equals(codeString)) + return ObjectRole._13; + if ("14".equals(codeString)) + return ObjectRole._14; + if ("15".equals(codeString)) + return ObjectRole._15; + if ("16".equals(codeString)) + return ObjectRole._16; + if ("17".equals(codeString)) + return ObjectRole._17; + if ("18".equals(codeString)) + return ObjectRole._18; + if ("19".equals(codeString)) + return ObjectRole._19; + if ("20".equals(codeString)) + return ObjectRole._20; + if ("21".equals(codeString)) + return ObjectRole._21; + if ("22".equals(codeString)) + return ObjectRole._22; + if ("23".equals(codeString)) + return ObjectRole._23; + if ("24".equals(codeString)) + return ObjectRole._24; + throw new IllegalArgumentException("Unknown ObjectRole code '"+codeString+"'"); + } + public String toCode(ObjectRole code) { + if (code == ObjectRole._1) + return "1"; + if (code == ObjectRole._2) + return "2"; + if (code == ObjectRole._3) + return "3"; + if (code == ObjectRole._4) + return "4"; + if (code == ObjectRole._5) + return "5"; + if (code == ObjectRole._6) + return "6"; + if (code == ObjectRole._7) + return "7"; + if (code == ObjectRole._8) + return "8"; + if (code == ObjectRole._9) + return "9"; + if (code == ObjectRole._10) + return "10"; + if (code == ObjectRole._11) + return "11"; + if (code == ObjectRole._12) + return "12"; + if (code == ObjectRole._13) + return "13"; + if (code == ObjectRole._14) + return "14"; + if (code == ObjectRole._15) + return "15"; + if (code == ObjectRole._16) + return "16"; + if (code == ObjectRole._17) + return "17"; + if (code == ObjectRole._18) + return "18"; + if (code == ObjectRole._19) + return "19"; + if (code == ObjectRole._20) + return "20"; + if (code == ObjectRole._21) + return "21"; + if (code == ObjectRole._22) + return "22"; + if (code == ObjectRole._23) + return "23"; + if (code == ObjectRole._24) + return "24"; + return "?"; + } + } + + public enum ObjectLifecycle { + /** + * Origination / Creation. + */ + _1, + /** + * Import / Copy from original. + */ + _2, + /** + * Amendment. + */ + _3, + /** + * Verification. + */ + _4, + /** + * Translation. + */ + _5, + /** + * Access / Use. + */ + _6, + /** + * De-identification. + */ + _7, + /** + * Aggregation, summarization, derivation. + */ + _8, + /** + * Report. + */ + _9, + /** + * Export / Copy to target. + */ + _10, + /** + * Disclosure. + */ + _11, + /** + * Receipt of disclosure. + */ + _12, + /** + * Archiving. + */ + _13, + /** + * Logical deletion. + */ + _14, + /** + * Permanent erasure / Physical destruction. + */ + _15, + /** + * added to help the parsers + */ + NULL; + public static ObjectLifecycle fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("1".equals(codeString)) + return _1; + if ("2".equals(codeString)) + return _2; + if ("3".equals(codeString)) + return _3; + if ("4".equals(codeString)) + return _4; + if ("5".equals(codeString)) + return _5; + if ("6".equals(codeString)) + return _6; + if ("7".equals(codeString)) + return _7; + if ("8".equals(codeString)) + return _8; + if ("9".equals(codeString)) + return _9; + if ("10".equals(codeString)) + return _10; + if ("11".equals(codeString)) + return _11; + if ("12".equals(codeString)) + return _12; + if ("13".equals(codeString)) + return _13; + if ("14".equals(codeString)) + return _14; + if ("15".equals(codeString)) + return _15; + throw new Exception("Unknown ObjectLifecycle code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case _1: return "1"; + case _2: return "2"; + case _3: return "3"; + case _4: return "4"; + case _5: return "5"; + case _6: return "6"; + case _7: return "7"; + case _8: return "8"; + case _9: return "9"; + case _10: return "10"; + case _11: return "11"; + case _12: return "12"; + case _13: return "13"; + case _14: return "14"; + case _15: return "15"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case _1: return ""; + case _2: return ""; + case _3: return ""; + case _4: return ""; + case _5: return ""; + case _6: return ""; + case _7: return ""; + case _8: return ""; + case _9: return ""; + case _10: return ""; + case _11: return ""; + case _12: return ""; + case _13: return ""; + case _14: return ""; + case _15: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case _1: return "Origination / Creation."; + case _2: return "Import / Copy from original."; + case _3: return "Amendment."; + case _4: return "Verification."; + case _5: return "Translation."; + case _6: return "Access / Use."; + case _7: return "De-identification."; + case _8: return "Aggregation, summarization, derivation."; + case _9: return "Report."; + case _10: return "Export / Copy to target."; + case _11: return "Disclosure."; + case _12: return "Receipt of disclosure."; + case _13: return "Archiving."; + case _14: return "Logical deletion."; + case _15: return "Permanent erasure / Physical destruction."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case _1: return " "; + case _2: return " "; + case _3: return " "; + case _4: return " "; + case _5: return " "; + case _6: return " "; + case _7: return " "; + case _8: return " "; + case _9: return " "; + case _10: return " "; + case _11: return " "; + case _12: return " "; + case _13: return " "; + case _14: return " "; + case _15: return " "; + default: return "?"; + } + } + } + + public static class ObjectLifecycleEnumFactory implements EnumFactory { + public ObjectLifecycle fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("1".equals(codeString)) + return ObjectLifecycle._1; + if ("2".equals(codeString)) + return ObjectLifecycle._2; + if ("3".equals(codeString)) + return ObjectLifecycle._3; + if ("4".equals(codeString)) + return ObjectLifecycle._4; + if ("5".equals(codeString)) + return ObjectLifecycle._5; + if ("6".equals(codeString)) + return ObjectLifecycle._6; + if ("7".equals(codeString)) + return ObjectLifecycle._7; + if ("8".equals(codeString)) + return ObjectLifecycle._8; + if ("9".equals(codeString)) + return ObjectLifecycle._9; + if ("10".equals(codeString)) + return ObjectLifecycle._10; + if ("11".equals(codeString)) + return ObjectLifecycle._11; + if ("12".equals(codeString)) + return ObjectLifecycle._12; + if ("13".equals(codeString)) + return ObjectLifecycle._13; + if ("14".equals(codeString)) + return ObjectLifecycle._14; + if ("15".equals(codeString)) + return ObjectLifecycle._15; + throw new IllegalArgumentException("Unknown ObjectLifecycle code '"+codeString+"'"); + } + public String toCode(ObjectLifecycle code) { + if (code == ObjectLifecycle._1) + return "1"; + if (code == ObjectLifecycle._2) + return "2"; + if (code == ObjectLifecycle._3) + return "3"; + if (code == ObjectLifecycle._4) + return "4"; + if (code == ObjectLifecycle._5) + return "5"; + if (code == ObjectLifecycle._6) + return "6"; + if (code == ObjectLifecycle._7) + return "7"; + if (code == ObjectLifecycle._8) + return "8"; + if (code == ObjectLifecycle._9) + return "9"; + if (code == ObjectLifecycle._10) + return "10"; + if (code == ObjectLifecycle._11) + return "11"; + if (code == ObjectLifecycle._12) + return "12"; + if (code == ObjectLifecycle._13) + return "13"; + if (code == ObjectLifecycle._14) + return "14"; + if (code == ObjectLifecycle._15) + return "15"; + return "?"; + } + } + + @Block() + public static class AuditEventEventComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifier for a family of the event. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Type/identifier of event", formalDefinition="Identifier for a family of the event." ) + protected CodeableConcept type; + + /** + * Identifier for the category of event. + */ + @Child(name = "subtype", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="More specific type/id for the event", formalDefinition="Identifier for the category of event." ) + protected List subtype; + + /** + * Indicator for type of action performed during the event that generated the audit. + */ + @Child(name = "action", type = {CodeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Type of action performed during the event", formalDefinition="Indicator for type of action performed during the event that generated the audit." ) + protected Enumeration action; + + /** + * The time when the event occurred on the source. + */ + @Child(name = "dateTime", type = {InstantType.class}, order=4, min=1, max=1) + @Description(shortDefinition="Time when the event occurred on source", formalDefinition="The time when the event occurred on the source." ) + protected InstantType dateTime; + + /** + * Indicates whether the event succeeded or failed. + */ + @Child(name = "outcome", type = {CodeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Whether the event succeeded or failed", formalDefinition="Indicates whether the event succeeded or failed." ) + protected Enumeration outcome; + + /** + * A free text description of the outcome of the event. + */ + @Child(name = "outcomeDesc", type = {StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Description of the event outcome", formalDefinition="A free text description of the outcome of the event." ) + protected StringType outcomeDesc; + + /** + * The purposeOfUse (reason) that was used during the event being recorded. + */ + @Child(name = "purposeOfEvent", type = {Coding.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The purposeOfUse of the event", formalDefinition="The purposeOfUse (reason) that was used during the event being recorded." ) + protected List purposeOfEvent; + + private static final long serialVersionUID = 339035171L; + + /* + * Constructor + */ + public AuditEventEventComponent() { + super(); + } + + /* + * Constructor + */ + public AuditEventEventComponent(CodeableConcept type, InstantType dateTime) { + super(); + this.type = type; + this.dateTime = dateTime; + } + + /** + * @return {@link #type} (Identifier for a family of the event.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventEventComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Identifier for a family of the event.) + */ + public AuditEventEventComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #subtype} (Identifier for the category of event.) + */ + public List getSubtype() { + if (this.subtype == null) + this.subtype = new ArrayList(); + return this.subtype; + } + + public boolean hasSubtype() { + if (this.subtype == null) + return false; + for (CodeableConcept item : this.subtype) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subtype} (Identifier for the category of event.) + */ + // syntactic sugar + public CodeableConcept addSubtype() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.subtype == null) + this.subtype = new ArrayList(); + this.subtype.add(t); + return t; + } + + // syntactic sugar + public AuditEventEventComponent addSubtype(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.subtype == null) + this.subtype = new ArrayList(); + this.subtype.add(t); + return this; + } + + /** + * @return {@link #action} (Indicator for type of action performed during the event that generated the audit.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value + */ + public Enumeration getActionElement() { + if (this.action == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventEventComponent.action"); + else if (Configuration.doAutoCreate()) + this.action = new Enumeration(new AuditEventActionEnumFactory()); // bb + return this.action; + } + + public boolean hasActionElement() { + return this.action != null && !this.action.isEmpty(); + } + + public boolean hasAction() { + return this.action != null && !this.action.isEmpty(); + } + + /** + * @param value {@link #action} (Indicator for type of action performed during the event that generated the audit.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value + */ + public AuditEventEventComponent setActionElement(Enumeration value) { + this.action = value; + return this; + } + + /** + * @return Indicator for type of action performed during the event that generated the audit. + */ + public AuditEventAction getAction() { + return this.action == null ? null : this.action.getValue(); + } + + /** + * @param value Indicator for type of action performed during the event that generated the audit. + */ + public AuditEventEventComponent setAction(AuditEventAction value) { + if (value == null) + this.action = null; + else { + if (this.action == null) + this.action = new Enumeration(new AuditEventActionEnumFactory()); + this.action.setValue(value); + } + return this; + } + + /** + * @return {@link #dateTime} (The time when the event occurred on the source.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public InstantType getDateTimeElement() { + if (this.dateTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventEventComponent.dateTime"); + else if (Configuration.doAutoCreate()) + this.dateTime = new InstantType(); // bb + return this.dateTime; + } + + public boolean hasDateTimeElement() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + public boolean hasDateTime() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + /** + * @param value {@link #dateTime} (The time when the event occurred on the source.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public AuditEventEventComponent setDateTimeElement(InstantType value) { + this.dateTime = value; + return this; + } + + /** + * @return The time when the event occurred on the source. + */ + public Date getDateTime() { + return this.dateTime == null ? null : this.dateTime.getValue(); + } + + /** + * @param value The time when the event occurred on the source. + */ + public AuditEventEventComponent setDateTime(Date value) { + if (this.dateTime == null) + this.dateTime = new InstantType(); + this.dateTime.setValue(value); + return this; + } + + /** + * @return {@link #outcome} (Indicates whether the event succeeded or failed.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public Enumeration getOutcomeElement() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventEventComponent.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new Enumeration(new AuditEventOutcomeEnumFactory()); // bb + return this.outcome; + } + + public boolean hasOutcomeElement() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Indicates whether the event succeeded or failed.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public AuditEventEventComponent setOutcomeElement(Enumeration value) { + this.outcome = value; + return this; + } + + /** + * @return Indicates whether the event succeeded or failed. + */ + public AuditEventOutcome getOutcome() { + return this.outcome == null ? null : this.outcome.getValue(); + } + + /** + * @param value Indicates whether the event succeeded or failed. + */ + public AuditEventEventComponent setOutcome(AuditEventOutcome value) { + if (value == null) + this.outcome = null; + else { + if (this.outcome == null) + this.outcome = new Enumeration(new AuditEventOutcomeEnumFactory()); + this.outcome.setValue(value); + } + return this; + } + + /** + * @return {@link #outcomeDesc} (A free text description of the outcome of the event.). This is the underlying object with id, value and extensions. The accessor "getOutcomeDesc" gives direct access to the value + */ + public StringType getOutcomeDescElement() { + if (this.outcomeDesc == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventEventComponent.outcomeDesc"); + else if (Configuration.doAutoCreate()) + this.outcomeDesc = new StringType(); // bb + return this.outcomeDesc; + } + + public boolean hasOutcomeDescElement() { + return this.outcomeDesc != null && !this.outcomeDesc.isEmpty(); + } + + public boolean hasOutcomeDesc() { + return this.outcomeDesc != null && !this.outcomeDesc.isEmpty(); + } + + /** + * @param value {@link #outcomeDesc} (A free text description of the outcome of the event.). This is the underlying object with id, value and extensions. The accessor "getOutcomeDesc" gives direct access to the value + */ + public AuditEventEventComponent setOutcomeDescElement(StringType value) { + this.outcomeDesc = value; + return this; + } + + /** + * @return A free text description of the outcome of the event. + */ + public String getOutcomeDesc() { + return this.outcomeDesc == null ? null : this.outcomeDesc.getValue(); + } + + /** + * @param value A free text description of the outcome of the event. + */ + public AuditEventEventComponent setOutcomeDesc(String value) { + if (Utilities.noString(value)) + this.outcomeDesc = null; + else { + if (this.outcomeDesc == null) + this.outcomeDesc = new StringType(); + this.outcomeDesc.setValue(value); + } + return this; + } + + /** + * @return {@link #purposeOfEvent} (The purposeOfUse (reason) that was used during the event being recorded.) + */ + public List getPurposeOfEvent() { + if (this.purposeOfEvent == null) + this.purposeOfEvent = new ArrayList(); + return this.purposeOfEvent; + } + + public boolean hasPurposeOfEvent() { + if (this.purposeOfEvent == null) + return false; + for (Coding item : this.purposeOfEvent) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #purposeOfEvent} (The purposeOfUse (reason) that was used during the event being recorded.) + */ + // syntactic sugar + public Coding addPurposeOfEvent() { //3 + Coding t = new Coding(); + if (this.purposeOfEvent == null) + this.purposeOfEvent = new ArrayList(); + this.purposeOfEvent.add(t); + return t; + } + + // syntactic sugar + public AuditEventEventComponent addPurposeOfEvent(Coding t) { //3 + if (t == null) + return this; + if (this.purposeOfEvent == null) + this.purposeOfEvent = new ArrayList(); + this.purposeOfEvent.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "Identifier for a family of the event.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("subtype", "CodeableConcept", "Identifier for the category of event.", 0, java.lang.Integer.MAX_VALUE, subtype)); + childrenList.add(new Property("action", "code", "Indicator for type of action performed during the event that generated the audit.", 0, java.lang.Integer.MAX_VALUE, action)); + childrenList.add(new Property("dateTime", "instant", "The time when the event occurred on the source.", 0, java.lang.Integer.MAX_VALUE, dateTime)); + childrenList.add(new Property("outcome", "code", "Indicates whether the event succeeded or failed.", 0, java.lang.Integer.MAX_VALUE, outcome)); + childrenList.add(new Property("outcomeDesc", "string", "A free text description of the outcome of the event.", 0, java.lang.Integer.MAX_VALUE, outcomeDesc)); + childrenList.add(new Property("purposeOfEvent", "Coding", "The purposeOfUse (reason) that was used during the event being recorded.", 0, java.lang.Integer.MAX_VALUE, purposeOfEvent)); + } + + public AuditEventEventComponent copy() { + AuditEventEventComponent dst = new AuditEventEventComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + if (subtype != null) { + dst.subtype = new ArrayList(); + for (CodeableConcept i : subtype) + dst.subtype.add(i.copy()); + }; + dst.action = action == null ? null : action.copy(); + dst.dateTime = dateTime == null ? null : dateTime.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.outcomeDesc = outcomeDesc == null ? null : outcomeDesc.copy(); + if (purposeOfEvent != null) { + dst.purposeOfEvent = new ArrayList(); + for (Coding i : purposeOfEvent) + dst.purposeOfEvent.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AuditEventEventComponent)) + return false; + AuditEventEventComponent o = (AuditEventEventComponent) other; + return compareDeep(type, o.type, true) && compareDeep(subtype, o.subtype, true) && compareDeep(action, o.action, true) + && compareDeep(dateTime, o.dateTime, true) && compareDeep(outcome, o.outcome, true) && compareDeep(outcomeDesc, o.outcomeDesc, true) + && compareDeep(purposeOfEvent, o.purposeOfEvent, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AuditEventEventComponent)) + return false; + AuditEventEventComponent o = (AuditEventEventComponent) other; + return compareValues(action, o.action, true) && compareValues(dateTime, o.dateTime, true) && compareValues(outcome, o.outcome, true) + && compareValues(outcomeDesc, o.outcomeDesc, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (subtype == null || subtype.isEmpty()) + && (action == null || action.isEmpty()) && (dateTime == null || dateTime.isEmpty()) && (outcome == null || outcome.isEmpty()) + && (outcomeDesc == null || outcomeDesc.isEmpty()) && (purposeOfEvent == null || purposeOfEvent.isEmpty()) + ; + } + + } + + @Block() + public static class AuditEventParticipantComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context. + */ + @Child(name = "role", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="User roles (e.g. local RBAC codes)", formalDefinition="Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context." ) + protected List role; + + /** + * Direct reference to a resource that identifies the participant. + */ + @Child(name = "reference", type = {Practitioner.class, Organization.class, Device.class, Patient.class, RelatedPerson.class}, order=2, min=0, max=1) + @Description(shortDefinition="Direct reference to resource", formalDefinition="Direct reference to a resource that identifies the participant." ) + protected Reference reference; + + /** + * The actual object that is the target of the reference (Direct reference to a resource that identifies the participant.) + */ + protected Resource referenceTarget; + + /** + * Unique identifier for the user actively participating in the event. + */ + @Child(name = "userId", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Unique identifier for the user", formalDefinition="Unique identifier for the user actively participating in the event." ) + protected StringType userId; + + /** + * Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available. + */ + @Child(name = "altId", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Alternative User id e.g. authentication", formalDefinition="Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available." ) + protected StringType altId; + + /** + * Human-meaningful name for the user. + */ + @Child(name = "name", type = {StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Human-meaningful name for the user", formalDefinition="Human-meaningful name for the user." ) + protected StringType name; + + /** + * Indicator that the user is or is not the requestor, or initiator, for the event being audited. + */ + @Child(name = "requestor", type = {BooleanType.class}, order=6, min=1, max=1) + @Description(shortDefinition="Whether user is initiator", formalDefinition="Indicator that the user is or is not the requestor, or initiator, for the event being audited." ) + protected BooleanType requestor; + + /** + * Where the event occurred. + */ + @Child(name = "location", type = {Location.class}, order=7, min=0, max=1) + @Description(shortDefinition="Where", formalDefinition="Where the event occurred." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (Where the event occurred.) + */ + protected Location locationTarget; + + /** + * The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used. + */ + @Child(name = "policy", type = {UriType.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Policy that authorized event", formalDefinition="The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used." ) + protected List policy; + + /** + * Type of media involved. Used when the event is about exporting/importing onto media. + */ + @Child(name = "media", type = {Coding.class}, order=9, min=0, max=1) + @Description(shortDefinition="Type of media", formalDefinition="Type of media involved. Used when the event is about exporting/importing onto media." ) + protected Coding media; + + /** + * Logical network location for application activity, if the activity has a network location. + */ + @Child(name = "network", type = {}, order=10, min=0, max=1) + @Description(shortDefinition="Logical network location for application activity", formalDefinition="Logical network location for application activity, if the activity has a network location." ) + protected AuditEventParticipantNetworkComponent network; + + /** + * The purposeOfUse (reason) specific to this participant that was used during the event being recorded. + */ + @Child(name = "purposeOfUse", type = {Coding.class}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Participant purposeOfUse", formalDefinition="The purposeOfUse (reason) specific to this participant that was used during the event being recorded." ) + protected List purposeOfUse; + + private static final long serialVersionUID = -1555724321L; + + /* + * Constructor + */ + public AuditEventParticipantComponent() { + super(); + } + + /* + * Constructor + */ + public AuditEventParticipantComponent(BooleanType requestor) { + super(); + this.requestor = requestor; + } + + /** + * @return {@link #role} (Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context.) + */ + public List getRole() { + if (this.role == null) + this.role = new ArrayList(); + return this.role; + } + + public boolean hasRole() { + if (this.role == null) + return false; + for (CodeableConcept item : this.role) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #role} (Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context.) + */ + // syntactic sugar + public CodeableConcept addRole() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.role == null) + this.role = new ArrayList(); + this.role.add(t); + return t; + } + + // syntactic sugar + public AuditEventParticipantComponent addRole(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.role == null) + this.role = new ArrayList(); + this.role.add(t); + return this; + } + + /** + * @return {@link #reference} (Direct reference to a resource that identifies the participant.) + */ + public Reference getReference() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventParticipantComponent.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new Reference(); // cc + return this.reference; + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (Direct reference to a resource that identifies the participant.) + */ + public AuditEventParticipantComponent setReference(Reference value) { + this.reference = value; + return this; + } + + /** + * @return {@link #reference} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Direct reference to a resource that identifies the participant.) + */ + public Resource getReferenceTarget() { + return this.referenceTarget; + } + + /** + * @param value {@link #reference} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Direct reference to a resource that identifies the participant.) + */ + public AuditEventParticipantComponent setReferenceTarget(Resource value) { + this.referenceTarget = value; + return this; + } + + /** + * @return {@link #userId} (Unique identifier for the user actively participating in the event.). This is the underlying object with id, value and extensions. The accessor "getUserId" gives direct access to the value + */ + public StringType getUserIdElement() { + if (this.userId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventParticipantComponent.userId"); + else if (Configuration.doAutoCreate()) + this.userId = new StringType(); // bb + return this.userId; + } + + public boolean hasUserIdElement() { + return this.userId != null && !this.userId.isEmpty(); + } + + public boolean hasUserId() { + return this.userId != null && !this.userId.isEmpty(); + } + + /** + * @param value {@link #userId} (Unique identifier for the user actively participating in the event.). This is the underlying object with id, value and extensions. The accessor "getUserId" gives direct access to the value + */ + public AuditEventParticipantComponent setUserIdElement(StringType value) { + this.userId = value; + return this; + } + + /** + * @return Unique identifier for the user actively participating in the event. + */ + public String getUserId() { + return this.userId == null ? null : this.userId.getValue(); + } + + /** + * @param value Unique identifier for the user actively participating in the event. + */ + public AuditEventParticipantComponent setUserId(String value) { + if (Utilities.noString(value)) + this.userId = null; + else { + if (this.userId == null) + this.userId = new StringType(); + this.userId.setValue(value); + } + return this; + } + + /** + * @return {@link #altId} (Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available.). This is the underlying object with id, value and extensions. The accessor "getAltId" gives direct access to the value + */ + public StringType getAltIdElement() { + if (this.altId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventParticipantComponent.altId"); + else if (Configuration.doAutoCreate()) + this.altId = new StringType(); // bb + return this.altId; + } + + public boolean hasAltIdElement() { + return this.altId != null && !this.altId.isEmpty(); + } + + public boolean hasAltId() { + return this.altId != null && !this.altId.isEmpty(); + } + + /** + * @param value {@link #altId} (Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available.). This is the underlying object with id, value and extensions. The accessor "getAltId" gives direct access to the value + */ + public AuditEventParticipantComponent setAltIdElement(StringType value) { + this.altId = value; + return this; + } + + /** + * @return Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available. + */ + public String getAltId() { + return this.altId == null ? null : this.altId.getValue(); + } + + /** + * @param value Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available. + */ + public AuditEventParticipantComponent setAltId(String value) { + if (Utilities.noString(value)) + this.altId = null; + else { + if (this.altId == null) + this.altId = new StringType(); + this.altId.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (Human-meaningful name for the user.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventParticipantComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (Human-meaningful name for the user.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public AuditEventParticipantComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Human-meaningful name for the user. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Human-meaningful name for the user. + */ + public AuditEventParticipantComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #requestor} (Indicator that the user is or is not the requestor, or initiator, for the event being audited.). This is the underlying object with id, value and extensions. The accessor "getRequestor" gives direct access to the value + */ + public BooleanType getRequestorElement() { + if (this.requestor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventParticipantComponent.requestor"); + else if (Configuration.doAutoCreate()) + this.requestor = new BooleanType(); // bb + return this.requestor; + } + + public boolean hasRequestorElement() { + return this.requestor != null && !this.requestor.isEmpty(); + } + + public boolean hasRequestor() { + return this.requestor != null && !this.requestor.isEmpty(); + } + + /** + * @param value {@link #requestor} (Indicator that the user is or is not the requestor, or initiator, for the event being audited.). This is the underlying object with id, value and extensions. The accessor "getRequestor" gives direct access to the value + */ + public AuditEventParticipantComponent setRequestorElement(BooleanType value) { + this.requestor = value; + return this; + } + + /** + * @return Indicator that the user is or is not the requestor, or initiator, for the event being audited. + */ + public boolean getRequestor() { + return this.requestor == null || this.requestor.isEmpty() ? false : this.requestor.getValue(); + } + + /** + * @param value Indicator that the user is or is not the requestor, or initiator, for the event being audited. + */ + public AuditEventParticipantComponent setRequestor(boolean value) { + if (this.requestor == null) + this.requestor = new BooleanType(); + this.requestor.setValue(value); + return this; + } + + /** + * @return {@link #location} (Where the event occurred.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventParticipantComponent.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); // cc + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (Where the event occurred.) + */ + public AuditEventParticipantComponent setLocation(Reference value) { + this.location = value; + return this; + } + + /** + * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Where the event occurred.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventParticipantComponent.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); // aa + return this.locationTarget; + } + + /** + * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Where the event occurred.) + */ + public AuditEventParticipantComponent setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #policy} (The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.) + */ + public List getPolicy() { + if (this.policy == null) + this.policy = new ArrayList(); + return this.policy; + } + + public boolean hasPolicy() { + if (this.policy == null) + return false; + for (UriType item : this.policy) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #policy} (The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.) + */ + // syntactic sugar + public UriType addPolicyElement() {//2 + UriType t = new UriType(); + if (this.policy == null) + this.policy = new ArrayList(); + this.policy.add(t); + return t; + } + + /** + * @param value {@link #policy} (The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.) + */ + public AuditEventParticipantComponent addPolicy(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.policy == null) + this.policy = new ArrayList(); + this.policy.add(t); + return this; + } + + /** + * @param value {@link #policy} (The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.) + */ + public boolean hasPolicy(String value) { + if (this.policy == null) + return false; + for (UriType v : this.policy) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #media} (Type of media involved. Used when the event is about exporting/importing onto media.) + */ + public Coding getMedia() { + if (this.media == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventParticipantComponent.media"); + else if (Configuration.doAutoCreate()) + this.media = new Coding(); // cc + return this.media; + } + + public boolean hasMedia() { + return this.media != null && !this.media.isEmpty(); + } + + /** + * @param value {@link #media} (Type of media involved. Used when the event is about exporting/importing onto media.) + */ + public AuditEventParticipantComponent setMedia(Coding value) { + this.media = value; + return this; + } + + /** + * @return {@link #network} (Logical network location for application activity, if the activity has a network location.) + */ + public AuditEventParticipantNetworkComponent getNetwork() { + if (this.network == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventParticipantComponent.network"); + else if (Configuration.doAutoCreate()) + this.network = new AuditEventParticipantNetworkComponent(); // cc + return this.network; + } + + public boolean hasNetwork() { + return this.network != null && !this.network.isEmpty(); + } + + /** + * @param value {@link #network} (Logical network location for application activity, if the activity has a network location.) + */ + public AuditEventParticipantComponent setNetwork(AuditEventParticipantNetworkComponent value) { + this.network = value; + return this; + } + + /** + * @return {@link #purposeOfUse} (The purposeOfUse (reason) specific to this participant that was used during the event being recorded.) + */ + public List getPurposeOfUse() { + if (this.purposeOfUse == null) + this.purposeOfUse = new ArrayList(); + return this.purposeOfUse; + } + + public boolean hasPurposeOfUse() { + if (this.purposeOfUse == null) + return false; + for (Coding item : this.purposeOfUse) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #purposeOfUse} (The purposeOfUse (reason) specific to this participant that was used during the event being recorded.) + */ + // syntactic sugar + public Coding addPurposeOfUse() { //3 + Coding t = new Coding(); + if (this.purposeOfUse == null) + this.purposeOfUse = new ArrayList(); + this.purposeOfUse.add(t); + return t; + } + + // syntactic sugar + public AuditEventParticipantComponent addPurposeOfUse(Coding t) { //3 + if (t == null) + return this; + if (this.purposeOfUse == null) + this.purposeOfUse = new ArrayList(); + this.purposeOfUse.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("role", "CodeableConcept", "Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context.", 0, java.lang.Integer.MAX_VALUE, role)); + childrenList.add(new Property("reference", "Reference(Practitioner|Organization|Device|Patient|RelatedPerson)", "Direct reference to a resource that identifies the participant.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("userId", "string", "Unique identifier for the user actively participating in the event.", 0, java.lang.Integer.MAX_VALUE, userId)); + childrenList.add(new Property("altId", "string", "Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available.", 0, java.lang.Integer.MAX_VALUE, altId)); + childrenList.add(new Property("name", "string", "Human-meaningful name for the user.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("requestor", "boolean", "Indicator that the user is or is not the requestor, or initiator, for the event being audited.", 0, java.lang.Integer.MAX_VALUE, requestor)); + childrenList.add(new Property("location", "Reference(Location)", "Where the event occurred.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("policy", "uri", "The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.", 0, java.lang.Integer.MAX_VALUE, policy)); + childrenList.add(new Property("media", "Coding", "Type of media involved. Used when the event is about exporting/importing onto media.", 0, java.lang.Integer.MAX_VALUE, media)); + childrenList.add(new Property("network", "", "Logical network location for application activity, if the activity has a network location.", 0, java.lang.Integer.MAX_VALUE, network)); + childrenList.add(new Property("purposeOfUse", "Coding", "The purposeOfUse (reason) specific to this participant that was used during the event being recorded.", 0, java.lang.Integer.MAX_VALUE, purposeOfUse)); + } + + public AuditEventParticipantComponent copy() { + AuditEventParticipantComponent dst = new AuditEventParticipantComponent(); + copyValues(dst); + if (role != null) { + dst.role = new ArrayList(); + for (CodeableConcept i : role) + dst.role.add(i.copy()); + }; + dst.reference = reference == null ? null : reference.copy(); + dst.userId = userId == null ? null : userId.copy(); + dst.altId = altId == null ? null : altId.copy(); + dst.name = name == null ? null : name.copy(); + dst.requestor = requestor == null ? null : requestor.copy(); + dst.location = location == null ? null : location.copy(); + if (policy != null) { + dst.policy = new ArrayList(); + for (UriType i : policy) + dst.policy.add(i.copy()); + }; + dst.media = media == null ? null : media.copy(); + dst.network = network == null ? null : network.copy(); + if (purposeOfUse != null) { + dst.purposeOfUse = new ArrayList(); + for (Coding i : purposeOfUse) + dst.purposeOfUse.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AuditEventParticipantComponent)) + return false; + AuditEventParticipantComponent o = (AuditEventParticipantComponent) other; + return compareDeep(role, o.role, true) && compareDeep(reference, o.reference, true) && compareDeep(userId, o.userId, true) + && compareDeep(altId, o.altId, true) && compareDeep(name, o.name, true) && compareDeep(requestor, o.requestor, true) + && compareDeep(location, o.location, true) && compareDeep(policy, o.policy, true) && compareDeep(media, o.media, true) + && compareDeep(network, o.network, true) && compareDeep(purposeOfUse, o.purposeOfUse, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AuditEventParticipantComponent)) + return false; + AuditEventParticipantComponent o = (AuditEventParticipantComponent) other; + return compareValues(userId, o.userId, true) && compareValues(altId, o.altId, true) && compareValues(name, o.name, true) + && compareValues(requestor, o.requestor, true) && compareValues(policy, o.policy, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (role == null || role.isEmpty()) && (reference == null || reference.isEmpty()) + && (userId == null || userId.isEmpty()) && (altId == null || altId.isEmpty()) && (name == null || name.isEmpty()) + && (requestor == null || requestor.isEmpty()) && (location == null || location.isEmpty()) + && (policy == null || policy.isEmpty()) && (media == null || media.isEmpty()) && (network == null || network.isEmpty()) + && (purposeOfUse == null || purposeOfUse.isEmpty()); + } + + } + + @Block() + public static class AuditEventParticipantNetworkComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An identifier for the network access point of the user device for the audit event. + */ + @Child(name = "identifier", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Identifier for the network access point of the user device", formalDefinition="An identifier for the network access point of the user device for the audit event." ) + protected StringType identifier; + + /** + * An identifier for the type of network access point that originated the audit event. + */ + @Child(name = "type", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="The type of network access point", formalDefinition="An identifier for the type of network access point that originated the audit event." ) + protected Enumeration type; + + private static final long serialVersionUID = -1946856025L; + + /* + * Constructor + */ + public AuditEventParticipantNetworkComponent() { + super(); + } + + /** + * @return {@link #identifier} (An identifier for the network access point of the user device for the audit event.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public StringType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventParticipantNetworkComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new StringType(); // bb + return this.identifier; + } + + public boolean hasIdentifierElement() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (An identifier for the network access point of the user device for the audit event.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public AuditEventParticipantNetworkComponent setIdentifierElement(StringType value) { + this.identifier = value; + return this; + } + + /** + * @return An identifier for the network access point of the user device for the audit event. + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value An identifier for the network access point of the user device for the audit event. + */ + public AuditEventParticipantNetworkComponent setIdentifier(String value) { + if (Utilities.noString(value)) + this.identifier = null; + else { + if (this.identifier == null) + this.identifier = new StringType(); + this.identifier.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (An identifier for the type of network access point that originated the audit event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventParticipantNetworkComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new NetworkTypeEnumFactory()); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (An identifier for the type of network access point that originated the audit event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public AuditEventParticipantNetworkComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return An identifier for the type of network access point that originated the audit event. + */ + public NetworkType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value An identifier for the type of network access point that originated the audit event. + */ + public AuditEventParticipantNetworkComponent setType(NetworkType value) { + if (value == null) + this.type = null; + else { + if (this.type == null) + this.type = new Enumeration(new NetworkTypeEnumFactory()); + this.type.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "string", "An identifier for the network access point of the user device for the audit event.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("type", "code", "An identifier for the type of network access point that originated the audit event.", 0, java.lang.Integer.MAX_VALUE, type)); + } + + public AuditEventParticipantNetworkComponent copy() { + AuditEventParticipantNetworkComponent dst = new AuditEventParticipantNetworkComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.type = type == null ? null : type.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AuditEventParticipantNetworkComponent)) + return false; + AuditEventParticipantNetworkComponent o = (AuditEventParticipantNetworkComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AuditEventParticipantNetworkComponent)) + return false; + AuditEventParticipantNetworkComponent o = (AuditEventParticipantNetworkComponent) other; + return compareValues(identifier, o.identifier, true) && compareValues(type, o.type, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) + ; + } + + } + + @Block() + public static class AuditEventSourceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Logical source location within the healthcare enterprise network. + */ + @Child(name = "site", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Logical source location within the enterprise", formalDefinition="Logical source location within the healthcare enterprise network." ) + protected StringType site; + + /** + * Identifier of the source where the event originated. + */ + @Child(name = "identifier", type = {StringType.class}, order=2, min=1, max=1) + @Description(shortDefinition="The id of source where event originated", formalDefinition="Identifier of the source where the event originated." ) + protected StringType identifier; + + /** + * Code specifying the type of source where event originated. + */ + @Child(name = "type", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The type of source where event originated", formalDefinition="Code specifying the type of source where event originated." ) + protected List type; + + private static final long serialVersionUID = -382040480L; + + /* + * Constructor + */ + public AuditEventSourceComponent() { + super(); + } + + /* + * Constructor + */ + public AuditEventSourceComponent(StringType identifier) { + super(); + this.identifier = identifier; + } + + /** + * @return {@link #site} (Logical source location within the healthcare enterprise network.). This is the underlying object with id, value and extensions. The accessor "getSite" gives direct access to the value + */ + public StringType getSiteElement() { + if (this.site == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventSourceComponent.site"); + else if (Configuration.doAutoCreate()) + this.site = new StringType(); // bb + return this.site; + } + + public boolean hasSiteElement() { + return this.site != null && !this.site.isEmpty(); + } + + public boolean hasSite() { + return this.site != null && !this.site.isEmpty(); + } + + /** + * @param value {@link #site} (Logical source location within the healthcare enterprise network.). This is the underlying object with id, value and extensions. The accessor "getSite" gives direct access to the value + */ + public AuditEventSourceComponent setSiteElement(StringType value) { + this.site = value; + return this; + } + + /** + * @return Logical source location within the healthcare enterprise network. + */ + public String getSite() { + return this.site == null ? null : this.site.getValue(); + } + + /** + * @param value Logical source location within the healthcare enterprise network. + */ + public AuditEventSourceComponent setSite(String value) { + if (Utilities.noString(value)) + this.site = null; + else { + if (this.site == null) + this.site = new StringType(); + this.site.setValue(value); + } + return this; + } + + /** + * @return {@link #identifier} (Identifier of the source where the event originated.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public StringType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventSourceComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new StringType(); // bb + return this.identifier; + } + + public boolean hasIdentifierElement() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifier of the source where the event originated.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public AuditEventSourceComponent setIdentifierElement(StringType value) { + this.identifier = value; + return this; + } + + /** + * @return Identifier of the source where the event originated. + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value Identifier of the source where the event originated. + */ + public AuditEventSourceComponent setIdentifier(String value) { + if (this.identifier == null) + this.identifier = new StringType(); + this.identifier.setValue(value); + return this; + } + + /** + * @return {@link #type} (Code specifying the type of source where event originated.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (Coding item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (Code specifying the type of source where event originated.) + */ + // syntactic sugar + public Coding addType() { //3 + Coding t = new Coding(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + // syntactic sugar + public AuditEventSourceComponent addType(Coding t) { //3 + if (t == null) + return this; + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("site", "string", "Logical source location within the healthcare enterprise network.", 0, java.lang.Integer.MAX_VALUE, site)); + childrenList.add(new Property("identifier", "string", "Identifier of the source where the event originated.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("type", "Coding", "Code specifying the type of source where event originated.", 0, java.lang.Integer.MAX_VALUE, type)); + } + + public AuditEventSourceComponent copy() { + AuditEventSourceComponent dst = new AuditEventSourceComponent(); + copyValues(dst); + dst.site = site == null ? null : site.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + if (type != null) { + dst.type = new ArrayList(); + for (Coding i : type) + dst.type.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AuditEventSourceComponent)) + return false; + AuditEventSourceComponent o = (AuditEventSourceComponent) other; + return compareDeep(site, o.site, true) && compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AuditEventSourceComponent)) + return false; + AuditEventSourceComponent o = (AuditEventSourceComponent) other; + return compareValues(site, o.site, true) && compareValues(identifier, o.identifier, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (site == null || site.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (type == null || type.isEmpty()); + } + + } + + @Block() + public static class AuditEventObjectComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifies a specific instance of the participant object. The reference should always be version specific. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) + @Description(shortDefinition="Specific instance of object (e.g. versioned)", formalDefinition="Identifies a specific instance of the participant object. The reference should always be version specific." ) + protected Identifier identifier; + + /** + * Identifies a specific instance of the participant object. The reference should always be version specific. + */ + @Child(name = "reference", type = {}, order=2, min=0, max=1) + @Description(shortDefinition="Specific instance of resource (e.g. versioned)", formalDefinition="Identifies a specific instance of the participant object. The reference should always be version specific." ) + protected Reference reference; + + /** + * The actual object that is the target of the reference (Identifies a specific instance of the participant object. The reference should always be version specific.) + */ + protected Resource referenceTarget; + + /** + * The type of the object that was involved in this audit event. + */ + @Child(name = "type", type = {CodeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Type of object involved", formalDefinition="The type of the object that was involved in this audit event." ) + protected Enumeration type; + + /** + * Code representing the functional application role of Participant Object being audited. + */ + @Child(name = "role", type = {CodeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="What role the Object played", formalDefinition="Code representing the functional application role of Participant Object being audited." ) + protected Enumeration role; + + /** + * Identifier for the data life-cycle stage for the participant object. + */ + @Child(name = "lifecycle", type = {CodeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Life-cycle stage for the object", formalDefinition="Identifier for the data life-cycle stage for the participant object." ) + protected Enumeration lifecycle; + + /** + * Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics. + */ + @Child(name = "sensitivity", type = {CodeableConcept.class}, order=6, min=0, max=1) + @Description(shortDefinition="Policy-defined sensitivity for the object", formalDefinition="Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics." ) + protected CodeableConcept sensitivity; + + /** + * An instance-specific descriptor of the Participant Object ID audited, such as a person's name. + */ + @Child(name = "name", type = {StringType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Instance-specific descriptor for Object", formalDefinition="An instance-specific descriptor of the Participant Object ID audited, such as a person's name." ) + protected StringType name; + + /** + * Text that describes the object in more detail. + */ + @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Descriptive text", formalDefinition="Text that describes the object in more detail." ) + protected StringType description; + + /** + * The actual query for a query-type participant object. + */ + @Child(name = "query", type = {Base64BinaryType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Actual query for object", formalDefinition="The actual query for a query-type participant object." ) + protected Base64BinaryType query; + + /** + * Additional Information about the Object. + */ + @Child(name = "detail", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional Information about the Object", formalDefinition="Additional Information about the Object." ) + protected List detail; + + private static final long serialVersionUID = 618775596L; + + /* + * Constructor + */ + public AuditEventObjectComponent() { + super(); + } + + /** + * @return {@link #identifier} (Identifies a specific instance of the participant object. The reference should always be version specific.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventObjectComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifies a specific instance of the participant object. The reference should always be version specific.) + */ + public AuditEventObjectComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #reference} (Identifies a specific instance of the participant object. The reference should always be version specific.) + */ + public Reference getReference() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventObjectComponent.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new Reference(); // cc + return this.reference; + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (Identifies a specific instance of the participant object. The reference should always be version specific.) + */ + public AuditEventObjectComponent setReference(Reference value) { + this.reference = value; + return this; + } + + /** + * @return {@link #reference} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies a specific instance of the participant object. The reference should always be version specific.) + */ + public Resource getReferenceTarget() { + return this.referenceTarget; + } + + /** + * @param value {@link #reference} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies a specific instance of the participant object. The reference should always be version specific.) + */ + public AuditEventObjectComponent setReferenceTarget(Resource value) { + this.referenceTarget = value; + return this; + } + + /** + * @return {@link #type} (The type of the object that was involved in this audit event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventObjectComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new ObjectTypeEnumFactory()); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of the object that was involved in this audit event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public AuditEventObjectComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The type of the object that was involved in this audit event. + */ + public ObjectType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of the object that was involved in this audit event. + */ + public AuditEventObjectComponent setType(ObjectType value) { + if (value == null) + this.type = null; + else { + if (this.type == null) + this.type = new Enumeration(new ObjectTypeEnumFactory()); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #role} (Code representing the functional application role of Participant Object being audited.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value + */ + public Enumeration getRoleElement() { + if (this.role == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventObjectComponent.role"); + else if (Configuration.doAutoCreate()) + this.role = new Enumeration(new ObjectRoleEnumFactory()); // bb + return this.role; + } + + public boolean hasRoleElement() { + return this.role != null && !this.role.isEmpty(); + } + + public boolean hasRole() { + return this.role != null && !this.role.isEmpty(); + } + + /** + * @param value {@link #role} (Code representing the functional application role of Participant Object being audited.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value + */ + public AuditEventObjectComponent setRoleElement(Enumeration value) { + this.role = value; + return this; + } + + /** + * @return Code representing the functional application role of Participant Object being audited. + */ + public ObjectRole getRole() { + return this.role == null ? null : this.role.getValue(); + } + + /** + * @param value Code representing the functional application role of Participant Object being audited. + */ + public AuditEventObjectComponent setRole(ObjectRole value) { + if (value == null) + this.role = null; + else { + if (this.role == null) + this.role = new Enumeration(new ObjectRoleEnumFactory()); + this.role.setValue(value); + } + return this; + } + + /** + * @return {@link #lifecycle} (Identifier for the data life-cycle stage for the participant object.). This is the underlying object with id, value and extensions. The accessor "getLifecycle" gives direct access to the value + */ + public Enumeration getLifecycleElement() { + if (this.lifecycle == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventObjectComponent.lifecycle"); + else if (Configuration.doAutoCreate()) + this.lifecycle = new Enumeration(new ObjectLifecycleEnumFactory()); // bb + return this.lifecycle; + } + + public boolean hasLifecycleElement() { + return this.lifecycle != null && !this.lifecycle.isEmpty(); + } + + public boolean hasLifecycle() { + return this.lifecycle != null && !this.lifecycle.isEmpty(); + } + + /** + * @param value {@link #lifecycle} (Identifier for the data life-cycle stage for the participant object.). This is the underlying object with id, value and extensions. The accessor "getLifecycle" gives direct access to the value + */ + public AuditEventObjectComponent setLifecycleElement(Enumeration value) { + this.lifecycle = value; + return this; + } + + /** + * @return Identifier for the data life-cycle stage for the participant object. + */ + public ObjectLifecycle getLifecycle() { + return this.lifecycle == null ? null : this.lifecycle.getValue(); + } + + /** + * @param value Identifier for the data life-cycle stage for the participant object. + */ + public AuditEventObjectComponent setLifecycle(ObjectLifecycle value) { + if (value == null) + this.lifecycle = null; + else { + if (this.lifecycle == null) + this.lifecycle = new Enumeration(new ObjectLifecycleEnumFactory()); + this.lifecycle.setValue(value); + } + return this; + } + + /** + * @return {@link #sensitivity} (Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics.) + */ + public CodeableConcept getSensitivity() { + if (this.sensitivity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventObjectComponent.sensitivity"); + else if (Configuration.doAutoCreate()) + this.sensitivity = new CodeableConcept(); // cc + return this.sensitivity; + } + + public boolean hasSensitivity() { + return this.sensitivity != null && !this.sensitivity.isEmpty(); + } + + /** + * @param value {@link #sensitivity} (Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics.) + */ + public AuditEventObjectComponent setSensitivity(CodeableConcept value) { + this.sensitivity = value; + return this; + } + + /** + * @return {@link #name} (An instance-specific descriptor of the Participant Object ID audited, such as a person's name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventObjectComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (An instance-specific descriptor of the Participant Object ID audited, such as a person's name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public AuditEventObjectComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return An instance-specific descriptor of the Participant Object ID audited, such as a person's name. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value An instance-specific descriptor of the Participant Object ID audited, such as a person's name. + */ + public AuditEventObjectComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (Text that describes the object in more detail.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventObjectComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Text that describes the object in more detail.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public AuditEventObjectComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Text that describes the object in more detail. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Text that describes the object in more detail. + */ + public AuditEventObjectComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #query} (The actual query for a query-type participant object.). This is the underlying object with id, value and extensions. The accessor "getQuery" gives direct access to the value + */ + public Base64BinaryType getQueryElement() { + if (this.query == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventObjectComponent.query"); + else if (Configuration.doAutoCreate()) + this.query = new Base64BinaryType(); // bb + return this.query; + } + + public boolean hasQueryElement() { + return this.query != null && !this.query.isEmpty(); + } + + public boolean hasQuery() { + return this.query != null && !this.query.isEmpty(); + } + + /** + * @param value {@link #query} (The actual query for a query-type participant object.). This is the underlying object with id, value and extensions. The accessor "getQuery" gives direct access to the value + */ + public AuditEventObjectComponent setQueryElement(Base64BinaryType value) { + this.query = value; + return this; + } + + /** + * @return The actual query for a query-type participant object. + */ + public byte[] getQuery() { + return this.query == null ? null : this.query.getValue(); + } + + /** + * @param value The actual query for a query-type participant object. + */ + public AuditEventObjectComponent setQuery(byte[] value) { + if (value == null) + this.query = null; + else { + if (this.query == null) + this.query = new Base64BinaryType(); + this.query.setValue(value); + } + return this; + } + + /** + * @return {@link #detail} (Additional Information about the Object.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (AuditEventObjectDetailComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (Additional Information about the Object.) + */ + // syntactic sugar + public AuditEventObjectDetailComponent addDetail() { //3 + AuditEventObjectDetailComponent t = new AuditEventObjectDetailComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + // syntactic sugar + public AuditEventObjectComponent addDetail(AuditEventObjectDetailComponent t) { //3 + if (t == null) + return this; + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifies a specific instance of the participant object. The reference should always be version specific.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("reference", "Reference(Any)", "Identifies a specific instance of the participant object. The reference should always be version specific.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("type", "code", "The type of the object that was involved in this audit event.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("role", "code", "Code representing the functional application role of Participant Object being audited.", 0, java.lang.Integer.MAX_VALUE, role)); + childrenList.add(new Property("lifecycle", "code", "Identifier for the data life-cycle stage for the participant object.", 0, java.lang.Integer.MAX_VALUE, lifecycle)); + childrenList.add(new Property("sensitivity", "CodeableConcept", "Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics.", 0, java.lang.Integer.MAX_VALUE, sensitivity)); + childrenList.add(new Property("name", "string", "An instance-specific descriptor of the Participant Object ID audited, such as a person's name.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("description", "string", "Text that describes the object in more detail.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("query", "base64Binary", "The actual query for a query-type participant object.", 0, java.lang.Integer.MAX_VALUE, query)); + childrenList.add(new Property("detail", "", "Additional Information about the Object.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public AuditEventObjectComponent copy() { + AuditEventObjectComponent dst = new AuditEventObjectComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.reference = reference == null ? null : reference.copy(); + dst.type = type == null ? null : type.copy(); + dst.role = role == null ? null : role.copy(); + dst.lifecycle = lifecycle == null ? null : lifecycle.copy(); + dst.sensitivity = sensitivity == null ? null : sensitivity.copy(); + dst.name = name == null ? null : name.copy(); + dst.description = description == null ? null : description.copy(); + dst.query = query == null ? null : query.copy(); + if (detail != null) { + dst.detail = new ArrayList(); + for (AuditEventObjectDetailComponent i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AuditEventObjectComponent)) + return false; + AuditEventObjectComponent o = (AuditEventObjectComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(reference, o.reference, true) + && compareDeep(type, o.type, true) && compareDeep(role, o.role, true) && compareDeep(lifecycle, o.lifecycle, true) + && compareDeep(sensitivity, o.sensitivity, true) && compareDeep(name, o.name, true) && compareDeep(description, o.description, true) + && compareDeep(query, o.query, true) && compareDeep(detail, o.detail, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AuditEventObjectComponent)) + return false; + AuditEventObjectComponent o = (AuditEventObjectComponent) other; + return compareValues(type, o.type, true) && compareValues(role, o.role, true) && compareValues(lifecycle, o.lifecycle, true) + && compareValues(name, o.name, true) && compareValues(description, o.description, true) && compareValues(query, o.query, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (reference == null || reference.isEmpty()) + && (type == null || type.isEmpty()) && (role == null || role.isEmpty()) && (lifecycle == null || lifecycle.isEmpty()) + && (sensitivity == null || sensitivity.isEmpty()) && (name == null || name.isEmpty()) && (description == null || description.isEmpty()) + && (query == null || query.isEmpty()) && (detail == null || detail.isEmpty()); + } + + } + + @Block() + public static class AuditEventObjectDetailComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Name of the property. + */ + @Child(name = "type", type = {StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Name of the property", formalDefinition="Name of the property." ) + protected StringType type; + + /** + * Property value. + */ + @Child(name = "value", type = {Base64BinaryType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Property value", formalDefinition="Property value." ) + protected Base64BinaryType value; + + private static final long serialVersionUID = 11139504L; + + /* + * Constructor + */ + public AuditEventObjectDetailComponent() { + super(); + } + + /* + * Constructor + */ + public AuditEventObjectDetailComponent(StringType type, Base64BinaryType value) { + super(); + this.type = type; + this.value = value; + } + + /** + * @return {@link #type} (Name of the property.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public StringType getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventObjectDetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new StringType(); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Name of the property.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public AuditEventObjectDetailComponent setTypeElement(StringType value) { + this.type = value; + return this; + } + + /** + * @return Name of the property. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Name of the property. + */ + public AuditEventObjectDetailComponent setType(String value) { + if (this.type == null) + this.type = new StringType(); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #value} (Property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public Base64BinaryType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventObjectDetailComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new Base64BinaryType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (Property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public AuditEventObjectDetailComponent setValueElement(Base64BinaryType value) { + this.value = value; + return this; + } + + /** + * @return Property value. + */ + public byte[] getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value Property value. + */ + public AuditEventObjectDetailComponent setValue(byte[] value) { + if (this.value == null) + this.value = new Base64BinaryType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "string", "Name of the property.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("value", "base64Binary", "Property value.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public AuditEventObjectDetailComponent copy() { + AuditEventObjectDetailComponent dst = new AuditEventObjectDetailComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AuditEventObjectDetailComponent)) + return false; + AuditEventObjectDetailComponent o = (AuditEventObjectDetailComponent) other; + return compareDeep(type, o.type, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AuditEventObjectDetailComponent)) + return false; + AuditEventObjectDetailComponent o = (AuditEventObjectDetailComponent) other; + return compareValues(type, o.type, true) && compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + } + + /** + * Identifies the name, action type, time, and disposition of the audited event. + */ + @Child(name = "event", type = {}, order=0, min=1, max=1) + @Description(shortDefinition="What was done", formalDefinition="Identifies the name, action type, time, and disposition of the audited event." ) + protected AuditEventEventComponent event; + + /** + * A person, a hardware device or software process. + */ + @Child(name = "participant", type = {}, order=1, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A person, a hardware device or software process", formalDefinition="A person, a hardware device or software process." ) + protected List participant; + + /** + * Application systems and processes. + */ + @Child(name = "source", type = {}, order=2, min=1, max=1) + @Description(shortDefinition="Application systems and processes", formalDefinition="Application systems and processes." ) + protected AuditEventSourceComponent source; + + /** + * Specific instances of data or objects that have been accessed. + */ + @Child(name = "object", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Specific instances of data or objects that have been accessed", formalDefinition="Specific instances of data or objects that have been accessed." ) + protected List object; + + private static final long serialVersionUID = -1495151000L; + + /* + * Constructor + */ + public AuditEvent() { + super(); + } + + /* + * Constructor + */ + public AuditEvent(AuditEventEventComponent event, AuditEventSourceComponent source) { + super(); + this.event = event; + this.source = source; + } + + /** + * @return {@link #event} (Identifies the name, action type, time, and disposition of the audited event.) + */ + public AuditEventEventComponent getEvent() { + if (this.event == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEvent.event"); + else if (Configuration.doAutoCreate()) + this.event = new AuditEventEventComponent(); // cc + return this.event; + } + + public boolean hasEvent() { + return this.event != null && !this.event.isEmpty(); + } + + /** + * @param value {@link #event} (Identifies the name, action type, time, and disposition of the audited event.) + */ + public AuditEvent setEvent(AuditEventEventComponent value) { + this.event = value; + return this; + } + + /** + * @return {@link #participant} (A person, a hardware device or software process.) + */ + public List getParticipant() { + if (this.participant == null) + this.participant = new ArrayList(); + return this.participant; + } + + public boolean hasParticipant() { + if (this.participant == null) + return false; + for (AuditEventParticipantComponent item : this.participant) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #participant} (A person, a hardware device or software process.) + */ + // syntactic sugar + public AuditEventParticipantComponent addParticipant() { //3 + AuditEventParticipantComponent t = new AuditEventParticipantComponent(); + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return t; + } + + // syntactic sugar + public AuditEvent addParticipant(AuditEventParticipantComponent t) { //3 + if (t == null) + return this; + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return this; + } + + /** + * @return {@link #source} (Application systems and processes.) + */ + public AuditEventSourceComponent getSource() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEvent.source"); + else if (Configuration.doAutoCreate()) + this.source = new AuditEventSourceComponent(); // cc + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (Application systems and processes.) + */ + public AuditEvent setSource(AuditEventSourceComponent value) { + this.source = value; + return this; + } + + /** + * @return {@link #object} (Specific instances of data or objects that have been accessed.) + */ + public List getObject() { + if (this.object == null) + this.object = new ArrayList(); + return this.object; + } + + public boolean hasObject() { + if (this.object == null) + return false; + for (AuditEventObjectComponent item : this.object) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #object} (Specific instances of data or objects that have been accessed.) + */ + // syntactic sugar + public AuditEventObjectComponent addObject() { //3 + AuditEventObjectComponent t = new AuditEventObjectComponent(); + if (this.object == null) + this.object = new ArrayList(); + this.object.add(t); + return t; + } + + // syntactic sugar + public AuditEvent addObject(AuditEventObjectComponent t) { //3 + if (t == null) + return this; + if (this.object == null) + this.object = new ArrayList(); + this.object.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("event", "", "Identifies the name, action type, time, and disposition of the audited event.", 0, java.lang.Integer.MAX_VALUE, event)); + childrenList.add(new Property("participant", "", "A person, a hardware device or software process.", 0, java.lang.Integer.MAX_VALUE, participant)); + childrenList.add(new Property("source", "", "Application systems and processes.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("object", "", "Specific instances of data or objects that have been accessed.", 0, java.lang.Integer.MAX_VALUE, object)); + } + + public AuditEvent copy() { + AuditEvent dst = new AuditEvent(); + copyValues(dst); + dst.event = event == null ? null : event.copy(); + if (participant != null) { + dst.participant = new ArrayList(); + for (AuditEventParticipantComponent i : participant) + dst.participant.add(i.copy()); + }; + dst.source = source == null ? null : source.copy(); + if (object != null) { + dst.object = new ArrayList(); + for (AuditEventObjectComponent i : object) + dst.object.add(i.copy()); + }; + return dst; + } + + protected AuditEvent typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AuditEvent)) + return false; + AuditEvent o = (AuditEvent) other; + return compareDeep(event, o.event, true) && compareDeep(participant, o.participant, true) && compareDeep(source, o.source, true) + && compareDeep(object, o.object, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AuditEvent)) + return false; + AuditEvent o = (AuditEvent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (event == null || event.isEmpty()) && (participant == null || participant.isEmpty()) + && (source == null || source.isEmpty()) && (object == null || object.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.AuditEvent; + } + + @SearchParamDefinition(name="date", path="AuditEvent.event.dateTime", description="Time when the event occurred on source", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="address", path="AuditEvent.participant.network.identifier", description="Identifier for the network access point of the user device", type="token" ) + public static final String SP_ADDRESS = "address"; + @SearchParamDefinition(name="patientid", path="", description="The id of the patient (one of multiple kinds of participations)", type="token" ) + public static final String SP_PATIENTID = "patientid"; + @SearchParamDefinition(name="source", path="AuditEvent.source.identifier", description="The id of source where event originated", type="token" ) + public static final String SP_SOURCE = "source"; + @SearchParamDefinition(name="type", path="AuditEvent.event.type", description="Type/identifier of event", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="altid", path="AuditEvent.participant.altId", description="Alternative User id e.g. authentication", type="token" ) + public static final String SP_ALTID = "altid"; + @SearchParamDefinition(name="participant", path="AuditEvent.participant.reference", description="Direct reference to resource", type="reference" ) + public static final String SP_PARTICIPANT = "participant"; + @SearchParamDefinition(name="reference", path="AuditEvent.object.reference", description="Specific instance of resource (e.g. versioned)", type="reference" ) + public static final String SP_REFERENCE = "reference"; + @SearchParamDefinition(name="site", path="AuditEvent.source.site", description="Logical source location within the enterprise", type="token" ) + public static final String SP_SITE = "site"; + @SearchParamDefinition(name="subtype", path="AuditEvent.event.subtype", description="More specific type/id for the event", type="token" ) + public static final String SP_SUBTYPE = "subtype"; + @SearchParamDefinition(name="identity", path="AuditEvent.object.identifier", description="Specific instance of object (e.g. versioned)", type="token" ) + public static final String SP_IDENTITY = "identity"; + @SearchParamDefinition(name="patient", path="", description="A patient that the .object.reference refers to", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="object-type", path="AuditEvent.object.type", description="Type of object involved", type="token" ) + public static final String SP_OBJECTTYPE = "object-type"; + @SearchParamDefinition(name="name", path="AuditEvent.participant.name", description="Human-meaningful name for the user", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="action", path="AuditEvent.event.action", description="Type of action performed during the event", type="token" ) + public static final String SP_ACTION = "action"; + @SearchParamDefinition(name="user", path="AuditEvent.participant.userId", description="Unique identifier for the user", type="token" ) + public static final String SP_USER = "user"; + @SearchParamDefinition(name="desc", path="AuditEvent.object.name", description="Instance-specific descriptor for Object", type="string" ) + public static final String SP_DESC = "desc"; + @SearchParamDefinition(name="policy", path="AuditEvent.participant.policy", description="Policy that authorized event", type="uri" ) + public static final String SP_POLICY = "policy"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BackboneElement.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BackboneElement.java index 6bdd8d1eeba..90905688562 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BackboneElement.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BackboneElement.java @@ -1,164 +1,143 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Base definition for all elements that are defined inside a resource - but not those in a data type. - */ -@DatatypeDef(name="BackboneElement") -public abstract class BackboneElement extends Element implements IBaseBackboneElement { - - /** - * May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. - */ - @Child(name = "modifierExtension", type = {Extension.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Extensions that cannot be ignored", formalDefinition="May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions." ) - protected List modifierExtension; - - private static final long serialVersionUID = -1431673179L; - - /* - * Constructor - */ - public BackboneElement() { - super(); - } - - /** - * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) - */ - public List getModifierExtension() { - if (this.modifierExtension == null) - this.modifierExtension = new ArrayList(); - return this.modifierExtension; - } - - public boolean hasModifierExtension() { - if (this.modifierExtension == null) - return false; - for (Extension item : this.modifierExtension) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) - */ - // syntactic sugar - public Extension addModifierExtension() { //3 - Extension t = new Extension(); - if (this.modifierExtension == null) - this.modifierExtension = new ArrayList(); - this.modifierExtension.add(t); - return t; - } - - // syntactic sugar - public BackboneElement addModifierExtension(Extension t) { //3 - if (t == null) - return this; - if (this.modifierExtension == null) - this.modifierExtension = new ArrayList(); - this.modifierExtension.add(t); - return this; - } - - protected void listChildren(List childrenList) { - childrenList.add(new Property("modifierExtension", "Extension", "May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.", 0, java.lang.Integer.MAX_VALUE, modifierExtension)); - } - - public abstract BackboneElement copy(); - - public void copyValues(BackboneElement dst) { - if (modifierExtension != null) { - dst.modifierExtension = new ArrayList(); - for (Extension i : modifierExtension) - dst.modifierExtension.add(i.copy()); - }; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof BackboneElement)) - return false; - BackboneElement o = (BackboneElement) other; - return compareDeep(modifierExtension, o.modifierExtension, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof BackboneElement)) - return false; - BackboneElement o = (BackboneElement) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (modifierExtension == null || modifierExtension.isEmpty()); - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Base definition for all elements that are defined inside a resource - but not those in a data type. + */ +@DatatypeDef(name="BackboneElement") +public abstract class BackboneElement extends Element implements IBaseBackboneElement { + + /** + * May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. + */ + @Child(name = "modifierExtension", type = {Extension.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Extensions that cannot be ignored", formalDefinition="May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions." ) + protected List modifierExtension; + + private static final long serialVersionUID = -1431673179L; + + /* + * Constructor + */ + public BackboneElement() { + super(); + } + + /** + * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) + */ + public List getModifierExtension() { + if (this.modifierExtension == null) + this.modifierExtension = new ArrayList(); + return this.modifierExtension; + } + + public boolean hasModifierExtension() { + if (this.modifierExtension == null) + return false; + for (Extension item : this.modifierExtension) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) + */ + // syntactic sugar + public Extension addModifierExtension() { //3 + Extension t = new Extension(); + if (this.modifierExtension == null) + this.modifierExtension = new ArrayList(); + this.modifierExtension.add(t); + return t; + } + + // syntactic sugar + public BackboneElement addModifierExtension(Extension t) { //3 + if (t == null) + return this; + if (this.modifierExtension == null) + this.modifierExtension = new ArrayList(); + this.modifierExtension.add(t); + return this; + } + + protected void listChildren(List childrenList) { + childrenList.add(new Property("modifierExtension", "Extension", "May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.", 0, java.lang.Integer.MAX_VALUE, modifierExtension)); + } + + public abstract BackboneElement copy(); + + public void copyValues(BackboneElement dst) { + if (modifierExtension != null) { + dst.modifierExtension = new ArrayList(); + for (Extension i : modifierExtension) + dst.modifierExtension.add(i.copy()); + }; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof BackboneElement)) + return false; + BackboneElement o = (BackboneElement) other; + return compareDeep(modifierExtension, o.modifierExtension, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof BackboneElement)) + return false; + BackboneElement o = (BackboneElement) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (modifierExtension == null || modifierExtension.isEmpty()); + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Base.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Base.java index bf699c1be71..00e6c651806 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Base.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Base.java @@ -1,178 +1,157 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.hl7.fhir.instance.model.api.IBase; -import org.hl7.fhir.utilities.xhtml.XhtmlNode; - -public abstract class Base implements Serializable, IBase { - - /** - * User appended data items - allow users to add extra information to the class - */ -private Map userData; - - /** - * Round tracking xml comments for testing convenience - */ - private List 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(); - userData.put(name, value); - } - - public boolean hasUserData(String name) { - if (userData == null) - return false; - else - return userData.containsKey(name); - } - - public String getUserString(String name) { - return (String) getUserData(name); - } - - public boolean hasFormatComment() { - return (formatComments != null && !formatComments.isEmpty()); - } - - public List getFormatComments() { - if (formatComments == null) - formatComments = new ArrayList(); - return formatComments; - } - - protected abstract void listChildren(List 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 children() { - List result = new ArrayList(); - listChildren(result); - return result; - } - - public Property getChildByName(String name) { - List children = new ArrayList(); - listChildren(children); - for (Property c : children) - if (c.getName().equals(name)) - return c; - return null; - } - - public List listChildrenByName(String name) { - List children = new ArrayList(); - listChildren(children); - for (Property c : children) - if (c.getName().equals(name) || (c.getName().endsWith("[x]") && name.startsWith(c.getName()))) - return c.getValues(); - return new ArrayList(); - } - - public boolean isEmpty() { - return true; // userData does not count - } - - public boolean equalsDeep(Base other) { - return other != null; - } - - public boolean equalsShallow(Base other) { - return other != null; - } - - public static boolean compareDeep(List e1, List e2, boolean allowNull) { - if (e1 == null && e2 == null && allowNull) - return true; - if (e1 == null || e2 == null) - return false; - if (e1.size() != e2.size()) - return false; - for (int i = 0; i < e1.size(); i++) { - if (!compareDeep(e1.get(i), e2.get(i), allowNull)) - return false; - } - return true; - } - public static boolean compareDeep(Base e1, Base e2, boolean allowNull) { - if (e1 == null && e2 == null && allowNull) - return true; - if (e1 == null || e2 == null) - return false; - return e1.equalsDeep(e2); - } - - public static boolean compareDeep(XhtmlNode div1, XhtmlNode div2, boolean allowNull) { - if (div1 == null && div2 == null && allowNull) - return true; - if (div1 == null || div2 == null) - return false; - return div1.equalsDeep(div2); - } - - - public static boolean compareValues(List e1, List e2, boolean allowNull) { - if (e1 == null && e2 == null && allowNull) - return true; - if (e1 == null || e2 == null) - return false; - if (e1.size() != e2.size()) - return false; - for (int i = 0; i < e1.size(); i++) { - if (!compareValues(e1.get(i), e2.get(i), allowNull)) - return false; - } - return true; - } - - public static boolean compareValues(PrimitiveType e1, PrimitiveType e2, boolean allowNull) { - if (e1 == null && e2 == null && allowNull) - return true; - if (e1 == null || e2 == null) - return false; - return e1.equalsShallow(e2); - } -} +package org.hl7.fhir.instance.model; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.hl7.fhir.instance.model.api.IBase; +import org.hl7.fhir.utilities.xhtml.XhtmlNode; + +public abstract class Base implements Serializable, IBase { + + /** + * User appended data items - allow users to add extra information to the class + */ +private Map userData; + + /** + * Round tracking xml comments for testing convenience + */ + private List 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(); + userData.put(name, value); + } + + public boolean hasUserData(String name) { + if (userData == null) + return false; + else + return userData.containsKey(name); + } + + public String getUserString(String name) { + return (String) getUserData(name); + } + + public boolean hasFormatComment() { + return (formatComments != null && !formatComments.isEmpty()); + } + + public List getFormatComments() { + if (formatComments == null) + formatComments = new ArrayList(); + return formatComments; + } + + protected abstract void listChildren(List 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 children() { + List result = new ArrayList(); + listChildren(result); + return result; + } + + public Property getChildByName(String name) { + List children = new ArrayList(); + listChildren(children); + for (Property c : children) + if (c.getName().equals(name)) + return c; + return null; + } + + public List listChildrenByName(String name) { + List children = new ArrayList(); + listChildren(children); + for (Property c : children) + if (c.getName().equals(name) || (c.getName().endsWith("[x]") && name.startsWith(c.getName()))) + return c.getValues(); + return new ArrayList(); + } + + public boolean isEmpty() { + return true; // userData does not count + } + + public boolean equalsDeep(Base other) { + return other != null; + } + + public boolean equalsShallow(Base other) { + return other != null; + } + + public static boolean compareDeep(List e1, List e2, boolean allowNull) { + if (e1 == null && e2 == null && allowNull) + return true; + if (e1 == null || e2 == null) + return false; + if (e1.size() != e2.size()) + return false; + for (int i = 0; i < e1.size(); i++) { + if (!compareDeep(e1.get(i), e2.get(i), allowNull)) + return false; + } + return true; + } + public static boolean compareDeep(Base e1, Base e2, boolean allowNull) { + if (e1 == null && e2 == null && allowNull) + return true; + if (e1 == null || e2 == null) + return false; + return e1.equalsDeep(e2); + } + + public static boolean compareDeep(XhtmlNode div1, XhtmlNode div2, boolean allowNull) { + if (div1 == null && div2 == null && allowNull) + return true; + if (div1 == null || div2 == null) + return false; + return div1.equalsDeep(div2); + } + + + public static boolean compareValues(List e1, List e2, boolean allowNull) { + if (e1 == null && e2 == null && allowNull) + return true; + if (e1 == null || e2 == null) + return false; + if (e1.size() != e2.size()) + return false; + for (int i = 0; i < e1.size(); i++) { + if (!compareValues(e1.get(i), e2.get(i), allowNull)) + return false; + } + return true; + } + + public static boolean compareValues(PrimitiveType e1, PrimitiveType e2, boolean allowNull) { + if (e1 == null && e2 == null && allowNull) + return true; + if (e1 == null || e2 == null) + return false; + return e1.equalsShallow(e2); + } +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Base64BinaryType.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Base64BinaryType.java index 7f0b0140d13..5376b1cf323 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Base64BinaryType.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Base64BinaryType.java @@ -1,93 +1,72 @@ -/* -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; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import org.apache.commons.codec.binary.Base64; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; - -/** - * Primitive type "base64Binary" in FHIR: a sequence of bytes represented in base64 - */ -@DatatypeDef(name="base64binary") -public class Base64BinaryType extends PrimitiveType { - - private static final long serialVersionUID = 3L; - - /** - * Constructor - */ - public Base64BinaryType() { - super(); - } - - public Base64BinaryType(byte[] theBytes) { - super(); - setValue(theBytes); - } - - public Base64BinaryType(String theValue) { - super(); - setValueAsString(theValue); - } - - protected byte[] parse(String theValue) { - return Base64.decodeBase64(theValue); - } - - protected String encode(byte[] theValue) { - return Base64.encodeBase64String(theValue); - } - - @Override - public Base64BinaryType copy() { - return new Base64BinaryType(getValue()); - } - -} +/* +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; + +import org.apache.commons.codec.binary.Base64; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; + +/** + * Primitive type "base64Binary" in FHIR: a sequence of bytes represented in base64 + */ +@DatatypeDef(name="base64binary") +public class Base64BinaryType extends PrimitiveType { + + private static final long serialVersionUID = 3L; + + /** + * Constructor + */ + public Base64BinaryType() { + super(); + } + + public Base64BinaryType(byte[] theBytes) { + super(); + setValue(theBytes); + } + + public Base64BinaryType(String theValue) { + super(); + setValueAsString(theValue); + } + + protected byte[] parse(String theValue) { + return Base64.decodeBase64(theValue); + } + + protected String encode(byte[] theValue) { + return Base64.encodeBase64String(theValue); + } + + @Override + public Base64BinaryType copy() { + return new Base64BinaryType(getValue()); + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseBinary.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseBinary.java index e76b2750394..d8c4aeb0715 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseBinary.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseBinary.java @@ -1,25 +1,5 @@ package org.hl7.fhir.instance.model; -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - import org.hl7.fhir.instance.model.api.IBaseBinary; public abstract class BaseBinary extends Resource implements IBaseBinary { diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseDateTimeType.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseDateTimeType.java index 4e6d77f608c..0111c56a286 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseDateTimeType.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseDateTimeType.java @@ -1,25 +1,5 @@ package org.hl7.fhir.instance.model; -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseExtension.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseExtension.java index 9427d69a6bc..9d119880865 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseExtension.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseExtension.java @@ -1,25 +1,5 @@ package org.hl7.fhir.instance.model; -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - import org.hl7.fhir.instance.model.api.IBaseDatatype; import org.hl7.fhir.instance.model.api.IBaseExtension; import org.hl7.fhir.instance.model.api.IBaseHasExtensions; diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseNarrative.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseNarrative.java index 95fc9e6f6c9..9a40348ca4e 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseNarrative.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseNarrative.java @@ -1,25 +1,5 @@ package org.hl7.fhir.instance.model; -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.model.api.INarrative; import org.hl7.fhir.utilities.xhtml.XhtmlNode; diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseReference.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseReference.java index f265e6f944a..0ca2cbd5c4f 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseReference.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseReference.java @@ -1,30 +1,10 @@ package org.hl7.fhir.instance.model; -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - import org.hl7.fhir.instance.model.api.IBaseReference; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.ICompositeType; import org.hl7.fhir.instance.model.api.IIdType; -import org.hl7.fhir.instance.model.api.IRefImplResource; +import org.hl7.fhir.instance.model.api.IAnyResource; public abstract class BaseReference extends Type implements IBaseReference, ICompositeType { @@ -45,7 +25,7 @@ public abstract class BaseReference extends Type implements IBaseReference, ICom } } - public BaseReference(IRefImplResource theResource) { + public BaseReference(IAnyResource theResource) { resource = theResource; } diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseResource.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseResource.java index 411bab8011a..ae07add7381 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseResource.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseResource.java @@ -1,31 +1,13 @@ package org.hl7.fhir.instance.model; -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - +import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IIdType; -import org.hl7.fhir.instance.model.api.IRefImplResource; -public abstract class BaseResource extends Base implements IRefImplResource { +public abstract class BaseResource extends Base implements IAnyResource { - /** + private static final long serialVersionUID = 1L; + + /** * @param value The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes. */ public BaseResource setId(IIdType value) { diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Basic.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Basic.java index 258188cc36c..c3e1bf651fb 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Basic.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Basic.java @@ -1,394 +1,373 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. - */ -@ResourceDef(name="Basic", profile="http://hl7.org/fhir/Profile/Basic") -public class Basic extends DomainResource { - - /** - * Identifier assigned to the resource for business purposes, outside the context of FHIR. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business identifier", formalDefinition="Identifier assigned to the resource for business purposes, outside the context of FHIR." ) - protected List identifier; - - /** - * Identifies the 'type' of resource - equivalent to the resource name for other resources. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1) - @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=2, 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=3, 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=4, 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; - - /* - * Constructor - */ - public Basic() { - super(); - } - - /* - * Constructor - */ - public Basic(CodeableConcept code) { - super(); - this.code = code; - } - - /** - * @return {@link #identifier} (Identifier assigned to the resource for business purposes, outside the context of FHIR.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifier assigned to the resource for business purposes, outside the context of FHIR.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Basic addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #code} (Identifies the 'type' of resource - equivalent to the resource name for other resources.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Basic.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Identifies the 'type' of resource - equivalent to the resource name for other resources.) - */ - public Basic setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #subject} (Identifies the patient, practitioner, device or any other resource that is the "focus" of this 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(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (Identifies the patient, practitioner, device or any other resource that is the "focus" of this 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(); // cc - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Indicates who was responsible for creating the resource instance.) - */ - public Basic setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates who was responsible for creating the resource instance.) - */ - public Resource getAuthorTarget() { - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates who was responsible for creating the resource instance.) - */ - public Basic setAuthorTarget(Resource value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #created} (Identifies when the resource was first created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Basic.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (Identifies when the resource was first created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public Basic setCreatedElement(DateType value) { - this.created = value; - return this; - } - - /** - * @return Identifies when the resource was first created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value Identifies when the resource was first created. - */ - public Basic setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateType(); - this.created.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier assigned to the resource for business purposes, outside the context of FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("code", "CodeableConcept", "Identifies the 'type' of resource - equivalent to the resource name for other resources.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("subject", "Reference(Any)", "Identifies the patient, practitioner, device or any other resource that is the 'focus' of this 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(); - 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(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Basic)) - return false; - Basic o = (Basic) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(code, o.code, true) && compareDeep(subject, o.subject, true) - && compareDeep(author, o.author, true) && compareDeep(created, o.created, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Basic)) - return false; - Basic o = (Basic) other; - return compareValues(created, o.created, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) - && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) && (created == null || created.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Basic; - } - - @SearchParamDefinition(name="author", path="Basic.author", description="Who created", type="reference" ) - public static final String SP_AUTHOR = "author"; - @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"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. + */ +@ResourceDef(name="Basic", profile="http://hl7.org/fhir/Profile/Basic") +public class Basic extends DomainResource { + + /** + * Identifier assigned to the resource for business purposes, outside the context of FHIR. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business identifier", formalDefinition="Identifier assigned to the resource for business purposes, outside the context of FHIR." ) + protected List identifier; + + /** + * Identifies the 'type' of resource - equivalent to the resource name for other resources. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1) + @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=2, 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=3, 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=4, 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; + + /* + * Constructor + */ + public Basic() { + super(); + } + + /* + * Constructor + */ + public Basic(CodeableConcept code) { + super(); + this.code = code; + } + + /** + * @return {@link #identifier} (Identifier assigned to the resource for business purposes, outside the context of FHIR.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Identifier assigned to the resource for business purposes, outside the context of FHIR.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Basic addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #code} (Identifies the 'type' of resource - equivalent to the resource name for other resources.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Basic.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Identifies the 'type' of resource - equivalent to the resource name for other resources.) + */ + public Basic setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #subject} (Identifies the patient, practitioner, device or any other resource that is the "focus" of this 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(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Identifies the patient, practitioner, device or any other resource that is the "focus" of this 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(); // cc + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Indicates who was responsible for creating the resource instance.) + */ + public Basic setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates who was responsible for creating the resource instance.) + */ + public Resource getAuthorTarget() { + return this.authorTarget; + } + + /** + * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates who was responsible for creating the resource instance.) + */ + public Basic setAuthorTarget(Resource value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #created} (Identifies when the resource was first created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Basic.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateType(); // bb + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (Identifies when the resource was first created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public Basic setCreatedElement(DateType value) { + this.created = value; + return this; + } + + /** + * @return Identifies when the resource was first created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value Identifies when the resource was first created. + */ + public Basic setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateType(); + this.created.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier assigned to the resource for business purposes, outside the context of FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("code", "CodeableConcept", "Identifies the 'type' of resource - equivalent to the resource name for other resources.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("subject", "Reference(Any)", "Identifies the patient, practitioner, device or any other resource that is the 'focus' of this 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(); + 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(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Basic)) + return false; + Basic o = (Basic) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(code, o.code, true) && compareDeep(subject, o.subject, true) + && compareDeep(author, o.author, true) && compareDeep(created, o.created, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Basic)) + return false; + Basic o = (Basic) other; + return compareValues(created, o.created, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) + && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) && (created == null || created.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Basic; + } + + @SearchParamDefinition(name="code", path="Basic.code", description="Kind of Resource", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="subject", path="Basic.subject", description="Identifies the", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="created", path="Basic.created", description="When created", type="date" ) + public static final String SP_CREATED = "created"; + @SearchParamDefinition(name="patient", path="Basic.subject", description="Identifies the", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="author", path="Basic.author", description="Who created", type="reference" ) + public static final String SP_AUTHOR = "author"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Binary.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Binary.java index c3dc54444e5..6480d6e74f0 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Binary.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Binary.java @@ -1,244 +1,223 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A binary resource can contain any content, whether text, image, pdf, zip archive, etc. - */ -@ResourceDef(name="Binary", profile="http://hl7.org/fhir/Profile/Binary") -public class Binary extends BaseBinary implements IBaseBinary { - - /** - * MimeType of the binary content represented as a standard MimeType (BCP 13). - */ - @Child(name = "contentType", type = {CodeType.class}, order=0, min=1, max=1) - @Description(shortDefinition="MimeType of the binary content", formalDefinition="MimeType of the binary content represented as a standard MimeType (BCP 13)." ) - protected CodeType contentType; - - /** - * The actual content, base64 encoded. - */ - @Child(name = "content", type = {Base64BinaryType.class}, order=1, min=1, max=1) - @Description(shortDefinition="The actual content", formalDefinition="The actual content, base64 encoded." ) - protected Base64BinaryType content; - - private static final long serialVersionUID = 974764407L; - - /* - * Constructor - */ - public Binary() { - super(); - } - - /* - * Constructor - */ - public Binary(CodeType contentType, Base64BinaryType content) { - super(); - this.contentType = contentType; - this.content = content; - } - - /** - * @return {@link #contentType} (MimeType of the binary content represented as a standard MimeType (BCP 13).). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value - */ - public CodeType getContentTypeElement() { - if (this.contentType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Binary.contentType"); - else if (Configuration.doAutoCreate()) - this.contentType = new CodeType(); // bb - return this.contentType; - } - - public boolean hasContentTypeElement() { - return this.contentType != null && !this.contentType.isEmpty(); - } - - public boolean hasContentType() { - return this.contentType != null && !this.contentType.isEmpty(); - } - - /** - * @param value {@link #contentType} (MimeType of the binary content represented as a standard MimeType (BCP 13).). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value - */ - public Binary setContentTypeElement(CodeType value) { - this.contentType = value; - return this; - } - - /** - * @return MimeType of the binary content represented as a standard MimeType (BCP 13). - */ - public String getContentType() { - return this.contentType == null ? null : this.contentType.getValue(); - } - - /** - * @param value MimeType of the binary content represented as a standard MimeType (BCP 13). - */ - public Binary setContentType(String value) { - if (this.contentType == null) - this.contentType = new CodeType(); - this.contentType.setValue(value); - return this; - } - - /** - * @return {@link #content} (The actual content, base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getContent" gives direct access to the value - */ - public Base64BinaryType getContentElement() { - if (this.content == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Binary.content"); - else if (Configuration.doAutoCreate()) - this.content = new Base64BinaryType(); // bb - return this.content; - } - - public boolean hasContentElement() { - return this.content != null && !this.content.isEmpty(); - } - - public boolean hasContent() { - return this.content != null && !this.content.isEmpty(); - } - - /** - * @param value {@link #content} (The actual content, base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getContent" gives direct access to the value - */ - public Binary setContentElement(Base64BinaryType value) { - this.content = value; - return this; - } - - /** - * @return The actual content, base64 encoded. - */ - public byte[] getContent() { - return this.content == null ? null : this.content.getValue(); - } - - /** - * @param value The actual content, base64 encoded. - */ - public Binary setContent(byte[] value) { - if (this.content == null) - this.content = new Base64BinaryType(); - this.content.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("contentType", "code", "MimeType of the binary content represented as a standard MimeType (BCP 13).", 0, java.lang.Integer.MAX_VALUE, contentType)); - childrenList.add(new Property("content", "base64Binary", "The actual content, base64 encoded.", 0, java.lang.Integer.MAX_VALUE, content)); - } - - public Binary copy() { - Binary dst = new Binary(); - copyValues(dst); - dst.contentType = contentType == null ? null : contentType.copy(); - dst.content = content == null ? null : content.copy(); - return dst; - } - - protected Binary typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Binary)) - return false; - Binary o = (Binary) other; - return compareDeep(contentType, o.contentType, true) && compareDeep(content, o.content, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Binary)) - return false; - Binary o = (Binary) other; - return compareValues(contentType, o.contentType, true) && compareValues(content, o.content, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (contentType == null || contentType.isEmpty()) && (content == null || content.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Binary; - } - - @SearchParamDefinition(name="contenttype", path="Binary.contentType", description="MimeType of the binary content", type="token" ) - public static final String SP_CONTENTTYPE = "contenttype"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A binary resource can contain any content, whether text, image, pdf, zip archive, etc. + */ +@ResourceDef(name="Binary", profile="http://hl7.org/fhir/Profile/Binary") +public class Binary extends BaseBinary implements IBaseBinary { + + /** + * MimeType of the binary content represented as a standard MimeType (BCP 13). + */ + @Child(name = "contentType", type = {CodeType.class}, order=0, min=1, max=1) + @Description(shortDefinition="MimeType of the binary content", formalDefinition="MimeType of the binary content represented as a standard MimeType (BCP 13)." ) + protected CodeType contentType; + + /** + * The actual content, base64 encoded. + */ + @Child(name = "content", type = {Base64BinaryType.class}, order=1, min=1, max=1) + @Description(shortDefinition="The actual content", formalDefinition="The actual content, base64 encoded." ) + protected Base64BinaryType content; + + private static final long serialVersionUID = 974764407L; + + /* + * Constructor + */ + public Binary() { + super(); + } + + /* + * Constructor + */ + public Binary(CodeType contentType, Base64BinaryType content) { + super(); + this.contentType = contentType; + this.content = content; + } + + /** + * @return {@link #contentType} (MimeType of the binary content represented as a standard MimeType (BCP 13).). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public CodeType getContentTypeElement() { + if (this.contentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Binary.contentType"); + else if (Configuration.doAutoCreate()) + this.contentType = new CodeType(); // bb + return this.contentType; + } + + public boolean hasContentTypeElement() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + public boolean hasContentType() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + /** + * @param value {@link #contentType} (MimeType of the binary content represented as a standard MimeType (BCP 13).). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public Binary setContentTypeElement(CodeType value) { + this.contentType = value; + return this; + } + + /** + * @return MimeType of the binary content represented as a standard MimeType (BCP 13). + */ + public String getContentType() { + return this.contentType == null ? null : this.contentType.getValue(); + } + + /** + * @param value MimeType of the binary content represented as a standard MimeType (BCP 13). + */ + public Binary setContentType(String value) { + if (this.contentType == null) + this.contentType = new CodeType(); + this.contentType.setValue(value); + return this; + } + + /** + * @return {@link #content} (The actual content, base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getContent" gives direct access to the value + */ + public Base64BinaryType getContentElement() { + if (this.content == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Binary.content"); + else if (Configuration.doAutoCreate()) + this.content = new Base64BinaryType(); // bb + return this.content; + } + + public boolean hasContentElement() { + return this.content != null && !this.content.isEmpty(); + } + + public boolean hasContent() { + return this.content != null && !this.content.isEmpty(); + } + + /** + * @param value {@link #content} (The actual content, base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getContent" gives direct access to the value + */ + public Binary setContentElement(Base64BinaryType value) { + this.content = value; + return this; + } + + /** + * @return The actual content, base64 encoded. + */ + public byte[] getContent() { + return this.content == null ? null : this.content.getValue(); + } + + /** + * @param value The actual content, base64 encoded. + */ + public Binary setContent(byte[] value) { + if (this.content == null) + this.content = new Base64BinaryType(); + this.content.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("contentType", "code", "MimeType of the binary content represented as a standard MimeType (BCP 13).", 0, java.lang.Integer.MAX_VALUE, contentType)); + childrenList.add(new Property("content", "base64Binary", "The actual content, base64 encoded.", 0, java.lang.Integer.MAX_VALUE, content)); + } + + public Binary copy() { + Binary dst = new Binary(); + copyValues(dst); + dst.contentType = contentType == null ? null : contentType.copy(); + dst.content = content == null ? null : content.copy(); + return dst; + } + + protected Binary typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Binary)) + return false; + Binary o = (Binary) other; + return compareDeep(contentType, o.contentType, true) && compareDeep(content, o.content, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Binary)) + return false; + Binary o = (Binary) other; + return compareValues(contentType, o.contentType, true) && compareValues(content, o.content, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (contentType == null || contentType.isEmpty()) && (content == null || content.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Binary; + } + + @SearchParamDefinition(name="contenttype", path="Binary.contentType", description="MimeType of the binary content", type="token" ) + public static final String SP_CONTENTTYPE = "contenttype"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BodySite.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BodySite.java index 22f5bc7f89c..2de91cfb874 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BodySite.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BodySite.java @@ -1,448 +1,427 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Record details about the anatomical location of a specimen or body part. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. - */ -@ResourceDef(name="BodySite", profile="http://hl7.org/fhir/Profile/BodySite") -public class BodySite extends DomainResource { - - /** - * The person to which the body site belongs. - */ - @Child(name = "patient", type = {Patient.class}, order=0, min=1, max=1) - @Description(shortDefinition="Patient", formalDefinition="The person to which the body site belongs." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The person to which the body site belongs.) - */ - protected Patient patientTarget; - - /** - * Identifier for this instance of the anatomical location. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Bodysite identifier", formalDefinition="Identifier for this instance of the anatomical location." ) - protected List identifier; - - /** - * Named anatomical location - ideally would be coded where possible. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Named anatomical location", formalDefinition="Named anatomical location - ideally would be coded where possible." ) - protected CodeableConcept code; - - /** - * Modifier to refine the anatomical location. These include modifiers for laterality, relative location, directionality, number, and plane. - */ - @Child(name = "modifier", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Modification to location code", formalDefinition="Modifier to refine the anatomical location. These include modifiers for laterality, relative location, directionality, number, and plane." ) - protected List modifier; - - /** - * Description of anatomical location. - */ - @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="The Description of anatomical location", formalDefinition="Description of anatomical location." ) - protected StringType description; - - /** - * Image or images used to identify a location. - */ - @Child(name = "image", type = {Attachment.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Attached images", formalDefinition="Image or images used to identify a location." ) - protected List image; - - private static final long serialVersionUID = 1568109920L; - - /* - * Constructor - */ - public BodySite() { - super(); - } - - /* - * Constructor - */ - public BodySite(Reference patient) { - super(); - this.patient = patient; - } - - /** - * @return {@link #patient} (The person to which the body site belongs.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BodySite.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The person to which the body site belongs.) - */ - public BodySite setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person to which the body site belongs.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BodySite.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person to which the body site belongs.) - */ - public BodySite setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #identifier} (Identifier for this instance of the anatomical location.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifier for this instance of the anatomical location.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public BodySite addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #code} (Named anatomical location - ideally would be coded where possible.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BodySite.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Named anatomical location - ideally would be coded where possible.) - */ - public BodySite setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #modifier} (Modifier to refine the anatomical location. These include modifiers for laterality, relative location, directionality, number, and plane.) - */ - public List getModifier() { - if (this.modifier == null) - this.modifier = new ArrayList(); - return this.modifier; - } - - public boolean hasModifier() { - if (this.modifier == null) - return false; - for (CodeableConcept item : this.modifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #modifier} (Modifier to refine the anatomical location. These include modifiers for laterality, relative location, directionality, number, and plane.) - */ - // syntactic sugar - public CodeableConcept addModifier() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.modifier == null) - this.modifier = new ArrayList(); - this.modifier.add(t); - return t; - } - - // syntactic sugar - public BodySite addModifier(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.modifier == null) - this.modifier = new ArrayList(); - this.modifier.add(t); - return this; - } - - /** - * @return {@link #description} (Description of anatomical location.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BodySite.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Description of anatomical location.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public BodySite setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Description of anatomical location. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Description of anatomical location. - */ - public BodySite setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #image} (Image or images used to identify a location.) - */ - public List getImage() { - if (this.image == null) - this.image = new ArrayList(); - return this.image; - } - - public boolean hasImage() { - if (this.image == null) - return false; - for (Attachment item : this.image) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #image} (Image or images used to identify a location.) - */ - // syntactic sugar - public Attachment addImage() { //3 - Attachment t = new Attachment(); - if (this.image == null) - this.image = new ArrayList(); - this.image.add(t); - return t; - } - - // syntactic sugar - public BodySite addImage(Attachment t) { //3 - if (t == null) - return this; - if (this.image == null) - this.image = new ArrayList(); - this.image.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("patient", "Reference(Patient)", "The person to which the body site belongs.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("identifier", "Identifier", "Identifier for this instance of the anatomical location.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("code", "CodeableConcept", "Named anatomical location - ideally would be coded where possible.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("modifier", "CodeableConcept", "Modifier to refine the anatomical location. These include modifiers for laterality, relative location, directionality, number, and plane.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("description", "string", "Description of anatomical location.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("image", "Attachment", "Image or images used to identify a location.", 0, java.lang.Integer.MAX_VALUE, image)); - } - - public BodySite copy() { - BodySite dst = new BodySite(); - copyValues(dst); - dst.patient = patient == null ? null : patient.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.code = code == null ? null : code.copy(); - if (modifier != null) { - dst.modifier = new ArrayList(); - for (CodeableConcept i : modifier) - dst.modifier.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - if (image != null) { - dst.image = new ArrayList(); - for (Attachment i : image) - dst.image.add(i.copy()); - }; - return dst; - } - - protected BodySite typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof BodySite)) - return false; - BodySite o = (BodySite) other; - return compareDeep(patient, o.patient, true) && compareDeep(identifier, o.identifier, true) && compareDeep(code, o.code, true) - && compareDeep(modifier, o.modifier, true) && compareDeep(description, o.description, true) && compareDeep(image, o.image, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof BodySite)) - return false; - BodySite o = (BodySite) other; - return compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (patient == null || patient.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (code == null || code.isEmpty()) && (modifier == null || modifier.isEmpty()) && (description == null || description.isEmpty()) - && (image == null || image.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.BodySite; - } - - @SearchParamDefinition(name="patient", path="BodySite.patient", description="Patient to whom bodysite belongs", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="code", path="BodySite.code", description="Named anatomical location", type="token" ) - public static final String SP_CODE = "code"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Record details about the anatomical location of a specimen or body part. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. + */ +@ResourceDef(name="BodySite", profile="http://hl7.org/fhir/Profile/BodySite") +public class BodySite extends DomainResource { + + /** + * The person to which the body site belongs. + */ + @Child(name = "patient", type = {Patient.class}, order=0, min=1, max=1) + @Description(shortDefinition="Patient", formalDefinition="The person to which the body site belongs." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The person to which the body site belongs.) + */ + protected Patient patientTarget; + + /** + * Identifier for this instance of the anatomical location. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Bodysite identifier", formalDefinition="Identifier for this instance of the anatomical location." ) + protected List identifier; + + /** + * Named anatomical location - ideally would be coded where possible. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Named anatomical location", formalDefinition="Named anatomical location - ideally would be coded where possible." ) + protected CodeableConcept code; + + /** + * Modifier to refine the anatomical location. These include modifiers for laterality, relative location, directionality, number, and plane. + */ + @Child(name = "modifier", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Modification to location code", formalDefinition="Modifier to refine the anatomical location. These include modifiers for laterality, relative location, directionality, number, and plane." ) + protected List modifier; + + /** + * Description of anatomical location. + */ + @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="The Description of anatomical location", formalDefinition="Description of anatomical location." ) + protected StringType description; + + /** + * Image or images used to identify a location. + */ + @Child(name = "image", type = {Attachment.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Attached images", formalDefinition="Image or images used to identify a location." ) + protected List image; + + private static final long serialVersionUID = 1568109920L; + + /* + * Constructor + */ + public BodySite() { + super(); + } + + /* + * Constructor + */ + public BodySite(Reference patient) { + super(); + this.patient = patient; + } + + /** + * @return {@link #patient} (The person to which the body site belongs.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BodySite.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The person to which the body site belongs.) + */ + public BodySite setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person to which the body site belongs.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BodySite.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person to which the body site belongs.) + */ + public BodySite setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #identifier} (Identifier for this instance of the anatomical location.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Identifier for this instance of the anatomical location.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public BodySite addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #code} (Named anatomical location - ideally would be coded where possible.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BodySite.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Named anatomical location - ideally would be coded where possible.) + */ + public BodySite setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #modifier} (Modifier to refine the anatomical location. These include modifiers for laterality, relative location, directionality, number, and plane.) + */ + public List getModifier() { + if (this.modifier == null) + this.modifier = new ArrayList(); + return this.modifier; + } + + public boolean hasModifier() { + if (this.modifier == null) + return false; + for (CodeableConcept item : this.modifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modifier} (Modifier to refine the anatomical location. These include modifiers for laterality, relative location, directionality, number, and plane.) + */ + // syntactic sugar + public CodeableConcept addModifier() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.modifier == null) + this.modifier = new ArrayList(); + this.modifier.add(t); + return t; + } + + // syntactic sugar + public BodySite addModifier(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.modifier == null) + this.modifier = new ArrayList(); + this.modifier.add(t); + return this; + } + + /** + * @return {@link #description} (Description of anatomical location.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BodySite.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Description of anatomical location.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public BodySite setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Description of anatomical location. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Description of anatomical location. + */ + public BodySite setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #image} (Image or images used to identify a location.) + */ + public List getImage() { + if (this.image == null) + this.image = new ArrayList(); + return this.image; + } + + public boolean hasImage() { + if (this.image == null) + return false; + for (Attachment item : this.image) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #image} (Image or images used to identify a location.) + */ + // syntactic sugar + public Attachment addImage() { //3 + Attachment t = new Attachment(); + if (this.image == null) + this.image = new ArrayList(); + this.image.add(t); + return t; + } + + // syntactic sugar + public BodySite addImage(Attachment t) { //3 + if (t == null) + return this; + if (this.image == null) + this.image = new ArrayList(); + this.image.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("patient", "Reference(Patient)", "The person to which the body site belongs.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("identifier", "Identifier", "Identifier for this instance of the anatomical location.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("code", "CodeableConcept", "Named anatomical location - ideally would be coded where possible.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("modifier", "CodeableConcept", "Modifier to refine the anatomical location. These include modifiers for laterality, relative location, directionality, number, and plane.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("description", "string", "Description of anatomical location.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("image", "Attachment", "Image or images used to identify a location.", 0, java.lang.Integer.MAX_VALUE, image)); + } + + public BodySite copy() { + BodySite dst = new BodySite(); + copyValues(dst); + dst.patient = patient == null ? null : patient.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.code = code == null ? null : code.copy(); + if (modifier != null) { + dst.modifier = new ArrayList(); + for (CodeableConcept i : modifier) + dst.modifier.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + if (image != null) { + dst.image = new ArrayList(); + for (Attachment i : image) + dst.image.add(i.copy()); + }; + return dst; + } + + protected BodySite typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof BodySite)) + return false; + BodySite o = (BodySite) other; + return compareDeep(patient, o.patient, true) && compareDeep(identifier, o.identifier, true) && compareDeep(code, o.code, true) + && compareDeep(modifier, o.modifier, true) && compareDeep(description, o.description, true) && compareDeep(image, o.image, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof BodySite)) + return false; + BodySite o = (BodySite) other; + return compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (patient == null || patient.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (code == null || code.isEmpty()) && (modifier == null || modifier.isEmpty()) && (description == null || description.isEmpty()) + && (image == null || image.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.BodySite; + } + + @SearchParamDefinition(name="code", path="BodySite.code", description="Named anatomical location", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="patient", path="BodySite.patient", description="Patient to whom bodysite belongs", type="reference" ) + public static final String SP_PATIENT = "patient"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BooleanType.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BooleanType.java index e75a21975b3..64c4d76f7a7 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BooleanType.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BooleanType.java @@ -1,107 +1,86 @@ -/* -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; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -import org.hl7.fhir.instance.model.api.IBaseBooleanDatatype; - -/** - * Primitive type "boolean" in FHIR "true" or "false" - */ -@DatatypeDef(name="boolean") -public class BooleanType extends PrimitiveType implements IBaseBooleanDatatype { - - private static final long serialVersionUID = 3L; - - public BooleanType() { - super(); - } - - public BooleanType(boolean theBoolean) { - super(); - setValue(theBoolean); - } - - public BooleanType(Boolean theBoolean) { - super(); - setValue(theBoolean); - } - - public BooleanType(String value) { - super(); - setValueAsString(value); - } - - 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 + "'"); - } - } - - protected String encode(Boolean theValue) { - if (Boolean.TRUE.equals(theValue)) { - return "true"; - } else { - return "false"; - } - } - - public BooleanType copy() { - return new BooleanType(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. + + */ +/** + * + */ +package org.hl7.fhir.instance.model; + +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +import org.hl7.fhir.instance.model.api.IBaseBooleanDatatype; + +/** + * Primitive type "boolean" in FHIR "true" or "false" + */ +@DatatypeDef(name="boolean") +public class BooleanType extends PrimitiveType implements IBaseBooleanDatatype { + + private static final long serialVersionUID = 3L; + + public BooleanType() { + super(); + } + + public BooleanType(boolean theBoolean) { + super(); + setValue(theBoolean); + } + + public BooleanType(Boolean theBoolean) { + super(); + setValue(theBoolean); + } + + public BooleanType(String value) { + super(); + setValueAsString(value); + } + + 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 + "'"); + } + } + + protected String encode(Boolean theValue) { + if (Boolean.TRUE.equals(theValue)) { + return "true"; + } else { + return "false"; + } + } + + public BooleanType copy() { + return new BooleanType(getValue()); + } +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Bundle.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Bundle.java index 598dc30dbfc..35011c03dc0 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Bundle.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Bundle.java @@ -1,2095 +1,2121 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import java.util.*; - -import java.math.*; -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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A container for a collection of resources. - */ -@ResourceDef(name="Bundle", profile="http://hl7.org/fhir/Profile/Bundle") -public class Bundle extends Resource implements IBaseBundle { - - public enum BundleType { - /** - * The bundle is a document. The first resource is a Composition. - */ - DOCUMENT, - /** - * The bundle is a message. The first resource is a MessageHeader. - */ - MESSAGE, - /** - * The bundle is a transaction - intended to be processed by a server as an atomic commit. - */ - TRANSACTION, - /** - * The bundle is a transaction response. - */ - TRANSACTIONRESPONSE, - /** - * The bundle is a list of resources from a _history interaction on a server. - */ - HISTORY, - /** - * The bundle is a list of resources returned as a result of a search/query interaction, operation, or message. - */ - SEARCHSET, - /** - * The bundle is a set of resources collected into a single document for ease of distribution. - */ - COLLECTION, - /** - * added to help the parsers - */ - NULL; - public static BundleType fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("document".equals(codeString)) - return DOCUMENT; - if ("message".equals(codeString)) - return MESSAGE; - if ("transaction".equals(codeString)) - return TRANSACTION; - if ("transaction-response".equals(codeString)) - return TRANSACTIONRESPONSE; - if ("history".equals(codeString)) - return HISTORY; - if ("searchset".equals(codeString)) - return SEARCHSET; - if ("collection".equals(codeString)) - return COLLECTION; - throw new Exception("Unknown BundleType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case DOCUMENT: return "document"; - case MESSAGE: return "message"; - case TRANSACTION: return "transaction"; - case TRANSACTIONRESPONSE: return "transaction-response"; - case HISTORY: return "history"; - case SEARCHSET: return "searchset"; - case COLLECTION: return "collection"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DOCUMENT: return ""; - case MESSAGE: return ""; - case TRANSACTION: return ""; - case TRANSACTIONRESPONSE: return ""; - case HISTORY: return ""; - case SEARCHSET: return ""; - case COLLECTION: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DOCUMENT: return "The bundle is a document. The first resource is a Composition."; - case MESSAGE: return "The bundle is a message. The first resource is a MessageHeader."; - case TRANSACTION: return "The bundle is a transaction - intended to be processed by a server as an atomic commit."; - case TRANSACTIONRESPONSE: return "The bundle is a transaction response."; - case HISTORY: return "The bundle is a list of resources from a _history interaction on a server."; - case SEARCHSET: return "The bundle is a list of resources returned as a result of a search/query interaction, operation, or message."; - case COLLECTION: return "The bundle is a set of resources collected into a single document for ease of distribution."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DOCUMENT: return "Document"; - case MESSAGE: return "Message"; - case TRANSACTION: return "Transaction"; - case TRANSACTIONRESPONSE: return "Transaction Response"; - case HISTORY: return "History List"; - case SEARCHSET: return "Search Results"; - case COLLECTION: return "Collection"; - default: return "?"; - } - } - } - - public static class BundleTypeEnumFactory implements EnumFactory { - public BundleType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("document".equals(codeString)) - return BundleType.DOCUMENT; - if ("message".equals(codeString)) - return BundleType.MESSAGE; - if ("transaction".equals(codeString)) - return BundleType.TRANSACTION; - if ("transaction-response".equals(codeString)) - return BundleType.TRANSACTIONRESPONSE; - if ("history".equals(codeString)) - return BundleType.HISTORY; - if ("searchset".equals(codeString)) - return BundleType.SEARCHSET; - if ("collection".equals(codeString)) - return BundleType.COLLECTION; - throw new IllegalArgumentException("Unknown BundleType code '"+codeString+"'"); - } - public String toCode(BundleType code) { - if (code == BundleType.DOCUMENT) - return "document"; - if (code == BundleType.MESSAGE) - return "message"; - if (code == BundleType.TRANSACTION) - return "transaction"; - if (code == BundleType.TRANSACTIONRESPONSE) - return "transaction-response"; - if (code == BundleType.HISTORY) - return "history"; - if (code == BundleType.SEARCHSET) - return "searchset"; - if (code == BundleType.COLLECTION) - return "collection"; - return "?"; - } - } - - public enum SearchEntryMode { - /** - * This resource matched the search specification. - */ - MATCH, - /** - * This resource is returned because it is referred to from another resource in the search set. - */ - INCLUDE, - /** - * added to help the parsers - */ - NULL; - public static SearchEntryMode fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("match".equals(codeString)) - return MATCH; - if ("include".equals(codeString)) - return INCLUDE; - throw new Exception("Unknown SearchEntryMode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case MATCH: return "match"; - case INCLUDE: return "include"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MATCH: return ""; - case INCLUDE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MATCH: return "This resource matched the search specification."; - case INCLUDE: return "This resource is returned because it is referred to from another resource in the search set."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MATCH: return "match"; - case INCLUDE: return "include"; - default: return "?"; - } - } - } - - public static class SearchEntryModeEnumFactory implements EnumFactory { - public SearchEntryMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("match".equals(codeString)) - return SearchEntryMode.MATCH; - if ("include".equals(codeString)) - return SearchEntryMode.INCLUDE; - throw new IllegalArgumentException("Unknown SearchEntryMode code '"+codeString+"'"); - } - public String toCode(SearchEntryMode code) { - if (code == SearchEntryMode.MATCH) - return "match"; - if (code == SearchEntryMode.INCLUDE) - return "include"; - return "?"; - } - } - - public enum HttpVerb { - /** - * HTTP GET. - */ - GET, - /** - * HTTP POST. - */ - POST, - /** - * HTTP PUT. - */ - PUT, - /** - * HTTP DELETE. - */ - DELETE, - /** - * added to help the parsers - */ - NULL; - public static HttpVerb fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("GET".equals(codeString)) - return GET; - if ("POST".equals(codeString)) - return POST; - if ("PUT".equals(codeString)) - return PUT; - if ("DELETE".equals(codeString)) - return DELETE; - throw new Exception("Unknown HttpVerb code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case GET: return "GET"; - case POST: return "POST"; - case PUT: return "PUT"; - case DELETE: return "DELETE"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case GET: return ""; - case POST: return ""; - case PUT: return ""; - case DELETE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case GET: return "HTTP GET."; - case POST: return "HTTP POST."; - case PUT: return "HTTP PUT."; - case DELETE: return "HTTP DELETE."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case GET: return "GET"; - case POST: return "POST"; - case PUT: return "PUT"; - case DELETE: return "DELETE"; - default: return "?"; - } - } - } - - public static class HttpVerbEnumFactory implements EnumFactory { - public HttpVerb fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("GET".equals(codeString)) - return HttpVerb.GET; - if ("POST".equals(codeString)) - return HttpVerb.POST; - if ("PUT".equals(codeString)) - return HttpVerb.PUT; - if ("DELETE".equals(codeString)) - return HttpVerb.DELETE; - throw new IllegalArgumentException("Unknown HttpVerb code '"+codeString+"'"); - } - public String toCode(HttpVerb code) { - if (code == HttpVerb.GET) - return "GET"; - if (code == HttpVerb.POST) - return "POST"; - if (code == HttpVerb.PUT) - return "PUT"; - if (code == HttpVerb.DELETE) - return "DELETE"; - return "?"; - } - } - - @Block() - public static class BundleLinkComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. - */ - @Child(name = "relation", type = {StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="http://www.iana.org/assignments/link-relations/link-relations.xhtml", formalDefinition="A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]." ) - protected StringType relation; - - /** - * The reference details for the link. - */ - @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Reference details for the link", formalDefinition="The reference details for the link." ) - protected UriType url; - - private static final long serialVersionUID = -1010386066L; - - /* - * Constructor - */ - public BundleLinkComponent() { - super(); - } - - /* - * Constructor - */ - public BundleLinkComponent(StringType relation, UriType url) { - super(); - this.relation = relation; - this.url = url; - } - - /** - * @return {@link #relation} (A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].). This is the underlying object with id, value and extensions. The accessor "getRelation" gives direct access to the value - */ - public StringType getRelationElement() { - if (this.relation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleLinkComponent.relation"); - else if (Configuration.doAutoCreate()) - this.relation = new StringType(); // bb - return this.relation; - } - - public boolean hasRelationElement() { - return this.relation != null && !this.relation.isEmpty(); - } - - public boolean hasRelation() { - return this.relation != null && !this.relation.isEmpty(); - } - - /** - * @param value {@link #relation} (A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].). This is the underlying object with id, value and extensions. The accessor "getRelation" gives direct access to the value - */ - public BundleLinkComponent setRelationElement(StringType value) { - this.relation = value; - return this; - } - - /** - * @return A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. - */ - public String getRelation() { - return this.relation == null ? null : this.relation.getValue(); - } - - /** - * @param value A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. - */ - public BundleLinkComponent setRelation(String value) { - if (this.relation == null) - this.relation = new StringType(); - this.relation.setValue(value); - return this; - } - - /** - * @return {@link #url} (The reference details for the link.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleLinkComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (The reference details for the link.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public BundleLinkComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return The reference details for the link. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value The reference details for the link. - */ - public BundleLinkComponent setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("relation", "string", "A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].", 0, java.lang.Integer.MAX_VALUE, relation)); - childrenList.add(new Property("url", "uri", "The reference details for the link.", 0, java.lang.Integer.MAX_VALUE, url)); - } - - public BundleLinkComponent copy() { - BundleLinkComponent dst = new BundleLinkComponent(); - copyValues(dst); - dst.relation = relation == null ? null : relation.copy(); - dst.url = url == null ? null : url.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof BundleLinkComponent)) - return false; - BundleLinkComponent o = (BundleLinkComponent) other; - return compareDeep(relation, o.relation, true) && compareDeep(url, o.url, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof BundleLinkComponent)) - return false; - BundleLinkComponent o = (BundleLinkComponent) other; - return compareValues(relation, o.relation, true) && compareValues(url, o.url, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (relation == null || relation.isEmpty()) && (url == null || url.isEmpty()) - ; - } - - } - - @Block() - public static class BundleEntryComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The Base URL for the resource, if different to the base URL specified for the bundle as a whole. - */ - @Child(name = "base", type = {UriType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Base URL, if different to bundle base", formalDefinition="The Base URL for the resource, if different to the base URL specified for the bundle as a whole." ) - protected UriType base; - - /** - * A series of links that provide context to this entry. - */ - @Child(name = "link", type = {BundleLinkComponent.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Links related to this entry", formalDefinition="A series of links that provide context to this entry." ) - protected List link; - - /** - * The Resources for the entry. - */ - @Child(name = "resource", type = {Resource.class}, order=3, min=0, max=1) - @Description(shortDefinition="Resources in this bundle", formalDefinition="The Resources for the entry." ) - protected Resource resource; - - /** - * Information about the search process that lead to the creation of this entry. - */ - @Child(name = "search", type = {}, order=4, min=0, max=1) - @Description(shortDefinition="Search related information", formalDefinition="Information about the search process that lead to the creation of this entry." ) - protected BundleEntrySearchComponent search; - - /** - * Additional information about how this entry should be processed as part of a transaction. - */ - @Child(name = "transaction", type = {}, order=5, min=0, max=1) - @Description(shortDefinition="Transaction Related Information", formalDefinition="Additional information about how this entry should be processed as part of a transaction." ) - protected BundleEntryTransactionComponent transaction; - - /** - * Additional information about how this entry should be processed as part of a transaction. - */ - @Child(name = "transactionResponse", type = {}, order=6, min=0, max=1) - @Description(shortDefinition="Transaction Related Information", formalDefinition="Additional information about how this entry should be processed as part of a transaction." ) - protected BundleEntryTransactionResponseComponent transactionResponse; - - private static final long serialVersionUID = -1846898377L; - - /* - * Constructor - */ - public BundleEntryComponent() { - super(); - } - - /** - * @return {@link #base} (The Base URL for the resource, if different to the base URL specified for the bundle as a whole.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public UriType getBaseElement() { - if (this.base == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryComponent.base"); - else if (Configuration.doAutoCreate()) - this.base = new UriType(); // bb - return this.base; - } - - public boolean hasBaseElement() { - return this.base != null && !this.base.isEmpty(); - } - - public boolean hasBase() { - return this.base != null && !this.base.isEmpty(); - } - - /** - * @param value {@link #base} (The Base URL for the resource, if different to the base URL specified for the bundle as a whole.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public BundleEntryComponent setBaseElement(UriType value) { - this.base = value; - return this; - } - - /** - * @return The Base URL for the resource, if different to the base URL specified for the bundle as a whole. - */ - public String getBase() { - return this.base == null ? null : this.base.getValue(); - } - - /** - * @param value The Base URL for the resource, if different to the base URL specified for the bundle as a whole. - */ - public BundleEntryComponent setBase(String value) { - if (Utilities.noString(value)) - this.base = null; - else { - if (this.base == null) - this.base = new UriType(); - this.base.setValue(value); - } - return this; - } - - /** - * @return {@link #link} (A series of links that provide context to this entry.) - */ - public List getLink() { - if (this.link == null) - this.link = new ArrayList(); - return this.link; - } - - public boolean hasLink() { - if (this.link == null) - return false; - for (BundleLinkComponent item : this.link) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #link} (A series of links that provide context to this entry.) - */ - // syntactic sugar - public BundleLinkComponent addLink() { //3 - BundleLinkComponent t = new BundleLinkComponent(); - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return t; - } - - // syntactic sugar - public BundleEntryComponent addLink(BundleLinkComponent t) { //3 - if (t == null) - return this; - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return this; - } - - /** - * @return {@link #resource} (The Resources for the entry.) - */ - public Resource getResource() { - return this.resource; - } - - public boolean hasResource() { - return this.resource != null && !this.resource.isEmpty(); - } - - /** - * @param value {@link #resource} (The Resources for the entry.) - */ - public BundleEntryComponent setResource(Resource value) { - this.resource = value; - return this; - } - - /** - * @return {@link #search} (Information about the search process that lead to the creation of this entry.) - */ - public BundleEntrySearchComponent getSearch() { - if (this.search == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryComponent.search"); - else if (Configuration.doAutoCreate()) - this.search = new BundleEntrySearchComponent(); // cc - return this.search; - } - - public boolean hasSearch() { - return this.search != null && !this.search.isEmpty(); - } - - /** - * @param value {@link #search} (Information about the search process that lead to the creation of this entry.) - */ - public BundleEntryComponent setSearch(BundleEntrySearchComponent value) { - this.search = value; - return this; - } - - /** - * @return {@link #transaction} (Additional information about how this entry should be processed as part of a transaction.) - */ - public BundleEntryTransactionComponent getTransaction() { - if (this.transaction == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryComponent.transaction"); - else if (Configuration.doAutoCreate()) - this.transaction = new BundleEntryTransactionComponent(); // cc - return this.transaction; - } - - public boolean hasTransaction() { - return this.transaction != null && !this.transaction.isEmpty(); - } - - /** - * @param value {@link #transaction} (Additional information about how this entry should be processed as part of a transaction.) - */ - public BundleEntryComponent setTransaction(BundleEntryTransactionComponent value) { - this.transaction = value; - return this; - } - - /** - * @return {@link #transactionResponse} (Additional information about how this entry should be processed as part of a transaction.) - */ - public BundleEntryTransactionResponseComponent getTransactionResponse() { - if (this.transactionResponse == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryComponent.transactionResponse"); - else if (Configuration.doAutoCreate()) - this.transactionResponse = new BundleEntryTransactionResponseComponent(); // cc - return this.transactionResponse; - } - - public boolean hasTransactionResponse() { - return this.transactionResponse != null && !this.transactionResponse.isEmpty(); - } - - /** - * @param value {@link #transactionResponse} (Additional information about how this entry should be processed as part of a transaction.) - */ - public BundleEntryComponent setTransactionResponse(BundleEntryTransactionResponseComponent value) { - this.transactionResponse = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("base", "uri", "The Base URL for the resource, if different to the base URL specified for the bundle as a whole.", 0, java.lang.Integer.MAX_VALUE, base)); - childrenList.add(new Property("link", "@Bundle.link", "A series of links that provide context to this entry.", 0, java.lang.Integer.MAX_VALUE, link)); - childrenList.add(new Property("resource", "Resource", "The Resources for the entry.", 0, java.lang.Integer.MAX_VALUE, resource)); - childrenList.add(new Property("search", "", "Information about the search process that lead to the creation of this entry.", 0, java.lang.Integer.MAX_VALUE, search)); - childrenList.add(new Property("transaction", "", "Additional information about how this entry should be processed as part of a transaction.", 0, java.lang.Integer.MAX_VALUE, transaction)); - childrenList.add(new Property("transactionResponse", "", "Additional information about how this entry should be processed as part of a transaction.", 0, java.lang.Integer.MAX_VALUE, transactionResponse)); - } - - public BundleEntryComponent copy() { - BundleEntryComponent dst = new BundleEntryComponent(); - copyValues(dst); - dst.base = base == null ? null : base.copy(); - if (link != null) { - dst.link = new ArrayList(); - for (BundleLinkComponent i : link) - dst.link.add(i.copy()); - }; - dst.resource = resource == null ? null : resource.copy(); - dst.search = search == null ? null : search.copy(); - dst.transaction = transaction == null ? null : transaction.copy(); - dst.transactionResponse = transactionResponse == null ? null : transactionResponse.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof BundleEntryComponent)) - return false; - BundleEntryComponent o = (BundleEntryComponent) other; - return compareDeep(base, o.base, true) && compareDeep(link, o.link, true) && compareDeep(resource, o.resource, true) - && compareDeep(search, o.search, true) && compareDeep(transaction, o.transaction, true) && compareDeep(transactionResponse, o.transactionResponse, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof BundleEntryComponent)) - return false; - BundleEntryComponent o = (BundleEntryComponent) other; - return compareValues(base, o.base, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (base == null || base.isEmpty()) && (link == null || link.isEmpty()) - && (resource == null || resource.isEmpty()) && (search == null || search.isEmpty()) && (transaction == null || transaction.isEmpty()) - && (transactionResponse == null || transactionResponse.isEmpty()); - } - - } - - @Block() - public static class BundleEntrySearchComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Why this entry is in the result set - whether it's included as a match or because of an _include requirement. - */ - @Child(name = "mode", type = {CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="match | include - why this is in the result set", formalDefinition="Why this entry is in the result set - whether it's included as a match or because of an _include requirement." ) - protected Enumeration mode; - - /** - * When searching, the server's search ranking score for the entry. - */ - @Child(name = "score", type = {DecimalType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Search ranking (between 0 and 1)", formalDefinition="When searching, the server's search ranking score for the entry." ) - protected DecimalType score; - - private static final long serialVersionUID = 837739866L; - - /* - * Constructor - */ - public BundleEntrySearchComponent() { - super(); - } - - /** - * @return {@link #mode} (Why this entry is in the result set - whether it's included as a match or because of an _include requirement.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Enumeration getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntrySearchComponent.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(new SearchEntryModeEnumFactory()); // bb - return this.mode; - } - - public boolean hasModeElement() { - return this.mode != null && !this.mode.isEmpty(); - } - - public boolean hasMode() { - return this.mode != null && !this.mode.isEmpty(); - } - - /** - * @param value {@link #mode} (Why this entry is in the result set - whether it's included as a match or because of an _include requirement.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public BundleEntrySearchComponent setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return Why this entry is in the result set - whether it's included as a match or because of an _include requirement. - */ - public SearchEntryMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value Why this entry is in the result set - whether it's included as a match or because of an _include requirement. - */ - public BundleEntrySearchComponent setMode(SearchEntryMode value) { - if (value == null) - this.mode = null; - else { - if (this.mode == null) - this.mode = new Enumeration(new SearchEntryModeEnumFactory()); - this.mode.setValue(value); - } - return this; - } - - /** - * @return {@link #score} (When searching, the server's search ranking score for the entry.). This is the underlying object with id, value and extensions. The accessor "getScore" gives direct access to the value - */ - public DecimalType getScoreElement() { - if (this.score == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntrySearchComponent.score"); - else if (Configuration.doAutoCreate()) - this.score = new DecimalType(); // bb - return this.score; - } - - public boolean hasScoreElement() { - return this.score != null && !this.score.isEmpty(); - } - - public boolean hasScore() { - return this.score != null && !this.score.isEmpty(); - } - - /** - * @param value {@link #score} (When searching, the server's search ranking score for the entry.). This is the underlying object with id, value and extensions. The accessor "getScore" gives direct access to the value - */ - public BundleEntrySearchComponent setScoreElement(DecimalType value) { - this.score = value; - return this; - } - - /** - * @return When searching, the server's search ranking score for the entry. - */ - public BigDecimal getScore() { - return this.score == null ? null : this.score.getValue(); - } - - /** - * @param value When searching, the server's search ranking score for the entry. - */ - public BundleEntrySearchComponent setScore(BigDecimal value) { - if (value == null) - this.score = null; - else { - if (this.score == null) - this.score = new DecimalType(); - this.score.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("mode", "code", "Why this entry is in the result set - whether it's included as a match or because of an _include requirement.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("score", "decimal", "When searching, the server's search ranking score for the entry.", 0, java.lang.Integer.MAX_VALUE, score)); - } - - public BundleEntrySearchComponent copy() { - BundleEntrySearchComponent dst = new BundleEntrySearchComponent(); - copyValues(dst); - dst.mode = mode == null ? null : mode.copy(); - dst.score = score == null ? null : score.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof BundleEntrySearchComponent)) - return false; - BundleEntrySearchComponent o = (BundleEntrySearchComponent) other; - return compareDeep(mode, o.mode, true) && compareDeep(score, o.score, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof BundleEntrySearchComponent)) - return false; - BundleEntrySearchComponent o = (BundleEntrySearchComponent) other; - return compareValues(mode, o.mode, true) && compareValues(score, o.score, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (mode == null || mode.isEmpty()) && (score == null || score.isEmpty()) - ; - } - - } - - @Block() - public static class BundleEntryTransactionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The HTTP verb for this entry in either a update history, or a transaction/ transaction response. - */ - @Child(name = "method", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="GET | POST | PUT | DELETE", formalDefinition="The HTTP verb for this entry in either a update history, or a transaction/ transaction response." ) - protected Enumeration method; - - /** - * A search URL for this resource that specifies how the resource is matched to an existing resource when processing a transaction (see transaction documentation). - */ - @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1) - @Description(shortDefinition="The URL for the transaction", formalDefinition="A search URL for this resource that specifies how the resource is matched to an existing resource when processing a transaction (see transaction documentation)." ) - protected UriType url; - - /** - * If the ETag values match, return a 304 Not modified status. See the read/vread interaction documentation. - */ - @Child(name = "ifNoneMatch", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="For managing cache currency", formalDefinition="If the ETag values match, return a 304 Not modified status. See the read/vread interaction documentation." ) - protected StringType ifNoneMatch; - - /** - * Only perform the operation if the Etag value matches. For more information, see the API section "Managing Resource Contention". - */ - @Child(name = "ifMatch", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="For managing update contention", formalDefinition="Only perform the operation if the Etag value matches. For more information, see the API section 'Managing Resource Contention'." ) - protected StringType ifMatch; - - /** - * Only perform the operation if the last updated date matches. For more information, see the API section "Managing Resource Contention". - */ - @Child(name = "ifModifiedSince", type = {InstantType.class}, order=5, min=0, max=1) - @Description(shortDefinition="For managing update contention", formalDefinition="Only perform the operation if the last updated date matches. For more information, see the API section 'Managing Resource Contention'." ) - protected InstantType ifModifiedSince; - - /** - * Instruct the server not to perform the create if a specified resource already exists. For further information, see "Conditional Create". - */ - @Child(name = "ifNoneExist", type = {StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="For conditional creates", formalDefinition="Instruct the server not to perform the create if a specified resource already exists. For further information, see 'Conditional Create'." ) - protected StringType ifNoneExist; - - private static final long serialVersionUID = -769185862L; - - /* - * Constructor - */ - public BundleEntryTransactionComponent() { - super(); - } - - /* - * Constructor - */ - public BundleEntryTransactionComponent(Enumeration method, UriType url) { - super(); - this.method = method; - this.url = url; - } - - /** - * @return {@link #method} (The HTTP verb for this entry in either a update history, or a transaction/ transaction response.). This is the underlying object with id, value and extensions. The accessor "getMethod" gives direct access to the value - */ - public Enumeration getMethodElement() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryTransactionComponent.method"); - else if (Configuration.doAutoCreate()) - this.method = new Enumeration(new HttpVerbEnumFactory()); // bb - return this.method; - } - - public boolean hasMethodElement() { - return this.method != null && !this.method.isEmpty(); - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** - * @param value {@link #method} (The HTTP verb for this entry in either a update history, or a transaction/ transaction response.). This is the underlying object with id, value and extensions. The accessor "getMethod" gives direct access to the value - */ - public BundleEntryTransactionComponent setMethodElement(Enumeration value) { - this.method = value; - return this; - } - - /** - * @return The HTTP verb for this entry in either a update history, or a transaction/ transaction response. - */ - public HttpVerb getMethod() { - return this.method == null ? null : this.method.getValue(); - } - - /** - * @param value The HTTP verb for this entry in either a update history, or a transaction/ transaction response. - */ - public BundleEntryTransactionComponent setMethod(HttpVerb value) { - if (this.method == null) - this.method = new Enumeration(new HttpVerbEnumFactory()); - this.method.setValue(value); - return this; - } - - /** - * @return {@link #url} (A search URL for this resource that specifies how the resource is matched to an existing resource when processing a transaction (see transaction documentation).). 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 BundleEntryTransactionComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (A search URL for this resource that specifies how the resource is matched to an existing resource when processing a transaction (see transaction documentation).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public BundleEntryTransactionComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return A search URL for this resource that specifies how the resource is matched to an existing resource when processing a transaction (see transaction documentation). - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value A search URL for this resource that specifies how the resource is matched to an existing resource when processing a transaction (see transaction documentation). - */ - public BundleEntryTransactionComponent setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - /** - * @return {@link #ifNoneMatch} (If the ETag values match, return a 304 Not modified status. See the read/vread interaction documentation.). This is the underlying object with id, value and extensions. The accessor "getIfNoneMatch" gives direct access to the value - */ - public StringType getIfNoneMatchElement() { - if (this.ifNoneMatch == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryTransactionComponent.ifNoneMatch"); - else if (Configuration.doAutoCreate()) - this.ifNoneMatch = new StringType(); // bb - return this.ifNoneMatch; - } - - public boolean hasIfNoneMatchElement() { - return this.ifNoneMatch != null && !this.ifNoneMatch.isEmpty(); - } - - public boolean hasIfNoneMatch() { - return this.ifNoneMatch != null && !this.ifNoneMatch.isEmpty(); - } - - /** - * @param value {@link #ifNoneMatch} (If the ETag values match, return a 304 Not modified status. See the read/vread interaction documentation.). This is the underlying object with id, value and extensions. The accessor "getIfNoneMatch" gives direct access to the value - */ - public BundleEntryTransactionComponent setIfNoneMatchElement(StringType value) { - this.ifNoneMatch = value; - return this; - } - - /** - * @return If the ETag values match, return a 304 Not modified status. See the read/vread interaction documentation. - */ - public String getIfNoneMatch() { - return this.ifNoneMatch == null ? null : this.ifNoneMatch.getValue(); - } - - /** - * @param value If the ETag values match, return a 304 Not modified status. See the read/vread interaction documentation. - */ - public BundleEntryTransactionComponent setIfNoneMatch(String value) { - if (Utilities.noString(value)) - this.ifNoneMatch = null; - else { - if (this.ifNoneMatch == null) - this.ifNoneMatch = new StringType(); - this.ifNoneMatch.setValue(value); - } - return this; - } - - /** - * @return {@link #ifMatch} (Only perform the operation if the Etag value matches. For more information, see the API section "Managing Resource Contention".). This is the underlying object with id, value and extensions. The accessor "getIfMatch" gives direct access to the value - */ - public StringType getIfMatchElement() { - if (this.ifMatch == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryTransactionComponent.ifMatch"); - else if (Configuration.doAutoCreate()) - this.ifMatch = new StringType(); // bb - return this.ifMatch; - } - - public boolean hasIfMatchElement() { - return this.ifMatch != null && !this.ifMatch.isEmpty(); - } - - public boolean hasIfMatch() { - return this.ifMatch != null && !this.ifMatch.isEmpty(); - } - - /** - * @param value {@link #ifMatch} (Only perform the operation if the Etag value matches. For more information, see the API section "Managing Resource Contention".). This is the underlying object with id, value and extensions. The accessor "getIfMatch" gives direct access to the value - */ - public BundleEntryTransactionComponent setIfMatchElement(StringType value) { - this.ifMatch = value; - return this; - } - - /** - * @return Only perform the operation if the Etag value matches. For more information, see the API section "Managing Resource Contention". - */ - public String getIfMatch() { - return this.ifMatch == null ? null : this.ifMatch.getValue(); - } - - /** - * @param value Only perform the operation if the Etag value matches. For more information, see the API section "Managing Resource Contention". - */ - public BundleEntryTransactionComponent setIfMatch(String value) { - if (Utilities.noString(value)) - this.ifMatch = null; - else { - if (this.ifMatch == null) - this.ifMatch = new StringType(); - this.ifMatch.setValue(value); - } - return this; - } - - /** - * @return {@link #ifModifiedSince} (Only perform the operation if the last updated date matches. For more information, see the API section "Managing Resource Contention".). This is the underlying object with id, value and extensions. The accessor "getIfModifiedSince" gives direct access to the value - */ - public InstantType getIfModifiedSinceElement() { - if (this.ifModifiedSince == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryTransactionComponent.ifModifiedSince"); - else if (Configuration.doAutoCreate()) - this.ifModifiedSince = new InstantType(); // bb - return this.ifModifiedSince; - } - - public boolean hasIfModifiedSinceElement() { - return this.ifModifiedSince != null && !this.ifModifiedSince.isEmpty(); - } - - public boolean hasIfModifiedSince() { - return this.ifModifiedSince != null && !this.ifModifiedSince.isEmpty(); - } - - /** - * @param value {@link #ifModifiedSince} (Only perform the operation if the last updated date matches. For more information, see the API section "Managing Resource Contention".). This is the underlying object with id, value and extensions. The accessor "getIfModifiedSince" gives direct access to the value - */ - public BundleEntryTransactionComponent setIfModifiedSinceElement(InstantType value) { - this.ifModifiedSince = value; - return this; - } - - /** - * @return Only perform the operation if the last updated date matches. For more information, see the API section "Managing Resource Contention". - */ - public Date getIfModifiedSince() { - return this.ifModifiedSince == null ? null : this.ifModifiedSince.getValue(); - } - - /** - * @param value Only perform the operation if the last updated date matches. For more information, see the API section "Managing Resource Contention". - */ - public BundleEntryTransactionComponent setIfModifiedSince(Date value) { - if (value == null) - this.ifModifiedSince = null; - else { - if (this.ifModifiedSince == null) - this.ifModifiedSince = new InstantType(); - this.ifModifiedSince.setValue(value); - } - return this; - } - - /** - * @return {@link #ifNoneExist} (Instruct the server not to perform the create if a specified resource already exists. For further information, see "Conditional Create".). This is the underlying object with id, value and extensions. The accessor "getIfNoneExist" gives direct access to the value - */ - public StringType getIfNoneExistElement() { - if (this.ifNoneExist == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryTransactionComponent.ifNoneExist"); - else if (Configuration.doAutoCreate()) - this.ifNoneExist = new StringType(); // bb - return this.ifNoneExist; - } - - public boolean hasIfNoneExistElement() { - return this.ifNoneExist != null && !this.ifNoneExist.isEmpty(); - } - - public boolean hasIfNoneExist() { - return this.ifNoneExist != null && !this.ifNoneExist.isEmpty(); - } - - /** - * @param value {@link #ifNoneExist} (Instruct the server not to perform the create if a specified resource already exists. For further information, see "Conditional Create".). This is the underlying object with id, value and extensions. The accessor "getIfNoneExist" gives direct access to the value - */ - public BundleEntryTransactionComponent setIfNoneExistElement(StringType value) { - this.ifNoneExist = value; - return this; - } - - /** - * @return Instruct the server not to perform the create if a specified resource already exists. For further information, see "Conditional Create". - */ - public String getIfNoneExist() { - return this.ifNoneExist == null ? null : this.ifNoneExist.getValue(); - } - - /** - * @param value Instruct the server not to perform the create if a specified resource already exists. For further information, see "Conditional Create". - */ - public BundleEntryTransactionComponent setIfNoneExist(String value) { - if (Utilities.noString(value)) - this.ifNoneExist = null; - else { - if (this.ifNoneExist == null) - this.ifNoneExist = new StringType(); - this.ifNoneExist.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("method", "code", "The HTTP verb for this entry in either a update history, or a transaction/ transaction response.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("url", "uri", "A search URL for this resource that specifies how the resource is matched to an existing resource when processing a transaction (see transaction documentation).", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("ifNoneMatch", "string", "If the ETag values match, return a 304 Not modified status. See the read/vread interaction documentation.", 0, java.lang.Integer.MAX_VALUE, ifNoneMatch)); - childrenList.add(new Property("ifMatch", "string", "Only perform the operation if the Etag value matches. For more information, see the API section 'Managing Resource Contention'.", 0, java.lang.Integer.MAX_VALUE, ifMatch)); - childrenList.add(new Property("ifModifiedSince", "instant", "Only perform the operation if the last updated date matches. For more information, see the API section 'Managing Resource Contention'.", 0, java.lang.Integer.MAX_VALUE, ifModifiedSince)); - childrenList.add(new Property("ifNoneExist", "string", "Instruct the server not to perform the create if a specified resource already exists. For further information, see 'Conditional Create'.", 0, java.lang.Integer.MAX_VALUE, ifNoneExist)); - } - - public BundleEntryTransactionComponent copy() { - BundleEntryTransactionComponent dst = new BundleEntryTransactionComponent(); - copyValues(dst); - dst.method = method == null ? null : method.copy(); - dst.url = url == null ? null : url.copy(); - dst.ifNoneMatch = ifNoneMatch == null ? null : ifNoneMatch.copy(); - dst.ifMatch = ifMatch == null ? null : ifMatch.copy(); - dst.ifModifiedSince = ifModifiedSince == null ? null : ifModifiedSince.copy(); - dst.ifNoneExist = ifNoneExist == null ? null : ifNoneExist.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof BundleEntryTransactionComponent)) - return false; - BundleEntryTransactionComponent o = (BundleEntryTransactionComponent) other; - return compareDeep(method, o.method, true) && compareDeep(url, o.url, true) && compareDeep(ifNoneMatch, o.ifNoneMatch, true) - && compareDeep(ifMatch, o.ifMatch, true) && compareDeep(ifModifiedSince, o.ifModifiedSince, true) - && compareDeep(ifNoneExist, o.ifNoneExist, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof BundleEntryTransactionComponent)) - return false; - BundleEntryTransactionComponent o = (BundleEntryTransactionComponent) other; - return compareValues(method, o.method, true) && compareValues(url, o.url, true) && compareValues(ifNoneMatch, o.ifNoneMatch, true) - && compareValues(ifMatch, o.ifMatch, true) && compareValues(ifModifiedSince, o.ifModifiedSince, true) - && compareValues(ifNoneExist, o.ifNoneExist, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (method == null || method.isEmpty()) && (url == null || url.isEmpty()) - && (ifNoneMatch == null || ifNoneMatch.isEmpty()) && (ifMatch == null || ifMatch.isEmpty()) - && (ifModifiedSince == null || ifModifiedSince.isEmpty()) && (ifNoneExist == null || ifNoneExist.isEmpty()) - ; - } - - } - - @Block() - public static class BundleEntryTransactionResponseComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The status code returned by processing this entry. - */ - @Child(name = "status", type = {StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Status return code for entry", formalDefinition="The status code returned by processing this entry." ) - protected StringType status; - - /** - * The location header created by processing this operation. - */ - @Child(name = "location", type = {UriType.class}, order=2, min=0, max=1) - @Description(shortDefinition="The location, if the operation returns a location", formalDefinition="The location header created by processing this operation." ) - protected UriType location; - - /** - * The etag for the resource, it the operation for the entry produced a versioned resource. - */ - @Child(name = "etag", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="The etag for the resource (if relevant)", formalDefinition="The etag for the resource, it the operation for the entry produced a versioned resource." ) - protected StringType etag; - - /** - * The date/time that the resource was modified on the server. - */ - @Child(name = "lastModified", type = {InstantType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Server's date time modified", formalDefinition="The date/time that the resource was modified on the server." ) - protected InstantType lastModified; - - private static final long serialVersionUID = -1526413234L; - - /* - * Constructor - */ - public BundleEntryTransactionResponseComponent() { - super(); - } - - /* - * Constructor - */ - public BundleEntryTransactionResponseComponent(StringType status) { - super(); - this.status = status; - } - - /** - * @return {@link #status} (The status code returned by processing this entry.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public StringType getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryTransactionResponseComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new StringType(); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status code returned by processing this entry.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public BundleEntryTransactionResponseComponent setStatusElement(StringType value) { - this.status = value; - return this; - } - - /** - * @return The status code returned by processing this entry. - */ - public String getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status code returned by processing this entry. - */ - public BundleEntryTransactionResponseComponent setStatus(String value) { - if (this.status == null) - this.status = new StringType(); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #location} (The location header created by processing this operation.). This is the underlying object with id, value and extensions. The accessor "getLocation" gives direct access to the value - */ - public UriType getLocationElement() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryTransactionResponseComponent.location"); - else if (Configuration.doAutoCreate()) - this.location = new UriType(); // bb - return this.location; - } - - public boolean hasLocationElement() { - return this.location != null && !this.location.isEmpty(); - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (The location header created by processing this operation.). This is the underlying object with id, value and extensions. The accessor "getLocation" gives direct access to the value - */ - public BundleEntryTransactionResponseComponent setLocationElement(UriType value) { - this.location = value; - return this; - } - - /** - * @return The location header created by processing this operation. - */ - public String getLocation() { - return this.location == null ? null : this.location.getValue(); - } - - /** - * @param value The location header created by processing this operation. - */ - public BundleEntryTransactionResponseComponent setLocation(String value) { - if (Utilities.noString(value)) - this.location = null; - else { - if (this.location == null) - this.location = new UriType(); - this.location.setValue(value); - } - return this; - } - - /** - * @return {@link #etag} (The etag for the resource, it the operation for the entry produced a versioned resource.). This is the underlying object with id, value and extensions. The accessor "getEtag" gives direct access to the value - */ - public StringType getEtagElement() { - if (this.etag == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryTransactionResponseComponent.etag"); - else if (Configuration.doAutoCreate()) - this.etag = new StringType(); // bb - return this.etag; - } - - public boolean hasEtagElement() { - return this.etag != null && !this.etag.isEmpty(); - } - - public boolean hasEtag() { - return this.etag != null && !this.etag.isEmpty(); - } - - /** - * @param value {@link #etag} (The etag for the resource, it the operation for the entry produced a versioned resource.). This is the underlying object with id, value and extensions. The accessor "getEtag" gives direct access to the value - */ - public BundleEntryTransactionResponseComponent setEtagElement(StringType value) { - this.etag = value; - return this; - } - - /** - * @return The etag for the resource, it the operation for the entry produced a versioned resource. - */ - public String getEtag() { - return this.etag == null ? null : this.etag.getValue(); - } - - /** - * @param value The etag for the resource, it the operation for the entry produced a versioned resource. - */ - public BundleEntryTransactionResponseComponent setEtag(String value) { - if (Utilities.noString(value)) - this.etag = null; - else { - if (this.etag == null) - this.etag = new StringType(); - this.etag.setValue(value); - } - return this; - } - - /** - * @return {@link #lastModified} (The date/time that the resource was modified on the server.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value - */ - public InstantType getLastModifiedElement() { - if (this.lastModified == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryTransactionResponseComponent.lastModified"); - else if (Configuration.doAutoCreate()) - this.lastModified = new InstantType(); // bb - return this.lastModified; - } - - public boolean hasLastModifiedElement() { - return this.lastModified != null && !this.lastModified.isEmpty(); - } - - public boolean hasLastModified() { - return this.lastModified != null && !this.lastModified.isEmpty(); - } - - /** - * @param value {@link #lastModified} (The date/time that the resource was modified on the server.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value - */ - public BundleEntryTransactionResponseComponent setLastModifiedElement(InstantType value) { - this.lastModified = value; - return this; - } - - /** - * @return The date/time that the resource was modified on the server. - */ - public Date getLastModified() { - return this.lastModified == null ? null : this.lastModified.getValue(); - } - - /** - * @param value The date/time that the resource was modified on the server. - */ - public BundleEntryTransactionResponseComponent setLastModified(Date value) { - if (value == null) - this.lastModified = null; - else { - if (this.lastModified == null) - this.lastModified = new InstantType(); - this.lastModified.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("status", "string", "The status code returned by processing this entry.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("location", "uri", "The location header created by processing this operation.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("etag", "string", "The etag for the resource, it the operation for the entry produced a versioned resource.", 0, java.lang.Integer.MAX_VALUE, etag)); - childrenList.add(new Property("lastModified", "instant", "The date/time that the resource was modified on the server.", 0, java.lang.Integer.MAX_VALUE, lastModified)); - } - - public BundleEntryTransactionResponseComponent copy() { - BundleEntryTransactionResponseComponent dst = new BundleEntryTransactionResponseComponent(); - copyValues(dst); - dst.status = status == null ? null : status.copy(); - dst.location = location == null ? null : location.copy(); - dst.etag = etag == null ? null : etag.copy(); - dst.lastModified = lastModified == null ? null : lastModified.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof BundleEntryTransactionResponseComponent)) - return false; - BundleEntryTransactionResponseComponent o = (BundleEntryTransactionResponseComponent) other; - return compareDeep(status, o.status, true) && compareDeep(location, o.location, true) && compareDeep(etag, o.etag, true) - && compareDeep(lastModified, o.lastModified, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof BundleEntryTransactionResponseComponent)) - return false; - BundleEntryTransactionResponseComponent o = (BundleEntryTransactionResponseComponent) other; - return compareValues(status, o.status, true) && compareValues(location, o.location, true) && compareValues(etag, o.etag, true) - && compareValues(lastModified, o.lastModified, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (status == null || status.isEmpty()) && (location == null || location.isEmpty()) - && (etag == null || etag.isEmpty()) && (lastModified == null || lastModified.isEmpty()); - } - - } - - /** - * Indicates the purpose of this bundle- how it was intended to be used. - */ - @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1) - @Description(shortDefinition="document | message | transaction | transaction-response | history | searchset | collection", formalDefinition="Indicates the purpose of this bundle- how it was intended to be used." ) - protected Enumeration type; - - /** - * The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base). - */ - @Child(name = "base", type = {UriType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Stated Base URL", formalDefinition="The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base)." ) - protected UriType base; - - /** - * If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). - */ - @Child(name = "total", type = {UnsignedIntType.class}, order=2, min=0, max=1) - @Description(shortDefinition="If search, the total number of matches", formalDefinition="If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)." ) - protected UnsignedIntType total; - - /** - * A series of links that provide context to this bundle. - */ - @Child(name = "link", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Links related to this Bundle", formalDefinition="A series of links that provide context to this bundle." ) - protected List link; - - /** - * An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only). - */ - @Child(name = "entry", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Entry in the bundle - will have a resource, or information", formalDefinition="An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)." ) - protected List entry; - - /** - * XML Digital Signature - base64 encoded. - */ - @Child(name = "signature", type = {Base64BinaryType.class}, order=5, min=0, max=1) - @Description(shortDefinition="XML Digital Signature (base64 encoded)", formalDefinition="XML Digital Signature - base64 encoded." ) - protected Base64BinaryType signature; - - private static final long serialVersionUID = -1380125450L; - - /* - * Constructor - */ - public Bundle() { - super(); - } - - /* - * Constructor - */ - public Bundle(Enumeration type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (Indicates the purpose of this bundle- how it was intended to be used.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Bundle.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new BundleTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Indicates the purpose of this bundle- how it was intended to be used.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Bundle setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Indicates the purpose of this bundle- how it was intended to be used. - */ - public BundleType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Indicates the purpose of this bundle- how it was intended to be used. - */ - public Bundle setType(BundleType value) { - if (this.type == null) - this.type = new Enumeration(new BundleTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #base} (The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base).). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public UriType getBaseElement() { - if (this.base == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Bundle.base"); - else if (Configuration.doAutoCreate()) - this.base = new UriType(); // bb - return this.base; - } - - public boolean hasBaseElement() { - return this.base != null && !this.base.isEmpty(); - } - - public boolean hasBase() { - return this.base != null && !this.base.isEmpty(); - } - - /** - * @param value {@link #base} (The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base).). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public Bundle setBaseElement(UriType value) { - this.base = value; - return this; - } - - /** - * @return The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base). - */ - public String getBase() { - return this.base == null ? null : this.base.getValue(); - } - - /** - * @param value The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base). - */ - public Bundle setBase(String value) { - if (Utilities.noString(value)) - this.base = null; - else { - if (this.base == null) - this.base = new UriType(); - this.base.setValue(value); - } - return this; - } - - /** - * @return {@link #total} (If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value - */ - public UnsignedIntType getTotalElement() { - if (this.total == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Bundle.total"); - else if (Configuration.doAutoCreate()) - this.total = new UnsignedIntType(); // bb - return this.total; - } - - public boolean hasTotalElement() { - return this.total != null && !this.total.isEmpty(); - } - - public boolean hasTotal() { - return this.total != null && !this.total.isEmpty(); - } - - /** - * @param value {@link #total} (If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value - */ - public Bundle setTotalElement(UnsignedIntType value) { - this.total = value; - return this; - } - - /** - * @return If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). - */ - public int getTotal() { - return this.total == null || this.total.isEmpty() ? 0 : this.total.getValue(); - } - - /** - * @param value If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). - */ - public Bundle setTotal(int value) { - if (this.total == null) - this.total = new UnsignedIntType(); - this.total.setValue(value); - return this; - } - - /** - * @return {@link #link} (A series of links that provide context to this bundle.) - */ - public List getLink() { - if (this.link == null) - this.link = new ArrayList(); - return this.link; - } - - public boolean hasLink() { - if (this.link == null) - return false; - for (BundleLinkComponent item : this.link) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #link} (A series of links that provide context to this bundle.) - */ - // syntactic sugar - public BundleLinkComponent addLink() { //3 - BundleLinkComponent t = new BundleLinkComponent(); - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return t; - } - - // syntactic sugar - public Bundle addLink(BundleLinkComponent t) { //3 - if (t == null) - return this; - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return this; - } - - /** - * @return {@link #entry} (An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).) - */ - public List getEntry() { - if (this.entry == null) - this.entry = new ArrayList(); - return this.entry; - } - - public boolean hasEntry() { - if (this.entry == null) - return false; - for (BundleEntryComponent item : this.entry) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #entry} (An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).) - */ - // syntactic sugar - public BundleEntryComponent addEntry() { //3 - BundleEntryComponent t = new BundleEntryComponent(); - if (this.entry == null) - this.entry = new ArrayList(); - this.entry.add(t); - return t; - } - - // syntactic sugar - public Bundle addEntry(BundleEntryComponent t) { //3 - if (t == null) - return this; - if (this.entry == null) - this.entry = new ArrayList(); - this.entry.add(t); - return this; - } - - /** - * @return {@link #signature} (XML Digital Signature - base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getSignature" gives direct access to the value - */ - public Base64BinaryType getSignatureElement() { - if (this.signature == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Bundle.signature"); - else if (Configuration.doAutoCreate()) - this.signature = new Base64BinaryType(); // bb - return this.signature; - } - - public boolean hasSignatureElement() { - return this.signature != null && !this.signature.isEmpty(); - } - - public boolean hasSignature() { - return this.signature != null && !this.signature.isEmpty(); - } - - /** - * @param value {@link #signature} (XML Digital Signature - base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getSignature" gives direct access to the value - */ - public Bundle setSignatureElement(Base64BinaryType value) { - this.signature = value; - return this; - } - - /** - * @return XML Digital Signature - base64 encoded. - */ - public byte[] getSignature() { - return this.signature == null ? null : this.signature.getValue(); - } - - /** - * @param value XML Digital Signature - base64 encoded. - */ - public Bundle setSignature(byte[] value) { - if (value == null) - this.signature = null; - else { - if (this.signature == null) - this.signature = new Base64BinaryType(); - this.signature.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Indicates the purpose of this bundle- how it was intended to be used.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("base", "uri", "The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base).", 0, java.lang.Integer.MAX_VALUE, base)); - childrenList.add(new Property("total", "unsignedInt", "If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).", 0, java.lang.Integer.MAX_VALUE, total)); - childrenList.add(new Property("link", "", "A series of links that provide context to this bundle.", 0, java.lang.Integer.MAX_VALUE, link)); - childrenList.add(new Property("entry", "", "An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).", 0, java.lang.Integer.MAX_VALUE, entry)); - childrenList.add(new Property("signature", "base64Binary", "XML Digital Signature - base64 encoded.", 0, java.lang.Integer.MAX_VALUE, signature)); - } - - public Bundle copy() { - Bundle dst = new Bundle(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.base = base == null ? null : base.copy(); - dst.total = total == null ? null : total.copy(); - if (link != null) { - dst.link = new ArrayList(); - for (BundleLinkComponent i : link) - dst.link.add(i.copy()); - }; - if (entry != null) { - dst.entry = new ArrayList(); - for (BundleEntryComponent i : entry) - dst.entry.add(i.copy()); - }; - dst.signature = signature == null ? null : signature.copy(); - return dst; - } - - protected Bundle typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Bundle)) - return false; - Bundle o = (Bundle) other; - return compareDeep(type, o.type, true) && compareDeep(base, o.base, true) && compareDeep(total, o.total, true) - && compareDeep(link, o.link, true) && compareDeep(entry, o.entry, true) && compareDeep(signature, o.signature, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Bundle)) - return false; - Bundle o = (Bundle) other; - return compareValues(type, o.type, true) && compareValues(base, o.base, true) && compareValues(total, o.total, true) - && compareValues(signature, o.signature, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (base == null || base.isEmpty()) - && (total == null || total.isEmpty()) && (link == null || link.isEmpty()) && (entry == null || entry.isEmpty()) - && (signature == null || signature.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Bundle; - } - - @SearchParamDefinition(name="message", path="", description="The first resource in the bundle, if the bundle type is 'message' - this is a message header, and this parameter provides access to search its contents", type="reference" ) - public static final String SP_MESSAGE = "message"; - @SearchParamDefinition(name="composition", path="", description="The first resource in the bundle, if the bundle type is 'document' - this is a composition, and this parameter provides access to searches its contents", type="reference" ) - public static final String SP_COMPOSITION = "composition"; - @SearchParamDefinition(name="type", path="Bundle.type", description="document | message | transaction | transaction-response | history | searchset | collection", type="token" ) - public static final String SP_TYPE = "type"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import java.util.*; + +import java.math.*; +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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A container for a collection of resources. + */ +@ResourceDef(name="Bundle", profile="http://hl7.org/fhir/Profile/Bundle") +public class Bundle extends Resource implements IBaseBundle { + + public enum BundleType { + /** + * The bundle is a document. The first resource is a Composition. + */ + DOCUMENT, + /** + * The bundle is a message. The first resource is a MessageHeader. + */ + MESSAGE, + /** + * The bundle is a transaction - intended to be processed by a server as an atomic commit. + */ + TRANSACTION, + /** + * The bundle is a transaction response. + */ + TRANSACTIONRESPONSE, + /** + * The bundle is a list of resources from a _history interaction on a server. + */ + HISTORY, + /** + * The bundle is a list of resources returned as a result of a search/query interaction, operation, or message. + */ + SEARCHSET, + /** + * The bundle is a set of resources collected into a single document for ease of distribution. + */ + COLLECTION, + /** + * added to help the parsers + */ + NULL; + public static BundleType fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("document".equals(codeString)) + return DOCUMENT; + if ("message".equals(codeString)) + return MESSAGE; + if ("transaction".equals(codeString)) + return TRANSACTION; + if ("transaction-response".equals(codeString)) + return TRANSACTIONRESPONSE; + if ("history".equals(codeString)) + return HISTORY; + if ("searchset".equals(codeString)) + return SEARCHSET; + if ("collection".equals(codeString)) + return COLLECTION; + throw new Exception("Unknown BundleType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case DOCUMENT: return "document"; + case MESSAGE: return "message"; + case TRANSACTION: return "transaction"; + case TRANSACTIONRESPONSE: return "transaction-response"; + case HISTORY: return "history"; + case SEARCHSET: return "searchset"; + case COLLECTION: return "collection"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DOCUMENT: return ""; + case MESSAGE: return ""; + case TRANSACTION: return ""; + case TRANSACTIONRESPONSE: return ""; + case HISTORY: return ""; + case SEARCHSET: return ""; + case COLLECTION: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DOCUMENT: return "The bundle is a document. The first resource is a Composition."; + case MESSAGE: return "The bundle is a message. The first resource is a MessageHeader."; + case TRANSACTION: return "The bundle is a transaction - intended to be processed by a server as an atomic commit."; + case TRANSACTIONRESPONSE: return "The bundle is a transaction response."; + case HISTORY: return "The bundle is a list of resources from a _history interaction on a server."; + case SEARCHSET: return "The bundle is a list of resources returned as a result of a search/query interaction, operation, or message."; + case COLLECTION: return "The bundle is a set of resources collected into a single document for ease of distribution."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DOCUMENT: return "Document"; + case MESSAGE: return "Message"; + case TRANSACTION: return "Transaction"; + case TRANSACTIONRESPONSE: return "Transaction Response"; + case HISTORY: return "History List"; + case SEARCHSET: return "Search Results"; + case COLLECTION: return "Collection"; + default: return "?"; + } + } + } + + public static class BundleTypeEnumFactory implements EnumFactory { + public BundleType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("document".equals(codeString)) + return BundleType.DOCUMENT; + if ("message".equals(codeString)) + return BundleType.MESSAGE; + if ("transaction".equals(codeString)) + return BundleType.TRANSACTION; + if ("transaction-response".equals(codeString)) + return BundleType.TRANSACTIONRESPONSE; + if ("history".equals(codeString)) + return BundleType.HISTORY; + if ("searchset".equals(codeString)) + return BundleType.SEARCHSET; + if ("collection".equals(codeString)) + return BundleType.COLLECTION; + throw new IllegalArgumentException("Unknown BundleType code '"+codeString+"'"); + } + public String toCode(BundleType code) { + if (code == BundleType.DOCUMENT) + return "document"; + if (code == BundleType.MESSAGE) + return "message"; + if (code == BundleType.TRANSACTION) + return "transaction"; + if (code == BundleType.TRANSACTIONRESPONSE) + return "transaction-response"; + if (code == BundleType.HISTORY) + return "history"; + if (code == BundleType.SEARCHSET) + return "searchset"; + if (code == BundleType.COLLECTION) + return "collection"; + return "?"; + } + } + + public enum SearchEntryMode { + /** + * This resource matched the search specification. + */ + MATCH, + /** + * This resource is returned because it is referred to from another resource in the search set. + */ + INCLUDE, + /** + * added to help the parsers + */ + NULL; + public static SearchEntryMode fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("match".equals(codeString)) + return MATCH; + if ("include".equals(codeString)) + return INCLUDE; + throw new Exception("Unknown SearchEntryMode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case MATCH: return "match"; + case INCLUDE: return "include"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MATCH: return ""; + case INCLUDE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MATCH: return "This resource matched the search specification."; + case INCLUDE: return "This resource is returned because it is referred to from another resource in the search set."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MATCH: return "match"; + case INCLUDE: return "include"; + default: return "?"; + } + } + } + + public static class SearchEntryModeEnumFactory implements EnumFactory { + public SearchEntryMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("match".equals(codeString)) + return SearchEntryMode.MATCH; + if ("include".equals(codeString)) + return SearchEntryMode.INCLUDE; + throw new IllegalArgumentException("Unknown SearchEntryMode code '"+codeString+"'"); + } + public String toCode(SearchEntryMode code) { + if (code == SearchEntryMode.MATCH) + return "match"; + if (code == SearchEntryMode.INCLUDE) + return "include"; + return "?"; + } + } + + public enum HttpVerb { + /** + * HTTP GET. + */ + GET, + /** + * HTTP POST. + */ + POST, + /** + * HTTP PUT. + */ + PUT, + /** + * HTTP DELETE. + */ + DELETE, + /** + * added to help the parsers + */ + NULL; + public static HttpVerb fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("GET".equals(codeString)) + return GET; + if ("POST".equals(codeString)) + return POST; + if ("PUT".equals(codeString)) + return PUT; + if ("DELETE".equals(codeString)) + return DELETE; + throw new Exception("Unknown HttpVerb code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case GET: return "GET"; + case POST: return "POST"; + case PUT: return "PUT"; + case DELETE: return "DELETE"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case GET: return ""; + case POST: return ""; + case PUT: return ""; + case DELETE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case GET: return "HTTP GET."; + case POST: return "HTTP POST."; + case PUT: return "HTTP PUT."; + case DELETE: return "HTTP DELETE."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case GET: return "GET"; + case POST: return "POST"; + case PUT: return "PUT"; + case DELETE: return "DELETE"; + default: return "?"; + } + } + } + + public static class HttpVerbEnumFactory implements EnumFactory { + public HttpVerb fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("GET".equals(codeString)) + return HttpVerb.GET; + if ("POST".equals(codeString)) + return HttpVerb.POST; + if ("PUT".equals(codeString)) + return HttpVerb.PUT; + if ("DELETE".equals(codeString)) + return HttpVerb.DELETE; + throw new IllegalArgumentException("Unknown HttpVerb code '"+codeString+"'"); + } + public String toCode(HttpVerb code) { + if (code == HttpVerb.GET) + return "GET"; + if (code == HttpVerb.POST) + return "POST"; + if (code == HttpVerb.PUT) + return "PUT"; + if (code == HttpVerb.DELETE) + return "DELETE"; + return "?"; + } + } + + @Block() + public static class BundleLinkComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. + */ + @Child(name = "relation", type = {StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="http://www.iana.org/assignments/link-relations/link-relations.xhtml", formalDefinition="A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]." ) + protected StringType relation; + + /** + * The reference details for the link. + */ + @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Reference details for the link", formalDefinition="The reference details for the link." ) + protected UriType url; + + private static final long serialVersionUID = -1010386066L; + + /* + * Constructor + */ + public BundleLinkComponent() { + super(); + } + + /* + * Constructor + */ + public BundleLinkComponent(StringType relation, UriType url) { + super(); + this.relation = relation; + this.url = url; + } + + /** + * @return {@link #relation} (A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].). This is the underlying object with id, value and extensions. The accessor "getRelation" gives direct access to the value + */ + public StringType getRelationElement() { + if (this.relation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleLinkComponent.relation"); + else if (Configuration.doAutoCreate()) + this.relation = new StringType(); // bb + return this.relation; + } + + public boolean hasRelationElement() { + return this.relation != null && !this.relation.isEmpty(); + } + + public boolean hasRelation() { + return this.relation != null && !this.relation.isEmpty(); + } + + /** + * @param value {@link #relation} (A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].). This is the underlying object with id, value and extensions. The accessor "getRelation" gives direct access to the value + */ + public BundleLinkComponent setRelationElement(StringType value) { + this.relation = value; + return this; + } + + /** + * @return A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. + */ + public String getRelation() { + return this.relation == null ? null : this.relation.getValue(); + } + + /** + * @param value A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. + */ + public BundleLinkComponent setRelation(String value) { + if (this.relation == null) + this.relation = new StringType(); + this.relation.setValue(value); + return this; + } + + /** + * @return {@link #url} (The reference details for the link.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleLinkComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (The reference details for the link.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public BundleLinkComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return The reference details for the link. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value The reference details for the link. + */ + public BundleLinkComponent setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("relation", "string", "A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].", 0, java.lang.Integer.MAX_VALUE, relation)); + childrenList.add(new Property("url", "uri", "The reference details for the link.", 0, java.lang.Integer.MAX_VALUE, url)); + } + + public BundleLinkComponent copy() { + BundleLinkComponent dst = new BundleLinkComponent(); + copyValues(dst); + dst.relation = relation == null ? null : relation.copy(); + dst.url = url == null ? null : url.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof BundleLinkComponent)) + return false; + BundleLinkComponent o = (BundleLinkComponent) other; + return compareDeep(relation, o.relation, true) && compareDeep(url, o.url, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof BundleLinkComponent)) + return false; + BundleLinkComponent o = (BundleLinkComponent) other; + return compareValues(relation, o.relation, true) && compareValues(url, o.url, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (relation == null || relation.isEmpty()) && (url == null || url.isEmpty()) + ; + } + + } + + @Block() + public static class BundleEntryComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The Base URL for the resource, if different to the base URL specified for the bundle as a whole. + */ + @Child(name = "base", type = {UriType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Base URL, if different to bundle base", formalDefinition="The Base URL for the resource, if different to the base URL specified for the bundle as a whole." ) + protected UriType base; + + /** + * A series of links that provide context to this entry. + */ + @Child(name = "link", type = {BundleLinkComponent.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Links related to this entry", formalDefinition="A series of links that provide context to this entry." ) + protected List link; + + /** + * The Resources for the entry. + */ + @Child(name = "resource", type = {Resource.class}, order=3, min=0, max=1) + @Description(shortDefinition="Resources in this bundle", formalDefinition="The Resources for the entry." ) + protected Resource resource; + + /** + * Information about the search process that lead to the creation of this entry. + */ + @Child(name = "search", type = {}, order=4, min=0, max=1) + @Description(shortDefinition="Search related information", formalDefinition="Information about the search process that lead to the creation of this entry." ) + protected BundleEntrySearchComponent search; + + /** + * Additional information about how this entry should be processed as part of a transaction. + */ + @Child(name = "transaction", type = {}, order=5, min=0, max=1) + @Description(shortDefinition="Transaction Related Information", formalDefinition="Additional information about how this entry should be processed as part of a transaction." ) + protected BundleEntryTransactionComponent transaction; + + /** + * Additional information about how this entry should be processed as part of a transaction. + */ + @Child(name = "transactionResponse", type = {}, order=6, min=0, max=1) + @Description(shortDefinition="Transaction Related Information", formalDefinition="Additional information about how this entry should be processed as part of a transaction." ) + protected BundleEntryTransactionResponseComponent transactionResponse; + + private static final long serialVersionUID = -1846898377L; + + /* + * Constructor + */ + public BundleEntryComponent() { + super(); + } + + /** + * @return {@link #base} (The Base URL for the resource, if different to the base URL specified for the bundle as a whole.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public UriType getBaseElement() { + if (this.base == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryComponent.base"); + else if (Configuration.doAutoCreate()) + this.base = new UriType(); // bb + return this.base; + } + + public boolean hasBaseElement() { + return this.base != null && !this.base.isEmpty(); + } + + public boolean hasBase() { + return this.base != null && !this.base.isEmpty(); + } + + /** + * @param value {@link #base} (The Base URL for the resource, if different to the base URL specified for the bundle as a whole.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public BundleEntryComponent setBaseElement(UriType value) { + this.base = value; + return this; + } + + /** + * @return The Base URL for the resource, if different to the base URL specified for the bundle as a whole. + */ + public String getBase() { + return this.base == null ? null : this.base.getValue(); + } + + /** + * @param value The Base URL for the resource, if different to the base URL specified for the bundle as a whole. + */ + public BundleEntryComponent setBase(String value) { + if (Utilities.noString(value)) + this.base = null; + else { + if (this.base == null) + this.base = new UriType(); + this.base.setValue(value); + } + return this; + } + + /** + * @return {@link #link} (A series of links that provide context to this entry.) + */ + public List getLink() { + if (this.link == null) + this.link = new ArrayList(); + return this.link; + } + + public boolean hasLink() { + if (this.link == null) + return false; + for (BundleLinkComponent item : this.link) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #link} (A series of links that provide context to this entry.) + */ + // syntactic sugar + public BundleLinkComponent addLink() { //3 + BundleLinkComponent t = new BundleLinkComponent(); + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return t; + } + + // syntactic sugar + public BundleEntryComponent addLink(BundleLinkComponent t) { //3 + if (t == null) + return this; + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return this; + } + + /** + * @return {@link #resource} (The Resources for the entry.) + */ + public Resource getResource() { + return this.resource; + } + + public boolean hasResource() { + return this.resource != null && !this.resource.isEmpty(); + } + + /** + * @param value {@link #resource} (The Resources for the entry.) + */ + public BundleEntryComponent setResource(Resource value) { + this.resource = value; + return this; + } + + /** + * @return {@link #search} (Information about the search process that lead to the creation of this entry.) + */ + public BundleEntrySearchComponent getSearch() { + if (this.search == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryComponent.search"); + else if (Configuration.doAutoCreate()) + this.search = new BundleEntrySearchComponent(); // cc + return this.search; + } + + public boolean hasSearch() { + return this.search != null && !this.search.isEmpty(); + } + + /** + * @param value {@link #search} (Information about the search process that lead to the creation of this entry.) + */ + public BundleEntryComponent setSearch(BundleEntrySearchComponent value) { + this.search = value; + return this; + } + + /** + * @return {@link #transaction} (Additional information about how this entry should be processed as part of a transaction.) + */ + public BundleEntryTransactionComponent getTransaction() { + if (this.transaction == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryComponent.transaction"); + else if (Configuration.doAutoCreate()) + this.transaction = new BundleEntryTransactionComponent(); // cc + return this.transaction; + } + + public boolean hasTransaction() { + return this.transaction != null && !this.transaction.isEmpty(); + } + + /** + * @param value {@link #transaction} (Additional information about how this entry should be processed as part of a transaction.) + */ + public BundleEntryComponent setTransaction(BundleEntryTransactionComponent value) { + this.transaction = value; + return this; + } + + /** + * @return {@link #transactionResponse} (Additional information about how this entry should be processed as part of a transaction.) + */ + public BundleEntryTransactionResponseComponent getTransactionResponse() { + if (this.transactionResponse == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryComponent.transactionResponse"); + else if (Configuration.doAutoCreate()) + this.transactionResponse = new BundleEntryTransactionResponseComponent(); // cc + return this.transactionResponse; + } + + public boolean hasTransactionResponse() { + return this.transactionResponse != null && !this.transactionResponse.isEmpty(); + } + + /** + * @param value {@link #transactionResponse} (Additional information about how this entry should be processed as part of a transaction.) + */ + public BundleEntryComponent setTransactionResponse(BundleEntryTransactionResponseComponent value) { + this.transactionResponse = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("base", "uri", "The Base URL for the resource, if different to the base URL specified for the bundle as a whole.", 0, java.lang.Integer.MAX_VALUE, base)); + childrenList.add(new Property("link", "@Bundle.link", "A series of links that provide context to this entry.", 0, java.lang.Integer.MAX_VALUE, link)); + childrenList.add(new Property("resource", "Resource", "The Resources for the entry.", 0, java.lang.Integer.MAX_VALUE, resource)); + childrenList.add(new Property("search", "", "Information about the search process that lead to the creation of this entry.", 0, java.lang.Integer.MAX_VALUE, search)); + childrenList.add(new Property("transaction", "", "Additional information about how this entry should be processed as part of a transaction.", 0, java.lang.Integer.MAX_VALUE, transaction)); + childrenList.add(new Property("transactionResponse", "", "Additional information about how this entry should be processed as part of a transaction.", 0, java.lang.Integer.MAX_VALUE, transactionResponse)); + } + + public BundleEntryComponent copy() { + BundleEntryComponent dst = new BundleEntryComponent(); + copyValues(dst); + dst.base = base == null ? null : base.copy(); + if (link != null) { + dst.link = new ArrayList(); + for (BundleLinkComponent i : link) + dst.link.add(i.copy()); + }; + dst.resource = resource == null ? null : resource.copy(); + dst.search = search == null ? null : search.copy(); + dst.transaction = transaction == null ? null : transaction.copy(); + dst.transactionResponse = transactionResponse == null ? null : transactionResponse.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof BundleEntryComponent)) + return false; + BundleEntryComponent o = (BundleEntryComponent) other; + return compareDeep(base, o.base, true) && compareDeep(link, o.link, true) && compareDeep(resource, o.resource, true) + && compareDeep(search, o.search, true) && compareDeep(transaction, o.transaction, true) && compareDeep(transactionResponse, o.transactionResponse, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof BundleEntryComponent)) + return false; + BundleEntryComponent o = (BundleEntryComponent) other; + return compareValues(base, o.base, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (base == null || base.isEmpty()) && (link == null || link.isEmpty()) + && (resource == null || resource.isEmpty()) && (search == null || search.isEmpty()) && (transaction == null || transaction.isEmpty()) + && (transactionResponse == null || transactionResponse.isEmpty()); + } + + } + + @Block() + public static class BundleEntrySearchComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Why this entry is in the result set - whether it's included as a match or because of an _include requirement. + */ + @Child(name = "mode", type = {CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="match | include - why this is in the result set", formalDefinition="Why this entry is in the result set - whether it's included as a match or because of an _include requirement." ) + protected Enumeration mode; + + /** + * When searching, the server's search ranking score for the entry. + */ + @Child(name = "score", type = {DecimalType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Search ranking (between 0 and 1)", formalDefinition="When searching, the server's search ranking score for the entry." ) + protected DecimalType score; + + private static final long serialVersionUID = 837739866L; + + /* + * Constructor + */ + public BundleEntrySearchComponent() { + super(); + } + + /** + * @return {@link #mode} (Why this entry is in the result set - whether it's included as a match or because of an _include requirement.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public Enumeration getModeElement() { + if (this.mode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntrySearchComponent.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(new SearchEntryModeEnumFactory()); // bb + return this.mode; + } + + public boolean hasModeElement() { + return this.mode != null && !this.mode.isEmpty(); + } + + public boolean hasMode() { + return this.mode != null && !this.mode.isEmpty(); + } + + /** + * @param value {@link #mode} (Why this entry is in the result set - whether it's included as a match or because of an _include requirement.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public BundleEntrySearchComponent setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return Why this entry is in the result set - whether it's included as a match or because of an _include requirement. + */ + public SearchEntryMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value Why this entry is in the result set - whether it's included as a match or because of an _include requirement. + */ + public BundleEntrySearchComponent setMode(SearchEntryMode value) { + if (value == null) + this.mode = null; + else { + if (this.mode == null) + this.mode = new Enumeration(new SearchEntryModeEnumFactory()); + this.mode.setValue(value); + } + return this; + } + + /** + * @return {@link #score} (When searching, the server's search ranking score for the entry.). This is the underlying object with id, value and extensions. The accessor "getScore" gives direct access to the value + */ + public DecimalType getScoreElement() { + if (this.score == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntrySearchComponent.score"); + else if (Configuration.doAutoCreate()) + this.score = new DecimalType(); // bb + return this.score; + } + + public boolean hasScoreElement() { + return this.score != null && !this.score.isEmpty(); + } + + public boolean hasScore() { + return this.score != null && !this.score.isEmpty(); + } + + /** + * @param value {@link #score} (When searching, the server's search ranking score for the entry.). This is the underlying object with id, value and extensions. The accessor "getScore" gives direct access to the value + */ + public BundleEntrySearchComponent setScoreElement(DecimalType value) { + this.score = value; + return this; + } + + /** + * @return When searching, the server's search ranking score for the entry. + */ + public BigDecimal getScore() { + return this.score == null ? null : this.score.getValue(); + } + + /** + * @param value When searching, the server's search ranking score for the entry. + */ + public BundleEntrySearchComponent setScore(BigDecimal value) { + if (value == null) + this.score = null; + else { + if (this.score == null) + this.score = new DecimalType(); + this.score.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("mode", "code", "Why this entry is in the result set - whether it's included as a match or because of an _include requirement.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("score", "decimal", "When searching, the server's search ranking score for the entry.", 0, java.lang.Integer.MAX_VALUE, score)); + } + + public BundleEntrySearchComponent copy() { + BundleEntrySearchComponent dst = new BundleEntrySearchComponent(); + copyValues(dst); + dst.mode = mode == null ? null : mode.copy(); + dst.score = score == null ? null : score.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof BundleEntrySearchComponent)) + return false; + BundleEntrySearchComponent o = (BundleEntrySearchComponent) other; + return compareDeep(mode, o.mode, true) && compareDeep(score, o.score, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof BundleEntrySearchComponent)) + return false; + BundleEntrySearchComponent o = (BundleEntrySearchComponent) other; + return compareValues(mode, o.mode, true) && compareValues(score, o.score, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (mode == null || mode.isEmpty()) && (score == null || score.isEmpty()) + ; + } + + } + + @Block() + public static class BundleEntryTransactionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The HTTP verb for this entry in either a update history, or a transaction/ transaction response. + */ + @Child(name = "method", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="GET | POST | PUT | DELETE", formalDefinition="The HTTP verb for this entry in either a update history, or a transaction/ transaction response." ) + protected Enumeration method; + + /** + * A search URL for this resource that specifies how the resource is matched to an existing resource when processing a transaction (see transaction documentation). + */ + @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1) + @Description(shortDefinition="The URL for the transaction", formalDefinition="A search URL for this resource that specifies how the resource is matched to an existing resource when processing a transaction (see transaction documentation)." ) + protected UriType url; + + /** + * If the ETag values match, return a 304 Not modified status. See the read/vread interaction documentation. + */ + @Child(name = "ifNoneMatch", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="For managing cache currency", formalDefinition="If the ETag values match, return a 304 Not modified status. See the read/vread interaction documentation." ) + protected StringType ifNoneMatch; + + /** + * Only perform the operation if the Etag value matches. For more information, see the API section "Managing Resource Contention". + */ + @Child(name = "ifMatch", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="For managing update contention", formalDefinition="Only perform the operation if the Etag value matches. For more information, see the API section 'Managing Resource Contention'." ) + protected StringType ifMatch; + + /** + * Only perform the operation if the last updated date matches. For more information, see the API section "Managing Resource Contention". + */ + @Child(name = "ifModifiedSince", type = {InstantType.class}, order=5, min=0, max=1) + @Description(shortDefinition="For managing update contention", formalDefinition="Only perform the operation if the last updated date matches. For more information, see the API section 'Managing Resource Contention'." ) + protected InstantType ifModifiedSince; + + /** + * Instruct the server not to perform the create if a specified resource already exists. For further information, see "Conditional Create". + */ + @Child(name = "ifNoneExist", type = {StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="For conditional creates", formalDefinition="Instruct the server not to perform the create if a specified resource already exists. For further information, see 'Conditional Create'." ) + protected StringType ifNoneExist; + + private static final long serialVersionUID = -769185862L; + + /* + * Constructor + */ + public BundleEntryTransactionComponent() { + super(); + } + + /* + * Constructor + */ + public BundleEntryTransactionComponent(Enumeration method, UriType url) { + super(); + this.method = method; + this.url = url; + } + + /** + * @return {@link #method} (The HTTP verb for this entry in either a update history, or a transaction/ transaction response.). This is the underlying object with id, value and extensions. The accessor "getMethod" gives direct access to the value + */ + public Enumeration getMethodElement() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryTransactionComponent.method"); + else if (Configuration.doAutoCreate()) + this.method = new Enumeration(new HttpVerbEnumFactory()); // bb + return this.method; + } + + public boolean hasMethodElement() { + return this.method != null && !this.method.isEmpty(); + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** + * @param value {@link #method} (The HTTP verb for this entry in either a update history, or a transaction/ transaction response.). This is the underlying object with id, value and extensions. The accessor "getMethod" gives direct access to the value + */ + public BundleEntryTransactionComponent setMethodElement(Enumeration value) { + this.method = value; + return this; + } + + /** + * @return The HTTP verb for this entry in either a update history, or a transaction/ transaction response. + */ + public HttpVerb getMethod() { + return this.method == null ? null : this.method.getValue(); + } + + /** + * @param value The HTTP verb for this entry in either a update history, or a transaction/ transaction response. + */ + public BundleEntryTransactionComponent setMethod(HttpVerb value) { + if (this.method == null) + this.method = new Enumeration(new HttpVerbEnumFactory()); + this.method.setValue(value); + return this; + } + + /** + * @return {@link #url} (A search URL for this resource that specifies how the resource is matched to an existing resource when processing a transaction (see transaction documentation).). 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 BundleEntryTransactionComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (A search URL for this resource that specifies how the resource is matched to an existing resource when processing a transaction (see transaction documentation).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public BundleEntryTransactionComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return A search URL for this resource that specifies how the resource is matched to an existing resource when processing a transaction (see transaction documentation). + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value A search URL for this resource that specifies how the resource is matched to an existing resource when processing a transaction (see transaction documentation). + */ + public BundleEntryTransactionComponent setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + /** + * @return {@link #ifNoneMatch} (If the ETag values match, return a 304 Not modified status. See the read/vread interaction documentation.). This is the underlying object with id, value and extensions. The accessor "getIfNoneMatch" gives direct access to the value + */ + public StringType getIfNoneMatchElement() { + if (this.ifNoneMatch == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryTransactionComponent.ifNoneMatch"); + else if (Configuration.doAutoCreate()) + this.ifNoneMatch = new StringType(); // bb + return this.ifNoneMatch; + } + + public boolean hasIfNoneMatchElement() { + return this.ifNoneMatch != null && !this.ifNoneMatch.isEmpty(); + } + + public boolean hasIfNoneMatch() { + return this.ifNoneMatch != null && !this.ifNoneMatch.isEmpty(); + } + + /** + * @param value {@link #ifNoneMatch} (If the ETag values match, return a 304 Not modified status. See the read/vread interaction documentation.). This is the underlying object with id, value and extensions. The accessor "getIfNoneMatch" gives direct access to the value + */ + public BundleEntryTransactionComponent setIfNoneMatchElement(StringType value) { + this.ifNoneMatch = value; + return this; + } + + /** + * @return If the ETag values match, return a 304 Not modified status. See the read/vread interaction documentation. + */ + public String getIfNoneMatch() { + return this.ifNoneMatch == null ? null : this.ifNoneMatch.getValue(); + } + + /** + * @param value If the ETag values match, return a 304 Not modified status. See the read/vread interaction documentation. + */ + public BundleEntryTransactionComponent setIfNoneMatch(String value) { + if (Utilities.noString(value)) + this.ifNoneMatch = null; + else { + if (this.ifNoneMatch == null) + this.ifNoneMatch = new StringType(); + this.ifNoneMatch.setValue(value); + } + return this; + } + + /** + * @return {@link #ifMatch} (Only perform the operation if the Etag value matches. For more information, see the API section "Managing Resource Contention".). This is the underlying object with id, value and extensions. The accessor "getIfMatch" gives direct access to the value + */ + public StringType getIfMatchElement() { + if (this.ifMatch == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryTransactionComponent.ifMatch"); + else if (Configuration.doAutoCreate()) + this.ifMatch = new StringType(); // bb + return this.ifMatch; + } + + public boolean hasIfMatchElement() { + return this.ifMatch != null && !this.ifMatch.isEmpty(); + } + + public boolean hasIfMatch() { + return this.ifMatch != null && !this.ifMatch.isEmpty(); + } + + /** + * @param value {@link #ifMatch} (Only perform the operation if the Etag value matches. For more information, see the API section "Managing Resource Contention".). This is the underlying object with id, value and extensions. The accessor "getIfMatch" gives direct access to the value + */ + public BundleEntryTransactionComponent setIfMatchElement(StringType value) { + this.ifMatch = value; + return this; + } + + /** + * @return Only perform the operation if the Etag value matches. For more information, see the API section "Managing Resource Contention". + */ + public String getIfMatch() { + return this.ifMatch == null ? null : this.ifMatch.getValue(); + } + + /** + * @param value Only perform the operation if the Etag value matches. For more information, see the API section "Managing Resource Contention". + */ + public BundleEntryTransactionComponent setIfMatch(String value) { + if (Utilities.noString(value)) + this.ifMatch = null; + else { + if (this.ifMatch == null) + this.ifMatch = new StringType(); + this.ifMatch.setValue(value); + } + return this; + } + + /** + * @return {@link #ifModifiedSince} (Only perform the operation if the last updated date matches. For more information, see the API section "Managing Resource Contention".). This is the underlying object with id, value and extensions. The accessor "getIfModifiedSince" gives direct access to the value + */ + public InstantType getIfModifiedSinceElement() { + if (this.ifModifiedSince == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryTransactionComponent.ifModifiedSince"); + else if (Configuration.doAutoCreate()) + this.ifModifiedSince = new InstantType(); // bb + return this.ifModifiedSince; + } + + public boolean hasIfModifiedSinceElement() { + return this.ifModifiedSince != null && !this.ifModifiedSince.isEmpty(); + } + + public boolean hasIfModifiedSince() { + return this.ifModifiedSince != null && !this.ifModifiedSince.isEmpty(); + } + + /** + * @param value {@link #ifModifiedSince} (Only perform the operation if the last updated date matches. For more information, see the API section "Managing Resource Contention".). This is the underlying object with id, value and extensions. The accessor "getIfModifiedSince" gives direct access to the value + */ + public BundleEntryTransactionComponent setIfModifiedSinceElement(InstantType value) { + this.ifModifiedSince = value; + return this; + } + + /** + * @return Only perform the operation if the last updated date matches. For more information, see the API section "Managing Resource Contention". + */ + public Date getIfModifiedSince() { + return this.ifModifiedSince == null ? null : this.ifModifiedSince.getValue(); + } + + /** + * @param value Only perform the operation if the last updated date matches. For more information, see the API section "Managing Resource Contention". + */ + public BundleEntryTransactionComponent setIfModifiedSince(Date value) { + if (value == null) + this.ifModifiedSince = null; + else { + if (this.ifModifiedSince == null) + this.ifModifiedSince = new InstantType(); + this.ifModifiedSince.setValue(value); + } + return this; + } + + /** + * @return {@link #ifNoneExist} (Instruct the server not to perform the create if a specified resource already exists. For further information, see "Conditional Create".). This is the underlying object with id, value and extensions. The accessor "getIfNoneExist" gives direct access to the value + */ + public StringType getIfNoneExistElement() { + if (this.ifNoneExist == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryTransactionComponent.ifNoneExist"); + else if (Configuration.doAutoCreate()) + this.ifNoneExist = new StringType(); // bb + return this.ifNoneExist; + } + + public boolean hasIfNoneExistElement() { + return this.ifNoneExist != null && !this.ifNoneExist.isEmpty(); + } + + public boolean hasIfNoneExist() { + return this.ifNoneExist != null && !this.ifNoneExist.isEmpty(); + } + + /** + * @param value {@link #ifNoneExist} (Instruct the server not to perform the create if a specified resource already exists. For further information, see "Conditional Create".). This is the underlying object with id, value and extensions. The accessor "getIfNoneExist" gives direct access to the value + */ + public BundleEntryTransactionComponent setIfNoneExistElement(StringType value) { + this.ifNoneExist = value; + return this; + } + + /** + * @return Instruct the server not to perform the create if a specified resource already exists. For further information, see "Conditional Create". + */ + public String getIfNoneExist() { + return this.ifNoneExist == null ? null : this.ifNoneExist.getValue(); + } + + /** + * @param value Instruct the server not to perform the create if a specified resource already exists. For further information, see "Conditional Create". + */ + public BundleEntryTransactionComponent setIfNoneExist(String value) { + if (Utilities.noString(value)) + this.ifNoneExist = null; + else { + if (this.ifNoneExist == null) + this.ifNoneExist = new StringType(); + this.ifNoneExist.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("method", "code", "The HTTP verb for this entry in either a update history, or a transaction/ transaction response.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("url", "uri", "A search URL for this resource that specifies how the resource is matched to an existing resource when processing a transaction (see transaction documentation).", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("ifNoneMatch", "string", "If the ETag values match, return a 304 Not modified status. See the read/vread interaction documentation.", 0, java.lang.Integer.MAX_VALUE, ifNoneMatch)); + childrenList.add(new Property("ifMatch", "string", "Only perform the operation if the Etag value matches. For more information, see the API section 'Managing Resource Contention'.", 0, java.lang.Integer.MAX_VALUE, ifMatch)); + childrenList.add(new Property("ifModifiedSince", "instant", "Only perform the operation if the last updated date matches. For more information, see the API section 'Managing Resource Contention'.", 0, java.lang.Integer.MAX_VALUE, ifModifiedSince)); + childrenList.add(new Property("ifNoneExist", "string", "Instruct the server not to perform the create if a specified resource already exists. For further information, see 'Conditional Create'.", 0, java.lang.Integer.MAX_VALUE, ifNoneExist)); + } + + public BundleEntryTransactionComponent copy() { + BundleEntryTransactionComponent dst = new BundleEntryTransactionComponent(); + copyValues(dst); + dst.method = method == null ? null : method.copy(); + dst.url = url == null ? null : url.copy(); + dst.ifNoneMatch = ifNoneMatch == null ? null : ifNoneMatch.copy(); + dst.ifMatch = ifMatch == null ? null : ifMatch.copy(); + dst.ifModifiedSince = ifModifiedSince == null ? null : ifModifiedSince.copy(); + dst.ifNoneExist = ifNoneExist == null ? null : ifNoneExist.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof BundleEntryTransactionComponent)) + return false; + BundleEntryTransactionComponent o = (BundleEntryTransactionComponent) other; + return compareDeep(method, o.method, true) && compareDeep(url, o.url, true) && compareDeep(ifNoneMatch, o.ifNoneMatch, true) + && compareDeep(ifMatch, o.ifMatch, true) && compareDeep(ifModifiedSince, o.ifModifiedSince, true) + && compareDeep(ifNoneExist, o.ifNoneExist, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof BundleEntryTransactionComponent)) + return false; + BundleEntryTransactionComponent o = (BundleEntryTransactionComponent) other; + return compareValues(method, o.method, true) && compareValues(url, o.url, true) && compareValues(ifNoneMatch, o.ifNoneMatch, true) + && compareValues(ifMatch, o.ifMatch, true) && compareValues(ifModifiedSince, o.ifModifiedSince, true) + && compareValues(ifNoneExist, o.ifNoneExist, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (method == null || method.isEmpty()) && (url == null || url.isEmpty()) + && (ifNoneMatch == null || ifNoneMatch.isEmpty()) && (ifMatch == null || ifMatch.isEmpty()) + && (ifModifiedSince == null || ifModifiedSince.isEmpty()) && (ifNoneExist == null || ifNoneExist.isEmpty()) + ; + } + + } + + @Block() + public static class BundleEntryTransactionResponseComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The status code returned by processing this entry. + */ + @Child(name = "status", type = {StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Status return code for entry", formalDefinition="The status code returned by processing this entry." ) + protected StringType status; + + /** + * The location header created by processing this operation. + */ + @Child(name = "location", type = {UriType.class}, order=2, min=0, max=1) + @Description(shortDefinition="The location, if the operation returns a location", formalDefinition="The location header created by processing this operation." ) + protected UriType location; + + /** + * The etag for the resource, it the operation for the entry produced a versioned resource. + */ + @Child(name = "etag", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="The etag for the resource (if relevant)", formalDefinition="The etag for the resource, it the operation for the entry produced a versioned resource." ) + protected StringType etag; + + /** + * The date/time that the resource was modified on the server. + */ + @Child(name = "lastModified", type = {InstantType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Server's date time modified", formalDefinition="The date/time that the resource was modified on the server." ) + protected InstantType lastModified; + + private static final long serialVersionUID = -1526413234L; + + /* + * Constructor + */ + public BundleEntryTransactionResponseComponent() { + super(); + } + + /* + * Constructor + */ + public BundleEntryTransactionResponseComponent(StringType status) { + super(); + this.status = status; + } + + /** + * @return {@link #status} (The status code returned by processing this entry.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public StringType getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryTransactionResponseComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new StringType(); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status code returned by processing this entry.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public BundleEntryTransactionResponseComponent setStatusElement(StringType value) { + this.status = value; + return this; + } + + /** + * @return The status code returned by processing this entry. + */ + public String getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status code returned by processing this entry. + */ + public BundleEntryTransactionResponseComponent setStatus(String value) { + if (this.status == null) + this.status = new StringType(); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #location} (The location header created by processing this operation.). This is the underlying object with id, value and extensions. The accessor "getLocation" gives direct access to the value + */ + public UriType getLocationElement() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryTransactionResponseComponent.location"); + else if (Configuration.doAutoCreate()) + this.location = new UriType(); // bb + return this.location; + } + + public boolean hasLocationElement() { + return this.location != null && !this.location.isEmpty(); + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (The location header created by processing this operation.). This is the underlying object with id, value and extensions. The accessor "getLocation" gives direct access to the value + */ + public BundleEntryTransactionResponseComponent setLocationElement(UriType value) { + this.location = value; + return this; + } + + /** + * @return The location header created by processing this operation. + */ + public String getLocation() { + return this.location == null ? null : this.location.getValue(); + } + + /** + * @param value The location header created by processing this operation. + */ + public BundleEntryTransactionResponseComponent setLocation(String value) { + if (Utilities.noString(value)) + this.location = null; + else { + if (this.location == null) + this.location = new UriType(); + this.location.setValue(value); + } + return this; + } + + /** + * @return {@link #etag} (The etag for the resource, it the operation for the entry produced a versioned resource.). This is the underlying object with id, value and extensions. The accessor "getEtag" gives direct access to the value + */ + public StringType getEtagElement() { + if (this.etag == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryTransactionResponseComponent.etag"); + else if (Configuration.doAutoCreate()) + this.etag = new StringType(); // bb + return this.etag; + } + + public boolean hasEtagElement() { + return this.etag != null && !this.etag.isEmpty(); + } + + public boolean hasEtag() { + return this.etag != null && !this.etag.isEmpty(); + } + + /** + * @param value {@link #etag} (The etag for the resource, it the operation for the entry produced a versioned resource.). This is the underlying object with id, value and extensions. The accessor "getEtag" gives direct access to the value + */ + public BundleEntryTransactionResponseComponent setEtagElement(StringType value) { + this.etag = value; + return this; + } + + /** + * @return The etag for the resource, it the operation for the entry produced a versioned resource. + */ + public String getEtag() { + return this.etag == null ? null : this.etag.getValue(); + } + + /** + * @param value The etag for the resource, it the operation for the entry produced a versioned resource. + */ + public BundleEntryTransactionResponseComponent setEtag(String value) { + if (Utilities.noString(value)) + this.etag = null; + else { + if (this.etag == null) + this.etag = new StringType(); + this.etag.setValue(value); + } + return this; + } + + /** + * @return {@link #lastModified} (The date/time that the resource was modified on the server.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value + */ + public InstantType getLastModifiedElement() { + if (this.lastModified == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryTransactionResponseComponent.lastModified"); + else if (Configuration.doAutoCreate()) + this.lastModified = new InstantType(); // bb + return this.lastModified; + } + + public boolean hasLastModifiedElement() { + return this.lastModified != null && !this.lastModified.isEmpty(); + } + + public boolean hasLastModified() { + return this.lastModified != null && !this.lastModified.isEmpty(); + } + + /** + * @param value {@link #lastModified} (The date/time that the resource was modified on the server.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value + */ + public BundleEntryTransactionResponseComponent setLastModifiedElement(InstantType value) { + this.lastModified = value; + return this; + } + + /** + * @return The date/time that the resource was modified on the server. + */ + public Date getLastModified() { + return this.lastModified == null ? null : this.lastModified.getValue(); + } + + /** + * @param value The date/time that the resource was modified on the server. + */ + public BundleEntryTransactionResponseComponent setLastModified(Date value) { + if (value == null) + this.lastModified = null; + else { + if (this.lastModified == null) + this.lastModified = new InstantType(); + this.lastModified.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("status", "string", "The status code returned by processing this entry.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("location", "uri", "The location header created by processing this operation.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("etag", "string", "The etag for the resource, it the operation for the entry produced a versioned resource.", 0, java.lang.Integer.MAX_VALUE, etag)); + childrenList.add(new Property("lastModified", "instant", "The date/time that the resource was modified on the server.", 0, java.lang.Integer.MAX_VALUE, lastModified)); + } + + public BundleEntryTransactionResponseComponent copy() { + BundleEntryTransactionResponseComponent dst = new BundleEntryTransactionResponseComponent(); + copyValues(dst); + dst.status = status == null ? null : status.copy(); + dst.location = location == null ? null : location.copy(); + dst.etag = etag == null ? null : etag.copy(); + dst.lastModified = lastModified == null ? null : lastModified.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof BundleEntryTransactionResponseComponent)) + return false; + BundleEntryTransactionResponseComponent o = (BundleEntryTransactionResponseComponent) other; + return compareDeep(status, o.status, true) && compareDeep(location, o.location, true) && compareDeep(etag, o.etag, true) + && compareDeep(lastModified, o.lastModified, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof BundleEntryTransactionResponseComponent)) + return false; + BundleEntryTransactionResponseComponent o = (BundleEntryTransactionResponseComponent) other; + return compareValues(status, o.status, true) && compareValues(location, o.location, true) && compareValues(etag, o.etag, true) + && compareValues(lastModified, o.lastModified, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (status == null || status.isEmpty()) && (location == null || location.isEmpty()) + && (etag == null || etag.isEmpty()) && (lastModified == null || lastModified.isEmpty()); + } + + } + + /** + * Indicates the purpose of this bundle- how it was intended to be used. + */ + @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1) + @Description(shortDefinition="document | message | transaction | transaction-response | history | searchset | collection", formalDefinition="Indicates the purpose of this bundle- how it was intended to be used." ) + protected Enumeration type; + + /** + * The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base). + */ + @Child(name = "base", type = {UriType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Stated Base URL", formalDefinition="The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base)." ) + protected UriType base; + + /** + * If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). + */ + @Child(name = "total", type = {UnsignedIntType.class}, order=2, min=0, max=1) + @Description(shortDefinition="If search, the total number of matches", formalDefinition="If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)." ) + protected UnsignedIntType total; + + /** + * A series of links that provide context to this bundle. + */ + @Child(name = "link", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Links related to this Bundle", formalDefinition="A series of links that provide context to this bundle." ) + protected List link; + + /** + * An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only). + */ + @Child(name = "entry", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Entry in the bundle - will have a resource, or information", formalDefinition="An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)." ) + protected List entry; + + /** + * XML Digital Signature - base64 encoded. + */ + @Child(name = "signature", type = {Base64BinaryType.class}, order=5, min=0, max=1) + @Description(shortDefinition="XML Digital Signature (base64 encoded)", formalDefinition="XML Digital Signature - base64 encoded." ) + protected Base64BinaryType signature; + + private static final long serialVersionUID = -1380125450L; + + /* + * Constructor + */ + public Bundle() { + super(); + } + + /* + * Constructor + */ + public Bundle(Enumeration type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (Indicates the purpose of this bundle- how it was intended to be used.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Bundle.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new BundleTypeEnumFactory()); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Indicates the purpose of this bundle- how it was intended to be used.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Bundle setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Indicates the purpose of this bundle- how it was intended to be used. + */ + public BundleType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Indicates the purpose of this bundle- how it was intended to be used. + */ + public Bundle setType(BundleType value) { + if (this.type == null) + this.type = new Enumeration(new BundleTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #base} (The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base).). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public UriType getBaseElement() { + if (this.base == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Bundle.base"); + else if (Configuration.doAutoCreate()) + this.base = new UriType(); // bb + return this.base; + } + + public boolean hasBaseElement() { + return this.base != null && !this.base.isEmpty(); + } + + public boolean hasBase() { + return this.base != null && !this.base.isEmpty(); + } + + /** + * @param value {@link #base} (The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base).). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public Bundle setBaseElement(UriType value) { + this.base = value; + return this; + } + + /** + * @return The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base). + */ + public String getBase() { + return this.base == null ? null : this.base.getValue(); + } + + /** + * @param value The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base). + */ + public Bundle setBase(String value) { + if (Utilities.noString(value)) + this.base = null; + else { + if (this.base == null) + this.base = new UriType(); + this.base.setValue(value); + } + return this; + } + + /** + * @return {@link #total} (If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value + */ + public UnsignedIntType getTotalElement() { + if (this.total == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Bundle.total"); + else if (Configuration.doAutoCreate()) + this.total = new UnsignedIntType(); // bb + return this.total; + } + + public boolean hasTotalElement() { + return this.total != null && !this.total.isEmpty(); + } + + public boolean hasTotal() { + return this.total != null && !this.total.isEmpty(); + } + + /** + * @param value {@link #total} (If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value + */ + public Bundle setTotalElement(UnsignedIntType value) { + this.total = value; + return this; + } + + /** + * @return If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). + */ + public int getTotal() { + return this.total == null || this.total.isEmpty() ? 0 : this.total.getValue(); + } + + /** + * @param value If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). + */ + public Bundle setTotal(int value) { + if (this.total == null) + this.total = new UnsignedIntType(); + this.total.setValue(value); + return this; + } + + /** + * @return {@link #link} (A series of links that provide context to this bundle.) + */ + public List getLink() { + if (this.link == null) + this.link = new ArrayList(); + return this.link; + } + + public boolean hasLink() { + if (this.link == null) + return false; + for (BundleLinkComponent item : this.link) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #link} (A series of links that provide context to this bundle.) + */ + // syntactic sugar + public BundleLinkComponent addLink() { //3 + BundleLinkComponent t = new BundleLinkComponent(); + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return t; + } + + // syntactic sugar + public Bundle addLink(BundleLinkComponent t) { //3 + if (t == null) + return this; + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return this; + } + + /** + * @return {@link #entry} (An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).) + */ + public List getEntry() { + if (this.entry == null) + this.entry = new ArrayList(); + return this.entry; + } + + public boolean hasEntry() { + if (this.entry == null) + return false; + for (BundleEntryComponent item : this.entry) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #entry} (An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).) + */ + // syntactic sugar + public BundleEntryComponent addEntry() { //3 + BundleEntryComponent t = new BundleEntryComponent(); + if (this.entry == null) + this.entry = new ArrayList(); + this.entry.add(t); + return t; + } + + // syntactic sugar + public Bundle addEntry(BundleEntryComponent t) { //3 + if (t == null) + return this; + if (this.entry == null) + this.entry = new ArrayList(); + this.entry.add(t); + return this; + } + + /** + * @return {@link #signature} (XML Digital Signature - base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getSignature" gives direct access to the value + */ + public Base64BinaryType getSignatureElement() { + if (this.signature == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Bundle.signature"); + else if (Configuration.doAutoCreate()) + this.signature = new Base64BinaryType(); // bb + return this.signature; + } + + public boolean hasSignatureElement() { + return this.signature != null && !this.signature.isEmpty(); + } + + public boolean hasSignature() { + return this.signature != null && !this.signature.isEmpty(); + } + + /** + * @param value {@link #signature} (XML Digital Signature - base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getSignature" gives direct access to the value + */ + public Bundle setSignatureElement(Base64BinaryType value) { + this.signature = value; + return this; + } + + /** + * @return XML Digital Signature - base64 encoded. + */ + public byte[] getSignature() { + return this.signature == null ? null : this.signature.getValue(); + } + + /** + * @param value XML Digital Signature - base64 encoded. + */ + public Bundle setSignature(byte[] value) { + if (value == null) + this.signature = null; + else { + if (this.signature == null) + this.signature = new Base64BinaryType(); + this.signature.setValue(value); + } + return this; + } + + /** + * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. + * If no link is found which matches the given relation, returns null. If more than one + * link is found which matches the given relation, returns the first matching BundleLinkComponent. + * + * @param theRelation + * The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}. + * @return Returns a matching BundleLinkComponent, or null + * @see IBaseBundle#LINK_NEXT + * @see IBaseBundle#LINK_PREV + * @see IBaseBundle#LINK_SELF + */ + public BundleLinkComponent getLink(String theRelation) { + org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty"); + for (BundleLinkComponent next : getLink()) { + if (theRelation.equals(next.getRelation())) { + return next; + } + } + return null; + } + + /** + * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. + * If no link is found which matches the given relation, creates a new BundleLinkComponent with the + * given relation and adds it to this Bundle. If more than one + * link is found which matches the given relation, returns the first matching BundleLinkComponent. + * + * @param theRelation + * The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}. + * @return Returns a matching BundleLinkComponent, or null + * @see IBaseBundle#LINK_NEXT + * @see IBaseBundle#LINK_PREV + * @see IBaseBundle#LINK_SELF + */ + public BundleLinkComponent getLinkOrCreate(String theRelation) { + org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty"); + for (BundleLinkComponent next : getLink()) { + if (theRelation.equals(next.getRelation())) { + return next; + } + } + BundleLinkComponent retVal = new BundleLinkComponent(); + retVal.setRelation(theRelation); + getLink().add(retVal); + return retVal; + } + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Indicates the purpose of this bundle- how it was intended to be used.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("base", "uri", "The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base).", 0, java.lang.Integer.MAX_VALUE, base)); + childrenList.add(new Property("total", "unsignedInt", "If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).", 0, java.lang.Integer.MAX_VALUE, total)); + childrenList.add(new Property("link", "", "A series of links that provide context to this bundle.", 0, java.lang.Integer.MAX_VALUE, link)); + childrenList.add(new Property("entry", "", "An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).", 0, java.lang.Integer.MAX_VALUE, entry)); + childrenList.add(new Property("signature", "base64Binary", "XML Digital Signature - base64 encoded.", 0, java.lang.Integer.MAX_VALUE, signature)); + } + + public Bundle copy() { + Bundle dst = new Bundle(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.base = base == null ? null : base.copy(); + dst.total = total == null ? null : total.copy(); + if (link != null) { + dst.link = new ArrayList(); + for (BundleLinkComponent i : link) + dst.link.add(i.copy()); + }; + if (entry != null) { + dst.entry = new ArrayList(); + for (BundleEntryComponent i : entry) + dst.entry.add(i.copy()); + }; + dst.signature = signature == null ? null : signature.copy(); + return dst; + } + + protected Bundle typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Bundle)) + return false; + Bundle o = (Bundle) other; + return compareDeep(type, o.type, true) && compareDeep(base, o.base, true) && compareDeep(total, o.total, true) + && compareDeep(link, o.link, true) && compareDeep(entry, o.entry, true) && compareDeep(signature, o.signature, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Bundle)) + return false; + Bundle o = (Bundle) other; + return compareValues(type, o.type, true) && compareValues(base, o.base, true) && compareValues(total, o.total, true) + && compareValues(signature, o.signature, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (base == null || base.isEmpty()) + && (total == null || total.isEmpty()) && (link == null || link.isEmpty()) && (entry == null || entry.isEmpty()) + && (signature == null || signature.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Bundle; + } + + @SearchParamDefinition(name="composition", path="", description="The first resource in the bundle, if the bundle type is 'document' - this is a composition, and this parameter provides access to searches its contents", type="reference" ) + public static final String SP_COMPOSITION = "composition"; + @SearchParamDefinition(name="type", path="Bundle.type", description="document | message | transaction | transaction-response | history | searchset | collection", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="message", path="", description="The first resource in the bundle, if the bundle type is 'message' - this is a message header, and this parameter provides access to search its contents", type="reference" ) + public static final String SP_MESSAGE = "message"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/CarePlan.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/CarePlan.java index 49b3a32699d..2162dee192e 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/CarePlan.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/CarePlan.java @@ -1,2463 +1,2442 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions. - */ -@ResourceDef(name="CarePlan", profile="http://hl7.org/fhir/Profile/CarePlan") -public class CarePlan extends DomainResource { - - public enum CarePlanStatus { - /** - * The plan is in development or awaiting use but is not yet intended to be acted upon. - */ - PLANNED, - /** - * The plan is intended to be followed and used as part of patient care. - */ - ACTIVE, - /** - * The plan is no longer in use and is not expected to be followed or used in patient care. - */ - COMPLETED, - /** - * added to help the parsers - */ - NULL; - public static CarePlanStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return PLANNED; - if ("active".equals(codeString)) - return ACTIVE; - if ("completed".equals(codeString)) - return COMPLETED; - throw new Exception("Unknown CarePlanStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PLANNED: return "planned"; - case ACTIVE: return "active"; - case COMPLETED: return "completed"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PLANNED: return ""; - case ACTIVE: return ""; - case COMPLETED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PLANNED: return "The plan is in development or awaiting use but is not yet intended to be acted upon."; - case ACTIVE: return "The plan is intended to be followed and used as part of patient care."; - case COMPLETED: return "The plan is no longer in use and is not expected to be followed or used in patient care."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PLANNED: return "Planned"; - case ACTIVE: return "Active"; - case COMPLETED: return "Completed"; - default: return "?"; - } - } - } - - public static class CarePlanStatusEnumFactory implements EnumFactory { - public CarePlanStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return CarePlanStatus.PLANNED; - if ("active".equals(codeString)) - return CarePlanStatus.ACTIVE; - if ("completed".equals(codeString)) - return CarePlanStatus.COMPLETED; - throw new IllegalArgumentException("Unknown CarePlanStatus code '"+codeString+"'"); - } - public String toCode(CarePlanStatus code) { - if (code == CarePlanStatus.PLANNED) - return "planned"; - if (code == CarePlanStatus.ACTIVE) - return "active"; - if (code == CarePlanStatus.COMPLETED) - return "completed"; - return "?"; - } - } - - public enum CarePlanActivityCategory { - /** - * Plan for the patient to consume food of a specified nature. - */ - DIET, - /** - * Plan for the patient to consume/receive a drug, vaccine or other product. - */ - DRUG, - /** - * Plan to meet or communicate with the patient (in-patient, out-patient, phone call, etc.). - */ - ENCOUNTER, - /** - * Plan to capture information about a patient (vitals, labs, diagnostic images, etc.). - */ - OBSERVATION, - /** - * Plan to modify the patient in some way (surgery, physiotherapy, education, counseling, etc.). - */ - PROCEDURE, - /** - * Plan to provide something to the patient (medication, medical supply, etc.). - */ - SUPPLY, - /** - * Some other form of action. - */ - OTHER, - /** - * added to help the parsers - */ - NULL; - public static CarePlanActivityCategory fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("diet".equals(codeString)) - return DIET; - if ("drug".equals(codeString)) - return DRUG; - if ("encounter".equals(codeString)) - return ENCOUNTER; - if ("observation".equals(codeString)) - return OBSERVATION; - if ("procedure".equals(codeString)) - return PROCEDURE; - if ("supply".equals(codeString)) - return SUPPLY; - if ("other".equals(codeString)) - return OTHER; - throw new Exception("Unknown CarePlanActivityCategory code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case DIET: return "diet"; - case DRUG: return "drug"; - case ENCOUNTER: return "encounter"; - case OBSERVATION: return "observation"; - case PROCEDURE: return "procedure"; - case SUPPLY: return "supply"; - case OTHER: return "other"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DIET: return ""; - case DRUG: return ""; - case ENCOUNTER: return ""; - case OBSERVATION: return ""; - case PROCEDURE: return ""; - case SUPPLY: return ""; - case OTHER: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DIET: return "Plan for the patient to consume food of a specified nature."; - case DRUG: return "Plan for the patient to consume/receive a drug, vaccine or other product."; - case ENCOUNTER: return "Plan to meet or communicate with the patient (in-patient, out-patient, phone call, etc.)."; - case OBSERVATION: return "Plan to capture information about a patient (vitals, labs, diagnostic images, etc.)."; - case PROCEDURE: return "Plan to modify the patient in some way (surgery, physiotherapy, education, counseling, etc.)."; - case SUPPLY: return "Plan to provide something to the patient (medication, medical supply, etc.)."; - case OTHER: return "Some other form of action."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DIET: return "Diet"; - case DRUG: return "Drug"; - case ENCOUNTER: return "Encounter"; - case OBSERVATION: return "Observation"; - case PROCEDURE: return "Procedure"; - case SUPPLY: return "Supply"; - case OTHER: return "Other"; - default: return "?"; - } - } - } - - public static class CarePlanActivityCategoryEnumFactory implements EnumFactory { - public CarePlanActivityCategory fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("diet".equals(codeString)) - return CarePlanActivityCategory.DIET; - if ("drug".equals(codeString)) - return CarePlanActivityCategory.DRUG; - if ("encounter".equals(codeString)) - return CarePlanActivityCategory.ENCOUNTER; - if ("observation".equals(codeString)) - return CarePlanActivityCategory.OBSERVATION; - if ("procedure".equals(codeString)) - return CarePlanActivityCategory.PROCEDURE; - if ("supply".equals(codeString)) - return CarePlanActivityCategory.SUPPLY; - if ("other".equals(codeString)) - return CarePlanActivityCategory.OTHER; - throw new IllegalArgumentException("Unknown CarePlanActivityCategory code '"+codeString+"'"); - } - public String toCode(CarePlanActivityCategory code) { - if (code == CarePlanActivityCategory.DIET) - return "diet"; - if (code == CarePlanActivityCategory.DRUG) - return "drug"; - if (code == CarePlanActivityCategory.ENCOUNTER) - return "encounter"; - if (code == CarePlanActivityCategory.OBSERVATION) - return "observation"; - if (code == CarePlanActivityCategory.PROCEDURE) - return "procedure"; - if (code == CarePlanActivityCategory.SUPPLY) - return "supply"; - if (code == CarePlanActivityCategory.OTHER) - return "other"; - return "?"; - } - } - - public enum CarePlanActivityStatus { - /** - * Activity is planned but no action has yet been taken. - */ - NOTSTARTED, - /** - * Appointment or other booking has occurred but activity has not yet begun. - */ - SCHEDULED, - /** - * Activity has been started but is not yet complete. - */ - INPROGRESS, - /** - * Activity was started but has temporarily ceased with an expectation of resumption at a future time. - */ - ONHOLD, - /** - * The activities have been completed (more or less) as planned. - */ - COMPLETED, - /** - * The activities have been ended prior to completion (perhaps even before they were started). - */ - CANCELLED, - /** - * added to help the parsers - */ - NULL; - public static CarePlanActivityStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("not-started".equals(codeString)) - return NOTSTARTED; - if ("scheduled".equals(codeString)) - return SCHEDULED; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("on-hold".equals(codeString)) - return ONHOLD; - if ("completed".equals(codeString)) - return COMPLETED; - if ("cancelled".equals(codeString)) - return CANCELLED; - throw new Exception("Unknown CarePlanActivityStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case NOTSTARTED: return "not-started"; - case SCHEDULED: return "scheduled"; - case INPROGRESS: return "in-progress"; - case ONHOLD: return "on-hold"; - case COMPLETED: return "completed"; - case CANCELLED: return "cancelled"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case NOTSTARTED: return ""; - case SCHEDULED: return ""; - case INPROGRESS: return ""; - case ONHOLD: return ""; - case COMPLETED: return ""; - case CANCELLED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case NOTSTARTED: return "Activity is planned but no action has yet been taken."; - case SCHEDULED: return "Appointment or other booking has occurred but activity has not yet begun."; - case INPROGRESS: return "Activity has been started but is not yet complete."; - case ONHOLD: return "Activity was started but has temporarily ceased with an expectation of resumption at a future time."; - case COMPLETED: return "The activities have been completed (more or less) as planned."; - case CANCELLED: return "The activities have been ended prior to completion (perhaps even before they were started)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case NOTSTARTED: return "Not Started"; - case SCHEDULED: return "Scheduled"; - case INPROGRESS: return "In Progress"; - case ONHOLD: return "On Hold"; - case COMPLETED: return "Completed"; - case CANCELLED: return "Cancelled"; - default: return "?"; - } - } - } - - public static class CarePlanActivityStatusEnumFactory implements EnumFactory { - public CarePlanActivityStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("not-started".equals(codeString)) - return CarePlanActivityStatus.NOTSTARTED; - if ("scheduled".equals(codeString)) - return CarePlanActivityStatus.SCHEDULED; - if ("in-progress".equals(codeString)) - return CarePlanActivityStatus.INPROGRESS; - if ("on-hold".equals(codeString)) - return CarePlanActivityStatus.ONHOLD; - if ("completed".equals(codeString)) - return CarePlanActivityStatus.COMPLETED; - if ("cancelled".equals(codeString)) - return CarePlanActivityStatus.CANCELLED; - throw new IllegalArgumentException("Unknown CarePlanActivityStatus code '"+codeString+"'"); - } - public String toCode(CarePlanActivityStatus code) { - if (code == CarePlanActivityStatus.NOTSTARTED) - return "not-started"; - if (code == CarePlanActivityStatus.SCHEDULED) - return "scheduled"; - if (code == CarePlanActivityStatus.INPROGRESS) - return "in-progress"; - if (code == CarePlanActivityStatus.ONHOLD) - return "on-hold"; - if (code == CarePlanActivityStatus.COMPLETED) - return "completed"; - if (code == CarePlanActivityStatus.CANCELLED) - return "cancelled"; - return "?"; - } - } - - @Block() - public static class CarePlanParticipantComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Indicates specific responsibility of an individual within the care plan. E.g. "Primary physician", "Team coordinator", "Caregiver", etc. - */ - @Child(name = "role", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Type of involvement", formalDefinition="Indicates specific responsibility of an individual within the care plan. E.g. 'Primary physician', 'Team coordinator', 'Caregiver', etc." ) - protected CodeableConcept role; - - /** - * The specific person or organization who is participating/expected to participate in the care plan. - */ - @Child(name = "member", type = {Practitioner.class, RelatedPerson.class, Patient.class, Organization.class}, order=2, min=1, max=1) - @Description(shortDefinition="Who is involved", formalDefinition="The specific person or organization who is participating/expected to participate in the care plan." ) - protected Reference member; - - /** - * The actual object that is the target of the reference (The specific person or organization who is participating/expected to participate in the care plan.) - */ - protected Resource memberTarget; - - private static final long serialVersionUID = -466811117L; - - /* - * Constructor - */ - public CarePlanParticipantComponent() { - super(); - } - - /* - * Constructor - */ - public CarePlanParticipantComponent(Reference member) { - super(); - this.member = member; - } - - /** - * @return {@link #role} (Indicates specific responsibility of an individual within the care plan. E.g. "Primary physician", "Team coordinator", "Caregiver", etc.) - */ - public CodeableConcept getRole() { - if (this.role == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanParticipantComponent.role"); - else if (Configuration.doAutoCreate()) - this.role = new CodeableConcept(); // cc - return this.role; - } - - public boolean hasRole() { - return this.role != null && !this.role.isEmpty(); - } - - /** - * @param value {@link #role} (Indicates specific responsibility of an individual within the care plan. E.g. "Primary physician", "Team coordinator", "Caregiver", etc.) - */ - public CarePlanParticipantComponent setRole(CodeableConcept value) { - this.role = value; - return this; - } - - /** - * @return {@link #member} (The specific person or organization who is participating/expected to participate in the care plan.) - */ - public Reference getMember() { - if (this.member == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanParticipantComponent.member"); - else if (Configuration.doAutoCreate()) - this.member = new Reference(); // cc - return this.member; - } - - public boolean hasMember() { - return this.member != null && !this.member.isEmpty(); - } - - /** - * @param value {@link #member} (The specific person or organization who is participating/expected to participate in the care plan.) - */ - public CarePlanParticipantComponent setMember(Reference value) { - this.member = value; - return this; - } - - /** - * @return {@link #member} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The specific person or organization who is participating/expected to participate in the care plan.) - */ - public Resource getMemberTarget() { - return this.memberTarget; - } - - /** - * @param value {@link #member} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The specific person or organization who is participating/expected to participate in the care plan.) - */ - public CarePlanParticipantComponent setMemberTarget(Resource value) { - this.memberTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("role", "CodeableConcept", "Indicates specific responsibility of an individual within the care plan. E.g. 'Primary physician', 'Team coordinator', 'Caregiver', etc.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("member", "Reference(Practitioner|RelatedPerson|Patient|Organization)", "The specific person or organization who is participating/expected to participate in the care plan.", 0, java.lang.Integer.MAX_VALUE, member)); - } - - public CarePlanParticipantComponent copy() { - CarePlanParticipantComponent dst = new CarePlanParticipantComponent(); - copyValues(dst); - dst.role = role == null ? null : role.copy(); - dst.member = member == null ? null : member.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CarePlanParticipantComponent)) - return false; - CarePlanParticipantComponent o = (CarePlanParticipantComponent) other; - return compareDeep(role, o.role, true) && compareDeep(member, o.member, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CarePlanParticipantComponent)) - return false; - CarePlanParticipantComponent o = (CarePlanParticipantComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (role == null || role.isEmpty()) && (member == null || member.isEmpty()) - ; - } - - } - - @Block() - public static class CarePlanActivityComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc. - */ - @Child(name = "actionResulting", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Appointments, orders, etc.", formalDefinition="Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc." ) - protected List actionResulting; - /** - * The actual objects that are the target of the reference (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) - */ - protected List actionResultingTarget; - - - /** - * Notes about the execution of the activity. - */ - @Child(name = "notes", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Comments about the activity", formalDefinition="Notes about the execution of the activity." ) - protected StringType notes; - - /** - * The details of the proposed activity represented in a specific resource. - */ - @Child(name = "reference", type = {Appointment.class, CommunicationRequest.class, DeviceUseRequest.class, DiagnosticOrder.class, MedicationPrescription.class, NutritionOrder.class, Order.class, ProcedureRequest.class, ProcessRequest.class, ReferralRequest.class, Supply.class, VisionPrescription.class}, order=3, min=0, max=1) - @Description(shortDefinition="Activity details defined in specific resource", formalDefinition="The details of the proposed activity represented in a specific resource." ) - protected Reference reference; - - /** - * The actual object that is the target of the reference (The details of the proposed activity represented in a specific resource.) - */ - protected Resource referenceTarget; - - /** - * A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc. - */ - @Child(name = "detail", type = {}, order=4, min=0, max=1) - @Description(shortDefinition="In-line definition of activity", formalDefinition="A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc." ) - protected CarePlanActivityDetailComponent detail; - - private static final long serialVersionUID = -1011983328L; - - /* - * Constructor - */ - public CarePlanActivityComponent() { - super(); - } - - /** - * @return {@link #actionResulting} (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) - */ - public List getActionResulting() { - if (this.actionResulting == null) - this.actionResulting = new ArrayList(); - return this.actionResulting; - } - - public boolean hasActionResulting() { - if (this.actionResulting == null) - return false; - for (Reference item : this.actionResulting) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #actionResulting} (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) - */ - // syntactic sugar - public Reference addActionResulting() { //3 - Reference t = new Reference(); - if (this.actionResulting == null) - this.actionResulting = new ArrayList(); - this.actionResulting.add(t); - return t; - } - - // syntactic sugar - public CarePlanActivityComponent addActionResulting(Reference t) { //3 - if (t == null) - return this; - if (this.actionResulting == null) - this.actionResulting = new ArrayList(); - this.actionResulting.add(t); - return this; - } - - /** - * @return {@link #actionResulting} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) - */ - public List getActionResultingTarget() { - if (this.actionResultingTarget == null) - this.actionResultingTarget = new ArrayList(); - return this.actionResultingTarget; - } - - /** - * @return {@link #notes} (Notes about the execution of the activity.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public StringType getNotesElement() { - if (this.notes == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityComponent.notes"); - else if (Configuration.doAutoCreate()) - this.notes = new StringType(); // bb - return this.notes; - } - - public boolean hasNotesElement() { - return this.notes != null && !this.notes.isEmpty(); - } - - public boolean hasNotes() { - return this.notes != null && !this.notes.isEmpty(); - } - - /** - * @param value {@link #notes} (Notes about the execution of the activity.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public CarePlanActivityComponent setNotesElement(StringType value) { - this.notes = value; - return this; - } - - /** - * @return Notes about the execution of the activity. - */ - public String getNotes() { - return this.notes == null ? null : this.notes.getValue(); - } - - /** - * @param value Notes about the execution of the activity. - */ - public CarePlanActivityComponent setNotes(String value) { - if (Utilities.noString(value)) - this.notes = null; - else { - if (this.notes == null) - this.notes = new StringType(); - this.notes.setValue(value); - } - return this; - } - - /** - * @return {@link #reference} (The details of the proposed activity represented in a specific resource.) - */ - public Reference getReference() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityComponent.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new Reference(); // cc - return this.reference; - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (The details of the proposed activity represented in a specific resource.) - */ - public CarePlanActivityComponent setReference(Reference value) { - this.reference = value; - return this; - } - - /** - * @return {@link #reference} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The details of the proposed activity represented in a specific resource.) - */ - public Resource getReferenceTarget() { - return this.referenceTarget; - } - - /** - * @param value {@link #reference} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The details of the proposed activity represented in a specific resource.) - */ - public CarePlanActivityComponent setReferenceTarget(Resource value) { - this.referenceTarget = value; - return this; - } - - /** - * @return {@link #detail} (A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.) - */ - public CarePlanActivityDetailComponent getDetail() { - if (this.detail == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityComponent.detail"); - else if (Configuration.doAutoCreate()) - this.detail = new CarePlanActivityDetailComponent(); // cc - return this.detail; - } - - public boolean hasDetail() { - return this.detail != null && !this.detail.isEmpty(); - } - - /** - * @param value {@link #detail} (A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.) - */ - public CarePlanActivityComponent setDetail(CarePlanActivityDetailComponent value) { - this.detail = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("actionResulting", "Reference(Any)", "Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.", 0, java.lang.Integer.MAX_VALUE, actionResulting)); - childrenList.add(new Property("notes", "string", "Notes about the execution of the activity.", 0, java.lang.Integer.MAX_VALUE, notes)); - childrenList.add(new Property("reference", "Reference(Appointment|CommunicationRequest|DeviceUseRequest|DiagnosticOrder|MedicationPrescription|NutritionOrder|Order|ProcedureRequest|ProcessRequest|ReferralRequest|Supply|VisionPrescription)", "The details of the proposed activity represented in a specific resource.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("detail", "", "A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - public CarePlanActivityComponent copy() { - CarePlanActivityComponent dst = new CarePlanActivityComponent(); - copyValues(dst); - if (actionResulting != null) { - dst.actionResulting = new ArrayList(); - for (Reference i : actionResulting) - dst.actionResulting.add(i.copy()); - }; - dst.notes = notes == null ? null : notes.copy(); - dst.reference = reference == null ? null : reference.copy(); - dst.detail = detail == null ? null : detail.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CarePlanActivityComponent)) - return false; - CarePlanActivityComponent o = (CarePlanActivityComponent) other; - return compareDeep(actionResulting, o.actionResulting, true) && compareDeep(notes, o.notes, true) - && compareDeep(reference, o.reference, true) && compareDeep(detail, o.detail, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CarePlanActivityComponent)) - return false; - CarePlanActivityComponent o = (CarePlanActivityComponent) other; - return compareValues(notes, o.notes, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (actionResulting == null || actionResulting.isEmpty()) && (notes == null || notes.isEmpty()) - && (reference == null || reference.isEmpty()) && (detail == null || detail.isEmpty()); - } - - } - - @Block() - public static class CarePlanActivityDetailComponent extends BackboneElement implements IBaseBackboneElement { - /** - * High-level categorization of the type of activity in a care plan. - */ - @Child(name = "category", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="diet | drug | encounter | observation | procedure | supply | other", formalDefinition="High-level categorization of the type of activity in a care plan." ) - protected Enumeration category; - - /** - * Detailed description of the type of planned activity. E.g. What lab test, what procedure, what kind of encounter. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Detail type of activity", formalDefinition="Detailed description of the type of planned activity. E.g. What lab test, what procedure, what kind of encounter." ) - protected CodeableConcept code; - - /** - * Provides the health condition(s) or other rationale that drove the inclusion of this particular activity as part of the plan. - */ - @Child(name = "reason", type = {CodeableConcept.class, Condition.class}, order=3, min=0, max=1) - @Description(shortDefinition="Why activity should be done", formalDefinition="Provides the health condition(s) or other rationale that drove the inclusion of this particular activity as part of the plan." ) - protected Type reason; - - /** - * Internal reference that identifies the goals that this activity is intended to contribute towards meeting. - */ - @Child(name = "goal", type = {Goal.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Goals this activity relates to", formalDefinition="Internal reference that identifies the goals that this activity is intended to contribute towards meeting." ) - protected List goal; - /** - * The actual objects that are the target of the reference (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) - */ - protected List goalTarget; - - - /** - * Identifies what progress is being made for the specific activity. - */ - @Child(name = "status", type = {CodeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="not-started | scheduled | in-progress | on-hold | completed | cancelled", formalDefinition="Identifies what progress is being made for the specific activity." ) - protected Enumeration status; - - /** - * Provides reason why the activity isn't yet started, is on hold, was cancelled, etc. - */ - @Child(name = "statusReason", type = {CodeableConcept.class}, order=6, min=0, max=1) - @Description(shortDefinition="Reason for current status", formalDefinition="Provides reason why the activity isn't yet started, is on hold, was cancelled, etc." ) - protected CodeableConcept statusReason; - - /** - * If true, indicates that the described activity is one that must NOT be engaged in when following the plan. - */ - @Child(name = "prohibited", type = {BooleanType.class}, order=7, min=1, max=1) - @Description(shortDefinition="Do NOT do", formalDefinition="If true, indicates that the described activity is one that must NOT be engaged in when following the plan." ) - protected BooleanType prohibited; - - /** - * The period, timing or frequency upon which the described activity is to occur. - */ - @Child(name = "scheduled", type = {Timing.class, Period.class, StringType.class}, order=8, min=0, max=1) - @Description(shortDefinition="When activity is to occur", formalDefinition="The period, timing or frequency upon which the described activity is to occur." ) - protected Type scheduled; - - /** - * Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc. - */ - @Child(name = "location", type = {Location.class}, order=9, min=0, max=1) - @Description(shortDefinition="Where it should happen", formalDefinition="Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) - */ - protected Location locationTarget; - - /** - * Identifies who's expected to be involved in the activity. - */ - @Child(name = "performer", type = {Practitioner.class, Organization.class, RelatedPerson.class, Patient.class}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who will be responsible?", formalDefinition="Identifies who's expected to be involved in the activity." ) - protected List performer; - /** - * The actual objects that are the target of the reference (Identifies who's expected to be involved in the activity.) - */ - protected List performerTarget; - - - /** - * Identifies the food, drug or other product to be consumed or supplied in the activity. - */ - @Child(name = "product", type = {Medication.class, Substance.class}, order=11, min=0, max=1) - @Description(shortDefinition="What is to be administered/supplied", formalDefinition="Identifies the food, drug or other product to be consumed or supplied in the activity." ) - protected Reference product; - - /** - * The actual object that is the target of the reference (Identifies the food, drug or other product to be consumed or supplied in the activity.) - */ - protected Resource productTarget; - - /** - * Identifies the quantity expected to be consumed in a given day. - */ - @Child(name = "dailyAmount", type = {Quantity.class}, order=12, min=0, max=1) - @Description(shortDefinition="How to consume/day?", formalDefinition="Identifies the quantity expected to be consumed in a given day." ) - protected Quantity dailyAmount; - - /** - * Identifies the quantity expected to be supplied, addministered or consumed by the subject. - */ - @Child(name = "quantity", type = {Quantity.class}, order=13, min=0, max=1) - @Description(shortDefinition="How much to administer/supply/consume", formalDefinition="Identifies the quantity expected to be supplied, addministered or consumed by the subject." ) - protected Quantity quantity; - - /** - * This provides a textual description of constraints on the intended activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. - */ - @Child(name = "note", type = {StringType.class}, order=14, min=0, max=1) - @Description(shortDefinition="Extra info on activity occurrence", formalDefinition="This provides a textual description of constraints on the intended activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc." ) - protected StringType note; - - private static final long serialVersionUID = -1276666801L; - - /* - * Constructor - */ - public CarePlanActivityDetailComponent() { - super(); - } - - /* - * Constructor - */ - public CarePlanActivityDetailComponent(Enumeration category, BooleanType prohibited) { - super(); - this.category = category; - this.prohibited = prohibited; - } - - /** - * @return {@link #category} (High-level categorization of the type of activity in a care plan.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public Enumeration getCategoryElement() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.category"); - else if (Configuration.doAutoCreate()) - this.category = new Enumeration(new CarePlanActivityCategoryEnumFactory()); // bb - return this.category; - } - - public boolean hasCategoryElement() { - return this.category != null && !this.category.isEmpty(); - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (High-level categorization of the type of activity in a care plan.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public CarePlanActivityDetailComponent setCategoryElement(Enumeration value) { - this.category = value; - return this; - } - - /** - * @return High-level categorization of the type of activity in a care plan. - */ - public CarePlanActivityCategory getCategory() { - return this.category == null ? null : this.category.getValue(); - } - - /** - * @param value High-level categorization of the type of activity in a care plan. - */ - public CarePlanActivityDetailComponent setCategory(CarePlanActivityCategory value) { - if (this.category == null) - this.category = new Enumeration(new CarePlanActivityCategoryEnumFactory()); - this.category.setValue(value); - return this; - } - - /** - * @return {@link #code} (Detailed description of the type of planned activity. E.g. What lab test, what procedure, what kind of encounter.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Detailed description of the type of planned activity. E.g. What lab test, what procedure, what kind of encounter.) - */ - public CarePlanActivityDetailComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #reason} (Provides the health condition(s) or other rationale that drove the inclusion of this particular activity as part of the plan.) - */ - public Type getReason() { - return this.reason; - } - - /** - * @return {@link #reason} (Provides the health condition(s) or other rationale that drove the inclusion of this particular activity as part of the plan.) - */ - public CodeableConcept getReasonCodeableConcept() throws Exception { - if (!(this.reason instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (CodeableConcept) this.reason; - } - - /** - * @return {@link #reason} (Provides the health condition(s) or other rationale that drove the inclusion of this particular activity as part of the plan.) - */ - public Reference getReasonReference() throws Exception { - if (!(this.reason instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (Reference) this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Provides the health condition(s) or other rationale that drove the inclusion of this particular activity as part of the plan.) - */ - public CarePlanActivityDetailComponent setReason(Type value) { - this.reason = value; - return this; - } - - /** - * @return {@link #goal} (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) - */ - public List getGoal() { - if (this.goal == null) - this.goal = new ArrayList(); - return this.goal; - } - - public boolean hasGoal() { - if (this.goal == null) - return false; - for (Reference item : this.goal) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #goal} (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) - */ - // syntactic sugar - public Reference addGoal() { //3 - Reference t = new Reference(); - if (this.goal == null) - this.goal = new ArrayList(); - this.goal.add(t); - return t; - } - - // syntactic sugar - public CarePlanActivityDetailComponent addGoal(Reference t) { //3 - if (t == null) - return this; - if (this.goal == null) - this.goal = new ArrayList(); - this.goal.add(t); - return this; - } - - /** - * @return {@link #goal} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) - */ - public List getGoalTarget() { - if (this.goalTarget == null) - this.goalTarget = new ArrayList(); - return this.goalTarget; - } - - // syntactic sugar - /** - * @return {@link #goal} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) - */ - public Goal addGoalTarget() { - Goal r = new Goal(); - if (this.goalTarget == null) - this.goalTarget = new ArrayList(); - this.goalTarget.add(r); - return r; - } - - /** - * @return {@link #status} (Identifies what progress is being made for the specific activity.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new CarePlanActivityStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Identifies what progress is being made for the specific activity.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public CarePlanActivityDetailComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Identifies what progress is being made for the specific activity. - */ - public CarePlanActivityStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Identifies what progress is being made for the specific activity. - */ - public CarePlanActivityDetailComponent setStatus(CarePlanActivityStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new CarePlanActivityStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #statusReason} (Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.) - */ - public CodeableConcept getStatusReason() { - if (this.statusReason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.statusReason"); - else if (Configuration.doAutoCreate()) - this.statusReason = new CodeableConcept(); // cc - return this.statusReason; - } - - public boolean hasStatusReason() { - return this.statusReason != null && !this.statusReason.isEmpty(); - } - - /** - * @param value {@link #statusReason} (Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.) - */ - public CarePlanActivityDetailComponent setStatusReason(CodeableConcept value) { - this.statusReason = value; - return this; - } - - /** - * @return {@link #prohibited} (If true, indicates that the described activity is one that must NOT be engaged in when following the plan.). This is the underlying object with id, value and extensions. The accessor "getProhibited" gives direct access to the value - */ - public BooleanType getProhibitedElement() { - if (this.prohibited == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.prohibited"); - else if (Configuration.doAutoCreate()) - this.prohibited = new BooleanType(); // bb - return this.prohibited; - } - - public boolean hasProhibitedElement() { - return this.prohibited != null && !this.prohibited.isEmpty(); - } - - public boolean hasProhibited() { - return this.prohibited != null && !this.prohibited.isEmpty(); - } - - /** - * @param value {@link #prohibited} (If true, indicates that the described activity is one that must NOT be engaged in when following the plan.). This is the underlying object with id, value and extensions. The accessor "getProhibited" gives direct access to the value - */ - public CarePlanActivityDetailComponent setProhibitedElement(BooleanType value) { - this.prohibited = value; - return this; - } - - /** - * @return If true, indicates that the described activity is one that must NOT be engaged in when following the plan. - */ - public boolean getProhibited() { - return this.prohibited == null || this.prohibited.isEmpty() ? false : this.prohibited.getValue(); - } - - /** - * @param value If true, indicates that the described activity is one that must NOT be engaged in when following the plan. - */ - public CarePlanActivityDetailComponent setProhibited(boolean value) { - if (this.prohibited == null) - this.prohibited = new BooleanType(); - this.prohibited.setValue(value); - return this; - } - - /** - * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) - */ - public Type getScheduled() { - return this.scheduled; - } - - /** - * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) - */ - public Timing getScheduledTiming() throws Exception { - if (!(this.scheduled instanceof Timing)) - throw new Exception("Type mismatch: the type Timing was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (Timing) this.scheduled; - } - - /** - * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) - */ - public Period getScheduledPeriod() throws Exception { - if (!(this.scheduled instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (Period) this.scheduled; - } - - /** - * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) - */ - public StringType getScheduledStringType() throws Exception { - if (!(this.scheduled instanceof StringType)) - throw new Exception("Type mismatch: the type StringType was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (StringType) this.scheduled; - } - - public boolean hasScheduled() { - return this.scheduled != null && !this.scheduled.isEmpty(); - } - - /** - * @param value {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) - */ - public CarePlanActivityDetailComponent setScheduled(Type value) { - this.scheduled = value; - return this; - } - - /** - * @return {@link #location} (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); // cc - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) - */ - public CarePlanActivityDetailComponent setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); // aa - return this.locationTarget; - } - - /** - * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) - */ - public CarePlanActivityDetailComponent setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #performer} (Identifies who's expected to be involved in the activity.) - */ - public List getPerformer() { - if (this.performer == null) - this.performer = new ArrayList(); - return this.performer; - } - - public boolean hasPerformer() { - if (this.performer == null) - return false; - for (Reference item : this.performer) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #performer} (Identifies who's expected to be involved in the activity.) - */ - // syntactic sugar - public Reference addPerformer() { //3 - Reference t = new Reference(); - if (this.performer == null) - this.performer = new ArrayList(); - this.performer.add(t); - return t; - } - - // syntactic sugar - public CarePlanActivityDetailComponent addPerformer(Reference t) { //3 - if (t == null) - return this; - if (this.performer == null) - this.performer = new ArrayList(); - this.performer.add(t); - return this; - } - - /** - * @return {@link #performer} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies who's expected to be involved in the activity.) - */ - public List getPerformerTarget() { - if (this.performerTarget == null) - this.performerTarget = new ArrayList(); - return this.performerTarget; - } - - /** - * @return {@link #product} (Identifies the food, drug or other product to be consumed or supplied in the activity.) - */ - public Reference getProduct() { - if (this.product == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.product"); - else if (Configuration.doAutoCreate()) - this.product = new Reference(); // cc - return this.product; - } - - public boolean hasProduct() { - return this.product != null && !this.product.isEmpty(); - } - - /** - * @param value {@link #product} (Identifies the food, drug or other product to be consumed or supplied in the activity.) - */ - public CarePlanActivityDetailComponent setProduct(Reference value) { - this.product = value; - return this; - } - - /** - * @return {@link #product} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the food, drug or other product to be consumed or supplied in the activity.) - */ - public Resource getProductTarget() { - return this.productTarget; - } - - /** - * @param value {@link #product} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the food, drug or other product to be consumed or supplied in the activity.) - */ - public CarePlanActivityDetailComponent setProductTarget(Resource value) { - this.productTarget = value; - return this; - } - - /** - * @return {@link #dailyAmount} (Identifies the quantity expected to be consumed in a given day.) - */ - public Quantity getDailyAmount() { - if (this.dailyAmount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.dailyAmount"); - else if (Configuration.doAutoCreate()) - this.dailyAmount = new Quantity(); // cc - return this.dailyAmount; - } - - public boolean hasDailyAmount() { - return this.dailyAmount != null && !this.dailyAmount.isEmpty(); - } - - /** - * @param value {@link #dailyAmount} (Identifies the quantity expected to be consumed in a given day.) - */ - public CarePlanActivityDetailComponent setDailyAmount(Quantity value) { - this.dailyAmount = value; - return this; - } - - /** - * @return {@link #quantity} (Identifies the quantity expected to be supplied, addministered or consumed by the subject.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (Identifies the quantity expected to be supplied, addministered or consumed by the subject.) - */ - public CarePlanActivityDetailComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #note} (This provides a textual description of constraints on the intended activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value - */ - public StringType getNoteElement() { - if (this.note == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.note"); - else if (Configuration.doAutoCreate()) - this.note = new StringType(); // bb - 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} (This provides a textual description of constraints on the intended activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value - */ - public CarePlanActivityDetailComponent setNoteElement(StringType value) { - this.note = value; - return this; - } - - /** - * @return This provides a textual description of constraints on the intended activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. - */ - public String getNote() { - return this.note == null ? null : this.note.getValue(); - } - - /** - * @param value This provides a textual description of constraints on the intended activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. - */ - public CarePlanActivityDetailComponent setNote(String value) { - if (Utilities.noString(value)) - this.note = null; - else { - if (this.note == null) - this.note = new StringType(); - this.note.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("category", "code", "High-level categorization of the type of activity in a care plan.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("code", "CodeableConcept", "Detailed description of the type of planned activity. E.g. What lab test, what procedure, what kind of encounter.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Condition)", "Provides the health condition(s) or other rationale that drove the inclusion of this particular activity as part of the plan.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("goal", "Reference(Goal)", "Internal reference that identifies the goals that this activity is intended to contribute towards meeting.", 0, java.lang.Integer.MAX_VALUE, goal)); - childrenList.add(new Property("status", "code", "Identifies what progress is being made for the specific activity.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("statusReason", "CodeableConcept", "Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.", 0, java.lang.Integer.MAX_VALUE, statusReason)); - childrenList.add(new Property("prohibited", "boolean", "If true, indicates that the described activity is one that must NOT be engaged in when following the plan.", 0, java.lang.Integer.MAX_VALUE, prohibited)); - childrenList.add(new Property("scheduled[x]", "Timing|Period|string", "The period, timing or frequency upon which the described activity is to occur.", 0, java.lang.Integer.MAX_VALUE, scheduled)); - childrenList.add(new Property("location", "Reference(Location)", "Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("performer", "Reference(Practitioner|Organization|RelatedPerson|Patient)", "Identifies who's expected to be involved in the activity.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("product", "Reference(Medication|Substance)", "Identifies the food, drug or other product to be consumed or supplied in the activity.", 0, java.lang.Integer.MAX_VALUE, product)); - childrenList.add(new Property("dailyAmount", "Quantity", "Identifies the quantity expected to be consumed in a given day.", 0, java.lang.Integer.MAX_VALUE, dailyAmount)); - childrenList.add(new Property("quantity", "Quantity", "Identifies the quantity expected to be supplied, addministered or consumed by the subject.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("note", "string", "This provides a textual description of constraints on the intended activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.", 0, java.lang.Integer.MAX_VALUE, note)); - } - - public CarePlanActivityDetailComponent copy() { - CarePlanActivityDetailComponent dst = new CarePlanActivityDetailComponent(); - copyValues(dst); - dst.category = category == null ? null : category.copy(); - dst.code = code == null ? null : code.copy(); - dst.reason = reason == null ? null : reason.copy(); - if (goal != null) { - dst.goal = new ArrayList(); - for (Reference i : goal) - dst.goal.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.statusReason = statusReason == null ? null : statusReason.copy(); - dst.prohibited = prohibited == null ? null : prohibited.copy(); - dst.scheduled = scheduled == null ? null : scheduled.copy(); - dst.location = location == null ? null : location.copy(); - if (performer != null) { - dst.performer = new ArrayList(); - for (Reference i : performer) - dst.performer.add(i.copy()); - }; - dst.product = product == null ? null : product.copy(); - dst.dailyAmount = dailyAmount == null ? null : dailyAmount.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.note = note == null ? null : note.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CarePlanActivityDetailComponent)) - return false; - CarePlanActivityDetailComponent o = (CarePlanActivityDetailComponent) other; - return compareDeep(category, o.category, true) && compareDeep(code, o.code, true) && compareDeep(reason, o.reason, true) - && compareDeep(goal, o.goal, true) && compareDeep(status, o.status, true) && compareDeep(statusReason, o.statusReason, true) - && compareDeep(prohibited, o.prohibited, true) && compareDeep(scheduled, o.scheduled, true) && compareDeep(location, o.location, true) - && compareDeep(performer, o.performer, true) && compareDeep(product, o.product, true) && compareDeep(dailyAmount, o.dailyAmount, true) - && compareDeep(quantity, o.quantity, true) && compareDeep(note, o.note, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CarePlanActivityDetailComponent)) - return false; - CarePlanActivityDetailComponent o = (CarePlanActivityDetailComponent) other; - return compareValues(category, o.category, true) && compareValues(status, o.status, true) && compareValues(prohibited, o.prohibited, true) - && compareValues(note, o.note, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (category == null || category.isEmpty()) && (code == null || code.isEmpty()) - && (reason == null || reason.isEmpty()) && (goal == null || goal.isEmpty()) && (status == null || status.isEmpty()) - && (statusReason == null || statusReason.isEmpty()) && (prohibited == null || prohibited.isEmpty()) - && (scheduled == null || scheduled.isEmpty()) && (location == null || location.isEmpty()) - && (performer == null || performer.isEmpty()) && (product == null || product.isEmpty()) && (dailyAmount == null || dailyAmount.isEmpty()) - && (quantity == null || quantity.isEmpty()) && (note == null || note.isEmpty()); - } - - } - - /** - * This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External Ids for this plan", formalDefinition="This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) - protected List identifier; - - /** - * Identifies the patient/subject whose intended care is described by the plan. - */ - @Child(name = "patient", type = {Patient.class}, order=1, min=0, max=1) - @Description(shortDefinition="Who care plan is for", formalDefinition="Identifies the patient/subject whose intended care is described by the plan." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (Identifies the patient/subject whose intended care is described by the plan.) - */ - protected Patient patientTarget; - - /** - * Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="planned | active | completed", formalDefinition="Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record." ) - protected Enumeration status; - - /** - * Indicates when the plan did (or is intended to) come into effect and end. - */ - @Child(name = "period", type = {Period.class}, order=3, min=0, max=1) - @Description(shortDefinition="Time period plan covers", formalDefinition="Indicates when the plan did (or is intended to) come into effect and end." ) - protected Period period; - - /** - * Identifies the individual(s) or ogranization who is responsible for the content of the care plan. - */ - @Child(name = "author", type = {Patient.class, Practitioner.class, RelatedPerson.class, Organization.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who is responsible for plan", formalDefinition="Identifies the individual(s) or ogranization who is responsible for the content of the care plan." ) - protected List author; - /** - * The actual objects that are the target of the reference (Identifies the individual(s) or ogranization who is responsible for the content of the care plan.) - */ - protected List authorTarget; - - - /** - * Identifies the most recent date on which the plan has been revised. - */ - @Child(name = "modified", type = {DateTimeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="When last updated", formalDefinition="Identifies the most recent date on which the plan has been revised." ) - protected DateTimeType modified; - - /** - * Identifies what "kind" of plan this is to support differentiation between multiple co-existing plans. E.g. "Home health", "psychiatric", "asthma", "disease management", etc. - */ - @Child(name = "category", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Type of plan", formalDefinition="Identifies what 'kind' of plan this is to support differentiation between multiple co-existing plans. E.g. 'Home health', 'psychiatric', 'asthma', 'disease management', etc." ) - protected List category; - - /** - * Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan. - */ - @Child(name = "concern", type = {Condition.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Health issues this plan addresses", formalDefinition="Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan." ) - protected List concern; - /** - * The actual objects that are the target of the reference (Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) - */ - protected List concernTarget; - - - /** - * Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc. - */ - @Child(name = "support", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Information considered as part of plan", formalDefinition="Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc." ) - protected List support; - /** - * The actual objects that are the target of the reference (Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc.) - */ - protected List supportTarget; - - - /** - * Identifies all people and organizations who are expected to be involved in the care envisioned by this plan. - */ - @Child(name = "participant", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who's involved in plan?", formalDefinition="Identifies all people and organizations who are expected to be involved in the care envisioned by this plan." ) - protected List participant; - - /** - * Describes the intended objective(s) of carrying out the Care Plan. - */ - @Child(name = "goal", type = {Goal.class}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Desired outcome of plan", formalDefinition="Describes the intended objective(s) of carrying out the Care Plan." ) - protected List goal; - /** - * The actual objects that are the target of the reference (Describes the intended objective(s) of carrying out the Care Plan.) - */ - protected List goalTarget; - - - /** - * Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc. - */ - @Child(name = "activity", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Action to occur as part of plan", formalDefinition="Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc." ) - protected List activity; - - /** - * General notes about the care plan not covered elsewhere. - */ - @Child(name = "notes", type = {StringType.class}, order=12, min=0, max=1) - @Description(shortDefinition="Comments about the plan", formalDefinition="General notes about the care plan not covered elsewhere." ) - protected StringType notes; - - private static final long serialVersionUID = -1877285959L; - - /* - * Constructor - */ - public CarePlan() { - super(); - } - - /* - * Constructor - */ - public CarePlan(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public CarePlan addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlan.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.) - */ - public CarePlan setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlan.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.) - */ - public CarePlan setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #status} (Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlan.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new CarePlanStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public CarePlan setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record. - */ - public CarePlanStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record. - */ - public CarePlan setStatus(CarePlanStatus value) { - if (this.status == null) - this.status = new Enumeration(new CarePlanStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #period} (Indicates when the plan did (or is intended to) come into effect and end.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlan.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (Indicates when the plan did (or is intended to) come into effect and end.) - */ - public CarePlan setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #author} (Identifies the individual(s) or ogranization who is responsible for the content of the care plan.) - */ - public List getAuthor() { - if (this.author == null) - this.author = new ArrayList(); - return this.author; - } - - public boolean hasAuthor() { - if (this.author == null) - return false; - for (Reference item : this.author) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #author} (Identifies the individual(s) or ogranization who is responsible for the content of the care plan.) - */ - // syntactic sugar - public Reference addAuthor() { //3 - Reference t = new Reference(); - if (this.author == null) - this.author = new ArrayList(); - this.author.add(t); - return t; - } - - // syntactic sugar - public CarePlan addAuthor(Reference t) { //3 - if (t == null) - return this; - if (this.author == null) - this.author = new ArrayList(); - this.author.add(t); - return this; - } - - /** - * @return {@link #author} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies the individual(s) or ogranization who is responsible for the content of the care plan.) - */ - public List getAuthorTarget() { - if (this.authorTarget == null) - this.authorTarget = new ArrayList(); - return this.authorTarget; - } - - /** - * @return {@link #modified} (Identifies the most recent date on which the plan has been revised.). This is the underlying object with id, value and extensions. The accessor "getModified" gives direct access to the value - */ - public DateTimeType getModifiedElement() { - if (this.modified == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlan.modified"); - else if (Configuration.doAutoCreate()) - this.modified = new DateTimeType(); // bb - return this.modified; - } - - public boolean hasModifiedElement() { - return this.modified != null && !this.modified.isEmpty(); - } - - public boolean hasModified() { - return this.modified != null && !this.modified.isEmpty(); - } - - /** - * @param value {@link #modified} (Identifies the most recent date on which the plan has been revised.). This is the underlying object with id, value and extensions. The accessor "getModified" gives direct access to the value - */ - public CarePlan setModifiedElement(DateTimeType value) { - this.modified = value; - return this; - } - - /** - * @return Identifies the most recent date on which the plan has been revised. - */ - public Date getModified() { - return this.modified == null ? null : this.modified.getValue(); - } - - /** - * @param value Identifies the most recent date on which the plan has been revised. - */ - public CarePlan setModified(Date value) { - if (value == null) - this.modified = null; - else { - if (this.modified == null) - this.modified = new DateTimeType(); - this.modified.setValue(value); - } - return this; - } - - /** - * @return {@link #category} (Identifies what "kind" of plan this is to support differentiation between multiple co-existing plans. E.g. "Home health", "psychiatric", "asthma", "disease management", etc.) - */ - public List getCategory() { - if (this.category == null) - this.category = new ArrayList(); - return this.category; - } - - public boolean hasCategory() { - if (this.category == null) - return false; - for (CodeableConcept item : this.category) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #category} (Identifies what "kind" of plan this is to support differentiation between multiple co-existing plans. E.g. "Home health", "psychiatric", "asthma", "disease management", etc.) - */ - // syntactic sugar - public CodeableConcept addCategory() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.category == null) - this.category = new ArrayList(); - this.category.add(t); - return t; - } - - // syntactic sugar - public CarePlan addCategory(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.category == null) - this.category = new ArrayList(); - this.category.add(t); - return this; - } - - /** - * @return {@link #concern} (Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) - */ - public List getConcern() { - if (this.concern == null) - this.concern = new ArrayList(); - return this.concern; - } - - public boolean hasConcern() { - if (this.concern == null) - return false; - for (Reference item : this.concern) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #concern} (Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) - */ - // syntactic sugar - public Reference addConcern() { //3 - Reference t = new Reference(); - if (this.concern == null) - this.concern = new ArrayList(); - this.concern.add(t); - return t; - } - - // syntactic sugar - public CarePlan addConcern(Reference t) { //3 - if (t == null) - return this; - if (this.concern == null) - this.concern = new ArrayList(); - this.concern.add(t); - return this; - } - - /** - * @return {@link #concern} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) - */ - public List getConcernTarget() { - if (this.concernTarget == null) - this.concernTarget = new ArrayList(); - return this.concernTarget; - } - - // syntactic sugar - /** - * @return {@link #concern} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) - */ - public Condition addConcernTarget() { - Condition r = new Condition(); - if (this.concernTarget == null) - this.concernTarget = new ArrayList(); - this.concernTarget.add(r); - return r; - } - - /** - * @return {@link #support} (Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc.) - */ - public List getSupport() { - if (this.support == null) - this.support = new ArrayList(); - return this.support; - } - - public boolean hasSupport() { - if (this.support == null) - return false; - for (Reference item : this.support) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #support} (Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc.) - */ - // syntactic sugar - public Reference addSupport() { //3 - Reference t = new Reference(); - if (this.support == null) - this.support = new ArrayList(); - this.support.add(t); - return t; - } - - // syntactic sugar - public CarePlan addSupport(Reference t) { //3 - if (t == null) - return this; - if (this.support == null) - this.support = new ArrayList(); - this.support.add(t); - return this; - } - - /** - * @return {@link #support} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc.) - */ - public List getSupportTarget() { - if (this.supportTarget == null) - this.supportTarget = new ArrayList(); - return this.supportTarget; - } - - /** - * @return {@link #participant} (Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.) - */ - public List getParticipant() { - if (this.participant == null) - this.participant = new ArrayList(); - return this.participant; - } - - public boolean hasParticipant() { - if (this.participant == null) - return false; - for (CarePlanParticipantComponent item : this.participant) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #participant} (Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.) - */ - // syntactic sugar - public CarePlanParticipantComponent addParticipant() { //3 - CarePlanParticipantComponent t = new CarePlanParticipantComponent(); - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return t; - } - - // syntactic sugar - public CarePlan addParticipant(CarePlanParticipantComponent t) { //3 - if (t == null) - return this; - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return this; - } - - /** - * @return {@link #goal} (Describes the intended objective(s) of carrying out the Care Plan.) - */ - public List getGoal() { - if (this.goal == null) - this.goal = new ArrayList(); - return this.goal; - } - - public boolean hasGoal() { - if (this.goal == null) - return false; - for (Reference item : this.goal) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #goal} (Describes the intended objective(s) of carrying out the Care Plan.) - */ - // syntactic sugar - public Reference addGoal() { //3 - Reference t = new Reference(); - if (this.goal == null) - this.goal = new ArrayList(); - this.goal.add(t); - return t; - } - - // syntactic sugar - public CarePlan addGoal(Reference t) { //3 - if (t == null) - return this; - if (this.goal == null) - this.goal = new ArrayList(); - this.goal.add(t); - return this; - } - - /** - * @return {@link #goal} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Describes the intended objective(s) of carrying out the Care Plan.) - */ - public List getGoalTarget() { - if (this.goalTarget == null) - this.goalTarget = new ArrayList(); - return this.goalTarget; - } - - // syntactic sugar - /** - * @return {@link #goal} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Describes the intended objective(s) of carrying out the Care Plan.) - */ - public Goal addGoalTarget() { - Goal r = new Goal(); - if (this.goalTarget == null) - this.goalTarget = new ArrayList(); - this.goalTarget.add(r); - return r; - } - - /** - * @return {@link #activity} (Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.) - */ - public List getActivity() { - if (this.activity == null) - this.activity = new ArrayList(); - return this.activity; - } - - public boolean hasActivity() { - if (this.activity == null) - return false; - for (CarePlanActivityComponent item : this.activity) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #activity} (Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.) - */ - // syntactic sugar - public CarePlanActivityComponent addActivity() { //3 - CarePlanActivityComponent t = new CarePlanActivityComponent(); - if (this.activity == null) - this.activity = new ArrayList(); - this.activity.add(t); - return t; - } - - // syntactic sugar - public CarePlan addActivity(CarePlanActivityComponent t) { //3 - if (t == null) - return this; - if (this.activity == null) - this.activity = new ArrayList(); - this.activity.add(t); - return this; - } - - /** - * @return {@link #notes} (General notes about the care plan not covered elsewhere.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public StringType getNotesElement() { - if (this.notes == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlan.notes"); - else if (Configuration.doAutoCreate()) - this.notes = new StringType(); // bb - return this.notes; - } - - public boolean hasNotesElement() { - return this.notes != null && !this.notes.isEmpty(); - } - - public boolean hasNotes() { - return this.notes != null && !this.notes.isEmpty(); - } - - /** - * @param value {@link #notes} (General notes about the care plan not covered elsewhere.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public CarePlan setNotesElement(StringType value) { - this.notes = value; - return this; - } - - /** - * @return General notes about the care plan not covered elsewhere. - */ - public String getNotes() { - return this.notes == null ? null : this.notes.getValue(); - } - - /** - * @param value General notes about the care plan not covered elsewhere. - */ - public CarePlan setNotes(String value) { - if (Utilities.noString(value)) - this.notes = null; - else { - if (this.notes == null) - this.notes = new StringType(); - this.notes.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("patient", "Reference(Patient)", "Identifies the patient/subject whose intended care is described by the plan.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("status", "code", "Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("period", "Period", "Indicates when the plan did (or is intended to) come into effect and end.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("author", "Reference(Patient|Practitioner|RelatedPerson|Organization)", "Identifies the individual(s) or ogranization who is responsible for the content of the care plan.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("modified", "dateTime", "Identifies the most recent date on which the plan has been revised.", 0, java.lang.Integer.MAX_VALUE, modified)); - childrenList.add(new Property("category", "CodeableConcept", "Identifies what 'kind' of plan this is to support differentiation between multiple co-existing plans. E.g. 'Home health', 'psychiatric', 'asthma', 'disease management', etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("concern", "Reference(Condition)", "Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.", 0, java.lang.Integer.MAX_VALUE, concern)); - childrenList.add(new Property("support", "Reference(Any)", "Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc.", 0, java.lang.Integer.MAX_VALUE, support)); - childrenList.add(new Property("participant", "", "Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.", 0, java.lang.Integer.MAX_VALUE, participant)); - childrenList.add(new Property("goal", "Reference(Goal)", "Describes the intended objective(s) of carrying out the Care Plan.", 0, java.lang.Integer.MAX_VALUE, goal)); - childrenList.add(new Property("activity", "", "Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.", 0, java.lang.Integer.MAX_VALUE, activity)); - childrenList.add(new Property("notes", "string", "General notes about the care plan not covered elsewhere.", 0, java.lang.Integer.MAX_VALUE, notes)); - } - - public CarePlan copy() { - CarePlan dst = new CarePlan(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - dst.status = status == null ? null : status.copy(); - dst.period = period == null ? null : period.copy(); - if (author != null) { - dst.author = new ArrayList(); - for (Reference i : author) - dst.author.add(i.copy()); - }; - dst.modified = modified == null ? null : modified.copy(); - if (category != null) { - dst.category = new ArrayList(); - for (CodeableConcept i : category) - dst.category.add(i.copy()); - }; - if (concern != null) { - dst.concern = new ArrayList(); - for (Reference i : concern) - dst.concern.add(i.copy()); - }; - if (support != null) { - dst.support = new ArrayList(); - for (Reference i : support) - dst.support.add(i.copy()); - }; - if (participant != null) { - dst.participant = new ArrayList(); - for (CarePlanParticipantComponent i : participant) - dst.participant.add(i.copy()); - }; - if (goal != null) { - dst.goal = new ArrayList(); - for (Reference i : goal) - dst.goal.add(i.copy()); - }; - if (activity != null) { - dst.activity = new ArrayList(); - for (CarePlanActivityComponent i : activity) - dst.activity.add(i.copy()); - }; - dst.notes = notes == null ? null : notes.copy(); - return dst; - } - - protected CarePlan typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CarePlan)) - return false; - CarePlan o = (CarePlan) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(status, o.status, true) - && compareDeep(period, o.period, true) && compareDeep(author, o.author, true) && compareDeep(modified, o.modified, true) - && compareDeep(category, o.category, true) && compareDeep(concern, o.concern, true) && compareDeep(support, o.support, true) - && compareDeep(participant, o.participant, true) && compareDeep(goal, o.goal, true) && compareDeep(activity, o.activity, true) - && compareDeep(notes, o.notes, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CarePlan)) - return false; - CarePlan o = (CarePlan) other; - return compareValues(status, o.status, true) && compareValues(modified, o.modified, true) && compareValues(notes, o.notes, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) - && (status == null || status.isEmpty()) && (period == null || period.isEmpty()) && (author == null || author.isEmpty()) - && (modified == null || modified.isEmpty()) && (category == null || category.isEmpty()) && (concern == null || concern.isEmpty()) - && (support == null || support.isEmpty()) && (participant == null || participant.isEmpty()) - && (goal == null || goal.isEmpty()) && (activity == null || activity.isEmpty()) && (notes == null || notes.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.CarePlan; - } - - @SearchParamDefinition(name="activitycode", path="CarePlan.activity.detail.code", description="Detail type of activity", type="token" ) - public static final String SP_ACTIVITYCODE = "activitycode"; - @SearchParamDefinition(name="patient", path="CarePlan.patient", description="Who care plan is for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="condition", path="CarePlan.concern", description="Health issues this plan addresses", type="reference" ) - public static final String SP_CONDITION = "condition"; - @SearchParamDefinition(name="activitydate", path="CarePlan.activity.detail.scheduled[x]", description="Specified date occurs within period specified by CarePlan.activity.timingSchedule", type="date" ) - public static final String SP_ACTIVITYDATE = "activitydate"; - @SearchParamDefinition(name="performer", path="CarePlan.activity.detail.performer", description="Matches if the practitioner is listed as a performer in any of the 'simple' activities. (For performers of the detailed activities, chain through the activitydetail search parameter.)", type="reference" ) - public static final String SP_PERFORMER = "performer"; - @SearchParamDefinition(name="participant", path="CarePlan.participant.member", description="Who is involved", type="reference" ) - public static final String SP_PARTICIPANT = "participant"; - @SearchParamDefinition(name="date", path="CarePlan.period", description="Time period plan covers", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="goal", path="CarePlan.goal", description="Desired outcome of plan", type="reference" ) - public static final String SP_GOAL = "goal"; - @SearchParamDefinition(name="activityreference", path="CarePlan.activity.reference", description="Activity details defined in specific resource", type="reference" ) - public static final String SP_ACTIVITYREFERENCE = "activityreference"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions. + */ +@ResourceDef(name="CarePlan", profile="http://hl7.org/fhir/Profile/CarePlan") +public class CarePlan extends DomainResource { + + public enum CarePlanStatus { + /** + * The plan is in development or awaiting use but is not yet intended to be acted upon. + */ + PLANNED, + /** + * The plan is intended to be followed and used as part of patient care. + */ + ACTIVE, + /** + * The plan is no longer in use and is not expected to be followed or used in patient care. + */ + COMPLETED, + /** + * added to help the parsers + */ + NULL; + public static CarePlanStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return PLANNED; + if ("active".equals(codeString)) + return ACTIVE; + if ("completed".equals(codeString)) + return COMPLETED; + throw new Exception("Unknown CarePlanStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PLANNED: return "planned"; + case ACTIVE: return "active"; + case COMPLETED: return "completed"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PLANNED: return ""; + case ACTIVE: return ""; + case COMPLETED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PLANNED: return "The plan is in development or awaiting use but is not yet intended to be acted upon."; + case ACTIVE: return "The plan is intended to be followed and used as part of patient care."; + case COMPLETED: return "The plan is no longer in use and is not expected to be followed or used in patient care."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PLANNED: return "Planned"; + case ACTIVE: return "Active"; + case COMPLETED: return "Completed"; + default: return "?"; + } + } + } + + public static class CarePlanStatusEnumFactory implements EnumFactory { + public CarePlanStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return CarePlanStatus.PLANNED; + if ("active".equals(codeString)) + return CarePlanStatus.ACTIVE; + if ("completed".equals(codeString)) + return CarePlanStatus.COMPLETED; + throw new IllegalArgumentException("Unknown CarePlanStatus code '"+codeString+"'"); + } + public String toCode(CarePlanStatus code) { + if (code == CarePlanStatus.PLANNED) + return "planned"; + if (code == CarePlanStatus.ACTIVE) + return "active"; + if (code == CarePlanStatus.COMPLETED) + return "completed"; + return "?"; + } + } + + public enum CarePlanActivityCategory { + /** + * Plan for the patient to consume food of a specified nature. + */ + DIET, + /** + * Plan for the patient to consume/receive a drug, vaccine or other product. + */ + DRUG, + /** + * Plan to meet or communicate with the patient (in-patient, out-patient, phone call, etc.). + */ + ENCOUNTER, + /** + * Plan to capture information about a patient (vitals, labs, diagnostic images, etc.). + */ + OBSERVATION, + /** + * Plan to modify the patient in some way (surgery, physiotherapy, education, counseling, etc.). + */ + PROCEDURE, + /** + * Plan to provide something to the patient (medication, medical supply, etc.). + */ + SUPPLY, + /** + * Some other form of action. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + public static CarePlanActivityCategory fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("diet".equals(codeString)) + return DIET; + if ("drug".equals(codeString)) + return DRUG; + if ("encounter".equals(codeString)) + return ENCOUNTER; + if ("observation".equals(codeString)) + return OBSERVATION; + if ("procedure".equals(codeString)) + return PROCEDURE; + if ("supply".equals(codeString)) + return SUPPLY; + if ("other".equals(codeString)) + return OTHER; + throw new Exception("Unknown CarePlanActivityCategory code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case DIET: return "diet"; + case DRUG: return "drug"; + case ENCOUNTER: return "encounter"; + case OBSERVATION: return "observation"; + case PROCEDURE: return "procedure"; + case SUPPLY: return "supply"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DIET: return ""; + case DRUG: return ""; + case ENCOUNTER: return ""; + case OBSERVATION: return ""; + case PROCEDURE: return ""; + case SUPPLY: return ""; + case OTHER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DIET: return "Plan for the patient to consume food of a specified nature."; + case DRUG: return "Plan for the patient to consume/receive a drug, vaccine or other product."; + case ENCOUNTER: return "Plan to meet or communicate with the patient (in-patient, out-patient, phone call, etc.)."; + case OBSERVATION: return "Plan to capture information about a patient (vitals, labs, diagnostic images, etc.)."; + case PROCEDURE: return "Plan to modify the patient in some way (surgery, physiotherapy, education, counseling, etc.)."; + case SUPPLY: return "Plan to provide something to the patient (medication, medical supply, etc.)."; + case OTHER: return "Some other form of action."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DIET: return "Diet"; + case DRUG: return "Drug"; + case ENCOUNTER: return "Encounter"; + case OBSERVATION: return "Observation"; + case PROCEDURE: return "Procedure"; + case SUPPLY: return "Supply"; + case OTHER: return "Other"; + default: return "?"; + } + } + } + + public static class CarePlanActivityCategoryEnumFactory implements EnumFactory { + public CarePlanActivityCategory fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("diet".equals(codeString)) + return CarePlanActivityCategory.DIET; + if ("drug".equals(codeString)) + return CarePlanActivityCategory.DRUG; + if ("encounter".equals(codeString)) + return CarePlanActivityCategory.ENCOUNTER; + if ("observation".equals(codeString)) + return CarePlanActivityCategory.OBSERVATION; + if ("procedure".equals(codeString)) + return CarePlanActivityCategory.PROCEDURE; + if ("supply".equals(codeString)) + return CarePlanActivityCategory.SUPPLY; + if ("other".equals(codeString)) + return CarePlanActivityCategory.OTHER; + throw new IllegalArgumentException("Unknown CarePlanActivityCategory code '"+codeString+"'"); + } + public String toCode(CarePlanActivityCategory code) { + if (code == CarePlanActivityCategory.DIET) + return "diet"; + if (code == CarePlanActivityCategory.DRUG) + return "drug"; + if (code == CarePlanActivityCategory.ENCOUNTER) + return "encounter"; + if (code == CarePlanActivityCategory.OBSERVATION) + return "observation"; + if (code == CarePlanActivityCategory.PROCEDURE) + return "procedure"; + if (code == CarePlanActivityCategory.SUPPLY) + return "supply"; + if (code == CarePlanActivityCategory.OTHER) + return "other"; + return "?"; + } + } + + public enum CarePlanActivityStatus { + /** + * Activity is planned but no action has yet been taken. + */ + NOTSTARTED, + /** + * Appointment or other booking has occurred but activity has not yet begun. + */ + SCHEDULED, + /** + * Activity has been started but is not yet complete. + */ + INPROGRESS, + /** + * Activity was started but has temporarily ceased with an expectation of resumption at a future time. + */ + ONHOLD, + /** + * The activities have been completed (more or less) as planned. + */ + COMPLETED, + /** + * The activities have been ended prior to completion (perhaps even before they were started). + */ + CANCELLED, + /** + * added to help the parsers + */ + NULL; + public static CarePlanActivityStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("not-started".equals(codeString)) + return NOTSTARTED; + if ("scheduled".equals(codeString)) + return SCHEDULED; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("on-hold".equals(codeString)) + return ONHOLD; + if ("completed".equals(codeString)) + return COMPLETED; + if ("cancelled".equals(codeString)) + return CANCELLED; + throw new Exception("Unknown CarePlanActivityStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case NOTSTARTED: return "not-started"; + case SCHEDULED: return "scheduled"; + case INPROGRESS: return "in-progress"; + case ONHOLD: return "on-hold"; + case COMPLETED: return "completed"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case NOTSTARTED: return ""; + case SCHEDULED: return ""; + case INPROGRESS: return ""; + case ONHOLD: return ""; + case COMPLETED: return ""; + case CANCELLED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case NOTSTARTED: return "Activity is planned but no action has yet been taken."; + case SCHEDULED: return "Appointment or other booking has occurred but activity has not yet begun."; + case INPROGRESS: return "Activity has been started but is not yet complete."; + case ONHOLD: return "Activity was started but has temporarily ceased with an expectation of resumption at a future time."; + case COMPLETED: return "The activities have been completed (more or less) as planned."; + case CANCELLED: return "The activities have been ended prior to completion (perhaps even before they were started)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NOTSTARTED: return "Not Started"; + case SCHEDULED: return "Scheduled"; + case INPROGRESS: return "In Progress"; + case ONHOLD: return "On Hold"; + case COMPLETED: return "Completed"; + case CANCELLED: return "Cancelled"; + default: return "?"; + } + } + } + + public static class CarePlanActivityStatusEnumFactory implements EnumFactory { + public CarePlanActivityStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("not-started".equals(codeString)) + return CarePlanActivityStatus.NOTSTARTED; + if ("scheduled".equals(codeString)) + return CarePlanActivityStatus.SCHEDULED; + if ("in-progress".equals(codeString)) + return CarePlanActivityStatus.INPROGRESS; + if ("on-hold".equals(codeString)) + return CarePlanActivityStatus.ONHOLD; + if ("completed".equals(codeString)) + return CarePlanActivityStatus.COMPLETED; + if ("cancelled".equals(codeString)) + return CarePlanActivityStatus.CANCELLED; + throw new IllegalArgumentException("Unknown CarePlanActivityStatus code '"+codeString+"'"); + } + public String toCode(CarePlanActivityStatus code) { + if (code == CarePlanActivityStatus.NOTSTARTED) + return "not-started"; + if (code == CarePlanActivityStatus.SCHEDULED) + return "scheduled"; + if (code == CarePlanActivityStatus.INPROGRESS) + return "in-progress"; + if (code == CarePlanActivityStatus.ONHOLD) + return "on-hold"; + if (code == CarePlanActivityStatus.COMPLETED) + return "completed"; + if (code == CarePlanActivityStatus.CANCELLED) + return "cancelled"; + return "?"; + } + } + + @Block() + public static class CarePlanParticipantComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Indicates specific responsibility of an individual within the care plan. E.g. "Primary physician", "Team coordinator", "Caregiver", etc. + */ + @Child(name = "role", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Type of involvement", formalDefinition="Indicates specific responsibility of an individual within the care plan. E.g. 'Primary physician', 'Team coordinator', 'Caregiver', etc." ) + protected CodeableConcept role; + + /** + * The specific person or organization who is participating/expected to participate in the care plan. + */ + @Child(name = "member", type = {Practitioner.class, RelatedPerson.class, Patient.class, Organization.class}, order=2, min=1, max=1) + @Description(shortDefinition="Who is involved", formalDefinition="The specific person or organization who is participating/expected to participate in the care plan." ) + protected Reference member; + + /** + * The actual object that is the target of the reference (The specific person or organization who is participating/expected to participate in the care plan.) + */ + protected Resource memberTarget; + + private static final long serialVersionUID = -466811117L; + + /* + * Constructor + */ + public CarePlanParticipantComponent() { + super(); + } + + /* + * Constructor + */ + public CarePlanParticipantComponent(Reference member) { + super(); + this.member = member; + } + + /** + * @return {@link #role} (Indicates specific responsibility of an individual within the care plan. E.g. "Primary physician", "Team coordinator", "Caregiver", etc.) + */ + public CodeableConcept getRole() { + if (this.role == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanParticipantComponent.role"); + else if (Configuration.doAutoCreate()) + this.role = new CodeableConcept(); // cc + return this.role; + } + + public boolean hasRole() { + return this.role != null && !this.role.isEmpty(); + } + + /** + * @param value {@link #role} (Indicates specific responsibility of an individual within the care plan. E.g. "Primary physician", "Team coordinator", "Caregiver", etc.) + */ + public CarePlanParticipantComponent setRole(CodeableConcept value) { + this.role = value; + return this; + } + + /** + * @return {@link #member} (The specific person or organization who is participating/expected to participate in the care plan.) + */ + public Reference getMember() { + if (this.member == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanParticipantComponent.member"); + else if (Configuration.doAutoCreate()) + this.member = new Reference(); // cc + return this.member; + } + + public boolean hasMember() { + return this.member != null && !this.member.isEmpty(); + } + + /** + * @param value {@link #member} (The specific person or organization who is participating/expected to participate in the care plan.) + */ + public CarePlanParticipantComponent setMember(Reference value) { + this.member = value; + return this; + } + + /** + * @return {@link #member} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The specific person or organization who is participating/expected to participate in the care plan.) + */ + public Resource getMemberTarget() { + return this.memberTarget; + } + + /** + * @param value {@link #member} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The specific person or organization who is participating/expected to participate in the care plan.) + */ + public CarePlanParticipantComponent setMemberTarget(Resource value) { + this.memberTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("role", "CodeableConcept", "Indicates specific responsibility of an individual within the care plan. E.g. 'Primary physician', 'Team coordinator', 'Caregiver', etc.", 0, java.lang.Integer.MAX_VALUE, role)); + childrenList.add(new Property("member", "Reference(Practitioner|RelatedPerson|Patient|Organization)", "The specific person or organization who is participating/expected to participate in the care plan.", 0, java.lang.Integer.MAX_VALUE, member)); + } + + public CarePlanParticipantComponent copy() { + CarePlanParticipantComponent dst = new CarePlanParticipantComponent(); + copyValues(dst); + dst.role = role == null ? null : role.copy(); + dst.member = member == null ? null : member.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CarePlanParticipantComponent)) + return false; + CarePlanParticipantComponent o = (CarePlanParticipantComponent) other; + return compareDeep(role, o.role, true) && compareDeep(member, o.member, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CarePlanParticipantComponent)) + return false; + CarePlanParticipantComponent o = (CarePlanParticipantComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (role == null || role.isEmpty()) && (member == null || member.isEmpty()) + ; + } + + } + + @Block() + public static class CarePlanActivityComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc. + */ + @Child(name = "actionResulting", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Appointments, orders, etc.", formalDefinition="Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc." ) + protected List actionResulting; + /** + * The actual objects that are the target of the reference (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) + */ + protected List actionResultingTarget; + + + /** + * Notes about the execution of the activity. + */ + @Child(name = "notes", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Comments about the activity", formalDefinition="Notes about the execution of the activity." ) + protected StringType notes; + + /** + * The details of the proposed activity represented in a specific resource. + */ + @Child(name = "reference", type = {Appointment.class, CommunicationRequest.class, DeviceUseRequest.class, DiagnosticOrder.class, MedicationPrescription.class, NutritionOrder.class, Order.class, ProcedureRequest.class, ProcessRequest.class, ReferralRequest.class, Supply.class, VisionPrescription.class}, order=3, min=0, max=1) + @Description(shortDefinition="Activity details defined in specific resource", formalDefinition="The details of the proposed activity represented in a specific resource." ) + protected Reference reference; + + /** + * The actual object that is the target of the reference (The details of the proposed activity represented in a specific resource.) + */ + protected Resource referenceTarget; + + /** + * A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc. + */ + @Child(name = "detail", type = {}, order=4, min=0, max=1) + @Description(shortDefinition="In-line definition of activity", formalDefinition="A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc." ) + protected CarePlanActivityDetailComponent detail; + + private static final long serialVersionUID = -1011983328L; + + /* + * Constructor + */ + public CarePlanActivityComponent() { + super(); + } + + /** + * @return {@link #actionResulting} (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) + */ + public List getActionResulting() { + if (this.actionResulting == null) + this.actionResulting = new ArrayList(); + return this.actionResulting; + } + + public boolean hasActionResulting() { + if (this.actionResulting == null) + return false; + for (Reference item : this.actionResulting) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #actionResulting} (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) + */ + // syntactic sugar + public Reference addActionResulting() { //3 + Reference t = new Reference(); + if (this.actionResulting == null) + this.actionResulting = new ArrayList(); + this.actionResulting.add(t); + return t; + } + + // syntactic sugar + public CarePlanActivityComponent addActionResulting(Reference t) { //3 + if (t == null) + return this; + if (this.actionResulting == null) + this.actionResulting = new ArrayList(); + this.actionResulting.add(t); + return this; + } + + /** + * @return {@link #actionResulting} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) + */ + public List getActionResultingTarget() { + if (this.actionResultingTarget == null) + this.actionResultingTarget = new ArrayList(); + return this.actionResultingTarget; + } + + /** + * @return {@link #notes} (Notes about the execution of the activity.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public StringType getNotesElement() { + if (this.notes == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityComponent.notes"); + else if (Configuration.doAutoCreate()) + this.notes = new StringType(); // bb + return this.notes; + } + + public boolean hasNotesElement() { + return this.notes != null && !this.notes.isEmpty(); + } + + public boolean hasNotes() { + return this.notes != null && !this.notes.isEmpty(); + } + + /** + * @param value {@link #notes} (Notes about the execution of the activity.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public CarePlanActivityComponent setNotesElement(StringType value) { + this.notes = value; + return this; + } + + /** + * @return Notes about the execution of the activity. + */ + public String getNotes() { + return this.notes == null ? null : this.notes.getValue(); + } + + /** + * @param value Notes about the execution of the activity. + */ + public CarePlanActivityComponent setNotes(String value) { + if (Utilities.noString(value)) + this.notes = null; + else { + if (this.notes == null) + this.notes = new StringType(); + this.notes.setValue(value); + } + return this; + } + + /** + * @return {@link #reference} (The details of the proposed activity represented in a specific resource.) + */ + public Reference getReference() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityComponent.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new Reference(); // cc + return this.reference; + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (The details of the proposed activity represented in a specific resource.) + */ + public CarePlanActivityComponent setReference(Reference value) { + this.reference = value; + return this; + } + + /** + * @return {@link #reference} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The details of the proposed activity represented in a specific resource.) + */ + public Resource getReferenceTarget() { + return this.referenceTarget; + } + + /** + * @param value {@link #reference} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The details of the proposed activity represented in a specific resource.) + */ + public CarePlanActivityComponent setReferenceTarget(Resource value) { + this.referenceTarget = value; + return this; + } + + /** + * @return {@link #detail} (A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.) + */ + public CarePlanActivityDetailComponent getDetail() { + if (this.detail == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityComponent.detail"); + else if (Configuration.doAutoCreate()) + this.detail = new CarePlanActivityDetailComponent(); // cc + return this.detail; + } + + public boolean hasDetail() { + return this.detail != null && !this.detail.isEmpty(); + } + + /** + * @param value {@link #detail} (A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.) + */ + public CarePlanActivityComponent setDetail(CarePlanActivityDetailComponent value) { + this.detail = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("actionResulting", "Reference(Any)", "Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.", 0, java.lang.Integer.MAX_VALUE, actionResulting)); + childrenList.add(new Property("notes", "string", "Notes about the execution of the activity.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("reference", "Reference(Appointment|CommunicationRequest|DeviceUseRequest|DiagnosticOrder|MedicationPrescription|NutritionOrder|Order|ProcedureRequest|ProcessRequest|ReferralRequest|Supply|VisionPrescription)", "The details of the proposed activity represented in a specific resource.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("detail", "", "A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public CarePlanActivityComponent copy() { + CarePlanActivityComponent dst = new CarePlanActivityComponent(); + copyValues(dst); + if (actionResulting != null) { + dst.actionResulting = new ArrayList(); + for (Reference i : actionResulting) + dst.actionResulting.add(i.copy()); + }; + dst.notes = notes == null ? null : notes.copy(); + dst.reference = reference == null ? null : reference.copy(); + dst.detail = detail == null ? null : detail.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CarePlanActivityComponent)) + return false; + CarePlanActivityComponent o = (CarePlanActivityComponent) other; + return compareDeep(actionResulting, o.actionResulting, true) && compareDeep(notes, o.notes, true) + && compareDeep(reference, o.reference, true) && compareDeep(detail, o.detail, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CarePlanActivityComponent)) + return false; + CarePlanActivityComponent o = (CarePlanActivityComponent) other; + return compareValues(notes, o.notes, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (actionResulting == null || actionResulting.isEmpty()) && (notes == null || notes.isEmpty()) + && (reference == null || reference.isEmpty()) && (detail == null || detail.isEmpty()); + } + + } + + @Block() + public static class CarePlanActivityDetailComponent extends BackboneElement implements IBaseBackboneElement { + /** + * High-level categorization of the type of activity in a care plan. + */ + @Child(name = "category", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="diet | drug | encounter | observation | procedure | supply | other", formalDefinition="High-level categorization of the type of activity in a care plan." ) + protected Enumeration category; + + /** + * Detailed description of the type of planned activity. E.g. What lab test, what procedure, what kind of encounter. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Detail type of activity", formalDefinition="Detailed description of the type of planned activity. E.g. What lab test, what procedure, what kind of encounter." ) + protected CodeableConcept code; + + /** + * Provides the health condition(s) or other rationale that drove the inclusion of this particular activity as part of the plan. + */ + @Child(name = "reason", type = {CodeableConcept.class, Condition.class}, order=3, min=0, max=1) + @Description(shortDefinition="Why activity should be done", formalDefinition="Provides the health condition(s) or other rationale that drove the inclusion of this particular activity as part of the plan." ) + protected Type reason; + + /** + * Internal reference that identifies the goals that this activity is intended to contribute towards meeting. + */ + @Child(name = "goal", type = {Goal.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Goals this activity relates to", formalDefinition="Internal reference that identifies the goals that this activity is intended to contribute towards meeting." ) + protected List goal; + /** + * The actual objects that are the target of the reference (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) + */ + protected List goalTarget; + + + /** + * Identifies what progress is being made for the specific activity. + */ + @Child(name = "status", type = {CodeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="not-started | scheduled | in-progress | on-hold | completed | cancelled", formalDefinition="Identifies what progress is being made for the specific activity." ) + protected Enumeration status; + + /** + * Provides reason why the activity isn't yet started, is on hold, was cancelled, etc. + */ + @Child(name = "statusReason", type = {CodeableConcept.class}, order=6, min=0, max=1) + @Description(shortDefinition="Reason for current status", formalDefinition="Provides reason why the activity isn't yet started, is on hold, was cancelled, etc." ) + protected CodeableConcept statusReason; + + /** + * If true, indicates that the described activity is one that must NOT be engaged in when following the plan. + */ + @Child(name = "prohibited", type = {BooleanType.class}, order=7, min=1, max=1) + @Description(shortDefinition="Do NOT do", formalDefinition="If true, indicates that the described activity is one that must NOT be engaged in when following the plan." ) + protected BooleanType prohibited; + + /** + * The period, timing or frequency upon which the described activity is to occur. + */ + @Child(name = "scheduled", type = {Timing.class, Period.class, StringType.class}, order=8, min=0, max=1) + @Description(shortDefinition="When activity is to occur", formalDefinition="The period, timing or frequency upon which the described activity is to occur." ) + protected Type scheduled; + + /** + * Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc. + */ + @Child(name = "location", type = {Location.class}, order=9, min=0, max=1) + @Description(shortDefinition="Where it should happen", formalDefinition="Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) + */ + protected Location locationTarget; + + /** + * Identifies who's expected to be involved in the activity. + */ + @Child(name = "performer", type = {Practitioner.class, Organization.class, RelatedPerson.class, Patient.class}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who will be responsible?", formalDefinition="Identifies who's expected to be involved in the activity." ) + protected List performer; + /** + * The actual objects that are the target of the reference (Identifies who's expected to be involved in the activity.) + */ + protected List performerTarget; + + + /** + * Identifies the food, drug or other product to be consumed or supplied in the activity. + */ + @Child(name = "product", type = {Medication.class, Substance.class}, order=11, min=0, max=1) + @Description(shortDefinition="What is to be administered/supplied", formalDefinition="Identifies the food, drug or other product to be consumed or supplied in the activity." ) + protected Reference product; + + /** + * The actual object that is the target of the reference (Identifies the food, drug or other product to be consumed or supplied in the activity.) + */ + protected Resource productTarget; + + /** + * Identifies the quantity expected to be consumed in a given day. + */ + @Child(name = "dailyAmount", type = {Quantity.class}, order=12, min=0, max=1) + @Description(shortDefinition="How to consume/day?", formalDefinition="Identifies the quantity expected to be consumed in a given day." ) + protected Quantity dailyAmount; + + /** + * Identifies the quantity expected to be supplied, addministered or consumed by the subject. + */ + @Child(name = "quantity", type = {Quantity.class}, order=13, min=0, max=1) + @Description(shortDefinition="How much to administer/supply/consume", formalDefinition="Identifies the quantity expected to be supplied, addministered or consumed by the subject." ) + protected Quantity quantity; + + /** + * This provides a textual description of constraints on the intended activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. + */ + @Child(name = "note", type = {StringType.class}, order=14, min=0, max=1) + @Description(shortDefinition="Extra info on activity occurrence", formalDefinition="This provides a textual description of constraints on the intended activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc." ) + protected StringType note; + + private static final long serialVersionUID = -1276666801L; + + /* + * Constructor + */ + public CarePlanActivityDetailComponent() { + super(); + } + + /* + * Constructor + */ + public CarePlanActivityDetailComponent(Enumeration category, BooleanType prohibited) { + super(); + this.category = category; + this.prohibited = prohibited; + } + + /** + * @return {@link #category} (High-level categorization of the type of activity in a care plan.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public Enumeration getCategoryElement() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.category"); + else if (Configuration.doAutoCreate()) + this.category = new Enumeration(new CarePlanActivityCategoryEnumFactory()); // bb + return this.category; + } + + public boolean hasCategoryElement() { + return this.category != null && !this.category.isEmpty(); + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (High-level categorization of the type of activity in a care plan.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public CarePlanActivityDetailComponent setCategoryElement(Enumeration value) { + this.category = value; + return this; + } + + /** + * @return High-level categorization of the type of activity in a care plan. + */ + public CarePlanActivityCategory getCategory() { + return this.category == null ? null : this.category.getValue(); + } + + /** + * @param value High-level categorization of the type of activity in a care plan. + */ + public CarePlanActivityDetailComponent setCategory(CarePlanActivityCategory value) { + if (this.category == null) + this.category = new Enumeration(new CarePlanActivityCategoryEnumFactory()); + this.category.setValue(value); + return this; + } + + /** + * @return {@link #code} (Detailed description of the type of planned activity. E.g. What lab test, what procedure, what kind of encounter.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Detailed description of the type of planned activity. E.g. What lab test, what procedure, what kind of encounter.) + */ + public CarePlanActivityDetailComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #reason} (Provides the health condition(s) or other rationale that drove the inclusion of this particular activity as part of the plan.) + */ + public Type getReason() { + return this.reason; + } + + /** + * @return {@link #reason} (Provides the health condition(s) or other rationale that drove the inclusion of this particular activity as part of the plan.) + */ + public CodeableConcept getReasonCodeableConcept() throws Exception { + if (!(this.reason instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (CodeableConcept) this.reason; + } + + /** + * @return {@link #reason} (Provides the health condition(s) or other rationale that drove the inclusion of this particular activity as part of the plan.) + */ + public Reference getReasonReference() throws Exception { + if (!(this.reason instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (Reference) this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Provides the health condition(s) or other rationale that drove the inclusion of this particular activity as part of the plan.) + */ + public CarePlanActivityDetailComponent setReason(Type value) { + this.reason = value; + return this; + } + + /** + * @return {@link #goal} (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) + */ + public List getGoal() { + if (this.goal == null) + this.goal = new ArrayList(); + return this.goal; + } + + public boolean hasGoal() { + if (this.goal == null) + return false; + for (Reference item : this.goal) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #goal} (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) + */ + // syntactic sugar + public Reference addGoal() { //3 + Reference t = new Reference(); + if (this.goal == null) + this.goal = new ArrayList(); + this.goal.add(t); + return t; + } + + // syntactic sugar + public CarePlanActivityDetailComponent addGoal(Reference t) { //3 + if (t == null) + return this; + if (this.goal == null) + this.goal = new ArrayList(); + this.goal.add(t); + return this; + } + + /** + * @return {@link #goal} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) + */ + public List getGoalTarget() { + if (this.goalTarget == null) + this.goalTarget = new ArrayList(); + return this.goalTarget; + } + + // syntactic sugar + /** + * @return {@link #goal} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) + */ + public Goal addGoalTarget() { + Goal r = new Goal(); + if (this.goalTarget == null) + this.goalTarget = new ArrayList(); + this.goalTarget.add(r); + return r; + } + + /** + * @return {@link #status} (Identifies what progress is being made for the specific activity.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new CarePlanActivityStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (Identifies what progress is being made for the specific activity.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public CarePlanActivityDetailComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Identifies what progress is being made for the specific activity. + */ + public CarePlanActivityStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Identifies what progress is being made for the specific activity. + */ + public CarePlanActivityDetailComponent setStatus(CarePlanActivityStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new CarePlanActivityStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #statusReason} (Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.) + */ + public CodeableConcept getStatusReason() { + if (this.statusReason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.statusReason"); + else if (Configuration.doAutoCreate()) + this.statusReason = new CodeableConcept(); // cc + return this.statusReason; + } + + public boolean hasStatusReason() { + return this.statusReason != null && !this.statusReason.isEmpty(); + } + + /** + * @param value {@link #statusReason} (Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.) + */ + public CarePlanActivityDetailComponent setStatusReason(CodeableConcept value) { + this.statusReason = value; + return this; + } + + /** + * @return {@link #prohibited} (If true, indicates that the described activity is one that must NOT be engaged in when following the plan.). This is the underlying object with id, value and extensions. The accessor "getProhibited" gives direct access to the value + */ + public BooleanType getProhibitedElement() { + if (this.prohibited == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.prohibited"); + else if (Configuration.doAutoCreate()) + this.prohibited = new BooleanType(); // bb + return this.prohibited; + } + + public boolean hasProhibitedElement() { + return this.prohibited != null && !this.prohibited.isEmpty(); + } + + public boolean hasProhibited() { + return this.prohibited != null && !this.prohibited.isEmpty(); + } + + /** + * @param value {@link #prohibited} (If true, indicates that the described activity is one that must NOT be engaged in when following the plan.). This is the underlying object with id, value and extensions. The accessor "getProhibited" gives direct access to the value + */ + public CarePlanActivityDetailComponent setProhibitedElement(BooleanType value) { + this.prohibited = value; + return this; + } + + /** + * @return If true, indicates that the described activity is one that must NOT be engaged in when following the plan. + */ + public boolean getProhibited() { + return this.prohibited == null || this.prohibited.isEmpty() ? false : this.prohibited.getValue(); + } + + /** + * @param value If true, indicates that the described activity is one that must NOT be engaged in when following the plan. + */ + public CarePlanActivityDetailComponent setProhibited(boolean value) { + if (this.prohibited == null) + this.prohibited = new BooleanType(); + this.prohibited.setValue(value); + return this; + } + + /** + * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public Type getScheduled() { + return this.scheduled; + } + + /** + * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public Timing getScheduledTiming() throws Exception { + if (!(this.scheduled instanceof Timing)) + throw new Exception("Type mismatch: the type Timing was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (Timing) this.scheduled; + } + + /** + * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public Period getScheduledPeriod() throws Exception { + if (!(this.scheduled instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (Period) this.scheduled; + } + + /** + * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public StringType getScheduledStringType() throws Exception { + if (!(this.scheduled instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (StringType) this.scheduled; + } + + public boolean hasScheduled() { + return this.scheduled != null && !this.scheduled.isEmpty(); + } + + /** + * @param value {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public CarePlanActivityDetailComponent setScheduled(Type value) { + this.scheduled = value; + return this; + } + + /** + * @return {@link #location} (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); // cc + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) + */ + public CarePlanActivityDetailComponent setLocation(Reference value) { + this.location = value; + return this; + } + + /** + * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); // aa + return this.locationTarget; + } + + /** + * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) + */ + public CarePlanActivityDetailComponent setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #performer} (Identifies who's expected to be involved in the activity.) + */ + public List getPerformer() { + if (this.performer == null) + this.performer = new ArrayList(); + return this.performer; + } + + public boolean hasPerformer() { + if (this.performer == null) + return false; + for (Reference item : this.performer) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #performer} (Identifies who's expected to be involved in the activity.) + */ + // syntactic sugar + public Reference addPerformer() { //3 + Reference t = new Reference(); + if (this.performer == null) + this.performer = new ArrayList(); + this.performer.add(t); + return t; + } + + // syntactic sugar + public CarePlanActivityDetailComponent addPerformer(Reference t) { //3 + if (t == null) + return this; + if (this.performer == null) + this.performer = new ArrayList(); + this.performer.add(t); + return this; + } + + /** + * @return {@link #performer} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies who's expected to be involved in the activity.) + */ + public List getPerformerTarget() { + if (this.performerTarget == null) + this.performerTarget = new ArrayList(); + return this.performerTarget; + } + + /** + * @return {@link #product} (Identifies the food, drug or other product to be consumed or supplied in the activity.) + */ + public Reference getProduct() { + if (this.product == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.product"); + else if (Configuration.doAutoCreate()) + this.product = new Reference(); // cc + return this.product; + } + + public boolean hasProduct() { + return this.product != null && !this.product.isEmpty(); + } + + /** + * @param value {@link #product} (Identifies the food, drug or other product to be consumed or supplied in the activity.) + */ + public CarePlanActivityDetailComponent setProduct(Reference value) { + this.product = value; + return this; + } + + /** + * @return {@link #product} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the food, drug or other product to be consumed or supplied in the activity.) + */ + public Resource getProductTarget() { + return this.productTarget; + } + + /** + * @param value {@link #product} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the food, drug or other product to be consumed or supplied in the activity.) + */ + public CarePlanActivityDetailComponent setProductTarget(Resource value) { + this.productTarget = value; + return this; + } + + /** + * @return {@link #dailyAmount} (Identifies the quantity expected to be consumed in a given day.) + */ + public Quantity getDailyAmount() { + if (this.dailyAmount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.dailyAmount"); + else if (Configuration.doAutoCreate()) + this.dailyAmount = new Quantity(); // cc + return this.dailyAmount; + } + + public boolean hasDailyAmount() { + return this.dailyAmount != null && !this.dailyAmount.isEmpty(); + } + + /** + * @param value {@link #dailyAmount} (Identifies the quantity expected to be consumed in a given day.) + */ + public CarePlanActivityDetailComponent setDailyAmount(Quantity value) { + this.dailyAmount = value; + return this; + } + + /** + * @return {@link #quantity} (Identifies the quantity expected to be supplied, addministered or consumed by the subject.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (Identifies the quantity expected to be supplied, addministered or consumed by the subject.) + */ + public CarePlanActivityDetailComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #note} (This provides a textual description of constraints on the intended activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value + */ + public StringType getNoteElement() { + if (this.note == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.note"); + else if (Configuration.doAutoCreate()) + this.note = new StringType(); // bb + 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} (This provides a textual description of constraints on the intended activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value + */ + public CarePlanActivityDetailComponent setNoteElement(StringType value) { + this.note = value; + return this; + } + + /** + * @return This provides a textual description of constraints on the intended activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. + */ + public String getNote() { + return this.note == null ? null : this.note.getValue(); + } + + /** + * @param value This provides a textual description of constraints on the intended activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. + */ + public CarePlanActivityDetailComponent setNote(String value) { + if (Utilities.noString(value)) + this.note = null; + else { + if (this.note == null) + this.note = new StringType(); + this.note.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("category", "code", "High-level categorization of the type of activity in a care plan.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("code", "CodeableConcept", "Detailed description of the type of planned activity. E.g. What lab test, what procedure, what kind of encounter.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Condition)", "Provides the health condition(s) or other rationale that drove the inclusion of this particular activity as part of the plan.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("goal", "Reference(Goal)", "Internal reference that identifies the goals that this activity is intended to contribute towards meeting.", 0, java.lang.Integer.MAX_VALUE, goal)); + childrenList.add(new Property("status", "code", "Identifies what progress is being made for the specific activity.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("statusReason", "CodeableConcept", "Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.", 0, java.lang.Integer.MAX_VALUE, statusReason)); + childrenList.add(new Property("prohibited", "boolean", "If true, indicates that the described activity is one that must NOT be engaged in when following the plan.", 0, java.lang.Integer.MAX_VALUE, prohibited)); + childrenList.add(new Property("scheduled[x]", "Timing|Period|string", "The period, timing or frequency upon which the described activity is to occur.", 0, java.lang.Integer.MAX_VALUE, scheduled)); + childrenList.add(new Property("location", "Reference(Location)", "Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("performer", "Reference(Practitioner|Organization|RelatedPerson|Patient)", "Identifies who's expected to be involved in the activity.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("product", "Reference(Medication|Substance)", "Identifies the food, drug or other product to be consumed or supplied in the activity.", 0, java.lang.Integer.MAX_VALUE, product)); + childrenList.add(new Property("dailyAmount", "Quantity", "Identifies the quantity expected to be consumed in a given day.", 0, java.lang.Integer.MAX_VALUE, dailyAmount)); + childrenList.add(new Property("quantity", "Quantity", "Identifies the quantity expected to be supplied, addministered or consumed by the subject.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("note", "string", "This provides a textual description of constraints on the intended activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.", 0, java.lang.Integer.MAX_VALUE, note)); + } + + public CarePlanActivityDetailComponent copy() { + CarePlanActivityDetailComponent dst = new CarePlanActivityDetailComponent(); + copyValues(dst); + dst.category = category == null ? null : category.copy(); + dst.code = code == null ? null : code.copy(); + dst.reason = reason == null ? null : reason.copy(); + if (goal != null) { + dst.goal = new ArrayList(); + for (Reference i : goal) + dst.goal.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.statusReason = statusReason == null ? null : statusReason.copy(); + dst.prohibited = prohibited == null ? null : prohibited.copy(); + dst.scheduled = scheduled == null ? null : scheduled.copy(); + dst.location = location == null ? null : location.copy(); + if (performer != null) { + dst.performer = new ArrayList(); + for (Reference i : performer) + dst.performer.add(i.copy()); + }; + dst.product = product == null ? null : product.copy(); + dst.dailyAmount = dailyAmount == null ? null : dailyAmount.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.note = note == null ? null : note.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CarePlanActivityDetailComponent)) + return false; + CarePlanActivityDetailComponent o = (CarePlanActivityDetailComponent) other; + return compareDeep(category, o.category, true) && compareDeep(code, o.code, true) && compareDeep(reason, o.reason, true) + && compareDeep(goal, o.goal, true) && compareDeep(status, o.status, true) && compareDeep(statusReason, o.statusReason, true) + && compareDeep(prohibited, o.prohibited, true) && compareDeep(scheduled, o.scheduled, true) && compareDeep(location, o.location, true) + && compareDeep(performer, o.performer, true) && compareDeep(product, o.product, true) && compareDeep(dailyAmount, o.dailyAmount, true) + && compareDeep(quantity, o.quantity, true) && compareDeep(note, o.note, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CarePlanActivityDetailComponent)) + return false; + CarePlanActivityDetailComponent o = (CarePlanActivityDetailComponent) other; + return compareValues(category, o.category, true) && compareValues(status, o.status, true) && compareValues(prohibited, o.prohibited, true) + && compareValues(note, o.note, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (category == null || category.isEmpty()) && (code == null || code.isEmpty()) + && (reason == null || reason.isEmpty()) && (goal == null || goal.isEmpty()) && (status == null || status.isEmpty()) + && (statusReason == null || statusReason.isEmpty()) && (prohibited == null || prohibited.isEmpty()) + && (scheduled == null || scheduled.isEmpty()) && (location == null || location.isEmpty()) + && (performer == null || performer.isEmpty()) && (product == null || product.isEmpty()) && (dailyAmount == null || dailyAmount.isEmpty()) + && (quantity == null || quantity.isEmpty()) && (note == null || note.isEmpty()); + } + + } + + /** + * This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Ids for this plan", formalDefinition="This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) + protected List identifier; + + /** + * Identifies the patient/subject whose intended care is described by the plan. + */ + @Child(name = "patient", type = {Patient.class}, order=1, min=0, max=1) + @Description(shortDefinition="Who care plan is for", formalDefinition="Identifies the patient/subject whose intended care is described by the plan." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Identifies the patient/subject whose intended care is described by the plan.) + */ + protected Patient patientTarget; + + /** + * Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="planned | active | completed", formalDefinition="Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record." ) + protected Enumeration status; + + /** + * Indicates when the plan did (or is intended to) come into effect and end. + */ + @Child(name = "period", type = {Period.class}, order=3, min=0, max=1) + @Description(shortDefinition="Time period plan covers", formalDefinition="Indicates when the plan did (or is intended to) come into effect and end." ) + protected Period period; + + /** + * Identifies the individual(s) or ogranization who is responsible for the content of the care plan. + */ + @Child(name = "author", type = {Patient.class, Practitioner.class, RelatedPerson.class, Organization.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who is responsible for plan", formalDefinition="Identifies the individual(s) or ogranization who is responsible for the content of the care plan." ) + protected List author; + /** + * The actual objects that are the target of the reference (Identifies the individual(s) or ogranization who is responsible for the content of the care plan.) + */ + protected List authorTarget; + + + /** + * Identifies the most recent date on which the plan has been revised. + */ + @Child(name = "modified", type = {DateTimeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="When last updated", formalDefinition="Identifies the most recent date on which the plan has been revised." ) + protected DateTimeType modified; + + /** + * Identifies what "kind" of plan this is to support differentiation between multiple co-existing plans. E.g. "Home health", "psychiatric", "asthma", "disease management", etc. + */ + @Child(name = "category", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Type of plan", formalDefinition="Identifies what 'kind' of plan this is to support differentiation between multiple co-existing plans. E.g. 'Home health', 'psychiatric', 'asthma', 'disease management', etc." ) + protected List category; + + /** + * Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan. + */ + @Child(name = "concern", type = {Condition.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Health issues this plan addresses", formalDefinition="Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan." ) + protected List concern; + /** + * The actual objects that are the target of the reference (Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) + */ + protected List concernTarget; + + + /** + * Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc. + */ + @Child(name = "support", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Information considered as part of plan", formalDefinition="Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc." ) + protected List support; + /** + * The actual objects that are the target of the reference (Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc.) + */ + protected List supportTarget; + + + /** + * Identifies all people and organizations who are expected to be involved in the care envisioned by this plan. + */ + @Child(name = "participant", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who's involved in plan?", formalDefinition="Identifies all people and organizations who are expected to be involved in the care envisioned by this plan." ) + protected List participant; + + /** + * Describes the intended objective(s) of carrying out the Care Plan. + */ + @Child(name = "goal", type = {Goal.class}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Desired outcome of plan", formalDefinition="Describes the intended objective(s) of carrying out the Care Plan." ) + protected List goal; + /** + * The actual objects that are the target of the reference (Describes the intended objective(s) of carrying out the Care Plan.) + */ + protected List goalTarget; + + + /** + * Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc. + */ + @Child(name = "activity", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Action to occur as part of plan", formalDefinition="Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc." ) + protected List activity; + + /** + * General notes about the care plan not covered elsewhere. + */ + @Child(name = "notes", type = {StringType.class}, order=12, min=0, max=1) + @Description(shortDefinition="Comments about the plan", formalDefinition="General notes about the care plan not covered elsewhere." ) + protected StringType notes; + + private static final long serialVersionUID = -1877285959L; + + /* + * Constructor + */ + public CarePlan() { + super(); + } + + /* + * Constructor + */ + public CarePlan(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public CarePlan addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlan.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.) + */ + public CarePlan setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlan.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.) + */ + public CarePlan setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #status} (Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlan.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new CarePlanStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public CarePlan setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record. + */ + public CarePlanStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record. + */ + public CarePlan setStatus(CarePlanStatus value) { + if (this.status == null) + this.status = new Enumeration(new CarePlanStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #period} (Indicates when the plan did (or is intended to) come into effect and end.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlan.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Indicates when the plan did (or is intended to) come into effect and end.) + */ + public CarePlan setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #author} (Identifies the individual(s) or ogranization who is responsible for the content of the care plan.) + */ + public List getAuthor() { + if (this.author == null) + this.author = new ArrayList(); + return this.author; + } + + public boolean hasAuthor() { + if (this.author == null) + return false; + for (Reference item : this.author) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #author} (Identifies the individual(s) or ogranization who is responsible for the content of the care plan.) + */ + // syntactic sugar + public Reference addAuthor() { //3 + Reference t = new Reference(); + if (this.author == null) + this.author = new ArrayList(); + this.author.add(t); + return t; + } + + // syntactic sugar + public CarePlan addAuthor(Reference t) { //3 + if (t == null) + return this; + if (this.author == null) + this.author = new ArrayList(); + this.author.add(t); + return this; + } + + /** + * @return {@link #author} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies the individual(s) or ogranization who is responsible for the content of the care plan.) + */ + public List getAuthorTarget() { + if (this.authorTarget == null) + this.authorTarget = new ArrayList(); + return this.authorTarget; + } + + /** + * @return {@link #modified} (Identifies the most recent date on which the plan has been revised.). This is the underlying object with id, value and extensions. The accessor "getModified" gives direct access to the value + */ + public DateTimeType getModifiedElement() { + if (this.modified == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlan.modified"); + else if (Configuration.doAutoCreate()) + this.modified = new DateTimeType(); // bb + return this.modified; + } + + public boolean hasModifiedElement() { + return this.modified != null && !this.modified.isEmpty(); + } + + public boolean hasModified() { + return this.modified != null && !this.modified.isEmpty(); + } + + /** + * @param value {@link #modified} (Identifies the most recent date on which the plan has been revised.). This is the underlying object with id, value and extensions. The accessor "getModified" gives direct access to the value + */ + public CarePlan setModifiedElement(DateTimeType value) { + this.modified = value; + return this; + } + + /** + * @return Identifies the most recent date on which the plan has been revised. + */ + public Date getModified() { + return this.modified == null ? null : this.modified.getValue(); + } + + /** + * @param value Identifies the most recent date on which the plan has been revised. + */ + public CarePlan setModified(Date value) { + if (value == null) + this.modified = null; + else { + if (this.modified == null) + this.modified = new DateTimeType(); + this.modified.setValue(value); + } + return this; + } + + /** + * @return {@link #category} (Identifies what "kind" of plan this is to support differentiation between multiple co-existing plans. E.g. "Home health", "psychiatric", "asthma", "disease management", etc.) + */ + public List getCategory() { + if (this.category == null) + this.category = new ArrayList(); + return this.category; + } + + public boolean hasCategory() { + if (this.category == null) + return false; + for (CodeableConcept item : this.category) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #category} (Identifies what "kind" of plan this is to support differentiation between multiple co-existing plans. E.g. "Home health", "psychiatric", "asthma", "disease management", etc.) + */ + // syntactic sugar + public CodeableConcept addCategory() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.category == null) + this.category = new ArrayList(); + this.category.add(t); + return t; + } + + // syntactic sugar + public CarePlan addCategory(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.category == null) + this.category = new ArrayList(); + this.category.add(t); + return this; + } + + /** + * @return {@link #concern} (Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) + */ + public List getConcern() { + if (this.concern == null) + this.concern = new ArrayList(); + return this.concern; + } + + public boolean hasConcern() { + if (this.concern == null) + return false; + for (Reference item : this.concern) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concern} (Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) + */ + // syntactic sugar + public Reference addConcern() { //3 + Reference t = new Reference(); + if (this.concern == null) + this.concern = new ArrayList(); + this.concern.add(t); + return t; + } + + // syntactic sugar + public CarePlan addConcern(Reference t) { //3 + if (t == null) + return this; + if (this.concern == null) + this.concern = new ArrayList(); + this.concern.add(t); + return this; + } + + /** + * @return {@link #concern} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) + */ + public List getConcernTarget() { + if (this.concernTarget == null) + this.concernTarget = new ArrayList(); + return this.concernTarget; + } + + // syntactic sugar + /** + * @return {@link #concern} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) + */ + public Condition addConcernTarget() { + Condition r = new Condition(); + if (this.concernTarget == null) + this.concernTarget = new ArrayList(); + this.concernTarget.add(r); + return r; + } + + /** + * @return {@link #support} (Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc.) + */ + public List getSupport() { + if (this.support == null) + this.support = new ArrayList(); + return this.support; + } + + public boolean hasSupport() { + if (this.support == null) + return false; + for (Reference item : this.support) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #support} (Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc.) + */ + // syntactic sugar + public Reference addSupport() { //3 + Reference t = new Reference(); + if (this.support == null) + this.support = new ArrayList(); + this.support.add(t); + return t; + } + + // syntactic sugar + public CarePlan addSupport(Reference t) { //3 + if (t == null) + return this; + if (this.support == null) + this.support = new ArrayList(); + this.support.add(t); + return this; + } + + /** + * @return {@link #support} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc.) + */ + public List getSupportTarget() { + if (this.supportTarget == null) + this.supportTarget = new ArrayList(); + return this.supportTarget; + } + + /** + * @return {@link #participant} (Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.) + */ + public List getParticipant() { + if (this.participant == null) + this.participant = new ArrayList(); + return this.participant; + } + + public boolean hasParticipant() { + if (this.participant == null) + return false; + for (CarePlanParticipantComponent item : this.participant) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #participant} (Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.) + */ + // syntactic sugar + public CarePlanParticipantComponent addParticipant() { //3 + CarePlanParticipantComponent t = new CarePlanParticipantComponent(); + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return t; + } + + // syntactic sugar + public CarePlan addParticipant(CarePlanParticipantComponent t) { //3 + if (t == null) + return this; + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return this; + } + + /** + * @return {@link #goal} (Describes the intended objective(s) of carrying out the Care Plan.) + */ + public List getGoal() { + if (this.goal == null) + this.goal = new ArrayList(); + return this.goal; + } + + public boolean hasGoal() { + if (this.goal == null) + return false; + for (Reference item : this.goal) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #goal} (Describes the intended objective(s) of carrying out the Care Plan.) + */ + // syntactic sugar + public Reference addGoal() { //3 + Reference t = new Reference(); + if (this.goal == null) + this.goal = new ArrayList(); + this.goal.add(t); + return t; + } + + // syntactic sugar + public CarePlan addGoal(Reference t) { //3 + if (t == null) + return this; + if (this.goal == null) + this.goal = new ArrayList(); + this.goal.add(t); + return this; + } + + /** + * @return {@link #goal} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Describes the intended objective(s) of carrying out the Care Plan.) + */ + public List getGoalTarget() { + if (this.goalTarget == null) + this.goalTarget = new ArrayList(); + return this.goalTarget; + } + + // syntactic sugar + /** + * @return {@link #goal} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Describes the intended objective(s) of carrying out the Care Plan.) + */ + public Goal addGoalTarget() { + Goal r = new Goal(); + if (this.goalTarget == null) + this.goalTarget = new ArrayList(); + this.goalTarget.add(r); + return r; + } + + /** + * @return {@link #activity} (Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.) + */ + public List getActivity() { + if (this.activity == null) + this.activity = new ArrayList(); + return this.activity; + } + + public boolean hasActivity() { + if (this.activity == null) + return false; + for (CarePlanActivityComponent item : this.activity) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #activity} (Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.) + */ + // syntactic sugar + public CarePlanActivityComponent addActivity() { //3 + CarePlanActivityComponent t = new CarePlanActivityComponent(); + if (this.activity == null) + this.activity = new ArrayList(); + this.activity.add(t); + return t; + } + + // syntactic sugar + public CarePlan addActivity(CarePlanActivityComponent t) { //3 + if (t == null) + return this; + if (this.activity == null) + this.activity = new ArrayList(); + this.activity.add(t); + return this; + } + + /** + * @return {@link #notes} (General notes about the care plan not covered elsewhere.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public StringType getNotesElement() { + if (this.notes == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlan.notes"); + else if (Configuration.doAutoCreate()) + this.notes = new StringType(); // bb + return this.notes; + } + + public boolean hasNotesElement() { + return this.notes != null && !this.notes.isEmpty(); + } + + public boolean hasNotes() { + return this.notes != null && !this.notes.isEmpty(); + } + + /** + * @param value {@link #notes} (General notes about the care plan not covered elsewhere.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public CarePlan setNotesElement(StringType value) { + this.notes = value; + return this; + } + + /** + * @return General notes about the care plan not covered elsewhere. + */ + public String getNotes() { + return this.notes == null ? null : this.notes.getValue(); + } + + /** + * @param value General notes about the care plan not covered elsewhere. + */ + public CarePlan setNotes(String value) { + if (Utilities.noString(value)) + this.notes = null; + else { + if (this.notes == null) + this.notes = new StringType(); + this.notes.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("patient", "Reference(Patient)", "Identifies the patient/subject whose intended care is described by the plan.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("status", "code", "Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("period", "Period", "Indicates when the plan did (or is intended to) come into effect and end.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("author", "Reference(Patient|Practitioner|RelatedPerson|Organization)", "Identifies the individual(s) or ogranization who is responsible for the content of the care plan.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("modified", "dateTime", "Identifies the most recent date on which the plan has been revised.", 0, java.lang.Integer.MAX_VALUE, modified)); + childrenList.add(new Property("category", "CodeableConcept", "Identifies what 'kind' of plan this is to support differentiation between multiple co-existing plans. E.g. 'Home health', 'psychiatric', 'asthma', 'disease management', etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("concern", "Reference(Condition)", "Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.", 0, java.lang.Integer.MAX_VALUE, concern)); + childrenList.add(new Property("support", "Reference(Any)", "Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc.", 0, java.lang.Integer.MAX_VALUE, support)); + childrenList.add(new Property("participant", "", "Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.", 0, java.lang.Integer.MAX_VALUE, participant)); + childrenList.add(new Property("goal", "Reference(Goal)", "Describes the intended objective(s) of carrying out the Care Plan.", 0, java.lang.Integer.MAX_VALUE, goal)); + childrenList.add(new Property("activity", "", "Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.", 0, java.lang.Integer.MAX_VALUE, activity)); + childrenList.add(new Property("notes", "string", "General notes about the care plan not covered elsewhere.", 0, java.lang.Integer.MAX_VALUE, notes)); + } + + public CarePlan copy() { + CarePlan dst = new CarePlan(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + dst.status = status == null ? null : status.copy(); + dst.period = period == null ? null : period.copy(); + if (author != null) { + dst.author = new ArrayList(); + for (Reference i : author) + dst.author.add(i.copy()); + }; + dst.modified = modified == null ? null : modified.copy(); + if (category != null) { + dst.category = new ArrayList(); + for (CodeableConcept i : category) + dst.category.add(i.copy()); + }; + if (concern != null) { + dst.concern = new ArrayList(); + for (Reference i : concern) + dst.concern.add(i.copy()); + }; + if (support != null) { + dst.support = new ArrayList(); + for (Reference i : support) + dst.support.add(i.copy()); + }; + if (participant != null) { + dst.participant = new ArrayList(); + for (CarePlanParticipantComponent i : participant) + dst.participant.add(i.copy()); + }; + if (goal != null) { + dst.goal = new ArrayList(); + for (Reference i : goal) + dst.goal.add(i.copy()); + }; + if (activity != null) { + dst.activity = new ArrayList(); + for (CarePlanActivityComponent i : activity) + dst.activity.add(i.copy()); + }; + dst.notes = notes == null ? null : notes.copy(); + return dst; + } + + protected CarePlan typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CarePlan)) + return false; + CarePlan o = (CarePlan) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(status, o.status, true) + && compareDeep(period, o.period, true) && compareDeep(author, o.author, true) && compareDeep(modified, o.modified, true) + && compareDeep(category, o.category, true) && compareDeep(concern, o.concern, true) && compareDeep(support, o.support, true) + && compareDeep(participant, o.participant, true) && compareDeep(goal, o.goal, true) && compareDeep(activity, o.activity, true) + && compareDeep(notes, o.notes, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CarePlan)) + return false; + CarePlan o = (CarePlan) other; + return compareValues(status, o.status, true) && compareValues(modified, o.modified, true) && compareValues(notes, o.notes, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) + && (status == null || status.isEmpty()) && (period == null || period.isEmpty()) && (author == null || author.isEmpty()) + && (modified == null || modified.isEmpty()) && (category == null || category.isEmpty()) && (concern == null || concern.isEmpty()) + && (support == null || support.isEmpty()) && (participant == null || participant.isEmpty()) + && (goal == null || goal.isEmpty()) && (activity == null || activity.isEmpty()) && (notes == null || notes.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.CarePlan; + } + + @SearchParamDefinition(name="date", path="CarePlan.period", description="Time period plan covers", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="activitycode", path="CarePlan.activity.detail.code", description="Detail type of activity", type="token" ) + public static final String SP_ACTIVITYCODE = "activitycode"; + @SearchParamDefinition(name="activitydate", path="CarePlan.activity.detail.scheduled[x]", description="Specified date occurs within period specified by CarePlan.activity.timingSchedule", type="date" ) + public static final String SP_ACTIVITYDATE = "activitydate"; + @SearchParamDefinition(name="condition", path="CarePlan.concern", description="Health issues this plan addresses", type="reference" ) + public static final String SP_CONDITION = "condition"; + @SearchParamDefinition(name="activityreference", path="CarePlan.activity.reference", description="Activity details defined in specific resource", type="reference" ) + public static final String SP_ACTIVITYREFERENCE = "activityreference"; + @SearchParamDefinition(name="performer", path="CarePlan.activity.detail.performer", description="Matches if the practitioner is listed as a performer in any of the 'simple' activities. (For performers of the detailed activities, chain through the activitydetail search parameter.)", type="reference" ) + public static final String SP_PERFORMER = "performer"; + @SearchParamDefinition(name="goal", path="CarePlan.goal", description="Desired outcome of plan", type="reference" ) + public static final String SP_GOAL = "goal"; + @SearchParamDefinition(name="patient", path="CarePlan.patient", description="Who care plan is for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="participant", path="CarePlan.participant.member", description="Who is involved", type="reference" ) + public static final String SP_PARTICIPANT = "participant"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Claim.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Claim.java index 633ea702455..9ec03cce1c9 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Claim.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Claim.java @@ -1,4882 +1,4861 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import java.util.*; - -import java.math.*; -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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. - */ -@ResourceDef(name="Claim", profile="http://hl7.org/fhir/Profile/Claim") -public class Claim extends DomainResource { - - public enum TypeLink { - /** - * A claim for Institution based, typically in-patient, goods and services. - */ - INSTITUTIONAL, - /** - * A claim for Oral Health (Dentist, Denturist, Hygienist) goods and services. - */ - ORAL, - /** - * A claim for Pharmacy based goods and services. - */ - PHARMACY, - /** - * A claim for Professional, typically out-patient, goods and services. - */ - PROFESSIONAL, - /** - * A claim for Vision (Opthamologist, Optometrist and Optician) goods and services. - */ - VISION, - /** - * added to help the parsers - */ - NULL; - public static TypeLink fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("institutional".equals(codeString)) - return INSTITUTIONAL; - if ("oral".equals(codeString)) - return ORAL; - if ("pharmacy".equals(codeString)) - return PHARMACY; - if ("professional".equals(codeString)) - return PROFESSIONAL; - if ("vision".equals(codeString)) - return VISION; - throw new Exception("Unknown TypeLink code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INSTITUTIONAL: return "institutional"; - case ORAL: return "oral"; - case PHARMACY: return "pharmacy"; - case PROFESSIONAL: return "professional"; - case VISION: return "vision"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INSTITUTIONAL: return ""; - case ORAL: return ""; - case PHARMACY: return ""; - case PROFESSIONAL: return ""; - case VISION: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INSTITUTIONAL: return "A claim for Institution based, typically in-patient, goods and services."; - case ORAL: return "A claim for Oral Health (Dentist, Denturist, Hygienist) goods and services."; - case PHARMACY: return "A claim for Pharmacy based goods and services."; - case PROFESSIONAL: return "A claim for Professional, typically out-patient, goods and services."; - case VISION: return "A claim for Vision (Opthamologist, Optometrist and Optician) goods and services."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INSTITUTIONAL: return "Institutional"; - case ORAL: return "Oral Health"; - case PHARMACY: return "Pharmacy"; - case PROFESSIONAL: return "Professional"; - case VISION: return "Vision"; - default: return "?"; - } - } - } - - public static class TypeLinkEnumFactory implements EnumFactory { - public TypeLink fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("institutional".equals(codeString)) - return TypeLink.INSTITUTIONAL; - if ("oral".equals(codeString)) - return TypeLink.ORAL; - if ("pharmacy".equals(codeString)) - return TypeLink.PHARMACY; - if ("professional".equals(codeString)) - return TypeLink.PROFESSIONAL; - if ("vision".equals(codeString)) - return TypeLink.VISION; - throw new IllegalArgumentException("Unknown TypeLink code '"+codeString+"'"); - } - public String toCode(TypeLink code) { - if (code == TypeLink.INSTITUTIONAL) - return "institutional"; - if (code == TypeLink.ORAL) - return "oral"; - if (code == TypeLink.PHARMACY) - return "pharmacy"; - if (code == TypeLink.PROFESSIONAL) - return "professional"; - if (code == TypeLink.VISION) - return "vision"; - return "?"; - } - } - - public enum UseLink { - /** - * The treatment is complete and this represents a Claim for the services. - */ - COMPLETE, - /** - * The treatment is proposed and this represents a Pre-authorization for the services. - */ - PROPOSED, - /** - * The treatment is proposed and this represents a Pre-determination for the services. - */ - EXPLORATORY, - /** - * A locally defined or otherwise resolved status. - */ - OTHER, - /** - * added to help the parsers - */ - NULL; - public static UseLink fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return COMPLETE; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("exploratory".equals(codeString)) - return EXPLORATORY; - if ("other".equals(codeString)) - return OTHER; - throw new Exception("Unknown UseLink code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case COMPLETE: return "complete"; - case PROPOSED: return "proposed"; - case EXPLORATORY: return "exploratory"; - case OTHER: return "other"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case COMPLETE: return ""; - case PROPOSED: return ""; - case EXPLORATORY: return ""; - case OTHER: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case COMPLETE: return "The treatment is complete and this represents a Claim for the services."; - case PROPOSED: return "The treatment is proposed and this represents a Pre-authorization for the services."; - case EXPLORATORY: return "The treatment is proposed and this represents a Pre-determination for the services."; - case OTHER: return "A locally defined or otherwise resolved status."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case COMPLETE: return "Complete"; - case PROPOSED: return "Proposed"; - case EXPLORATORY: return "Exploratory"; - case OTHER: return "Other"; - default: return "?"; - } - } - } - - public static class UseLinkEnumFactory implements EnumFactory { - public UseLink fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return UseLink.COMPLETE; - if ("proposed".equals(codeString)) - return UseLink.PROPOSED; - if ("exploratory".equals(codeString)) - return UseLink.EXPLORATORY; - if ("other".equals(codeString)) - return UseLink.OTHER; - throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); - } - public String toCode(UseLink code) { - if (code == UseLink.COMPLETE) - return "complete"; - if (code == UseLink.PROPOSED) - return "proposed"; - if (code == UseLink.EXPLORATORY) - return "exploratory"; - if (code == UseLink.OTHER) - return "other"; - return "?"; - } - } - - @Block() - public static class PayeeComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Party to be reimbursed: Subscriber, provider, other. - */ - @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) - protected Coding type; - - /** - * The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned). - */ - @Child(name = "provider", type = {Practitioner.class}, order=2, min=0, max=1) - @Description(shortDefinition="Provider who is the payee", formalDefinition="The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - protected Practitioner providerTarget; - - /** - * The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned). - */ - @Child(name = "organization", type = {Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Organization who is the payee", formalDefinition="The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - protected Organization organizationTarget; - - /** - * The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned). - */ - @Child(name = "person", type = {Patient.class}, order=4, min=0, max=1) - @Description(shortDefinition="Other person who is the payee", formalDefinition="The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) - protected Reference person; - - /** - * The actual object that is the target of the reference (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - protected Patient personTarget; - - private static final long serialVersionUID = -503108488L; - - /* - * Constructor - */ - public PayeeComponent() { - super(); - } - - /** - * @return {@link #type} (Party to be reimbursed: Subscriber, provider, other.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Party to be reimbursed: Subscriber, provider, other.) - */ - public PayeeComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); // cc - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent 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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); // aa - return this.providerTarget; - } - - /** - * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); // cc - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent 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 who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); // aa - return this.organizationTarget; - } - - /** - * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Reference getPerson() { - if (this.person == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.person"); - else if (Configuration.doAutoCreate()) - this.person = new Reference(); // cc - return this.person; - } - - public boolean hasPerson() { - return this.person != null && !this.person.isEmpty(); - } - - /** - * @param value {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setPerson(Reference value) { - this.person = value; - return this; - } - - /** - * @return {@link #person} The actual object that is the 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 other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Patient getPersonTarget() { - if (this.personTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.person"); - else if (Configuration.doAutoCreate()) - this.personTarget = new Patient(); // aa - return this.personTarget; - } - - /** - * @param value {@link #person} The actual object that is the 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 other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setPersonTarget(Patient value) { - this.personTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("organization", "Reference(Organization)", "The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("person", "Reference(Patient)", "The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, person)); - } - - public PayeeComponent copy() { - PayeeComponent dst = new PayeeComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.provider = provider == null ? null : provider.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.person = person == null ? null : person.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof PayeeComponent)) - return false; - PayeeComponent o = (PayeeComponent) other; - return compareDeep(type, o.type, true) && compareDeep(provider, o.provider, true) && compareDeep(organization, o.organization, true) - && compareDeep(person, o.person, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof PayeeComponent)) - return false; - PayeeComponent o = (PayeeComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (provider == null || provider.isEmpty()) - && (organization == null || organization.isEmpty()) && (person == null || person.isEmpty()) - ; - } - - } - - @Block() - public static class DiagnosisComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Sequence of diagnosis which serves to order and provide a link. - */ - @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Sequence of diagnosis", formalDefinition="Sequence of diagnosis which serves to order and provide a link." ) - protected PositiveIntType sequence; - - /** - * The diagnosis. - */ - @Child(name = "diagnosis", type = {Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." ) - protected Coding diagnosis; - - private static final long serialVersionUID = -795010186L; - - /* - * Constructor - */ - public DiagnosisComponent() { - super(); - } - - /* - * Constructor - */ - public DiagnosisComponent(PositiveIntType sequence, Coding diagnosis) { - super(); - this.sequence = sequence; - this.diagnosis = diagnosis; - } - - /** - * @return {@link #sequence} (Sequence of diagnosis which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public PositiveIntType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosisComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new PositiveIntType(); // bb - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (Sequence of diagnosis which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public DiagnosisComponent setSequenceElement(PositiveIntType value) { - this.sequence = value; - return this; - } - - /** - * @return Sequence of diagnosis which serves to order and provide a link. - */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); - } - - /** - * @param value Sequence of diagnosis which serves to order and provide a link. - */ - public DiagnosisComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new PositiveIntType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #diagnosis} (The diagnosis.) - */ - public Coding getDiagnosis() { - if (this.diagnosis == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosisComponent.diagnosis"); - else if (Configuration.doAutoCreate()) - this.diagnosis = new Coding(); // cc - return this.diagnosis; - } - - public boolean hasDiagnosis() { - return this.diagnosis != null && !this.diagnosis.isEmpty(); - } - - /** - * @param value {@link #diagnosis} (The diagnosis.) - */ - public DiagnosisComponent setDiagnosis(Coding value) { - this.diagnosis = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "positiveInt", "Sequence of diagnosis which serves to order and provide a link.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); - } - - public DiagnosisComponent copy() { - DiagnosisComponent dst = new DiagnosisComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.diagnosis = diagnosis == null ? null : diagnosis.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DiagnosisComponent)) - return false; - DiagnosisComponent o = (DiagnosisComponent) other; - return compareDeep(sequence, o.sequence, true) && compareDeep(diagnosis, o.diagnosis, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DiagnosisComponent)) - return false; - DiagnosisComponent o = (DiagnosisComponent) other; - return compareValues(sequence, o.sequence, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) - ; - } - - } - - @Block() - public static class CoverageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A service line item. - */ - @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) - protected PositiveIntType sequence; - - /** - * The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. - */ - @Child(name = "focal", type = {BooleanType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated." ) - protected BooleanType focal; - - /** - * Reference to the program or plan identification, underwriter or payor. - */ - @Child(name = "coverage", type = {Coverage.class}, order=3, min=1, max=1) - @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) - protected Reference coverage; - - /** - * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) - */ - protected Coverage coverageTarget; - - /** - * The contract number of a business agreement which describes the terms and conditions. - */ - @Child(name = "businessArrangement", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agreement which describes the terms and conditions." ) - protected StringType businessArrangement; - - /** - * The relationship of the patient to the subscriber. - */ - @Child(name = "relationship", type = {Coding.class}, order=5, min=1, max=1) - @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) - protected Coding relationship; - - /** - * A list of references from the Insurer to which these services pertain. - */ - @Child(name = "preAuthRef", type = {StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) - protected List preAuthRef; - - /** - * The Coverages adjudication details. - */ - @Child(name = "claimResponse", type = {ClaimResponse.class}, order=7, min=0, max=1) - @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." ) - protected Reference claimResponse; - - /** - * The actual object that is the target of the reference (The Coverages adjudication details.) - */ - protected ClaimResponse claimResponseTarget; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=8, 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; - - private static final long serialVersionUID = 621250924L; - - /* - * Constructor - */ - public CoverageComponent() { - super(); - } - - /* - * Constructor - */ - public CoverageComponent(PositiveIntType sequence, BooleanType focal, Reference coverage, Coding relationship) { - super(); - this.sequence = sequence; - this.focal = focal; - this.coverage = coverage; - this.relationship = relationship; - } - - /** - * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public PositiveIntType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new PositiveIntType(); // bb - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public CoverageComponent setSequenceElement(PositiveIntType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line item. - */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); - } - - /** - * @param value A service line item. - */ - public CoverageComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new PositiveIntType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value - */ - public BooleanType getFocalElement() { - if (this.focal == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.focal"); - else if (Configuration.doAutoCreate()) - this.focal = new BooleanType(); // bb - return this.focal; - } - - public boolean hasFocalElement() { - return this.focal != null && !this.focal.isEmpty(); - } - - public boolean hasFocal() { - return this.focal != null && !this.focal.isEmpty(); - } - - /** - * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value - */ - public CoverageComponent setFocalElement(BooleanType value) { - this.focal = value; - return this; - } - - /** - * @return The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. - */ - public boolean getFocal() { - return this.focal == null || this.focal.isEmpty() ? false : this.focal.getValue(); - } - - /** - * @param value The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. - */ - public CoverageComponent setFocal(boolean value) { - if (this.focal == null) - this.focal = new BooleanType(); - this.focal.setValue(value); - return this; - } - - /** - * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public Reference getCoverage() { - if (this.coverage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.coverage"); - else if (Configuration.doAutoCreate()) - this.coverage = new Reference(); // cc - return this.coverage; - } - - public boolean hasCoverage() { - return this.coverage != null && !this.coverage.isEmpty(); - } - - /** - * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public CoverageComponent setCoverage(Reference value) { - this.coverage = value; - return this; - } - - /** - * @return {@link #coverage} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) - */ - public Coverage getCoverageTarget() { - if (this.coverageTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.coverage"); - else if (Configuration.doAutoCreate()) - this.coverageTarget = new Coverage(); // aa - return this.coverageTarget; - } - - /** - * @param value {@link #coverage} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) - */ - public CoverageComponent setCoverageTarget(Coverage value) { - this.coverageTarget = value; - return this; - } - - /** - * @return {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public StringType getBusinessArrangementElement() { - if (this.businessArrangement == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); - else if (Configuration.doAutoCreate()) - this.businessArrangement = new StringType(); // bb - return this.businessArrangement; - } - - public boolean hasBusinessArrangementElement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - public boolean hasBusinessArrangement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - /** - * @param value {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public CoverageComponent setBusinessArrangementElement(StringType value) { - this.businessArrangement = value; - return this; - } - - /** - * @return The contract number of a business agreement which describes the terms and conditions. - */ - public String getBusinessArrangement() { - return this.businessArrangement == null ? null : this.businessArrangement.getValue(); - } - - /** - * @param value The contract number of a business agreement which describes the terms and conditions. - */ - public CoverageComponent setBusinessArrangement(String value) { - if (Utilities.noString(value)) - this.businessArrangement = null; - else { - if (this.businessArrangement == null) - this.businessArrangement = new StringType(); - this.businessArrangement.setValue(value); - } - return this; - } - - /** - * @return {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public Coding getRelationship() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new Coding(); // cc - return this.relationship; - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public CoverageComponent setRelationship(Coding value) { - this.relationship = value; - return this; - } - - /** - * @return {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) - */ - public List getPreAuthRef() { - if (this.preAuthRef == null) - this.preAuthRef = new ArrayList(); - return this.preAuthRef; - } - - public boolean hasPreAuthRef() { - if (this.preAuthRef == null) - return false; - for (StringType item : this.preAuthRef) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) - */ - // syntactic sugar - public StringType addPreAuthRefElement() {//2 - StringType t = new StringType(); - if (this.preAuthRef == null) - this.preAuthRef = new ArrayList(); - this.preAuthRef.add(t); - return t; - } - - /** - * @param value {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) - */ - public CoverageComponent addPreAuthRef(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.preAuthRef == null) - this.preAuthRef = new ArrayList(); - this.preAuthRef.add(t); - return this; - } - - /** - * @param value {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) - */ - public boolean hasPreAuthRef(String value) { - if (this.preAuthRef == null) - return false; - for (StringType v : this.preAuthRef) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #claimResponse} (The Coverages adjudication details.) - */ - public Reference getClaimResponse() { - if (this.claimResponse == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); - else if (Configuration.doAutoCreate()) - this.claimResponse = new Reference(); // cc - return this.claimResponse; - } - - public boolean hasClaimResponse() { - return this.claimResponse != null && !this.claimResponse.isEmpty(); - } - - /** - * @param value {@link #claimResponse} (The Coverages adjudication details.) - */ - public CoverageComponent setClaimResponse(Reference value) { - this.claimResponse = value; - return this; - } - - /** - * @return {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.) - */ - public ClaimResponse getClaimResponseTarget() { - if (this.claimResponseTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); - else if (Configuration.doAutoCreate()) - this.claimResponseTarget = new ClaimResponse(); // aa - return this.claimResponseTarget; - } - - /** - * @param value {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.) - */ - public CoverageComponent setClaimResponseTarget(ClaimResponse value) { - this.claimResponseTarget = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public CoverageComponent setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "positiveInt", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.", 0, java.lang.Integer.MAX_VALUE, focal)); - childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agreement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); - childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("preAuthRef", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preAuthRef)); - childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - } - - public CoverageComponent copy() { - CoverageComponent dst = new CoverageComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.focal = focal == null ? null : focal.copy(); - dst.coverage = coverage == null ? null : coverage.copy(); - dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - if (preAuthRef != null) { - dst.preAuthRef = new ArrayList(); - for (StringType i : preAuthRef) - dst.preAuthRef.add(i.copy()); - }; - dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CoverageComponent)) - return false; - CoverageComponent o = (CoverageComponent) other; - return compareDeep(sequence, o.sequence, true) && compareDeep(focal, o.focal, true) && compareDeep(coverage, o.coverage, true) - && compareDeep(businessArrangement, o.businessArrangement, true) && compareDeep(relationship, o.relationship, true) - && compareDeep(preAuthRef, o.preAuthRef, true) && compareDeep(claimResponse, o.claimResponse, true) - && compareDeep(originalRuleset, o.originalRuleset, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CoverageComponent)) - return false; - CoverageComponent o = (CoverageComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(focal, o.focal, true) && compareValues(businessArrangement, o.businessArrangement, true) - && compareValues(preAuthRef, o.preAuthRef, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) - && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) - && (relationship == null || relationship.isEmpty()) && (preAuthRef == null || preAuthRef.isEmpty()) - && (claimResponse == null || claimResponse.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - ; - } - - } - - @Block() - public static class ItemsComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A service line number. - */ - @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected PositiveIntType sequence; - - /** - * The type of product or service. - */ - @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name = "provider", type = {Practitioner.class}, order=3, 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; - - /** - * Diagnosis applicable for this service or product line. - */ - @Child(name = "diagnosisLinkId", type = {PositiveIntType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Diagnosis Link", formalDefinition="Diagnosis applicable for this service or product line." ) - protected List diagnosisLinkId; - - /** - * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied. - */ - @Child(name = "service", type = {Coding.class}, order=5, min=1, max=1) - @Description(shortDefinition="Item Code", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied." ) - protected Coding service; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @Child(name = "serviceDate", type = {DateType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Date of Service", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateType serviceDate; - - /** - * The number of repetitions of a service or product. - */ - @Child(name = "quantity", type = {Quantity.class}, order=7, min=0, max=1) - @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) - protected Quantity quantity; - - /** - * If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group. - */ - @Child(name = "unitPrice", type = {Money.class}, order=8, min=0, max=1) - @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group." ) - protected Money unitPrice; - - /** - * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - @Child(name = "factor", type = {DecimalType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) - protected DecimalType factor; - - /** - * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - @Child(name = "points", type = {DecimalType.class}, order=10, min=0, max=1) - @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) - protected DecimalType points; - - /** - * The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. - */ - @Child(name = "net", type = {Money.class}, order=11, min=0, max=1) - @Description(shortDefinition="Total item cost", formalDefinition="The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) - protected Money net; - - /** - * List of Unique Device Identifiers associated with this line item. - */ - @Child(name = "udi", type = {Coding.class}, order=12, min=0, max=1) - @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) - protected Coding udi; - - /** - * Physical service site on the patient (limb, tooth, etc). - */ - @Child(name = "bodySite", type = {Coding.class}, order=13, min=0, max=1) - @Description(shortDefinition="Service Location", formalDefinition="Physical service site on the patient (limb, tooth, etc)." ) - protected Coding bodySite; - - /** - * A region or surface of the site, eg. limb region or tooth surface(s). - */ - @Child(name = "subSite", type = {Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Service Sub-location", formalDefinition="A region or surface of the site, eg. limb region or tooth surface(s)." ) - protected List subSite; - - /** - * Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen. - */ - @Child(name = "modifier", type = {Coding.class}, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Service/Product billing modifiers", formalDefinition="Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen." ) - protected List modifier; - - /** - * Second tier of goods and services. - */ - @Child(name = "detail", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Additional items", formalDefinition="Second tier of goods and services." ) - protected List detail; - - /** - * The materials and placement date of prior fixed prosthesis. - */ - @Child(name = "prosthesis", type = {}, order=17, min=0, max=1) - @Description(shortDefinition="Prosthetic details", formalDefinition="The materials and placement date of prior fixed prosthesis." ) - protected ProsthesisComponent prosthesis; - - private static final long serialVersionUID = -311028698L; - - /* - * Constructor - */ - public ItemsComponent() { - super(); - } - - /* - * Constructor - */ - public ItemsComponent(PositiveIntType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public PositiveIntType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new PositiveIntType(); // bb - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public ItemsComponent setSequenceElement(PositiveIntType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public ItemsComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new PositiveIntType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public ItemsComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); // cc - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public ItemsComponent 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 ItemsComponent.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); // aa - return this.providerTarget; - } - - /** - * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) - */ - public ItemsComponent setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) - */ - public List getDiagnosisLinkId() { - if (this.diagnosisLinkId == null) - this.diagnosisLinkId = new ArrayList(); - return this.diagnosisLinkId; - } - - public boolean hasDiagnosisLinkId() { - if (this.diagnosisLinkId == null) - return false; - for (PositiveIntType item : this.diagnosisLinkId) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) - */ - // syntactic sugar - public PositiveIntType addDiagnosisLinkIdElement() {//2 - PositiveIntType t = new PositiveIntType(); - if (this.diagnosisLinkId == null) - this.diagnosisLinkId = new ArrayList(); - this.diagnosisLinkId.add(t); - return t; - } - - /** - * @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) - */ - public ItemsComponent addDiagnosisLinkId(int value) { //1 - PositiveIntType t = new PositiveIntType(); - t.setValue(value); - if (this.diagnosisLinkId == null) - this.diagnosisLinkId = new ArrayList(); - this.diagnosisLinkId.add(t); - return this; - } - - /** - * @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) - */ - public boolean hasDiagnosisLinkId(int value) { - if (this.diagnosisLinkId == null) - return false; - for (PositiveIntType v : this.diagnosisLinkId) - if (v.equals(value)) // positiveInt - return true; - return false; - } - - /** - * @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); // cc - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) - */ - public ItemsComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value - */ - public DateType getServiceDateElement() { - if (this.serviceDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.serviceDate"); - else if (Configuration.doAutoCreate()) - this.serviceDate = new DateType(); // bb - return this.serviceDate; - } - - public boolean hasServiceDateElement() { - return this.serviceDate != null && !this.serviceDate.isEmpty(); - } - - public boolean hasServiceDate() { - return this.serviceDate != null && !this.serviceDate.isEmpty(); - } - - /** - * @param value {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value - */ - public ItemsComponent setServiceDateElement(DateType value) { - this.serviceDate = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - public Date getServiceDate() { - return this.serviceDate == null ? null : this.serviceDate.getValue(); - } - - /** - * @param value The date when the enclosed suite of services were performed or completed. - */ - public ItemsComponent setServiceDate(Date value) { - if (value == null) - this.serviceDate = null; - else { - if (this.serviceDate == null) - this.serviceDate = new DateType(); - this.serviceDate.setValue(value); - } - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public ItemsComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); // cc - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) - */ - public ItemsComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); // bb - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public ItemsComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public ItemsComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); // bb - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public ItemsComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public ItemsComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); // cc - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public ItemsComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public Coding getUdi() { - if (this.udi == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.udi"); - else if (Configuration.doAutoCreate()) - this.udi = new Coding(); // cc - return this.udi; - } - - public boolean hasUdi() { - return this.udi != null && !this.udi.isEmpty(); - } - - /** - * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public ItemsComponent setUdi(Coding value) { - this.udi = value; - return this; - } - - /** - * @return {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) - */ - public Coding getBodySite() { - if (this.bodySite == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.bodySite"); - else if (Configuration.doAutoCreate()) - this.bodySite = new Coding(); // cc - return this.bodySite; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) - */ - public ItemsComponent setBodySite(Coding value) { - this.bodySite = value; - return this; - } - - /** - * @return {@link #subSite} (A region or surface of the site, eg. limb region or tooth surface(s).) - */ - public List getSubSite() { - if (this.subSite == null) - this.subSite = new ArrayList(); - return this.subSite; - } - - public boolean hasSubSite() { - if (this.subSite == null) - return false; - for (Coding item : this.subSite) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subSite} (A region or surface of the site, eg. limb region or tooth surface(s).) - */ - // syntactic sugar - public Coding addSubSite() { //3 - Coding t = new Coding(); - if (this.subSite == null) - this.subSite = new ArrayList(); - this.subSite.add(t); - return t; - } - - // syntactic sugar - public ItemsComponent addSubSite(Coding t) { //3 - if (t == null) - return this; - if (this.subSite == null) - this.subSite = new ArrayList(); - this.subSite.add(t); - return this; - } - - /** - * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) - */ - public List getModifier() { - if (this.modifier == null) - this.modifier = new ArrayList(); - return this.modifier; - } - - public boolean hasModifier() { - if (this.modifier == null) - return false; - for (Coding item : this.modifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) - */ - // syntactic sugar - public Coding addModifier() { //3 - Coding t = new Coding(); - if (this.modifier == null) - this.modifier = new ArrayList(); - this.modifier.add(t); - return t; - } - - // syntactic sugar - public ItemsComponent addModifier(Coding t) { //3 - if (t == null) - return this; - if (this.modifier == null) - this.modifier = new ArrayList(); - this.modifier.add(t); - return this; - } - - /** - * @return {@link #detail} (Second tier of goods and services.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (DetailComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (Second tier of goods and services.) - */ - // syntactic sugar - public DetailComponent addDetail() { //3 - DetailComponent t = new DetailComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - // syntactic sugar - public ItemsComponent addDetail(DetailComponent t) { //3 - if (t == null) - return this; - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return this; - } - - /** - * @return {@link #prosthesis} (The materials and placement date of prior fixed prosthesis.) - */ - public ProsthesisComponent getProsthesis() { - if (this.prosthesis == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.prosthesis"); - else if (Configuration.doAutoCreate()) - this.prosthesis = new ProsthesisComponent(); // cc - return this.prosthesis; - } - - public boolean hasProsthesis() { - return this.prosthesis != null && !this.prosthesis.isEmpty(); - } - - /** - * @param value {@link #prosthesis} (The materials and placement date of prior fixed prosthesis.) - */ - public ItemsComponent setProsthesis(ProsthesisComponent value) { - this.prosthesis = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("provider", "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("diagnosisLinkId", "positiveInt", "Diagnosis applicable for this service or product line.", 0, java.lang.Integer.MAX_VALUE, diagnosisLinkId)); - childrenList.add(new Property("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("serviceDate", "date", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, serviceDate)); - childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - childrenList.add(new Property("bodySite", "Coding", "Physical service site on the patient (limb, tooth, etc).", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("subSite", "Coding", "A region or surface of the site, eg. limb region or tooth surface(s).", 0, java.lang.Integer.MAX_VALUE, subSite)); - childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); - childrenList.add(new Property("prosthesis", "", "The materials and placement date of prior fixed prosthesis.", 0, java.lang.Integer.MAX_VALUE, prosthesis)); - } - - public ItemsComponent copy() { - ItemsComponent dst = new ItemsComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.type = type == null ? null : type.copy(); - dst.provider = provider == null ? null : provider.copy(); - if (diagnosisLinkId != null) { - dst.diagnosisLinkId = new ArrayList(); - for (PositiveIntType i : diagnosisLinkId) - dst.diagnosisLinkId.add(i.copy()); - }; - dst.service = service == null ? null : service.copy(); - dst.serviceDate = serviceDate == null ? null : serviceDate.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - dst.udi = udi == null ? null : udi.copy(); - dst.bodySite = bodySite == null ? null : bodySite.copy(); - if (subSite != null) { - dst.subSite = new ArrayList(); - for (Coding i : subSite) - dst.subSite.add(i.copy()); - }; - if (modifier != null) { - dst.modifier = new ArrayList(); - for (Coding i : modifier) - dst.modifier.add(i.copy()); - }; - if (detail != null) { - dst.detail = new ArrayList(); - for (DetailComponent i : detail) - dst.detail.add(i.copy()); - }; - dst.prosthesis = prosthesis == null ? null : prosthesis.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ItemsComponent)) - return false; - ItemsComponent o = (ItemsComponent) other; - return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(provider, o.provider, true) - && compareDeep(diagnosisLinkId, o.diagnosisLinkId, true) && compareDeep(service, o.service, true) - && compareDeep(serviceDate, o.serviceDate, true) && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) - && compareDeep(factor, o.factor, true) && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) - && compareDeep(udi, o.udi, true) && compareDeep(bodySite, o.bodySite, true) && compareDeep(subSite, o.subSite, true) - && compareDeep(modifier, o.modifier, true) && compareDeep(detail, o.detail, true) && compareDeep(prosthesis, o.prosthesis, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ItemsComponent)) - return false; - ItemsComponent o = (ItemsComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(diagnosisLinkId, o.diagnosisLinkId, true) - && compareValues(serviceDate, o.serviceDate, true) && compareValues(factor, o.factor, true) && compareValues(points, o.points, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) - && (provider == null || provider.isEmpty()) && (diagnosisLinkId == null || diagnosisLinkId.isEmpty()) - && (service == null || service.isEmpty()) && (serviceDate == null || serviceDate.isEmpty()) - && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) - && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) - && (udi == null || udi.isEmpty()) && (bodySite == null || bodySite.isEmpty()) && (subSite == null || subSite.isEmpty()) - && (modifier == null || modifier.isEmpty()) && (detail == null || detail.isEmpty()) && (prosthesis == null || prosthesis.isEmpty()) - ; - } - - } - - @Block() - public static class DetailComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A service line number. - */ - @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected PositiveIntType sequence; - - /** - * The type of product or service. - */ - @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied. - */ - @Child(name = "service", type = {Coding.class}, order=3, min=1, max=1) - @Description(shortDefinition="Additional item codes", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied." ) - protected Coding service; - - /** - * The number of repetitions of a service or product. - */ - @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1) - @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) - protected Quantity quantity; - - /** - * If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group. - */ - @Child(name = "unitPrice", type = {Money.class}, order=5, min=0, max=1) - @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group." ) - protected Money unitPrice; - - /** - * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - @Child(name = "factor", type = {DecimalType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) - protected DecimalType factor; - - /** - * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - @Child(name = "points", type = {DecimalType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) - protected DecimalType points; - - /** - * The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. - */ - @Child(name = "net", type = {Money.class}, order=8, min=0, max=1) - @Description(shortDefinition="Total additional item cost", formalDefinition="The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) - protected Money net; - - /** - * List of Unique Device Identifiers associated with this line item. - */ - @Child(name = "udi", type = {Coding.class}, order=9, min=0, max=1) - @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) - protected Coding udi; - - /** - * Third tier of goods and services. - */ - @Child(name = "subDetail", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) - protected List subDetail; - - private static final long serialVersionUID = -1641314433L; - - /* - * Constructor - */ - public DetailComponent() { - super(); - } - - /* - * Constructor - */ - public DetailComponent(PositiveIntType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public PositiveIntType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new PositiveIntType(); // bb - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public DetailComponent setSequenceElement(PositiveIntType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public DetailComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new PositiveIntType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public DetailComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); // cc - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) - */ - public DetailComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public DetailComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); // cc - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) - */ - public DetailComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); // bb - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DetailComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public DetailComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); // bb - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DetailComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public DetailComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); // cc - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public DetailComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public Coding getUdi() { - if (this.udi == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.udi"); - else if (Configuration.doAutoCreate()) - this.udi = new Coding(); // cc - return this.udi; - } - - public boolean hasUdi() { - return this.udi != null && !this.udi.isEmpty(); - } - - /** - * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public DetailComponent setUdi(Coding value) { - this.udi = value; - return this; - } - - /** - * @return {@link #subDetail} (Third tier of goods and services.) - */ - public List getSubDetail() { - if (this.subDetail == null) - this.subDetail = new ArrayList(); - return this.subDetail; - } - - public boolean hasSubDetail() { - if (this.subDetail == null) - return false; - for (SubDetailComponent item : this.subDetail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subDetail} (Third tier of goods and services.) - */ - // syntactic sugar - public SubDetailComponent addSubDetail() { //3 - SubDetailComponent t = new SubDetailComponent(); - if (this.subDetail == null) - this.subDetail = new ArrayList(); - this.subDetail.add(t); - return t; - } - - // syntactic sugar - public DetailComponent addSubDetail(SubDetailComponent t) { //3 - if (t == null) - return this; - if (this.subDetail == null) - this.subDetail = new ArrayList(); - this.subDetail.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - childrenList.add(new Property("subDetail", "", "Third tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); - } - - public DetailComponent copy() { - DetailComponent dst = new DetailComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.type = type == null ? null : type.copy(); - dst.service = service == null ? null : service.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - dst.udi = udi == null ? null : udi.copy(); - if (subDetail != null) { - dst.subDetail = new ArrayList(); - for (SubDetailComponent i : subDetail) - dst.subDetail.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DetailComponent)) - return false; - DetailComponent o = (DetailComponent) other; - return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(service, o.service, true) - && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true) - && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) && compareDeep(udi, o.udi, true) - && compareDeep(subDetail, o.subDetail, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DetailComponent)) - return false; - DetailComponent o = (DetailComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true) && compareValues(points, o.points, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) - && (service == null || service.isEmpty()) && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) - && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) - && (udi == null || udi.isEmpty()) && (subDetail == null || subDetail.isEmpty()); - } - - } - - @Block() - public static class SubDetailComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A service line number. - */ - @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected PositiveIntType sequence; - - /** - * The type of product or service. - */ - @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * The fee for an addittional service or product or charge. - */ - @Child(name = "service", type = {Coding.class}, order=3, min=1, max=1) - @Description(shortDefinition="Additional item codes", formalDefinition="The fee for an addittional service or product or charge." ) - protected Coding service; - - /** - * The number of repetitions of a service or product. - */ - @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1) - @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) - protected Quantity quantity; - - /** - * The fee for an addittional service or product or charge. - */ - @Child(name = "unitPrice", type = {Money.class}, order=5, min=0, max=1) - @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The fee for an addittional service or product or charge." ) - protected Money unitPrice; - - /** - * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - @Child(name = "factor", type = {DecimalType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) - protected DecimalType factor; - - /** - * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - @Child(name = "points", type = {DecimalType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) - protected DecimalType points; - - /** - * The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. - */ - @Child(name = "net", type = {Money.class}, order=8, min=0, max=1) - @Description(shortDefinition="Net additional item cost", formalDefinition="The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) - protected Money net; - - /** - * List of Unique Device Identifiers associated with this line item. - */ - @Child(name = "udi", type = {Coding.class}, order=9, min=0, max=1) - @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) - protected Coding udi; - - private static final long serialVersionUID = -947666334L; - - /* - * Constructor - */ - public SubDetailComponent() { - super(); - } - - /* - * Constructor - */ - public SubDetailComponent(PositiveIntType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public PositiveIntType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new PositiveIntType(); // bb - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public SubDetailComponent setSequenceElement(PositiveIntType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public SubDetailComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new PositiveIntType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public SubDetailComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #service} (The fee for an addittional service or product or charge.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); // cc - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (The fee for an addittional service or product or charge.) - */ - public SubDetailComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public SubDetailComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (The fee for an addittional service or product or charge.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); // cc - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (The fee for an addittional service or product or charge.) - */ - public SubDetailComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); // bb - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public SubDetailComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public SubDetailComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); // bb - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public SubDetailComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public SubDetailComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); // cc - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public SubDetailComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public Coding getUdi() { - if (this.udi == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.udi"); - else if (Configuration.doAutoCreate()) - this.udi = new Coding(); // cc - return this.udi; - } - - public boolean hasUdi() { - return this.udi != null && !this.udi.isEmpty(); - } - - /** - * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public SubDetailComponent setUdi(Coding value) { - this.udi = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("service", "Coding", "The fee for an addittional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "The fee for an addittional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - } - - public SubDetailComponent copy() { - SubDetailComponent dst = new SubDetailComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.type = type == null ? null : type.copy(); - dst.service = service == null ? null : service.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - dst.udi = udi == null ? null : udi.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SubDetailComponent)) - return false; - SubDetailComponent o = (SubDetailComponent) other; - return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(service, o.service, true) - && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true) - && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) && compareDeep(udi, o.udi, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SubDetailComponent)) - return false; - SubDetailComponent o = (SubDetailComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true) && compareValues(points, o.points, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) - && (service == null || service.isEmpty()) && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) - && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) - && (udi == null || udi.isEmpty()); - } - - } - - @Block() - public static class ProsthesisComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Indicates whether this is the initial placement of a fixed prosthesis. - */ - @Child(name = "initial", type = {BooleanType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Is this the initial service", formalDefinition="Indicates whether this is the initial placement of a fixed prosthesis." ) - protected BooleanType initial; - - /** - * Date of the initial placement. - */ - @Child(name = "priorDate", type = {DateType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Initial service Date", formalDefinition="Date of the initial placement." ) - protected DateType priorDate; - - /** - * Material of the prior denture or bridge prosthesis. (Oral). - */ - @Child(name = "priorMaterial", type = {Coding.class}, order=3, min=0, max=1) - @Description(shortDefinition="Prosthetic Material", formalDefinition="Material of the prior denture or bridge prosthesis. (Oral)." ) - protected Coding priorMaterial; - - private static final long serialVersionUID = 1739349641L; - - /* - * Constructor - */ - public ProsthesisComponent() { - super(); - } - - /** - * @return {@link #initial} (Indicates whether this is the initial placement of a fixed prosthesis.). This is the underlying object with id, value and extensions. The accessor "getInitial" gives direct access to the value - */ - public BooleanType getInitialElement() { - if (this.initial == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProsthesisComponent.initial"); - else if (Configuration.doAutoCreate()) - this.initial = new BooleanType(); // bb - return this.initial; - } - - public boolean hasInitialElement() { - return this.initial != null && !this.initial.isEmpty(); - } - - public boolean hasInitial() { - return this.initial != null && !this.initial.isEmpty(); - } - - /** - * @param value {@link #initial} (Indicates whether this is the initial placement of a fixed prosthesis.). This is the underlying object with id, value and extensions. The accessor "getInitial" gives direct access to the value - */ - public ProsthesisComponent setInitialElement(BooleanType value) { - this.initial = value; - return this; - } - - /** - * @return Indicates whether this is the initial placement of a fixed prosthesis. - */ - public boolean getInitial() { - return this.initial == null || this.initial.isEmpty() ? false : this.initial.getValue(); - } - - /** - * @param value Indicates whether this is the initial placement of a fixed prosthesis. - */ - public ProsthesisComponent setInitial(boolean value) { - if (this.initial == null) - this.initial = new BooleanType(); - this.initial.setValue(value); - return this; - } - - /** - * @return {@link #priorDate} (Date of the initial placement.). This is the underlying object with id, value and extensions. The accessor "getPriorDate" gives direct access to the value - */ - public DateType getPriorDateElement() { - if (this.priorDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProsthesisComponent.priorDate"); - else if (Configuration.doAutoCreate()) - this.priorDate = new DateType(); // bb - return this.priorDate; - } - - public boolean hasPriorDateElement() { - return this.priorDate != null && !this.priorDate.isEmpty(); - } - - public boolean hasPriorDate() { - return this.priorDate != null && !this.priorDate.isEmpty(); - } - - /** - * @param value {@link #priorDate} (Date of the initial placement.). This is the underlying object with id, value and extensions. The accessor "getPriorDate" gives direct access to the value - */ - public ProsthesisComponent setPriorDateElement(DateType value) { - this.priorDate = value; - return this; - } - - /** - * @return Date of the initial placement. - */ - public Date getPriorDate() { - return this.priorDate == null ? null : this.priorDate.getValue(); - } - - /** - * @param value Date of the initial placement. - */ - public ProsthesisComponent setPriorDate(Date value) { - if (value == null) - this.priorDate = null; - else { - if (this.priorDate == null) - this.priorDate = new DateType(); - this.priorDate.setValue(value); - } - return this; - } - - /** - * @return {@link #priorMaterial} (Material of the prior denture or bridge prosthesis. (Oral).) - */ - public Coding getPriorMaterial() { - if (this.priorMaterial == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProsthesisComponent.priorMaterial"); - else if (Configuration.doAutoCreate()) - this.priorMaterial = new Coding(); // cc - return this.priorMaterial; - } - - public boolean hasPriorMaterial() { - return this.priorMaterial != null && !this.priorMaterial.isEmpty(); - } - - /** - * @param value {@link #priorMaterial} (Material of the prior denture or bridge prosthesis. (Oral).) - */ - public ProsthesisComponent setPriorMaterial(Coding value) { - this.priorMaterial = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("initial", "boolean", "Indicates whether this is the initial placement of a fixed prosthesis.", 0, java.lang.Integer.MAX_VALUE, initial)); - childrenList.add(new Property("priorDate", "date", "Date of the initial placement.", 0, java.lang.Integer.MAX_VALUE, priorDate)); - childrenList.add(new Property("priorMaterial", "Coding", "Material of the prior denture or bridge prosthesis. (Oral).", 0, java.lang.Integer.MAX_VALUE, priorMaterial)); - } - - public ProsthesisComponent copy() { - ProsthesisComponent dst = new ProsthesisComponent(); - copyValues(dst); - dst.initial = initial == null ? null : initial.copy(); - dst.priorDate = priorDate == null ? null : priorDate.copy(); - dst.priorMaterial = priorMaterial == null ? null : priorMaterial.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProsthesisComponent)) - return false; - ProsthesisComponent o = (ProsthesisComponent) other; - return compareDeep(initial, o.initial, true) && compareDeep(priorDate, o.priorDate, true) && compareDeep(priorMaterial, o.priorMaterial, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProsthesisComponent)) - return false; - ProsthesisComponent o = (ProsthesisComponent) other; - return compareValues(initial, o.initial, true) && compareValues(priorDate, o.priorDate, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (initial == null || initial.isEmpty()) && (priorDate == null || priorDate.isEmpty()) - && (priorMaterial == null || priorMaterial.isEmpty()); - } - - } - - @Block() - public static class MissingTeethComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The code identifying which tooth is missing. - */ - @Child(name = "tooth", type = {Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Tooth Code", formalDefinition="The code identifying which tooth is missing." ) - protected Coding tooth; - - /** - * Missing reason may be: E-extraction, O-other. - */ - @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1) - @Description(shortDefinition="Reason for missing", formalDefinition="Missing reason may be: E-extraction, O-other." ) - protected Coding reason; - - /** - * The date of the extraction either known from records or patient reported estimate. - */ - @Child(name = "extractionDate", type = {DateType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Date of Extraction", formalDefinition="The date of the extraction either known from records or patient reported estimate." ) - protected DateType extractionDate; - - private static final long serialVersionUID = 352913313L; - - /* - * Constructor - */ - public MissingTeethComponent() { - super(); - } - - /* - * Constructor - */ - public MissingTeethComponent(Coding tooth) { - super(); - this.tooth = tooth; - } - - /** - * @return {@link #tooth} (The code identifying which tooth is missing.) - */ - public Coding getTooth() { - if (this.tooth == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MissingTeethComponent.tooth"); - else if (Configuration.doAutoCreate()) - this.tooth = new Coding(); // cc - return this.tooth; - } - - public boolean hasTooth() { - return this.tooth != null && !this.tooth.isEmpty(); - } - - /** - * @param value {@link #tooth} (The code identifying which tooth is missing.) - */ - public MissingTeethComponent setTooth(Coding value) { - this.tooth = value; - return this; - } - - /** - * @return {@link #reason} (Missing reason may be: E-extraction, O-other.) - */ - public Coding getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MissingTeethComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new Coding(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Missing reason may be: E-extraction, O-other.) - */ - public MissingTeethComponent setReason(Coding value) { - this.reason = value; - return this; - } - - /** - * @return {@link #extractionDate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractionDate" gives direct access to the value - */ - public DateType getExtractionDateElement() { - if (this.extractionDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MissingTeethComponent.extractionDate"); - else if (Configuration.doAutoCreate()) - this.extractionDate = new DateType(); // bb - return this.extractionDate; - } - - public boolean hasExtractionDateElement() { - return this.extractionDate != null && !this.extractionDate.isEmpty(); - } - - public boolean hasExtractionDate() { - return this.extractionDate != null && !this.extractionDate.isEmpty(); - } - - /** - * @param value {@link #extractionDate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractionDate" gives direct access to the value - */ - public MissingTeethComponent setExtractionDateElement(DateType value) { - this.extractionDate = value; - return this; - } - - /** - * @return The date of the extraction either known from records or patient reported estimate. - */ - public Date getExtractionDate() { - return this.extractionDate == null ? null : this.extractionDate.getValue(); - } - - /** - * @param value The date of the extraction either known from records or patient reported estimate. - */ - public MissingTeethComponent setExtractionDate(Date value) { - if (value == null) - this.extractionDate = null; - else { - if (this.extractionDate == null) - this.extractionDate = new DateType(); - this.extractionDate.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("tooth", "Coding", "The code identifying which tooth is missing.", 0, java.lang.Integer.MAX_VALUE, tooth)); - childrenList.add(new Property("reason", "Coding", "Missing reason may be: E-extraction, O-other.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("extractionDate", "date", "The date of the extraction either known from records or patient reported estimate.", 0, java.lang.Integer.MAX_VALUE, extractionDate)); - } - - public MissingTeethComponent copy() { - MissingTeethComponent dst = new MissingTeethComponent(); - copyValues(dst); - dst.tooth = tooth == null ? null : tooth.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.extractionDate = extractionDate == null ? null : extractionDate.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MissingTeethComponent)) - return false; - MissingTeethComponent o = (MissingTeethComponent) other; - return compareDeep(tooth, o.tooth, true) && compareDeep(reason, o.reason, true) && compareDeep(extractionDate, o.extractionDate, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MissingTeethComponent)) - return false; - MissingTeethComponent o = (MissingTeethComponent) other; - return compareValues(extractionDate, o.extractionDate, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (tooth == null || tooth.isEmpty()) && (reason == null || reason.isEmpty()) - && (extractionDate == null || extractionDate.isEmpty()); - } - - } - - /** - * The category of claim this is. - */ - @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1) - @Description(shortDefinition="institutional | oral | pharmacy | professional | vision", formalDefinition="The category of claim this is." ) - protected Enumeration type; - - /** - * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Claim number", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) - protected List identifier; - - /** - * The version of the specification on which this instance relies. - */ - @Child(name = "ruleset", type = {Coding.class}, order=2, min=0, max=1) - @Description(shortDefinition="Current specification followed", formalDefinition="The version of the specification on which this instance relies." ) - protected Coding ruleset; - - /** - * The version of the specification from which the original instance was created. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=3, min=0, max=1) - @Description(shortDefinition="Original specification followed", formalDefinition="The version of the specification from which the original instance was created." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @Child(name = "created", type = {DateTimeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateTimeType created; - - /** - * Insurer Identifier, typical BIN number (6 digit). - */ - @Child(name = "target", type = {Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="Insurer Identifier, typical BIN number (6 digit)." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (Insurer Identifier, typical BIN number (6 digit).) - */ - protected Organization targetTarget; - - /** - * The provider which is responsible for the bill, claim pre-determination, pre-authorization. - */ - @Child(name = "provider", type = {Practitioner.class}, order=6, min=0, max=1) - @Description(shortDefinition="Responsible provider", formalDefinition="The provider which is responsible for the bill, claim pre-determination, pre-authorization." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - protected Practitioner providerTarget; - - /** - * The organization which is responsible for the bill, claim pre-determination, pre-authorization. - */ - @Child(name = "organization", type = {Organization.class}, order=7, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the bill, claim pre-determination, pre-authorization." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - protected Organization organizationTarget; - - /** - * Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - @Child(name = "use", type = {CodeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="complete | proposed | exploratory | other", formalDefinition="Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination)." ) - protected Enumeration use; - - /** - * Immediate (STAT), best effort (NORMAL), deferred (DEFER). - */ - @Child(name = "priority", type = {Coding.class}, order=9, min=0, max=1) - @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) - protected Coding priority; - - /** - * In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested. - */ - @Child(name = "fundsReserve", type = {Coding.class}, order=10, min=0, max=1) - @Description(shortDefinition="Funds requested to be reserved", formalDefinition="In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested." ) - protected Coding fundsReserve; - - /** - * Person who created the invoice/claim/pre-determination or pre-authorization. - */ - @Child(name = "enterer", type = {Practitioner.class}, order=11, min=0, max=1) - @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." ) - protected Reference enterer; - - /** - * The actual object that is the target of the reference (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - protected Practitioner entererTarget; - - /** - * Facility where the services were provided. - */ - @Child(name = "facility", type = {Location.class}, order=12, min=0, max=1) - @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) - protected Reference facility; - - /** - * The actual object that is the target of the reference (Facility where the services were provided.) - */ - protected Location facilityTarget; - - /** - * Prescription to support the dispensing of Pharmacy or Vision products. - */ - @Child(name = "prescription", type = {MedicationPrescription.class, VisionPrescription.class}, order=13, min=0, max=1) - @Description(shortDefinition="Prescription", formalDefinition="Prescription to support the dispensing of Pharmacy or Vision products." ) - protected Reference prescription; - - /** - * The actual object that is the target of the reference (Prescription to support the dispensing of Pharmacy or Vision products.) - */ - protected Resource prescriptionTarget; - - /** - * Original prescription to support the dispensing of pharmacy services, medications or products. - */ - @Child(name = "originalPrescription", type = {MedicationPrescription.class}, order=14, min=0, max=1) - @Description(shortDefinition="Original Prescription", formalDefinition="Original prescription to support the dispensing of pharmacy services, medications or products." ) - protected Reference originalPrescription; - - /** - * The actual object that is the target of the reference (Original prescription to support the dispensing of pharmacy services, medications or products.) - */ - protected MedicationPrescription originalPrescriptionTarget; - - /** - * The party to be reimbursed for the services. - */ - @Child(name = "payee", type = {}, order=15, min=0, max=1) - @Description(shortDefinition="Payee", formalDefinition="The party to be reimbursed for the services." ) - protected PayeeComponent payee; - - /** - * The referral resource which lists the date, practitioner, reason and other supporting information. - */ - @Child(name = "referral", type = {ReferralRequest.class}, order=16, min=0, max=1) - @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) - protected Reference referral; - - /** - * The actual object that is the target of the reference (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - protected ReferralRequest referralTarget; - - /** - * Ordered list of patient diagnosis for which care is sought. - */ - @Child(name = "diagnosis", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." ) - protected List diagnosis; - - /** - * List of patient conditions for which care is sought. - */ - @Child(name = "condition", type = {Coding.class}, order=18, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of presenting Conditions", formalDefinition="List of patient conditions for which care is sought." ) - protected List condition; - - /** - * Patient Resource. - */ - @Child(name = "patient", type = {Patient.class}, order=19, min=1, max=1) - @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (Patient Resource.) - */ - protected Patient patientTarget; - - /** - * Financial instrument by which payment information for health care. - */ - @Child(name = "coverage", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) - protected List coverage; - - /** - * Factors which may influence the applicability of coverage. - */ - @Child(name = "exception", type = {Coding.class}, order=21, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Eligibility exceptions", formalDefinition="Factors which may influence the applicability of coverage." ) - protected List exception; - - /** - * Name of school for over-aged dependants. - */ - @Child(name = "school", type = {StringType.class}, order=22, min=0, max=1) - @Description(shortDefinition="Name of School", formalDefinition="Name of school for over-aged dependants." ) - protected StringType school; - - /** - * Date of an accident which these services are addressing. - */ - @Child(name = "accident", type = {DateType.class}, order=23, min=0, max=1) - @Description(shortDefinition="Accident Date", formalDefinition="Date of an accident which these services are addressing." ) - protected DateType accident; - - /** - * Type of accident: work, auto, etc. - */ - @Child(name = "accidentType", type = {Coding.class}, order=24, min=0, max=1) - @Description(shortDefinition="Accident Type", formalDefinition="Type of accident: work, auto, etc." ) - protected Coding accidentType; - - /** - * A list of intervention and exception codes which may influence the adjudication of the claim. - */ - @Child(name = "interventionException", type = {Coding.class}, order=25, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Intervention and exception code (Pharma)", formalDefinition="A list of intervention and exception codes which may influence the adjudication of the claim." ) - protected List interventionException; - - /** - * First tier of goods and services. - */ - @Child(name = "item", type = {}, order=26, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Goods and Services", formalDefinition="First tier of goods and services." ) - protected List item; - - /** - * Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission. - */ - @Child(name = "additionalMaterials", type = {Coding.class}, order=27, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Additional materials, documents, etc.", formalDefinition="Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission." ) - protected List additionalMaterials; - - /** - * A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons. - */ - @Child(name = "missingTeeth", type = {}, order=28, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Only if type = oral", formalDefinition="A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons." ) - protected List missingTeeth; - - private static final long serialVersionUID = 764017933L; - - /* - * Constructor - */ - public Claim() { - super(); - } - - /* - * Constructor - */ - public Claim(Enumeration type, Reference patient) { - super(); - this.type = type; - this.patient = patient; - } - - /** - * @return {@link #type} (The category of claim this is.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new TypeLinkEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The category of claim this is.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Claim setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The category of claim this is. - */ - public TypeLink getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The category of claim this is. - */ - public Claim setType(TypeLink value) { - if (this.type == null) - this.type = new Enumeration(new TypeLinkEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Claim addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #ruleset} (The version of the specification on which this instance relies.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the specification on which this instance relies.) - */ - public Claim setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The version of the specification from which the original instance was created.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The version of the specification from which the original instance was created.) - */ - public Claim setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public Claim setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when the enclosed suite of services were performed or completed. - */ - public Claim setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); // cc - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (Insurer Identifier, typical BIN number (6 digit).) - */ - public Claim 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. (Insurer Identifier, typical BIN number (6 digit).) - */ - public Organization getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Organization(); // aa - return this.targetTarget; - } - - /** - * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Insurer Identifier, typical BIN number (6 digit).) - */ - public Claim setTargetTarget(Organization value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); // cc - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Claim 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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); // aa - return this.providerTarget; - } - - /** - * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Claim setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); // cc - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Claim 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 bill, claim pre-determination, pre-authorization.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); // aa - return this.organizationTarget; - } - - /** - * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Claim setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(new UseLinkEnumFactory()); // bb - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Claim setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - public UseLink getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - public Claim setUse(UseLink value) { - if (value == null) - this.use = null; - else { - if (this.use == null) - this.use = new Enumeration(new UseLinkEnumFactory()); - this.use.setValue(value); - } - return this; - } - - /** - * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) - */ - public Coding getPriority() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new Coding(); // cc - return this.priority; - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) - */ - public Claim setPriority(Coding value) { - this.priority = value; - return this; - } - - /** - * @return {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) - */ - public Coding getFundsReserve() { - if (this.fundsReserve == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.fundsReserve"); - else if (Configuration.doAutoCreate()) - this.fundsReserve = new Coding(); // cc - return this.fundsReserve; - } - - public boolean hasFundsReserve() { - return this.fundsReserve != null && !this.fundsReserve.isEmpty(); - } - - /** - * @param value {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) - */ - public Claim setFundsReserve(Coding value) { - this.fundsReserve = value; - return this; - } - - /** - * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public Reference getEnterer() { - if (this.enterer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.enterer"); - else if (Configuration.doAutoCreate()) - this.enterer = new Reference(); // cc - return this.enterer; - } - - public boolean hasEnterer() { - return this.enterer != null && !this.enterer.isEmpty(); - } - - /** - * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public Claim setEnterer(Reference value) { - this.enterer = value; - return this; - } - - /** - * @return {@link #enterer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public Practitioner getEntererTarget() { - if (this.entererTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.enterer"); - else if (Configuration.doAutoCreate()) - this.entererTarget = new Practitioner(); // aa - return this.entererTarget; - } - - /** - * @param value {@link #enterer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public Claim setEntererTarget(Practitioner value) { - this.entererTarget = value; - return this; - } - - /** - * @return {@link #facility} (Facility where the services were provided.) - */ - public Reference getFacility() { - if (this.facility == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.facility"); - else if (Configuration.doAutoCreate()) - this.facility = new Reference(); // cc - return this.facility; - } - - public boolean hasFacility() { - return this.facility != null && !this.facility.isEmpty(); - } - - /** - * @param value {@link #facility} (Facility where the services were provided.) - */ - public Claim setFacility(Reference value) { - this.facility = value; - return this; - } - - /** - * @return {@link #facility} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Facility where the services were provided.) - */ - public Location getFacilityTarget() { - if (this.facilityTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.facility"); - else if (Configuration.doAutoCreate()) - this.facilityTarget = new Location(); // aa - return this.facilityTarget; - } - - /** - * @param value {@link #facility} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Facility where the services were provided.) - */ - public Claim setFacilityTarget(Location value) { - this.facilityTarget = value; - return this; - } - - /** - * @return {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.) - */ - public Reference getPrescription() { - if (this.prescription == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.prescription"); - else if (Configuration.doAutoCreate()) - this.prescription = new Reference(); // cc - return this.prescription; - } - - public boolean hasPrescription() { - return this.prescription != null && !this.prescription.isEmpty(); - } - - /** - * @param value {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.) - */ - public Claim setPrescription(Reference value) { - this.prescription = value; - return this; - } - - /** - * @return {@link #prescription} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Prescription to support the dispensing of Pharmacy or Vision products.) - */ - public Resource getPrescriptionTarget() { - return this.prescriptionTarget; - } - - /** - * @param value {@link #prescription} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Prescription to support the dispensing of Pharmacy or Vision products.) - */ - public Claim setPrescriptionTarget(Resource value) { - this.prescriptionTarget = value; - return this; - } - - /** - * @return {@link #originalPrescription} (Original prescription to support the dispensing of pharmacy services, medications or products.) - */ - public Reference getOriginalPrescription() { - if (this.originalPrescription == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.originalPrescription"); - else if (Configuration.doAutoCreate()) - this.originalPrescription = new Reference(); // cc - return this.originalPrescription; - } - - public boolean hasOriginalPrescription() { - return this.originalPrescription != null && !this.originalPrescription.isEmpty(); - } - - /** - * @param value {@link #originalPrescription} (Original prescription to support the dispensing of pharmacy services, medications or products.) - */ - public Claim setOriginalPrescription(Reference value) { - this.originalPrescription = value; - return this; - } - - /** - * @return {@link #originalPrescription} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original prescription to support the dispensing of pharmacy services, medications or products.) - */ - public MedicationPrescription getOriginalPrescriptionTarget() { - if (this.originalPrescriptionTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.originalPrescription"); - else if (Configuration.doAutoCreate()) - this.originalPrescriptionTarget = new MedicationPrescription(); // aa - return this.originalPrescriptionTarget; - } - - /** - * @param value {@link #originalPrescription} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original prescription to support the dispensing of pharmacy services, medications or products.) - */ - public Claim setOriginalPrescriptionTarget(MedicationPrescription value) { - this.originalPrescriptionTarget = value; - return this; - } - - /** - * @return {@link #payee} (The party to be reimbursed for the services.) - */ - public PayeeComponent getPayee() { - if (this.payee == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.payee"); - else if (Configuration.doAutoCreate()) - this.payee = new PayeeComponent(); // cc - return this.payee; - } - - public boolean hasPayee() { - return this.payee != null && !this.payee.isEmpty(); - } - - /** - * @param value {@link #payee} (The party to be reimbursed for the services.) - */ - public Claim setPayee(PayeeComponent value) { - this.payee = value; - return this; - } - - /** - * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public Reference getReferral() { - if (this.referral == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.referral"); - else if (Configuration.doAutoCreate()) - this.referral = new Reference(); // cc - return this.referral; - } - - public boolean hasReferral() { - return this.referral != null && !this.referral.isEmpty(); - } - - /** - * @param value {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public Claim setReferral(Reference value) { - this.referral = value; - return this; - } - - /** - * @return {@link #referral} The actual object that is the 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 referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public ReferralRequest getReferralTarget() { - if (this.referralTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.referral"); - else if (Configuration.doAutoCreate()) - this.referralTarget = new ReferralRequest(); // aa - return this.referralTarget; - } - - /** - * @param value {@link #referral} The actual object that is the 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 referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public Claim setReferralTarget(ReferralRequest value) { - this.referralTarget = value; - return this; - } - - /** - * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) - */ - public List getDiagnosis() { - if (this.diagnosis == null) - this.diagnosis = new ArrayList(); - return this.diagnosis; - } - - public boolean hasDiagnosis() { - if (this.diagnosis == null) - return false; - for (DiagnosisComponent item : this.diagnosis) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) - */ - // syntactic sugar - public DiagnosisComponent addDiagnosis() { //3 - DiagnosisComponent t = new DiagnosisComponent(); - if (this.diagnosis == null) - this.diagnosis = new ArrayList(); - this.diagnosis.add(t); - return t; - } - - // syntactic sugar - public Claim addDiagnosis(DiagnosisComponent t) { //3 - if (t == null) - return this; - if (this.diagnosis == null) - this.diagnosis = new ArrayList(); - this.diagnosis.add(t); - return this; - } - - /** - * @return {@link #condition} (List of patient conditions for which care is sought.) - */ - public List getCondition() { - if (this.condition == null) - this.condition = new ArrayList(); - return this.condition; - } - - public boolean hasCondition() { - if (this.condition == null) - return false; - for (Coding item : this.condition) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #condition} (List of patient conditions for which care is sought.) - */ - // syntactic sugar - public Coding addCondition() { //3 - Coding t = new Coding(); - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return t; - } - - // syntactic sugar - public Claim addCondition(Coding t) { //3 - if (t == null) - return this; - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return this; - } - - /** - * @return {@link #patient} (Patient Resource.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (Patient Resource.) - */ - public Claim setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Patient Resource.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Patient Resource.) - */ - public Claim setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - public List getCoverage() { - if (this.coverage == null) - this.coverage = new ArrayList(); - return this.coverage; - } - - public boolean hasCoverage() { - if (this.coverage == null) - return false; - for (CoverageComponent item : this.coverage) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - // syntactic sugar - public CoverageComponent addCoverage() { //3 - CoverageComponent t = new CoverageComponent(); - if (this.coverage == null) - this.coverage = new ArrayList(); - this.coverage.add(t); - return t; - } - - // syntactic sugar - public Claim addCoverage(CoverageComponent t) { //3 - if (t == null) - return this; - if (this.coverage == null) - this.coverage = new ArrayList(); - this.coverage.add(t); - return this; - } - - /** - * @return {@link #exception} (Factors which may influence the applicability of coverage.) - */ - public List getException() { - if (this.exception == null) - this.exception = new ArrayList(); - return this.exception; - } - - public boolean hasException() { - if (this.exception == null) - return false; - for (Coding item : this.exception) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #exception} (Factors which may influence the applicability of coverage.) - */ - // syntactic sugar - public Coding addException() { //3 - Coding t = new Coding(); - if (this.exception == null) - this.exception = new ArrayList(); - this.exception.add(t); - return t; - } - - // syntactic sugar - public Claim addException(Coding t) { //3 - if (t == null) - return this; - if (this.exception == null) - this.exception = new ArrayList(); - this.exception.add(t); - return this; - } - - /** - * @return {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value - */ - public StringType getSchoolElement() { - if (this.school == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.school"); - else if (Configuration.doAutoCreate()) - this.school = new StringType(); // bb - return this.school; - } - - public boolean hasSchoolElement() { - return this.school != null && !this.school.isEmpty(); - } - - public boolean hasSchool() { - return this.school != null && !this.school.isEmpty(); - } - - /** - * @param value {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value - */ - public Claim setSchoolElement(StringType value) { - this.school = value; - return this; - } - - /** - * @return Name of school for over-aged dependants. - */ - public String getSchool() { - return this.school == null ? null : this.school.getValue(); - } - - /** - * @param value Name of school for over-aged dependants. - */ - public Claim setSchool(String value) { - if (Utilities.noString(value)) - this.school = null; - else { - if (this.school == null) - this.school = new StringType(); - this.school.setValue(value); - } - return this; - } - - /** - * @return {@link #accident} (Date of an accident which these services are addressing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value - */ - public DateType getAccidentElement() { - if (this.accident == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.accident"); - else if (Configuration.doAutoCreate()) - this.accident = new DateType(); // bb - return this.accident; - } - - public boolean hasAccidentElement() { - return this.accident != null && !this.accident.isEmpty(); - } - - public boolean hasAccident() { - return this.accident != null && !this.accident.isEmpty(); - } - - /** - * @param value {@link #accident} (Date of an accident which these services are addressing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value - */ - public Claim setAccidentElement(DateType value) { - this.accident = value; - return this; - } - - /** - * @return Date of an accident which these services are addressing. - */ - public Date getAccident() { - return this.accident == null ? null : this.accident.getValue(); - } - - /** - * @param value Date of an accident which these services are addressing. - */ - public Claim setAccident(Date value) { - if (value == null) - this.accident = null; - else { - if (this.accident == null) - this.accident = new DateType(); - this.accident.setValue(value); - } - return this; - } - - /** - * @return {@link #accidentType} (Type of accident: work, auto, etc.) - */ - public Coding getAccidentType() { - if (this.accidentType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.accidentType"); - else if (Configuration.doAutoCreate()) - this.accidentType = new Coding(); // cc - return this.accidentType; - } - - public boolean hasAccidentType() { - return this.accidentType != null && !this.accidentType.isEmpty(); - } - - /** - * @param value {@link #accidentType} (Type of accident: work, auto, etc.) - */ - public Claim setAccidentType(Coding value) { - this.accidentType = value; - return this; - } - - /** - * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) - */ - public List getInterventionException() { - if (this.interventionException == null) - this.interventionException = new ArrayList(); - return this.interventionException; - } - - public boolean hasInterventionException() { - if (this.interventionException == null) - return false; - for (Coding item : this.interventionException) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) - */ - // syntactic sugar - public Coding addInterventionException() { //3 - Coding t = new Coding(); - if (this.interventionException == null) - this.interventionException = new ArrayList(); - this.interventionException.add(t); - return t; - } - - // syntactic sugar - public Claim addInterventionException(Coding t) { //3 - if (t == null) - return this; - if (this.interventionException == null) - this.interventionException = new ArrayList(); - this.interventionException.add(t); - return this; - } - - /** - * @return {@link #item} (First tier of goods and services.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (ItemsComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (First tier of goods and services.) - */ - // syntactic sugar - public ItemsComponent addItem() { //3 - ItemsComponent t = new ItemsComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - // syntactic sugar - public Claim addItem(ItemsComponent t) { //3 - if (t == null) - return this; - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return this; - } - - /** - * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) - */ - public List getAdditionalMaterials() { - if (this.additionalMaterials == null) - this.additionalMaterials = new ArrayList(); - return this.additionalMaterials; - } - - public boolean hasAdditionalMaterials() { - if (this.additionalMaterials == null) - return false; - for (Coding item : this.additionalMaterials) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) - */ - // syntactic sugar - public Coding addAdditionalMaterials() { //3 - Coding t = new Coding(); - if (this.additionalMaterials == null) - this.additionalMaterials = new ArrayList(); - this.additionalMaterials.add(t); - return t; - } - - // syntactic sugar - public Claim addAdditionalMaterials(Coding t) { //3 - if (t == null) - return this; - if (this.additionalMaterials == null) - this.additionalMaterials = new ArrayList(); - this.additionalMaterials.add(t); - return this; - } - - /** - * @return {@link #missingTeeth} (A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.) - */ - public List getMissingTeeth() { - if (this.missingTeeth == null) - this.missingTeeth = new ArrayList(); - return this.missingTeeth; - } - - public boolean hasMissingTeeth() { - if (this.missingTeeth == null) - return false; - for (MissingTeethComponent item : this.missingTeeth) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #missingTeeth} (A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.) - */ - // syntactic sugar - public MissingTeethComponent addMissingTeeth() { //3 - MissingTeethComponent t = new MissingTeethComponent(); - if (this.missingTeeth == null) - this.missingTeeth = new ArrayList(); - this.missingTeeth.add(t); - return t; - } - - // syntactic sugar - public Claim addMissingTeeth(MissingTeethComponent t) { //3 - if (t == null) - return this; - if (this.missingTeeth == null) - this.missingTeeth = new ArrayList(); - this.missingTeeth.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "The category of claim this is.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("identifier", "Identifier", "The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("ruleset", "Coding", "The version of the specification on which this instance relies.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The version of the specification from which the original instance was created.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("target", "Reference(Organization)", "Insurer Identifier, typical BIN number (6 digit).", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider which is responsible for the bill, claim pre-determination, pre-authorization.", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the bill, claim pre-determination, pre-authorization.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("use", "code", "Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("priority", "Coding", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("fundsReserve", "Coding", "In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.", 0, java.lang.Integer.MAX_VALUE, fundsReserve)); - childrenList.add(new Property("enterer", "Reference(Practitioner)", "Person who created the invoice/claim/pre-determination or pre-authorization.", 0, java.lang.Integer.MAX_VALUE, enterer)); - childrenList.add(new Property("facility", "Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); - childrenList.add(new Property("prescription", "Reference(MedicationPrescription|VisionPrescription)", "Prescription to support the dispensing of Pharmacy or Vision products.", 0, java.lang.Integer.MAX_VALUE, prescription)); - childrenList.add(new Property("originalPrescription", "Reference(MedicationPrescription)", "Original prescription to support the dispensing of pharmacy services, medications or products.", 0, java.lang.Integer.MAX_VALUE, originalPrescription)); - childrenList.add(new Property("payee", "", "The party to be reimbursed for the services.", 0, java.lang.Integer.MAX_VALUE, payee)); - childrenList.add(new Property("referral", "Reference(ReferralRequest)", "The referral resource which lists the date, practitioner, reason and other supporting information.", 0, java.lang.Integer.MAX_VALUE, referral)); - childrenList.add(new Property("diagnosis", "", "Ordered list of patient diagnosis for which care is sought.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); - childrenList.add(new Property("condition", "Coding", "List of patient conditions for which care is sought.", 0, java.lang.Integer.MAX_VALUE, condition)); - childrenList.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("exception", "Coding", "Factors which may influence the applicability of coverage.", 0, java.lang.Integer.MAX_VALUE, exception)); - childrenList.add(new Property("school", "string", "Name of school for over-aged dependants.", 0, java.lang.Integer.MAX_VALUE, school)); - childrenList.add(new Property("accident", "date", "Date of an accident which these services are addressing.", 0, java.lang.Integer.MAX_VALUE, accident)); - childrenList.add(new Property("accidentType", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, accidentType)); - childrenList.add(new Property("interventionException", "Coding", "A list of intervention and exception codes which may influence the adjudication of the claim.", 0, java.lang.Integer.MAX_VALUE, interventionException)); - childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("additionalMaterials", "Coding", "Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.", 0, java.lang.Integer.MAX_VALUE, additionalMaterials)); - childrenList.add(new Property("missingTeeth", "", "A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.", 0, java.lang.Integer.MAX_VALUE, missingTeeth)); - } - - public Claim copy() { - Claim dst = new Claim(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.target = target == null ? null : target.copy(); - dst.provider = provider == null ? null : provider.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.use = use == null ? null : use.copy(); - dst.priority = priority == null ? null : priority.copy(); - dst.fundsReserve = fundsReserve == null ? null : fundsReserve.copy(); - dst.enterer = enterer == null ? null : enterer.copy(); - dst.facility = facility == null ? null : facility.copy(); - dst.prescription = prescription == null ? null : prescription.copy(); - dst.originalPrescription = originalPrescription == null ? null : originalPrescription.copy(); - dst.payee = payee == null ? null : payee.copy(); - dst.referral = referral == null ? null : referral.copy(); - if (diagnosis != null) { - dst.diagnosis = new ArrayList(); - for (DiagnosisComponent i : diagnosis) - dst.diagnosis.add(i.copy()); - }; - if (condition != null) { - dst.condition = new ArrayList(); - for (Coding i : condition) - dst.condition.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - if (coverage != null) { - dst.coverage = new ArrayList(); - for (CoverageComponent i : coverage) - dst.coverage.add(i.copy()); - }; - if (exception != null) { - dst.exception = new ArrayList(); - for (Coding i : exception) - dst.exception.add(i.copy()); - }; - dst.school = school == null ? null : school.copy(); - dst.accident = accident == null ? null : accident.copy(); - dst.accidentType = accidentType == null ? null : accidentType.copy(); - if (interventionException != null) { - dst.interventionException = new ArrayList(); - for (Coding i : interventionException) - dst.interventionException.add(i.copy()); - }; - if (item != null) { - dst.item = new ArrayList(); - for (ItemsComponent i : item) - dst.item.add(i.copy()); - }; - if (additionalMaterials != null) { - dst.additionalMaterials = new ArrayList(); - for (Coding i : additionalMaterials) - dst.additionalMaterials.add(i.copy()); - }; - if (missingTeeth != null) { - dst.missingTeeth = new ArrayList(); - for (MissingTeethComponent i : missingTeeth) - dst.missingTeeth.add(i.copy()); - }; - return dst; - } - - protected Claim typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Claim)) - return false; - Claim o = (Claim) other; - return compareDeep(type, o.type, true) && compareDeep(identifier, o.identifier, true) && compareDeep(ruleset, o.ruleset, true) - && compareDeep(originalRuleset, o.originalRuleset, true) && compareDeep(created, o.created, true) - && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) && compareDeep(organization, o.organization, true) - && compareDeep(use, o.use, true) && compareDeep(priority, o.priority, true) && compareDeep(fundsReserve, o.fundsReserve, true) - && compareDeep(enterer, o.enterer, true) && compareDeep(facility, o.facility, true) && compareDeep(prescription, o.prescription, true) - && compareDeep(originalPrescription, o.originalPrescription, true) && compareDeep(payee, o.payee, true) - && compareDeep(referral, o.referral, true) && compareDeep(diagnosis, o.diagnosis, true) && compareDeep(condition, o.condition, true) - && compareDeep(patient, o.patient, true) && compareDeep(coverage, o.coverage, true) && compareDeep(exception, o.exception, true) - && compareDeep(school, o.school, true) && compareDeep(accident, o.accident, true) && compareDeep(accidentType, o.accidentType, true) - && compareDeep(interventionException, o.interventionException, true) && compareDeep(item, o.item, true) - && compareDeep(additionalMaterials, o.additionalMaterials, true) && compareDeep(missingTeeth, o.missingTeeth, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Claim)) - return false; - Claim o = (Claim) other; - return compareValues(type, o.type, true) && compareValues(created, o.created, true) && compareValues(use, o.use, true) - && compareValues(school, o.school, true) && compareValues(accident, o.accident, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.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()) && (use == null || use.isEmpty()) && (priority == null || priority.isEmpty()) - && (fundsReserve == null || fundsReserve.isEmpty()) && (enterer == null || enterer.isEmpty()) - && (facility == null || facility.isEmpty()) && (prescription == null || prescription.isEmpty()) - && (originalPrescription == null || originalPrescription.isEmpty()) && (payee == null || payee.isEmpty()) - && (referral == null || referral.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) - && (condition == null || condition.isEmpty()) && (patient == null || patient.isEmpty()) && (coverage == null || coverage.isEmpty()) - && (exception == null || exception.isEmpty()) && (school == null || school.isEmpty()) && (accident == null || accident.isEmpty()) - && (accidentType == null || accidentType.isEmpty()) && (interventionException == null || interventionException.isEmpty()) - && (item == null || item.isEmpty()) && (additionalMaterials == null || additionalMaterials.isEmpty()) - && (missingTeeth == null || missingTeeth.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Claim; - } - - @SearchParamDefinition(name="patient", path="Claim.patient", description="Patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="priority", path="Claim.priority", description="Processing priority requested", type="token" ) - public static final String SP_PRIORITY = "priority"; - @SearchParamDefinition(name="use", path="Claim.use", description="The kind of financial resource", type="token" ) - public static final String SP_USE = "use"; - @SearchParamDefinition(name="provider", path="Claim.provider", description="Provider responsible for the claim", type="reference" ) - public static final String SP_PROVIDER = "provider"; - @SearchParamDefinition(name="identifier", path="Claim.identifier", description="The primary identifier of the financial resource", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import java.util.*; + +import java.math.*; +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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. + */ +@ResourceDef(name="Claim", profile="http://hl7.org/fhir/Profile/Claim") +public class Claim extends DomainResource { + + public enum TypeLink { + /** + * A claim for Institution based, typically in-patient, goods and services. + */ + INSTITUTIONAL, + /** + * A claim for Oral Health (Dentist, Denturist, Hygienist) goods and services. + */ + ORAL, + /** + * A claim for Pharmacy based goods and services. + */ + PHARMACY, + /** + * A claim for Professional, typically out-patient, goods and services. + */ + PROFESSIONAL, + /** + * A claim for Vision (Opthamologist, Optometrist and Optician) goods and services. + */ + VISION, + /** + * added to help the parsers + */ + NULL; + public static TypeLink fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("institutional".equals(codeString)) + return INSTITUTIONAL; + if ("oral".equals(codeString)) + return ORAL; + if ("pharmacy".equals(codeString)) + return PHARMACY; + if ("professional".equals(codeString)) + return PROFESSIONAL; + if ("vision".equals(codeString)) + return VISION; + throw new Exception("Unknown TypeLink code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INSTITUTIONAL: return "institutional"; + case ORAL: return "oral"; + case PHARMACY: return "pharmacy"; + case PROFESSIONAL: return "professional"; + case VISION: return "vision"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INSTITUTIONAL: return ""; + case ORAL: return ""; + case PHARMACY: return ""; + case PROFESSIONAL: return ""; + case VISION: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INSTITUTIONAL: return "A claim for Institution based, typically in-patient, goods and services."; + case ORAL: return "A claim for Oral Health (Dentist, Denturist, Hygienist) goods and services."; + case PHARMACY: return "A claim for Pharmacy based goods and services."; + case PROFESSIONAL: return "A claim for Professional, typically out-patient, goods and services."; + case VISION: return "A claim for Vision (Opthamologist, Optometrist and Optician) goods and services."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INSTITUTIONAL: return "Institutional"; + case ORAL: return "Oral Health"; + case PHARMACY: return "Pharmacy"; + case PROFESSIONAL: return "Professional"; + case VISION: return "Vision"; + default: return "?"; + } + } + } + + public static class TypeLinkEnumFactory implements EnumFactory { + public TypeLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("institutional".equals(codeString)) + return TypeLink.INSTITUTIONAL; + if ("oral".equals(codeString)) + return TypeLink.ORAL; + if ("pharmacy".equals(codeString)) + return TypeLink.PHARMACY; + if ("professional".equals(codeString)) + return TypeLink.PROFESSIONAL; + if ("vision".equals(codeString)) + return TypeLink.VISION; + throw new IllegalArgumentException("Unknown TypeLink code '"+codeString+"'"); + } + public String toCode(TypeLink code) { + if (code == TypeLink.INSTITUTIONAL) + return "institutional"; + if (code == TypeLink.ORAL) + return "oral"; + if (code == TypeLink.PHARMACY) + return "pharmacy"; + if (code == TypeLink.PROFESSIONAL) + return "professional"; + if (code == TypeLink.VISION) + return "vision"; + return "?"; + } + } + + public enum UseLink { + /** + * The treatment is complete and this represents a Claim for the services. + */ + COMPLETE, + /** + * The treatment is proposed and this represents a Pre-authorization for the services. + */ + PROPOSED, + /** + * The treatment is proposed and this represents a Pre-determination for the services. + */ + EXPLORATORY, + /** + * A locally defined or otherwise resolved status. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + public static UseLink fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return COMPLETE; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("exploratory".equals(codeString)) + return EXPLORATORY; + if ("other".equals(codeString)) + return OTHER; + throw new Exception("Unknown UseLink code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case PROPOSED: return "proposed"; + case EXPLORATORY: return "exploratory"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return ""; + case PROPOSED: return ""; + case EXPLORATORY: return ""; + case OTHER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The treatment is complete and this represents a Claim for the services."; + case PROPOSED: return "The treatment is proposed and this represents a Pre-authorization for the services."; + case EXPLORATORY: return "The treatment is proposed and this represents a Pre-determination for the services."; + case OTHER: return "A locally defined or otherwise resolved status."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "Complete"; + case PROPOSED: return "Proposed"; + case EXPLORATORY: return "Exploratory"; + case OTHER: return "Other"; + default: return "?"; + } + } + } + + public static class UseLinkEnumFactory implements EnumFactory { + public UseLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return UseLink.COMPLETE; + if ("proposed".equals(codeString)) + return UseLink.PROPOSED; + if ("exploratory".equals(codeString)) + return UseLink.EXPLORATORY; + if ("other".equals(codeString)) + return UseLink.OTHER; + throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); + } + public String toCode(UseLink code) { + if (code == UseLink.COMPLETE) + return "complete"; + if (code == UseLink.PROPOSED) + return "proposed"; + if (code == UseLink.EXPLORATORY) + return "exploratory"; + if (code == UseLink.OTHER) + return "other"; + return "?"; + } + } + + @Block() + public static class PayeeComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Party to be reimbursed: Subscriber, provider, other. + */ + @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) + protected Coding type; + + /** + * The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name = "provider", type = {Practitioner.class}, order=2, min=0, max=1) + @Description(shortDefinition="Provider who is the payee", formalDefinition="The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Practitioner providerTarget; + + /** + * The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name = "organization", type = {Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Organization who is the payee", formalDefinition="The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Organization organizationTarget; + + /** + * The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name = "person", type = {Patient.class}, order=4, min=0, max=1) + @Description(shortDefinition="Other person who is the payee", formalDefinition="The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference person; + + /** + * The actual object that is the target of the reference (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Patient personTarget; + + private static final long serialVersionUID = -503108488L; + + /* + * Constructor + */ + public PayeeComponent() { + super(); + } + + /** + * @return {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public PayeeComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); // cc + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent 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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); // aa + return this.providerTarget; + } + + /** + * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); // cc + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent 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 who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); // aa + return this.organizationTarget; + } + + /** + * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getPerson() { + if (this.person == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.person = new Reference(); // cc + return this.person; + } + + public boolean hasPerson() { + return this.person != null && !this.person.isEmpty(); + } + + /** + * @param value {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPerson(Reference value) { + this.person = value; + return this; + } + + /** + * @return {@link #person} The actual object that is the 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 other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Patient getPersonTarget() { + if (this.personTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.personTarget = new Patient(); // aa + return this.personTarget; + } + + /** + * @param value {@link #person} The actual object that is the 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 other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPersonTarget(Patient value) { + this.personTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("person", "Reference(Patient)", "The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, person)); + } + + public PayeeComponent copy() { + PayeeComponent dst = new PayeeComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.person = person == null ? null : person.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof PayeeComponent)) + return false; + PayeeComponent o = (PayeeComponent) other; + return compareDeep(type, o.type, true) && compareDeep(provider, o.provider, true) && compareDeep(organization, o.organization, true) + && compareDeep(person, o.person, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof PayeeComponent)) + return false; + PayeeComponent o = (PayeeComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (provider == null || provider.isEmpty()) + && (organization == null || organization.isEmpty()) && (person == null || person.isEmpty()) + ; + } + + } + + @Block() + public static class DiagnosisComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Sequence of diagnosis which serves to order and provide a link. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Sequence of diagnosis", formalDefinition="Sequence of diagnosis which serves to order and provide a link." ) + protected PositiveIntType sequence; + + /** + * The diagnosis. + */ + @Child(name = "diagnosis", type = {Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." ) + protected Coding diagnosis; + + private static final long serialVersionUID = -795010186L; + + /* + * Constructor + */ + public DiagnosisComponent() { + super(); + } + + /* + * Constructor + */ + public DiagnosisComponent(PositiveIntType sequence, Coding diagnosis) { + super(); + this.sequence = sequence; + this.diagnosis = diagnosis; + } + + /** + * @return {@link #sequence} (Sequence of diagnosis which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (Sequence of diagnosis which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DiagnosisComponent setSequenceElement(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return Sequence of diagnosis which serves to order and provide a link. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value Sequence of diagnosis which serves to order and provide a link. + */ + public DiagnosisComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #diagnosis} (The diagnosis.) + */ + public Coding getDiagnosis() { + if (this.diagnosis == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.diagnosis"); + else if (Configuration.doAutoCreate()) + this.diagnosis = new Coding(); // cc + return this.diagnosis; + } + + public boolean hasDiagnosis() { + return this.diagnosis != null && !this.diagnosis.isEmpty(); + } + + /** + * @param value {@link #diagnosis} (The diagnosis.) + */ + public DiagnosisComponent setDiagnosis(Coding value) { + this.diagnosis = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "positiveInt", "Sequence of diagnosis which serves to order and provide a link.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + } + + public DiagnosisComponent copy() { + DiagnosisComponent dst = new DiagnosisComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.diagnosis = diagnosis == null ? null : diagnosis.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DiagnosisComponent)) + return false; + DiagnosisComponent o = (DiagnosisComponent) other; + return compareDeep(sequence, o.sequence, true) && compareDeep(diagnosis, o.diagnosis, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DiagnosisComponent)) + return false; + DiagnosisComponent o = (DiagnosisComponent) other; + return compareValues(sequence, o.sequence, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + ; + } + + } + + @Block() + public static class CoverageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A service line item. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) + protected PositiveIntType sequence; + + /** + * The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. + */ + @Child(name = "focal", type = {BooleanType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated." ) + protected BooleanType focal; + + /** + * Reference to the program or plan identification, underwriter or payor. + */ + @Child(name = "coverage", type = {Coverage.class}, order=3, min=1, max=1) + @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) + protected Reference coverage; + + /** + * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) + */ + protected Coverage coverageTarget; + + /** + * The contract number of a business agreement which describes the terms and conditions. + */ + @Child(name = "businessArrangement", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agreement which describes the terms and conditions." ) + protected StringType businessArrangement; + + /** + * The relationship of the patient to the subscriber. + */ + @Child(name = "relationship", type = {Coding.class}, order=5, min=1, max=1) + @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) + protected Coding relationship; + + /** + * A list of references from the Insurer to which these services pertain. + */ + @Child(name = "preAuthRef", type = {StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) + protected List preAuthRef; + + /** + * The Coverages adjudication details. + */ + @Child(name = "claimResponse", type = {ClaimResponse.class}, order=7, min=0, max=1) + @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." ) + protected Reference claimResponse; + + /** + * The actual object that is the target of the reference (The Coverages adjudication details.) + */ + protected ClaimResponse claimResponseTarget; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=8, 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; + + private static final long serialVersionUID = 621250924L; + + /* + * Constructor + */ + public CoverageComponent() { + super(); + } + + /* + * Constructor + */ + public CoverageComponent(PositiveIntType sequence, BooleanType focal, Reference coverage, Coding relationship) { + super(); + this.sequence = sequence; + this.focal = focal; + this.coverage = coverage; + this.relationship = relationship; + } + + /** + * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public CoverageComponent setSequenceElement(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line item. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value A service line item. + */ + public CoverageComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public BooleanType getFocalElement() { + if (this.focal == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.focal"); + else if (Configuration.doAutoCreate()) + this.focal = new BooleanType(); // bb + return this.focal; + } + + public boolean hasFocalElement() { + return this.focal != null && !this.focal.isEmpty(); + } + + public boolean hasFocal() { + return this.focal != null && !this.focal.isEmpty(); + } + + /** + * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public CoverageComponent setFocalElement(BooleanType value) { + this.focal = value; + return this; + } + + /** + * @return The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. + */ + public boolean getFocal() { + return this.focal == null || this.focal.isEmpty() ? false : this.focal.getValue(); + } + + /** + * @param value The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. + */ + public CoverageComponent setFocal(boolean value) { + if (this.focal == null) + this.focal = new BooleanType(); + this.focal.setValue(value); + return this; + } + + /** + * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public Reference getCoverage() { + if (this.coverage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverage = new Reference(); // cc + return this.coverage; + } + + public boolean hasCoverage() { + return this.coverage != null && !this.coverage.isEmpty(); + } + + /** + * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public CoverageComponent setCoverage(Reference value) { + this.coverage = value; + return this; + } + + /** + * @return {@link #coverage} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) + */ + public Coverage getCoverageTarget() { + if (this.coverageTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverageTarget = new Coverage(); // aa + return this.coverageTarget; + } + + /** + * @param value {@link #coverage} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) + */ + public CoverageComponent setCoverageTarget(Coverage value) { + this.coverageTarget = value; + return this; + } + + /** + * @return {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public StringType getBusinessArrangementElement() { + if (this.businessArrangement == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); + else if (Configuration.doAutoCreate()) + this.businessArrangement = new StringType(); // bb + return this.businessArrangement; + } + + public boolean hasBusinessArrangementElement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + public boolean hasBusinessArrangement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + /** + * @param value {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public CoverageComponent setBusinessArrangementElement(StringType value) { + this.businessArrangement = value; + return this; + } + + /** + * @return The contract number of a business agreement which describes the terms and conditions. + */ + public String getBusinessArrangement() { + return this.businessArrangement == null ? null : this.businessArrangement.getValue(); + } + + /** + * @param value The contract number of a business agreement which describes the terms and conditions. + */ + public CoverageComponent setBusinessArrangement(String value) { + if (Utilities.noString(value)) + this.businessArrangement = null; + else { + if (this.businessArrangement == null) + this.businessArrangement = new StringType(); + this.businessArrangement.setValue(value); + } + return this; + } + + /** + * @return {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public Coding getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new Coding(); // cc + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public CoverageComponent setRelationship(Coding value) { + this.relationship = value; + return this; + } + + /** + * @return {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) + */ + public List getPreAuthRef() { + if (this.preAuthRef == null) + this.preAuthRef = new ArrayList(); + return this.preAuthRef; + } + + public boolean hasPreAuthRef() { + if (this.preAuthRef == null) + return false; + for (StringType item : this.preAuthRef) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) + */ + // syntactic sugar + public StringType addPreAuthRefElement() {//2 + StringType t = new StringType(); + if (this.preAuthRef == null) + this.preAuthRef = new ArrayList(); + this.preAuthRef.add(t); + return t; + } + + /** + * @param value {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) + */ + public CoverageComponent addPreAuthRef(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.preAuthRef == null) + this.preAuthRef = new ArrayList(); + this.preAuthRef.add(t); + return this; + } + + /** + * @param value {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) + */ + public boolean hasPreAuthRef(String value) { + if (this.preAuthRef == null) + return false; + for (StringType v : this.preAuthRef) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #claimResponse} (The Coverages adjudication details.) + */ + public Reference getClaimResponse() { + if (this.claimResponse == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponse = new Reference(); // cc + return this.claimResponse; + } + + public boolean hasClaimResponse() { + return this.claimResponse != null && !this.claimResponse.isEmpty(); + } + + /** + * @param value {@link #claimResponse} (The Coverages adjudication details.) + */ + public CoverageComponent setClaimResponse(Reference value) { + this.claimResponse = value; + return this; + } + + /** + * @return {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.) + */ + public ClaimResponse getClaimResponseTarget() { + if (this.claimResponseTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponseTarget = new ClaimResponse(); // aa + return this.claimResponseTarget; + } + + /** + * @param value {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.) + */ + public CoverageComponent setClaimResponseTarget(ClaimResponse value) { + this.claimResponseTarget = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public CoverageComponent setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "positiveInt", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.", 0, java.lang.Integer.MAX_VALUE, focal)); + childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agreement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); + childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("preAuthRef", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preAuthRef)); + childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); + childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); + } + + public CoverageComponent copy() { + CoverageComponent dst = new CoverageComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.focal = focal == null ? null : focal.copy(); + dst.coverage = coverage == null ? null : coverage.copy(); + dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + if (preAuthRef != null) { + dst.preAuthRef = new ArrayList(); + for (StringType i : preAuthRef) + dst.preAuthRef.add(i.copy()); + }; + dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CoverageComponent)) + return false; + CoverageComponent o = (CoverageComponent) other; + return compareDeep(sequence, o.sequence, true) && compareDeep(focal, o.focal, true) && compareDeep(coverage, o.coverage, true) + && compareDeep(businessArrangement, o.businessArrangement, true) && compareDeep(relationship, o.relationship, true) + && compareDeep(preAuthRef, o.preAuthRef, true) && compareDeep(claimResponse, o.claimResponse, true) + && compareDeep(originalRuleset, o.originalRuleset, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CoverageComponent)) + return false; + CoverageComponent o = (CoverageComponent) other; + return compareValues(sequence, o.sequence, true) && compareValues(focal, o.focal, true) && compareValues(businessArrangement, o.businessArrangement, true) + && compareValues(preAuthRef, o.preAuthRef, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) + && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) + && (relationship == null || relationship.isEmpty()) && (preAuthRef == null || preAuthRef.isEmpty()) + && (claimResponse == null || claimResponse.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) + ; + } + + } + + @Block() + public static class ItemsComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A service line number. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected PositiveIntType sequence; + + /** + * The type of product or service. + */ + @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name = "provider", type = {Practitioner.class}, order=3, 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; + + /** + * Diagnosis applicable for this service or product line. + */ + @Child(name = "diagnosisLinkId", type = {PositiveIntType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosis Link", formalDefinition="Diagnosis applicable for this service or product line." ) + protected List diagnosisLinkId; + + /** + * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied. + */ + @Child(name = "service", type = {Coding.class}, order=5, min=1, max=1) + @Description(shortDefinition="Item Code", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied." ) + protected Coding service; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name = "serviceDate", type = {DateType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Date of Service", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateType serviceDate; + + /** + * The number of repetitions of a service or product. + */ + @Child(name = "quantity", type = {Quantity.class}, order=7, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group. + */ + @Child(name = "unitPrice", type = {Money.class}, order=8, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group." ) + protected Money unitPrice; + + /** + * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + @Child(name = "factor", type = {DecimalType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) + protected DecimalType factor; + + /** + * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + @Child(name = "points", type = {DecimalType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) + protected DecimalType points; + + /** + * The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + */ + @Child(name = "net", type = {Money.class}, order=11, min=0, max=1) + @Description(shortDefinition="Total item cost", formalDefinition="The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) + protected Money net; + + /** + * List of Unique Device Identifiers associated with this line item. + */ + @Child(name = "udi", type = {Coding.class}, order=12, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + /** + * Physical service site on the patient (limb, tooth, etc). + */ + @Child(name = "bodySite", type = {Coding.class}, order=13, min=0, max=1) + @Description(shortDefinition="Service Location", formalDefinition="Physical service site on the patient (limb, tooth, etc)." ) + protected Coding bodySite; + + /** + * A region or surface of the site, eg. limb region or tooth surface(s). + */ + @Child(name = "subSite", type = {Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Service Sub-location", formalDefinition="A region or surface of the site, eg. limb region or tooth surface(s)." ) + protected List subSite; + + /** + * Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen. + */ + @Child(name = "modifier", type = {Coding.class}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Service/Product billing modifiers", formalDefinition="Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen." ) + protected List modifier; + + /** + * Second tier of goods and services. + */ + @Child(name = "detail", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional items", formalDefinition="Second tier of goods and services." ) + protected List detail; + + /** + * The materials and placement date of prior fixed prosthesis. + */ + @Child(name = "prosthesis", type = {}, order=17, min=0, max=1) + @Description(shortDefinition="Prosthetic details", formalDefinition="The materials and placement date of prior fixed prosthesis." ) + protected ProsthesisComponent prosthesis; + + private static final long serialVersionUID = -311028698L; + + /* + * Constructor + */ + public ItemsComponent() { + super(); + } + + /* + * Constructor + */ + public ItemsComponent(PositiveIntType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public ItemsComponent setSequenceElement(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemsComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public ItemsComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); // cc + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public ItemsComponent 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 ItemsComponent.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); // aa + return this.providerTarget; + } + + /** + * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public ItemsComponent setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public List getDiagnosisLinkId() { + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + return this.diagnosisLinkId; + } + + public boolean hasDiagnosisLinkId() { + if (this.diagnosisLinkId == null) + return false; + for (PositiveIntType item : this.diagnosisLinkId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + // syntactic sugar + public PositiveIntType addDiagnosisLinkIdElement() {//2 + PositiveIntType t = new PositiveIntType(); + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + this.diagnosisLinkId.add(t); + return t; + } + + /** + * @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public ItemsComponent addDiagnosisLinkId(int value) { //1 + PositiveIntType t = new PositiveIntType(); + t.setValue(value); + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + this.diagnosisLinkId.add(t); + return this; + } + + /** + * @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public boolean hasDiagnosisLinkId(int value) { + if (this.diagnosisLinkId == null) + return false; + for (PositiveIntType v : this.diagnosisLinkId) + if (v.equals(value)) // positiveInt + return true; + return false; + } + + /** + * @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); // cc + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public ItemsComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value + */ + public DateType getServiceDateElement() { + if (this.serviceDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.serviceDate"); + else if (Configuration.doAutoCreate()) + this.serviceDate = new DateType(); // bb + return this.serviceDate; + } + + public boolean hasServiceDateElement() { + return this.serviceDate != null && !this.serviceDate.isEmpty(); + } + + public boolean hasServiceDate() { + return this.serviceDate != null && !this.serviceDate.isEmpty(); + } + + /** + * @param value {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value + */ + public ItemsComponent setServiceDateElement(DateType value) { + this.serviceDate = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + public Date getServiceDate() { + return this.serviceDate == null ? null : this.serviceDate.getValue(); + } + + /** + * @param value The date when the enclosed suite of services were performed or completed. + */ + public ItemsComponent setServiceDate(Date value) { + if (value == null) + this.serviceDate = null; + else { + if (this.serviceDate == null) + this.serviceDate = new DateType(); + this.serviceDate.setValue(value); + } + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public ItemsComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); // cc + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) + */ + public ItemsComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); // bb + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public ItemsComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public ItemsComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); // bb + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public ItemsComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public ItemsComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); // cc + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public ItemsComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); // cc + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public ItemsComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + /** + * @return {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) + */ + public Coding getBodySite() { + if (this.bodySite == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.bodySite"); + else if (Configuration.doAutoCreate()) + this.bodySite = new Coding(); // cc + return this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) + */ + public ItemsComponent setBodySite(Coding value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #subSite} (A region or surface of the site, eg. limb region or tooth surface(s).) + */ + public List getSubSite() { + if (this.subSite == null) + this.subSite = new ArrayList(); + return this.subSite; + } + + public boolean hasSubSite() { + if (this.subSite == null) + return false; + for (Coding item : this.subSite) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subSite} (A region or surface of the site, eg. limb region or tooth surface(s).) + */ + // syntactic sugar + public Coding addSubSite() { //3 + Coding t = new Coding(); + if (this.subSite == null) + this.subSite = new ArrayList(); + this.subSite.add(t); + return t; + } + + // syntactic sugar + public ItemsComponent addSubSite(Coding t) { //3 + if (t == null) + return this; + if (this.subSite == null) + this.subSite = new ArrayList(); + this.subSite.add(t); + return this; + } + + /** + * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) + */ + public List getModifier() { + if (this.modifier == null) + this.modifier = new ArrayList(); + return this.modifier; + } + + public boolean hasModifier() { + if (this.modifier == null) + return false; + for (Coding item : this.modifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) + */ + // syntactic sugar + public Coding addModifier() { //3 + Coding t = new Coding(); + if (this.modifier == null) + this.modifier = new ArrayList(); + this.modifier.add(t); + return t; + } + + // syntactic sugar + public ItemsComponent addModifier(Coding t) { //3 + if (t == null) + return this; + if (this.modifier == null) + this.modifier = new ArrayList(); + this.modifier.add(t); + return this; + } + + /** + * @return {@link #detail} (Second tier of goods and services.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (DetailComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (Second tier of goods and services.) + */ + // syntactic sugar + public DetailComponent addDetail() { //3 + DetailComponent t = new DetailComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + // syntactic sugar + public ItemsComponent addDetail(DetailComponent t) { //3 + if (t == null) + return this; + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return this; + } + + /** + * @return {@link #prosthesis} (The materials and placement date of prior fixed prosthesis.) + */ + public ProsthesisComponent getProsthesis() { + if (this.prosthesis == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.prosthesis"); + else if (Configuration.doAutoCreate()) + this.prosthesis = new ProsthesisComponent(); // cc + return this.prosthesis; + } + + public boolean hasProsthesis() { + return this.prosthesis != null && !this.prosthesis.isEmpty(); + } + + /** + * @param value {@link #prosthesis} (The materials and placement date of prior fixed prosthesis.) + */ + public ItemsComponent setProsthesis(ProsthesisComponent value) { + this.prosthesis = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("provider", "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("diagnosisLinkId", "positiveInt", "Diagnosis applicable for this service or product line.", 0, java.lang.Integer.MAX_VALUE, diagnosisLinkId)); + childrenList.add(new Property("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("serviceDate", "date", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, serviceDate)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("bodySite", "Coding", "Physical service site on the patient (limb, tooth, etc).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("subSite", "Coding", "A region or surface of the site, eg. limb region or tooth surface(s).", 0, java.lang.Integer.MAX_VALUE, subSite)); + childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); + childrenList.add(new Property("prosthesis", "", "The materials and placement date of prior fixed prosthesis.", 0, java.lang.Integer.MAX_VALUE, prosthesis)); + } + + public ItemsComponent copy() { + ItemsComponent dst = new ItemsComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.provider = provider == null ? null : provider.copy(); + if (diagnosisLinkId != null) { + dst.diagnosisLinkId = new ArrayList(); + for (PositiveIntType i : diagnosisLinkId) + dst.diagnosisLinkId.add(i.copy()); + }; + dst.service = service == null ? null : service.copy(); + dst.serviceDate = serviceDate == null ? null : serviceDate.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + if (subSite != null) { + dst.subSite = new ArrayList(); + for (Coding i : subSite) + dst.subSite.add(i.copy()); + }; + if (modifier != null) { + dst.modifier = new ArrayList(); + for (Coding i : modifier) + dst.modifier.add(i.copy()); + }; + if (detail != null) { + dst.detail = new ArrayList(); + for (DetailComponent i : detail) + dst.detail.add(i.copy()); + }; + dst.prosthesis = prosthesis == null ? null : prosthesis.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ItemsComponent)) + return false; + ItemsComponent o = (ItemsComponent) other; + return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(provider, o.provider, true) + && compareDeep(diagnosisLinkId, o.diagnosisLinkId, true) && compareDeep(service, o.service, true) + && compareDeep(serviceDate, o.serviceDate, true) && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) + && compareDeep(factor, o.factor, true) && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) + && compareDeep(udi, o.udi, true) && compareDeep(bodySite, o.bodySite, true) && compareDeep(subSite, o.subSite, true) + && compareDeep(modifier, o.modifier, true) && compareDeep(detail, o.detail, true) && compareDeep(prosthesis, o.prosthesis, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ItemsComponent)) + return false; + ItemsComponent o = (ItemsComponent) other; + return compareValues(sequence, o.sequence, true) && compareValues(diagnosisLinkId, o.diagnosisLinkId, true) + && compareValues(serviceDate, o.serviceDate, true) && compareValues(factor, o.factor, true) && compareValues(points, o.points, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (provider == null || provider.isEmpty()) && (diagnosisLinkId == null || diagnosisLinkId.isEmpty()) + && (service == null || service.isEmpty()) && (serviceDate == null || serviceDate.isEmpty()) + && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) + && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) + && (udi == null || udi.isEmpty()) && (bodySite == null || bodySite.isEmpty()) && (subSite == null || subSite.isEmpty()) + && (modifier == null || modifier.isEmpty()) && (detail == null || detail.isEmpty()) && (prosthesis == null || prosthesis.isEmpty()) + ; + } + + } + + @Block() + public static class DetailComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A service line number. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected PositiveIntType sequence; + + /** + * The type of product or service. + */ + @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied. + */ + @Child(name = "service", type = {Coding.class}, order=3, min=1, max=1) + @Description(shortDefinition="Additional item codes", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied." ) + protected Coding service; + + /** + * The number of repetitions of a service or product. + */ + @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group. + */ + @Child(name = "unitPrice", type = {Money.class}, order=5, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group." ) + protected Money unitPrice; + + /** + * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + @Child(name = "factor", type = {DecimalType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) + protected DecimalType factor; + + /** + * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + @Child(name = "points", type = {DecimalType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) + protected DecimalType points; + + /** + * The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + */ + @Child(name = "net", type = {Money.class}, order=8, min=0, max=1) + @Description(shortDefinition="Total additional item cost", formalDefinition="The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) + protected Money net; + + /** + * List of Unique Device Identifiers associated with this line item. + */ + @Child(name = "udi", type = {Coding.class}, order=9, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + /** + * Third tier of goods and services. + */ + @Child(name = "subDetail", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) + protected List subDetail; + + private static final long serialVersionUID = -1641314433L; + + /* + * Constructor + */ + public DetailComponent() { + super(); + } + + /* + * Constructor + */ + public DetailComponent(PositiveIntType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DetailComponent setSequenceElement(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public DetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public DetailComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); // cc + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public DetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public DetailComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); // cc + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) + */ + public DetailComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); // bb + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DetailComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public DetailComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); // bb + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DetailComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public DetailComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); // cc + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public DetailComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); // cc + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public DetailComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + /** + * @return {@link #subDetail} (Third tier of goods and services.) + */ + public List getSubDetail() { + if (this.subDetail == null) + this.subDetail = new ArrayList(); + return this.subDetail; + } + + public boolean hasSubDetail() { + if (this.subDetail == null) + return false; + for (SubDetailComponent item : this.subDetail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subDetail} (Third tier of goods and services.) + */ + // syntactic sugar + public SubDetailComponent addSubDetail() { //3 + SubDetailComponent t = new SubDetailComponent(); + if (this.subDetail == null) + this.subDetail = new ArrayList(); + this.subDetail.add(t); + return t; + } + + // syntactic sugar + public DetailComponent addSubDetail(SubDetailComponent t) { //3 + if (t == null) + return this; + if (this.subDetail == null) + this.subDetail = new ArrayList(); + this.subDetail.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("subDetail", "", "Third tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); + } + + public DetailComponent copy() { + DetailComponent dst = new DetailComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.service = service == null ? null : service.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + if (subDetail != null) { + dst.subDetail = new ArrayList(); + for (SubDetailComponent i : subDetail) + dst.subDetail.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DetailComponent)) + return false; + DetailComponent o = (DetailComponent) other; + return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(service, o.service, true) + && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true) + && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) && compareDeep(udi, o.udi, true) + && compareDeep(subDetail, o.subDetail, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DetailComponent)) + return false; + DetailComponent o = (DetailComponent) other; + return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true) && compareValues(points, o.points, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.isEmpty()) && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) + && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) + && (udi == null || udi.isEmpty()) && (subDetail == null || subDetail.isEmpty()); + } + + } + + @Block() + public static class SubDetailComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A service line number. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected PositiveIntType sequence; + + /** + * The type of product or service. + */ + @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The fee for an addittional service or product or charge. + */ + @Child(name = "service", type = {Coding.class}, order=3, min=1, max=1) + @Description(shortDefinition="Additional item codes", formalDefinition="The fee for an addittional service or product or charge." ) + protected Coding service; + + /** + * The number of repetitions of a service or product. + */ + @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * The fee for an addittional service or product or charge. + */ + @Child(name = "unitPrice", type = {Money.class}, order=5, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The fee for an addittional service or product or charge." ) + protected Money unitPrice; + + /** + * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + @Child(name = "factor", type = {DecimalType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) + protected DecimalType factor; + + /** + * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + @Child(name = "points", type = {DecimalType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) + protected DecimalType points; + + /** + * The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + */ + @Child(name = "net", type = {Money.class}, order=8, min=0, max=1) + @Description(shortDefinition="Net additional item cost", formalDefinition="The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) + protected Money net; + + /** + * List of Unique Device Identifiers associated with this line item. + */ + @Child(name = "udi", type = {Coding.class}, order=9, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + private static final long serialVersionUID = -947666334L; + + /* + * Constructor + */ + public SubDetailComponent() { + super(); + } + + /* + * Constructor + */ + public SubDetailComponent(PositiveIntType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public SubDetailComponent setSequenceElement(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public SubDetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public SubDetailComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #service} (The fee for an addittional service or product or charge.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); // cc + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (The fee for an addittional service or product or charge.) + */ + public SubDetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public SubDetailComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (The fee for an addittional service or product or charge.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); // cc + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (The fee for an addittional service or product or charge.) + */ + public SubDetailComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); // bb + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public SubDetailComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public SubDetailComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); // bb + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public SubDetailComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public SubDetailComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); // cc + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public SubDetailComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); // cc + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public SubDetailComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("service", "Coding", "The fee for an addittional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "The fee for an addittional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + } + + public SubDetailComponent copy() { + SubDetailComponent dst = new SubDetailComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.service = service == null ? null : service.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SubDetailComponent)) + return false; + SubDetailComponent o = (SubDetailComponent) other; + return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(service, o.service, true) + && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true) + && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) && compareDeep(udi, o.udi, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SubDetailComponent)) + return false; + SubDetailComponent o = (SubDetailComponent) other; + return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true) && compareValues(points, o.points, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.isEmpty()) && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) + && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) + && (udi == null || udi.isEmpty()); + } + + } + + @Block() + public static class ProsthesisComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Indicates whether this is the initial placement of a fixed prosthesis. + */ + @Child(name = "initial", type = {BooleanType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Is this the initial service", formalDefinition="Indicates whether this is the initial placement of a fixed prosthesis." ) + protected BooleanType initial; + + /** + * Date of the initial placement. + */ + @Child(name = "priorDate", type = {DateType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Initial service Date", formalDefinition="Date of the initial placement." ) + protected DateType priorDate; + + /** + * Material of the prior denture or bridge prosthesis. (Oral). + */ + @Child(name = "priorMaterial", type = {Coding.class}, order=3, min=0, max=1) + @Description(shortDefinition="Prosthetic Material", formalDefinition="Material of the prior denture or bridge prosthesis. (Oral)." ) + protected Coding priorMaterial; + + private static final long serialVersionUID = 1739349641L; + + /* + * Constructor + */ + public ProsthesisComponent() { + super(); + } + + /** + * @return {@link #initial} (Indicates whether this is the initial placement of a fixed prosthesis.). This is the underlying object with id, value and extensions. The accessor "getInitial" gives direct access to the value + */ + public BooleanType getInitialElement() { + if (this.initial == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProsthesisComponent.initial"); + else if (Configuration.doAutoCreate()) + this.initial = new BooleanType(); // bb + return this.initial; + } + + public boolean hasInitialElement() { + return this.initial != null && !this.initial.isEmpty(); + } + + public boolean hasInitial() { + return this.initial != null && !this.initial.isEmpty(); + } + + /** + * @param value {@link #initial} (Indicates whether this is the initial placement of a fixed prosthesis.). This is the underlying object with id, value and extensions. The accessor "getInitial" gives direct access to the value + */ + public ProsthesisComponent setInitialElement(BooleanType value) { + this.initial = value; + return this; + } + + /** + * @return Indicates whether this is the initial placement of a fixed prosthesis. + */ + public boolean getInitial() { + return this.initial == null || this.initial.isEmpty() ? false : this.initial.getValue(); + } + + /** + * @param value Indicates whether this is the initial placement of a fixed prosthesis. + */ + public ProsthesisComponent setInitial(boolean value) { + if (this.initial == null) + this.initial = new BooleanType(); + this.initial.setValue(value); + return this; + } + + /** + * @return {@link #priorDate} (Date of the initial placement.). This is the underlying object with id, value and extensions. The accessor "getPriorDate" gives direct access to the value + */ + public DateType getPriorDateElement() { + if (this.priorDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProsthesisComponent.priorDate"); + else if (Configuration.doAutoCreate()) + this.priorDate = new DateType(); // bb + return this.priorDate; + } + + public boolean hasPriorDateElement() { + return this.priorDate != null && !this.priorDate.isEmpty(); + } + + public boolean hasPriorDate() { + return this.priorDate != null && !this.priorDate.isEmpty(); + } + + /** + * @param value {@link #priorDate} (Date of the initial placement.). This is the underlying object with id, value and extensions. The accessor "getPriorDate" gives direct access to the value + */ + public ProsthesisComponent setPriorDateElement(DateType value) { + this.priorDate = value; + return this; + } + + /** + * @return Date of the initial placement. + */ + public Date getPriorDate() { + return this.priorDate == null ? null : this.priorDate.getValue(); + } + + /** + * @param value Date of the initial placement. + */ + public ProsthesisComponent setPriorDate(Date value) { + if (value == null) + this.priorDate = null; + else { + if (this.priorDate == null) + this.priorDate = new DateType(); + this.priorDate.setValue(value); + } + return this; + } + + /** + * @return {@link #priorMaterial} (Material of the prior denture or bridge prosthesis. (Oral).) + */ + public Coding getPriorMaterial() { + if (this.priorMaterial == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProsthesisComponent.priorMaterial"); + else if (Configuration.doAutoCreate()) + this.priorMaterial = new Coding(); // cc + return this.priorMaterial; + } + + public boolean hasPriorMaterial() { + return this.priorMaterial != null && !this.priorMaterial.isEmpty(); + } + + /** + * @param value {@link #priorMaterial} (Material of the prior denture or bridge prosthesis. (Oral).) + */ + public ProsthesisComponent setPriorMaterial(Coding value) { + this.priorMaterial = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("initial", "boolean", "Indicates whether this is the initial placement of a fixed prosthesis.", 0, java.lang.Integer.MAX_VALUE, initial)); + childrenList.add(new Property("priorDate", "date", "Date of the initial placement.", 0, java.lang.Integer.MAX_VALUE, priorDate)); + childrenList.add(new Property("priorMaterial", "Coding", "Material of the prior denture or bridge prosthesis. (Oral).", 0, java.lang.Integer.MAX_VALUE, priorMaterial)); + } + + public ProsthesisComponent copy() { + ProsthesisComponent dst = new ProsthesisComponent(); + copyValues(dst); + dst.initial = initial == null ? null : initial.copy(); + dst.priorDate = priorDate == null ? null : priorDate.copy(); + dst.priorMaterial = priorMaterial == null ? null : priorMaterial.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProsthesisComponent)) + return false; + ProsthesisComponent o = (ProsthesisComponent) other; + return compareDeep(initial, o.initial, true) && compareDeep(priorDate, o.priorDate, true) && compareDeep(priorMaterial, o.priorMaterial, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProsthesisComponent)) + return false; + ProsthesisComponent o = (ProsthesisComponent) other; + return compareValues(initial, o.initial, true) && compareValues(priorDate, o.priorDate, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (initial == null || initial.isEmpty()) && (priorDate == null || priorDate.isEmpty()) + && (priorMaterial == null || priorMaterial.isEmpty()); + } + + } + + @Block() + public static class MissingTeethComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The code identifying which tooth is missing. + */ + @Child(name = "tooth", type = {Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Tooth Code", formalDefinition="The code identifying which tooth is missing." ) + protected Coding tooth; + + /** + * Missing reason may be: E-extraction, O-other. + */ + @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1) + @Description(shortDefinition="Reason for missing", formalDefinition="Missing reason may be: E-extraction, O-other." ) + protected Coding reason; + + /** + * The date of the extraction either known from records or patient reported estimate. + */ + @Child(name = "extractionDate", type = {DateType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Date of Extraction", formalDefinition="The date of the extraction either known from records or patient reported estimate." ) + protected DateType extractionDate; + + private static final long serialVersionUID = 352913313L; + + /* + * Constructor + */ + public MissingTeethComponent() { + super(); + } + + /* + * Constructor + */ + public MissingTeethComponent(Coding tooth) { + super(); + this.tooth = tooth; + } + + /** + * @return {@link #tooth} (The code identifying which tooth is missing.) + */ + public Coding getTooth() { + if (this.tooth == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MissingTeethComponent.tooth"); + else if (Configuration.doAutoCreate()) + this.tooth = new Coding(); // cc + return this.tooth; + } + + public boolean hasTooth() { + return this.tooth != null && !this.tooth.isEmpty(); + } + + /** + * @param value {@link #tooth} (The code identifying which tooth is missing.) + */ + public MissingTeethComponent setTooth(Coding value) { + this.tooth = value; + return this; + } + + /** + * @return {@link #reason} (Missing reason may be: E-extraction, O-other.) + */ + public Coding getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MissingTeethComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new Coding(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Missing reason may be: E-extraction, O-other.) + */ + public MissingTeethComponent setReason(Coding value) { + this.reason = value; + return this; + } + + /** + * @return {@link #extractionDate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractionDate" gives direct access to the value + */ + public DateType getExtractionDateElement() { + if (this.extractionDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MissingTeethComponent.extractionDate"); + else if (Configuration.doAutoCreate()) + this.extractionDate = new DateType(); // bb + return this.extractionDate; + } + + public boolean hasExtractionDateElement() { + return this.extractionDate != null && !this.extractionDate.isEmpty(); + } + + public boolean hasExtractionDate() { + return this.extractionDate != null && !this.extractionDate.isEmpty(); + } + + /** + * @param value {@link #extractionDate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractionDate" gives direct access to the value + */ + public MissingTeethComponent setExtractionDateElement(DateType value) { + this.extractionDate = value; + return this; + } + + /** + * @return The date of the extraction either known from records or patient reported estimate. + */ + public Date getExtractionDate() { + return this.extractionDate == null ? null : this.extractionDate.getValue(); + } + + /** + * @param value The date of the extraction either known from records or patient reported estimate. + */ + public MissingTeethComponent setExtractionDate(Date value) { + if (value == null) + this.extractionDate = null; + else { + if (this.extractionDate == null) + this.extractionDate = new DateType(); + this.extractionDate.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("tooth", "Coding", "The code identifying which tooth is missing.", 0, java.lang.Integer.MAX_VALUE, tooth)); + childrenList.add(new Property("reason", "Coding", "Missing reason may be: E-extraction, O-other.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("extractionDate", "date", "The date of the extraction either known from records or patient reported estimate.", 0, java.lang.Integer.MAX_VALUE, extractionDate)); + } + + public MissingTeethComponent copy() { + MissingTeethComponent dst = new MissingTeethComponent(); + copyValues(dst); + dst.tooth = tooth == null ? null : tooth.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.extractionDate = extractionDate == null ? null : extractionDate.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MissingTeethComponent)) + return false; + MissingTeethComponent o = (MissingTeethComponent) other; + return compareDeep(tooth, o.tooth, true) && compareDeep(reason, o.reason, true) && compareDeep(extractionDate, o.extractionDate, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MissingTeethComponent)) + return false; + MissingTeethComponent o = (MissingTeethComponent) other; + return compareValues(extractionDate, o.extractionDate, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (tooth == null || tooth.isEmpty()) && (reason == null || reason.isEmpty()) + && (extractionDate == null || extractionDate.isEmpty()); + } + + } + + /** + * The category of claim this is. + */ + @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1) + @Description(shortDefinition="institutional | oral | pharmacy | professional | vision", formalDefinition="The category of claim this is." ) + protected Enumeration type; + + /** + * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Claim number", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) + protected List identifier; + + /** + * The version of the specification on which this instance relies. + */ + @Child(name = "ruleset", type = {Coding.class}, order=2, min=0, max=1) + @Description(shortDefinition="Current specification followed", formalDefinition="The version of the specification on which this instance relies." ) + protected Coding ruleset; + + /** + * The version of the specification from which the original instance was created. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=3, min=0, max=1) + @Description(shortDefinition="Original specification followed", formalDefinition="The version of the specification from which the original instance was created." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name = "created", type = {DateTimeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateTimeType created; + + /** + * Insurer Identifier, typical BIN number (6 digit). + */ + @Child(name = "target", type = {Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="Insurer Identifier, typical BIN number (6 digit)." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (Insurer Identifier, typical BIN number (6 digit).) + */ + protected Organization targetTarget; + + /** + * The provider which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name = "provider", type = {Practitioner.class}, order=6, min=0, max=1) + @Description(shortDefinition="Responsible provider", formalDefinition="The provider which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name = "organization", type = {Organization.class}, order=7, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + protected Organization organizationTarget; + + /** + * Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + @Child(name = "use", type = {CodeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="complete | proposed | exploratory | other", formalDefinition="Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination)." ) + protected Enumeration use; + + /** + * Immediate (STAT), best effort (NORMAL), deferred (DEFER). + */ + @Child(name = "priority", type = {Coding.class}, order=9, min=0, max=1) + @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) + protected Coding priority; + + /** + * In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested. + */ + @Child(name = "fundsReserve", type = {Coding.class}, order=10, min=0, max=1) + @Description(shortDefinition="Funds requested to be reserved", formalDefinition="In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested." ) + protected Coding fundsReserve; + + /** + * Person who created the invoice/claim/pre-determination or pre-authorization. + */ + @Child(name = "enterer", type = {Practitioner.class}, order=11, min=0, max=1) + @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." ) + protected Reference enterer; + + /** + * The actual object that is the target of the reference (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + protected Practitioner entererTarget; + + /** + * Facility where the services were provided. + */ + @Child(name = "facility", type = {Location.class}, order=12, min=0, max=1) + @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) + protected Reference facility; + + /** + * The actual object that is the target of the reference (Facility where the services were provided.) + */ + protected Location facilityTarget; + + /** + * Prescription to support the dispensing of Pharmacy or Vision products. + */ + @Child(name = "prescription", type = {MedicationPrescription.class, VisionPrescription.class}, order=13, min=0, max=1) + @Description(shortDefinition="Prescription", formalDefinition="Prescription to support the dispensing of Pharmacy or Vision products." ) + protected Reference prescription; + + /** + * The actual object that is the target of the reference (Prescription to support the dispensing of Pharmacy or Vision products.) + */ + protected Resource prescriptionTarget; + + /** + * Original prescription to support the dispensing of pharmacy services, medications or products. + */ + @Child(name = "originalPrescription", type = {MedicationPrescription.class}, order=14, min=0, max=1) + @Description(shortDefinition="Original Prescription", formalDefinition="Original prescription to support the dispensing of pharmacy services, medications or products." ) + protected Reference originalPrescription; + + /** + * The actual object that is the target of the reference (Original prescription to support the dispensing of pharmacy services, medications or products.) + */ + protected MedicationPrescription originalPrescriptionTarget; + + /** + * The party to be reimbursed for the services. + */ + @Child(name = "payee", type = {}, order=15, min=0, max=1) + @Description(shortDefinition="Payee", formalDefinition="The party to be reimbursed for the services." ) + protected PayeeComponent payee; + + /** + * The referral resource which lists the date, practitioner, reason and other supporting information. + */ + @Child(name = "referral", type = {ReferralRequest.class}, order=16, min=0, max=1) + @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) + protected Reference referral; + + /** + * The actual object that is the target of the reference (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + protected ReferralRequest referralTarget; + + /** + * Ordered list of patient diagnosis for which care is sought. + */ + @Child(name = "diagnosis", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." ) + protected List diagnosis; + + /** + * List of patient conditions for which care is sought. + */ + @Child(name = "condition", type = {Coding.class}, order=18, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of presenting Conditions", formalDefinition="List of patient conditions for which care is sought." ) + protected List condition; + + /** + * Patient Resource. + */ + @Child(name = "patient", type = {Patient.class}, order=19, min=1, max=1) + @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Patient Resource.) + */ + protected Patient patientTarget; + + /** + * Financial instrument by which payment information for health care. + */ + @Child(name = "coverage", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) + protected List coverage; + + /** + * Factors which may influence the applicability of coverage. + */ + @Child(name = "exception", type = {Coding.class}, order=21, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Eligibility exceptions", formalDefinition="Factors which may influence the applicability of coverage." ) + protected List exception; + + /** + * Name of school for over-aged dependants. + */ + @Child(name = "school", type = {StringType.class}, order=22, min=0, max=1) + @Description(shortDefinition="Name of School", formalDefinition="Name of school for over-aged dependants." ) + protected StringType school; + + /** + * Date of an accident which these services are addressing. + */ + @Child(name = "accident", type = {DateType.class}, order=23, min=0, max=1) + @Description(shortDefinition="Accident Date", formalDefinition="Date of an accident which these services are addressing." ) + protected DateType accident; + + /** + * Type of accident: work, auto, etc. + */ + @Child(name = "accidentType", type = {Coding.class}, order=24, min=0, max=1) + @Description(shortDefinition="Accident Type", formalDefinition="Type of accident: work, auto, etc." ) + protected Coding accidentType; + + /** + * A list of intervention and exception codes which may influence the adjudication of the claim. + */ + @Child(name = "interventionException", type = {Coding.class}, order=25, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Intervention and exception code (Pharma)", formalDefinition="A list of intervention and exception codes which may influence the adjudication of the claim." ) + protected List interventionException; + + /** + * First tier of goods and services. + */ + @Child(name = "item", type = {}, order=26, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Goods and Services", formalDefinition="First tier of goods and services." ) + protected List item; + + /** + * Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission. + */ + @Child(name = "additionalMaterials", type = {Coding.class}, order=27, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional materials, documents, etc.", formalDefinition="Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission." ) + protected List additionalMaterials; + + /** + * A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons. + */ + @Child(name = "missingTeeth", type = {}, order=28, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Only if type = oral", formalDefinition="A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons." ) + protected List missingTeeth; + + private static final long serialVersionUID = 764017933L; + + /* + * Constructor + */ + public Claim() { + super(); + } + + /* + * Constructor + */ + public Claim(Enumeration type, Reference patient) { + super(); + this.type = type; + this.patient = patient; + } + + /** + * @return {@link #type} (The category of claim this is.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new TypeLinkEnumFactory()); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The category of claim this is.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Claim setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The category of claim this is. + */ + public TypeLink getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The category of claim this is. + */ + public Claim setType(TypeLink value) { + if (this.type == null) + this.type = new Enumeration(new TypeLinkEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Claim addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #ruleset} (The version of the specification on which this instance relies.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @param value {@link #ruleset} (The version of the specification on which this instance relies.) + */ + public Claim setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The version of the specification from which the original instance was created.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The version of the specification from which the original instance was created.) + */ + public Claim setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public Claim setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when the enclosed suite of services were performed or completed. + */ + public Claim setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); // cc + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public Claim 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. (Insurer Identifier, typical BIN number (6 digit).) + */ + public Organization getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); // aa + return this.targetTarget; + } + + /** + * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Insurer Identifier, typical BIN number (6 digit).) + */ + public Claim setTargetTarget(Organization value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); // cc + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Claim 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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); // aa + return this.providerTarget; + } + + /** + * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Claim setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); // cc + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Claim 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 bill, claim pre-determination, pre-authorization.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); // aa + return this.organizationTarget; + } + + /** + * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Claim setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Enumeration getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(new UseLinkEnumFactory()); // bb + return this.use; + } + + public boolean hasUseElement() { + return this.use != null && !this.use.isEmpty(); + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Claim setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public UseLink getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public Claim setUse(UseLink value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(new UseLinkEnumFactory()); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + */ + public Coding getPriority() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Coding(); // cc + return this.priority; + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + */ + public Claim setPriority(Coding value) { + this.priority = value; + return this; + } + + /** + * @return {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) + */ + public Coding getFundsReserve() { + if (this.fundsReserve == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.fundsReserve"); + else if (Configuration.doAutoCreate()) + this.fundsReserve = new Coding(); // cc + return this.fundsReserve; + } + + public boolean hasFundsReserve() { + return this.fundsReserve != null && !this.fundsReserve.isEmpty(); + } + + /** + * @param value {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) + */ + public Claim setFundsReserve(Coding value) { + this.fundsReserve = value; + return this; + } + + /** + * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Reference getEnterer() { + if (this.enterer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.enterer"); + else if (Configuration.doAutoCreate()) + this.enterer = new Reference(); // cc + return this.enterer; + } + + public boolean hasEnterer() { + return this.enterer != null && !this.enterer.isEmpty(); + } + + /** + * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Claim setEnterer(Reference value) { + this.enterer = value; + return this; + } + + /** + * @return {@link #enterer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Practitioner getEntererTarget() { + if (this.entererTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.enterer"); + else if (Configuration.doAutoCreate()) + this.entererTarget = new Practitioner(); // aa + return this.entererTarget; + } + + /** + * @param value {@link #enterer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Claim setEntererTarget(Practitioner value) { + this.entererTarget = value; + return this; + } + + /** + * @return {@link #facility} (Facility where the services were provided.) + */ + public Reference getFacility() { + if (this.facility == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.facility"); + else if (Configuration.doAutoCreate()) + this.facility = new Reference(); // cc + return this.facility; + } + + public boolean hasFacility() { + return this.facility != null && !this.facility.isEmpty(); + } + + /** + * @param value {@link #facility} (Facility where the services were provided.) + */ + public Claim setFacility(Reference value) { + this.facility = value; + return this; + } + + /** + * @return {@link #facility} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Facility where the services were provided.) + */ + public Location getFacilityTarget() { + if (this.facilityTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.facility"); + else if (Configuration.doAutoCreate()) + this.facilityTarget = new Location(); // aa + return this.facilityTarget; + } + + /** + * @param value {@link #facility} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Facility where the services were provided.) + */ + public Claim setFacilityTarget(Location value) { + this.facilityTarget = value; + return this; + } + + /** + * @return {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.) + */ + public Reference getPrescription() { + if (this.prescription == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.prescription"); + else if (Configuration.doAutoCreate()) + this.prescription = new Reference(); // cc + return this.prescription; + } + + public boolean hasPrescription() { + return this.prescription != null && !this.prescription.isEmpty(); + } + + /** + * @param value {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.) + */ + public Claim setPrescription(Reference value) { + this.prescription = value; + return this; + } + + /** + * @return {@link #prescription} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Prescription to support the dispensing of Pharmacy or Vision products.) + */ + public Resource getPrescriptionTarget() { + return this.prescriptionTarget; + } + + /** + * @param value {@link #prescription} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Prescription to support the dispensing of Pharmacy or Vision products.) + */ + public Claim setPrescriptionTarget(Resource value) { + this.prescriptionTarget = value; + return this; + } + + /** + * @return {@link #originalPrescription} (Original prescription to support the dispensing of pharmacy services, medications or products.) + */ + public Reference getOriginalPrescription() { + if (this.originalPrescription == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.originalPrescription"); + else if (Configuration.doAutoCreate()) + this.originalPrescription = new Reference(); // cc + return this.originalPrescription; + } + + public boolean hasOriginalPrescription() { + return this.originalPrescription != null && !this.originalPrescription.isEmpty(); + } + + /** + * @param value {@link #originalPrescription} (Original prescription to support the dispensing of pharmacy services, medications or products.) + */ + public Claim setOriginalPrescription(Reference value) { + this.originalPrescription = value; + return this; + } + + /** + * @return {@link #originalPrescription} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original prescription to support the dispensing of pharmacy services, medications or products.) + */ + public MedicationPrescription getOriginalPrescriptionTarget() { + if (this.originalPrescriptionTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.originalPrescription"); + else if (Configuration.doAutoCreate()) + this.originalPrescriptionTarget = new MedicationPrescription(); // aa + return this.originalPrescriptionTarget; + } + + /** + * @param value {@link #originalPrescription} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original prescription to support the dispensing of pharmacy services, medications or products.) + */ + public Claim setOriginalPrescriptionTarget(MedicationPrescription value) { + this.originalPrescriptionTarget = value; + return this; + } + + /** + * @return {@link #payee} (The party to be reimbursed for the services.) + */ + public PayeeComponent getPayee() { + if (this.payee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.payee"); + else if (Configuration.doAutoCreate()) + this.payee = new PayeeComponent(); // cc + return this.payee; + } + + public boolean hasPayee() { + return this.payee != null && !this.payee.isEmpty(); + } + + /** + * @param value {@link #payee} (The party to be reimbursed for the services.) + */ + public Claim setPayee(PayeeComponent value) { + this.payee = value; + return this; + } + + /** + * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public Reference getReferral() { + if (this.referral == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.referral"); + else if (Configuration.doAutoCreate()) + this.referral = new Reference(); // cc + return this.referral; + } + + public boolean hasReferral() { + return this.referral != null && !this.referral.isEmpty(); + } + + /** + * @param value {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public Claim setReferral(Reference value) { + this.referral = value; + return this; + } + + /** + * @return {@link #referral} The actual object that is the 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 referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public ReferralRequest getReferralTarget() { + if (this.referralTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.referral"); + else if (Configuration.doAutoCreate()) + this.referralTarget = new ReferralRequest(); // aa + return this.referralTarget; + } + + /** + * @param value {@link #referral} The actual object that is the 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 referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public Claim setReferralTarget(ReferralRequest value) { + this.referralTarget = value; + return this; + } + + /** + * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) + */ + public List getDiagnosis() { + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + return this.diagnosis; + } + + public boolean hasDiagnosis() { + if (this.diagnosis == null) + return false; + for (DiagnosisComponent item : this.diagnosis) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) + */ + // syntactic sugar + public DiagnosisComponent addDiagnosis() { //3 + DiagnosisComponent t = new DiagnosisComponent(); + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + this.diagnosis.add(t); + return t; + } + + // syntactic sugar + public Claim addDiagnosis(DiagnosisComponent t) { //3 + if (t == null) + return this; + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + this.diagnosis.add(t); + return this; + } + + /** + * @return {@link #condition} (List of patient conditions for which care is sought.) + */ + public List getCondition() { + if (this.condition == null) + this.condition = new ArrayList(); + return this.condition; + } + + public boolean hasCondition() { + if (this.condition == null) + return false; + for (Coding item : this.condition) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #condition} (List of patient conditions for which care is sought.) + */ + // syntactic sugar + public Coding addCondition() { //3 + Coding t = new Coding(); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return t; + } + + // syntactic sugar + public Claim addCondition(Coding t) { //3 + if (t == null) + return this; + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return this; + } + + /** + * @return {@link #patient} (Patient Resource.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Patient Resource.) + */ + public Claim setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Patient Resource.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Patient Resource.) + */ + public Claim setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + public List getCoverage() { + if (this.coverage == null) + this.coverage = new ArrayList(); + return this.coverage; + } + + public boolean hasCoverage() { + if (this.coverage == null) + return false; + for (CoverageComponent item : this.coverage) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + // syntactic sugar + public CoverageComponent addCoverage() { //3 + CoverageComponent t = new CoverageComponent(); + if (this.coverage == null) + this.coverage = new ArrayList(); + this.coverage.add(t); + return t; + } + + // syntactic sugar + public Claim addCoverage(CoverageComponent t) { //3 + if (t == null) + return this; + if (this.coverage == null) + this.coverage = new ArrayList(); + this.coverage.add(t); + return this; + } + + /** + * @return {@link #exception} (Factors which may influence the applicability of coverage.) + */ + public List getException() { + if (this.exception == null) + this.exception = new ArrayList(); + return this.exception; + } + + public boolean hasException() { + if (this.exception == null) + return false; + for (Coding item : this.exception) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #exception} (Factors which may influence the applicability of coverage.) + */ + // syntactic sugar + public Coding addException() { //3 + Coding t = new Coding(); + if (this.exception == null) + this.exception = new ArrayList(); + this.exception.add(t); + return t; + } + + // syntactic sugar + public Claim addException(Coding t) { //3 + if (t == null) + return this; + if (this.exception == null) + this.exception = new ArrayList(); + this.exception.add(t); + return this; + } + + /** + * @return {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value + */ + public StringType getSchoolElement() { + if (this.school == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.school"); + else if (Configuration.doAutoCreate()) + this.school = new StringType(); // bb + return this.school; + } + + public boolean hasSchoolElement() { + return this.school != null && !this.school.isEmpty(); + } + + public boolean hasSchool() { + return this.school != null && !this.school.isEmpty(); + } + + /** + * @param value {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value + */ + public Claim setSchoolElement(StringType value) { + this.school = value; + return this; + } + + /** + * @return Name of school for over-aged dependants. + */ + public String getSchool() { + return this.school == null ? null : this.school.getValue(); + } + + /** + * @param value Name of school for over-aged dependants. + */ + public Claim setSchool(String value) { + if (Utilities.noString(value)) + this.school = null; + else { + if (this.school == null) + this.school = new StringType(); + this.school.setValue(value); + } + return this; + } + + /** + * @return {@link #accident} (Date of an accident which these services are addressing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value + */ + public DateType getAccidentElement() { + if (this.accident == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.accident"); + else if (Configuration.doAutoCreate()) + this.accident = new DateType(); // bb + return this.accident; + } + + public boolean hasAccidentElement() { + return this.accident != null && !this.accident.isEmpty(); + } + + public boolean hasAccident() { + return this.accident != null && !this.accident.isEmpty(); + } + + /** + * @param value {@link #accident} (Date of an accident which these services are addressing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value + */ + public Claim setAccidentElement(DateType value) { + this.accident = value; + return this; + } + + /** + * @return Date of an accident which these services are addressing. + */ + public Date getAccident() { + return this.accident == null ? null : this.accident.getValue(); + } + + /** + * @param value Date of an accident which these services are addressing. + */ + public Claim setAccident(Date value) { + if (value == null) + this.accident = null; + else { + if (this.accident == null) + this.accident = new DateType(); + this.accident.setValue(value); + } + return this; + } + + /** + * @return {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public Coding getAccidentType() { + if (this.accidentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.accidentType"); + else if (Configuration.doAutoCreate()) + this.accidentType = new Coding(); // cc + return this.accidentType; + } + + public boolean hasAccidentType() { + return this.accidentType != null && !this.accidentType.isEmpty(); + } + + /** + * @param value {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public Claim setAccidentType(Coding value) { + this.accidentType = value; + return this; + } + + /** + * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) + */ + public List getInterventionException() { + if (this.interventionException == null) + this.interventionException = new ArrayList(); + return this.interventionException; + } + + public boolean hasInterventionException() { + if (this.interventionException == null) + return false; + for (Coding item : this.interventionException) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) + */ + // syntactic sugar + public Coding addInterventionException() { //3 + Coding t = new Coding(); + if (this.interventionException == null) + this.interventionException = new ArrayList(); + this.interventionException.add(t); + return t; + } + + // syntactic sugar + public Claim addInterventionException(Coding t) { //3 + if (t == null) + return this; + if (this.interventionException == null) + this.interventionException = new ArrayList(); + this.interventionException.add(t); + return this; + } + + /** + * @return {@link #item} (First tier of goods and services.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (ItemsComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (First tier of goods and services.) + */ + // syntactic sugar + public ItemsComponent addItem() { //3 + ItemsComponent t = new ItemsComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + // syntactic sugar + public Claim addItem(ItemsComponent t) { //3 + if (t == null) + return this; + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return this; + } + + /** + * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + public List getAdditionalMaterials() { + if (this.additionalMaterials == null) + this.additionalMaterials = new ArrayList(); + return this.additionalMaterials; + } + + public boolean hasAdditionalMaterials() { + if (this.additionalMaterials == null) + return false; + for (Coding item : this.additionalMaterials) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + // syntactic sugar + public Coding addAdditionalMaterials() { //3 + Coding t = new Coding(); + if (this.additionalMaterials == null) + this.additionalMaterials = new ArrayList(); + this.additionalMaterials.add(t); + return t; + } + + // syntactic sugar + public Claim addAdditionalMaterials(Coding t) { //3 + if (t == null) + return this; + if (this.additionalMaterials == null) + this.additionalMaterials = new ArrayList(); + this.additionalMaterials.add(t); + return this; + } + + /** + * @return {@link #missingTeeth} (A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.) + */ + public List getMissingTeeth() { + if (this.missingTeeth == null) + this.missingTeeth = new ArrayList(); + return this.missingTeeth; + } + + public boolean hasMissingTeeth() { + if (this.missingTeeth == null) + return false; + for (MissingTeethComponent item : this.missingTeeth) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #missingTeeth} (A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.) + */ + // syntactic sugar + public MissingTeethComponent addMissingTeeth() { //3 + MissingTeethComponent t = new MissingTeethComponent(); + if (this.missingTeeth == null) + this.missingTeeth = new ArrayList(); + this.missingTeeth.add(t); + return t; + } + + // syntactic sugar + public Claim addMissingTeeth(MissingTeethComponent t) { //3 + if (t == null) + return this; + if (this.missingTeeth == null) + this.missingTeeth = new ArrayList(); + this.missingTeeth.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "The category of claim this is.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("identifier", "Identifier", "The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("ruleset", "Coding", "The version of the specification on which this instance relies.", 0, java.lang.Integer.MAX_VALUE, ruleset)); + childrenList.add(new Property("originalRuleset", "Coding", "The version of the specification from which the original instance was created.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); + childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("target", "Reference(Organization)", "Insurer Identifier, typical BIN number (6 digit).", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider which is responsible for the bill, claim pre-determination, pre-authorization.", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the bill, claim pre-determination, pre-authorization.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("use", "code", "Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("priority", "Coding", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("fundsReserve", "Coding", "In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.", 0, java.lang.Integer.MAX_VALUE, fundsReserve)); + childrenList.add(new Property("enterer", "Reference(Practitioner)", "Person who created the invoice/claim/pre-determination or pre-authorization.", 0, java.lang.Integer.MAX_VALUE, enterer)); + childrenList.add(new Property("facility", "Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); + childrenList.add(new Property("prescription", "Reference(MedicationPrescription|VisionPrescription)", "Prescription to support the dispensing of Pharmacy or Vision products.", 0, java.lang.Integer.MAX_VALUE, prescription)); + childrenList.add(new Property("originalPrescription", "Reference(MedicationPrescription)", "Original prescription to support the dispensing of pharmacy services, medications or products.", 0, java.lang.Integer.MAX_VALUE, originalPrescription)); + childrenList.add(new Property("payee", "", "The party to be reimbursed for the services.", 0, java.lang.Integer.MAX_VALUE, payee)); + childrenList.add(new Property("referral", "Reference(ReferralRequest)", "The referral resource which lists the date, practitioner, reason and other supporting information.", 0, java.lang.Integer.MAX_VALUE, referral)); + childrenList.add(new Property("diagnosis", "", "Ordered list of patient diagnosis for which care is sought.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + childrenList.add(new Property("condition", "Coding", "List of patient conditions for which care is sought.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("exception", "Coding", "Factors which may influence the applicability of coverage.", 0, java.lang.Integer.MAX_VALUE, exception)); + childrenList.add(new Property("school", "string", "Name of school for over-aged dependants.", 0, java.lang.Integer.MAX_VALUE, school)); + childrenList.add(new Property("accident", "date", "Date of an accident which these services are addressing.", 0, java.lang.Integer.MAX_VALUE, accident)); + childrenList.add(new Property("accidentType", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, accidentType)); + childrenList.add(new Property("interventionException", "Coding", "A list of intervention and exception codes which may influence the adjudication of the claim.", 0, java.lang.Integer.MAX_VALUE, interventionException)); + childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("additionalMaterials", "Coding", "Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.", 0, java.lang.Integer.MAX_VALUE, additionalMaterials)); + childrenList.add(new Property("missingTeeth", "", "A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.", 0, java.lang.Integer.MAX_VALUE, missingTeeth)); + } + + public Claim copy() { + Claim dst = new Claim(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + dst.created = created == null ? null : created.copy(); + dst.target = target == null ? null : target.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.use = use == null ? null : use.copy(); + dst.priority = priority == null ? null : priority.copy(); + dst.fundsReserve = fundsReserve == null ? null : fundsReserve.copy(); + dst.enterer = enterer == null ? null : enterer.copy(); + dst.facility = facility == null ? null : facility.copy(); + dst.prescription = prescription == null ? null : prescription.copy(); + dst.originalPrescription = originalPrescription == null ? null : originalPrescription.copy(); + dst.payee = payee == null ? null : payee.copy(); + dst.referral = referral == null ? null : referral.copy(); + if (diagnosis != null) { + dst.diagnosis = new ArrayList(); + for (DiagnosisComponent i : diagnosis) + dst.diagnosis.add(i.copy()); + }; + if (condition != null) { + dst.condition = new ArrayList(); + for (Coding i : condition) + dst.condition.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + if (coverage != null) { + dst.coverage = new ArrayList(); + for (CoverageComponent i : coverage) + dst.coverage.add(i.copy()); + }; + if (exception != null) { + dst.exception = new ArrayList(); + for (Coding i : exception) + dst.exception.add(i.copy()); + }; + dst.school = school == null ? null : school.copy(); + dst.accident = accident == null ? null : accident.copy(); + dst.accidentType = accidentType == null ? null : accidentType.copy(); + if (interventionException != null) { + dst.interventionException = new ArrayList(); + for (Coding i : interventionException) + dst.interventionException.add(i.copy()); + }; + if (item != null) { + dst.item = new ArrayList(); + for (ItemsComponent i : item) + dst.item.add(i.copy()); + }; + if (additionalMaterials != null) { + dst.additionalMaterials = new ArrayList(); + for (Coding i : additionalMaterials) + dst.additionalMaterials.add(i.copy()); + }; + if (missingTeeth != null) { + dst.missingTeeth = new ArrayList(); + for (MissingTeethComponent i : missingTeeth) + dst.missingTeeth.add(i.copy()); + }; + return dst; + } + + protected Claim typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Claim)) + return false; + Claim o = (Claim) other; + return compareDeep(type, o.type, true) && compareDeep(identifier, o.identifier, true) && compareDeep(ruleset, o.ruleset, true) + && compareDeep(originalRuleset, o.originalRuleset, true) && compareDeep(created, o.created, true) + && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) && compareDeep(organization, o.organization, true) + && compareDeep(use, o.use, true) && compareDeep(priority, o.priority, true) && compareDeep(fundsReserve, o.fundsReserve, true) + && compareDeep(enterer, o.enterer, true) && compareDeep(facility, o.facility, true) && compareDeep(prescription, o.prescription, true) + && compareDeep(originalPrescription, o.originalPrescription, true) && compareDeep(payee, o.payee, true) + && compareDeep(referral, o.referral, true) && compareDeep(diagnosis, o.diagnosis, true) && compareDeep(condition, o.condition, true) + && compareDeep(patient, o.patient, true) && compareDeep(coverage, o.coverage, true) && compareDeep(exception, o.exception, true) + && compareDeep(school, o.school, true) && compareDeep(accident, o.accident, true) && compareDeep(accidentType, o.accidentType, true) + && compareDeep(interventionException, o.interventionException, true) && compareDeep(item, o.item, true) + && compareDeep(additionalMaterials, o.additionalMaterials, true) && compareDeep(missingTeeth, o.missingTeeth, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Claim)) + return false; + Claim o = (Claim) other; + return compareValues(type, o.type, true) && compareValues(created, o.created, true) && compareValues(use, o.use, true) + && compareValues(school, o.school, true) && compareValues(accident, o.accident, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.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()) && (use == null || use.isEmpty()) && (priority == null || priority.isEmpty()) + && (fundsReserve == null || fundsReserve.isEmpty()) && (enterer == null || enterer.isEmpty()) + && (facility == null || facility.isEmpty()) && (prescription == null || prescription.isEmpty()) + && (originalPrescription == null || originalPrescription.isEmpty()) && (payee == null || payee.isEmpty()) + && (referral == null || referral.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + && (condition == null || condition.isEmpty()) && (patient == null || patient.isEmpty()) && (coverage == null || coverage.isEmpty()) + && (exception == null || exception.isEmpty()) && (school == null || school.isEmpty()) && (accident == null || accident.isEmpty()) + && (accidentType == null || accidentType.isEmpty()) && (interventionException == null || interventionException.isEmpty()) + && (item == null || item.isEmpty()) && (additionalMaterials == null || additionalMaterials.isEmpty()) + && (missingTeeth == null || missingTeeth.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Claim; + } + + @SearchParamDefinition(name="identifier", path="Claim.identifier", description="The primary identifier of the financial resource", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="provider", path="Claim.provider", description="Provider responsible for the claim", type="reference" ) + public static final String SP_PROVIDER = "provider"; + @SearchParamDefinition(name="use", path="Claim.use", description="The kind of financial resource", type="token" ) + public static final String SP_USE = "use"; + @SearchParamDefinition(name="patient", path="Claim.patient", description="Patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="priority", path="Claim.priority", description="Processing priority requested", type="token" ) + public static final String SP_PRIORITY = "priority"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ClaimResponse.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ClaimResponse.java index 5af52aab7b7..2d2df06b2e4 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ClaimResponse.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ClaimResponse.java @@ -1,4444 +1,4423 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import java.util.*; - -import java.math.*; -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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * This resource provides the adjudication details from the processing of a Claim resource. - */ -@ResourceDef(name="ClaimResponse", profile="http://hl7.org/fhir/Profile/ClaimResponse") -public class ClaimResponse extends DomainResource { - - public enum RSLink { - /** - * The processing completed without errors. - */ - COMPLETE, - /** - * The processing identified with errors. - */ - ERROR, - /** - * added to help the parsers - */ - NULL; - public static RSLink fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return COMPLETE; - if ("error".equals(codeString)) - return ERROR; - throw new Exception("Unknown RSLink code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case COMPLETE: return "complete"; - case ERROR: return "error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case COMPLETE: return ""; - case ERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case COMPLETE: return "The processing completed without errors."; - case ERROR: return "The processing identified with errors."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case COMPLETE: return "Complete"; - case ERROR: return "Error"; - default: return "?"; - } - } - } - - public static class RSLinkEnumFactory implements EnumFactory { - public RSLink fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return RSLink.COMPLETE; - if ("error".equals(codeString)) - return RSLink.ERROR; - throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); - } - public String toCode(RSLink code) { - if (code == RSLink.COMPLETE) - return "complete"; - if (code == RSLink.ERROR) - return "error"; - return "?"; - } - } - - @Block() - public static class ItemsComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A service line number. - */ - @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected PositiveIntType sequenceLinkId; - - /** - * A list of note references to the notes provided below. - */ - @Child(name = "noteNumber", type = {PositiveIntType.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of note numbers which apply", formalDefinition="A list of note references to the notes provided below." ) - protected List noteNumber; - - /** - * The adjudications results. - */ - @Child(name = "adjudication", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Adjudication details", formalDefinition="The adjudications results." ) - protected List adjudication; - - /** - * The second tier service adjudications for submitted services. - */ - @Child(name = "detail", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Detail line items", formalDefinition="The second tier service adjudications for submitted services." ) - protected List detail; - - private static final long serialVersionUID = -1917866697L; - - /* - * Constructor - */ - public ItemsComponent() { - super(); - } - - /* - * Constructor - */ - public ItemsComponent(PositiveIntType sequenceLinkId) { - super(); - this.sequenceLinkId = sequenceLinkId; - } - - /** - * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public PositiveIntType getSequenceLinkIdElement() { - if (this.sequenceLinkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.sequenceLinkId"); - else if (Configuration.doAutoCreate()) - this.sequenceLinkId = new PositiveIntType(); // bb - return this.sequenceLinkId; - } - - public boolean hasSequenceLinkIdElement() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - public boolean hasSequenceLinkId() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - /** - * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public ItemsComponent setSequenceLinkIdElement(PositiveIntType value) { - this.sequenceLinkId = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequenceLinkId() { - return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue(); - } - - /** - * @param value A service line number. - */ - public ItemsComponent setSequenceLinkId(int value) { - if (this.sequenceLinkId == null) - this.sequenceLinkId = new PositiveIntType(); - this.sequenceLinkId.setValue(value); - return this; - } - - /** - * @return {@link #noteNumber} (A list of note references to the notes provided below.) - */ - public List getNoteNumber() { - if (this.noteNumber == null) - this.noteNumber = new ArrayList(); - return this.noteNumber; - } - - public boolean hasNoteNumber() { - if (this.noteNumber == null) - return false; - for (PositiveIntType item : this.noteNumber) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #noteNumber} (A list of note references to the notes provided below.) - */ - // syntactic sugar - public PositiveIntType addNoteNumberElement() {//2 - PositiveIntType t = new PositiveIntType(); - if (this.noteNumber == null) - this.noteNumber = new ArrayList(); - this.noteNumber.add(t); - return t; - } - - /** - * @param value {@link #noteNumber} (A list of note references to the notes provided below.) - */ - public ItemsComponent addNoteNumber(int value) { //1 - PositiveIntType t = new PositiveIntType(); - t.setValue(value); - if (this.noteNumber == null) - this.noteNumber = new ArrayList(); - this.noteNumber.add(t); - return this; - } - - /** - * @param value {@link #noteNumber} (A list of note references to the notes provided below.) - */ - public boolean hasNoteNumber(int value) { - if (this.noteNumber == null) - return false; - for (PositiveIntType v : this.noteNumber) - if (v.equals(value)) // positiveInt - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - public List getAdjudication() { - if (this.adjudication == null) - this.adjudication = new ArrayList(); - return this.adjudication; - } - - public boolean hasAdjudication() { - if (this.adjudication == null) - return false; - for (ItemAdjudicationComponent item : this.adjudication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - // syntactic sugar - public ItemAdjudicationComponent addAdjudication() { //3 - ItemAdjudicationComponent t = new ItemAdjudicationComponent(); - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return t; - } - - // syntactic sugar - public ItemsComponent addAdjudication(ItemAdjudicationComponent t) { //3 - if (t == null) - return this; - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return this; - } - - /** - * @return {@link #detail} (The second tier service adjudications for submitted services.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (ItemDetailComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (The second tier service adjudications for submitted services.) - */ - // syntactic sugar - public ItemDetailComponent addDetail() { //3 - ItemDetailComponent t = new ItemDetailComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - // syntactic sugar - public ItemsComponent addDetail(ItemDetailComponent t) { //3 - if (t == null) - return this; - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequenceLinkId", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); - childrenList.add(new Property("noteNumber", "positiveInt", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumber)); - childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); - childrenList.add(new Property("detail", "", "The second tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - public ItemsComponent copy() { - ItemsComponent dst = new ItemsComponent(); - copyValues(dst); - dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); - if (noteNumber != null) { - dst.noteNumber = new ArrayList(); - for (PositiveIntType i : noteNumber) - dst.noteNumber.add(i.copy()); - }; - if (adjudication != null) { - dst.adjudication = new ArrayList(); - for (ItemAdjudicationComponent i : adjudication) - dst.adjudication.add(i.copy()); - }; - if (detail != null) { - dst.detail = new ArrayList(); - for (ItemDetailComponent i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ItemsComponent)) - return false; - ItemsComponent o = (ItemsComponent) other; - return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(noteNumber, o.noteNumber, true) - && compareDeep(adjudication, o.adjudication, true) && compareDeep(detail, o.detail, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ItemsComponent)) - return false; - ItemsComponent o = (ItemsComponent) other; - return compareValues(sequenceLinkId, o.sequenceLinkId, true) && compareValues(noteNumber, o.noteNumber, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (noteNumber == null || noteNumber.isEmpty()) - && (adjudication == null || adjudication.isEmpty()) && (detail == null || detail.isEmpty()) - ; - } - - } - - @Block() - public static class ItemAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. - */ - @Child(name = "code", type = {Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) - protected Coding code; - - /** - * Monitory amount associated with the code. - */ - @Child(name = "amount", type = {Money.class}, order=2, min=0, max=1) - @Description(shortDefinition="Monetary amount", formalDefinition="Monitory amount associated with the code." ) - protected Money amount; - - /** - * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - @Child(name = "value", type = {DecimalType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) - protected DecimalType value; - - private static final long serialVersionUID = -949880587L; - - /* - * Constructor - */ - public ItemAdjudicationComponent() { - super(); - } - - /* - * Constructor - */ - public ItemAdjudicationComponent(Coding code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public Coding getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemAdjudicationComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Coding(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public ItemAdjudicationComponent setCode(Coding value) { - this.code = value; - return this; - } - - /** - * @return {@link #amount} (Monitory amount associated with the code.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemAdjudicationComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Monitory amount associated with the code.) - */ - public ItemAdjudicationComponent setAmount(Money value) { - this.amount = value; - return this; - } - - /** - * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemAdjudicationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public ItemAdjudicationComponent setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public ItemAdjudicationComponent setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); - childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public ItemAdjudicationComponent copy() { - ItemAdjudicationComponent dst = new ItemAdjudicationComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.amount = amount == null ? null : amount.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ItemAdjudicationComponent)) - return false; - ItemAdjudicationComponent o = (ItemAdjudicationComponent) other; - return compareDeep(code, o.code, true) && compareDeep(amount, o.amount, true) && compareDeep(value, o.value, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ItemAdjudicationComponent)) - return false; - ItemAdjudicationComponent o = (ItemAdjudicationComponent) other; - return compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (amount == null || amount.isEmpty()) - && (value == null || value.isEmpty()); - } - - } - - @Block() - public static class ItemDetailComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A service line number. - */ - @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected PositiveIntType sequenceLinkId; - - /** - * The adjudications results. - */ - @Child(name = "adjudication", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Detail adjudication", formalDefinition="The adjudications results." ) - protected List adjudication; - - /** - * The third tier service adjudications for submitted services. - */ - @Child(name = "subDetail", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Subdetail line items", formalDefinition="The third tier service adjudications for submitted services." ) - protected List subDetail; - - private static final long serialVersionUID = -1751018357L; - - /* - * Constructor - */ - public ItemDetailComponent() { - super(); - } - - /* - * Constructor - */ - public ItemDetailComponent(PositiveIntType sequenceLinkId) { - super(); - this.sequenceLinkId = sequenceLinkId; - } - - /** - * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public PositiveIntType getSequenceLinkIdElement() { - if (this.sequenceLinkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemDetailComponent.sequenceLinkId"); - else if (Configuration.doAutoCreate()) - this.sequenceLinkId = new PositiveIntType(); // bb - return this.sequenceLinkId; - } - - public boolean hasSequenceLinkIdElement() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - public boolean hasSequenceLinkId() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - /** - * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public ItemDetailComponent setSequenceLinkIdElement(PositiveIntType value) { - this.sequenceLinkId = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequenceLinkId() { - return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue(); - } - - /** - * @param value A service line number. - */ - public ItemDetailComponent setSequenceLinkId(int value) { - if (this.sequenceLinkId == null) - this.sequenceLinkId = new PositiveIntType(); - this.sequenceLinkId.setValue(value); - return this; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - public List getAdjudication() { - if (this.adjudication == null) - this.adjudication = new ArrayList(); - return this.adjudication; - } - - public boolean hasAdjudication() { - if (this.adjudication == null) - return false; - for (DetailAdjudicationComponent item : this.adjudication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - // syntactic sugar - public DetailAdjudicationComponent addAdjudication() { //3 - DetailAdjudicationComponent t = new DetailAdjudicationComponent(); - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return t; - } - - // syntactic sugar - public ItemDetailComponent addAdjudication(DetailAdjudicationComponent t) { //3 - if (t == null) - return this; - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return this; - } - - /** - * @return {@link #subDetail} (The third tier service adjudications for submitted services.) - */ - public List getSubDetail() { - if (this.subDetail == null) - this.subDetail = new ArrayList(); - return this.subDetail; - } - - public boolean hasSubDetail() { - if (this.subDetail == null) - return false; - for (SubDetailComponent item : this.subDetail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subDetail} (The third tier service adjudications for submitted services.) - */ - // syntactic sugar - public SubDetailComponent addSubDetail() { //3 - SubDetailComponent t = new SubDetailComponent(); - if (this.subDetail == null) - this.subDetail = new ArrayList(); - this.subDetail.add(t); - return t; - } - - // syntactic sugar - public ItemDetailComponent addSubDetail(SubDetailComponent t) { //3 - if (t == null) - return this; - if (this.subDetail == null) - this.subDetail = new ArrayList(); - this.subDetail.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequenceLinkId", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); - childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); - childrenList.add(new Property("subDetail", "", "The third tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); - } - - public ItemDetailComponent copy() { - ItemDetailComponent dst = new ItemDetailComponent(); - copyValues(dst); - dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); - if (adjudication != null) { - dst.adjudication = new ArrayList(); - for (DetailAdjudicationComponent i : adjudication) - dst.adjudication.add(i.copy()); - }; - if (subDetail != null) { - dst.subDetail = new ArrayList(); - for (SubDetailComponent i : subDetail) - dst.subDetail.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ItemDetailComponent)) - return false; - ItemDetailComponent o = (ItemDetailComponent) other; - return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(adjudication, o.adjudication, true) - && compareDeep(subDetail, o.subDetail, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ItemDetailComponent)) - return false; - ItemDetailComponent o = (ItemDetailComponent) other; - return compareValues(sequenceLinkId, o.sequenceLinkId, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (adjudication == null || adjudication.isEmpty()) - && (subDetail == null || subDetail.isEmpty()); - } - - } - - @Block() - public static class DetailAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. - */ - @Child(name = "code", type = {Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) - protected Coding code; - - /** - * Monitory amount associated with the code. - */ - @Child(name = "amount", type = {Money.class}, order=2, min=0, max=1) - @Description(shortDefinition="Monetary amount", formalDefinition="Monitory amount associated with the code." ) - protected Money amount; - - /** - * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - @Child(name = "value", type = {DecimalType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) - protected DecimalType value; - - private static final long serialVersionUID = -949880587L; - - /* - * Constructor - */ - public DetailAdjudicationComponent() { - super(); - } - - /* - * Constructor - */ - public DetailAdjudicationComponent(Coding code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public Coding getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailAdjudicationComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Coding(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public DetailAdjudicationComponent setCode(Coding value) { - this.code = value; - return this; - } - - /** - * @return {@link #amount} (Monitory amount associated with the code.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailAdjudicationComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Monitory amount associated with the code.) - */ - public DetailAdjudicationComponent setAmount(Money value) { - this.amount = value; - return this; - } - - /** - * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailAdjudicationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DetailAdjudicationComponent setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public DetailAdjudicationComponent setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); - childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public DetailAdjudicationComponent copy() { - DetailAdjudicationComponent dst = new DetailAdjudicationComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.amount = amount == null ? null : amount.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DetailAdjudicationComponent)) - return false; - DetailAdjudicationComponent o = (DetailAdjudicationComponent) other; - return compareDeep(code, o.code, true) && compareDeep(amount, o.amount, true) && compareDeep(value, o.value, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DetailAdjudicationComponent)) - return false; - DetailAdjudicationComponent o = (DetailAdjudicationComponent) other; - return compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (amount == null || amount.isEmpty()) - && (value == null || value.isEmpty()); - } - - } - - @Block() - public static class SubDetailComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A service line number. - */ - @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected PositiveIntType sequenceLinkId; - - /** - * The adjudications results. - */ - @Child(name = "adjudication", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Subdetail adjudication", formalDefinition="The adjudications results." ) - protected List adjudication; - - private static final long serialVersionUID = 1780202110L; - - /* - * Constructor - */ - public SubDetailComponent() { - super(); - } - - /* - * Constructor - */ - public SubDetailComponent(PositiveIntType sequenceLinkId) { - super(); - this.sequenceLinkId = sequenceLinkId; - } - - /** - * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public PositiveIntType getSequenceLinkIdElement() { - if (this.sequenceLinkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.sequenceLinkId"); - else if (Configuration.doAutoCreate()) - this.sequenceLinkId = new PositiveIntType(); // bb - return this.sequenceLinkId; - } - - public boolean hasSequenceLinkIdElement() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - public boolean hasSequenceLinkId() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - /** - * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public SubDetailComponent setSequenceLinkIdElement(PositiveIntType value) { - this.sequenceLinkId = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequenceLinkId() { - return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue(); - } - - /** - * @param value A service line number. - */ - public SubDetailComponent setSequenceLinkId(int value) { - if (this.sequenceLinkId == null) - this.sequenceLinkId = new PositiveIntType(); - this.sequenceLinkId.setValue(value); - return this; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - public List getAdjudication() { - if (this.adjudication == null) - this.adjudication = new ArrayList(); - return this.adjudication; - } - - public boolean hasAdjudication() { - if (this.adjudication == null) - return false; - for (SubdetailAdjudicationComponent item : this.adjudication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - // syntactic sugar - public SubdetailAdjudicationComponent addAdjudication() { //3 - SubdetailAdjudicationComponent t = new SubdetailAdjudicationComponent(); - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return t; - } - - // syntactic sugar - public SubDetailComponent addAdjudication(SubdetailAdjudicationComponent t) { //3 - if (t == null) - return this; - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequenceLinkId", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); - childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); - } - - public SubDetailComponent copy() { - SubDetailComponent dst = new SubDetailComponent(); - copyValues(dst); - dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); - if (adjudication != null) { - dst.adjudication = new ArrayList(); - for (SubdetailAdjudicationComponent i : adjudication) - dst.adjudication.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SubDetailComponent)) - return false; - SubDetailComponent o = (SubDetailComponent) other; - return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(adjudication, o.adjudication, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SubDetailComponent)) - return false; - SubDetailComponent o = (SubDetailComponent) other; - return compareValues(sequenceLinkId, o.sequenceLinkId, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (adjudication == null || adjudication.isEmpty()) - ; - } - - } - - @Block() - public static class SubdetailAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. - */ - @Child(name = "code", type = {Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) - protected Coding code; - - /** - * Monitory amount associated with the code. - */ - @Child(name = "amount", type = {Money.class}, order=2, min=0, max=1) - @Description(shortDefinition="Monetary amount", formalDefinition="Monitory amount associated with the code." ) - protected Money amount; - - /** - * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - @Child(name = "value", type = {DecimalType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) - protected DecimalType value; - - private static final long serialVersionUID = -949880587L; - - /* - * Constructor - */ - public SubdetailAdjudicationComponent() { - super(); - } - - /* - * Constructor - */ - public SubdetailAdjudicationComponent(Coding code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public Coding getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Coding(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public SubdetailAdjudicationComponent setCode(Coding value) { - this.code = value; - return this; - } - - /** - * @return {@link #amount} (Monitory amount associated with the code.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Monitory amount associated with the code.) - */ - public SubdetailAdjudicationComponent setAmount(Money value) { - this.amount = value; - return this; - } - - /** - * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public SubdetailAdjudicationComponent setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public SubdetailAdjudicationComponent setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); - childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public SubdetailAdjudicationComponent copy() { - SubdetailAdjudicationComponent dst = new SubdetailAdjudicationComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.amount = amount == null ? null : amount.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SubdetailAdjudicationComponent)) - return false; - SubdetailAdjudicationComponent o = (SubdetailAdjudicationComponent) other; - return compareDeep(code, o.code, true) && compareDeep(amount, o.amount, true) && compareDeep(value, o.value, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SubdetailAdjudicationComponent)) - return false; - SubdetailAdjudicationComponent o = (SubdetailAdjudicationComponent) other; - return compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (amount == null || amount.isEmpty()) - && (value == null || value.isEmpty()); - } - - } - - @Block() - public static class AddedItemComponent extends BackboneElement implements IBaseBackboneElement { - /** - * List of input service items which this service line is intended to replace. - */ - @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Service instances", formalDefinition="List of input service items which this service line is intended to replace." ) - protected List sequenceLinkId; - - /** - * A code to indicate the Professional Service or Product supplied. - */ - @Child(name = "service", type = {Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Group, Service or Product", formalDefinition="A code to indicate the Professional Service or Product supplied." ) - protected Coding service; - - /** - * The fee charged for the professional service or product.. - */ - @Child(name = "fee", type = {Money.class}, order=3, min=0, max=1) - @Description(shortDefinition="Professional fee or Product charge", formalDefinition="The fee charged for the professional service or product.." ) - protected Money fee; - - /** - * A list of note references to the notes provided below. - */ - @Child(name = "noteNumberLinkId", type = {PositiveIntType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of note numbers which apply", formalDefinition="A list of note references to the notes provided below." ) - protected List noteNumberLinkId; - - /** - * The adjudications results. - */ - @Child(name = "adjudication", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Added items adjudication", formalDefinition="The adjudications results." ) - protected List adjudication; - - /** - * The second tier service adjudications for payor added services. - */ - @Child(name = "detail", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Added items details", formalDefinition="The second tier service adjudications for payor added services." ) - protected List detail; - - private static final long serialVersionUID = -1675935854L; - - /* - * Constructor - */ - public AddedItemComponent() { - super(); - } - - /* - * Constructor - */ - public AddedItemComponent(Coding service) { - super(); - this.service = service; - } - - /** - * @return {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) - */ - public List getSequenceLinkId() { - if (this.sequenceLinkId == null) - this.sequenceLinkId = new ArrayList(); - return this.sequenceLinkId; - } - - public boolean hasSequenceLinkId() { - if (this.sequenceLinkId == null) - return false; - for (PositiveIntType item : this.sequenceLinkId) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) - */ - // syntactic sugar - public PositiveIntType addSequenceLinkIdElement() {//2 - PositiveIntType t = new PositiveIntType(); - if (this.sequenceLinkId == null) - this.sequenceLinkId = new ArrayList(); - this.sequenceLinkId.add(t); - return t; - } - - /** - * @param value {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) - */ - public AddedItemComponent addSequenceLinkId(int value) { //1 - PositiveIntType t = new PositiveIntType(); - t.setValue(value); - if (this.sequenceLinkId == null) - this.sequenceLinkId = new ArrayList(); - this.sequenceLinkId.add(t); - return this; - } - - /** - * @param value {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) - */ - public boolean hasSequenceLinkId(int value) { - if (this.sequenceLinkId == null) - return false; - for (PositiveIntType v : this.sequenceLinkId) - if (v.equals(value)) // positiveInt - return true; - return false; - } - - /** - * @return {@link #service} (A code to indicate the Professional Service or Product supplied.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); // cc - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (A code to indicate the Professional Service or Product supplied.) - */ - public AddedItemComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #fee} (The fee charged for the professional service or product..) - */ - public Money getFee() { - if (this.fee == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemComponent.fee"); - else if (Configuration.doAutoCreate()) - this.fee = new Money(); // cc - return this.fee; - } - - public boolean hasFee() { - return this.fee != null && !this.fee.isEmpty(); - } - - /** - * @param value {@link #fee} (The fee charged for the professional service or product..) - */ - public AddedItemComponent setFee(Money value) { - this.fee = value; - return this; - } - - /** - * @return {@link #noteNumberLinkId} (A list of note references to the notes provided below.) - */ - public List getNoteNumberLinkId() { - if (this.noteNumberLinkId == null) - this.noteNumberLinkId = new ArrayList(); - return this.noteNumberLinkId; - } - - public boolean hasNoteNumberLinkId() { - if (this.noteNumberLinkId == null) - return false; - for (PositiveIntType item : this.noteNumberLinkId) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #noteNumberLinkId} (A list of note references to the notes provided below.) - */ - // syntactic sugar - public PositiveIntType addNoteNumberLinkIdElement() {//2 - PositiveIntType t = new PositiveIntType(); - if (this.noteNumberLinkId == null) - this.noteNumberLinkId = new ArrayList(); - this.noteNumberLinkId.add(t); - return t; - } - - /** - * @param value {@link #noteNumberLinkId} (A list of note references to the notes provided below.) - */ - public AddedItemComponent addNoteNumberLinkId(int value) { //1 - PositiveIntType t = new PositiveIntType(); - t.setValue(value); - if (this.noteNumberLinkId == null) - this.noteNumberLinkId = new ArrayList(); - this.noteNumberLinkId.add(t); - return this; - } - - /** - * @param value {@link #noteNumberLinkId} (A list of note references to the notes provided below.) - */ - public boolean hasNoteNumberLinkId(int value) { - if (this.noteNumberLinkId == null) - return false; - for (PositiveIntType v : this.noteNumberLinkId) - if (v.equals(value)) // positiveInt - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - public List getAdjudication() { - if (this.adjudication == null) - this.adjudication = new ArrayList(); - return this.adjudication; - } - - public boolean hasAdjudication() { - if (this.adjudication == null) - return false; - for (AddedItemAdjudicationComponent item : this.adjudication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - // syntactic sugar - public AddedItemAdjudicationComponent addAdjudication() { //3 - AddedItemAdjudicationComponent t = new AddedItemAdjudicationComponent(); - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return t; - } - - // syntactic sugar - public AddedItemComponent addAdjudication(AddedItemAdjudicationComponent t) { //3 - if (t == null) - return this; - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return this; - } - - /** - * @return {@link #detail} (The second tier service adjudications for payor added services.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (AddedItemsDetailComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (The second tier service adjudications for payor added services.) - */ - // syntactic sugar - public AddedItemsDetailComponent addDetail() { //3 - AddedItemsDetailComponent t = new AddedItemsDetailComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - // syntactic sugar - public AddedItemComponent addDetail(AddedItemsDetailComponent t) { //3 - if (t == null) - return this; - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequenceLinkId", "positiveInt", "List of input service items which this service line is intended to replace.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); - childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product..", 0, java.lang.Integer.MAX_VALUE, fee)); - childrenList.add(new Property("noteNumberLinkId", "positiveInt", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumberLinkId)); - childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); - childrenList.add(new Property("detail", "", "The second tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - public AddedItemComponent copy() { - AddedItemComponent dst = new AddedItemComponent(); - copyValues(dst); - if (sequenceLinkId != null) { - dst.sequenceLinkId = new ArrayList(); - for (PositiveIntType i : sequenceLinkId) - dst.sequenceLinkId.add(i.copy()); - }; - dst.service = service == null ? null : service.copy(); - dst.fee = fee == null ? null : fee.copy(); - if (noteNumberLinkId != null) { - dst.noteNumberLinkId = new ArrayList(); - for (PositiveIntType i : noteNumberLinkId) - dst.noteNumberLinkId.add(i.copy()); - }; - if (adjudication != null) { - dst.adjudication = new ArrayList(); - for (AddedItemAdjudicationComponent i : adjudication) - dst.adjudication.add(i.copy()); - }; - if (detail != null) { - dst.detail = new ArrayList(); - for (AddedItemsDetailComponent i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AddedItemComponent)) - return false; - AddedItemComponent o = (AddedItemComponent) other; - return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(service, o.service, true) - && compareDeep(fee, o.fee, true) && compareDeep(noteNumberLinkId, o.noteNumberLinkId, true) && compareDeep(adjudication, o.adjudication, true) - && compareDeep(detail, o.detail, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AddedItemComponent)) - return false; - AddedItemComponent o = (AddedItemComponent) other; - return compareValues(sequenceLinkId, o.sequenceLinkId, true) && compareValues(noteNumberLinkId, o.noteNumberLinkId, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (service == null || service.isEmpty()) - && (fee == null || fee.isEmpty()) && (noteNumberLinkId == null || noteNumberLinkId.isEmpty()) - && (adjudication == null || adjudication.isEmpty()) && (detail == null || detail.isEmpty()) - ; - } - - } - - @Block() - public static class AddedItemAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. - */ - @Child(name = "code", type = {Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) - protected Coding code; - - /** - * Monitory amount associated with the code. - */ - @Child(name = "amount", type = {Money.class}, order=2, min=0, max=1) - @Description(shortDefinition="Monetary amount", formalDefinition="Monitory amount associated with the code." ) - protected Money amount; - - /** - * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - @Child(name = "value", type = {DecimalType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) - protected DecimalType value; - - private static final long serialVersionUID = -949880587L; - - /* - * Constructor - */ - public AddedItemAdjudicationComponent() { - super(); - } - - /* - * Constructor - */ - public AddedItemAdjudicationComponent(Coding code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public Coding getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Coding(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public AddedItemAdjudicationComponent setCode(Coding value) { - this.code = value; - return this; - } - - /** - * @return {@link #amount} (Monitory amount associated with the code.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Monitory amount associated with the code.) - */ - public AddedItemAdjudicationComponent setAmount(Money value) { - this.amount = value; - return this; - } - - /** - * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public AddedItemAdjudicationComponent setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public AddedItemAdjudicationComponent setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); - childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public AddedItemAdjudicationComponent copy() { - AddedItemAdjudicationComponent dst = new AddedItemAdjudicationComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.amount = amount == null ? null : amount.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AddedItemAdjudicationComponent)) - return false; - AddedItemAdjudicationComponent o = (AddedItemAdjudicationComponent) other; - return compareDeep(code, o.code, true) && compareDeep(amount, o.amount, true) && compareDeep(value, o.value, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AddedItemAdjudicationComponent)) - return false; - AddedItemAdjudicationComponent o = (AddedItemAdjudicationComponent) other; - return compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (amount == null || amount.isEmpty()) - && (value == null || value.isEmpty()); - } - - } - - @Block() - public static class AddedItemsDetailComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A code to indicate the Professional Service or Product supplied. - */ - @Child(name = "service", type = {Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service or Product", formalDefinition="A code to indicate the Professional Service or Product supplied." ) - protected Coding service; - - /** - * The fee charged for the professional service or product.. - */ - @Child(name = "fee", type = {Money.class}, order=2, min=0, max=1) - @Description(shortDefinition="Professional fee or Product charge", formalDefinition="The fee charged for the professional service or product.." ) - protected Money fee; - - /** - * The adjudications results. - */ - @Child(name = "adjudication", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Added items detail adjudication", formalDefinition="The adjudications results." ) - protected List adjudication; - - private static final long serialVersionUID = -2104242020L; - - /* - * Constructor - */ - public AddedItemsDetailComponent() { - super(); - } - - /* - * Constructor - */ - public AddedItemsDetailComponent(Coding service) { - super(); - this.service = service; - } - - /** - * @return {@link #service} (A code to indicate the Professional Service or Product supplied.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemsDetailComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); // cc - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (A code to indicate the Professional Service or Product supplied.) - */ - public AddedItemsDetailComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #fee} (The fee charged for the professional service or product..) - */ - public Money getFee() { - if (this.fee == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemsDetailComponent.fee"); - else if (Configuration.doAutoCreate()) - this.fee = new Money(); // cc - return this.fee; - } - - public boolean hasFee() { - return this.fee != null && !this.fee.isEmpty(); - } - - /** - * @param value {@link #fee} (The fee charged for the professional service or product..) - */ - public AddedItemsDetailComponent setFee(Money value) { - this.fee = value; - return this; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - public List getAdjudication() { - if (this.adjudication == null) - this.adjudication = new ArrayList(); - return this.adjudication; - } - - public boolean hasAdjudication() { - if (this.adjudication == null) - return false; - for (AddedItemDetailAdjudicationComponent item : this.adjudication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - // syntactic sugar - public AddedItemDetailAdjudicationComponent addAdjudication() { //3 - AddedItemDetailAdjudicationComponent t = new AddedItemDetailAdjudicationComponent(); - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return t; - } - - // syntactic sugar - public AddedItemsDetailComponent addAdjudication(AddedItemDetailAdjudicationComponent t) { //3 - if (t == null) - return this; - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product..", 0, java.lang.Integer.MAX_VALUE, fee)); - childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); - } - - public AddedItemsDetailComponent copy() { - AddedItemsDetailComponent dst = new AddedItemsDetailComponent(); - copyValues(dst); - dst.service = service == null ? null : service.copy(); - dst.fee = fee == null ? null : fee.copy(); - if (adjudication != null) { - dst.adjudication = new ArrayList(); - for (AddedItemDetailAdjudicationComponent i : adjudication) - dst.adjudication.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AddedItemsDetailComponent)) - return false; - AddedItemsDetailComponent o = (AddedItemsDetailComponent) other; - return compareDeep(service, o.service, true) && compareDeep(fee, o.fee, true) && compareDeep(adjudication, o.adjudication, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AddedItemsDetailComponent)) - return false; - AddedItemsDetailComponent o = (AddedItemsDetailComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (service == null || service.isEmpty()) && (fee == null || fee.isEmpty()) - && (adjudication == null || adjudication.isEmpty()); - } - - } - - @Block() - public static class AddedItemDetailAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. - */ - @Child(name = "code", type = {Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) - protected Coding code; - - /** - * Monitory amount associated with the code. - */ - @Child(name = "amount", type = {Money.class}, order=2, min=0, max=1) - @Description(shortDefinition="Monetary amount", formalDefinition="Monitory amount associated with the code." ) - protected Money amount; - - /** - * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - @Child(name = "value", type = {DecimalType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) - protected DecimalType value; - - private static final long serialVersionUID = -949880587L; - - /* - * Constructor - */ - public AddedItemDetailAdjudicationComponent() { - super(); - } - - /* - * Constructor - */ - public AddedItemDetailAdjudicationComponent(Coding code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public Coding getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Coding(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public AddedItemDetailAdjudicationComponent setCode(Coding value) { - this.code = value; - return this; - } - - /** - * @return {@link #amount} (Monitory amount associated with the code.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Monitory amount associated with the code.) - */ - public AddedItemDetailAdjudicationComponent setAmount(Money value) { - this.amount = value; - return this; - } - - /** - * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public AddedItemDetailAdjudicationComponent setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public AddedItemDetailAdjudicationComponent setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); - childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public AddedItemDetailAdjudicationComponent copy() { - AddedItemDetailAdjudicationComponent dst = new AddedItemDetailAdjudicationComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.amount = amount == null ? null : amount.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AddedItemDetailAdjudicationComponent)) - return false; - AddedItemDetailAdjudicationComponent o = (AddedItemDetailAdjudicationComponent) other; - return compareDeep(code, o.code, true) && compareDeep(amount, o.amount, true) && compareDeep(value, o.value, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AddedItemDetailAdjudicationComponent)) - return false; - AddedItemDetailAdjudicationComponent o = (AddedItemDetailAdjudicationComponent) other; - return compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (amount == null || amount.isEmpty()) - && (value == null || value.isEmpty()); - } - - } - - @Block() - public static class ErrorsComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere. - */ - @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Item sequence number", formalDefinition="The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere." ) - protected PositiveIntType sequenceLinkId; - - /** - * The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. - */ - @Child(name = "detailSequenceLinkId", type = {PositiveIntType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Detail sequence number", formalDefinition="The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition." ) - protected PositiveIntType detailSequenceLinkId; - - /** - * The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. - */ - @Child(name = "subdetailSequenceLinkId", type = {PositiveIntType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Subdetail sequence number", formalDefinition="The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition." ) - protected PositiveIntType subdetailSequenceLinkId; - - /** - * An error code,froma specified code system, which details why the claim could not be adjudicated. - */ - @Child(name = "code", type = {Coding.class}, order=4, min=1, max=1) - @Description(shortDefinition="Error code detailing processing issues", formalDefinition="An error code,froma specified code system, which details why the claim could not be adjudicated." ) - protected Coding code; - - private static final long serialVersionUID = -1893641175L; - - /* - * Constructor - */ - public ErrorsComponent() { - super(); - } - - /* - * Constructor - */ - public ErrorsComponent(Coding code) { - super(); - this.code = code; - } - - /** - * @return {@link #sequenceLinkId} (The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public PositiveIntType getSequenceLinkIdElement() { - if (this.sequenceLinkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ErrorsComponent.sequenceLinkId"); - else if (Configuration.doAutoCreate()) - this.sequenceLinkId = new PositiveIntType(); // bb - return this.sequenceLinkId; - } - - public boolean hasSequenceLinkIdElement() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - public boolean hasSequenceLinkId() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - /** - * @param value {@link #sequenceLinkId} (The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public ErrorsComponent setSequenceLinkIdElement(PositiveIntType value) { - this.sequenceLinkId = value; - return this; - } - - /** - * @return The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere. - */ - public int getSequenceLinkId() { - return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue(); - } - - /** - * @param value The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere. - */ - public ErrorsComponent setSequenceLinkId(int value) { - if (this.sequenceLinkId == null) - this.sequenceLinkId = new PositiveIntType(); - this.sequenceLinkId.setValue(value); - return this; - } - - /** - * @return {@link #detailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getDetailSequenceLinkId" gives direct access to the value - */ - public PositiveIntType getDetailSequenceLinkIdElement() { - if (this.detailSequenceLinkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ErrorsComponent.detailSequenceLinkId"); - else if (Configuration.doAutoCreate()) - this.detailSequenceLinkId = new PositiveIntType(); // bb - return this.detailSequenceLinkId; - } - - public boolean hasDetailSequenceLinkIdElement() { - return this.detailSequenceLinkId != null && !this.detailSequenceLinkId.isEmpty(); - } - - public boolean hasDetailSequenceLinkId() { - return this.detailSequenceLinkId != null && !this.detailSequenceLinkId.isEmpty(); - } - - /** - * @param value {@link #detailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getDetailSequenceLinkId" gives direct access to the value - */ - public ErrorsComponent setDetailSequenceLinkIdElement(PositiveIntType value) { - this.detailSequenceLinkId = value; - return this; - } - - /** - * @return The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. - */ - public int getDetailSequenceLinkId() { - return this.detailSequenceLinkId == null || this.detailSequenceLinkId.isEmpty() ? 0 : this.detailSequenceLinkId.getValue(); - } - - /** - * @param value The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. - */ - public ErrorsComponent setDetailSequenceLinkId(int value) { - if (this.detailSequenceLinkId == null) - this.detailSequenceLinkId = new PositiveIntType(); - this.detailSequenceLinkId.setValue(value); - return this; - } - - /** - * @return {@link #subdetailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getSubdetailSequenceLinkId" gives direct access to the value - */ - public PositiveIntType getSubdetailSequenceLinkIdElement() { - if (this.subdetailSequenceLinkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ErrorsComponent.subdetailSequenceLinkId"); - else if (Configuration.doAutoCreate()) - this.subdetailSequenceLinkId = new PositiveIntType(); // bb - return this.subdetailSequenceLinkId; - } - - public boolean hasSubdetailSequenceLinkIdElement() { - return this.subdetailSequenceLinkId != null && !this.subdetailSequenceLinkId.isEmpty(); - } - - public boolean hasSubdetailSequenceLinkId() { - return this.subdetailSequenceLinkId != null && !this.subdetailSequenceLinkId.isEmpty(); - } - - /** - * @param value {@link #subdetailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getSubdetailSequenceLinkId" gives direct access to the value - */ - public ErrorsComponent setSubdetailSequenceLinkIdElement(PositiveIntType value) { - this.subdetailSequenceLinkId = value; - return this; - } - - /** - * @return The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. - */ - public int getSubdetailSequenceLinkId() { - return this.subdetailSequenceLinkId == null || this.subdetailSequenceLinkId.isEmpty() ? 0 : this.subdetailSequenceLinkId.getValue(); - } - - /** - * @param value The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. - */ - public ErrorsComponent setSubdetailSequenceLinkId(int value) { - if (this.subdetailSequenceLinkId == null) - this.subdetailSequenceLinkId = new PositiveIntType(); - this.subdetailSequenceLinkId.setValue(value); - return this; - } - - /** - * @return {@link #code} (An error code,froma specified code system, which details why the claim could not be adjudicated.) - */ - public Coding getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ErrorsComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Coding(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (An error code,froma specified code system, which details why the claim could not be adjudicated.) - */ - public ErrorsComponent setCode(Coding value) { - this.code = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequenceLinkId", "positiveInt", "The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); - childrenList.add(new Property("detailSequenceLinkId", "positiveInt", "The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.", 0, java.lang.Integer.MAX_VALUE, detailSequenceLinkId)); - childrenList.add(new Property("subdetailSequenceLinkId", "positiveInt", "The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.", 0, java.lang.Integer.MAX_VALUE, subdetailSequenceLinkId)); - childrenList.add(new Property("code", "Coding", "An error code,froma specified code system, which details why the claim could not be adjudicated.", 0, java.lang.Integer.MAX_VALUE, code)); - } - - public ErrorsComponent copy() { - ErrorsComponent dst = new ErrorsComponent(); - copyValues(dst); - dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); - dst.detailSequenceLinkId = detailSequenceLinkId == null ? null : detailSequenceLinkId.copy(); - dst.subdetailSequenceLinkId = subdetailSequenceLinkId == null ? null : subdetailSequenceLinkId.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ErrorsComponent)) - return false; - ErrorsComponent o = (ErrorsComponent) other; - return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(detailSequenceLinkId, o.detailSequenceLinkId, true) - && compareDeep(subdetailSequenceLinkId, o.subdetailSequenceLinkId, true) && compareDeep(code, o.code, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ErrorsComponent)) - return false; - ErrorsComponent o = (ErrorsComponent) other; - return compareValues(sequenceLinkId, o.sequenceLinkId, true) && compareValues(detailSequenceLinkId, o.detailSequenceLinkId, true) - && compareValues(subdetailSequenceLinkId, o.subdetailSequenceLinkId, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (detailSequenceLinkId == null || detailSequenceLinkId.isEmpty()) - && (subdetailSequenceLinkId == null || subdetailSequenceLinkId.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - } - - @Block() - public static class NotesComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An integer associated with each note which may be referred to from each service line item. - */ - @Child(name = "number", type = {PositiveIntType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Note Number for this note", formalDefinition="An integer associated with each note which may be referred to from each service line item." ) - protected PositiveIntType number; - - /** - * The note purpose: Print/Display. - */ - @Child(name = "type", type = {Coding.class}, order=2, min=0, max=1) - @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) - protected Coding type; - - /** - * The note text. - */ - @Child(name = "text", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Note explanitory text", formalDefinition="The note text." ) - protected StringType text; - - private static final long serialVersionUID = 1768923951L; - - /* - * Constructor - */ - public NotesComponent() { - super(); - } - - /** - * @return {@link #number} (An integer associated with each note which may be referred to from each service line item.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value - */ - public PositiveIntType getNumberElement() { - if (this.number == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NotesComponent.number"); - else if (Configuration.doAutoCreate()) - this.number = new PositiveIntType(); // bb - return this.number; - } - - public boolean hasNumberElement() { - return this.number != null && !this.number.isEmpty(); - } - - public boolean hasNumber() { - return this.number != null && !this.number.isEmpty(); - } - - /** - * @param value {@link #number} (An integer associated with each note which may be referred to from each service line item.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value - */ - public NotesComponent setNumberElement(PositiveIntType value) { - this.number = value; - return this; - } - - /** - * @return An integer associated with each note which may be referred to from each service line item. - */ - public int getNumber() { - return this.number == null || this.number.isEmpty() ? 0 : this.number.getValue(); - } - - /** - * @param value An integer associated with each note which may be referred to from each service line item. - */ - public NotesComponent setNumber(int value) { - if (this.number == null) - this.number = new PositiveIntType(); - this.number.setValue(value); - return this; - } - - /** - * @return {@link #type} (The note purpose: Print/Display.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NotesComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The note purpose: Print/Display.) - */ - public NotesComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NotesComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public NotesComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return The note text. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value The note text. - */ - public NotesComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("number", "positiveInt", "An integer associated with each note which may be referred to from each service line item.", 0, java.lang.Integer.MAX_VALUE, number)); - childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); - } - - public NotesComponent copy() { - NotesComponent dst = new NotesComponent(); - copyValues(dst); - dst.number = number == null ? null : number.copy(); - dst.type = type == null ? null : type.copy(); - dst.text = text == null ? null : text.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NotesComponent)) - return false; - NotesComponent o = (NotesComponent) other; - return compareDeep(number, o.number, true) && compareDeep(type, o.type, true) && compareDeep(text, o.text, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NotesComponent)) - return false; - NotesComponent o = (NotesComponent) other; - return compareValues(number, o.number, true) && compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (number == null || number.isEmpty()) && (type == null || type.isEmpty()) - && (text == null || text.isEmpty()); - } - - } - - @Block() - public static class CoverageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A service line item. - */ - @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) - protected PositiveIntType sequence; - - /** - * The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. - */ - @Child(name = "focal", type = {BooleanType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated." ) - protected BooleanType focal; - - /** - * Reference to the program or plan identification, underwriter or payor. - */ - @Child(name = "coverage", type = {Coverage.class}, order=3, min=1, max=1) - @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) - protected Reference coverage; - - /** - * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) - */ - protected Coverage coverageTarget; - - /** - * The contract number of a business agreement which describes the terms and conditions. - */ - @Child(name = "businessArrangement", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agreement which describes the terms and conditions." ) - protected StringType businessArrangement; - - /** - * The relationship of the patient to the subscriber. - */ - @Child(name = "relationship", type = {Coding.class}, order=5, min=1, max=1) - @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) - protected Coding relationship; - - /** - * A list of references from the Insurer to which these services pertain. - */ - @Child(name = "preAuthRef", type = {StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) - protected List preAuthRef; - - /** - * The Coverages adjudication details. - */ - @Child(name = "claimResponse", type = {ClaimResponse.class}, order=7, min=0, max=1) - @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." ) - protected Reference claimResponse; - - /** - * The actual object that is the target of the reference (The Coverages adjudication details.) - */ - protected ClaimResponse claimResponseTarget; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=8, 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; - - private static final long serialVersionUID = 621250924L; - - /* - * Constructor - */ - public CoverageComponent() { - super(); - } - - /* - * Constructor - */ - public CoverageComponent(PositiveIntType sequence, BooleanType focal, Reference coverage, Coding relationship) { - super(); - this.sequence = sequence; - this.focal = focal; - this.coverage = coverage; - this.relationship = relationship; - } - - /** - * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public PositiveIntType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new PositiveIntType(); // bb - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public CoverageComponent setSequenceElement(PositiveIntType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line item. - */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); - } - - /** - * @param value A service line item. - */ - public CoverageComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new PositiveIntType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value - */ - public BooleanType getFocalElement() { - if (this.focal == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.focal"); - else if (Configuration.doAutoCreate()) - this.focal = new BooleanType(); // bb - return this.focal; - } - - public boolean hasFocalElement() { - return this.focal != null && !this.focal.isEmpty(); - } - - public boolean hasFocal() { - return this.focal != null && !this.focal.isEmpty(); - } - - /** - * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value - */ - public CoverageComponent setFocalElement(BooleanType value) { - this.focal = value; - return this; - } - - /** - * @return The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. - */ - public boolean getFocal() { - return this.focal == null || this.focal.isEmpty() ? false : this.focal.getValue(); - } - - /** - * @param value The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. - */ - public CoverageComponent setFocal(boolean value) { - if (this.focal == null) - this.focal = new BooleanType(); - this.focal.setValue(value); - return this; - } - - /** - * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public Reference getCoverage() { - if (this.coverage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.coverage"); - else if (Configuration.doAutoCreate()) - this.coverage = new Reference(); // cc - return this.coverage; - } - - public boolean hasCoverage() { - return this.coverage != null && !this.coverage.isEmpty(); - } - - /** - * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public CoverageComponent setCoverage(Reference value) { - this.coverage = value; - return this; - } - - /** - * @return {@link #coverage} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) - */ - public Coverage getCoverageTarget() { - if (this.coverageTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.coverage"); - else if (Configuration.doAutoCreate()) - this.coverageTarget = new Coverage(); // aa - return this.coverageTarget; - } - - /** - * @param value {@link #coverage} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) - */ - public CoverageComponent setCoverageTarget(Coverage value) { - this.coverageTarget = value; - return this; - } - - /** - * @return {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public StringType getBusinessArrangementElement() { - if (this.businessArrangement == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); - else if (Configuration.doAutoCreate()) - this.businessArrangement = new StringType(); // bb - return this.businessArrangement; - } - - public boolean hasBusinessArrangementElement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - public boolean hasBusinessArrangement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - /** - * @param value {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public CoverageComponent setBusinessArrangementElement(StringType value) { - this.businessArrangement = value; - return this; - } - - /** - * @return The contract number of a business agreement which describes the terms and conditions. - */ - public String getBusinessArrangement() { - return this.businessArrangement == null ? null : this.businessArrangement.getValue(); - } - - /** - * @param value The contract number of a business agreement which describes the terms and conditions. - */ - public CoverageComponent setBusinessArrangement(String value) { - if (Utilities.noString(value)) - this.businessArrangement = null; - else { - if (this.businessArrangement == null) - this.businessArrangement = new StringType(); - this.businessArrangement.setValue(value); - } - return this; - } - - /** - * @return {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public Coding getRelationship() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new Coding(); // cc - return this.relationship; - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public CoverageComponent setRelationship(Coding value) { - this.relationship = value; - return this; - } - - /** - * @return {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) - */ - public List getPreAuthRef() { - if (this.preAuthRef == null) - this.preAuthRef = new ArrayList(); - return this.preAuthRef; - } - - public boolean hasPreAuthRef() { - if (this.preAuthRef == null) - return false; - for (StringType item : this.preAuthRef) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) - */ - // syntactic sugar - public StringType addPreAuthRefElement() {//2 - StringType t = new StringType(); - if (this.preAuthRef == null) - this.preAuthRef = new ArrayList(); - this.preAuthRef.add(t); - return t; - } - - /** - * @param value {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) - */ - public CoverageComponent addPreAuthRef(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.preAuthRef == null) - this.preAuthRef = new ArrayList(); - this.preAuthRef.add(t); - return this; - } - - /** - * @param value {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) - */ - public boolean hasPreAuthRef(String value) { - if (this.preAuthRef == null) - return false; - for (StringType v : this.preAuthRef) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #claimResponse} (The Coverages adjudication details.) - */ - public Reference getClaimResponse() { - if (this.claimResponse == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); - else if (Configuration.doAutoCreate()) - this.claimResponse = new Reference(); // cc - return this.claimResponse; - } - - public boolean hasClaimResponse() { - return this.claimResponse != null && !this.claimResponse.isEmpty(); - } - - /** - * @param value {@link #claimResponse} (The Coverages adjudication details.) - */ - public CoverageComponent setClaimResponse(Reference value) { - this.claimResponse = value; - return this; - } - - /** - * @return {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.) - */ - public ClaimResponse getClaimResponseTarget() { - if (this.claimResponseTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); - else if (Configuration.doAutoCreate()) - this.claimResponseTarget = new ClaimResponse(); // aa - return this.claimResponseTarget; - } - - /** - * @param value {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.) - */ - public CoverageComponent setClaimResponseTarget(ClaimResponse value) { - this.claimResponseTarget = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public CoverageComponent setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "positiveInt", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.", 0, java.lang.Integer.MAX_VALUE, focal)); - childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agreement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); - childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("preAuthRef", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preAuthRef)); - childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - } - - public CoverageComponent copy() { - CoverageComponent dst = new CoverageComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.focal = focal == null ? null : focal.copy(); - dst.coverage = coverage == null ? null : coverage.copy(); - dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - if (preAuthRef != null) { - dst.preAuthRef = new ArrayList(); - for (StringType i : preAuthRef) - dst.preAuthRef.add(i.copy()); - }; - dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CoverageComponent)) - return false; - CoverageComponent o = (CoverageComponent) other; - return compareDeep(sequence, o.sequence, true) && compareDeep(focal, o.focal, true) && compareDeep(coverage, o.coverage, true) - && compareDeep(businessArrangement, o.businessArrangement, true) && compareDeep(relationship, o.relationship, true) - && compareDeep(preAuthRef, o.preAuthRef, true) && compareDeep(claimResponse, o.claimResponse, true) - && compareDeep(originalRuleset, o.originalRuleset, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CoverageComponent)) - return false; - CoverageComponent o = (CoverageComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(focal, o.focal, true) && compareValues(businessArrangement, o.businessArrangement, true) - && compareValues(preAuthRef, o.preAuthRef, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) - && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) - && (relationship == null || relationship.isEmpty()) && (preAuthRef == null || preAuthRef.isEmpty()) - && (claimResponse == null || claimResponse.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - ; - } - - } - - /** - * The Response Business Identifier. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Response number", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * Original request resource referrence. - */ - @Child(name = "request", type = {Claim.class}, order=1, min=0, max=1) - @Description(shortDefinition="Id of resource triggering adjudication", formalDefinition="Original request resource referrence." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (Original request resource referrence.) - */ - protected Claim requestTarget; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=2, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=3, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @Child(name = "created", type = {DateTimeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateTimeType created; - - /** - * The Insurer who produced this adjudicated response. - */ - @Child(name = "organization", type = {Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) - */ - protected Organization organizationTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name = "requestProvider", type = {Practitioner.class}, order=6, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference requestProvider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner requestProviderTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name = "requestOrganization", type = {Organization.class}, order=7, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference requestOrganization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization requestOrganizationTarget; - - /** - * Transaction status: error, complete. - */ - @Child(name = "outcome", type = {CodeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) - protected Enumeration outcome; - - /** - * A description of the status of the adjudication. - */ - @Child(name = "disposition", type = {StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) - protected StringType disposition; - - /** - * Party to be reimbursed: Subscriber, provider, other. - */ - @Child(name = "payeeType", type = {Coding.class}, order=10, min=0, max=1) - @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) - protected Coding payeeType; - - /** - * The first tier service adjudications for submitted services. - */ - @Child(name = "item", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Line items", formalDefinition="The first tier service adjudications for submitted services." ) - protected List item; - - /** - * The first tier service adjudications for payor added services. - */ - @Child(name = "addItem", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Insurer added line items", formalDefinition="The first tier service adjudications for payor added services." ) - protected List addItem; - - /** - * Mutually exclusive with Services Provided (Item). - */ - @Child(name = "error", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Processing errors", formalDefinition="Mutually exclusive with Services Provided (Item)." ) - protected List error; - - /** - * The total cost of the services reported. - */ - @Child(name = "totalCost", type = {Money.class}, order=14, min=0, max=1) - @Description(shortDefinition="Total Cost of service from the Claim", formalDefinition="The total cost of the services reported." ) - protected Money totalCost; - - /** - * The amount of deductable applied which was not allocated to any particular service line. - */ - @Child(name = "unallocDeductable", type = {Money.class}, order=15, min=0, max=1) - @Description(shortDefinition="Unallocated deductable", formalDefinition="The amount of deductable applied which was not allocated to any particular service line." ) - protected Money unallocDeductable; - - /** - * Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable). - */ - @Child(name = "totalBenefit", type = {Money.class}, order=16, min=0, max=1) - @Description(shortDefinition="Total benefit payable for the Claim", formalDefinition="Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable)." ) - protected Money totalBenefit; - - /** - * Adjustment to the payment of this transaction which is not related to adjudication of this transaction. - */ - @Child(name = "paymentAdjustment", type = {Money.class}, order=17, min=0, max=1) - @Description(shortDefinition="Payment adjustment for non-Claim issues", formalDefinition="Adjustment to the payment of this transaction which is not related to adjudication of this transaction." ) - protected Money paymentAdjustment; - - /** - * Reason for the payment adjustment. - */ - @Child(name = "paymentAdjustmentReason", type = {Coding.class}, order=18, min=0, max=1) - @Description(shortDefinition="Reason for Payment adjustment", formalDefinition="Reason for the payment adjustment." ) - protected Coding paymentAdjustmentReason; - - /** - * Estimated payment data. - */ - @Child(name = "paymentDate", type = {DateType.class}, order=19, min=0, max=1) - @Description(shortDefinition="Expected data of Payment", formalDefinition="Estimated payment data." ) - protected DateType paymentDate; - - /** - * Payable less any payment adjustment. - */ - @Child(name = "paymentAmount", type = {Money.class}, order=20, min=0, max=1) - @Description(shortDefinition="Payment amount", formalDefinition="Payable less any payment adjustment." ) - protected Money paymentAmount; - - /** - * Payment identifer. - */ - @Child(name = "paymentRef", type = {Identifier.class}, order=21, min=0, max=1) - @Description(shortDefinition="Payment identifier", formalDefinition="Payment identifer." ) - protected Identifier paymentRef; - - /** - * Status of funds reservation (For provider, for Patient, None). - */ - @Child(name = "reserved", type = {Coding.class}, order=22, min=0, max=1) - @Description(shortDefinition="Funds reserved status", formalDefinition="Status of funds reservation (For provider, for Patient, None)." ) - protected Coding reserved; - - /** - * The form to be used for printing the content. - */ - @Child(name = "form", type = {Coding.class}, order=23, min=0, max=1) - @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) - protected Coding form; - - /** - * Note text. - */ - @Child(name = "note", type = {}, order=24, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Processing notes", formalDefinition="Note text." ) - protected List note; - - /** - * Financial instrument by which payment information for health care. - */ - @Child(name = "coverage", type = {}, order=25, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) - protected List coverage; - - private static final long serialVersionUID = -1720247756L; - - /* - * Constructor - */ - public ClaimResponse() { - super(); - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public ClaimResponse addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #request} (Original request resource referrence.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); // cc - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request resource referrence.) - */ - public ClaimResponse setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original request resource referrence.) - */ - public Claim getRequestTarget() { - if (this.requestTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.request"); - else if (Configuration.doAutoCreate()) - this.requestTarget = new Claim(); // aa - return this.requestTarget; - } - - /** - * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original request resource referrence.) - */ - public ClaimResponse setRequestTarget(Claim value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public ClaimResponse setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public ClaimResponse setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public ClaimResponse setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when the enclosed suite of services were performed or completed. - */ - public ClaimResponse setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); // cc - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public ClaimResponse setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); // aa - return this.organizationTarget; - } - - /** - * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) - */ - public ClaimResponse setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getRequestProvider() { - if (this.requestProvider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProvider = new Reference(); // cc - return this.requestProvider; - } - - public boolean hasRequestProvider() { - return this.requestProvider != null && !this.requestProvider.isEmpty(); - } - - /** - * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public ClaimResponse setRequestProvider(Reference value) { - this.requestProvider = value; - return this; - } - - /** - * @return {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getRequestProviderTarget() { - if (this.requestProviderTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProviderTarget = new Practitioner(); // aa - return this.requestProviderTarget; - } - - /** - * @param value {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) - */ - public ClaimResponse setRequestProviderTarget(Practitioner value) { - this.requestProviderTarget = value; - return this; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getRequestOrganization() { - if (this.requestOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganization = new Reference(); // cc - return this.requestOrganization; - } - - public boolean hasRequestOrganization() { - return this.requestOrganization != null && !this.requestOrganization.isEmpty(); - } - - /** - * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public ClaimResponse setRequestOrganization(Reference value) { - this.requestOrganization = value; - return this; - } - - /** - * @return {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) - */ - public Organization getRequestOrganizationTarget() { - if (this.requestOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganizationTarget = new Organization(); // aa - return this.requestOrganizationTarget; - } - - /** - * @param value {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) - */ - public ClaimResponse setRequestOrganizationTarget(Organization value) { - this.requestOrganizationTarget = value; - return this; - } - - /** - * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public Enumeration getOutcomeElement() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Enumeration(new RSLinkEnumFactory()); // bb - return this.outcome; - } - - public boolean hasOutcomeElement() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public ClaimResponse setOutcomeElement(Enumeration value) { - this.outcome = value; - return this; - } - - /** - * @return Transaction status: error, complete. - */ - public RSLink getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value Transaction status: error, complete. - */ - public ClaimResponse setOutcome(RSLink value) { - if (value == null) - this.outcome = null; - else { - if (this.outcome == null) - this.outcome = new Enumeration(new RSLinkEnumFactory()); - this.outcome.setValue(value); - } - return this; - } - - /** - * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public StringType getDispositionElement() { - if (this.disposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.disposition"); - else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); // bb - return this.disposition; - } - - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - /** - * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public ClaimResponse setDispositionElement(StringType value) { - this.disposition = value; - return this; - } - - /** - * @return A description of the status of the adjudication. - */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); - } - - /** - * @param value A description of the status of the adjudication. - */ - public ClaimResponse setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); - } - return this; - } - - /** - * @return {@link #payeeType} (Party to be reimbursed: Subscriber, provider, other.) - */ - public Coding getPayeeType() { - if (this.payeeType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.payeeType"); - else if (Configuration.doAutoCreate()) - this.payeeType = new Coding(); // cc - return this.payeeType; - } - - public boolean hasPayeeType() { - return this.payeeType != null && !this.payeeType.isEmpty(); - } - - /** - * @param value {@link #payeeType} (Party to be reimbursed: Subscriber, provider, other.) - */ - public ClaimResponse setPayeeType(Coding value) { - this.payeeType = value; - return this; - } - - /** - * @return {@link #item} (The first tier service adjudications for submitted services.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (ItemsComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (The first tier service adjudications for submitted services.) - */ - // syntactic sugar - public ItemsComponent addItem() { //3 - ItemsComponent t = new ItemsComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - // syntactic sugar - public ClaimResponse addItem(ItemsComponent t) { //3 - if (t == null) - return this; - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return this; - } - - /** - * @return {@link #addItem} (The first tier service adjudications for payor added services.) - */ - public List getAddItem() { - if (this.addItem == null) - this.addItem = new ArrayList(); - return this.addItem; - } - - public boolean hasAddItem() { - if (this.addItem == null) - return false; - for (AddedItemComponent item : this.addItem) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #addItem} (The first tier service adjudications for payor added services.) - */ - // syntactic sugar - public AddedItemComponent addAddItem() { //3 - AddedItemComponent t = new AddedItemComponent(); - if (this.addItem == null) - this.addItem = new ArrayList(); - this.addItem.add(t); - return t; - } - - // syntactic sugar - public ClaimResponse addAddItem(AddedItemComponent t) { //3 - if (t == null) - return this; - if (this.addItem == null) - this.addItem = new ArrayList(); - this.addItem.add(t); - return this; - } - - /** - * @return {@link #error} (Mutually exclusive with Services Provided (Item).) - */ - public List getError() { - if (this.error == null) - this.error = new ArrayList(); - return this.error; - } - - public boolean hasError() { - if (this.error == null) - return false; - for (ErrorsComponent item : this.error) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #error} (Mutually exclusive with Services Provided (Item).) - */ - // syntactic sugar - public ErrorsComponent addError() { //3 - ErrorsComponent t = new ErrorsComponent(); - if (this.error == null) - this.error = new ArrayList(); - this.error.add(t); - return t; - } - - // syntactic sugar - public ClaimResponse addError(ErrorsComponent t) { //3 - if (t == null) - return this; - if (this.error == null) - this.error = new ArrayList(); - this.error.add(t); - return this; - } - - /** - * @return {@link #totalCost} (The total cost of the services reported.) - */ - public Money getTotalCost() { - if (this.totalCost == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.totalCost"); - else if (Configuration.doAutoCreate()) - this.totalCost = new Money(); // cc - return this.totalCost; - } - - public boolean hasTotalCost() { - return this.totalCost != null && !this.totalCost.isEmpty(); - } - - /** - * @param value {@link #totalCost} (The total cost of the services reported.) - */ - public ClaimResponse setTotalCost(Money value) { - this.totalCost = value; - return this; - } - - /** - * @return {@link #unallocDeductable} (The amount of deductable applied which was not allocated to any particular service line.) - */ - public Money getUnallocDeductable() { - if (this.unallocDeductable == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.unallocDeductable"); - else if (Configuration.doAutoCreate()) - this.unallocDeductable = new Money(); // cc - return this.unallocDeductable; - } - - public boolean hasUnallocDeductable() { - return this.unallocDeductable != null && !this.unallocDeductable.isEmpty(); - } - - /** - * @param value {@link #unallocDeductable} (The amount of deductable applied which was not allocated to any particular service line.) - */ - public ClaimResponse setUnallocDeductable(Money value) { - this.unallocDeductable = value; - return this; - } - - /** - * @return {@link #totalBenefit} (Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable).) - */ - public Money getTotalBenefit() { - if (this.totalBenefit == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.totalBenefit"); - else if (Configuration.doAutoCreate()) - this.totalBenefit = new Money(); // cc - return this.totalBenefit; - } - - public boolean hasTotalBenefit() { - return this.totalBenefit != null && !this.totalBenefit.isEmpty(); - } - - /** - * @param value {@link #totalBenefit} (Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable).) - */ - public ClaimResponse setTotalBenefit(Money value) { - this.totalBenefit = value; - return this; - } - - /** - * @return {@link #paymentAdjustment} (Adjustment to the payment of this transaction which is not related to adjudication of this transaction.) - */ - public Money getPaymentAdjustment() { - if (this.paymentAdjustment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.paymentAdjustment"); - else if (Configuration.doAutoCreate()) - this.paymentAdjustment = new Money(); // cc - return this.paymentAdjustment; - } - - public boolean hasPaymentAdjustment() { - return this.paymentAdjustment != null && !this.paymentAdjustment.isEmpty(); - } - - /** - * @param value {@link #paymentAdjustment} (Adjustment to the payment of this transaction which is not related to adjudication of this transaction.) - */ - public ClaimResponse setPaymentAdjustment(Money value) { - this.paymentAdjustment = value; - return this; - } - - /** - * @return {@link #paymentAdjustmentReason} (Reason for the payment adjustment.) - */ - public Coding getPaymentAdjustmentReason() { - if (this.paymentAdjustmentReason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.paymentAdjustmentReason"); - else if (Configuration.doAutoCreate()) - this.paymentAdjustmentReason = new Coding(); // cc - return this.paymentAdjustmentReason; - } - - public boolean hasPaymentAdjustmentReason() { - return this.paymentAdjustmentReason != null && !this.paymentAdjustmentReason.isEmpty(); - } - - /** - * @param value {@link #paymentAdjustmentReason} (Reason for the payment adjustment.) - */ - public ClaimResponse setPaymentAdjustmentReason(Coding value) { - this.paymentAdjustmentReason = value; - return this; - } - - /** - * @return {@link #paymentDate} (Estimated payment data.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value - */ - public DateType getPaymentDateElement() { - if (this.paymentDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.paymentDate"); - else if (Configuration.doAutoCreate()) - this.paymentDate = new DateType(); // bb - return this.paymentDate; - } - - public boolean hasPaymentDateElement() { - return this.paymentDate != null && !this.paymentDate.isEmpty(); - } - - public boolean hasPaymentDate() { - return this.paymentDate != null && !this.paymentDate.isEmpty(); - } - - /** - * @param value {@link #paymentDate} (Estimated payment data.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value - */ - public ClaimResponse setPaymentDateElement(DateType value) { - this.paymentDate = value; - return this; - } - - /** - * @return Estimated payment data. - */ - public Date getPaymentDate() { - return this.paymentDate == null ? null : this.paymentDate.getValue(); - } - - /** - * @param value Estimated payment data. - */ - public ClaimResponse setPaymentDate(Date value) { - if (value == null) - this.paymentDate = null; - else { - if (this.paymentDate == null) - this.paymentDate = new DateType(); - this.paymentDate.setValue(value); - } - return this; - } - - /** - * @return {@link #paymentAmount} (Payable less any payment adjustment.) - */ - public Money getPaymentAmount() { - if (this.paymentAmount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.paymentAmount"); - else if (Configuration.doAutoCreate()) - this.paymentAmount = new Money(); // cc - return this.paymentAmount; - } - - public boolean hasPaymentAmount() { - return this.paymentAmount != null && !this.paymentAmount.isEmpty(); - } - - /** - * @param value {@link #paymentAmount} (Payable less any payment adjustment.) - */ - public ClaimResponse setPaymentAmount(Money value) { - this.paymentAmount = value; - return this; - } - - /** - * @return {@link #paymentRef} (Payment identifer.) - */ - public Identifier getPaymentRef() { - if (this.paymentRef == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.paymentRef"); - else if (Configuration.doAutoCreate()) - this.paymentRef = new Identifier(); // cc - return this.paymentRef; - } - - public boolean hasPaymentRef() { - return this.paymentRef != null && !this.paymentRef.isEmpty(); - } - - /** - * @param value {@link #paymentRef} (Payment identifer.) - */ - public ClaimResponse setPaymentRef(Identifier value) { - this.paymentRef = value; - return this; - } - - /** - * @return {@link #reserved} (Status of funds reservation (For provider, for Patient, None).) - */ - public Coding getReserved() { - if (this.reserved == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.reserved"); - else if (Configuration.doAutoCreate()) - this.reserved = new Coding(); // cc - return this.reserved; - } - - public boolean hasReserved() { - return this.reserved != null && !this.reserved.isEmpty(); - } - - /** - * @param value {@link #reserved} (Status of funds reservation (For provider, for Patient, None).) - */ - public ClaimResponse setReserved(Coding value) { - this.reserved = value; - return this; - } - - /** - * @return {@link #form} (The form to be used for printing the content.) - */ - public Coding getForm() { - if (this.form == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.form"); - else if (Configuration.doAutoCreate()) - this.form = new Coding(); // cc - return this.form; - } - - public boolean hasForm() { - return this.form != null && !this.form.isEmpty(); - } - - /** - * @param value {@link #form} (The form to be used for printing the content.) - */ - public ClaimResponse setForm(Coding value) { - this.form = value; - return this; - } - - /** - * @return {@link #note} (Note text.) - */ - public List getNote() { - if (this.note == null) - this.note = new ArrayList(); - return this.note; - } - - public boolean hasNote() { - if (this.note == null) - return false; - for (NotesComponent item : this.note) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #note} (Note text.) - */ - // syntactic sugar - public NotesComponent addNote() { //3 - NotesComponent t = new NotesComponent(); - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return t; - } - - // syntactic sugar - public ClaimResponse addNote(NotesComponent t) { //3 - if (t == null) - return this; - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return this; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - public List getCoverage() { - if (this.coverage == null) - this.coverage = new ArrayList(); - return this.coverage; - } - - public boolean hasCoverage() { - if (this.coverage == null) - return false; - for (CoverageComponent item : this.coverage) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - // syntactic sugar - public CoverageComponent addCoverage() { //3 - CoverageComponent t = new CoverageComponent(); - if (this.coverage == null) - this.coverage = new ArrayList(); - this.coverage.add(t); - return t; - } - - // syntactic sugar - public ClaimResponse addCoverage(CoverageComponent t) { //3 - if (t == null) - return this; - if (this.coverage == null) - this.coverage = new ArrayList(); - this.coverage.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("request", "Reference(Claim)", "Original request resource referrence.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); - childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); - childrenList.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition)); - childrenList.add(new Property("payeeType", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, payeeType)); - childrenList.add(new Property("item", "", "The first tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("addItem", "", "The first tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, addItem)); - childrenList.add(new Property("error", "", "Mutually exclusive with Services Provided (Item).", 0, java.lang.Integer.MAX_VALUE, error)); - childrenList.add(new Property("totalCost", "Money", "The total cost of the services reported.", 0, java.lang.Integer.MAX_VALUE, totalCost)); - childrenList.add(new Property("unallocDeductable", "Money", "The amount of deductable applied which was not allocated to any particular service line.", 0, java.lang.Integer.MAX_VALUE, unallocDeductable)); - childrenList.add(new Property("totalBenefit", "Money", "Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable).", 0, java.lang.Integer.MAX_VALUE, totalBenefit)); - childrenList.add(new Property("paymentAdjustment", "Money", "Adjustment to the payment of this transaction which is not related to adjudication of this transaction.", 0, java.lang.Integer.MAX_VALUE, paymentAdjustment)); - childrenList.add(new Property("paymentAdjustmentReason", "Coding", "Reason for the payment adjustment.", 0, java.lang.Integer.MAX_VALUE, paymentAdjustmentReason)); - childrenList.add(new Property("paymentDate", "date", "Estimated payment data.", 0, java.lang.Integer.MAX_VALUE, paymentDate)); - childrenList.add(new Property("paymentAmount", "Money", "Payable less any payment adjustment.", 0, java.lang.Integer.MAX_VALUE, paymentAmount)); - childrenList.add(new Property("paymentRef", "Identifier", "Payment identifer.", 0, java.lang.Integer.MAX_VALUE, paymentRef)); - childrenList.add(new Property("reserved", "Coding", "Status of funds reservation (For provider, for Patient, None).", 0, java.lang.Integer.MAX_VALUE, reserved)); - childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); - childrenList.add(new Property("note", "", "Note text.", 0, java.lang.Integer.MAX_VALUE, note)); - childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); - } - - public ClaimResponse copy() { - ClaimResponse dst = new ClaimResponse(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.request = request == null ? null : request.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); - dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.disposition = disposition == null ? null : disposition.copy(); - dst.payeeType = payeeType == null ? null : payeeType.copy(); - if (item != null) { - dst.item = new ArrayList(); - for (ItemsComponent i : item) - dst.item.add(i.copy()); - }; - if (addItem != null) { - dst.addItem = new ArrayList(); - for (AddedItemComponent i : addItem) - dst.addItem.add(i.copy()); - }; - if (error != null) { - dst.error = new ArrayList(); - for (ErrorsComponent i : error) - dst.error.add(i.copy()); - }; - dst.totalCost = totalCost == null ? null : totalCost.copy(); - dst.unallocDeductable = unallocDeductable == null ? null : unallocDeductable.copy(); - dst.totalBenefit = totalBenefit == null ? null : totalBenefit.copy(); - dst.paymentAdjustment = paymentAdjustment == null ? null : paymentAdjustment.copy(); - dst.paymentAdjustmentReason = paymentAdjustmentReason == null ? null : paymentAdjustmentReason.copy(); - dst.paymentDate = paymentDate == null ? null : paymentDate.copy(); - dst.paymentAmount = paymentAmount == null ? null : paymentAmount.copy(); - dst.paymentRef = paymentRef == null ? null : paymentRef.copy(); - dst.reserved = reserved == null ? null : reserved.copy(); - dst.form = form == null ? null : form.copy(); - if (note != null) { - dst.note = new ArrayList(); - for (NotesComponent i : note) - dst.note.add(i.copy()); - }; - if (coverage != null) { - dst.coverage = new ArrayList(); - for (CoverageComponent i : coverage) - dst.coverage.add(i.copy()); - }; - return dst; - } - - protected ClaimResponse typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ClaimResponse)) - return false; - ClaimResponse o = (ClaimResponse) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(ruleset, o.ruleset, true) - && compareDeep(originalRuleset, o.originalRuleset, true) && compareDeep(created, o.created, true) - && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) - && compareDeep(requestOrganization, o.requestOrganization, true) && compareDeep(outcome, o.outcome, true) - && compareDeep(disposition, o.disposition, true) && compareDeep(payeeType, o.payeeType, true) && compareDeep(item, o.item, true) - && compareDeep(addItem, o.addItem, true) && compareDeep(error, o.error, true) && compareDeep(totalCost, o.totalCost, true) - && compareDeep(unallocDeductable, o.unallocDeductable, true) && compareDeep(totalBenefit, o.totalBenefit, true) - && compareDeep(paymentAdjustment, o.paymentAdjustment, true) && compareDeep(paymentAdjustmentReason, o.paymentAdjustmentReason, true) - && compareDeep(paymentDate, o.paymentDate, true) && compareDeep(paymentAmount, o.paymentAmount, true) - && compareDeep(paymentRef, o.paymentRef, true) && compareDeep(reserved, o.reserved, true) && compareDeep(form, o.form, true) - && compareDeep(note, o.note, true) && compareDeep(coverage, o.coverage, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ClaimResponse)) - return false; - ClaimResponse o = (ClaimResponse) other; - return compareValues(created, o.created, true) && compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) - && compareValues(paymentDate, o.paymentDate, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) - && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) - && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) - && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) - && (payeeType == null || payeeType.isEmpty()) && (item == null || item.isEmpty()) && (addItem == null || addItem.isEmpty()) - && (error == null || error.isEmpty()) && (totalCost == null || totalCost.isEmpty()) && (unallocDeductable == null || unallocDeductable.isEmpty()) - && (totalBenefit == null || totalBenefit.isEmpty()) && (paymentAdjustment == null || paymentAdjustment.isEmpty()) - && (paymentAdjustmentReason == null || paymentAdjustmentReason.isEmpty()) && (paymentDate == null || paymentDate.isEmpty()) - && (paymentAmount == null || paymentAmount.isEmpty()) && (paymentRef == null || paymentRef.isEmpty()) - && (reserved == null || reserved.isEmpty()) && (form == null || form.isEmpty()) && (note == null || note.isEmpty()) - && (coverage == null || coverage.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ClaimResponse; - } - - @SearchParamDefinition(name="identifier", path="ClaimResponse.identifier", description="The identity of the insurer", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import java.util.*; + +import java.math.*; +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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * This resource provides the adjudication details from the processing of a Claim resource. + */ +@ResourceDef(name="ClaimResponse", profile="http://hl7.org/fhir/Profile/ClaimResponse") +public class ClaimResponse extends DomainResource { + + public enum RSLink { + /** + * The processing completed without errors. + */ + COMPLETE, + /** + * The processing identified with errors. + */ + ERROR, + /** + * added to help the parsers + */ + NULL; + public static RSLink fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return COMPLETE; + if ("error".equals(codeString)) + return ERROR; + throw new Exception("Unknown RSLink code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case ERROR: return "error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return ""; + case ERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The processing completed without errors."; + case ERROR: return "The processing identified with errors."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "Complete"; + case ERROR: return "Error"; + default: return "?"; + } + } + } + + public static class RSLinkEnumFactory implements EnumFactory { + public RSLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return RSLink.COMPLETE; + if ("error".equals(codeString)) + return RSLink.ERROR; + throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); + } + public String toCode(RSLink code) { + if (code == RSLink.COMPLETE) + return "complete"; + if (code == RSLink.ERROR) + return "error"; + return "?"; + } + } + + @Block() + public static class ItemsComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A service line number. + */ + @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected PositiveIntType sequenceLinkId; + + /** + * A list of note references to the notes provided below. + */ + @Child(name = "noteNumber", type = {PositiveIntType.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of note numbers which apply", formalDefinition="A list of note references to the notes provided below." ) + protected List noteNumber; + + /** + * The adjudications results. + */ + @Child(name = "adjudication", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Adjudication details", formalDefinition="The adjudications results." ) + protected List adjudication; + + /** + * The second tier service adjudications for submitted services. + */ + @Child(name = "detail", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Detail line items", formalDefinition="The second tier service adjudications for submitted services." ) + protected List detail; + + private static final long serialVersionUID = -1917866697L; + + /* + * Constructor + */ + public ItemsComponent() { + super(); + } + + /* + * Constructor + */ + public ItemsComponent(PositiveIntType sequenceLinkId) { + super(); + this.sequenceLinkId = sequenceLinkId; + } + + /** + * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public PositiveIntType getSequenceLinkIdElement() { + if (this.sequenceLinkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.sequenceLinkId"); + else if (Configuration.doAutoCreate()) + this.sequenceLinkId = new PositiveIntType(); // bb + return this.sequenceLinkId; + } + + public boolean hasSequenceLinkIdElement() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + public boolean hasSequenceLinkId() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + /** + * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public ItemsComponent setSequenceLinkIdElement(PositiveIntType value) { + this.sequenceLinkId = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequenceLinkId() { + return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemsComponent setSequenceLinkId(int value) { + if (this.sequenceLinkId == null) + this.sequenceLinkId = new PositiveIntType(); + this.sequenceLinkId.setValue(value); + return this; + } + + /** + * @return {@link #noteNumber} (A list of note references to the notes provided below.) + */ + public List getNoteNumber() { + if (this.noteNumber == null) + this.noteNumber = new ArrayList(); + return this.noteNumber; + } + + public boolean hasNoteNumber() { + if (this.noteNumber == null) + return false; + for (PositiveIntType item : this.noteNumber) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #noteNumber} (A list of note references to the notes provided below.) + */ + // syntactic sugar + public PositiveIntType addNoteNumberElement() {//2 + PositiveIntType t = new PositiveIntType(); + if (this.noteNumber == null) + this.noteNumber = new ArrayList(); + this.noteNumber.add(t); + return t; + } + + /** + * @param value {@link #noteNumber} (A list of note references to the notes provided below.) + */ + public ItemsComponent addNoteNumber(int value) { //1 + PositiveIntType t = new PositiveIntType(); + t.setValue(value); + if (this.noteNumber == null) + this.noteNumber = new ArrayList(); + this.noteNumber.add(t); + return this; + } + + /** + * @param value {@link #noteNumber} (A list of note references to the notes provided below.) + */ + public boolean hasNoteNumber(int value) { + if (this.noteNumber == null) + return false; + for (PositiveIntType v : this.noteNumber) + if (v.equals(value)) // positiveInt + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + public List getAdjudication() { + if (this.adjudication == null) + this.adjudication = new ArrayList(); + return this.adjudication; + } + + public boolean hasAdjudication() { + if (this.adjudication == null) + return false; + for (ItemAdjudicationComponent item : this.adjudication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + // syntactic sugar + public ItemAdjudicationComponent addAdjudication() { //3 + ItemAdjudicationComponent t = new ItemAdjudicationComponent(); + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return t; + } + + // syntactic sugar + public ItemsComponent addAdjudication(ItemAdjudicationComponent t) { //3 + if (t == null) + return this; + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return this; + } + + /** + * @return {@link #detail} (The second tier service adjudications for submitted services.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (ItemDetailComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (The second tier service adjudications for submitted services.) + */ + // syntactic sugar + public ItemDetailComponent addDetail() { //3 + ItemDetailComponent t = new ItemDetailComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + // syntactic sugar + public ItemsComponent addDetail(ItemDetailComponent t) { //3 + if (t == null) + return this; + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequenceLinkId", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); + childrenList.add(new Property("noteNumber", "positiveInt", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumber)); + childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); + childrenList.add(new Property("detail", "", "The second tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public ItemsComponent copy() { + ItemsComponent dst = new ItemsComponent(); + copyValues(dst); + dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); + if (noteNumber != null) { + dst.noteNumber = new ArrayList(); + for (PositiveIntType i : noteNumber) + dst.noteNumber.add(i.copy()); + }; + if (adjudication != null) { + dst.adjudication = new ArrayList(); + for (ItemAdjudicationComponent i : adjudication) + dst.adjudication.add(i.copy()); + }; + if (detail != null) { + dst.detail = new ArrayList(); + for (ItemDetailComponent i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ItemsComponent)) + return false; + ItemsComponent o = (ItemsComponent) other; + return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(noteNumber, o.noteNumber, true) + && compareDeep(adjudication, o.adjudication, true) && compareDeep(detail, o.detail, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ItemsComponent)) + return false; + ItemsComponent o = (ItemsComponent) other; + return compareValues(sequenceLinkId, o.sequenceLinkId, true) && compareValues(noteNumber, o.noteNumber, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (noteNumber == null || noteNumber.isEmpty()) + && (adjudication == null || adjudication.isEmpty()) && (detail == null || detail.isEmpty()) + ; + } + + } + + @Block() + public static class ItemAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. + */ + @Child(name = "code", type = {Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) + protected Coding code; + + /** + * Monitory amount associated with the code. + */ + @Child(name = "amount", type = {Money.class}, order=2, min=0, max=1) + @Description(shortDefinition="Monetary amount", formalDefinition="Monitory amount associated with the code." ) + protected Money amount; + + /** + * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + @Child(name = "value", type = {DecimalType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) + protected DecimalType value; + + private static final long serialVersionUID = -949880587L; + + /* + * Constructor + */ + public ItemAdjudicationComponent() { + super(); + } + + /* + * Constructor + */ + public ItemAdjudicationComponent(Coding code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public Coding getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemAdjudicationComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Coding(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public ItemAdjudicationComponent setCode(Coding value) { + this.code = value; + return this; + } + + /** + * @return {@link #amount} (Monitory amount associated with the code.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemAdjudicationComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Monitory amount associated with the code.) + */ + public ItemAdjudicationComponent setAmount(Money value) { + this.amount = value; + return this; + } + + /** + * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemAdjudicationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public ItemAdjudicationComponent setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public ItemAdjudicationComponent setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); + childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public ItemAdjudicationComponent copy() { + ItemAdjudicationComponent dst = new ItemAdjudicationComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.amount = amount == null ? null : amount.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ItemAdjudicationComponent)) + return false; + ItemAdjudicationComponent o = (ItemAdjudicationComponent) other; + return compareDeep(code, o.code, true) && compareDeep(amount, o.amount, true) && compareDeep(value, o.value, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ItemAdjudicationComponent)) + return false; + ItemAdjudicationComponent o = (ItemAdjudicationComponent) other; + return compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (amount == null || amount.isEmpty()) + && (value == null || value.isEmpty()); + } + + } + + @Block() + public static class ItemDetailComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A service line number. + */ + @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected PositiveIntType sequenceLinkId; + + /** + * The adjudications results. + */ + @Child(name = "adjudication", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Detail adjudication", formalDefinition="The adjudications results." ) + protected List adjudication; + + /** + * The third tier service adjudications for submitted services. + */ + @Child(name = "subDetail", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Subdetail line items", formalDefinition="The third tier service adjudications for submitted services." ) + protected List subDetail; + + private static final long serialVersionUID = -1751018357L; + + /* + * Constructor + */ + public ItemDetailComponent() { + super(); + } + + /* + * Constructor + */ + public ItemDetailComponent(PositiveIntType sequenceLinkId) { + super(); + this.sequenceLinkId = sequenceLinkId; + } + + /** + * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public PositiveIntType getSequenceLinkIdElement() { + if (this.sequenceLinkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemDetailComponent.sequenceLinkId"); + else if (Configuration.doAutoCreate()) + this.sequenceLinkId = new PositiveIntType(); // bb + return this.sequenceLinkId; + } + + public boolean hasSequenceLinkIdElement() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + public boolean hasSequenceLinkId() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + /** + * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public ItemDetailComponent setSequenceLinkIdElement(PositiveIntType value) { + this.sequenceLinkId = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequenceLinkId() { + return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemDetailComponent setSequenceLinkId(int value) { + if (this.sequenceLinkId == null) + this.sequenceLinkId = new PositiveIntType(); + this.sequenceLinkId.setValue(value); + return this; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + public List getAdjudication() { + if (this.adjudication == null) + this.adjudication = new ArrayList(); + return this.adjudication; + } + + public boolean hasAdjudication() { + if (this.adjudication == null) + return false; + for (DetailAdjudicationComponent item : this.adjudication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + // syntactic sugar + public DetailAdjudicationComponent addAdjudication() { //3 + DetailAdjudicationComponent t = new DetailAdjudicationComponent(); + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return t; + } + + // syntactic sugar + public ItemDetailComponent addAdjudication(DetailAdjudicationComponent t) { //3 + if (t == null) + return this; + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return this; + } + + /** + * @return {@link #subDetail} (The third tier service adjudications for submitted services.) + */ + public List getSubDetail() { + if (this.subDetail == null) + this.subDetail = new ArrayList(); + return this.subDetail; + } + + public boolean hasSubDetail() { + if (this.subDetail == null) + return false; + for (SubDetailComponent item : this.subDetail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subDetail} (The third tier service adjudications for submitted services.) + */ + // syntactic sugar + public SubDetailComponent addSubDetail() { //3 + SubDetailComponent t = new SubDetailComponent(); + if (this.subDetail == null) + this.subDetail = new ArrayList(); + this.subDetail.add(t); + return t; + } + + // syntactic sugar + public ItemDetailComponent addSubDetail(SubDetailComponent t) { //3 + if (t == null) + return this; + if (this.subDetail == null) + this.subDetail = new ArrayList(); + this.subDetail.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequenceLinkId", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); + childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); + childrenList.add(new Property("subDetail", "", "The third tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); + } + + public ItemDetailComponent copy() { + ItemDetailComponent dst = new ItemDetailComponent(); + copyValues(dst); + dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); + if (adjudication != null) { + dst.adjudication = new ArrayList(); + for (DetailAdjudicationComponent i : adjudication) + dst.adjudication.add(i.copy()); + }; + if (subDetail != null) { + dst.subDetail = new ArrayList(); + for (SubDetailComponent i : subDetail) + dst.subDetail.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ItemDetailComponent)) + return false; + ItemDetailComponent o = (ItemDetailComponent) other; + return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(adjudication, o.adjudication, true) + && compareDeep(subDetail, o.subDetail, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ItemDetailComponent)) + return false; + ItemDetailComponent o = (ItemDetailComponent) other; + return compareValues(sequenceLinkId, o.sequenceLinkId, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (adjudication == null || adjudication.isEmpty()) + && (subDetail == null || subDetail.isEmpty()); + } + + } + + @Block() + public static class DetailAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. + */ + @Child(name = "code", type = {Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) + protected Coding code; + + /** + * Monitory amount associated with the code. + */ + @Child(name = "amount", type = {Money.class}, order=2, min=0, max=1) + @Description(shortDefinition="Monetary amount", formalDefinition="Monitory amount associated with the code." ) + protected Money amount; + + /** + * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + @Child(name = "value", type = {DecimalType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) + protected DecimalType value; + + private static final long serialVersionUID = -949880587L; + + /* + * Constructor + */ + public DetailAdjudicationComponent() { + super(); + } + + /* + * Constructor + */ + public DetailAdjudicationComponent(Coding code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public Coding getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailAdjudicationComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Coding(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public DetailAdjudicationComponent setCode(Coding value) { + this.code = value; + return this; + } + + /** + * @return {@link #amount} (Monitory amount associated with the code.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailAdjudicationComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Monitory amount associated with the code.) + */ + public DetailAdjudicationComponent setAmount(Money value) { + this.amount = value; + return this; + } + + /** + * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailAdjudicationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DetailAdjudicationComponent setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public DetailAdjudicationComponent setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); + childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public DetailAdjudicationComponent copy() { + DetailAdjudicationComponent dst = new DetailAdjudicationComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.amount = amount == null ? null : amount.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DetailAdjudicationComponent)) + return false; + DetailAdjudicationComponent o = (DetailAdjudicationComponent) other; + return compareDeep(code, o.code, true) && compareDeep(amount, o.amount, true) && compareDeep(value, o.value, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DetailAdjudicationComponent)) + return false; + DetailAdjudicationComponent o = (DetailAdjudicationComponent) other; + return compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (amount == null || amount.isEmpty()) + && (value == null || value.isEmpty()); + } + + } + + @Block() + public static class SubDetailComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A service line number. + */ + @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected PositiveIntType sequenceLinkId; + + /** + * The adjudications results. + */ + @Child(name = "adjudication", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Subdetail adjudication", formalDefinition="The adjudications results." ) + protected List adjudication; + + private static final long serialVersionUID = 1780202110L; + + /* + * Constructor + */ + public SubDetailComponent() { + super(); + } + + /* + * Constructor + */ + public SubDetailComponent(PositiveIntType sequenceLinkId) { + super(); + this.sequenceLinkId = sequenceLinkId; + } + + /** + * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public PositiveIntType getSequenceLinkIdElement() { + if (this.sequenceLinkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.sequenceLinkId"); + else if (Configuration.doAutoCreate()) + this.sequenceLinkId = new PositiveIntType(); // bb + return this.sequenceLinkId; + } + + public boolean hasSequenceLinkIdElement() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + public boolean hasSequenceLinkId() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + /** + * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public SubDetailComponent setSequenceLinkIdElement(PositiveIntType value) { + this.sequenceLinkId = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequenceLinkId() { + return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue(); + } + + /** + * @param value A service line number. + */ + public SubDetailComponent setSequenceLinkId(int value) { + if (this.sequenceLinkId == null) + this.sequenceLinkId = new PositiveIntType(); + this.sequenceLinkId.setValue(value); + return this; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + public List getAdjudication() { + if (this.adjudication == null) + this.adjudication = new ArrayList(); + return this.adjudication; + } + + public boolean hasAdjudication() { + if (this.adjudication == null) + return false; + for (SubdetailAdjudicationComponent item : this.adjudication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + // syntactic sugar + public SubdetailAdjudicationComponent addAdjudication() { //3 + SubdetailAdjudicationComponent t = new SubdetailAdjudicationComponent(); + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return t; + } + + // syntactic sugar + public SubDetailComponent addAdjudication(SubdetailAdjudicationComponent t) { //3 + if (t == null) + return this; + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequenceLinkId", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); + childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); + } + + public SubDetailComponent copy() { + SubDetailComponent dst = new SubDetailComponent(); + copyValues(dst); + dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); + if (adjudication != null) { + dst.adjudication = new ArrayList(); + for (SubdetailAdjudicationComponent i : adjudication) + dst.adjudication.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SubDetailComponent)) + return false; + SubDetailComponent o = (SubDetailComponent) other; + return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(adjudication, o.adjudication, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SubDetailComponent)) + return false; + SubDetailComponent o = (SubDetailComponent) other; + return compareValues(sequenceLinkId, o.sequenceLinkId, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (adjudication == null || adjudication.isEmpty()) + ; + } + + } + + @Block() + public static class SubdetailAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. + */ + @Child(name = "code", type = {Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) + protected Coding code; + + /** + * Monitory amount associated with the code. + */ + @Child(name = "amount", type = {Money.class}, order=2, min=0, max=1) + @Description(shortDefinition="Monetary amount", formalDefinition="Monitory amount associated with the code." ) + protected Money amount; + + /** + * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + @Child(name = "value", type = {DecimalType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) + protected DecimalType value; + + private static final long serialVersionUID = -949880587L; + + /* + * Constructor + */ + public SubdetailAdjudicationComponent() { + super(); + } + + /* + * Constructor + */ + public SubdetailAdjudicationComponent(Coding code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public Coding getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Coding(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public SubdetailAdjudicationComponent setCode(Coding value) { + this.code = value; + return this; + } + + /** + * @return {@link #amount} (Monitory amount associated with the code.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Monitory amount associated with the code.) + */ + public SubdetailAdjudicationComponent setAmount(Money value) { + this.amount = value; + return this; + } + + /** + * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public SubdetailAdjudicationComponent setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public SubdetailAdjudicationComponent setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); + childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public SubdetailAdjudicationComponent copy() { + SubdetailAdjudicationComponent dst = new SubdetailAdjudicationComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.amount = amount == null ? null : amount.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SubdetailAdjudicationComponent)) + return false; + SubdetailAdjudicationComponent o = (SubdetailAdjudicationComponent) other; + return compareDeep(code, o.code, true) && compareDeep(amount, o.amount, true) && compareDeep(value, o.value, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SubdetailAdjudicationComponent)) + return false; + SubdetailAdjudicationComponent o = (SubdetailAdjudicationComponent) other; + return compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (amount == null || amount.isEmpty()) + && (value == null || value.isEmpty()); + } + + } + + @Block() + public static class AddedItemComponent extends BackboneElement implements IBaseBackboneElement { + /** + * List of input service items which this service line is intended to replace. + */ + @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Service instances", formalDefinition="List of input service items which this service line is intended to replace." ) + protected List sequenceLinkId; + + /** + * A code to indicate the Professional Service or Product supplied. + */ + @Child(name = "service", type = {Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group, Service or Product", formalDefinition="A code to indicate the Professional Service or Product supplied." ) + protected Coding service; + + /** + * The fee charged for the professional service or product.. + */ + @Child(name = "fee", type = {Money.class}, order=3, min=0, max=1) + @Description(shortDefinition="Professional fee or Product charge", formalDefinition="The fee charged for the professional service or product.." ) + protected Money fee; + + /** + * A list of note references to the notes provided below. + */ + @Child(name = "noteNumberLinkId", type = {PositiveIntType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of note numbers which apply", formalDefinition="A list of note references to the notes provided below." ) + protected List noteNumberLinkId; + + /** + * The adjudications results. + */ + @Child(name = "adjudication", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Added items adjudication", formalDefinition="The adjudications results." ) + protected List adjudication; + + /** + * The second tier service adjudications for payor added services. + */ + @Child(name = "detail", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Added items details", formalDefinition="The second tier service adjudications for payor added services." ) + protected List detail; + + private static final long serialVersionUID = -1675935854L; + + /* + * Constructor + */ + public AddedItemComponent() { + super(); + } + + /* + * Constructor + */ + public AddedItemComponent(Coding service) { + super(); + this.service = service; + } + + /** + * @return {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) + */ + public List getSequenceLinkId() { + if (this.sequenceLinkId == null) + this.sequenceLinkId = new ArrayList(); + return this.sequenceLinkId; + } + + public boolean hasSequenceLinkId() { + if (this.sequenceLinkId == null) + return false; + for (PositiveIntType item : this.sequenceLinkId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) + */ + // syntactic sugar + public PositiveIntType addSequenceLinkIdElement() {//2 + PositiveIntType t = new PositiveIntType(); + if (this.sequenceLinkId == null) + this.sequenceLinkId = new ArrayList(); + this.sequenceLinkId.add(t); + return t; + } + + /** + * @param value {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) + */ + public AddedItemComponent addSequenceLinkId(int value) { //1 + PositiveIntType t = new PositiveIntType(); + t.setValue(value); + if (this.sequenceLinkId == null) + this.sequenceLinkId = new ArrayList(); + this.sequenceLinkId.add(t); + return this; + } + + /** + * @param value {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) + */ + public boolean hasSequenceLinkId(int value) { + if (this.sequenceLinkId == null) + return false; + for (PositiveIntType v : this.sequenceLinkId) + if (v.equals(value)) // positiveInt + return true; + return false; + } + + /** + * @return {@link #service} (A code to indicate the Professional Service or Product supplied.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); // cc + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (A code to indicate the Professional Service or Product supplied.) + */ + public AddedItemComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #fee} (The fee charged for the professional service or product..) + */ + public Money getFee() { + if (this.fee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemComponent.fee"); + else if (Configuration.doAutoCreate()) + this.fee = new Money(); // cc + return this.fee; + } + + public boolean hasFee() { + return this.fee != null && !this.fee.isEmpty(); + } + + /** + * @param value {@link #fee} (The fee charged for the professional service or product..) + */ + public AddedItemComponent setFee(Money value) { + this.fee = value; + return this; + } + + /** + * @return {@link #noteNumberLinkId} (A list of note references to the notes provided below.) + */ + public List getNoteNumberLinkId() { + if (this.noteNumberLinkId == null) + this.noteNumberLinkId = new ArrayList(); + return this.noteNumberLinkId; + } + + public boolean hasNoteNumberLinkId() { + if (this.noteNumberLinkId == null) + return false; + for (PositiveIntType item : this.noteNumberLinkId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #noteNumberLinkId} (A list of note references to the notes provided below.) + */ + // syntactic sugar + public PositiveIntType addNoteNumberLinkIdElement() {//2 + PositiveIntType t = new PositiveIntType(); + if (this.noteNumberLinkId == null) + this.noteNumberLinkId = new ArrayList(); + this.noteNumberLinkId.add(t); + return t; + } + + /** + * @param value {@link #noteNumberLinkId} (A list of note references to the notes provided below.) + */ + public AddedItemComponent addNoteNumberLinkId(int value) { //1 + PositiveIntType t = new PositiveIntType(); + t.setValue(value); + if (this.noteNumberLinkId == null) + this.noteNumberLinkId = new ArrayList(); + this.noteNumberLinkId.add(t); + return this; + } + + /** + * @param value {@link #noteNumberLinkId} (A list of note references to the notes provided below.) + */ + public boolean hasNoteNumberLinkId(int value) { + if (this.noteNumberLinkId == null) + return false; + for (PositiveIntType v : this.noteNumberLinkId) + if (v.equals(value)) // positiveInt + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + public List getAdjudication() { + if (this.adjudication == null) + this.adjudication = new ArrayList(); + return this.adjudication; + } + + public boolean hasAdjudication() { + if (this.adjudication == null) + return false; + for (AddedItemAdjudicationComponent item : this.adjudication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + // syntactic sugar + public AddedItemAdjudicationComponent addAdjudication() { //3 + AddedItemAdjudicationComponent t = new AddedItemAdjudicationComponent(); + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return t; + } + + // syntactic sugar + public AddedItemComponent addAdjudication(AddedItemAdjudicationComponent t) { //3 + if (t == null) + return this; + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return this; + } + + /** + * @return {@link #detail} (The second tier service adjudications for payor added services.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (AddedItemsDetailComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (The second tier service adjudications for payor added services.) + */ + // syntactic sugar + public AddedItemsDetailComponent addDetail() { //3 + AddedItemsDetailComponent t = new AddedItemsDetailComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + // syntactic sugar + public AddedItemComponent addDetail(AddedItemsDetailComponent t) { //3 + if (t == null) + return this; + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequenceLinkId", "positiveInt", "List of input service items which this service line is intended to replace.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); + childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product..", 0, java.lang.Integer.MAX_VALUE, fee)); + childrenList.add(new Property("noteNumberLinkId", "positiveInt", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumberLinkId)); + childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); + childrenList.add(new Property("detail", "", "The second tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public AddedItemComponent copy() { + AddedItemComponent dst = new AddedItemComponent(); + copyValues(dst); + if (sequenceLinkId != null) { + dst.sequenceLinkId = new ArrayList(); + for (PositiveIntType i : sequenceLinkId) + dst.sequenceLinkId.add(i.copy()); + }; + dst.service = service == null ? null : service.copy(); + dst.fee = fee == null ? null : fee.copy(); + if (noteNumberLinkId != null) { + dst.noteNumberLinkId = new ArrayList(); + for (PositiveIntType i : noteNumberLinkId) + dst.noteNumberLinkId.add(i.copy()); + }; + if (adjudication != null) { + dst.adjudication = new ArrayList(); + for (AddedItemAdjudicationComponent i : adjudication) + dst.adjudication.add(i.copy()); + }; + if (detail != null) { + dst.detail = new ArrayList(); + for (AddedItemsDetailComponent i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AddedItemComponent)) + return false; + AddedItemComponent o = (AddedItemComponent) other; + return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(service, o.service, true) + && compareDeep(fee, o.fee, true) && compareDeep(noteNumberLinkId, o.noteNumberLinkId, true) && compareDeep(adjudication, o.adjudication, true) + && compareDeep(detail, o.detail, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AddedItemComponent)) + return false; + AddedItemComponent o = (AddedItemComponent) other; + return compareValues(sequenceLinkId, o.sequenceLinkId, true) && compareValues(noteNumberLinkId, o.noteNumberLinkId, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (service == null || service.isEmpty()) + && (fee == null || fee.isEmpty()) && (noteNumberLinkId == null || noteNumberLinkId.isEmpty()) + && (adjudication == null || adjudication.isEmpty()) && (detail == null || detail.isEmpty()) + ; + } + + } + + @Block() + public static class AddedItemAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. + */ + @Child(name = "code", type = {Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) + protected Coding code; + + /** + * Monitory amount associated with the code. + */ + @Child(name = "amount", type = {Money.class}, order=2, min=0, max=1) + @Description(shortDefinition="Monetary amount", formalDefinition="Monitory amount associated with the code." ) + protected Money amount; + + /** + * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + @Child(name = "value", type = {DecimalType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) + protected DecimalType value; + + private static final long serialVersionUID = -949880587L; + + /* + * Constructor + */ + public AddedItemAdjudicationComponent() { + super(); + } + + /* + * Constructor + */ + public AddedItemAdjudicationComponent(Coding code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public Coding getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Coding(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public AddedItemAdjudicationComponent setCode(Coding value) { + this.code = value; + return this; + } + + /** + * @return {@link #amount} (Monitory amount associated with the code.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Monitory amount associated with the code.) + */ + public AddedItemAdjudicationComponent setAmount(Money value) { + this.amount = value; + return this; + } + + /** + * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public AddedItemAdjudicationComponent setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public AddedItemAdjudicationComponent setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); + childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public AddedItemAdjudicationComponent copy() { + AddedItemAdjudicationComponent dst = new AddedItemAdjudicationComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.amount = amount == null ? null : amount.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AddedItemAdjudicationComponent)) + return false; + AddedItemAdjudicationComponent o = (AddedItemAdjudicationComponent) other; + return compareDeep(code, o.code, true) && compareDeep(amount, o.amount, true) && compareDeep(value, o.value, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AddedItemAdjudicationComponent)) + return false; + AddedItemAdjudicationComponent o = (AddedItemAdjudicationComponent) other; + return compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (amount == null || amount.isEmpty()) + && (value == null || value.isEmpty()); + } + + } + + @Block() + public static class AddedItemsDetailComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A code to indicate the Professional Service or Product supplied. + */ + @Child(name = "service", type = {Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service or Product", formalDefinition="A code to indicate the Professional Service or Product supplied." ) + protected Coding service; + + /** + * The fee charged for the professional service or product.. + */ + @Child(name = "fee", type = {Money.class}, order=2, min=0, max=1) + @Description(shortDefinition="Professional fee or Product charge", formalDefinition="The fee charged for the professional service or product.." ) + protected Money fee; + + /** + * The adjudications results. + */ + @Child(name = "adjudication", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Added items detail adjudication", formalDefinition="The adjudications results." ) + protected List adjudication; + + private static final long serialVersionUID = -2104242020L; + + /* + * Constructor + */ + public AddedItemsDetailComponent() { + super(); + } + + /* + * Constructor + */ + public AddedItemsDetailComponent(Coding service) { + super(); + this.service = service; + } + + /** + * @return {@link #service} (A code to indicate the Professional Service or Product supplied.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemsDetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); // cc + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (A code to indicate the Professional Service or Product supplied.) + */ + public AddedItemsDetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #fee} (The fee charged for the professional service or product..) + */ + public Money getFee() { + if (this.fee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemsDetailComponent.fee"); + else if (Configuration.doAutoCreate()) + this.fee = new Money(); // cc + return this.fee; + } + + public boolean hasFee() { + return this.fee != null && !this.fee.isEmpty(); + } + + /** + * @param value {@link #fee} (The fee charged for the professional service or product..) + */ + public AddedItemsDetailComponent setFee(Money value) { + this.fee = value; + return this; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + public List getAdjudication() { + if (this.adjudication == null) + this.adjudication = new ArrayList(); + return this.adjudication; + } + + public boolean hasAdjudication() { + if (this.adjudication == null) + return false; + for (AddedItemDetailAdjudicationComponent item : this.adjudication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + // syntactic sugar + public AddedItemDetailAdjudicationComponent addAdjudication() { //3 + AddedItemDetailAdjudicationComponent t = new AddedItemDetailAdjudicationComponent(); + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return t; + } + + // syntactic sugar + public AddedItemsDetailComponent addAdjudication(AddedItemDetailAdjudicationComponent t) { //3 + if (t == null) + return this; + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product..", 0, java.lang.Integer.MAX_VALUE, fee)); + childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); + } + + public AddedItemsDetailComponent copy() { + AddedItemsDetailComponent dst = new AddedItemsDetailComponent(); + copyValues(dst); + dst.service = service == null ? null : service.copy(); + dst.fee = fee == null ? null : fee.copy(); + if (adjudication != null) { + dst.adjudication = new ArrayList(); + for (AddedItemDetailAdjudicationComponent i : adjudication) + dst.adjudication.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AddedItemsDetailComponent)) + return false; + AddedItemsDetailComponent o = (AddedItemsDetailComponent) other; + return compareDeep(service, o.service, true) && compareDeep(fee, o.fee, true) && compareDeep(adjudication, o.adjudication, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AddedItemsDetailComponent)) + return false; + AddedItemsDetailComponent o = (AddedItemsDetailComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (service == null || service.isEmpty()) && (fee == null || fee.isEmpty()) + && (adjudication == null || adjudication.isEmpty()); + } + + } + + @Block() + public static class AddedItemDetailAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. + */ + @Child(name = "code", type = {Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) + protected Coding code; + + /** + * Monitory amount associated with the code. + */ + @Child(name = "amount", type = {Money.class}, order=2, min=0, max=1) + @Description(shortDefinition="Monetary amount", formalDefinition="Monitory amount associated with the code." ) + protected Money amount; + + /** + * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + @Child(name = "value", type = {DecimalType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) + protected DecimalType value; + + private static final long serialVersionUID = -949880587L; + + /* + * Constructor + */ + public AddedItemDetailAdjudicationComponent() { + super(); + } + + /* + * Constructor + */ + public AddedItemDetailAdjudicationComponent(Coding code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public Coding getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Coding(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public AddedItemDetailAdjudicationComponent setCode(Coding value) { + this.code = value; + return this; + } + + /** + * @return {@link #amount} (Monitory amount associated with the code.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Monitory amount associated with the code.) + */ + public AddedItemDetailAdjudicationComponent setAmount(Money value) { + this.amount = value; + return this; + } + + /** + * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public AddedItemDetailAdjudicationComponent setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public AddedItemDetailAdjudicationComponent setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); + childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public AddedItemDetailAdjudicationComponent copy() { + AddedItemDetailAdjudicationComponent dst = new AddedItemDetailAdjudicationComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.amount = amount == null ? null : amount.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AddedItemDetailAdjudicationComponent)) + return false; + AddedItemDetailAdjudicationComponent o = (AddedItemDetailAdjudicationComponent) other; + return compareDeep(code, o.code, true) && compareDeep(amount, o.amount, true) && compareDeep(value, o.value, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AddedItemDetailAdjudicationComponent)) + return false; + AddedItemDetailAdjudicationComponent o = (AddedItemDetailAdjudicationComponent) other; + return compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (amount == null || amount.isEmpty()) + && (value == null || value.isEmpty()); + } + + } + + @Block() + public static class ErrorsComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere. + */ + @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Item sequence number", formalDefinition="The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere." ) + protected PositiveIntType sequenceLinkId; + + /** + * The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. + */ + @Child(name = "detailSequenceLinkId", type = {PositiveIntType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Detail sequence number", formalDefinition="The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition." ) + protected PositiveIntType detailSequenceLinkId; + + /** + * The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. + */ + @Child(name = "subdetailSequenceLinkId", type = {PositiveIntType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Subdetail sequence number", formalDefinition="The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition." ) + protected PositiveIntType subdetailSequenceLinkId; + + /** + * An error code,froma specified code system, which details why the claim could not be adjudicated. + */ + @Child(name = "code", type = {Coding.class}, order=4, min=1, max=1) + @Description(shortDefinition="Error code detailing processing issues", formalDefinition="An error code,froma specified code system, which details why the claim could not be adjudicated." ) + protected Coding code; + + private static final long serialVersionUID = -1893641175L; + + /* + * Constructor + */ + public ErrorsComponent() { + super(); + } + + /* + * Constructor + */ + public ErrorsComponent(Coding code) { + super(); + this.code = code; + } + + /** + * @return {@link #sequenceLinkId} (The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public PositiveIntType getSequenceLinkIdElement() { + if (this.sequenceLinkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ErrorsComponent.sequenceLinkId"); + else if (Configuration.doAutoCreate()) + this.sequenceLinkId = new PositiveIntType(); // bb + return this.sequenceLinkId; + } + + public boolean hasSequenceLinkIdElement() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + public boolean hasSequenceLinkId() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + /** + * @param value {@link #sequenceLinkId} (The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public ErrorsComponent setSequenceLinkIdElement(PositiveIntType value) { + this.sequenceLinkId = value; + return this; + } + + /** + * @return The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere. + */ + public int getSequenceLinkId() { + return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue(); + } + + /** + * @param value The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere. + */ + public ErrorsComponent setSequenceLinkId(int value) { + if (this.sequenceLinkId == null) + this.sequenceLinkId = new PositiveIntType(); + this.sequenceLinkId.setValue(value); + return this; + } + + /** + * @return {@link #detailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getDetailSequenceLinkId" gives direct access to the value + */ + public PositiveIntType getDetailSequenceLinkIdElement() { + if (this.detailSequenceLinkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ErrorsComponent.detailSequenceLinkId"); + else if (Configuration.doAutoCreate()) + this.detailSequenceLinkId = new PositiveIntType(); // bb + return this.detailSequenceLinkId; + } + + public boolean hasDetailSequenceLinkIdElement() { + return this.detailSequenceLinkId != null && !this.detailSequenceLinkId.isEmpty(); + } + + public boolean hasDetailSequenceLinkId() { + return this.detailSequenceLinkId != null && !this.detailSequenceLinkId.isEmpty(); + } + + /** + * @param value {@link #detailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getDetailSequenceLinkId" gives direct access to the value + */ + public ErrorsComponent setDetailSequenceLinkIdElement(PositiveIntType value) { + this.detailSequenceLinkId = value; + return this; + } + + /** + * @return The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. + */ + public int getDetailSequenceLinkId() { + return this.detailSequenceLinkId == null || this.detailSequenceLinkId.isEmpty() ? 0 : this.detailSequenceLinkId.getValue(); + } + + /** + * @param value The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. + */ + public ErrorsComponent setDetailSequenceLinkId(int value) { + if (this.detailSequenceLinkId == null) + this.detailSequenceLinkId = new PositiveIntType(); + this.detailSequenceLinkId.setValue(value); + return this; + } + + /** + * @return {@link #subdetailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getSubdetailSequenceLinkId" gives direct access to the value + */ + public PositiveIntType getSubdetailSequenceLinkIdElement() { + if (this.subdetailSequenceLinkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ErrorsComponent.subdetailSequenceLinkId"); + else if (Configuration.doAutoCreate()) + this.subdetailSequenceLinkId = new PositiveIntType(); // bb + return this.subdetailSequenceLinkId; + } + + public boolean hasSubdetailSequenceLinkIdElement() { + return this.subdetailSequenceLinkId != null && !this.subdetailSequenceLinkId.isEmpty(); + } + + public boolean hasSubdetailSequenceLinkId() { + return this.subdetailSequenceLinkId != null && !this.subdetailSequenceLinkId.isEmpty(); + } + + /** + * @param value {@link #subdetailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getSubdetailSequenceLinkId" gives direct access to the value + */ + public ErrorsComponent setSubdetailSequenceLinkIdElement(PositiveIntType value) { + this.subdetailSequenceLinkId = value; + return this; + } + + /** + * @return The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. + */ + public int getSubdetailSequenceLinkId() { + return this.subdetailSequenceLinkId == null || this.subdetailSequenceLinkId.isEmpty() ? 0 : this.subdetailSequenceLinkId.getValue(); + } + + /** + * @param value The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. + */ + public ErrorsComponent setSubdetailSequenceLinkId(int value) { + if (this.subdetailSequenceLinkId == null) + this.subdetailSequenceLinkId = new PositiveIntType(); + this.subdetailSequenceLinkId.setValue(value); + return this; + } + + /** + * @return {@link #code} (An error code,froma specified code system, which details why the claim could not be adjudicated.) + */ + public Coding getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ErrorsComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Coding(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (An error code,froma specified code system, which details why the claim could not be adjudicated.) + */ + public ErrorsComponent setCode(Coding value) { + this.code = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequenceLinkId", "positiveInt", "The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); + childrenList.add(new Property("detailSequenceLinkId", "positiveInt", "The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.", 0, java.lang.Integer.MAX_VALUE, detailSequenceLinkId)); + childrenList.add(new Property("subdetailSequenceLinkId", "positiveInt", "The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.", 0, java.lang.Integer.MAX_VALUE, subdetailSequenceLinkId)); + childrenList.add(new Property("code", "Coding", "An error code,froma specified code system, which details why the claim could not be adjudicated.", 0, java.lang.Integer.MAX_VALUE, code)); + } + + public ErrorsComponent copy() { + ErrorsComponent dst = new ErrorsComponent(); + copyValues(dst); + dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); + dst.detailSequenceLinkId = detailSequenceLinkId == null ? null : detailSequenceLinkId.copy(); + dst.subdetailSequenceLinkId = subdetailSequenceLinkId == null ? null : subdetailSequenceLinkId.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ErrorsComponent)) + return false; + ErrorsComponent o = (ErrorsComponent) other; + return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(detailSequenceLinkId, o.detailSequenceLinkId, true) + && compareDeep(subdetailSequenceLinkId, o.subdetailSequenceLinkId, true) && compareDeep(code, o.code, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ErrorsComponent)) + return false; + ErrorsComponent o = (ErrorsComponent) other; + return compareValues(sequenceLinkId, o.sequenceLinkId, true) && compareValues(detailSequenceLinkId, o.detailSequenceLinkId, true) + && compareValues(subdetailSequenceLinkId, o.subdetailSequenceLinkId, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (detailSequenceLinkId == null || detailSequenceLinkId.isEmpty()) + && (subdetailSequenceLinkId == null || subdetailSequenceLinkId.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + } + + @Block() + public static class NotesComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An integer associated with each note which may be referred to from each service line item. + */ + @Child(name = "number", type = {PositiveIntType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Note Number for this note", formalDefinition="An integer associated with each note which may be referred to from each service line item." ) + protected PositiveIntType number; + + /** + * The note purpose: Print/Display. + */ + @Child(name = "type", type = {Coding.class}, order=2, min=0, max=1) + @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) + protected Coding type; + + /** + * The note text. + */ + @Child(name = "text", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Note explanitory text", formalDefinition="The note text." ) + protected StringType text; + + private static final long serialVersionUID = 1768923951L; + + /* + * Constructor + */ + public NotesComponent() { + super(); + } + + /** + * @return {@link #number} (An integer associated with each note which may be referred to from each service line item.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value + */ + public PositiveIntType getNumberElement() { + if (this.number == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NotesComponent.number"); + else if (Configuration.doAutoCreate()) + this.number = new PositiveIntType(); // bb + return this.number; + } + + public boolean hasNumberElement() { + return this.number != null && !this.number.isEmpty(); + } + + public boolean hasNumber() { + return this.number != null && !this.number.isEmpty(); + } + + /** + * @param value {@link #number} (An integer associated with each note which may be referred to from each service line item.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value + */ + public NotesComponent setNumberElement(PositiveIntType value) { + this.number = value; + return this; + } + + /** + * @return An integer associated with each note which may be referred to from each service line item. + */ + public int getNumber() { + return this.number == null || this.number.isEmpty() ? 0 : this.number.getValue(); + } + + /** + * @param value An integer associated with each note which may be referred to from each service line item. + */ + public NotesComponent setNumber(int value) { + if (this.number == null) + this.number = new PositiveIntType(); + this.number.setValue(value); + return this; + } + + /** + * @return {@link #type} (The note purpose: Print/Display.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NotesComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The note purpose: Print/Display.) + */ + public NotesComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NotesComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public NotesComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return The note text. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value The note text. + */ + public NotesComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("number", "positiveInt", "An integer associated with each note which may be referred to from each service line item.", 0, java.lang.Integer.MAX_VALUE, number)); + childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); + } + + public NotesComponent copy() { + NotesComponent dst = new NotesComponent(); + copyValues(dst); + dst.number = number == null ? null : number.copy(); + dst.type = type == null ? null : type.copy(); + dst.text = text == null ? null : text.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NotesComponent)) + return false; + NotesComponent o = (NotesComponent) other; + return compareDeep(number, o.number, true) && compareDeep(type, o.type, true) && compareDeep(text, o.text, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NotesComponent)) + return false; + NotesComponent o = (NotesComponent) other; + return compareValues(number, o.number, true) && compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (number == null || number.isEmpty()) && (type == null || type.isEmpty()) + && (text == null || text.isEmpty()); + } + + } + + @Block() + public static class CoverageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A service line item. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) + protected PositiveIntType sequence; + + /** + * The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. + */ + @Child(name = "focal", type = {BooleanType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated." ) + protected BooleanType focal; + + /** + * Reference to the program or plan identification, underwriter or payor. + */ + @Child(name = "coverage", type = {Coverage.class}, order=3, min=1, max=1) + @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) + protected Reference coverage; + + /** + * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) + */ + protected Coverage coverageTarget; + + /** + * The contract number of a business agreement which describes the terms and conditions. + */ + @Child(name = "businessArrangement", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agreement which describes the terms and conditions." ) + protected StringType businessArrangement; + + /** + * The relationship of the patient to the subscriber. + */ + @Child(name = "relationship", type = {Coding.class}, order=5, min=1, max=1) + @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) + protected Coding relationship; + + /** + * A list of references from the Insurer to which these services pertain. + */ + @Child(name = "preAuthRef", type = {StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) + protected List preAuthRef; + + /** + * The Coverages adjudication details. + */ + @Child(name = "claimResponse", type = {ClaimResponse.class}, order=7, min=0, max=1) + @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." ) + protected Reference claimResponse; + + /** + * The actual object that is the target of the reference (The Coverages adjudication details.) + */ + protected ClaimResponse claimResponseTarget; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=8, 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; + + private static final long serialVersionUID = 621250924L; + + /* + * Constructor + */ + public CoverageComponent() { + super(); + } + + /* + * Constructor + */ + public CoverageComponent(PositiveIntType sequence, BooleanType focal, Reference coverage, Coding relationship) { + super(); + this.sequence = sequence; + this.focal = focal; + this.coverage = coverage; + this.relationship = relationship; + } + + /** + * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public CoverageComponent setSequenceElement(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line item. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value A service line item. + */ + public CoverageComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public BooleanType getFocalElement() { + if (this.focal == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.focal"); + else if (Configuration.doAutoCreate()) + this.focal = new BooleanType(); // bb + return this.focal; + } + + public boolean hasFocalElement() { + return this.focal != null && !this.focal.isEmpty(); + } + + public boolean hasFocal() { + return this.focal != null && !this.focal.isEmpty(); + } + + /** + * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public CoverageComponent setFocalElement(BooleanType value) { + this.focal = value; + return this; + } + + /** + * @return The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. + */ + public boolean getFocal() { + return this.focal == null || this.focal.isEmpty() ? false : this.focal.getValue(); + } + + /** + * @param value The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. + */ + public CoverageComponent setFocal(boolean value) { + if (this.focal == null) + this.focal = new BooleanType(); + this.focal.setValue(value); + return this; + } + + /** + * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public Reference getCoverage() { + if (this.coverage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverage = new Reference(); // cc + return this.coverage; + } + + public boolean hasCoverage() { + return this.coverage != null && !this.coverage.isEmpty(); + } + + /** + * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public CoverageComponent setCoverage(Reference value) { + this.coverage = value; + return this; + } + + /** + * @return {@link #coverage} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) + */ + public Coverage getCoverageTarget() { + if (this.coverageTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverageTarget = new Coverage(); // aa + return this.coverageTarget; + } + + /** + * @param value {@link #coverage} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) + */ + public CoverageComponent setCoverageTarget(Coverage value) { + this.coverageTarget = value; + return this; + } + + /** + * @return {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public StringType getBusinessArrangementElement() { + if (this.businessArrangement == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); + else if (Configuration.doAutoCreate()) + this.businessArrangement = new StringType(); // bb + return this.businessArrangement; + } + + public boolean hasBusinessArrangementElement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + public boolean hasBusinessArrangement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + /** + * @param value {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public CoverageComponent setBusinessArrangementElement(StringType value) { + this.businessArrangement = value; + return this; + } + + /** + * @return The contract number of a business agreement which describes the terms and conditions. + */ + public String getBusinessArrangement() { + return this.businessArrangement == null ? null : this.businessArrangement.getValue(); + } + + /** + * @param value The contract number of a business agreement which describes the terms and conditions. + */ + public CoverageComponent setBusinessArrangement(String value) { + if (Utilities.noString(value)) + this.businessArrangement = null; + else { + if (this.businessArrangement == null) + this.businessArrangement = new StringType(); + this.businessArrangement.setValue(value); + } + return this; + } + + /** + * @return {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public Coding getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new Coding(); // cc + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public CoverageComponent setRelationship(Coding value) { + this.relationship = value; + return this; + } + + /** + * @return {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) + */ + public List getPreAuthRef() { + if (this.preAuthRef == null) + this.preAuthRef = new ArrayList(); + return this.preAuthRef; + } + + public boolean hasPreAuthRef() { + if (this.preAuthRef == null) + return false; + for (StringType item : this.preAuthRef) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) + */ + // syntactic sugar + public StringType addPreAuthRefElement() {//2 + StringType t = new StringType(); + if (this.preAuthRef == null) + this.preAuthRef = new ArrayList(); + this.preAuthRef.add(t); + return t; + } + + /** + * @param value {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) + */ + public CoverageComponent addPreAuthRef(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.preAuthRef == null) + this.preAuthRef = new ArrayList(); + this.preAuthRef.add(t); + return this; + } + + /** + * @param value {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) + */ + public boolean hasPreAuthRef(String value) { + if (this.preAuthRef == null) + return false; + for (StringType v : this.preAuthRef) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #claimResponse} (The Coverages adjudication details.) + */ + public Reference getClaimResponse() { + if (this.claimResponse == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponse = new Reference(); // cc + return this.claimResponse; + } + + public boolean hasClaimResponse() { + return this.claimResponse != null && !this.claimResponse.isEmpty(); + } + + /** + * @param value {@link #claimResponse} (The Coverages adjudication details.) + */ + public CoverageComponent setClaimResponse(Reference value) { + this.claimResponse = value; + return this; + } + + /** + * @return {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.) + */ + public ClaimResponse getClaimResponseTarget() { + if (this.claimResponseTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponseTarget = new ClaimResponse(); // aa + return this.claimResponseTarget; + } + + /** + * @param value {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.) + */ + public CoverageComponent setClaimResponseTarget(ClaimResponse value) { + this.claimResponseTarget = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public CoverageComponent setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "positiveInt", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.", 0, java.lang.Integer.MAX_VALUE, focal)); + childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agreement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); + childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("preAuthRef", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preAuthRef)); + childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); + childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); + } + + public CoverageComponent copy() { + CoverageComponent dst = new CoverageComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.focal = focal == null ? null : focal.copy(); + dst.coverage = coverage == null ? null : coverage.copy(); + dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + if (preAuthRef != null) { + dst.preAuthRef = new ArrayList(); + for (StringType i : preAuthRef) + dst.preAuthRef.add(i.copy()); + }; + dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CoverageComponent)) + return false; + CoverageComponent o = (CoverageComponent) other; + return compareDeep(sequence, o.sequence, true) && compareDeep(focal, o.focal, true) && compareDeep(coverage, o.coverage, true) + && compareDeep(businessArrangement, o.businessArrangement, true) && compareDeep(relationship, o.relationship, true) + && compareDeep(preAuthRef, o.preAuthRef, true) && compareDeep(claimResponse, o.claimResponse, true) + && compareDeep(originalRuleset, o.originalRuleset, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CoverageComponent)) + return false; + CoverageComponent o = (CoverageComponent) other; + return compareValues(sequence, o.sequence, true) && compareValues(focal, o.focal, true) && compareValues(businessArrangement, o.businessArrangement, true) + && compareValues(preAuthRef, o.preAuthRef, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) + && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) + && (relationship == null || relationship.isEmpty()) && (preAuthRef == null || preAuthRef.isEmpty()) + && (claimResponse == null || claimResponse.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) + ; + } + + } + + /** + * The Response Business Identifier. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Response number", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * Original request resource referrence. + */ + @Child(name = "request", type = {Claim.class}, order=1, min=0, max=1) + @Description(shortDefinition="Id of resource triggering adjudication", formalDefinition="Original request resource referrence." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (Original request resource referrence.) + */ + protected Claim requestTarget; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name = "ruleset", type = {Coding.class}, order=2, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=3, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name = "created", type = {DateTimeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateTimeType created; + + /** + * The Insurer who produced this adjudicated response. + */ + @Child(name = "organization", type = {Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) + */ + protected Organization organizationTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name = "requestProvider", type = {Practitioner.class}, order=6, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference requestProvider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner requestProviderTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name = "requestOrganization", type = {Organization.class}, order=7, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference requestOrganization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization requestOrganizationTarget; + + /** + * Transaction status: error, complete. + */ + @Child(name = "outcome", type = {CodeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) + protected Enumeration outcome; + + /** + * A description of the status of the adjudication. + */ + @Child(name = "disposition", type = {StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) + protected StringType disposition; + + /** + * Party to be reimbursed: Subscriber, provider, other. + */ + @Child(name = "payeeType", type = {Coding.class}, order=10, min=0, max=1) + @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) + protected Coding payeeType; + + /** + * The first tier service adjudications for submitted services. + */ + @Child(name = "item", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Line items", formalDefinition="The first tier service adjudications for submitted services." ) + protected List item; + + /** + * The first tier service adjudications for payor added services. + */ + @Child(name = "addItem", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Insurer added line items", formalDefinition="The first tier service adjudications for payor added services." ) + protected List addItem; + + /** + * Mutually exclusive with Services Provided (Item). + */ + @Child(name = "error", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Processing errors", formalDefinition="Mutually exclusive with Services Provided (Item)." ) + protected List error; + + /** + * The total cost of the services reported. + */ + @Child(name = "totalCost", type = {Money.class}, order=14, min=0, max=1) + @Description(shortDefinition="Total Cost of service from the Claim", formalDefinition="The total cost of the services reported." ) + protected Money totalCost; + + /** + * The amount of deductable applied which was not allocated to any particular service line. + */ + @Child(name = "unallocDeductable", type = {Money.class}, order=15, min=0, max=1) + @Description(shortDefinition="Unallocated deductable", formalDefinition="The amount of deductable applied which was not allocated to any particular service line." ) + protected Money unallocDeductable; + + /** + * Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable). + */ + @Child(name = "totalBenefit", type = {Money.class}, order=16, min=0, max=1) + @Description(shortDefinition="Total benefit payable for the Claim", formalDefinition="Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable)." ) + protected Money totalBenefit; + + /** + * Adjustment to the payment of this transaction which is not related to adjudication of this transaction. + */ + @Child(name = "paymentAdjustment", type = {Money.class}, order=17, min=0, max=1) + @Description(shortDefinition="Payment adjustment for non-Claim issues", formalDefinition="Adjustment to the payment of this transaction which is not related to adjudication of this transaction." ) + protected Money paymentAdjustment; + + /** + * Reason for the payment adjustment. + */ + @Child(name = "paymentAdjustmentReason", type = {Coding.class}, order=18, min=0, max=1) + @Description(shortDefinition="Reason for Payment adjustment", formalDefinition="Reason for the payment adjustment." ) + protected Coding paymentAdjustmentReason; + + /** + * Estimated payment data. + */ + @Child(name = "paymentDate", type = {DateType.class}, order=19, min=0, max=1) + @Description(shortDefinition="Expected data of Payment", formalDefinition="Estimated payment data." ) + protected DateType paymentDate; + + /** + * Payable less any payment adjustment. + */ + @Child(name = "paymentAmount", type = {Money.class}, order=20, min=0, max=1) + @Description(shortDefinition="Payment amount", formalDefinition="Payable less any payment adjustment." ) + protected Money paymentAmount; + + /** + * Payment identifer. + */ + @Child(name = "paymentRef", type = {Identifier.class}, order=21, min=0, max=1) + @Description(shortDefinition="Payment identifier", formalDefinition="Payment identifer." ) + protected Identifier paymentRef; + + /** + * Status of funds reservation (For provider, for Patient, None). + */ + @Child(name = "reserved", type = {Coding.class}, order=22, min=0, max=1) + @Description(shortDefinition="Funds reserved status", formalDefinition="Status of funds reservation (For provider, for Patient, None)." ) + protected Coding reserved; + + /** + * The form to be used for printing the content. + */ + @Child(name = "form", type = {Coding.class}, order=23, min=0, max=1) + @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) + protected Coding form; + + /** + * Note text. + */ + @Child(name = "note", type = {}, order=24, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Processing notes", formalDefinition="Note text." ) + protected List note; + + /** + * Financial instrument by which payment information for health care. + */ + @Child(name = "coverage", type = {}, order=25, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) + protected List coverage; + + private static final long serialVersionUID = -1720247756L; + + /* + * Constructor + */ + public ClaimResponse() { + super(); + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public ClaimResponse addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #request} (Original request resource referrence.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); // cc + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request resource referrence.) + */ + public ClaimResponse setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original request resource referrence.) + */ + public Claim getRequestTarget() { + if (this.requestTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.request"); + else if (Configuration.doAutoCreate()) + this.requestTarget = new Claim(); // aa + return this.requestTarget; + } + + /** + * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original request resource referrence.) + */ + public ClaimResponse setRequestTarget(Claim value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public ClaimResponse setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public ClaimResponse setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public ClaimResponse setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when the enclosed suite of services were performed or completed. + */ + public ClaimResponse setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); // cc + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public ClaimResponse setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); // aa + return this.organizationTarget; + } + + /** + * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) + */ + public ClaimResponse setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getRequestProvider() { + if (this.requestProvider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProvider = new Reference(); // cc + return this.requestProvider; + } + + public boolean hasRequestProvider() { + return this.requestProvider != null && !this.requestProvider.isEmpty(); + } + + /** + * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public ClaimResponse setRequestProvider(Reference value) { + this.requestProvider = value; + return this; + } + + /** + * @return {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getRequestProviderTarget() { + if (this.requestProviderTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProviderTarget = new Practitioner(); // aa + return this.requestProviderTarget; + } + + /** + * @param value {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public ClaimResponse setRequestProviderTarget(Practitioner value) { + this.requestProviderTarget = value; + return this; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getRequestOrganization() { + if (this.requestOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganization = new Reference(); // cc + return this.requestOrganization; + } + + public boolean hasRequestOrganization() { + return this.requestOrganization != null && !this.requestOrganization.isEmpty(); + } + + /** + * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public ClaimResponse setRequestOrganization(Reference value) { + this.requestOrganization = value; + return this; + } + + /** + * @return {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) + */ + public Organization getRequestOrganizationTarget() { + if (this.requestOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganizationTarget = new Organization(); // aa + return this.requestOrganizationTarget; + } + + /** + * @param value {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) + */ + public ClaimResponse setRequestOrganizationTarget(Organization value) { + this.requestOrganizationTarget = value; + return this; + } + + /** + * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public Enumeration getOutcomeElement() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new Enumeration(new RSLinkEnumFactory()); // bb + return this.outcome; + } + + public boolean hasOutcomeElement() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public ClaimResponse setOutcomeElement(Enumeration value) { + this.outcome = value; + return this; + } + + /** + * @return Transaction status: error, complete. + */ + public RSLink getOutcome() { + return this.outcome == null ? null : this.outcome.getValue(); + } + + /** + * @param value Transaction status: error, complete. + */ + public ClaimResponse setOutcome(RSLink value) { + if (value == null) + this.outcome = null; + else { + if (this.outcome == null) + this.outcome = new Enumeration(new RSLinkEnumFactory()); + this.outcome.setValue(value); + } + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); // bb + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public ClaimResponse setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication. + */ + public ClaimResponse setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + + /** + * @return {@link #payeeType} (Party to be reimbursed: Subscriber, provider, other.) + */ + public Coding getPayeeType() { + if (this.payeeType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.payeeType"); + else if (Configuration.doAutoCreate()) + this.payeeType = new Coding(); // cc + return this.payeeType; + } + + public boolean hasPayeeType() { + return this.payeeType != null && !this.payeeType.isEmpty(); + } + + /** + * @param value {@link #payeeType} (Party to be reimbursed: Subscriber, provider, other.) + */ + public ClaimResponse setPayeeType(Coding value) { + this.payeeType = value; + return this; + } + + /** + * @return {@link #item} (The first tier service adjudications for submitted services.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (ItemsComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (The first tier service adjudications for submitted services.) + */ + // syntactic sugar + public ItemsComponent addItem() { //3 + ItemsComponent t = new ItemsComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + // syntactic sugar + public ClaimResponse addItem(ItemsComponent t) { //3 + if (t == null) + return this; + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return this; + } + + /** + * @return {@link #addItem} (The first tier service adjudications for payor added services.) + */ + public List getAddItem() { + if (this.addItem == null) + this.addItem = new ArrayList(); + return this.addItem; + } + + public boolean hasAddItem() { + if (this.addItem == null) + return false; + for (AddedItemComponent item : this.addItem) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #addItem} (The first tier service adjudications for payor added services.) + */ + // syntactic sugar + public AddedItemComponent addAddItem() { //3 + AddedItemComponent t = new AddedItemComponent(); + if (this.addItem == null) + this.addItem = new ArrayList(); + this.addItem.add(t); + return t; + } + + // syntactic sugar + public ClaimResponse addAddItem(AddedItemComponent t) { //3 + if (t == null) + return this; + if (this.addItem == null) + this.addItem = new ArrayList(); + this.addItem.add(t); + return this; + } + + /** + * @return {@link #error} (Mutually exclusive with Services Provided (Item).) + */ + public List getError() { + if (this.error == null) + this.error = new ArrayList(); + return this.error; + } + + public boolean hasError() { + if (this.error == null) + return false; + for (ErrorsComponent item : this.error) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #error} (Mutually exclusive with Services Provided (Item).) + */ + // syntactic sugar + public ErrorsComponent addError() { //3 + ErrorsComponent t = new ErrorsComponent(); + if (this.error == null) + this.error = new ArrayList(); + this.error.add(t); + return t; + } + + // syntactic sugar + public ClaimResponse addError(ErrorsComponent t) { //3 + if (t == null) + return this; + if (this.error == null) + this.error = new ArrayList(); + this.error.add(t); + return this; + } + + /** + * @return {@link #totalCost} (The total cost of the services reported.) + */ + public Money getTotalCost() { + if (this.totalCost == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.totalCost"); + else if (Configuration.doAutoCreate()) + this.totalCost = new Money(); // cc + return this.totalCost; + } + + public boolean hasTotalCost() { + return this.totalCost != null && !this.totalCost.isEmpty(); + } + + /** + * @param value {@link #totalCost} (The total cost of the services reported.) + */ + public ClaimResponse setTotalCost(Money value) { + this.totalCost = value; + return this; + } + + /** + * @return {@link #unallocDeductable} (The amount of deductable applied which was not allocated to any particular service line.) + */ + public Money getUnallocDeductable() { + if (this.unallocDeductable == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.unallocDeductable"); + else if (Configuration.doAutoCreate()) + this.unallocDeductable = new Money(); // cc + return this.unallocDeductable; + } + + public boolean hasUnallocDeductable() { + return this.unallocDeductable != null && !this.unallocDeductable.isEmpty(); + } + + /** + * @param value {@link #unallocDeductable} (The amount of deductable applied which was not allocated to any particular service line.) + */ + public ClaimResponse setUnallocDeductable(Money value) { + this.unallocDeductable = value; + return this; + } + + /** + * @return {@link #totalBenefit} (Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable).) + */ + public Money getTotalBenefit() { + if (this.totalBenefit == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.totalBenefit"); + else if (Configuration.doAutoCreate()) + this.totalBenefit = new Money(); // cc + return this.totalBenefit; + } + + public boolean hasTotalBenefit() { + return this.totalBenefit != null && !this.totalBenefit.isEmpty(); + } + + /** + * @param value {@link #totalBenefit} (Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable).) + */ + public ClaimResponse setTotalBenefit(Money value) { + this.totalBenefit = value; + return this; + } + + /** + * @return {@link #paymentAdjustment} (Adjustment to the payment of this transaction which is not related to adjudication of this transaction.) + */ + public Money getPaymentAdjustment() { + if (this.paymentAdjustment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.paymentAdjustment"); + else if (Configuration.doAutoCreate()) + this.paymentAdjustment = new Money(); // cc + return this.paymentAdjustment; + } + + public boolean hasPaymentAdjustment() { + return this.paymentAdjustment != null && !this.paymentAdjustment.isEmpty(); + } + + /** + * @param value {@link #paymentAdjustment} (Adjustment to the payment of this transaction which is not related to adjudication of this transaction.) + */ + public ClaimResponse setPaymentAdjustment(Money value) { + this.paymentAdjustment = value; + return this; + } + + /** + * @return {@link #paymentAdjustmentReason} (Reason for the payment adjustment.) + */ + public Coding getPaymentAdjustmentReason() { + if (this.paymentAdjustmentReason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.paymentAdjustmentReason"); + else if (Configuration.doAutoCreate()) + this.paymentAdjustmentReason = new Coding(); // cc + return this.paymentAdjustmentReason; + } + + public boolean hasPaymentAdjustmentReason() { + return this.paymentAdjustmentReason != null && !this.paymentAdjustmentReason.isEmpty(); + } + + /** + * @param value {@link #paymentAdjustmentReason} (Reason for the payment adjustment.) + */ + public ClaimResponse setPaymentAdjustmentReason(Coding value) { + this.paymentAdjustmentReason = value; + return this; + } + + /** + * @return {@link #paymentDate} (Estimated payment data.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value + */ + public DateType getPaymentDateElement() { + if (this.paymentDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.paymentDate"); + else if (Configuration.doAutoCreate()) + this.paymentDate = new DateType(); // bb + return this.paymentDate; + } + + public boolean hasPaymentDateElement() { + return this.paymentDate != null && !this.paymentDate.isEmpty(); + } + + public boolean hasPaymentDate() { + return this.paymentDate != null && !this.paymentDate.isEmpty(); + } + + /** + * @param value {@link #paymentDate} (Estimated payment data.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value + */ + public ClaimResponse setPaymentDateElement(DateType value) { + this.paymentDate = value; + return this; + } + + /** + * @return Estimated payment data. + */ + public Date getPaymentDate() { + return this.paymentDate == null ? null : this.paymentDate.getValue(); + } + + /** + * @param value Estimated payment data. + */ + public ClaimResponse setPaymentDate(Date value) { + if (value == null) + this.paymentDate = null; + else { + if (this.paymentDate == null) + this.paymentDate = new DateType(); + this.paymentDate.setValue(value); + } + return this; + } + + /** + * @return {@link #paymentAmount} (Payable less any payment adjustment.) + */ + public Money getPaymentAmount() { + if (this.paymentAmount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.paymentAmount"); + else if (Configuration.doAutoCreate()) + this.paymentAmount = new Money(); // cc + return this.paymentAmount; + } + + public boolean hasPaymentAmount() { + return this.paymentAmount != null && !this.paymentAmount.isEmpty(); + } + + /** + * @param value {@link #paymentAmount} (Payable less any payment adjustment.) + */ + public ClaimResponse setPaymentAmount(Money value) { + this.paymentAmount = value; + return this; + } + + /** + * @return {@link #paymentRef} (Payment identifer.) + */ + public Identifier getPaymentRef() { + if (this.paymentRef == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.paymentRef"); + else if (Configuration.doAutoCreate()) + this.paymentRef = new Identifier(); // cc + return this.paymentRef; + } + + public boolean hasPaymentRef() { + return this.paymentRef != null && !this.paymentRef.isEmpty(); + } + + /** + * @param value {@link #paymentRef} (Payment identifer.) + */ + public ClaimResponse setPaymentRef(Identifier value) { + this.paymentRef = value; + return this; + } + + /** + * @return {@link #reserved} (Status of funds reservation (For provider, for Patient, None).) + */ + public Coding getReserved() { + if (this.reserved == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.reserved"); + else if (Configuration.doAutoCreate()) + this.reserved = new Coding(); // cc + return this.reserved; + } + + public boolean hasReserved() { + return this.reserved != null && !this.reserved.isEmpty(); + } + + /** + * @param value {@link #reserved} (Status of funds reservation (For provider, for Patient, None).) + */ + public ClaimResponse setReserved(Coding value) { + this.reserved = value; + return this; + } + + /** + * @return {@link #form} (The form to be used for printing the content.) + */ + public Coding getForm() { + if (this.form == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.form"); + else if (Configuration.doAutoCreate()) + this.form = new Coding(); // cc + return this.form; + } + + public boolean hasForm() { + return this.form != null && !this.form.isEmpty(); + } + + /** + * @param value {@link #form} (The form to be used for printing the content.) + */ + public ClaimResponse setForm(Coding value) { + this.form = value; + return this; + } + + /** + * @return {@link #note} (Note text.) + */ + public List getNote() { + if (this.note == null) + this.note = new ArrayList(); + return this.note; + } + + public boolean hasNote() { + if (this.note == null) + return false; + for (NotesComponent item : this.note) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #note} (Note text.) + */ + // syntactic sugar + public NotesComponent addNote() { //3 + NotesComponent t = new NotesComponent(); + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return t; + } + + // syntactic sugar + public ClaimResponse addNote(NotesComponent t) { //3 + if (t == null) + return this; + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return this; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + public List getCoverage() { + if (this.coverage == null) + this.coverage = new ArrayList(); + return this.coverage; + } + + public boolean hasCoverage() { + if (this.coverage == null) + return false; + for (CoverageComponent item : this.coverage) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + // syntactic sugar + public CoverageComponent addCoverage() { //3 + CoverageComponent t = new CoverageComponent(); + if (this.coverage == null) + this.coverage = new ArrayList(); + this.coverage.add(t); + return t; + } + + // syntactic sugar + public ClaimResponse addCoverage(CoverageComponent t) { //3 + if (t == null) + return this; + if (this.coverage == null) + this.coverage = new ArrayList(); + this.coverage.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("request", "Reference(Claim)", "Original request resource referrence.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); + childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); + childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); + childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); + childrenList.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome)); + childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition)); + childrenList.add(new Property("payeeType", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, payeeType)); + childrenList.add(new Property("item", "", "The first tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("addItem", "", "The first tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, addItem)); + childrenList.add(new Property("error", "", "Mutually exclusive with Services Provided (Item).", 0, java.lang.Integer.MAX_VALUE, error)); + childrenList.add(new Property("totalCost", "Money", "The total cost of the services reported.", 0, java.lang.Integer.MAX_VALUE, totalCost)); + childrenList.add(new Property("unallocDeductable", "Money", "The amount of deductable applied which was not allocated to any particular service line.", 0, java.lang.Integer.MAX_VALUE, unallocDeductable)); + childrenList.add(new Property("totalBenefit", "Money", "Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable).", 0, java.lang.Integer.MAX_VALUE, totalBenefit)); + childrenList.add(new Property("paymentAdjustment", "Money", "Adjustment to the payment of this transaction which is not related to adjudication of this transaction.", 0, java.lang.Integer.MAX_VALUE, paymentAdjustment)); + childrenList.add(new Property("paymentAdjustmentReason", "Coding", "Reason for the payment adjustment.", 0, java.lang.Integer.MAX_VALUE, paymentAdjustmentReason)); + childrenList.add(new Property("paymentDate", "date", "Estimated payment data.", 0, java.lang.Integer.MAX_VALUE, paymentDate)); + childrenList.add(new Property("paymentAmount", "Money", "Payable less any payment adjustment.", 0, java.lang.Integer.MAX_VALUE, paymentAmount)); + childrenList.add(new Property("paymentRef", "Identifier", "Payment identifer.", 0, java.lang.Integer.MAX_VALUE, paymentRef)); + childrenList.add(new Property("reserved", "Coding", "Status of funds reservation (For provider, for Patient, None).", 0, java.lang.Integer.MAX_VALUE, reserved)); + childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); + childrenList.add(new Property("note", "", "Note text.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); + } + + public ClaimResponse copy() { + ClaimResponse dst = new ClaimResponse(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.request = request == null ? null : request.copy(); + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + dst.created = created == null ? null : created.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); + dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.disposition = disposition == null ? null : disposition.copy(); + dst.payeeType = payeeType == null ? null : payeeType.copy(); + if (item != null) { + dst.item = new ArrayList(); + for (ItemsComponent i : item) + dst.item.add(i.copy()); + }; + if (addItem != null) { + dst.addItem = new ArrayList(); + for (AddedItemComponent i : addItem) + dst.addItem.add(i.copy()); + }; + if (error != null) { + dst.error = new ArrayList(); + for (ErrorsComponent i : error) + dst.error.add(i.copy()); + }; + dst.totalCost = totalCost == null ? null : totalCost.copy(); + dst.unallocDeductable = unallocDeductable == null ? null : unallocDeductable.copy(); + dst.totalBenefit = totalBenefit == null ? null : totalBenefit.copy(); + dst.paymentAdjustment = paymentAdjustment == null ? null : paymentAdjustment.copy(); + dst.paymentAdjustmentReason = paymentAdjustmentReason == null ? null : paymentAdjustmentReason.copy(); + dst.paymentDate = paymentDate == null ? null : paymentDate.copy(); + dst.paymentAmount = paymentAmount == null ? null : paymentAmount.copy(); + dst.paymentRef = paymentRef == null ? null : paymentRef.copy(); + dst.reserved = reserved == null ? null : reserved.copy(); + dst.form = form == null ? null : form.copy(); + if (note != null) { + dst.note = new ArrayList(); + for (NotesComponent i : note) + dst.note.add(i.copy()); + }; + if (coverage != null) { + dst.coverage = new ArrayList(); + for (CoverageComponent i : coverage) + dst.coverage.add(i.copy()); + }; + return dst; + } + + protected ClaimResponse typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ClaimResponse)) + return false; + ClaimResponse o = (ClaimResponse) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(ruleset, o.ruleset, true) + && compareDeep(originalRuleset, o.originalRuleset, true) && compareDeep(created, o.created, true) + && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) + && compareDeep(requestOrganization, o.requestOrganization, true) && compareDeep(outcome, o.outcome, true) + && compareDeep(disposition, o.disposition, true) && compareDeep(payeeType, o.payeeType, true) && compareDeep(item, o.item, true) + && compareDeep(addItem, o.addItem, true) && compareDeep(error, o.error, true) && compareDeep(totalCost, o.totalCost, true) + && compareDeep(unallocDeductable, o.unallocDeductable, true) && compareDeep(totalBenefit, o.totalBenefit, true) + && compareDeep(paymentAdjustment, o.paymentAdjustment, true) && compareDeep(paymentAdjustmentReason, o.paymentAdjustmentReason, true) + && compareDeep(paymentDate, o.paymentDate, true) && compareDeep(paymentAmount, o.paymentAmount, true) + && compareDeep(paymentRef, o.paymentRef, true) && compareDeep(reserved, o.reserved, true) && compareDeep(form, o.form, true) + && compareDeep(note, o.note, true) && compareDeep(coverage, o.coverage, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ClaimResponse)) + return false; + ClaimResponse o = (ClaimResponse) other; + return compareValues(created, o.created, true) && compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) + && compareValues(paymentDate, o.paymentDate, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) + && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) + && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) + && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) + && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) + && (payeeType == null || payeeType.isEmpty()) && (item == null || item.isEmpty()) && (addItem == null || addItem.isEmpty()) + && (error == null || error.isEmpty()) && (totalCost == null || totalCost.isEmpty()) && (unallocDeductable == null || unallocDeductable.isEmpty()) + && (totalBenefit == null || totalBenefit.isEmpty()) && (paymentAdjustment == null || paymentAdjustment.isEmpty()) + && (paymentAdjustmentReason == null || paymentAdjustmentReason.isEmpty()) && (paymentDate == null || paymentDate.isEmpty()) + && (paymentAmount == null || paymentAmount.isEmpty()) && (paymentRef == null || paymentRef.isEmpty()) + && (reserved == null || reserved.isEmpty()) && (form == null || form.isEmpty()) && (note == null || note.isEmpty()) + && (coverage == null || coverage.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ClaimResponse; + } + + @SearchParamDefinition(name="identifier", path="ClaimResponse.identifier", description="The identity of the insurer", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ClinicalImpression.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ClinicalImpression.java index 139df4994f8..b0e16e2d625 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ClinicalImpression.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ClinicalImpression.java @@ -1,1687 +1,1666 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. - */ -@ResourceDef(name="ClinicalImpression", profile="http://hl7.org/fhir/Profile/ClinicalImpression") -public class ClinicalImpression extends DomainResource { - - public enum ClinicalImpressionStatus { - /** - * The assessment is still on-going and results are not yet final. - */ - INPROGRESS, - /** - * The assessment is done and the results are final. - */ - COMPLETED, - /** - * This assessment was never actually done and the record is erroneous (e.g. Wrong patient). - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static ClinicalImpressionStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("completed".equals(codeString)) - return COMPLETED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new Exception("Unknown ClinicalImpressionStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INPROGRESS: return "in-progress"; - case COMPLETED: return "completed"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPROGRESS: return ""; - case COMPLETED: return ""; - case ENTEREDINERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPROGRESS: return "The assessment is still on-going and results are not yet final."; - case COMPLETED: return "The assessment is done and the results are final."; - case ENTEREDINERROR: return "This assessment was never actually done and the record is erroneous (e.g. Wrong patient)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPROGRESS: return "In progress"; - case COMPLETED: return "Completed"; - case ENTEREDINERROR: return "Entered in Error"; - default: return "?"; - } - } - } - - public static class ClinicalImpressionStatusEnumFactory implements EnumFactory { - public ClinicalImpressionStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return ClinicalImpressionStatus.INPROGRESS; - if ("completed".equals(codeString)) - return ClinicalImpressionStatus.COMPLETED; - if ("entered-in-error".equals(codeString)) - return ClinicalImpressionStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown ClinicalImpressionStatus code '"+codeString+"'"); - } - public String toCode(ClinicalImpressionStatus code) { - if (code == ClinicalImpressionStatus.INPROGRESS) - return "in-progress"; - if (code == ClinicalImpressionStatus.COMPLETED) - return "completed"; - if (code == ClinicalImpressionStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - } - - @Block() - public static class ClinicalImpressionInvestigationsComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="A name/code for the set", formalDefinition="A name/code for the group ('set') of investigations. Typically, this will be something like 'signs', 'symptoms', 'clinical', 'diagnostic', but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used." ) - protected CodeableConcept code; - - /** - * A record of a specific investigation that was undertaken. - */ - @Child(name = "item", type = {Observation.class, QuestionnaireAnswers.class, FamilyMemberHistory.class, DiagnosticReport.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Record of a specific investigation", formalDefinition="A record of a specific investigation that was undertaken." ) - protected List item; - /** - * The actual objects that are the target of the reference (A record of a specific investigation that was undertaken.) - */ - protected List itemTarget; - - - private static final long serialVersionUID = -301363326L; - - /* - * Constructor - */ - public ClinicalImpressionInvestigationsComponent() { - super(); - } - - /* - * Constructor - */ - public ClinicalImpressionInvestigationsComponent(CodeableConcept code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpressionInvestigationsComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.) - */ - public ClinicalImpressionInvestigationsComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #item} (A record of a specific investigation that was undertaken.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (Reference item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (A record of a specific investigation that was undertaken.) - */ - // syntactic sugar - public Reference addItem() { //3 - Reference t = new Reference(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - // syntactic sugar - public ClinicalImpressionInvestigationsComponent addItem(Reference t) { //3 - if (t == null) - return this; - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return this; - } - - /** - * @return {@link #item} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A record of a specific investigation that was undertaken.) - */ - public List getItemTarget() { - if (this.itemTarget == null) - this.itemTarget = new ArrayList(); - return this.itemTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "A name/code for the group ('set') of investigations. Typically, this will be something like 'signs', 'symptoms', 'clinical', 'diagnostic', but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("item", "Reference(Observation|QuestionnaireAnswers|FamilyMemberHistory|DiagnosticReport)", "A record of a specific investigation that was undertaken.", 0, java.lang.Integer.MAX_VALUE, item)); - } - - public ClinicalImpressionInvestigationsComponent copy() { - ClinicalImpressionInvestigationsComponent dst = new ClinicalImpressionInvestigationsComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - if (item != null) { - dst.item = new ArrayList(); - for (Reference i : item) - dst.item.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ClinicalImpressionInvestigationsComponent)) - return false; - ClinicalImpressionInvestigationsComponent o = (ClinicalImpressionInvestigationsComponent) other; - return compareDeep(code, o.code, true) && compareDeep(item, o.item, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ClinicalImpressionInvestigationsComponent)) - return false; - ClinicalImpressionInvestigationsComponent o = (ClinicalImpressionInvestigationsComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (item == null || item.isEmpty()) - ; - } - - } - - @Block() - public static class ClinicalImpressionFindingComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Specific text of code for finding or diagnosis. - */ - @Child(name = "item", type = {CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Specific text or code for finding", formalDefinition="Specific text of code for finding or diagnosis." ) - protected CodeableConcept item; - - /** - * Which investigations support finding or diagnosis. - */ - @Child(name = "cause", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Which investigations support finding", formalDefinition="Which investigations support finding or diagnosis." ) - protected StringType cause; - - private static final long serialVersionUID = -888590978L; - - /* - * Constructor - */ - public ClinicalImpressionFindingComponent() { - super(); - } - - /* - * Constructor - */ - public ClinicalImpressionFindingComponent(CodeableConcept item) { - super(); - this.item = item; - } - - /** - * @return {@link #item} (Specific text of code for finding or diagnosis.) - */ - public CodeableConcept getItem() { - if (this.item == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpressionFindingComponent.item"); - else if (Configuration.doAutoCreate()) - this.item = new CodeableConcept(); // cc - return this.item; - } - - public boolean hasItem() { - return this.item != null && !this.item.isEmpty(); - } - - /** - * @param value {@link #item} (Specific text of code for finding or diagnosis.) - */ - public ClinicalImpressionFindingComponent setItem(CodeableConcept value) { - this.item = value; - return this; - } - - /** - * @return {@link #cause} (Which investigations support finding or diagnosis.). This is the underlying object with id, value and extensions. The accessor "getCause" gives direct access to the value - */ - public StringType getCauseElement() { - if (this.cause == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpressionFindingComponent.cause"); - else if (Configuration.doAutoCreate()) - this.cause = new StringType(); // bb - return this.cause; - } - - public boolean hasCauseElement() { - return this.cause != null && !this.cause.isEmpty(); - } - - public boolean hasCause() { - return this.cause != null && !this.cause.isEmpty(); - } - - /** - * @param value {@link #cause} (Which investigations support finding or diagnosis.). This is the underlying object with id, value and extensions. The accessor "getCause" gives direct access to the value - */ - public ClinicalImpressionFindingComponent setCauseElement(StringType value) { - this.cause = value; - return this; - } - - /** - * @return Which investigations support finding or diagnosis. - */ - public String getCause() { - return this.cause == null ? null : this.cause.getValue(); - } - - /** - * @param value Which investigations support finding or diagnosis. - */ - public ClinicalImpressionFindingComponent setCause(String value) { - if (Utilities.noString(value)) - this.cause = null; - else { - if (this.cause == null) - this.cause = new StringType(); - this.cause.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("item", "CodeableConcept", "Specific text of code for finding or diagnosis.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("cause", "string", "Which investigations support finding or diagnosis.", 0, java.lang.Integer.MAX_VALUE, cause)); - } - - public ClinicalImpressionFindingComponent copy() { - ClinicalImpressionFindingComponent dst = new ClinicalImpressionFindingComponent(); - copyValues(dst); - dst.item = item == null ? null : item.copy(); - dst.cause = cause == null ? null : cause.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ClinicalImpressionFindingComponent)) - return false; - ClinicalImpressionFindingComponent o = (ClinicalImpressionFindingComponent) other; - return compareDeep(item, o.item, true) && compareDeep(cause, o.cause, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ClinicalImpressionFindingComponent)) - return false; - ClinicalImpressionFindingComponent o = (ClinicalImpressionFindingComponent) other; - return compareValues(cause, o.cause, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (item == null || item.isEmpty()) && (cause == null || cause.isEmpty()) - ; - } - - } - - @Block() - public static class ClinicalImpressionRuledOutComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Specific text of code for diagnosis. - */ - @Child(name = "item", type = {CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Specific text of code for diagnosis", formalDefinition="Specific text of code for diagnosis." ) - protected CodeableConcept item; - - /** - * Grounds for elimination. - */ - @Child(name = "reason", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Grounds for elimination", formalDefinition="Grounds for elimination." ) - protected StringType reason; - - private static final long serialVersionUID = -1001661243L; - - /* - * Constructor - */ - public ClinicalImpressionRuledOutComponent() { - super(); - } - - /* - * Constructor - */ - public ClinicalImpressionRuledOutComponent(CodeableConcept item) { - super(); - this.item = item; - } - - /** - * @return {@link #item} (Specific text of code for diagnosis.) - */ - public CodeableConcept getItem() { - if (this.item == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpressionRuledOutComponent.item"); - else if (Configuration.doAutoCreate()) - this.item = new CodeableConcept(); // cc - return this.item; - } - - public boolean hasItem() { - return this.item != null && !this.item.isEmpty(); - } - - /** - * @param value {@link #item} (Specific text of code for diagnosis.) - */ - public ClinicalImpressionRuledOutComponent setItem(CodeableConcept value) { - this.item = value; - return this; - } - - /** - * @return {@link #reason} (Grounds for elimination.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value - */ - public StringType getReasonElement() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpressionRuledOutComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new StringType(); // bb - return this.reason; - } - - public boolean hasReasonElement() { - return this.reason != null && !this.reason.isEmpty(); - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Grounds for elimination.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value - */ - public ClinicalImpressionRuledOutComponent setReasonElement(StringType value) { - this.reason = value; - return this; - } - - /** - * @return Grounds for elimination. - */ - public String getReason() { - return this.reason == null ? null : this.reason.getValue(); - } - - /** - * @param value Grounds for elimination. - */ - public ClinicalImpressionRuledOutComponent setReason(String value) { - if (Utilities.noString(value)) - this.reason = null; - else { - if (this.reason == null) - this.reason = new StringType(); - this.reason.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("item", "CodeableConcept", "Specific text of code for diagnosis.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("reason", "string", "Grounds for elimination.", 0, java.lang.Integer.MAX_VALUE, reason)); - } - - public ClinicalImpressionRuledOutComponent copy() { - ClinicalImpressionRuledOutComponent dst = new ClinicalImpressionRuledOutComponent(); - copyValues(dst); - dst.item = item == null ? null : item.copy(); - dst.reason = reason == null ? null : reason.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ClinicalImpressionRuledOutComponent)) - return false; - ClinicalImpressionRuledOutComponent o = (ClinicalImpressionRuledOutComponent) other; - return compareDeep(item, o.item, true) && compareDeep(reason, o.reason, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ClinicalImpressionRuledOutComponent)) - return false; - ClinicalImpressionRuledOutComponent o = (ClinicalImpressionRuledOutComponent) other; - return compareValues(reason, o.reason, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (item == null || item.isEmpty()) && (reason == null || reason.isEmpty()) - ; - } - - } - - /** - * The patient being asssesed. - */ - @Child(name = "patient", type = {Patient.class}, order=0, min=1, max=1) - @Description(shortDefinition="The patient being asssesed", formalDefinition="The patient being asssesed." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient being asssesed.) - */ - protected Patient patientTarget; - - /** - * The clinician performing the assessment. - */ - @Child(name = "assessor", type = {Practitioner.class}, order=1, min=0, max=1) - @Description(shortDefinition="The clinician performing the assessment", formalDefinition="The clinician performing the assessment." ) - protected Reference assessor; - - /** - * The actual object that is the target of the reference (The clinician performing the assessment.) - */ - protected Practitioner assessorTarget; - - /** - * Identifies the workflow status of the assessment. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="in-progress | completed | entered-in-error", formalDefinition="Identifies the workflow status of the assessment." ) - protected Enumeration status; - - /** - * The point in time at which the assessment was concluded (not when it was recorded). - */ - @Child(name = "date", type = {DateTimeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="When the assessment occurred", formalDefinition="The point in time at which the assessment was concluded (not when it was recorded)." ) - protected DateTimeType date; - - /** - * A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it. - */ - @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Why/how the assessment was performed", formalDefinition="A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it." ) - protected StringType description; - - /** - * A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes. - */ - @Child(name = "previous", type = {ClinicalImpression.class}, order=5, min=0, max=1) - @Description(shortDefinition="Reference to last assessment", formalDefinition="A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes." ) - protected Reference previous; - - /** - * The actual object that is the target of the reference (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) - */ - protected ClinicalImpression previousTarget; - - /** - * This a list of the general problems/conditions for a patient. - */ - @Child(name = "problem", type = {Condition.class, AllergyIntolerance.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="General assessment of patient state", formalDefinition="This a list of the general problems/conditions for a patient." ) - protected List problem; - /** - * The actual objects that are the target of the reference (This a list of the general problems/conditions for a patient.) - */ - protected List problemTarget; - - - /** - * The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource. - */ - @Child(name = "trigger", type = {CodeableConcept.class}, order=7, min=0, max=1) - @Description(shortDefinition="Request or event that necessitated this assessment", formalDefinition="The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource." ) - protected Type trigger; - - /** - * One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes. - */ - @Child(name = "investigations", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="One or more sets of investigations (signs, symptions, etc)", formalDefinition="One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes." ) - protected List investigations; - - /** - * Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis. - */ - @Child(name = "protocol", type = {UriType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Clinical Protocol followed", formalDefinition="Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis." ) - protected UriType protocol; - - /** - * A text summary of the investigations and the diagnosis. - */ - @Child(name = "summary", type = {StringType.class}, order=10, min=0, max=1) - @Description(shortDefinition="Summary of the assessment", formalDefinition="A text summary of the investigations and the diagnosis." ) - protected StringType summary; - - /** - * Specific findings or diagnoses that was considered likely or relevant to ongoing treatment. - */ - @Child(name = "finding", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Possible or likely findings and diagnoses", formalDefinition="Specific findings or diagnoses that was considered likely or relevant to ongoing treatment." ) - protected List finding; - - /** - * Diagnoses/conditions resolved since the last assessment. - */ - @Child(name = "resolved", type = {CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Diagnosies/conditions resolved since previous assessment", formalDefinition="Diagnoses/conditions resolved since the last assessment." ) - protected List resolved; - - /** - * Diagnosis considered not possible. - */ - @Child(name = "ruledOut", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Diagnosis considered not possible", formalDefinition="Diagnosis considered not possible." ) - protected List ruledOut; - - /** - * Estimate of likely outcome. - */ - @Child(name = "prognosis", type = {StringType.class}, order=14, min=0, max=1) - @Description(shortDefinition="Estimate of likely outcome", formalDefinition="Estimate of likely outcome." ) - protected StringType prognosis; - - /** - * Plan of action after assessment. - */ - @Child(name = "plan", type = {CarePlan.class, Appointment.class, CommunicationRequest.class, DeviceUseRequest.class, DiagnosticOrder.class, MedicationPrescription.class, NutritionOrder.class, Order.class, ProcedureRequest.class, ProcessRequest.class, ReferralRequest.class, Supply.class, VisionPrescription.class}, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Plan of action after assessment", formalDefinition="Plan of action after assessment." ) - protected List plan; - /** - * The actual objects that are the target of the reference (Plan of action after assessment.) - */ - protected List planTarget; - - - /** - * Actions taken during assessment. - */ - @Child(name = "action", type = {ReferralRequest.class, ProcedureRequest.class, Procedure.class, MedicationPrescription.class, DiagnosticOrder.class, NutritionOrder.class, Supply.class, Appointment.class}, order=16, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Actions taken during assessment", formalDefinition="Actions taken during assessment." ) - protected List action; - /** - * The actual objects that are the target of the reference (Actions taken during assessment.) - */ - protected List actionTarget; - - - private static final long serialVersionUID = 1650458630L; - - /* - * Constructor - */ - public ClinicalImpression() { - super(); - } - - /* - * Constructor - */ - public ClinicalImpression(Reference patient, Enumeration status) { - super(); - this.patient = patient; - this.status = status; - } - - /** - * @return {@link #patient} (The patient being asssesed.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The patient being asssesed.) - */ - public ClinicalImpression setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient being asssesed.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient being asssesed.) - */ - public ClinicalImpression setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #assessor} (The clinician performing the assessment.) - */ - public Reference getAssessor() { - if (this.assessor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.assessor"); - else if (Configuration.doAutoCreate()) - this.assessor = new Reference(); // cc - return this.assessor; - } - - public boolean hasAssessor() { - return this.assessor != null && !this.assessor.isEmpty(); - } - - /** - * @param value {@link #assessor} (The clinician performing the assessment.) - */ - public ClinicalImpression setAssessor(Reference value) { - this.assessor = value; - return this; - } - - /** - * @return {@link #assessor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The clinician performing the assessment.) - */ - public Practitioner getAssessorTarget() { - if (this.assessorTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.assessor"); - else if (Configuration.doAutoCreate()) - this.assessorTarget = new Practitioner(); // aa - return this.assessorTarget; - } - - /** - * @param value {@link #assessor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The clinician performing the assessment.) - */ - public ClinicalImpression setAssessorTarget(Practitioner value) { - this.assessorTarget = value; - return this; - } - - /** - * @return {@link #status} (Identifies the workflow status of the assessment.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ClinicalImpressionStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Identifies the workflow status of the assessment.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public ClinicalImpression setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Identifies the workflow status of the assessment. - */ - public ClinicalImpressionStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Identifies the workflow status of the assessment. - */ - public ClinicalImpression setStatus(ClinicalImpressionStatus value) { - if (this.status == null) - this.status = new Enumeration(new ClinicalImpressionStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #date} (The point in time at which the assessment was concluded (not when it was recorded).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The point in time at which the assessment was concluded (not when it was recorded).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ClinicalImpression setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The point in time at which the assessment was concluded (not when it was recorded). - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The point in time at which the assessment was concluded (not when it was recorded). - */ - public ClinicalImpression setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ClinicalImpression setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it. - */ - public ClinicalImpression setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #previous} (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) - */ - public Reference getPrevious() { - if (this.previous == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.previous"); - else if (Configuration.doAutoCreate()) - this.previous = new Reference(); // cc - return this.previous; - } - - public boolean hasPrevious() { - return this.previous != null && !this.previous.isEmpty(); - } - - /** - * @param value {@link #previous} (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) - */ - public ClinicalImpression setPrevious(Reference value) { - this.previous = value; - return this; - } - - /** - * @return {@link #previous} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) - */ - public ClinicalImpression getPreviousTarget() { - if (this.previousTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.previous"); - else if (Configuration.doAutoCreate()) - this.previousTarget = new ClinicalImpression(); // aa - return this.previousTarget; - } - - /** - * @param value {@link #previous} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) - */ - public ClinicalImpression setPreviousTarget(ClinicalImpression value) { - this.previousTarget = value; - return this; - } - - /** - * @return {@link #problem} (This a list of the general problems/conditions for a patient.) - */ - public List getProblem() { - if (this.problem == null) - this.problem = new ArrayList(); - return this.problem; - } - - public boolean hasProblem() { - if (this.problem == null) - return false; - for (Reference item : this.problem) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #problem} (This a list of the general problems/conditions for a patient.) - */ - // syntactic sugar - public Reference addProblem() { //3 - Reference t = new Reference(); - if (this.problem == null) - this.problem = new ArrayList(); - this.problem.add(t); - return t; - } - - // syntactic sugar - public ClinicalImpression addProblem(Reference t) { //3 - if (t == null) - return this; - if (this.problem == null) - this.problem = new ArrayList(); - this.problem.add(t); - return this; - } - - /** - * @return {@link #problem} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. This a list of the general problems/conditions for a patient.) - */ - public List getProblemTarget() { - if (this.problemTarget == null) - this.problemTarget = new ArrayList(); - return this.problemTarget; - } - - /** - * @return {@link #trigger} (The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.) - */ - public Type getTrigger() { - return this.trigger; - } - - /** - * @return {@link #trigger} (The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.) - */ - public CodeableConcept getTriggerCodeableConcept() throws Exception { - if (!(this.trigger instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.trigger.getClass().getName()+" was encountered"); - return (CodeableConcept) this.trigger; - } - - /** - * @return {@link #trigger} (The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.) - */ - public Reference getTriggerReference() throws Exception { - if (!(this.trigger instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.trigger.getClass().getName()+" was encountered"); - return (Reference) this.trigger; - } - - public boolean hasTrigger() { - return this.trigger != null && !this.trigger.isEmpty(); - } - - /** - * @param value {@link #trigger} (The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.) - */ - public ClinicalImpression setTrigger(Type value) { - this.trigger = value; - return this; - } - - /** - * @return {@link #investigations} (One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.) - */ - public List getInvestigations() { - if (this.investigations == null) - this.investigations = new ArrayList(); - return this.investigations; - } - - public boolean hasInvestigations() { - if (this.investigations == null) - return false; - for (ClinicalImpressionInvestigationsComponent item : this.investigations) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #investigations} (One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.) - */ - // syntactic sugar - public ClinicalImpressionInvestigationsComponent addInvestigations() { //3 - ClinicalImpressionInvestigationsComponent t = new ClinicalImpressionInvestigationsComponent(); - if (this.investigations == null) - this.investigations = new ArrayList(); - this.investigations.add(t); - return t; - } - - // syntactic sugar - public ClinicalImpression addInvestigations(ClinicalImpressionInvestigationsComponent t) { //3 - if (t == null) - return this; - if (this.investigations == null) - this.investigations = new ArrayList(); - this.investigations.add(t); - return this; - } - - /** - * @return {@link #protocol} (Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getProtocol" gives direct access to the value - */ - public UriType getProtocolElement() { - if (this.protocol == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.protocol"); - else if (Configuration.doAutoCreate()) - this.protocol = new UriType(); // bb - return this.protocol; - } - - public boolean hasProtocolElement() { - return this.protocol != null && !this.protocol.isEmpty(); - } - - public boolean hasProtocol() { - return this.protocol != null && !this.protocol.isEmpty(); - } - - /** - * @param value {@link #protocol} (Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getProtocol" gives direct access to the value - */ - public ClinicalImpression setProtocolElement(UriType value) { - this.protocol = value; - return this; - } - - /** - * @return Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis. - */ - public String getProtocol() { - return this.protocol == null ? null : this.protocol.getValue(); - } - - /** - * @param value Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis. - */ - public ClinicalImpression setProtocol(String value) { - if (Utilities.noString(value)) - this.protocol = null; - else { - if (this.protocol == null) - this.protocol = new UriType(); - this.protocol.setValue(value); - } - return this; - } - - /** - * @return {@link #summary} (A text summary of the investigations and the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSummary" gives direct access to the value - */ - public StringType getSummaryElement() { - if (this.summary == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.summary"); - else if (Configuration.doAutoCreate()) - this.summary = new StringType(); // bb - return this.summary; - } - - public boolean hasSummaryElement() { - return this.summary != null && !this.summary.isEmpty(); - } - - public boolean hasSummary() { - return this.summary != null && !this.summary.isEmpty(); - } - - /** - * @param value {@link #summary} (A text summary of the investigations and the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSummary" gives direct access to the value - */ - public ClinicalImpression setSummaryElement(StringType value) { - this.summary = value; - return this; - } - - /** - * @return A text summary of the investigations and the diagnosis. - */ - public String getSummary() { - return this.summary == null ? null : this.summary.getValue(); - } - - /** - * @param value A text summary of the investigations and the diagnosis. - */ - public ClinicalImpression setSummary(String value) { - if (Utilities.noString(value)) - this.summary = null; - else { - if (this.summary == null) - this.summary = new StringType(); - this.summary.setValue(value); - } - return this; - } - - /** - * @return {@link #finding} (Specific findings or diagnoses that was considered likely or relevant to ongoing treatment.) - */ - public List getFinding() { - if (this.finding == null) - this.finding = new ArrayList(); - return this.finding; - } - - public boolean hasFinding() { - if (this.finding == null) - return false; - for (ClinicalImpressionFindingComponent item : this.finding) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #finding} (Specific findings or diagnoses that was considered likely or relevant to ongoing treatment.) - */ - // syntactic sugar - public ClinicalImpressionFindingComponent addFinding() { //3 - ClinicalImpressionFindingComponent t = new ClinicalImpressionFindingComponent(); - if (this.finding == null) - this.finding = new ArrayList(); - this.finding.add(t); - return t; - } - - // syntactic sugar - public ClinicalImpression addFinding(ClinicalImpressionFindingComponent t) { //3 - if (t == null) - return this; - if (this.finding == null) - this.finding = new ArrayList(); - this.finding.add(t); - return this; - } - - /** - * @return {@link #resolved} (Diagnoses/conditions resolved since the last assessment.) - */ - public List getResolved() { - if (this.resolved == null) - this.resolved = new ArrayList(); - return this.resolved; - } - - public boolean hasResolved() { - if (this.resolved == null) - return false; - for (CodeableConcept item : this.resolved) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #resolved} (Diagnoses/conditions resolved since the last assessment.) - */ - // syntactic sugar - public CodeableConcept addResolved() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.resolved == null) - this.resolved = new ArrayList(); - this.resolved.add(t); - return t; - } - - // syntactic sugar - public ClinicalImpression addResolved(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.resolved == null) - this.resolved = new ArrayList(); - this.resolved.add(t); - return this; - } - - /** - * @return {@link #ruledOut} (Diagnosis considered not possible.) - */ - public List getRuledOut() { - if (this.ruledOut == null) - this.ruledOut = new ArrayList(); - return this.ruledOut; - } - - public boolean hasRuledOut() { - if (this.ruledOut == null) - return false; - for (ClinicalImpressionRuledOutComponent item : this.ruledOut) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #ruledOut} (Diagnosis considered not possible.) - */ - // syntactic sugar - public ClinicalImpressionRuledOutComponent addRuledOut() { //3 - ClinicalImpressionRuledOutComponent t = new ClinicalImpressionRuledOutComponent(); - if (this.ruledOut == null) - this.ruledOut = new ArrayList(); - this.ruledOut.add(t); - return t; - } - - // syntactic sugar - public ClinicalImpression addRuledOut(ClinicalImpressionRuledOutComponent t) { //3 - if (t == null) - return this; - if (this.ruledOut == null) - this.ruledOut = new ArrayList(); - this.ruledOut.add(t); - return this; - } - - /** - * @return {@link #prognosis} (Estimate of likely outcome.). This is the underlying object with id, value and extensions. The accessor "getPrognosis" gives direct access to the value - */ - public StringType getPrognosisElement() { - if (this.prognosis == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.prognosis"); - else if (Configuration.doAutoCreate()) - this.prognosis = new StringType(); // bb - return this.prognosis; - } - - public boolean hasPrognosisElement() { - return this.prognosis != null && !this.prognosis.isEmpty(); - } - - public boolean hasPrognosis() { - return this.prognosis != null && !this.prognosis.isEmpty(); - } - - /** - * @param value {@link #prognosis} (Estimate of likely outcome.). This is the underlying object with id, value and extensions. The accessor "getPrognosis" gives direct access to the value - */ - public ClinicalImpression setPrognosisElement(StringType value) { - this.prognosis = value; - return this; - } - - /** - * @return Estimate of likely outcome. - */ - public String getPrognosis() { - return this.prognosis == null ? null : this.prognosis.getValue(); - } - - /** - * @param value Estimate of likely outcome. - */ - public ClinicalImpression setPrognosis(String value) { - if (Utilities.noString(value)) - this.prognosis = null; - else { - if (this.prognosis == null) - this.prognosis = new StringType(); - this.prognosis.setValue(value); - } - return this; - } - - /** - * @return {@link #plan} (Plan of action after assessment.) - */ - public List getPlan() { - if (this.plan == null) - this.plan = new ArrayList(); - return this.plan; - } - - public boolean hasPlan() { - if (this.plan == null) - return false; - for (Reference item : this.plan) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #plan} (Plan of action after assessment.) - */ - // syntactic sugar - public Reference addPlan() { //3 - Reference t = new Reference(); - if (this.plan == null) - this.plan = new ArrayList(); - this.plan.add(t); - return t; - } - - // syntactic sugar - public ClinicalImpression addPlan(Reference t) { //3 - if (t == null) - return this; - if (this.plan == null) - this.plan = new ArrayList(); - this.plan.add(t); - return this; - } - - /** - * @return {@link #plan} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Plan of action after assessment.) - */ - public List getPlanTarget() { - if (this.planTarget == null) - this.planTarget = new ArrayList(); - return this.planTarget; - } - - /** - * @return {@link #action} (Actions taken during assessment.) - */ - public List getAction() { - if (this.action == null) - this.action = new ArrayList(); - return this.action; - } - - public boolean hasAction() { - if (this.action == null) - return false; - for (Reference item : this.action) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #action} (Actions taken during assessment.) - */ - // syntactic sugar - public Reference addAction() { //3 - Reference t = new Reference(); - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return t; - } - - // syntactic sugar - public ClinicalImpression addAction(Reference t) { //3 - if (t == null) - return this; - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return this; - } - - /** - * @return {@link #action} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Actions taken during assessment.) - */ - public List getActionTarget() { - if (this.actionTarget == null) - this.actionTarget = new ArrayList(); - return this.actionTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient being asssesed.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("assessor", "Reference(Practitioner)", "The clinician performing the assessment.", 0, java.lang.Integer.MAX_VALUE, assessor)); - childrenList.add(new Property("status", "code", "Identifies the workflow status of the assessment.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("date", "dateTime", "The point in time at which the assessment was concluded (not when it was recorded).", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("description", "string", "A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("previous", "Reference(ClinicalImpression)", "A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.", 0, java.lang.Integer.MAX_VALUE, previous)); - childrenList.add(new Property("problem", "Reference(Condition|AllergyIntolerance)", "This a list of the general problems/conditions for a patient.", 0, java.lang.Integer.MAX_VALUE, problem)); - childrenList.add(new Property("trigger[x]", "CodeableConcept|Reference(Any)", "The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.", 0, java.lang.Integer.MAX_VALUE, trigger)); - childrenList.add(new Property("investigations", "", "One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.", 0, java.lang.Integer.MAX_VALUE, investigations)); - childrenList.add(new Property("protocol", "uri", "Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.", 0, java.lang.Integer.MAX_VALUE, protocol)); - childrenList.add(new Property("summary", "string", "A text summary of the investigations and the diagnosis.", 0, java.lang.Integer.MAX_VALUE, summary)); - childrenList.add(new Property("finding", "", "Specific findings or diagnoses that was considered likely or relevant to ongoing treatment.", 0, java.lang.Integer.MAX_VALUE, finding)); - childrenList.add(new Property("resolved", "CodeableConcept", "Diagnoses/conditions resolved since the last assessment.", 0, java.lang.Integer.MAX_VALUE, resolved)); - childrenList.add(new Property("ruledOut", "", "Diagnosis considered not possible.", 0, java.lang.Integer.MAX_VALUE, ruledOut)); - childrenList.add(new Property("prognosis", "string", "Estimate of likely outcome.", 0, java.lang.Integer.MAX_VALUE, prognosis)); - childrenList.add(new Property("plan", "Reference(CarePlan|Appointment|CommunicationRequest|DeviceUseRequest|DiagnosticOrder|MedicationPrescription|NutritionOrder|Order|ProcedureRequest|ProcessRequest|ReferralRequest|Supply|VisionPrescription)", "Plan of action after assessment.", 0, java.lang.Integer.MAX_VALUE, plan)); - childrenList.add(new Property("action", "Reference(ReferralRequest|ProcedureRequest|Procedure|MedicationPrescription|DiagnosticOrder|NutritionOrder|Supply|Appointment)", "Actions taken during assessment.", 0, java.lang.Integer.MAX_VALUE, action)); - } - - public ClinicalImpression copy() { - ClinicalImpression dst = new ClinicalImpression(); - copyValues(dst); - dst.patient = patient == null ? null : patient.copy(); - dst.assessor = assessor == null ? null : assessor.copy(); - dst.status = status == null ? null : status.copy(); - dst.date = date == null ? null : date.copy(); - dst.description = description == null ? null : description.copy(); - dst.previous = previous == null ? null : previous.copy(); - if (problem != null) { - dst.problem = new ArrayList(); - for (Reference i : problem) - dst.problem.add(i.copy()); - }; - dst.trigger = trigger == null ? null : trigger.copy(); - if (investigations != null) { - dst.investigations = new ArrayList(); - for (ClinicalImpressionInvestigationsComponent i : investigations) - dst.investigations.add(i.copy()); - }; - dst.protocol = protocol == null ? null : protocol.copy(); - dst.summary = summary == null ? null : summary.copy(); - if (finding != null) { - dst.finding = new ArrayList(); - for (ClinicalImpressionFindingComponent i : finding) - dst.finding.add(i.copy()); - }; - if (resolved != null) { - dst.resolved = new ArrayList(); - for (CodeableConcept i : resolved) - dst.resolved.add(i.copy()); - }; - if (ruledOut != null) { - dst.ruledOut = new ArrayList(); - for (ClinicalImpressionRuledOutComponent i : ruledOut) - dst.ruledOut.add(i.copy()); - }; - dst.prognosis = prognosis == null ? null : prognosis.copy(); - if (plan != null) { - dst.plan = new ArrayList(); - for (Reference i : plan) - dst.plan.add(i.copy()); - }; - if (action != null) { - dst.action = new ArrayList(); - for (Reference i : action) - dst.action.add(i.copy()); - }; - return dst; - } - - protected ClinicalImpression typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ClinicalImpression)) - return false; - ClinicalImpression o = (ClinicalImpression) other; - return compareDeep(patient, o.patient, true) && compareDeep(assessor, o.assessor, true) && compareDeep(status, o.status, true) - && compareDeep(date, o.date, true) && compareDeep(description, o.description, true) && compareDeep(previous, o.previous, true) - && compareDeep(problem, o.problem, true) && compareDeep(trigger, o.trigger, true) && compareDeep(investigations, o.investigations, true) - && compareDeep(protocol, o.protocol, true) && compareDeep(summary, o.summary, true) && compareDeep(finding, o.finding, true) - && compareDeep(resolved, o.resolved, true) && compareDeep(ruledOut, o.ruledOut, true) && compareDeep(prognosis, o.prognosis, true) - && compareDeep(plan, o.plan, true) && compareDeep(action, o.action, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ClinicalImpression)) - return false; - ClinicalImpression o = (ClinicalImpression) other; - return compareValues(status, o.status, true) && compareValues(date, o.date, true) && compareValues(description, o.description, true) - && compareValues(protocol, o.protocol, true) && compareValues(summary, o.summary, true) && compareValues(prognosis, o.prognosis, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (patient == null || patient.isEmpty()) && (assessor == null || assessor.isEmpty()) - && (status == null || status.isEmpty()) && (date == null || date.isEmpty()) && (description == null || description.isEmpty()) - && (previous == null || previous.isEmpty()) && (problem == null || problem.isEmpty()) && (trigger == null || trigger.isEmpty()) - && (investigations == null || investigations.isEmpty()) && (protocol == null || protocol.isEmpty()) - && (summary == null || summary.isEmpty()) && (finding == null || finding.isEmpty()) && (resolved == null || resolved.isEmpty()) - && (ruledOut == null || ruledOut.isEmpty()) && (prognosis == null || prognosis.isEmpty()) - && (plan == null || plan.isEmpty()) && (action == null || action.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ClinicalImpression; - } - - @SearchParamDefinition(name="assessor", path="ClinicalImpression.assessor", description="The clinician performing the assessment", type="reference" ) - public static final String SP_ASSESSOR = "assessor"; - @SearchParamDefinition(name="trigger", path="ClinicalImpression.triggerReference", description="Request or event that necessitated this assessment", type="reference" ) - public static final String SP_TRIGGER = "trigger"; - @SearchParamDefinition(name="patient", path="ClinicalImpression.patient", description="The patient being asssesed", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="plan", path="ClinicalImpression.plan", description="Plan of action after assessment", type="reference" ) - public static final String SP_PLAN = "plan"; - @SearchParamDefinition(name="resolved", path="ClinicalImpression.resolved", description="Diagnosies/conditions resolved since previous assessment", type="token" ) - public static final String SP_RESOLVED = "resolved"; - @SearchParamDefinition(name="trigger-code", path="ClinicalImpression.triggerCodeableConcept", description="Request or event that necessitated this assessment", type="token" ) - public static final String SP_TRIGGERCODE = "trigger-code"; - @SearchParamDefinition(name="previous", path="ClinicalImpression.previous", description="Reference to last assessment", type="reference" ) - public static final String SP_PREVIOUS = "previous"; - @SearchParamDefinition(name="status", path="ClinicalImpression.status", description="in-progress | completed | entered-in-error", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="action", path="ClinicalImpression.action", description="Actions taken during assessment", type="reference" ) - public static final String SP_ACTION = "action"; - @SearchParamDefinition(name="finding", path="ClinicalImpression.finding.item", description="Specific text or code for finding", type="token" ) - public static final String SP_FINDING = "finding"; - @SearchParamDefinition(name="investigation", path="ClinicalImpression.investigations.item", description="Record of a specific investigation", type="reference" ) - public static final String SP_INVESTIGATION = "investigation"; - @SearchParamDefinition(name="problem", path="ClinicalImpression.problem", description="General assessment of patient state", type="reference" ) - public static final String SP_PROBLEM = "problem"; - @SearchParamDefinition(name="date", path="ClinicalImpression.date", description="When the assessment occurred", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="ruledout", path="ClinicalImpression.ruledOut.item", description="Specific text of code for diagnosis", type="token" ) - public static final String SP_RULEDOUT = "ruledout"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. + */ +@ResourceDef(name="ClinicalImpression", profile="http://hl7.org/fhir/Profile/ClinicalImpression") +public class ClinicalImpression extends DomainResource { + + public enum ClinicalImpressionStatus { + /** + * The assessment is still on-going and results are not yet final. + */ + INPROGRESS, + /** + * The assessment is done and the results are final. + */ + COMPLETED, + /** + * This assessment was never actually done and the record is erroneous (e.g. Wrong patient). + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static ClinicalImpressionStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("completed".equals(codeString)) + return COMPLETED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new Exception("Unknown ClinicalImpressionStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INPROGRESS: return "in-progress"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return ""; + case COMPLETED: return ""; + case ENTEREDINERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "The assessment is still on-going and results are not yet final."; + case COMPLETED: return "The assessment is done and the results are final."; + case ENTEREDINERROR: return "This assessment was never actually done and the record is erroneous (e.g. Wrong patient)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "In progress"; + case COMPLETED: return "Completed"; + case ENTEREDINERROR: return "Entered in Error"; + default: return "?"; + } + } + } + + public static class ClinicalImpressionStatusEnumFactory implements EnumFactory { + public ClinicalImpressionStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return ClinicalImpressionStatus.INPROGRESS; + if ("completed".equals(codeString)) + return ClinicalImpressionStatus.COMPLETED; + if ("entered-in-error".equals(codeString)) + return ClinicalImpressionStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown ClinicalImpressionStatus code '"+codeString+"'"); + } + public String toCode(ClinicalImpressionStatus code) { + if (code == ClinicalImpressionStatus.INPROGRESS) + return "in-progress"; + if (code == ClinicalImpressionStatus.COMPLETED) + return "completed"; + if (code == ClinicalImpressionStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + } + + @Block() + public static class ClinicalImpressionInvestigationsComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="A name/code for the set", formalDefinition="A name/code for the group ('set') of investigations. Typically, this will be something like 'signs', 'symptoms', 'clinical', 'diagnostic', but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used." ) + protected CodeableConcept code; + + /** + * A record of a specific investigation that was undertaken. + */ + @Child(name = "item", type = {Observation.class, QuestionnaireAnswers.class, FamilyMemberHistory.class, DiagnosticReport.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Record of a specific investigation", formalDefinition="A record of a specific investigation that was undertaken." ) + protected List item; + /** + * The actual objects that are the target of the reference (A record of a specific investigation that was undertaken.) + */ + protected List itemTarget; + + + private static final long serialVersionUID = -301363326L; + + /* + * Constructor + */ + public ClinicalImpressionInvestigationsComponent() { + super(); + } + + /* + * Constructor + */ + public ClinicalImpressionInvestigationsComponent(CodeableConcept code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpressionInvestigationsComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.) + */ + public ClinicalImpressionInvestigationsComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #item} (A record of a specific investigation that was undertaken.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (Reference item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (A record of a specific investigation that was undertaken.) + */ + // syntactic sugar + public Reference addItem() { //3 + Reference t = new Reference(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + // syntactic sugar + public ClinicalImpressionInvestigationsComponent addItem(Reference t) { //3 + if (t == null) + return this; + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return this; + } + + /** + * @return {@link #item} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A record of a specific investigation that was undertaken.) + */ + public List getItemTarget() { + if (this.itemTarget == null) + this.itemTarget = new ArrayList(); + return this.itemTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "A name/code for the group ('set') of investigations. Typically, this will be something like 'signs', 'symptoms', 'clinical', 'diagnostic', but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("item", "Reference(Observation|QuestionnaireAnswers|FamilyMemberHistory|DiagnosticReport)", "A record of a specific investigation that was undertaken.", 0, java.lang.Integer.MAX_VALUE, item)); + } + + public ClinicalImpressionInvestigationsComponent copy() { + ClinicalImpressionInvestigationsComponent dst = new ClinicalImpressionInvestigationsComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + if (item != null) { + dst.item = new ArrayList(); + for (Reference i : item) + dst.item.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ClinicalImpressionInvestigationsComponent)) + return false; + ClinicalImpressionInvestigationsComponent o = (ClinicalImpressionInvestigationsComponent) other; + return compareDeep(code, o.code, true) && compareDeep(item, o.item, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ClinicalImpressionInvestigationsComponent)) + return false; + ClinicalImpressionInvestigationsComponent o = (ClinicalImpressionInvestigationsComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (item == null || item.isEmpty()) + ; + } + + } + + @Block() + public static class ClinicalImpressionFindingComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Specific text of code for finding or diagnosis. + */ + @Child(name = "item", type = {CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Specific text or code for finding", formalDefinition="Specific text of code for finding or diagnosis." ) + protected CodeableConcept item; + + /** + * Which investigations support finding or diagnosis. + */ + @Child(name = "cause", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Which investigations support finding", formalDefinition="Which investigations support finding or diagnosis." ) + protected StringType cause; + + private static final long serialVersionUID = -888590978L; + + /* + * Constructor + */ + public ClinicalImpressionFindingComponent() { + super(); + } + + /* + * Constructor + */ + public ClinicalImpressionFindingComponent(CodeableConcept item) { + super(); + this.item = item; + } + + /** + * @return {@link #item} (Specific text of code for finding or diagnosis.) + */ + public CodeableConcept getItem() { + if (this.item == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpressionFindingComponent.item"); + else if (Configuration.doAutoCreate()) + this.item = new CodeableConcept(); // cc + return this.item; + } + + public boolean hasItem() { + return this.item != null && !this.item.isEmpty(); + } + + /** + * @param value {@link #item} (Specific text of code for finding or diagnosis.) + */ + public ClinicalImpressionFindingComponent setItem(CodeableConcept value) { + this.item = value; + return this; + } + + /** + * @return {@link #cause} (Which investigations support finding or diagnosis.). This is the underlying object with id, value and extensions. The accessor "getCause" gives direct access to the value + */ + public StringType getCauseElement() { + if (this.cause == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpressionFindingComponent.cause"); + else if (Configuration.doAutoCreate()) + this.cause = new StringType(); // bb + return this.cause; + } + + public boolean hasCauseElement() { + return this.cause != null && !this.cause.isEmpty(); + } + + public boolean hasCause() { + return this.cause != null && !this.cause.isEmpty(); + } + + /** + * @param value {@link #cause} (Which investigations support finding or diagnosis.). This is the underlying object with id, value and extensions. The accessor "getCause" gives direct access to the value + */ + public ClinicalImpressionFindingComponent setCauseElement(StringType value) { + this.cause = value; + return this; + } + + /** + * @return Which investigations support finding or diagnosis. + */ + public String getCause() { + return this.cause == null ? null : this.cause.getValue(); + } + + /** + * @param value Which investigations support finding or diagnosis. + */ + public ClinicalImpressionFindingComponent setCause(String value) { + if (Utilities.noString(value)) + this.cause = null; + else { + if (this.cause == null) + this.cause = new StringType(); + this.cause.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("item", "CodeableConcept", "Specific text of code for finding or diagnosis.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("cause", "string", "Which investigations support finding or diagnosis.", 0, java.lang.Integer.MAX_VALUE, cause)); + } + + public ClinicalImpressionFindingComponent copy() { + ClinicalImpressionFindingComponent dst = new ClinicalImpressionFindingComponent(); + copyValues(dst); + dst.item = item == null ? null : item.copy(); + dst.cause = cause == null ? null : cause.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ClinicalImpressionFindingComponent)) + return false; + ClinicalImpressionFindingComponent o = (ClinicalImpressionFindingComponent) other; + return compareDeep(item, o.item, true) && compareDeep(cause, o.cause, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ClinicalImpressionFindingComponent)) + return false; + ClinicalImpressionFindingComponent o = (ClinicalImpressionFindingComponent) other; + return compareValues(cause, o.cause, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (item == null || item.isEmpty()) && (cause == null || cause.isEmpty()) + ; + } + + } + + @Block() + public static class ClinicalImpressionRuledOutComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Specific text of code for diagnosis. + */ + @Child(name = "item", type = {CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Specific text of code for diagnosis", formalDefinition="Specific text of code for diagnosis." ) + protected CodeableConcept item; + + /** + * Grounds for elimination. + */ + @Child(name = "reason", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Grounds for elimination", formalDefinition="Grounds for elimination." ) + protected StringType reason; + + private static final long serialVersionUID = -1001661243L; + + /* + * Constructor + */ + public ClinicalImpressionRuledOutComponent() { + super(); + } + + /* + * Constructor + */ + public ClinicalImpressionRuledOutComponent(CodeableConcept item) { + super(); + this.item = item; + } + + /** + * @return {@link #item} (Specific text of code for diagnosis.) + */ + public CodeableConcept getItem() { + if (this.item == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpressionRuledOutComponent.item"); + else if (Configuration.doAutoCreate()) + this.item = new CodeableConcept(); // cc + return this.item; + } + + public boolean hasItem() { + return this.item != null && !this.item.isEmpty(); + } + + /** + * @param value {@link #item} (Specific text of code for diagnosis.) + */ + public ClinicalImpressionRuledOutComponent setItem(CodeableConcept value) { + this.item = value; + return this; + } + + /** + * @return {@link #reason} (Grounds for elimination.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value + */ + public StringType getReasonElement() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpressionRuledOutComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new StringType(); // bb + return this.reason; + } + + public boolean hasReasonElement() { + return this.reason != null && !this.reason.isEmpty(); + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Grounds for elimination.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value + */ + public ClinicalImpressionRuledOutComponent setReasonElement(StringType value) { + this.reason = value; + return this; + } + + /** + * @return Grounds for elimination. + */ + public String getReason() { + return this.reason == null ? null : this.reason.getValue(); + } + + /** + * @param value Grounds for elimination. + */ + public ClinicalImpressionRuledOutComponent setReason(String value) { + if (Utilities.noString(value)) + this.reason = null; + else { + if (this.reason == null) + this.reason = new StringType(); + this.reason.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("item", "CodeableConcept", "Specific text of code for diagnosis.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("reason", "string", "Grounds for elimination.", 0, java.lang.Integer.MAX_VALUE, reason)); + } + + public ClinicalImpressionRuledOutComponent copy() { + ClinicalImpressionRuledOutComponent dst = new ClinicalImpressionRuledOutComponent(); + copyValues(dst); + dst.item = item == null ? null : item.copy(); + dst.reason = reason == null ? null : reason.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ClinicalImpressionRuledOutComponent)) + return false; + ClinicalImpressionRuledOutComponent o = (ClinicalImpressionRuledOutComponent) other; + return compareDeep(item, o.item, true) && compareDeep(reason, o.reason, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ClinicalImpressionRuledOutComponent)) + return false; + ClinicalImpressionRuledOutComponent o = (ClinicalImpressionRuledOutComponent) other; + return compareValues(reason, o.reason, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (item == null || item.isEmpty()) && (reason == null || reason.isEmpty()) + ; + } + + } + + /** + * The patient being asssesed. + */ + @Child(name = "patient", type = {Patient.class}, order=0, min=1, max=1) + @Description(shortDefinition="The patient being asssesed", formalDefinition="The patient being asssesed." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient being asssesed.) + */ + protected Patient patientTarget; + + /** + * The clinician performing the assessment. + */ + @Child(name = "assessor", type = {Practitioner.class}, order=1, min=0, max=1) + @Description(shortDefinition="The clinician performing the assessment", formalDefinition="The clinician performing the assessment." ) + protected Reference assessor; + + /** + * The actual object that is the target of the reference (The clinician performing the assessment.) + */ + protected Practitioner assessorTarget; + + /** + * Identifies the workflow status of the assessment. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="in-progress | completed | entered-in-error", formalDefinition="Identifies the workflow status of the assessment." ) + protected Enumeration status; + + /** + * The point in time at which the assessment was concluded (not when it was recorded). + */ + @Child(name = "date", type = {DateTimeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="When the assessment occurred", formalDefinition="The point in time at which the assessment was concluded (not when it was recorded)." ) + protected DateTimeType date; + + /** + * A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it. + */ + @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Why/how the assessment was performed", formalDefinition="A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it." ) + protected StringType description; + + /** + * A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes. + */ + @Child(name = "previous", type = {ClinicalImpression.class}, order=5, min=0, max=1) + @Description(shortDefinition="Reference to last assessment", formalDefinition="A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes." ) + protected Reference previous; + + /** + * The actual object that is the target of the reference (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) + */ + protected ClinicalImpression previousTarget; + + /** + * This a list of the general problems/conditions for a patient. + */ + @Child(name = "problem", type = {Condition.class, AllergyIntolerance.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="General assessment of patient state", formalDefinition="This a list of the general problems/conditions for a patient." ) + protected List problem; + /** + * The actual objects that are the target of the reference (This a list of the general problems/conditions for a patient.) + */ + protected List problemTarget; + + + /** + * The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource. + */ + @Child(name = "trigger", type = {CodeableConcept.class}, order=7, min=0, max=1) + @Description(shortDefinition="Request or event that necessitated this assessment", formalDefinition="The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource." ) + protected Type trigger; + + /** + * One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes. + */ + @Child(name = "investigations", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="One or more sets of investigations (signs, symptions, etc)", formalDefinition="One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes." ) + protected List investigations; + + /** + * Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis. + */ + @Child(name = "protocol", type = {UriType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Clinical Protocol followed", formalDefinition="Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis." ) + protected UriType protocol; + + /** + * A text summary of the investigations and the diagnosis. + */ + @Child(name = "summary", type = {StringType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Summary of the assessment", formalDefinition="A text summary of the investigations and the diagnosis." ) + protected StringType summary; + + /** + * Specific findings or diagnoses that was considered likely or relevant to ongoing treatment. + */ + @Child(name = "finding", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Possible or likely findings and diagnoses", formalDefinition="Specific findings or diagnoses that was considered likely or relevant to ongoing treatment." ) + protected List finding; + + /** + * Diagnoses/conditions resolved since the last assessment. + */ + @Child(name = "resolved", type = {CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosies/conditions resolved since previous assessment", formalDefinition="Diagnoses/conditions resolved since the last assessment." ) + protected List resolved; + + /** + * Diagnosis considered not possible. + */ + @Child(name = "ruledOut", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosis considered not possible", formalDefinition="Diagnosis considered not possible." ) + protected List ruledOut; + + /** + * Estimate of likely outcome. + */ + @Child(name = "prognosis", type = {StringType.class}, order=14, min=0, max=1) + @Description(shortDefinition="Estimate of likely outcome", formalDefinition="Estimate of likely outcome." ) + protected StringType prognosis; + + /** + * Plan of action after assessment. + */ + @Child(name = "plan", type = {CarePlan.class, Appointment.class, CommunicationRequest.class, DeviceUseRequest.class, DiagnosticOrder.class, MedicationPrescription.class, NutritionOrder.class, Order.class, ProcedureRequest.class, ProcessRequest.class, ReferralRequest.class, Supply.class, VisionPrescription.class}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Plan of action after assessment", formalDefinition="Plan of action after assessment." ) + protected List plan; + /** + * The actual objects that are the target of the reference (Plan of action after assessment.) + */ + protected List planTarget; + + + /** + * Actions taken during assessment. + */ + @Child(name = "action", type = {ReferralRequest.class, ProcedureRequest.class, Procedure.class, MedicationPrescription.class, DiagnosticOrder.class, NutritionOrder.class, Supply.class, Appointment.class}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Actions taken during assessment", formalDefinition="Actions taken during assessment." ) + protected List action; + /** + * The actual objects that are the target of the reference (Actions taken during assessment.) + */ + protected List actionTarget; + + + private static final long serialVersionUID = 1650458630L; + + /* + * Constructor + */ + public ClinicalImpression() { + super(); + } + + /* + * Constructor + */ + public ClinicalImpression(Reference patient, Enumeration status) { + super(); + this.patient = patient; + this.status = status; + } + + /** + * @return {@link #patient} (The patient being asssesed.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpression.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The patient being asssesed.) + */ + public ClinicalImpression setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient being asssesed.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpression.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient being asssesed.) + */ + public ClinicalImpression setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #assessor} (The clinician performing the assessment.) + */ + public Reference getAssessor() { + if (this.assessor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpression.assessor"); + else if (Configuration.doAutoCreate()) + this.assessor = new Reference(); // cc + return this.assessor; + } + + public boolean hasAssessor() { + return this.assessor != null && !this.assessor.isEmpty(); + } + + /** + * @param value {@link #assessor} (The clinician performing the assessment.) + */ + public ClinicalImpression setAssessor(Reference value) { + this.assessor = value; + return this; + } + + /** + * @return {@link #assessor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The clinician performing the assessment.) + */ + public Practitioner getAssessorTarget() { + if (this.assessorTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpression.assessor"); + else if (Configuration.doAutoCreate()) + this.assessorTarget = new Practitioner(); // aa + return this.assessorTarget; + } + + /** + * @param value {@link #assessor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The clinician performing the assessment.) + */ + public ClinicalImpression setAssessorTarget(Practitioner value) { + this.assessorTarget = value; + return this; + } + + /** + * @return {@link #status} (Identifies the workflow status of the assessment.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpression.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ClinicalImpressionStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (Identifies the workflow status of the assessment.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public ClinicalImpression setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Identifies the workflow status of the assessment. + */ + public ClinicalImpressionStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Identifies the workflow status of the assessment. + */ + public ClinicalImpression setStatus(ClinicalImpressionStatus value) { + if (this.status == null) + this.status = new Enumeration(new ClinicalImpressionStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #date} (The point in time at which the assessment was concluded (not when it was recorded).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpression.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The point in time at which the assessment was concluded (not when it was recorded).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ClinicalImpression setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The point in time at which the assessment was concluded (not when it was recorded). + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The point in time at which the assessment was concluded (not when it was recorded). + */ + public ClinicalImpression setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpression.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ClinicalImpression setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it. + */ + public ClinicalImpression setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #previous} (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) + */ + public Reference getPrevious() { + if (this.previous == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpression.previous"); + else if (Configuration.doAutoCreate()) + this.previous = new Reference(); // cc + return this.previous; + } + + public boolean hasPrevious() { + return this.previous != null && !this.previous.isEmpty(); + } + + /** + * @param value {@link #previous} (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) + */ + public ClinicalImpression setPrevious(Reference value) { + this.previous = value; + return this; + } + + /** + * @return {@link #previous} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) + */ + public ClinicalImpression getPreviousTarget() { + if (this.previousTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpression.previous"); + else if (Configuration.doAutoCreate()) + this.previousTarget = new ClinicalImpression(); // aa + return this.previousTarget; + } + + /** + * @param value {@link #previous} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) + */ + public ClinicalImpression setPreviousTarget(ClinicalImpression value) { + this.previousTarget = value; + return this; + } + + /** + * @return {@link #problem} (This a list of the general problems/conditions for a patient.) + */ + public List getProblem() { + if (this.problem == null) + this.problem = new ArrayList(); + return this.problem; + } + + public boolean hasProblem() { + if (this.problem == null) + return false; + for (Reference item : this.problem) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #problem} (This a list of the general problems/conditions for a patient.) + */ + // syntactic sugar + public Reference addProblem() { //3 + Reference t = new Reference(); + if (this.problem == null) + this.problem = new ArrayList(); + this.problem.add(t); + return t; + } + + // syntactic sugar + public ClinicalImpression addProblem(Reference t) { //3 + if (t == null) + return this; + if (this.problem == null) + this.problem = new ArrayList(); + this.problem.add(t); + return this; + } + + /** + * @return {@link #problem} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. This a list of the general problems/conditions for a patient.) + */ + public List getProblemTarget() { + if (this.problemTarget == null) + this.problemTarget = new ArrayList(); + return this.problemTarget; + } + + /** + * @return {@link #trigger} (The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.) + */ + public Type getTrigger() { + return this.trigger; + } + + /** + * @return {@link #trigger} (The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.) + */ + public CodeableConcept getTriggerCodeableConcept() throws Exception { + if (!(this.trigger instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.trigger.getClass().getName()+" was encountered"); + return (CodeableConcept) this.trigger; + } + + /** + * @return {@link #trigger} (The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.) + */ + public Reference getTriggerReference() throws Exception { + if (!(this.trigger instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.trigger.getClass().getName()+" was encountered"); + return (Reference) this.trigger; + } + + public boolean hasTrigger() { + return this.trigger != null && !this.trigger.isEmpty(); + } + + /** + * @param value {@link #trigger} (The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.) + */ + public ClinicalImpression setTrigger(Type value) { + this.trigger = value; + return this; + } + + /** + * @return {@link #investigations} (One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.) + */ + public List getInvestigations() { + if (this.investigations == null) + this.investigations = new ArrayList(); + return this.investigations; + } + + public boolean hasInvestigations() { + if (this.investigations == null) + return false; + for (ClinicalImpressionInvestigationsComponent item : this.investigations) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #investigations} (One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.) + */ + // syntactic sugar + public ClinicalImpressionInvestigationsComponent addInvestigations() { //3 + ClinicalImpressionInvestigationsComponent t = new ClinicalImpressionInvestigationsComponent(); + if (this.investigations == null) + this.investigations = new ArrayList(); + this.investigations.add(t); + return t; + } + + // syntactic sugar + public ClinicalImpression addInvestigations(ClinicalImpressionInvestigationsComponent t) { //3 + if (t == null) + return this; + if (this.investigations == null) + this.investigations = new ArrayList(); + this.investigations.add(t); + return this; + } + + /** + * @return {@link #protocol} (Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getProtocol" gives direct access to the value + */ + public UriType getProtocolElement() { + if (this.protocol == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpression.protocol"); + else if (Configuration.doAutoCreate()) + this.protocol = new UriType(); // bb + return this.protocol; + } + + public boolean hasProtocolElement() { + return this.protocol != null && !this.protocol.isEmpty(); + } + + public boolean hasProtocol() { + return this.protocol != null && !this.protocol.isEmpty(); + } + + /** + * @param value {@link #protocol} (Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getProtocol" gives direct access to the value + */ + public ClinicalImpression setProtocolElement(UriType value) { + this.protocol = value; + return this; + } + + /** + * @return Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis. + */ + public String getProtocol() { + return this.protocol == null ? null : this.protocol.getValue(); + } + + /** + * @param value Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis. + */ + public ClinicalImpression setProtocol(String value) { + if (Utilities.noString(value)) + this.protocol = null; + else { + if (this.protocol == null) + this.protocol = new UriType(); + this.protocol.setValue(value); + } + return this; + } + + /** + * @return {@link #summary} (A text summary of the investigations and the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSummary" gives direct access to the value + */ + public StringType getSummaryElement() { + if (this.summary == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpression.summary"); + else if (Configuration.doAutoCreate()) + this.summary = new StringType(); // bb + return this.summary; + } + + public boolean hasSummaryElement() { + return this.summary != null && !this.summary.isEmpty(); + } + + public boolean hasSummary() { + return this.summary != null && !this.summary.isEmpty(); + } + + /** + * @param value {@link #summary} (A text summary of the investigations and the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSummary" gives direct access to the value + */ + public ClinicalImpression setSummaryElement(StringType value) { + this.summary = value; + return this; + } + + /** + * @return A text summary of the investigations and the diagnosis. + */ + public String getSummary() { + return this.summary == null ? null : this.summary.getValue(); + } + + /** + * @param value A text summary of the investigations and the diagnosis. + */ + public ClinicalImpression setSummary(String value) { + if (Utilities.noString(value)) + this.summary = null; + else { + if (this.summary == null) + this.summary = new StringType(); + this.summary.setValue(value); + } + return this; + } + + /** + * @return {@link #finding} (Specific findings or diagnoses that was considered likely or relevant to ongoing treatment.) + */ + public List getFinding() { + if (this.finding == null) + this.finding = new ArrayList(); + return this.finding; + } + + public boolean hasFinding() { + if (this.finding == null) + return false; + for (ClinicalImpressionFindingComponent item : this.finding) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #finding} (Specific findings or diagnoses that was considered likely or relevant to ongoing treatment.) + */ + // syntactic sugar + public ClinicalImpressionFindingComponent addFinding() { //3 + ClinicalImpressionFindingComponent t = new ClinicalImpressionFindingComponent(); + if (this.finding == null) + this.finding = new ArrayList(); + this.finding.add(t); + return t; + } + + // syntactic sugar + public ClinicalImpression addFinding(ClinicalImpressionFindingComponent t) { //3 + if (t == null) + return this; + if (this.finding == null) + this.finding = new ArrayList(); + this.finding.add(t); + return this; + } + + /** + * @return {@link #resolved} (Diagnoses/conditions resolved since the last assessment.) + */ + public List getResolved() { + if (this.resolved == null) + this.resolved = new ArrayList(); + return this.resolved; + } + + public boolean hasResolved() { + if (this.resolved == null) + return false; + for (CodeableConcept item : this.resolved) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #resolved} (Diagnoses/conditions resolved since the last assessment.) + */ + // syntactic sugar + public CodeableConcept addResolved() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.resolved == null) + this.resolved = new ArrayList(); + this.resolved.add(t); + return t; + } + + // syntactic sugar + public ClinicalImpression addResolved(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.resolved == null) + this.resolved = new ArrayList(); + this.resolved.add(t); + return this; + } + + /** + * @return {@link #ruledOut} (Diagnosis considered not possible.) + */ + public List getRuledOut() { + if (this.ruledOut == null) + this.ruledOut = new ArrayList(); + return this.ruledOut; + } + + public boolean hasRuledOut() { + if (this.ruledOut == null) + return false; + for (ClinicalImpressionRuledOutComponent item : this.ruledOut) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #ruledOut} (Diagnosis considered not possible.) + */ + // syntactic sugar + public ClinicalImpressionRuledOutComponent addRuledOut() { //3 + ClinicalImpressionRuledOutComponent t = new ClinicalImpressionRuledOutComponent(); + if (this.ruledOut == null) + this.ruledOut = new ArrayList(); + this.ruledOut.add(t); + return t; + } + + // syntactic sugar + public ClinicalImpression addRuledOut(ClinicalImpressionRuledOutComponent t) { //3 + if (t == null) + return this; + if (this.ruledOut == null) + this.ruledOut = new ArrayList(); + this.ruledOut.add(t); + return this; + } + + /** + * @return {@link #prognosis} (Estimate of likely outcome.). This is the underlying object with id, value and extensions. The accessor "getPrognosis" gives direct access to the value + */ + public StringType getPrognosisElement() { + if (this.prognosis == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpression.prognosis"); + else if (Configuration.doAutoCreate()) + this.prognosis = new StringType(); // bb + return this.prognosis; + } + + public boolean hasPrognosisElement() { + return this.prognosis != null && !this.prognosis.isEmpty(); + } + + public boolean hasPrognosis() { + return this.prognosis != null && !this.prognosis.isEmpty(); + } + + /** + * @param value {@link #prognosis} (Estimate of likely outcome.). This is the underlying object with id, value and extensions. The accessor "getPrognosis" gives direct access to the value + */ + public ClinicalImpression setPrognosisElement(StringType value) { + this.prognosis = value; + return this; + } + + /** + * @return Estimate of likely outcome. + */ + public String getPrognosis() { + return this.prognosis == null ? null : this.prognosis.getValue(); + } + + /** + * @param value Estimate of likely outcome. + */ + public ClinicalImpression setPrognosis(String value) { + if (Utilities.noString(value)) + this.prognosis = null; + else { + if (this.prognosis == null) + this.prognosis = new StringType(); + this.prognosis.setValue(value); + } + return this; + } + + /** + * @return {@link #plan} (Plan of action after assessment.) + */ + public List getPlan() { + if (this.plan == null) + this.plan = new ArrayList(); + return this.plan; + } + + public boolean hasPlan() { + if (this.plan == null) + return false; + for (Reference item : this.plan) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #plan} (Plan of action after assessment.) + */ + // syntactic sugar + public Reference addPlan() { //3 + Reference t = new Reference(); + if (this.plan == null) + this.plan = new ArrayList(); + this.plan.add(t); + return t; + } + + // syntactic sugar + public ClinicalImpression addPlan(Reference t) { //3 + if (t == null) + return this; + if (this.plan == null) + this.plan = new ArrayList(); + this.plan.add(t); + return this; + } + + /** + * @return {@link #plan} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Plan of action after assessment.) + */ + public List getPlanTarget() { + if (this.planTarget == null) + this.planTarget = new ArrayList(); + return this.planTarget; + } + + /** + * @return {@link #action} (Actions taken during assessment.) + */ + public List getAction() { + if (this.action == null) + this.action = new ArrayList(); + return this.action; + } + + public boolean hasAction() { + if (this.action == null) + return false; + for (Reference item : this.action) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #action} (Actions taken during assessment.) + */ + // syntactic sugar + public Reference addAction() { //3 + Reference t = new Reference(); + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return t; + } + + // syntactic sugar + public ClinicalImpression addAction(Reference t) { //3 + if (t == null) + return this; + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return this; + } + + /** + * @return {@link #action} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Actions taken during assessment.) + */ + public List getActionTarget() { + if (this.actionTarget == null) + this.actionTarget = new ArrayList(); + return this.actionTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient being asssesed.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("assessor", "Reference(Practitioner)", "The clinician performing the assessment.", 0, java.lang.Integer.MAX_VALUE, assessor)); + childrenList.add(new Property("status", "code", "Identifies the workflow status of the assessment.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("date", "dateTime", "The point in time at which the assessment was concluded (not when it was recorded).", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("description", "string", "A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("previous", "Reference(ClinicalImpression)", "A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.", 0, java.lang.Integer.MAX_VALUE, previous)); + childrenList.add(new Property("problem", "Reference(Condition|AllergyIntolerance)", "This a list of the general problems/conditions for a patient.", 0, java.lang.Integer.MAX_VALUE, problem)); + childrenList.add(new Property("trigger[x]", "CodeableConcept|Reference(Any)", "The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.", 0, java.lang.Integer.MAX_VALUE, trigger)); + childrenList.add(new Property("investigations", "", "One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.", 0, java.lang.Integer.MAX_VALUE, investigations)); + childrenList.add(new Property("protocol", "uri", "Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.", 0, java.lang.Integer.MAX_VALUE, protocol)); + childrenList.add(new Property("summary", "string", "A text summary of the investigations and the diagnosis.", 0, java.lang.Integer.MAX_VALUE, summary)); + childrenList.add(new Property("finding", "", "Specific findings or diagnoses that was considered likely or relevant to ongoing treatment.", 0, java.lang.Integer.MAX_VALUE, finding)); + childrenList.add(new Property("resolved", "CodeableConcept", "Diagnoses/conditions resolved since the last assessment.", 0, java.lang.Integer.MAX_VALUE, resolved)); + childrenList.add(new Property("ruledOut", "", "Diagnosis considered not possible.", 0, java.lang.Integer.MAX_VALUE, ruledOut)); + childrenList.add(new Property("prognosis", "string", "Estimate of likely outcome.", 0, java.lang.Integer.MAX_VALUE, prognosis)); + childrenList.add(new Property("plan", "Reference(CarePlan|Appointment|CommunicationRequest|DeviceUseRequest|DiagnosticOrder|MedicationPrescription|NutritionOrder|Order|ProcedureRequest|ProcessRequest|ReferralRequest|Supply|VisionPrescription)", "Plan of action after assessment.", 0, java.lang.Integer.MAX_VALUE, plan)); + childrenList.add(new Property("action", "Reference(ReferralRequest|ProcedureRequest|Procedure|MedicationPrescription|DiagnosticOrder|NutritionOrder|Supply|Appointment)", "Actions taken during assessment.", 0, java.lang.Integer.MAX_VALUE, action)); + } + + public ClinicalImpression copy() { + ClinicalImpression dst = new ClinicalImpression(); + copyValues(dst); + dst.patient = patient == null ? null : patient.copy(); + dst.assessor = assessor == null ? null : assessor.copy(); + dst.status = status == null ? null : status.copy(); + dst.date = date == null ? null : date.copy(); + dst.description = description == null ? null : description.copy(); + dst.previous = previous == null ? null : previous.copy(); + if (problem != null) { + dst.problem = new ArrayList(); + for (Reference i : problem) + dst.problem.add(i.copy()); + }; + dst.trigger = trigger == null ? null : trigger.copy(); + if (investigations != null) { + dst.investigations = new ArrayList(); + for (ClinicalImpressionInvestigationsComponent i : investigations) + dst.investigations.add(i.copy()); + }; + dst.protocol = protocol == null ? null : protocol.copy(); + dst.summary = summary == null ? null : summary.copy(); + if (finding != null) { + dst.finding = new ArrayList(); + for (ClinicalImpressionFindingComponent i : finding) + dst.finding.add(i.copy()); + }; + if (resolved != null) { + dst.resolved = new ArrayList(); + for (CodeableConcept i : resolved) + dst.resolved.add(i.copy()); + }; + if (ruledOut != null) { + dst.ruledOut = new ArrayList(); + for (ClinicalImpressionRuledOutComponent i : ruledOut) + dst.ruledOut.add(i.copy()); + }; + dst.prognosis = prognosis == null ? null : prognosis.copy(); + if (plan != null) { + dst.plan = new ArrayList(); + for (Reference i : plan) + dst.plan.add(i.copy()); + }; + if (action != null) { + dst.action = new ArrayList(); + for (Reference i : action) + dst.action.add(i.copy()); + }; + return dst; + } + + protected ClinicalImpression typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ClinicalImpression)) + return false; + ClinicalImpression o = (ClinicalImpression) other; + return compareDeep(patient, o.patient, true) && compareDeep(assessor, o.assessor, true) && compareDeep(status, o.status, true) + && compareDeep(date, o.date, true) && compareDeep(description, o.description, true) && compareDeep(previous, o.previous, true) + && compareDeep(problem, o.problem, true) && compareDeep(trigger, o.trigger, true) && compareDeep(investigations, o.investigations, true) + && compareDeep(protocol, o.protocol, true) && compareDeep(summary, o.summary, true) && compareDeep(finding, o.finding, true) + && compareDeep(resolved, o.resolved, true) && compareDeep(ruledOut, o.ruledOut, true) && compareDeep(prognosis, o.prognosis, true) + && compareDeep(plan, o.plan, true) && compareDeep(action, o.action, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ClinicalImpression)) + return false; + ClinicalImpression o = (ClinicalImpression) other; + return compareValues(status, o.status, true) && compareValues(date, o.date, true) && compareValues(description, o.description, true) + && compareValues(protocol, o.protocol, true) && compareValues(summary, o.summary, true) && compareValues(prognosis, o.prognosis, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (patient == null || patient.isEmpty()) && (assessor == null || assessor.isEmpty()) + && (status == null || status.isEmpty()) && (date == null || date.isEmpty()) && (description == null || description.isEmpty()) + && (previous == null || previous.isEmpty()) && (problem == null || problem.isEmpty()) && (trigger == null || trigger.isEmpty()) + && (investigations == null || investigations.isEmpty()) && (protocol == null || protocol.isEmpty()) + && (summary == null || summary.isEmpty()) && (finding == null || finding.isEmpty()) && (resolved == null || resolved.isEmpty()) + && (ruledOut == null || ruledOut.isEmpty()) && (prognosis == null || prognosis.isEmpty()) + && (plan == null || plan.isEmpty()) && (action == null || action.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ClinicalImpression; + } + + @SearchParamDefinition(name="date", path="ClinicalImpression.date", description="When the assessment occurred", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="previous", path="ClinicalImpression.previous", description="Reference to last assessment", type="reference" ) + public static final String SP_PREVIOUS = "previous"; + @SearchParamDefinition(name="assessor", path="ClinicalImpression.assessor", description="The clinician performing the assessment", type="reference" ) + public static final String SP_ASSESSOR = "assessor"; + @SearchParamDefinition(name="trigger", path="ClinicalImpression.triggerReference", description="Request or event that necessitated this assessment", type="reference" ) + public static final String SP_TRIGGER = "trigger"; + @SearchParamDefinition(name="finding", path="ClinicalImpression.finding.item", description="Specific text or code for finding", type="token" ) + public static final String SP_FINDING = "finding"; + @SearchParamDefinition(name="ruledout", path="ClinicalImpression.ruledOut.item", description="Specific text of code for diagnosis", type="token" ) + public static final String SP_RULEDOUT = "ruledout"; + @SearchParamDefinition(name="problem", path="ClinicalImpression.problem", description="General assessment of patient state", type="reference" ) + public static final String SP_PROBLEM = "problem"; + @SearchParamDefinition(name="patient", path="ClinicalImpression.patient", description="The patient being asssesed", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="investigation", path="ClinicalImpression.investigations.item", description="Record of a specific investigation", type="reference" ) + public static final String SP_INVESTIGATION = "investigation"; + @SearchParamDefinition(name="action", path="ClinicalImpression.action", description="Actions taken during assessment", type="reference" ) + public static final String SP_ACTION = "action"; + @SearchParamDefinition(name="trigger-code", path="ClinicalImpression.triggerCodeableConcept", description="Request or event that necessitated this assessment", type="token" ) + public static final String SP_TRIGGERCODE = "trigger-code"; + @SearchParamDefinition(name="plan", path="ClinicalImpression.plan", description="Plan of action after assessment", type="reference" ) + public static final String SP_PLAN = "plan"; + @SearchParamDefinition(name="resolved", path="ClinicalImpression.resolved", description="Diagnosies/conditions resolved since previous assessment", type="token" ) + public static final String SP_RESOLVED = "resolved"; + @SearchParamDefinition(name="status", path="ClinicalImpression.status", description="in-progress | completed | entered-in-error", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/CodeType.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/CodeType.java index 565841910f5..3e11dcd1144 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/CodeType.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/CodeType.java @@ -1,94 +1,73 @@ -/* -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; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import static org.apache.commons.lang3.StringUtils.defaultString; - -import org.hl7.fhir.instance.model.annotations.DatatypeDef; - -/** - * Primitive type "code" in FHIR, when not bound to an enumerated list of codes - */ -@DatatypeDef(name="code") -public class CodeType extends PrimitiveType implements Comparable { - - private static final long serialVersionUID = 3L; - - public CodeType() { - super(); - } - - public CodeType(String theCode) { - setValue(theCode); - } - - public int compareTo(CodeType theCode) { - if (theCode == null) { - return 1; - } - return defaultString(getValue()).compareTo(defaultString(theCode.getValue())); - } - - @Override - protected String parse(String theValue) { - return theValue.trim(); - } - - @Override - protected String encode(String theValue) { - return theValue; - } - - @Override - public CodeType copy() { - return new CodeType(getValue()); - } - -} +/* +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; + +import static org.apache.commons.lang3.StringUtils.defaultString; + +import org.hl7.fhir.instance.model.annotations.DatatypeDef; + +/** + * Primitive type "code" in FHIR, when not bound to an enumerated list of codes + */ +@DatatypeDef(name="code") +public class CodeType extends PrimitiveType implements Comparable { + + private static final long serialVersionUID = 3L; + + public CodeType() { + super(); + } + + public CodeType(String theCode) { + setValue(theCode); + } + + public int compareTo(CodeType theCode) { + if (theCode == null) { + return 1; + } + return defaultString(getValue()).compareTo(defaultString(theCode.getValue())); + } + + @Override + protected String parse(String theValue) { + return theValue.trim(); + } + + @Override + protected String encode(String theValue) { + return theValue; + } + + @Override + public CodeType copy() { + return new CodeType(getValue()); + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/CodeableConcept.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/CodeableConcept.java index 761b1f3d138..dcda7172ea1 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/CodeableConcept.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/CodeableConcept.java @@ -1,230 +1,209 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. - */ -@DatatypeDef(name="CodeableConcept") -public class CodeableConcept extends Type implements ICompositeType { - - /** - * A reference to a code defined by a terminology system. - */ - @Child(name = "coding", type = {Coding.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Code defined by a terminology system", formalDefinition="A reference to a code defined by a terminology system." ) - protected List coding; - - /** - * A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. - */ - @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Plain text representation of the concept", formalDefinition="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user." ) - protected StringType text; - - private static final long serialVersionUID = 760353246L; - - /* - * Constructor - */ - public CodeableConcept() { - super(); - } - - /** - * @return {@link #coding} (A reference to a code defined by a terminology system.) - */ - public List getCoding() { - if (this.coding == null) - this.coding = new ArrayList(); - return this.coding; - } - - public boolean hasCoding() { - if (this.coding == null) - return false; - for (Coding item : this.coding) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #coding} (A reference to a code defined by a terminology system.) - */ - // syntactic sugar - public Coding addCoding() { //3 - Coding t = new Coding(); - if (this.coding == null) - this.coding = new ArrayList(); - this.coding.add(t); - return t; - } - - // syntactic sugar - public CodeableConcept addCoding(Coding t) { //3 - if (t == null) - return this; - if (this.coding == null) - this.coding = new ArrayList(); - this.coding.add(t); - return this; - } - - /** - * @return {@link #text} (A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeableConcept.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public CodeableConcept setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. - */ - public CodeableConcept setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("coding", "Coding", "A reference to a code defined by a terminology system.", 0, java.lang.Integer.MAX_VALUE, coding)); - childrenList.add(new Property("text", "string", "A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.", 0, java.lang.Integer.MAX_VALUE, text)); - } - - public CodeableConcept copy() { - CodeableConcept dst = new CodeableConcept(); - copyValues(dst); - if (coding != null) { - dst.coding = new ArrayList(); - for (Coding i : coding) - dst.coding.add(i.copy()); - }; - dst.text = text == null ? null : text.copy(); - return dst; - } - - protected CodeableConcept typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CodeableConcept)) - return false; - CodeableConcept o = (CodeableConcept) other; - return compareDeep(coding, o.coding, true) && compareDeep(text, o.text, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CodeableConcept)) - return false; - CodeableConcept o = (CodeableConcept) other; - return compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (coding == null || coding.isEmpty()) && (text == null || text.isEmpty()) - ; - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. + */ +@DatatypeDef(name="CodeableConcept") +public class CodeableConcept extends Type implements ICompositeType { + + /** + * A reference to a code defined by a terminology system. + */ + @Child(name = "coding", type = {Coding.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Code defined by a terminology system", formalDefinition="A reference to a code defined by a terminology system." ) + protected List coding; + + /** + * A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. + */ + @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Plain text representation of the concept", formalDefinition="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user." ) + protected StringType text; + + private static final long serialVersionUID = 760353246L; + + /* + * Constructor + */ + public CodeableConcept() { + super(); + } + + /** + * @return {@link #coding} (A reference to a code defined by a terminology system.) + */ + public List getCoding() { + if (this.coding == null) + this.coding = new ArrayList(); + return this.coding; + } + + public boolean hasCoding() { + if (this.coding == null) + return false; + for (Coding item : this.coding) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #coding} (A reference to a code defined by a terminology system.) + */ + // syntactic sugar + public Coding addCoding() { //3 + Coding t = new Coding(); + if (this.coding == null) + this.coding = new ArrayList(); + this.coding.add(t); + return t; + } + + // syntactic sugar + public CodeableConcept addCoding(Coding t) { //3 + if (t == null) + return this; + if (this.coding == null) + this.coding = new ArrayList(); + this.coding.add(t); + return this; + } + + /** + * @return {@link #text} (A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeableConcept.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public CodeableConcept setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. + */ + public CodeableConcept setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("coding", "Coding", "A reference to a code defined by a terminology system.", 0, java.lang.Integer.MAX_VALUE, coding)); + childrenList.add(new Property("text", "string", "A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.", 0, java.lang.Integer.MAX_VALUE, text)); + } + + public CodeableConcept copy() { + CodeableConcept dst = new CodeableConcept(); + copyValues(dst); + if (coding != null) { + dst.coding = new ArrayList(); + for (Coding i : coding) + dst.coding.add(i.copy()); + }; + dst.text = text == null ? null : text.copy(); + return dst; + } + + protected CodeableConcept typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CodeableConcept)) + return false; + CodeableConcept o = (CodeableConcept) other; + return compareDeep(coding, o.coding, true) && compareDeep(text, o.text, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CodeableConcept)) + return false; + CodeableConcept o = (CodeableConcept) other; + return compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (coding == null || coding.isEmpty()) && (text == null || text.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Coding.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Coding.java index b511078782e..874e844d082 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Coding.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Coding.java @@ -1,408 +1,387 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A reference to a code defined by a terminology system. - */ -@DatatypeDef(name="Coding") -public class Coding extends Type implements IBaseCoding, ICompositeType { - - /** - * The identification of the code system that defines the meaning of the symbol in the code. - */ - @Child(name = "system", type = {UriType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Identity of the terminology system", formalDefinition="The identification of the code system that defines the meaning of the symbol in the code." ) - protected UriType system; - - /** - * The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. - */ - @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Version of the system - if relevant", formalDefinition="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged." ) - protected StringType version; - - /** - * A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). - */ - @Child(name = "code", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Symbol in syntax defined by the system", formalDefinition="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)." ) - protected CodeType code; - - /** - * A representation of the meaning of the code in the system, following the rules of the system. - */ - @Child(name = "display", type = {StringType.class}, order=3, min=0, max=1) - @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=4, min=0, max=1) - @Description(shortDefinition="If this code was chosen directly by the user", formalDefinition="Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays)." ) - protected BooleanType primary; - - private static final long serialVersionUID = 2019442517L; - - /* - * Constructor - */ - 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(); // bb - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (The identification of the code system that defines the meaning of the symbol in the code.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public Coding setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return The identification of the code system that defines the meaning of the symbol in the code. - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value The identification of the code system that defines the meaning of the symbol in the code. - */ - public Coding setSystem(String value) { - if (Utilities.noString(value)) - this.system = null; - else { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - } - return this; - } - - /** - * @return {@link #version} (The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coding.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public Coding setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. - */ - public Coding setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coding.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Coding setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). - */ - public Coding setCode(String value) { - if (Utilities.noString(value)) - this.code = null; - else { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - } - return this; - } - - /** - * @return {@link #display} (A representation of the meaning of the code in the system, following the rules of the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coding.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); // bb - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (A representation of the meaning of the code in the system, following the rules of the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public Coding setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return A representation of the meaning of the code in the system, following the rules of the system. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value A representation of the meaning of the code in the system, following the rules of the system. - */ - public Coding setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - /** - * @return {@link #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(); // bb - 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 || this.primary.isEmpty() ? 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 (this.primary == null) - this.primary = new BooleanType(); - this.primary.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("system", "uri", "The identification of the code system that defines the meaning of the symbol in the code.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("version", "string", "The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("code", "code", "A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("display", "string", "A representation of the meaning of the code in the system, following the rules of the system.", 0, java.lang.Integer.MAX_VALUE, display)); - childrenList.add(new Property("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)); - } - - 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(); - return dst; - } - - protected Coding typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Coding)) - return false; - Coding o = (Coding) other; - return compareDeep(system, o.system, true) && compareDeep(version, o.version, true) && compareDeep(code, o.code, true) - && compareDeep(display, o.display, true) && compareDeep(primary, o.primary, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Coding)) - return false; - Coding o = (Coding) other; - return compareValues(system, o.system, true) && compareValues(version, o.version, true) && compareValues(code, o.code, true) - && compareValues(display, o.display, true) && compareValues(primary, o.primary, true); - } - - 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()) - ; - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A reference to a code defined by a terminology system. + */ +@DatatypeDef(name="Coding") +public class Coding extends Type implements IBaseCoding, ICompositeType { + + /** + * The identification of the code system that defines the meaning of the symbol in the code. + */ + @Child(name = "system", type = {UriType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Identity of the terminology system", formalDefinition="The identification of the code system that defines the meaning of the symbol in the code." ) + protected UriType system; + + /** + * The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. + */ + @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Version of the system - if relevant", formalDefinition="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged." ) + protected StringType version; + + /** + * A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). + */ + @Child(name = "code", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Symbol in syntax defined by the system", formalDefinition="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)." ) + protected CodeType code; + + /** + * A representation of the meaning of the code in the system, following the rules of the system. + */ + @Child(name = "display", type = {StringType.class}, order=3, min=0, max=1) + @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=4, min=0, max=1) + @Description(shortDefinition="If this code was chosen directly by the user", formalDefinition="Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays)." ) + protected BooleanType primary; + + private static final long serialVersionUID = 2019442517L; + + /* + * Constructor + */ + 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(); // bb + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (The identification of the code system that defines the meaning of the symbol in the code.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public Coding setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return The identification of the code system that defines the meaning of the symbol in the code. + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value The identification of the code system that defines the meaning of the symbol in the code. + */ + public Coding setSystem(String value) { + if (Utilities.noString(value)) + this.system = null; + else { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coding.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public Coding setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. + */ + public Coding setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coding.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Coding setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). + */ + public Coding setCode(String value) { + if (Utilities.noString(value)) + this.code = null; + else { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + } + return this; + } + + /** + * @return {@link #display} (A representation of the meaning of the code in the system, following the rules of the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coding.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); // bb + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (A representation of the meaning of the code in the system, following the rules of the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public Coding setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return A representation of the meaning of the code in the system, following the rules of the system. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value A representation of the meaning of the code in the system, following the rules of the system. + */ + public Coding setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + /** + * @return {@link #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(); // bb + 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 || this.primary.isEmpty() ? 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 (this.primary == null) + this.primary = new BooleanType(); + this.primary.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("system", "uri", "The identification of the code system that defines the meaning of the symbol in the code.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("version", "string", "The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("code", "code", "A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("display", "string", "A representation of the meaning of the code in the system, following the rules of the system.", 0, java.lang.Integer.MAX_VALUE, display)); + childrenList.add(new Property("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)); + } + + 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(); + return dst; + } + + protected Coding typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Coding)) + return false; + Coding o = (Coding) other; + return compareDeep(system, o.system, true) && compareDeep(version, o.version, true) && compareDeep(code, o.code, true) + && compareDeep(display, o.display, true) && compareDeep(primary, o.primary, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Coding)) + return false; + Coding o = (Coding) other; + return compareValues(system, o.system, true) && compareValues(version, o.version, true) && compareValues(code, o.code, true) + && compareValues(display, o.display, true) && compareValues(primary, o.primary, true); + } + + 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()) + ; + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Communication.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Communication.java index 12e98d48196..548746e71f7 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Communication.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Communication.java @@ -1,1034 +1,1013 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * An occurrence of information being transmitted. E.g., an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition. - */ -@ResourceDef(name="Communication", profile="http://hl7.org/fhir/Profile/Communication") -public class Communication extends DomainResource { - - public enum CommunicationStatus { - /** - * The communication transmission is ongoing. - */ - INPROGRESS, - /** - * The message transmission is complete, i.e., delivered to the recipient's destination. - */ - COMPLETED, - /** - * The communication transmission has been held by originating system/user request. - */ - SUSPENDED, - /** - * The receiving system has declined to accept the message. - */ - REJECTED, - /** - * There was a failure in transmitting the message out. - */ - FAILED, - /** - * added to help the parsers - */ - NULL; - public static CommunicationStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("completed".equals(codeString)) - return COMPLETED; - if ("suspended".equals(codeString)) - return SUSPENDED; - if ("rejected".equals(codeString)) - return REJECTED; - if ("failed".equals(codeString)) - return FAILED; - throw new Exception("Unknown CommunicationStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INPROGRESS: return "in-progress"; - case COMPLETED: return "completed"; - case SUSPENDED: return "suspended"; - case REJECTED: return "rejected"; - case FAILED: return "failed"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPROGRESS: return ""; - case COMPLETED: return ""; - case SUSPENDED: return ""; - case REJECTED: return ""; - case FAILED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPROGRESS: return "The communication transmission is ongoing."; - case COMPLETED: return "The message transmission is complete, i.e., delivered to the recipient's destination."; - case SUSPENDED: return "The communication transmission has been held by originating system/user request."; - case REJECTED: return "The receiving system has declined to accept the message."; - case FAILED: return "There was a failure in transmitting the message out."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPROGRESS: return "In Progress"; - case COMPLETED: return "Completed"; - case SUSPENDED: return "Suspended"; - case REJECTED: return "Rejected"; - case FAILED: return "Failed"; - default: return "?"; - } - } - } - - public static class CommunicationStatusEnumFactory implements EnumFactory { - public CommunicationStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return CommunicationStatus.INPROGRESS; - if ("completed".equals(codeString)) - return CommunicationStatus.COMPLETED; - if ("suspended".equals(codeString)) - return CommunicationStatus.SUSPENDED; - if ("rejected".equals(codeString)) - return CommunicationStatus.REJECTED; - if ("failed".equals(codeString)) - return CommunicationStatus.FAILED; - throw new IllegalArgumentException("Unknown CommunicationStatus code '"+codeString+"'"); - } - public String toCode(CommunicationStatus code) { - if (code == CommunicationStatus.INPROGRESS) - return "in-progress"; - if (code == CommunicationStatus.COMPLETED) - return "completed"; - if (code == CommunicationStatus.SUSPENDED) - return "suspended"; - if (code == CommunicationStatus.REJECTED) - return "rejected"; - if (code == CommunicationStatus.FAILED) - return "failed"; - return "?"; - } - } - - @Block() - public static class CommunicationPayloadComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An individual message part for multi-part messages. - */ - @Child(name = "content", type = {StringType.class, Attachment.class}, order=1, min=1, max=1) - @Description(shortDefinition="Message part content", formalDefinition="An individual message part for multi-part messages." ) - protected Type content; - - private static final long serialVersionUID = -1763459053L; - - /* - * Constructor - */ - public CommunicationPayloadComponent() { - super(); - } - - /* - * Constructor - */ - public CommunicationPayloadComponent(Type content) { - super(); - this.content = content; - } - - /** - * @return {@link #content} (An individual message part for multi-part messages.) - */ - public Type getContent() { - return this.content; - } - - /** - * @return {@link #content} (An individual message part for multi-part messages.) - */ - public StringType getContentStringType() throws Exception { - if (!(this.content instanceof StringType)) - throw new Exception("Type mismatch: the type StringType was expected, but "+this.content.getClass().getName()+" was encountered"); - return (StringType) this.content; - } - - /** - * @return {@link #content} (An individual message part for multi-part messages.) - */ - public Attachment getContentAttachment() throws Exception { - if (!(this.content instanceof Attachment)) - throw new Exception("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered"); - return (Attachment) this.content; - } - - /** - * @return {@link #content} (An individual message part for multi-part messages.) - */ - public Reference getContentReference() throws Exception { - if (!(this.content instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered"); - return (Reference) this.content; - } - - public boolean hasContent() { - return this.content != null && !this.content.isEmpty(); - } - - /** - * @param value {@link #content} (An individual message part for multi-part messages.) - */ - public CommunicationPayloadComponent setContent(Type value) { - this.content = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("content[x]", "string|Attachment|Reference(Any)", "An individual message part for multi-part messages.", 0, java.lang.Integer.MAX_VALUE, content)); - } - - public CommunicationPayloadComponent copy() { - CommunicationPayloadComponent dst = new CommunicationPayloadComponent(); - copyValues(dst); - dst.content = content == null ? null : content.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CommunicationPayloadComponent)) - return false; - CommunicationPayloadComponent o = (CommunicationPayloadComponent) other; - return compareDeep(content, o.content, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CommunicationPayloadComponent)) - return false; - CommunicationPayloadComponent o = (CommunicationPayloadComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (content == null || content.isEmpty()); - } - - } - - /** - * Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Unique identifier", formalDefinition="Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) - protected List identifier; - - /** - * The type of message conveyed such as alert, notification, reminder, instruction, etc. - */ - @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Message category", formalDefinition="The type of message conveyed such as alert, notification, reminder, instruction, etc." ) - protected CodeableConcept category; - - /** - * The entity (e.g., person, organization, clinical information system, or device) which was the source of the communication. - */ - @Child(name = "sender", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=2, min=0, max=1) - @Description(shortDefinition="Message sender", formalDefinition="The entity (e.g., person, organization, clinical information system, or device) which was the source of the communication." ) - protected Reference sender; - - /** - * The actual object that is the target of the reference (The entity (e.g., person, organization, clinical information system, or device) which was the source of the communication.) - */ - protected Resource senderTarget; - - /** - * The entity (e.g., person, organization, clinical information system, or device) which was the target of the communication. - */ - @Child(name = "recipient", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Message recipient", formalDefinition="The entity (e.g., person, organization, clinical information system, or device) which was the target of the communication." ) - protected List recipient; - /** - * The actual objects that are the target of the reference (The entity (e.g., person, organization, clinical information system, or device) which was the target of the communication.) - */ - protected List recipientTarget; - - - /** - * Text, attachment(s), or resource(s) that was communicated to the recipient. - */ - @Child(name = "payload", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Message payload", formalDefinition="Text, attachment(s), or resource(s) that was communicated to the recipient." ) - protected List payload; - - /** - * The communication medium, e.g., email, fax. - */ - @Child(name = "medium", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Communication medium", formalDefinition="The communication medium, e.g., email, fax." ) - protected List medium; - - /** - * The status of the transmission. - */ - @Child(name = "status", type = {CodeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="in-progress | completed | suspended | rejected | failed", formalDefinition="The status of the transmission." ) - protected Enumeration status; - - /** - * The encounter within which the communication was sent. - */ - @Child(name = "encounter", type = {Encounter.class}, order=7, min=0, max=1) - @Description(shortDefinition="Encounter leading to message", formalDefinition="The encounter within which the communication was sent." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The encounter within which the communication was sent.) - */ - protected Encounter encounterTarget; - - /** - * The time when this communication was sent. - */ - @Child(name = "sent", type = {DateTimeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="When sent", formalDefinition="The time when this communication was sent." ) - protected DateTimeType sent; - - /** - * The time when this communication arrived at the destination. - */ - @Child(name = "received", type = {DateTimeType.class}, order=9, min=0, max=1) - @Description(shortDefinition="When received", formalDefinition="The time when this communication arrived at the destination." ) - protected DateTimeType received; - - /** - * The reason or justification for the communication. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Indication for message", formalDefinition="The reason or justification for the communication." ) - protected List reason; - - /** - * The patient who was the focus of this communication. - */ - @Child(name = "subject", type = {Patient.class}, order=11, min=0, max=1) - @Description(shortDefinition="Focus of message", formalDefinition="The patient who was the focus of this communication." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient who was the focus of this communication.) - */ - protected Patient subjectTarget; - - private static final long serialVersionUID = -744574729L; - - /* - * Constructor - */ - public Communication() { - super(); - } - - /** - * @return {@link #identifier} (Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Communication addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #category} (The type of message conveyed such as alert, notification, reminder, instruction, etc.) - */ - public CodeableConcept getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Communication.category"); - else if (Configuration.doAutoCreate()) - this.category = new CodeableConcept(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (The type of message conveyed such as alert, notification, reminder, instruction, etc.) - */ - public Communication setCategory(CodeableConcept value) { - this.category = value; - return this; - } - - /** - * @return {@link #sender} (The entity (e.g., person, organization, clinical information system, or device) which was the source of the communication.) - */ - public Reference getSender() { - if (this.sender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Communication.sender"); - else if (Configuration.doAutoCreate()) - this.sender = new Reference(); // cc - return this.sender; - } - - public boolean hasSender() { - return this.sender != null && !this.sender.isEmpty(); - } - - /** - * @param value {@link #sender} (The entity (e.g., person, organization, clinical information system, or device) which was the source of the communication.) - */ - public Communication setSender(Reference value) { - this.sender = value; - return this; - } - - /** - * @return {@link #sender} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The entity (e.g., person, organization, clinical information system, or device) which was the source of the communication.) - */ - public Resource getSenderTarget() { - return this.senderTarget; - } - - /** - * @param value {@link #sender} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The entity (e.g., person, organization, clinical information system, or device) which was the source of the communication.) - */ - public Communication setSenderTarget(Resource value) { - this.senderTarget = value; - return this; - } - - /** - * @return {@link #recipient} (The entity (e.g., person, organization, clinical information system, or device) which was the target of the communication.) - */ - public List getRecipient() { - if (this.recipient == null) - this.recipient = new ArrayList(); - return this.recipient; - } - - public boolean hasRecipient() { - if (this.recipient == null) - return false; - for (Reference item : this.recipient) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #recipient} (The entity (e.g., person, organization, clinical information system, or device) which was the target of the communication.) - */ - // syntactic sugar - public Reference addRecipient() { //3 - Reference t = new Reference(); - if (this.recipient == null) - this.recipient = new ArrayList(); - this.recipient.add(t); - return t; - } - - // syntactic sugar - public Communication addRecipient(Reference t) { //3 - if (t == null) - return this; - if (this.recipient == null) - this.recipient = new ArrayList(); - this.recipient.add(t); - return this; - } - - /** - * @return {@link #recipient} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The entity (e.g., person, organization, clinical information system, or device) which was the target of the communication.) - */ - public List getRecipientTarget() { - if (this.recipientTarget == null) - this.recipientTarget = new ArrayList(); - return this.recipientTarget; - } - - /** - * @return {@link #payload} (Text, attachment(s), or resource(s) that was communicated to the recipient.) - */ - public List getPayload() { - if (this.payload == null) - this.payload = new ArrayList(); - return this.payload; - } - - public boolean hasPayload() { - if (this.payload == null) - return false; - for (CommunicationPayloadComponent item : this.payload) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #payload} (Text, attachment(s), or resource(s) that was communicated to the recipient.) - */ - // syntactic sugar - public CommunicationPayloadComponent addPayload() { //3 - CommunicationPayloadComponent t = new CommunicationPayloadComponent(); - if (this.payload == null) - this.payload = new ArrayList(); - this.payload.add(t); - return t; - } - - // syntactic sugar - public Communication addPayload(CommunicationPayloadComponent t) { //3 - if (t == null) - return this; - if (this.payload == null) - this.payload = new ArrayList(); - this.payload.add(t); - return this; - } - - /** - * @return {@link #medium} (The communication medium, e.g., email, fax.) - */ - public List getMedium() { - if (this.medium == null) - this.medium = new ArrayList(); - return this.medium; - } - - public boolean hasMedium() { - if (this.medium == null) - return false; - for (CodeableConcept item : this.medium) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #medium} (The communication medium, e.g., email, fax.) - */ - // syntactic sugar - public CodeableConcept addMedium() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.medium == null) - this.medium = new ArrayList(); - this.medium.add(t); - return t; - } - - // syntactic sugar - public Communication addMedium(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.medium == null) - this.medium = new ArrayList(); - this.medium.add(t); - return this; - } - - /** - * @return {@link #status} (The status of the transmission.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Communication.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new CommunicationStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the transmission.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Communication setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the transmission. - */ - public CommunicationStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the transmission. - */ - public Communication setStatus(CommunicationStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new CommunicationStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #encounter} (The encounter within which the communication was sent.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Communication.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (The encounter within which the communication was sent.) - */ - public Communication setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter within which the communication was sent.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Communication.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter within which the communication was sent.) - */ - public Communication setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #sent} (The time when this communication was sent.). This is the underlying object with id, value and extensions. The accessor "getSent" gives direct access to the value - */ - public DateTimeType getSentElement() { - if (this.sent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Communication.sent"); - else if (Configuration.doAutoCreate()) - this.sent = new DateTimeType(); // bb - return this.sent; - } - - public boolean hasSentElement() { - return this.sent != null && !this.sent.isEmpty(); - } - - public boolean hasSent() { - return this.sent != null && !this.sent.isEmpty(); - } - - /** - * @param value {@link #sent} (The time when this communication was sent.). This is the underlying object with id, value and extensions. The accessor "getSent" gives direct access to the value - */ - public Communication setSentElement(DateTimeType value) { - this.sent = value; - return this; - } - - /** - * @return The time when this communication was sent. - */ - public Date getSent() { - return this.sent == null ? null : this.sent.getValue(); - } - - /** - * @param value The time when this communication was sent. - */ - public Communication setSent(Date value) { - if (value == null) - this.sent = null; - else { - if (this.sent == null) - this.sent = new DateTimeType(); - this.sent.setValue(value); - } - return this; - } - - /** - * @return {@link #received} (The time when this communication arrived at the destination.). This is the underlying object with id, value and extensions. The accessor "getReceived" gives direct access to the value - */ - public DateTimeType getReceivedElement() { - if (this.received == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Communication.received"); - else if (Configuration.doAutoCreate()) - this.received = new DateTimeType(); // bb - return this.received; - } - - public boolean hasReceivedElement() { - return this.received != null && !this.received.isEmpty(); - } - - public boolean hasReceived() { - return this.received != null && !this.received.isEmpty(); - } - - /** - * @param value {@link #received} (The time when this communication arrived at the destination.). This is the underlying object with id, value and extensions. The accessor "getReceived" gives direct access to the value - */ - public Communication setReceivedElement(DateTimeType value) { - this.received = value; - return this; - } - - /** - * @return The time when this communication arrived at the destination. - */ - public Date getReceived() { - return this.received == null ? null : this.received.getValue(); - } - - /** - * @param value The time when this communication arrived at the destination. - */ - public Communication setReceived(Date value) { - if (value == null) - this.received = null; - else { - if (this.received == null) - this.received = new DateTimeType(); - this.received.setValue(value); - } - return this; - } - - /** - * @return {@link #reason} (The reason or justification for the communication.) - */ - public List getReason() { - if (this.reason == null) - this.reason = new ArrayList(); - return this.reason; - } - - public boolean hasReason() { - if (this.reason == null) - return false; - for (CodeableConcept item : this.reason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reason} (The reason or justification for the communication.) - */ - // syntactic sugar - public CodeableConcept addReason() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return t; - } - - // syntactic sugar - public Communication addReason(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return this; - } - - /** - * @return {@link #subject} (The patient who was the focus of this communication.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Communication.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (The patient who was the focus of this communication.) - */ - public Communication setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who was the focus of this communication.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Communication.subject"); - else if (Configuration.doAutoCreate()) - this.subjectTarget = new Patient(); // aa - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who was the focus of this communication.) - */ - public Communication setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("category", "CodeableConcept", "The type of message conveyed such as alert, notification, reminder, instruction, etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("sender", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The entity (e.g., person, organization, clinical information system, or device) which was the source of the communication.", 0, java.lang.Integer.MAX_VALUE, sender)); - childrenList.add(new Property("recipient", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The entity (e.g., person, organization, clinical information system, or device) which was the target of the communication.", 0, java.lang.Integer.MAX_VALUE, recipient)); - childrenList.add(new Property("payload", "", "Text, attachment(s), or resource(s) that was communicated to the recipient.", 0, java.lang.Integer.MAX_VALUE, payload)); - childrenList.add(new Property("medium", "CodeableConcept", "The communication medium, e.g., email, fax.", 0, java.lang.Integer.MAX_VALUE, medium)); - childrenList.add(new Property("status", "code", "The status of the transmission.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter within which the communication was sent.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("sent", "dateTime", "The time when this communication was sent.", 0, java.lang.Integer.MAX_VALUE, sent)); - childrenList.add(new Property("received", "dateTime", "The time when this communication arrived at the destination.", 0, java.lang.Integer.MAX_VALUE, received)); - childrenList.add(new Property("reason", "CodeableConcept", "The reason or justification for the communication.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("subject", "Reference(Patient)", "The patient who was the focus of this communication.", 0, java.lang.Integer.MAX_VALUE, subject)); - } - - public Communication copy() { - Communication dst = new Communication(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.category = category == null ? null : category.copy(); - dst.sender = sender == null ? null : sender.copy(); - if (recipient != null) { - dst.recipient = new ArrayList(); - for (Reference i : recipient) - dst.recipient.add(i.copy()); - }; - if (payload != null) { - dst.payload = new ArrayList(); - for (CommunicationPayloadComponent i : payload) - dst.payload.add(i.copy()); - }; - if (medium != null) { - dst.medium = new ArrayList(); - for (CodeableConcept i : medium) - dst.medium.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.sent = sent == null ? null : sent.copy(); - dst.received = received == null ? null : received.copy(); - if (reason != null) { - dst.reason = new ArrayList(); - for (CodeableConcept i : reason) - dst.reason.add(i.copy()); - }; - dst.subject = subject == null ? null : subject.copy(); - return dst; - } - - protected Communication typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Communication)) - return false; - Communication o = (Communication) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(category, o.category, true) && compareDeep(sender, o.sender, true) - && compareDeep(recipient, o.recipient, true) && compareDeep(payload, o.payload, true) && compareDeep(medium, o.medium, true) - && compareDeep(status, o.status, true) && compareDeep(encounter, o.encounter, true) && compareDeep(sent, o.sent, true) - && compareDeep(received, o.received, true) && compareDeep(reason, o.reason, true) && compareDeep(subject, o.subject, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Communication)) - return false; - Communication o = (Communication) other; - return compareValues(status, o.status, true) && compareValues(sent, o.sent, true) && compareValues(received, o.received, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty()) - && (sender == null || sender.isEmpty()) && (recipient == null || recipient.isEmpty()) && (payload == null || payload.isEmpty()) - && (medium == null || medium.isEmpty()) && (status == null || status.isEmpty()) && (encounter == null || encounter.isEmpty()) - && (sent == null || sent.isEmpty()) && (received == null || received.isEmpty()) && (reason == null || reason.isEmpty()) - && (subject == null || subject.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Communication; - } - - @SearchParamDefinition(name="sender", path="Communication.sender", description="Message sender", type="reference" ) - public static final String SP_SENDER = "sender"; - @SearchParamDefinition(name="sent", path="Communication.sent", description="When sent", type="date" ) - public static final String SP_SENT = "sent"; - @SearchParamDefinition(name="category", path="Communication.category", description="Message category", type="token" ) - public static final String SP_CATEGORY = "category"; - @SearchParamDefinition(name="patient", path="Communication.subject", description="Focus of message", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="status", path="Communication.status", description="in-progress | completed | suspended | rejected | failed", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="subject", path="Communication.subject", description="Focus of message", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="received", path="Communication.received", description="When received", type="date" ) - public static final String SP_RECEIVED = "received"; - @SearchParamDefinition(name="encounter", path="Communication.encounter", description="Encounter leading to message", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - @SearchParamDefinition(name="identifier", path="Communication.identifier", description="Unique identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="medium", path="Communication.medium", description="Communication medium", type="token" ) - public static final String SP_MEDIUM = "medium"; - @SearchParamDefinition(name="recipient", path="Communication.recipient", description="Message recipient", type="reference" ) - public static final String SP_RECIPIENT = "recipient"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * An occurrence of information being transmitted. E.g., an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition. + */ +@ResourceDef(name="Communication", profile="http://hl7.org/fhir/Profile/Communication") +public class Communication extends DomainResource { + + public enum CommunicationStatus { + /** + * The communication transmission is ongoing. + */ + INPROGRESS, + /** + * The message transmission is complete, i.e., delivered to the recipient's destination. + */ + COMPLETED, + /** + * The communication transmission has been held by originating system/user request. + */ + SUSPENDED, + /** + * The receiving system has declined to accept the message. + */ + REJECTED, + /** + * There was a failure in transmitting the message out. + */ + FAILED, + /** + * added to help the parsers + */ + NULL; + public static CommunicationStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("completed".equals(codeString)) + return COMPLETED; + if ("suspended".equals(codeString)) + return SUSPENDED; + if ("rejected".equals(codeString)) + return REJECTED; + if ("failed".equals(codeString)) + return FAILED; + throw new Exception("Unknown CommunicationStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INPROGRESS: return "in-progress"; + case COMPLETED: return "completed"; + case SUSPENDED: return "suspended"; + case REJECTED: return "rejected"; + case FAILED: return "failed"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return ""; + case COMPLETED: return ""; + case SUSPENDED: return ""; + case REJECTED: return ""; + case FAILED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "The communication transmission is ongoing."; + case COMPLETED: return "The message transmission is complete, i.e., delivered to the recipient's destination."; + case SUSPENDED: return "The communication transmission has been held by originating system/user request."; + case REJECTED: return "The receiving system has declined to accept the message."; + case FAILED: return "There was a failure in transmitting the message out."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "In Progress"; + case COMPLETED: return "Completed"; + case SUSPENDED: return "Suspended"; + case REJECTED: return "Rejected"; + case FAILED: return "Failed"; + default: return "?"; + } + } + } + + public static class CommunicationStatusEnumFactory implements EnumFactory { + public CommunicationStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return CommunicationStatus.INPROGRESS; + if ("completed".equals(codeString)) + return CommunicationStatus.COMPLETED; + if ("suspended".equals(codeString)) + return CommunicationStatus.SUSPENDED; + if ("rejected".equals(codeString)) + return CommunicationStatus.REJECTED; + if ("failed".equals(codeString)) + return CommunicationStatus.FAILED; + throw new IllegalArgumentException("Unknown CommunicationStatus code '"+codeString+"'"); + } + public String toCode(CommunicationStatus code) { + if (code == CommunicationStatus.INPROGRESS) + return "in-progress"; + if (code == CommunicationStatus.COMPLETED) + return "completed"; + if (code == CommunicationStatus.SUSPENDED) + return "suspended"; + if (code == CommunicationStatus.REJECTED) + return "rejected"; + if (code == CommunicationStatus.FAILED) + return "failed"; + return "?"; + } + } + + @Block() + public static class CommunicationPayloadComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An individual message part for multi-part messages. + */ + @Child(name = "content", type = {StringType.class, Attachment.class}, order=1, min=1, max=1) + @Description(shortDefinition="Message part content", formalDefinition="An individual message part for multi-part messages." ) + protected Type content; + + private static final long serialVersionUID = -1763459053L; + + /* + * Constructor + */ + public CommunicationPayloadComponent() { + super(); + } + + /* + * Constructor + */ + public CommunicationPayloadComponent(Type content) { + super(); + this.content = content; + } + + /** + * @return {@link #content} (An individual message part for multi-part messages.) + */ + public Type getContent() { + return this.content; + } + + /** + * @return {@link #content} (An individual message part for multi-part messages.) + */ + public StringType getContentStringType() throws Exception { + if (!(this.content instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.content.getClass().getName()+" was encountered"); + return (StringType) this.content; + } + + /** + * @return {@link #content} (An individual message part for multi-part messages.) + */ + public Attachment getContentAttachment() throws Exception { + if (!(this.content instanceof Attachment)) + throw new Exception("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Attachment) this.content; + } + + /** + * @return {@link #content} (An individual message part for multi-part messages.) + */ + public Reference getContentReference() throws Exception { + if (!(this.content instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Reference) this.content; + } + + public boolean hasContent() { + return this.content != null && !this.content.isEmpty(); + } + + /** + * @param value {@link #content} (An individual message part for multi-part messages.) + */ + public CommunicationPayloadComponent setContent(Type value) { + this.content = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("content[x]", "string|Attachment|Reference(Any)", "An individual message part for multi-part messages.", 0, java.lang.Integer.MAX_VALUE, content)); + } + + public CommunicationPayloadComponent copy() { + CommunicationPayloadComponent dst = new CommunicationPayloadComponent(); + copyValues(dst); + dst.content = content == null ? null : content.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CommunicationPayloadComponent)) + return false; + CommunicationPayloadComponent o = (CommunicationPayloadComponent) other; + return compareDeep(content, o.content, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CommunicationPayloadComponent)) + return false; + CommunicationPayloadComponent o = (CommunicationPayloadComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (content == null || content.isEmpty()); + } + + } + + /** + * Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Unique identifier", formalDefinition="Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) + protected List identifier; + + /** + * The type of message conveyed such as alert, notification, reminder, instruction, etc. + */ + @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Message category", formalDefinition="The type of message conveyed such as alert, notification, reminder, instruction, etc." ) + protected CodeableConcept category; + + /** + * The entity (e.g., person, organization, clinical information system, or device) which was the source of the communication. + */ + @Child(name = "sender", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=2, min=0, max=1) + @Description(shortDefinition="Message sender", formalDefinition="The entity (e.g., person, organization, clinical information system, or device) which was the source of the communication." ) + protected Reference sender; + + /** + * The actual object that is the target of the reference (The entity (e.g., person, organization, clinical information system, or device) which was the source of the communication.) + */ + protected Resource senderTarget; + + /** + * The entity (e.g., person, organization, clinical information system, or device) which was the target of the communication. + */ + @Child(name = "recipient", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Message recipient", formalDefinition="The entity (e.g., person, organization, clinical information system, or device) which was the target of the communication." ) + protected List recipient; + /** + * The actual objects that are the target of the reference (The entity (e.g., person, organization, clinical information system, or device) which was the target of the communication.) + */ + protected List recipientTarget; + + + /** + * Text, attachment(s), or resource(s) that was communicated to the recipient. + */ + @Child(name = "payload", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Message payload", formalDefinition="Text, attachment(s), or resource(s) that was communicated to the recipient." ) + protected List payload; + + /** + * The communication medium, e.g., email, fax. + */ + @Child(name = "medium", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Communication medium", formalDefinition="The communication medium, e.g., email, fax." ) + protected List medium; + + /** + * The status of the transmission. + */ + @Child(name = "status", type = {CodeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="in-progress | completed | suspended | rejected | failed", formalDefinition="The status of the transmission." ) + protected Enumeration status; + + /** + * The encounter within which the communication was sent. + */ + @Child(name = "encounter", type = {Encounter.class}, order=7, min=0, max=1) + @Description(shortDefinition="Encounter leading to message", formalDefinition="The encounter within which the communication was sent." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The encounter within which the communication was sent.) + */ + protected Encounter encounterTarget; + + /** + * The time when this communication was sent. + */ + @Child(name = "sent", type = {DateTimeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="When sent", formalDefinition="The time when this communication was sent." ) + protected DateTimeType sent; + + /** + * The time when this communication arrived at the destination. + */ + @Child(name = "received", type = {DateTimeType.class}, order=9, min=0, max=1) + @Description(shortDefinition="When received", formalDefinition="The time when this communication arrived at the destination." ) + protected DateTimeType received; + + /** + * The reason or justification for the communication. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Indication for message", formalDefinition="The reason or justification for the communication." ) + protected List reason; + + /** + * The patient who was the focus of this communication. + */ + @Child(name = "subject", type = {Patient.class}, order=11, min=0, max=1) + @Description(shortDefinition="Focus of message", formalDefinition="The patient who was the focus of this communication." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient who was the focus of this communication.) + */ + protected Patient subjectTarget; + + private static final long serialVersionUID = -744574729L; + + /* + * Constructor + */ + public Communication() { + super(); + } + + /** + * @return {@link #identifier} (Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Communication addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #category} (The type of message conveyed such as alert, notification, reminder, instruction, etc.) + */ + public CodeableConcept getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Communication.category"); + else if (Configuration.doAutoCreate()) + this.category = new CodeableConcept(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (The type of message conveyed such as alert, notification, reminder, instruction, etc.) + */ + public Communication setCategory(CodeableConcept value) { + this.category = value; + return this; + } + + /** + * @return {@link #sender} (The entity (e.g., person, organization, clinical information system, or device) which was the source of the communication.) + */ + public Reference getSender() { + if (this.sender == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Communication.sender"); + else if (Configuration.doAutoCreate()) + this.sender = new Reference(); // cc + return this.sender; + } + + public boolean hasSender() { + return this.sender != null && !this.sender.isEmpty(); + } + + /** + * @param value {@link #sender} (The entity (e.g., person, organization, clinical information system, or device) which was the source of the communication.) + */ + public Communication setSender(Reference value) { + this.sender = value; + return this; + } + + /** + * @return {@link #sender} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The entity (e.g., person, organization, clinical information system, or device) which was the source of the communication.) + */ + public Resource getSenderTarget() { + return this.senderTarget; + } + + /** + * @param value {@link #sender} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The entity (e.g., person, organization, clinical information system, or device) which was the source of the communication.) + */ + public Communication setSenderTarget(Resource value) { + this.senderTarget = value; + return this; + } + + /** + * @return {@link #recipient} (The entity (e.g., person, organization, clinical information system, or device) which was the target of the communication.) + */ + public List getRecipient() { + if (this.recipient == null) + this.recipient = new ArrayList(); + return this.recipient; + } + + public boolean hasRecipient() { + if (this.recipient == null) + return false; + for (Reference item : this.recipient) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #recipient} (The entity (e.g., person, organization, clinical information system, or device) which was the target of the communication.) + */ + // syntactic sugar + public Reference addRecipient() { //3 + Reference t = new Reference(); + if (this.recipient == null) + this.recipient = new ArrayList(); + this.recipient.add(t); + return t; + } + + // syntactic sugar + public Communication addRecipient(Reference t) { //3 + if (t == null) + return this; + if (this.recipient == null) + this.recipient = new ArrayList(); + this.recipient.add(t); + return this; + } + + /** + * @return {@link #recipient} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The entity (e.g., person, organization, clinical information system, or device) which was the target of the communication.) + */ + public List getRecipientTarget() { + if (this.recipientTarget == null) + this.recipientTarget = new ArrayList(); + return this.recipientTarget; + } + + /** + * @return {@link #payload} (Text, attachment(s), or resource(s) that was communicated to the recipient.) + */ + public List getPayload() { + if (this.payload == null) + this.payload = new ArrayList(); + return this.payload; + } + + public boolean hasPayload() { + if (this.payload == null) + return false; + for (CommunicationPayloadComponent item : this.payload) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #payload} (Text, attachment(s), or resource(s) that was communicated to the recipient.) + */ + // syntactic sugar + public CommunicationPayloadComponent addPayload() { //3 + CommunicationPayloadComponent t = new CommunicationPayloadComponent(); + if (this.payload == null) + this.payload = new ArrayList(); + this.payload.add(t); + return t; + } + + // syntactic sugar + public Communication addPayload(CommunicationPayloadComponent t) { //3 + if (t == null) + return this; + if (this.payload == null) + this.payload = new ArrayList(); + this.payload.add(t); + return this; + } + + /** + * @return {@link #medium} (The communication medium, e.g., email, fax.) + */ + public List getMedium() { + if (this.medium == null) + this.medium = new ArrayList(); + return this.medium; + } + + public boolean hasMedium() { + if (this.medium == null) + return false; + for (CodeableConcept item : this.medium) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #medium} (The communication medium, e.g., email, fax.) + */ + // syntactic sugar + public CodeableConcept addMedium() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.medium == null) + this.medium = new ArrayList(); + this.medium.add(t); + return t; + } + + // syntactic sugar + public Communication addMedium(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.medium == null) + this.medium = new ArrayList(); + this.medium.add(t); + return this; + } + + /** + * @return {@link #status} (The status of the transmission.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Communication.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new CommunicationStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status of the transmission.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Communication setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the transmission. + */ + public CommunicationStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the transmission. + */ + public Communication setStatus(CommunicationStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new CommunicationStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #encounter} (The encounter within which the communication was sent.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Communication.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (The encounter within which the communication was sent.) + */ + public Communication setEncounter(Reference value) { + this.encounter = value; + return this; + } + + /** + * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter within which the communication was sent.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Communication.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + return this.encounterTarget; + } + + /** + * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter within which the communication was sent.) + */ + public Communication setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #sent} (The time when this communication was sent.). This is the underlying object with id, value and extensions. The accessor "getSent" gives direct access to the value + */ + public DateTimeType getSentElement() { + if (this.sent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Communication.sent"); + else if (Configuration.doAutoCreate()) + this.sent = new DateTimeType(); // bb + return this.sent; + } + + public boolean hasSentElement() { + return this.sent != null && !this.sent.isEmpty(); + } + + public boolean hasSent() { + return this.sent != null && !this.sent.isEmpty(); + } + + /** + * @param value {@link #sent} (The time when this communication was sent.). This is the underlying object with id, value and extensions. The accessor "getSent" gives direct access to the value + */ + public Communication setSentElement(DateTimeType value) { + this.sent = value; + return this; + } + + /** + * @return The time when this communication was sent. + */ + public Date getSent() { + return this.sent == null ? null : this.sent.getValue(); + } + + /** + * @param value The time when this communication was sent. + */ + public Communication setSent(Date value) { + if (value == null) + this.sent = null; + else { + if (this.sent == null) + this.sent = new DateTimeType(); + this.sent.setValue(value); + } + return this; + } + + /** + * @return {@link #received} (The time when this communication arrived at the destination.). This is the underlying object with id, value and extensions. The accessor "getReceived" gives direct access to the value + */ + public DateTimeType getReceivedElement() { + if (this.received == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Communication.received"); + else if (Configuration.doAutoCreate()) + this.received = new DateTimeType(); // bb + return this.received; + } + + public boolean hasReceivedElement() { + return this.received != null && !this.received.isEmpty(); + } + + public boolean hasReceived() { + return this.received != null && !this.received.isEmpty(); + } + + /** + * @param value {@link #received} (The time when this communication arrived at the destination.). This is the underlying object with id, value and extensions. The accessor "getReceived" gives direct access to the value + */ + public Communication setReceivedElement(DateTimeType value) { + this.received = value; + return this; + } + + /** + * @return The time when this communication arrived at the destination. + */ + public Date getReceived() { + return this.received == null ? null : this.received.getValue(); + } + + /** + * @param value The time when this communication arrived at the destination. + */ + public Communication setReceived(Date value) { + if (value == null) + this.received = null; + else { + if (this.received == null) + this.received = new DateTimeType(); + this.received.setValue(value); + } + return this; + } + + /** + * @return {@link #reason} (The reason or justification for the communication.) + */ + public List getReason() { + if (this.reason == null) + this.reason = new ArrayList(); + return this.reason; + } + + public boolean hasReason() { + if (this.reason == null) + return false; + for (CodeableConcept item : this.reason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reason} (The reason or justification for the communication.) + */ + // syntactic sugar + public CodeableConcept addReason() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return t; + } + + // syntactic sugar + public Communication addReason(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return this; + } + + /** + * @return {@link #subject} (The patient who was the focus of this communication.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Communication.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The patient who was the focus of this communication.) + */ + public Communication setSubject(Reference value) { + this.subject = value; + return this; + } + + /** + * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who was the focus of this communication.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Communication.subject"); + else if (Configuration.doAutoCreate()) + this.subjectTarget = new Patient(); // aa + return this.subjectTarget; + } + + /** + * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who was the focus of this communication.) + */ + public Communication setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("category", "CodeableConcept", "The type of message conveyed such as alert, notification, reminder, instruction, etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("sender", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The entity (e.g., person, organization, clinical information system, or device) which was the source of the communication.", 0, java.lang.Integer.MAX_VALUE, sender)); + childrenList.add(new Property("recipient", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The entity (e.g., person, organization, clinical information system, or device) which was the target of the communication.", 0, java.lang.Integer.MAX_VALUE, recipient)); + childrenList.add(new Property("payload", "", "Text, attachment(s), or resource(s) that was communicated to the recipient.", 0, java.lang.Integer.MAX_VALUE, payload)); + childrenList.add(new Property("medium", "CodeableConcept", "The communication medium, e.g., email, fax.", 0, java.lang.Integer.MAX_VALUE, medium)); + childrenList.add(new Property("status", "code", "The status of the transmission.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter within which the communication was sent.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("sent", "dateTime", "The time when this communication was sent.", 0, java.lang.Integer.MAX_VALUE, sent)); + childrenList.add(new Property("received", "dateTime", "The time when this communication arrived at the destination.", 0, java.lang.Integer.MAX_VALUE, received)); + childrenList.add(new Property("reason", "CodeableConcept", "The reason or justification for the communication.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("subject", "Reference(Patient)", "The patient who was the focus of this communication.", 0, java.lang.Integer.MAX_VALUE, subject)); + } + + public Communication copy() { + Communication dst = new Communication(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.category = category == null ? null : category.copy(); + dst.sender = sender == null ? null : sender.copy(); + if (recipient != null) { + dst.recipient = new ArrayList(); + for (Reference i : recipient) + dst.recipient.add(i.copy()); + }; + if (payload != null) { + dst.payload = new ArrayList(); + for (CommunicationPayloadComponent i : payload) + dst.payload.add(i.copy()); + }; + if (medium != null) { + dst.medium = new ArrayList(); + for (CodeableConcept i : medium) + dst.medium.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.sent = sent == null ? null : sent.copy(); + dst.received = received == null ? null : received.copy(); + if (reason != null) { + dst.reason = new ArrayList(); + for (CodeableConcept i : reason) + dst.reason.add(i.copy()); + }; + dst.subject = subject == null ? null : subject.copy(); + return dst; + } + + protected Communication typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Communication)) + return false; + Communication o = (Communication) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(category, o.category, true) && compareDeep(sender, o.sender, true) + && compareDeep(recipient, o.recipient, true) && compareDeep(payload, o.payload, true) && compareDeep(medium, o.medium, true) + && compareDeep(status, o.status, true) && compareDeep(encounter, o.encounter, true) && compareDeep(sent, o.sent, true) + && compareDeep(received, o.received, true) && compareDeep(reason, o.reason, true) && compareDeep(subject, o.subject, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Communication)) + return false; + Communication o = (Communication) other; + return compareValues(status, o.status, true) && compareValues(sent, o.sent, true) && compareValues(received, o.received, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty()) + && (sender == null || sender.isEmpty()) && (recipient == null || recipient.isEmpty()) && (payload == null || payload.isEmpty()) + && (medium == null || medium.isEmpty()) && (status == null || status.isEmpty()) && (encounter == null || encounter.isEmpty()) + && (sent == null || sent.isEmpty()) && (received == null || received.isEmpty()) && (reason == null || reason.isEmpty()) + && (subject == null || subject.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Communication; + } + + @SearchParamDefinition(name="identifier", path="Communication.identifier", description="Unique identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="sender", path="Communication.sender", description="Message sender", type="reference" ) + public static final String SP_SENDER = "sender"; + @SearchParamDefinition(name="subject", path="Communication.subject", description="Focus of message", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="patient", path="Communication.subject", description="Focus of message", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="recipient", path="Communication.recipient", description="Message recipient", type="reference" ) + public static final String SP_RECIPIENT = "recipient"; + @SearchParamDefinition(name="received", path="Communication.received", description="When received", type="date" ) + public static final String SP_RECEIVED = "received"; + @SearchParamDefinition(name="medium", path="Communication.medium", description="Communication medium", type="token" ) + public static final String SP_MEDIUM = "medium"; + @SearchParamDefinition(name="encounter", path="Communication.encounter", description="Encounter leading to message", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + @SearchParamDefinition(name="category", path="Communication.category", description="Message category", type="token" ) + public static final String SP_CATEGORY = "category"; + @SearchParamDefinition(name="sent", path="Communication.sent", description="When sent", type="date" ) + public static final String SP_SENT = "sent"; + @SearchParamDefinition(name="status", path="Communication.status", description="in-progress | completed | suspended | rejected | failed", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/CommunicationRequest.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/CommunicationRequest.java index 9c0ad7ca84a..c05f7fbf49c 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/CommunicationRequest.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/CommunicationRequest.java @@ -1,1195 +1,1174 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A request to convey information. E.g., the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. - */ -@ResourceDef(name="CommunicationRequest", profile="http://hl7.org/fhir/Profile/CommunicationRequest") -public class CommunicationRequest extends DomainResource { - - public enum CommunicationRequestStatus { - /** - * The request has been proposed. - */ - PROPOSED, - /** - * The request has been planned. - */ - PLANNED, - /** - * The request has been placed. - */ - REQUESTED, - /** - * The receiving system has received the request but not yet decided whether it will be performed. - */ - RECEIVED, - /** - * The receiving system has accepted the order, but work has not yet commenced. - */ - ACCEPTED, - /** - * The work to fulfill the order is happening. - */ - INPROGRESS, - /** - * The work has been complete, the report(s) released, and no further work is planned. - */ - COMPLETED, - /** - * The request has been held by originating system/user request. - */ - SUSPENDED, - /** - * The receiving system has declined to fulfill the request. - */ - REJECTED, - /** - * The communication was attempted, but due to some procedural error, it could not be completed. - */ - FAILED, - /** - * added to help the parsers - */ - NULL; - public static CommunicationRequestStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("planned".equals(codeString)) - return PLANNED; - if ("requested".equals(codeString)) - return REQUESTED; - if ("received".equals(codeString)) - return RECEIVED; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("completed".equals(codeString)) - return COMPLETED; - if ("suspended".equals(codeString)) - return SUSPENDED; - if ("rejected".equals(codeString)) - return REJECTED; - if ("failed".equals(codeString)) - return FAILED; - throw new Exception("Unknown CommunicationRequestStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PROPOSED: return "proposed"; - case PLANNED: return "planned"; - case REQUESTED: return "requested"; - case RECEIVED: return "received"; - case ACCEPTED: return "accepted"; - case INPROGRESS: return "in-progress"; - case COMPLETED: return "completed"; - case SUSPENDED: return "suspended"; - case REJECTED: return "rejected"; - case FAILED: return "failed"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PROPOSED: return ""; - case PLANNED: return ""; - case REQUESTED: return ""; - case RECEIVED: return ""; - case ACCEPTED: return ""; - case INPROGRESS: return ""; - case COMPLETED: return ""; - case SUSPENDED: return ""; - case REJECTED: return ""; - case FAILED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PROPOSED: return "The request has been proposed."; - case PLANNED: return "The request has been planned."; - case REQUESTED: return "The request has been placed."; - case RECEIVED: return "The receiving system has received the request but not yet decided whether it will be performed."; - case ACCEPTED: return "The receiving system has accepted the order, but work has not yet commenced."; - case INPROGRESS: return "The work to fulfill the order is happening."; - case COMPLETED: return "The work has been complete, the report(s) released, and no further work is planned."; - case SUSPENDED: return "The request has been held by originating system/user request."; - case REJECTED: return "The receiving system has declined to fulfill the request."; - case FAILED: return "The communication was attempted, but due to some procedural error, it could not be completed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PROPOSED: return "Proposed"; - case PLANNED: return "Planned"; - case REQUESTED: return "Requested"; - case RECEIVED: return "Received"; - case ACCEPTED: return "Accepted"; - case INPROGRESS: return "In Progress"; - case COMPLETED: return "Completed"; - case SUSPENDED: return "Suspended"; - case REJECTED: return "Rejected"; - case FAILED: return "Failed"; - default: return "?"; - } - } - } - - public static class CommunicationRequestStatusEnumFactory implements EnumFactory { - public CommunicationRequestStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return CommunicationRequestStatus.PROPOSED; - if ("planned".equals(codeString)) - return CommunicationRequestStatus.PLANNED; - if ("requested".equals(codeString)) - return CommunicationRequestStatus.REQUESTED; - if ("received".equals(codeString)) - return CommunicationRequestStatus.RECEIVED; - if ("accepted".equals(codeString)) - return CommunicationRequestStatus.ACCEPTED; - if ("in-progress".equals(codeString)) - return CommunicationRequestStatus.INPROGRESS; - if ("completed".equals(codeString)) - return CommunicationRequestStatus.COMPLETED; - if ("suspended".equals(codeString)) - return CommunicationRequestStatus.SUSPENDED; - if ("rejected".equals(codeString)) - return CommunicationRequestStatus.REJECTED; - if ("failed".equals(codeString)) - return CommunicationRequestStatus.FAILED; - throw new IllegalArgumentException("Unknown CommunicationRequestStatus code '"+codeString+"'"); - } - public String toCode(CommunicationRequestStatus code) { - if (code == CommunicationRequestStatus.PROPOSED) - return "proposed"; - if (code == CommunicationRequestStatus.PLANNED) - return "planned"; - if (code == CommunicationRequestStatus.REQUESTED) - return "requested"; - if (code == CommunicationRequestStatus.RECEIVED) - return "received"; - if (code == CommunicationRequestStatus.ACCEPTED) - return "accepted"; - if (code == CommunicationRequestStatus.INPROGRESS) - return "in-progress"; - if (code == CommunicationRequestStatus.COMPLETED) - return "completed"; - if (code == CommunicationRequestStatus.SUSPENDED) - return "suspended"; - if (code == CommunicationRequestStatus.REJECTED) - return "rejected"; - if (code == CommunicationRequestStatus.FAILED) - return "failed"; - return "?"; - } - } - - @Block() - public static class CommunicationRequestPayloadComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An individual message part for multi-part messages. - */ - @Child(name = "content", type = {StringType.class, Attachment.class}, order=1, min=1, max=1) - @Description(shortDefinition="Message part content", formalDefinition="An individual message part for multi-part messages." ) - protected Type content; - - private static final long serialVersionUID = -1763459053L; - - /* - * Constructor - */ - public CommunicationRequestPayloadComponent() { - super(); - } - - /* - * Constructor - */ - public CommunicationRequestPayloadComponent(Type content) { - super(); - this.content = content; - } - - /** - * @return {@link #content} (An individual message part for multi-part messages.) - */ - public Type getContent() { - return this.content; - } - - /** - * @return {@link #content} (An individual message part for multi-part messages.) - */ - public StringType getContentStringType() throws Exception { - if (!(this.content instanceof StringType)) - throw new Exception("Type mismatch: the type StringType was expected, but "+this.content.getClass().getName()+" was encountered"); - return (StringType) this.content; - } - - /** - * @return {@link #content} (An individual message part for multi-part messages.) - */ - public Attachment getContentAttachment() throws Exception { - if (!(this.content instanceof Attachment)) - throw new Exception("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered"); - return (Attachment) this.content; - } - - /** - * @return {@link #content} (An individual message part for multi-part messages.) - */ - public Reference getContentReference() throws Exception { - if (!(this.content instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered"); - return (Reference) this.content; - } - - public boolean hasContent() { - return this.content != null && !this.content.isEmpty(); - } - - /** - * @param value {@link #content} (An individual message part for multi-part messages.) - */ - public CommunicationRequestPayloadComponent setContent(Type value) { - this.content = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("content[x]", "string|Attachment|Reference(Any)", "An individual message part for multi-part messages.", 0, java.lang.Integer.MAX_VALUE, content)); - } - - public CommunicationRequestPayloadComponent copy() { - CommunicationRequestPayloadComponent dst = new CommunicationRequestPayloadComponent(); - copyValues(dst); - dst.content = content == null ? null : content.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CommunicationRequestPayloadComponent)) - return false; - CommunicationRequestPayloadComponent o = (CommunicationRequestPayloadComponent) other; - return compareDeep(content, o.content, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CommunicationRequestPayloadComponent)) - return false; - CommunicationRequestPayloadComponent o = (CommunicationRequestPayloadComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (content == null || content.isEmpty()); - } - - } - - /** - * A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Unique identifier", formalDefinition="A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system." ) - protected List identifier; - - /** - * The type of message to be sent such as alert, notification, reminder, instruction, etc. - */ - @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Message category", formalDefinition="The type of message to be sent such as alert, notification, reminder, instruction, etc." ) - protected CodeableConcept category; - - /** - * The entity (e.g., person, organization, clinical information system, or device) which is to be the source of the communication. - */ - @Child(name = "sender", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=2, min=0, max=1) - @Description(shortDefinition="Message sender", formalDefinition="The entity (e.g., person, organization, clinical information system, or device) which is to be the source of the communication." ) - protected Reference sender; - - /** - * The actual object that is the target of the reference (The entity (e.g., person, organization, clinical information system, or device) which is to be the source of the communication.) - */ - protected Resource senderTarget; - - /** - * The entity (e.g., person, organization, clinical information system, or device) which is the intended target of the communication. - */ - @Child(name = "recipient", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Message recipient", formalDefinition="The entity (e.g., person, organization, clinical information system, or device) which is the intended target of the communication." ) - protected List recipient; - /** - * The actual objects that are the target of the reference (The entity (e.g., person, organization, clinical information system, or device) which is the intended target of the communication.) - */ - protected List recipientTarget; - - - /** - * Text, attachment(s), or resource(s) to be communicated to the recipient. - */ - @Child(name = "payload", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Message payload", formalDefinition="Text, attachment(s), or resource(s) to be communicated to the recipient." ) - protected List payload; - - /** - * The communication medium to be used, e.g., email, fax. - */ - @Child(name = "medium", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Communication medium", formalDefinition="The communication medium to be used, e.g., email, fax." ) - protected List medium; - - /** - * The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application. - */ - @Child(name = "requester", type = {Practitioner.class, Patient.class, RelatedPerson.class}, order=6, min=0, max=1) - @Description(shortDefinition="Requester of communication", formalDefinition="The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application." ) - protected Reference requester; - - /** - * The actual object that is the target of the reference (The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.) - */ - protected Resource requesterTarget; - - /** - * The status of the proposal or order. - */ - @Child(name = "status", type = {CodeType.class}, order=7, min=0, max=1) - @Description(shortDefinition="proposed | planned | requested | received | accepted | in-progress | completed | suspended | rejected | failed", formalDefinition="The status of the proposal or order." ) - protected Enumeration status; - - /** - * The encounter within which the communication request was created. - */ - @Child(name = "encounter", type = {Encounter.class}, order=8, min=0, max=1) - @Description(shortDefinition="Encounter leading to message", formalDefinition="The encounter within which the communication request was created." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The encounter within which the communication request was created.) - */ - protected Encounter encounterTarget; - - /** - * The time when this communication is to occur. - */ - @Child(name = "scheduledTime", type = {DateTimeType.class}, order=9, min=0, max=1) - @Description(shortDefinition="When scheduled", formalDefinition="The time when this communication is to occur." ) - protected DateTimeType scheduledTime; - - /** - * The reason or justification for the communication request. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Indication for message", formalDefinition="The reason or justification for the communication request." ) - protected List reason; - - /** - * The time when the request was made. - */ - @Child(name = "orderedOn", type = {DateTimeType.class}, order=11, min=0, max=1) - @Description(shortDefinition="When ordered or proposed", formalDefinition="The time when the request was made." ) - protected DateTimeType orderedOn; - - /** - * The patient who is the focus of this communication request. - */ - @Child(name = "subject", type = {Patient.class}, order=12, min=0, max=1) - @Description(shortDefinition="Focus of message", formalDefinition="The patient who is the focus of this communication request." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient who is the focus of this communication request.) - */ - protected Patient subjectTarget; - - /** - * Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine. - */ - @Child(name = "priority", type = {CodeableConcept.class}, order=13, min=0, max=1) - @Description(shortDefinition="Message urgency", formalDefinition="Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine." ) - protected CodeableConcept priority; - - private static final long serialVersionUID = 431529355L; - - /* - * Constructor - */ - public CommunicationRequest() { - super(); - } - - /** - * @return {@link #identifier} (A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public CommunicationRequest addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #category} (The type of message to be sent such as alert, notification, reminder, instruction, etc.) - */ - public CodeableConcept getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.category"); - else if (Configuration.doAutoCreate()) - this.category = new CodeableConcept(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (The type of message to be sent such as alert, notification, reminder, instruction, etc.) - */ - public CommunicationRequest setCategory(CodeableConcept value) { - this.category = value; - return this; - } - - /** - * @return {@link #sender} (The entity (e.g., person, organization, clinical information system, or device) which is to be the source of the communication.) - */ - public Reference getSender() { - if (this.sender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.sender"); - else if (Configuration.doAutoCreate()) - this.sender = new Reference(); // cc - return this.sender; - } - - public boolean hasSender() { - return this.sender != null && !this.sender.isEmpty(); - } - - /** - * @param value {@link #sender} (The entity (e.g., person, organization, clinical information system, or device) which is to be the source of the communication.) - */ - public CommunicationRequest setSender(Reference value) { - this.sender = value; - return this; - } - - /** - * @return {@link #sender} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The entity (e.g., person, organization, clinical information system, or device) which is to be the source of the communication.) - */ - public Resource getSenderTarget() { - return this.senderTarget; - } - - /** - * @param value {@link #sender} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The entity (e.g., person, organization, clinical information system, or device) which is to be the source of the communication.) - */ - public CommunicationRequest setSenderTarget(Resource value) { - this.senderTarget = value; - return this; - } - - /** - * @return {@link #recipient} (The entity (e.g., person, organization, clinical information system, or device) which is the intended target of the communication.) - */ - public List getRecipient() { - if (this.recipient == null) - this.recipient = new ArrayList(); - return this.recipient; - } - - public boolean hasRecipient() { - if (this.recipient == null) - return false; - for (Reference item : this.recipient) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #recipient} (The entity (e.g., person, organization, clinical information system, or device) which is the intended target of the communication.) - */ - // syntactic sugar - public Reference addRecipient() { //3 - Reference t = new Reference(); - if (this.recipient == null) - this.recipient = new ArrayList(); - this.recipient.add(t); - return t; - } - - // syntactic sugar - public CommunicationRequest addRecipient(Reference t) { //3 - if (t == null) - return this; - if (this.recipient == null) - this.recipient = new ArrayList(); - this.recipient.add(t); - return this; - } - - /** - * @return {@link #recipient} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The entity (e.g., person, organization, clinical information system, or device) which is the intended target of the communication.) - */ - public List getRecipientTarget() { - if (this.recipientTarget == null) - this.recipientTarget = new ArrayList(); - return this.recipientTarget; - } - - /** - * @return {@link #payload} (Text, attachment(s), or resource(s) to be communicated to the recipient.) - */ - public List getPayload() { - if (this.payload == null) - this.payload = new ArrayList(); - return this.payload; - } - - public boolean hasPayload() { - if (this.payload == null) - return false; - for (CommunicationRequestPayloadComponent item : this.payload) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #payload} (Text, attachment(s), or resource(s) to be communicated to the recipient.) - */ - // syntactic sugar - public CommunicationRequestPayloadComponent addPayload() { //3 - CommunicationRequestPayloadComponent t = new CommunicationRequestPayloadComponent(); - if (this.payload == null) - this.payload = new ArrayList(); - this.payload.add(t); - return t; - } - - // syntactic sugar - public CommunicationRequest addPayload(CommunicationRequestPayloadComponent t) { //3 - if (t == null) - return this; - if (this.payload == null) - this.payload = new ArrayList(); - this.payload.add(t); - return this; - } - - /** - * @return {@link #medium} (The communication medium to be used, e.g., email, fax.) - */ - public List getMedium() { - if (this.medium == null) - this.medium = new ArrayList(); - return this.medium; - } - - public boolean hasMedium() { - if (this.medium == null) - return false; - for (CodeableConcept item : this.medium) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #medium} (The communication medium to be used, e.g., email, fax.) - */ - // syntactic sugar - public CodeableConcept addMedium() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.medium == null) - this.medium = new ArrayList(); - this.medium.add(t); - return t; - } - - // syntactic sugar - public CommunicationRequest addMedium(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.medium == null) - this.medium = new ArrayList(); - this.medium.add(t); - return this; - } - - /** - * @return {@link #requester} (The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.) - */ - public Reference getRequester() { - if (this.requester == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.requester"); - else if (Configuration.doAutoCreate()) - this.requester = new Reference(); // cc - return this.requester; - } - - public boolean hasRequester() { - return this.requester != null && !this.requester.isEmpty(); - } - - /** - * @param value {@link #requester} (The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.) - */ - public CommunicationRequest setRequester(Reference value) { - this.requester = value; - return this; - } - - /** - * @return {@link #requester} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.) - */ - public Resource getRequesterTarget() { - return this.requesterTarget; - } - - /** - * @param value {@link #requester} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.) - */ - public CommunicationRequest setRequesterTarget(Resource value) { - this.requesterTarget = value; - return this; - } - - /** - * @return {@link #status} (The status of the proposal or order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new CommunicationRequestStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the proposal or order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public CommunicationRequest setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the proposal or order. - */ - public CommunicationRequestStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the proposal or order. - */ - public CommunicationRequest setStatus(CommunicationRequestStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new CommunicationRequestStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #encounter} (The encounter within which the communication request was created.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (The encounter within which the communication request was created.) - */ - public CommunicationRequest setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter within which the communication request was created.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter within which the communication request was created.) - */ - public CommunicationRequest setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #scheduledTime} (The time when this communication is to occur.). This is the underlying object with id, value and extensions. The accessor "getScheduledTime" gives direct access to the value - */ - public DateTimeType getScheduledTimeElement() { - if (this.scheduledTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.scheduledTime"); - else if (Configuration.doAutoCreate()) - this.scheduledTime = new DateTimeType(); // bb - return this.scheduledTime; - } - - public boolean hasScheduledTimeElement() { - return this.scheduledTime != null && !this.scheduledTime.isEmpty(); - } - - public boolean hasScheduledTime() { - return this.scheduledTime != null && !this.scheduledTime.isEmpty(); - } - - /** - * @param value {@link #scheduledTime} (The time when this communication is to occur.). This is the underlying object with id, value and extensions. The accessor "getScheduledTime" gives direct access to the value - */ - public CommunicationRequest setScheduledTimeElement(DateTimeType value) { - this.scheduledTime = value; - return this; - } - - /** - * @return The time when this communication is to occur. - */ - public Date getScheduledTime() { - return this.scheduledTime == null ? null : this.scheduledTime.getValue(); - } - - /** - * @param value The time when this communication is to occur. - */ - public CommunicationRequest setScheduledTime(Date value) { - if (value == null) - this.scheduledTime = null; - else { - if (this.scheduledTime == null) - this.scheduledTime = new DateTimeType(); - this.scheduledTime.setValue(value); - } - return this; - } - - /** - * @return {@link #reason} (The reason or justification for the communication request.) - */ - public List getReason() { - if (this.reason == null) - this.reason = new ArrayList(); - return this.reason; - } - - public boolean hasReason() { - if (this.reason == null) - return false; - for (CodeableConcept item : this.reason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reason} (The reason or justification for the communication request.) - */ - // syntactic sugar - public CodeableConcept addReason() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return t; - } - - // syntactic sugar - public CommunicationRequest addReason(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return this; - } - - /** - * @return {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value - */ - public DateTimeType getOrderedOnElement() { - if (this.orderedOn == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.orderedOn"); - else if (Configuration.doAutoCreate()) - this.orderedOn = new DateTimeType(); // bb - return this.orderedOn; - } - - public boolean hasOrderedOnElement() { - return this.orderedOn != null && !this.orderedOn.isEmpty(); - } - - public boolean hasOrderedOn() { - return this.orderedOn != null && !this.orderedOn.isEmpty(); - } - - /** - * @param value {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value - */ - public CommunicationRequest setOrderedOnElement(DateTimeType value) { - this.orderedOn = value; - return this; - } - - /** - * @return The time when the request was made. - */ - public Date getOrderedOn() { - return this.orderedOn == null ? null : this.orderedOn.getValue(); - } - - /** - * @param value The time when the request was made. - */ - public CommunicationRequest setOrderedOn(Date value) { - if (value == null) - this.orderedOn = null; - else { - if (this.orderedOn == null) - this.orderedOn = new DateTimeType(); - this.orderedOn.setValue(value); - } - return this; - } - - /** - * @return {@link #subject} (The patient who is the focus of this communication request.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (The patient who is the focus of this communication request.) - */ - public CommunicationRequest setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who is the focus of this communication request.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.subject"); - else if (Configuration.doAutoCreate()) - this.subjectTarget = new Patient(); // aa - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who is the focus of this communication request.) - */ - public CommunicationRequest setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #priority} (Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.) - */ - public CodeableConcept getPriority() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new CodeableConcept(); // cc - return this.priority; - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.) - */ - public CommunicationRequest setPriority(CodeableConcept value) { - this.priority = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("category", "CodeableConcept", "The type of message to be sent such as alert, notification, reminder, instruction, etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("sender", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The entity (e.g., person, organization, clinical information system, or device) which is to be the source of the communication.", 0, java.lang.Integer.MAX_VALUE, sender)); - childrenList.add(new Property("recipient", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The entity (e.g., person, organization, clinical information system, or device) which is the intended target of the communication.", 0, java.lang.Integer.MAX_VALUE, recipient)); - childrenList.add(new Property("payload", "", "Text, attachment(s), or resource(s) to be communicated to the recipient.", 0, java.lang.Integer.MAX_VALUE, payload)); - childrenList.add(new Property("medium", "CodeableConcept", "The communication medium to be used, e.g., email, fax.", 0, java.lang.Integer.MAX_VALUE, medium)); - childrenList.add(new Property("requester", "Reference(Practitioner|Patient|RelatedPerson)", "The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.", 0, java.lang.Integer.MAX_VALUE, requester)); - childrenList.add(new Property("status", "code", "The status of the proposal or order.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter within which the communication request was created.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("scheduledTime", "dateTime", "The time when this communication is to occur.", 0, java.lang.Integer.MAX_VALUE, scheduledTime)); - childrenList.add(new Property("reason", "CodeableConcept", "The reason or justification for the communication request.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("orderedOn", "dateTime", "The time when the request was made.", 0, java.lang.Integer.MAX_VALUE, orderedOn)); - childrenList.add(new Property("subject", "Reference(Patient)", "The patient who is the focus of this communication request.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("priority", "CodeableConcept", "Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.", 0, java.lang.Integer.MAX_VALUE, priority)); - } - - public CommunicationRequest copy() { - CommunicationRequest dst = new CommunicationRequest(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.category = category == null ? null : category.copy(); - dst.sender = sender == null ? null : sender.copy(); - if (recipient != null) { - dst.recipient = new ArrayList(); - for (Reference i : recipient) - dst.recipient.add(i.copy()); - }; - if (payload != null) { - dst.payload = new ArrayList(); - for (CommunicationRequestPayloadComponent i : payload) - dst.payload.add(i.copy()); - }; - if (medium != null) { - dst.medium = new ArrayList(); - for (CodeableConcept i : medium) - dst.medium.add(i.copy()); - }; - dst.requester = requester == null ? null : requester.copy(); - dst.status = status == null ? null : status.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.scheduledTime = scheduledTime == null ? null : scheduledTime.copy(); - if (reason != null) { - dst.reason = new ArrayList(); - for (CodeableConcept i : reason) - dst.reason.add(i.copy()); - }; - dst.orderedOn = orderedOn == null ? null : orderedOn.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.priority = priority == null ? null : priority.copy(); - return dst; - } - - protected CommunicationRequest typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CommunicationRequest)) - return false; - CommunicationRequest o = (CommunicationRequest) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(category, o.category, true) && compareDeep(sender, o.sender, true) - && compareDeep(recipient, o.recipient, true) && compareDeep(payload, o.payload, true) && compareDeep(medium, o.medium, true) - && compareDeep(requester, o.requester, true) && compareDeep(status, o.status, true) && compareDeep(encounter, o.encounter, true) - && compareDeep(scheduledTime, o.scheduledTime, true) && compareDeep(reason, o.reason, true) && compareDeep(orderedOn, o.orderedOn, true) - && compareDeep(subject, o.subject, true) && compareDeep(priority, o.priority, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CommunicationRequest)) - return false; - CommunicationRequest o = (CommunicationRequest) other; - return compareValues(status, o.status, true) && compareValues(scheduledTime, o.scheduledTime, true) - && compareValues(orderedOn, o.orderedOn, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty()) - && (sender == null || sender.isEmpty()) && (recipient == null || recipient.isEmpty()) && (payload == null || payload.isEmpty()) - && (medium == null || medium.isEmpty()) && (requester == null || requester.isEmpty()) && (status == null || status.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (scheduledTime == null || scheduledTime.isEmpty()) - && (reason == null || reason.isEmpty()) && (orderedOn == null || orderedOn.isEmpty()) && (subject == null || subject.isEmpty()) - && (priority == null || priority.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.CommunicationRequest; - } - - @SearchParamDefinition(name="sender", path="CommunicationRequest.sender", description="Message sender", type="reference" ) - public static final String SP_SENDER = "sender"; - @SearchParamDefinition(name="time", path="CommunicationRequest.scheduledTime", description="When scheduled", type="date" ) - public static final String SP_TIME = "time"; - @SearchParamDefinition(name="requester", path="CommunicationRequest.requester", description="Requester of communication", type="reference" ) - public static final String SP_REQUESTER = "requester"; - @SearchParamDefinition(name="category", path="CommunicationRequest.category", description="Message category", type="token" ) - public static final String SP_CATEGORY = "category"; - @SearchParamDefinition(name="patient", path="CommunicationRequest.subject", description="Focus of message", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="status", path="CommunicationRequest.status", description="proposed | planned | requested | received | accepted | in-progress | completed | suspended | rejected | failed", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="priority", path="CommunicationRequest.priority", description="Message urgency", type="token" ) - public static final String SP_PRIORITY = "priority"; - @SearchParamDefinition(name="subject", path="CommunicationRequest.subject", description="Focus of message", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="ordered", path="CommunicationRequest.orderedOn", description="When ordered or proposed", type="date" ) - public static final String SP_ORDERED = "ordered"; - @SearchParamDefinition(name="encounter", path="CommunicationRequest.encounter", description="Encounter leading to message", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - @SearchParamDefinition(name="identifier", path="CommunicationRequest.identifier", description="Unique identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="medium", path="CommunicationRequest.medium", description="Communication medium", type="token" ) - public static final String SP_MEDIUM = "medium"; - @SearchParamDefinition(name="recipient", path="CommunicationRequest.recipient", description="Message recipient", type="reference" ) - public static final String SP_RECIPIENT = "recipient"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A request to convey information. E.g., the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. + */ +@ResourceDef(name="CommunicationRequest", profile="http://hl7.org/fhir/Profile/CommunicationRequest") +public class CommunicationRequest extends DomainResource { + + public enum CommunicationRequestStatus { + /** + * The request has been proposed. + */ + PROPOSED, + /** + * The request has been planned. + */ + PLANNED, + /** + * The request has been placed. + */ + REQUESTED, + /** + * The receiving system has received the request but not yet decided whether it will be performed. + */ + RECEIVED, + /** + * The receiving system has accepted the order, but work has not yet commenced. + */ + ACCEPTED, + /** + * The work to fulfill the order is happening. + */ + INPROGRESS, + /** + * The work has been complete, the report(s) released, and no further work is planned. + */ + COMPLETED, + /** + * The request has been held by originating system/user request. + */ + SUSPENDED, + /** + * The receiving system has declined to fulfill the request. + */ + REJECTED, + /** + * The communication was attempted, but due to some procedural error, it could not be completed. + */ + FAILED, + /** + * added to help the parsers + */ + NULL; + public static CommunicationRequestStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("planned".equals(codeString)) + return PLANNED; + if ("requested".equals(codeString)) + return REQUESTED; + if ("received".equals(codeString)) + return RECEIVED; + if ("accepted".equals(codeString)) + return ACCEPTED; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("completed".equals(codeString)) + return COMPLETED; + if ("suspended".equals(codeString)) + return SUSPENDED; + if ("rejected".equals(codeString)) + return REJECTED; + if ("failed".equals(codeString)) + return FAILED; + throw new Exception("Unknown CommunicationRequestStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROPOSED: return "proposed"; + case PLANNED: return "planned"; + case REQUESTED: return "requested"; + case RECEIVED: return "received"; + case ACCEPTED: return "accepted"; + case INPROGRESS: return "in-progress"; + case COMPLETED: return "completed"; + case SUSPENDED: return "suspended"; + case REJECTED: return "rejected"; + case FAILED: return "failed"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROPOSED: return ""; + case PLANNED: return ""; + case REQUESTED: return ""; + case RECEIVED: return ""; + case ACCEPTED: return ""; + case INPROGRESS: return ""; + case COMPLETED: return ""; + case SUSPENDED: return ""; + case REJECTED: return ""; + case FAILED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROPOSED: return "The request has been proposed."; + case PLANNED: return "The request has been planned."; + case REQUESTED: return "The request has been placed."; + case RECEIVED: return "The receiving system has received the request but not yet decided whether it will be performed."; + case ACCEPTED: return "The receiving system has accepted the order, but work has not yet commenced."; + case INPROGRESS: return "The work to fulfill the order is happening."; + case COMPLETED: return "The work has been complete, the report(s) released, and no further work is planned."; + case SUSPENDED: return "The request has been held by originating system/user request."; + case REJECTED: return "The receiving system has declined to fulfill the request."; + case FAILED: return "The communication was attempted, but due to some procedural error, it could not be completed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROPOSED: return "Proposed"; + case PLANNED: return "Planned"; + case REQUESTED: return "Requested"; + case RECEIVED: return "Received"; + case ACCEPTED: return "Accepted"; + case INPROGRESS: return "In Progress"; + case COMPLETED: return "Completed"; + case SUSPENDED: return "Suspended"; + case REJECTED: return "Rejected"; + case FAILED: return "Failed"; + default: return "?"; + } + } + } + + public static class CommunicationRequestStatusEnumFactory implements EnumFactory { + public CommunicationRequestStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return CommunicationRequestStatus.PROPOSED; + if ("planned".equals(codeString)) + return CommunicationRequestStatus.PLANNED; + if ("requested".equals(codeString)) + return CommunicationRequestStatus.REQUESTED; + if ("received".equals(codeString)) + return CommunicationRequestStatus.RECEIVED; + if ("accepted".equals(codeString)) + return CommunicationRequestStatus.ACCEPTED; + if ("in-progress".equals(codeString)) + return CommunicationRequestStatus.INPROGRESS; + if ("completed".equals(codeString)) + return CommunicationRequestStatus.COMPLETED; + if ("suspended".equals(codeString)) + return CommunicationRequestStatus.SUSPENDED; + if ("rejected".equals(codeString)) + return CommunicationRequestStatus.REJECTED; + if ("failed".equals(codeString)) + return CommunicationRequestStatus.FAILED; + throw new IllegalArgumentException("Unknown CommunicationRequestStatus code '"+codeString+"'"); + } + public String toCode(CommunicationRequestStatus code) { + if (code == CommunicationRequestStatus.PROPOSED) + return "proposed"; + if (code == CommunicationRequestStatus.PLANNED) + return "planned"; + if (code == CommunicationRequestStatus.REQUESTED) + return "requested"; + if (code == CommunicationRequestStatus.RECEIVED) + return "received"; + if (code == CommunicationRequestStatus.ACCEPTED) + return "accepted"; + if (code == CommunicationRequestStatus.INPROGRESS) + return "in-progress"; + if (code == CommunicationRequestStatus.COMPLETED) + return "completed"; + if (code == CommunicationRequestStatus.SUSPENDED) + return "suspended"; + if (code == CommunicationRequestStatus.REJECTED) + return "rejected"; + if (code == CommunicationRequestStatus.FAILED) + return "failed"; + return "?"; + } + } + + @Block() + public static class CommunicationRequestPayloadComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An individual message part for multi-part messages. + */ + @Child(name = "content", type = {StringType.class, Attachment.class}, order=1, min=1, max=1) + @Description(shortDefinition="Message part content", formalDefinition="An individual message part for multi-part messages." ) + protected Type content; + + private static final long serialVersionUID = -1763459053L; + + /* + * Constructor + */ + public CommunicationRequestPayloadComponent() { + super(); + } + + /* + * Constructor + */ + public CommunicationRequestPayloadComponent(Type content) { + super(); + this.content = content; + } + + /** + * @return {@link #content} (An individual message part for multi-part messages.) + */ + public Type getContent() { + return this.content; + } + + /** + * @return {@link #content} (An individual message part for multi-part messages.) + */ + public StringType getContentStringType() throws Exception { + if (!(this.content instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.content.getClass().getName()+" was encountered"); + return (StringType) this.content; + } + + /** + * @return {@link #content} (An individual message part for multi-part messages.) + */ + public Attachment getContentAttachment() throws Exception { + if (!(this.content instanceof Attachment)) + throw new Exception("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Attachment) this.content; + } + + /** + * @return {@link #content} (An individual message part for multi-part messages.) + */ + public Reference getContentReference() throws Exception { + if (!(this.content instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Reference) this.content; + } + + public boolean hasContent() { + return this.content != null && !this.content.isEmpty(); + } + + /** + * @param value {@link #content} (An individual message part for multi-part messages.) + */ + public CommunicationRequestPayloadComponent setContent(Type value) { + this.content = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("content[x]", "string|Attachment|Reference(Any)", "An individual message part for multi-part messages.", 0, java.lang.Integer.MAX_VALUE, content)); + } + + public CommunicationRequestPayloadComponent copy() { + CommunicationRequestPayloadComponent dst = new CommunicationRequestPayloadComponent(); + copyValues(dst); + dst.content = content == null ? null : content.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CommunicationRequestPayloadComponent)) + return false; + CommunicationRequestPayloadComponent o = (CommunicationRequestPayloadComponent) other; + return compareDeep(content, o.content, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CommunicationRequestPayloadComponent)) + return false; + CommunicationRequestPayloadComponent o = (CommunicationRequestPayloadComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (content == null || content.isEmpty()); + } + + } + + /** + * A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Unique identifier", formalDefinition="A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system." ) + protected List identifier; + + /** + * The type of message to be sent such as alert, notification, reminder, instruction, etc. + */ + @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Message category", formalDefinition="The type of message to be sent such as alert, notification, reminder, instruction, etc." ) + protected CodeableConcept category; + + /** + * The entity (e.g., person, organization, clinical information system, or device) which is to be the source of the communication. + */ + @Child(name = "sender", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=2, min=0, max=1) + @Description(shortDefinition="Message sender", formalDefinition="The entity (e.g., person, organization, clinical information system, or device) which is to be the source of the communication." ) + protected Reference sender; + + /** + * The actual object that is the target of the reference (The entity (e.g., person, organization, clinical information system, or device) which is to be the source of the communication.) + */ + protected Resource senderTarget; + + /** + * The entity (e.g., person, organization, clinical information system, or device) which is the intended target of the communication. + */ + @Child(name = "recipient", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Message recipient", formalDefinition="The entity (e.g., person, organization, clinical information system, or device) which is the intended target of the communication." ) + protected List recipient; + /** + * The actual objects that are the target of the reference (The entity (e.g., person, organization, clinical information system, or device) which is the intended target of the communication.) + */ + protected List recipientTarget; + + + /** + * Text, attachment(s), or resource(s) to be communicated to the recipient. + */ + @Child(name = "payload", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Message payload", formalDefinition="Text, attachment(s), or resource(s) to be communicated to the recipient." ) + protected List payload; + + /** + * The communication medium to be used, e.g., email, fax. + */ + @Child(name = "medium", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Communication medium", formalDefinition="The communication medium to be used, e.g., email, fax." ) + protected List medium; + + /** + * The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application. + */ + @Child(name = "requester", type = {Practitioner.class, Patient.class, RelatedPerson.class}, order=6, min=0, max=1) + @Description(shortDefinition="Requester of communication", formalDefinition="The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application." ) + protected Reference requester; + + /** + * The actual object that is the target of the reference (The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.) + */ + protected Resource requesterTarget; + + /** + * The status of the proposal or order. + */ + @Child(name = "status", type = {CodeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="proposed | planned | requested | received | accepted | in-progress | completed | suspended | rejected | failed", formalDefinition="The status of the proposal or order." ) + protected Enumeration status; + + /** + * The encounter within which the communication request was created. + */ + @Child(name = "encounter", type = {Encounter.class}, order=8, min=0, max=1) + @Description(shortDefinition="Encounter leading to message", formalDefinition="The encounter within which the communication request was created." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The encounter within which the communication request was created.) + */ + protected Encounter encounterTarget; + + /** + * The time when this communication is to occur. + */ + @Child(name = "scheduledTime", type = {DateTimeType.class}, order=9, min=0, max=1) + @Description(shortDefinition="When scheduled", formalDefinition="The time when this communication is to occur." ) + protected DateTimeType scheduledTime; + + /** + * The reason or justification for the communication request. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Indication for message", formalDefinition="The reason or justification for the communication request." ) + protected List reason; + + /** + * The time when the request was made. + */ + @Child(name = "orderedOn", type = {DateTimeType.class}, order=11, min=0, max=1) + @Description(shortDefinition="When ordered or proposed", formalDefinition="The time when the request was made." ) + protected DateTimeType orderedOn; + + /** + * The patient who is the focus of this communication request. + */ + @Child(name = "subject", type = {Patient.class}, order=12, min=0, max=1) + @Description(shortDefinition="Focus of message", formalDefinition="The patient who is the focus of this communication request." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient who is the focus of this communication request.) + */ + protected Patient subjectTarget; + + /** + * Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine. + */ + @Child(name = "priority", type = {CodeableConcept.class}, order=13, min=0, max=1) + @Description(shortDefinition="Message urgency", formalDefinition="Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine." ) + protected CodeableConcept priority; + + private static final long serialVersionUID = 431529355L; + + /* + * Constructor + */ + public CommunicationRequest() { + super(); + } + + /** + * @return {@link #identifier} (A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public CommunicationRequest addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #category} (The type of message to be sent such as alert, notification, reminder, instruction, etc.) + */ + public CodeableConcept getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.category"); + else if (Configuration.doAutoCreate()) + this.category = new CodeableConcept(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (The type of message to be sent such as alert, notification, reminder, instruction, etc.) + */ + public CommunicationRequest setCategory(CodeableConcept value) { + this.category = value; + return this; + } + + /** + * @return {@link #sender} (The entity (e.g., person, organization, clinical information system, or device) which is to be the source of the communication.) + */ + public Reference getSender() { + if (this.sender == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.sender"); + else if (Configuration.doAutoCreate()) + this.sender = new Reference(); // cc + return this.sender; + } + + public boolean hasSender() { + return this.sender != null && !this.sender.isEmpty(); + } + + /** + * @param value {@link #sender} (The entity (e.g., person, organization, clinical information system, or device) which is to be the source of the communication.) + */ + public CommunicationRequest setSender(Reference value) { + this.sender = value; + return this; + } + + /** + * @return {@link #sender} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The entity (e.g., person, organization, clinical information system, or device) which is to be the source of the communication.) + */ + public Resource getSenderTarget() { + return this.senderTarget; + } + + /** + * @param value {@link #sender} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The entity (e.g., person, organization, clinical information system, or device) which is to be the source of the communication.) + */ + public CommunicationRequest setSenderTarget(Resource value) { + this.senderTarget = value; + return this; + } + + /** + * @return {@link #recipient} (The entity (e.g., person, organization, clinical information system, or device) which is the intended target of the communication.) + */ + public List getRecipient() { + if (this.recipient == null) + this.recipient = new ArrayList(); + return this.recipient; + } + + public boolean hasRecipient() { + if (this.recipient == null) + return false; + for (Reference item : this.recipient) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #recipient} (The entity (e.g., person, organization, clinical information system, or device) which is the intended target of the communication.) + */ + // syntactic sugar + public Reference addRecipient() { //3 + Reference t = new Reference(); + if (this.recipient == null) + this.recipient = new ArrayList(); + this.recipient.add(t); + return t; + } + + // syntactic sugar + public CommunicationRequest addRecipient(Reference t) { //3 + if (t == null) + return this; + if (this.recipient == null) + this.recipient = new ArrayList(); + this.recipient.add(t); + return this; + } + + /** + * @return {@link #recipient} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The entity (e.g., person, organization, clinical information system, or device) which is the intended target of the communication.) + */ + public List getRecipientTarget() { + if (this.recipientTarget == null) + this.recipientTarget = new ArrayList(); + return this.recipientTarget; + } + + /** + * @return {@link #payload} (Text, attachment(s), or resource(s) to be communicated to the recipient.) + */ + public List getPayload() { + if (this.payload == null) + this.payload = new ArrayList(); + return this.payload; + } + + public boolean hasPayload() { + if (this.payload == null) + return false; + for (CommunicationRequestPayloadComponent item : this.payload) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #payload} (Text, attachment(s), or resource(s) to be communicated to the recipient.) + */ + // syntactic sugar + public CommunicationRequestPayloadComponent addPayload() { //3 + CommunicationRequestPayloadComponent t = new CommunicationRequestPayloadComponent(); + if (this.payload == null) + this.payload = new ArrayList(); + this.payload.add(t); + return t; + } + + // syntactic sugar + public CommunicationRequest addPayload(CommunicationRequestPayloadComponent t) { //3 + if (t == null) + return this; + if (this.payload == null) + this.payload = new ArrayList(); + this.payload.add(t); + return this; + } + + /** + * @return {@link #medium} (The communication medium to be used, e.g., email, fax.) + */ + public List getMedium() { + if (this.medium == null) + this.medium = new ArrayList(); + return this.medium; + } + + public boolean hasMedium() { + if (this.medium == null) + return false; + for (CodeableConcept item : this.medium) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #medium} (The communication medium to be used, e.g., email, fax.) + */ + // syntactic sugar + public CodeableConcept addMedium() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.medium == null) + this.medium = new ArrayList(); + this.medium.add(t); + return t; + } + + // syntactic sugar + public CommunicationRequest addMedium(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.medium == null) + this.medium = new ArrayList(); + this.medium.add(t); + return this; + } + + /** + * @return {@link #requester} (The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.) + */ + public Reference getRequester() { + if (this.requester == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.requester"); + else if (Configuration.doAutoCreate()) + this.requester = new Reference(); // cc + return this.requester; + } + + public boolean hasRequester() { + return this.requester != null && !this.requester.isEmpty(); + } + + /** + * @param value {@link #requester} (The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.) + */ + public CommunicationRequest setRequester(Reference value) { + this.requester = value; + return this; + } + + /** + * @return {@link #requester} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.) + */ + public Resource getRequesterTarget() { + return this.requesterTarget; + } + + /** + * @param value {@link #requester} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.) + */ + public CommunicationRequest setRequesterTarget(Resource value) { + this.requesterTarget = value; + return this; + } + + /** + * @return {@link #status} (The status of the proposal or order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new CommunicationRequestStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status of the proposal or order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public CommunicationRequest setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the proposal or order. + */ + public CommunicationRequestStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the proposal or order. + */ + public CommunicationRequest setStatus(CommunicationRequestStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new CommunicationRequestStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #encounter} (The encounter within which the communication request was created.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (The encounter within which the communication request was created.) + */ + public CommunicationRequest setEncounter(Reference value) { + this.encounter = value; + return this; + } + + /** + * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter within which the communication request was created.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + return this.encounterTarget; + } + + /** + * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter within which the communication request was created.) + */ + public CommunicationRequest setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #scheduledTime} (The time when this communication is to occur.). This is the underlying object with id, value and extensions. The accessor "getScheduledTime" gives direct access to the value + */ + public DateTimeType getScheduledTimeElement() { + if (this.scheduledTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.scheduledTime"); + else if (Configuration.doAutoCreate()) + this.scheduledTime = new DateTimeType(); // bb + return this.scheduledTime; + } + + public boolean hasScheduledTimeElement() { + return this.scheduledTime != null && !this.scheduledTime.isEmpty(); + } + + public boolean hasScheduledTime() { + return this.scheduledTime != null && !this.scheduledTime.isEmpty(); + } + + /** + * @param value {@link #scheduledTime} (The time when this communication is to occur.). This is the underlying object with id, value and extensions. The accessor "getScheduledTime" gives direct access to the value + */ + public CommunicationRequest setScheduledTimeElement(DateTimeType value) { + this.scheduledTime = value; + return this; + } + + /** + * @return The time when this communication is to occur. + */ + public Date getScheduledTime() { + return this.scheduledTime == null ? null : this.scheduledTime.getValue(); + } + + /** + * @param value The time when this communication is to occur. + */ + public CommunicationRequest setScheduledTime(Date value) { + if (value == null) + this.scheduledTime = null; + else { + if (this.scheduledTime == null) + this.scheduledTime = new DateTimeType(); + this.scheduledTime.setValue(value); + } + return this; + } + + /** + * @return {@link #reason} (The reason or justification for the communication request.) + */ + public List getReason() { + if (this.reason == null) + this.reason = new ArrayList(); + return this.reason; + } + + public boolean hasReason() { + if (this.reason == null) + return false; + for (CodeableConcept item : this.reason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reason} (The reason or justification for the communication request.) + */ + // syntactic sugar + public CodeableConcept addReason() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return t; + } + + // syntactic sugar + public CommunicationRequest addReason(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return this; + } + + /** + * @return {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value + */ + public DateTimeType getOrderedOnElement() { + if (this.orderedOn == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.orderedOn"); + else if (Configuration.doAutoCreate()) + this.orderedOn = new DateTimeType(); // bb + return this.orderedOn; + } + + public boolean hasOrderedOnElement() { + return this.orderedOn != null && !this.orderedOn.isEmpty(); + } + + public boolean hasOrderedOn() { + return this.orderedOn != null && !this.orderedOn.isEmpty(); + } + + /** + * @param value {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value + */ + public CommunicationRequest setOrderedOnElement(DateTimeType value) { + this.orderedOn = value; + return this; + } + + /** + * @return The time when the request was made. + */ + public Date getOrderedOn() { + return this.orderedOn == null ? null : this.orderedOn.getValue(); + } + + /** + * @param value The time when the request was made. + */ + public CommunicationRequest setOrderedOn(Date value) { + if (value == null) + this.orderedOn = null; + else { + if (this.orderedOn == null) + this.orderedOn = new DateTimeType(); + this.orderedOn.setValue(value); + } + return this; + } + + /** + * @return {@link #subject} (The patient who is the focus of this communication request.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The patient who is the focus of this communication request.) + */ + public CommunicationRequest setSubject(Reference value) { + this.subject = value; + return this; + } + + /** + * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who is the focus of this communication request.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.subject"); + else if (Configuration.doAutoCreate()) + this.subjectTarget = new Patient(); // aa + return this.subjectTarget; + } + + /** + * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who is the focus of this communication request.) + */ + public CommunicationRequest setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #priority} (Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.) + */ + public CodeableConcept getPriority() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new CodeableConcept(); // cc + return this.priority; + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.) + */ + public CommunicationRequest setPriority(CodeableConcept value) { + this.priority = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("category", "CodeableConcept", "The type of message to be sent such as alert, notification, reminder, instruction, etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("sender", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The entity (e.g., person, organization, clinical information system, or device) which is to be the source of the communication.", 0, java.lang.Integer.MAX_VALUE, sender)); + childrenList.add(new Property("recipient", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The entity (e.g., person, organization, clinical information system, or device) which is the intended target of the communication.", 0, java.lang.Integer.MAX_VALUE, recipient)); + childrenList.add(new Property("payload", "", "Text, attachment(s), or resource(s) to be communicated to the recipient.", 0, java.lang.Integer.MAX_VALUE, payload)); + childrenList.add(new Property("medium", "CodeableConcept", "The communication medium to be used, e.g., email, fax.", 0, java.lang.Integer.MAX_VALUE, medium)); + childrenList.add(new Property("requester", "Reference(Practitioner|Patient|RelatedPerson)", "The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.", 0, java.lang.Integer.MAX_VALUE, requester)); + childrenList.add(new Property("status", "code", "The status of the proposal or order.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter within which the communication request was created.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("scheduledTime", "dateTime", "The time when this communication is to occur.", 0, java.lang.Integer.MAX_VALUE, scheduledTime)); + childrenList.add(new Property("reason", "CodeableConcept", "The reason or justification for the communication request.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("orderedOn", "dateTime", "The time when the request was made.", 0, java.lang.Integer.MAX_VALUE, orderedOn)); + childrenList.add(new Property("subject", "Reference(Patient)", "The patient who is the focus of this communication request.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("priority", "CodeableConcept", "Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.", 0, java.lang.Integer.MAX_VALUE, priority)); + } + + public CommunicationRequest copy() { + CommunicationRequest dst = new CommunicationRequest(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.category = category == null ? null : category.copy(); + dst.sender = sender == null ? null : sender.copy(); + if (recipient != null) { + dst.recipient = new ArrayList(); + for (Reference i : recipient) + dst.recipient.add(i.copy()); + }; + if (payload != null) { + dst.payload = new ArrayList(); + for (CommunicationRequestPayloadComponent i : payload) + dst.payload.add(i.copy()); + }; + if (medium != null) { + dst.medium = new ArrayList(); + for (CodeableConcept i : medium) + dst.medium.add(i.copy()); + }; + dst.requester = requester == null ? null : requester.copy(); + dst.status = status == null ? null : status.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.scheduledTime = scheduledTime == null ? null : scheduledTime.copy(); + if (reason != null) { + dst.reason = new ArrayList(); + for (CodeableConcept i : reason) + dst.reason.add(i.copy()); + }; + dst.orderedOn = orderedOn == null ? null : orderedOn.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.priority = priority == null ? null : priority.copy(); + return dst; + } + + protected CommunicationRequest typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CommunicationRequest)) + return false; + CommunicationRequest o = (CommunicationRequest) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(category, o.category, true) && compareDeep(sender, o.sender, true) + && compareDeep(recipient, o.recipient, true) && compareDeep(payload, o.payload, true) && compareDeep(medium, o.medium, true) + && compareDeep(requester, o.requester, true) && compareDeep(status, o.status, true) && compareDeep(encounter, o.encounter, true) + && compareDeep(scheduledTime, o.scheduledTime, true) && compareDeep(reason, o.reason, true) && compareDeep(orderedOn, o.orderedOn, true) + && compareDeep(subject, o.subject, true) && compareDeep(priority, o.priority, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CommunicationRequest)) + return false; + CommunicationRequest o = (CommunicationRequest) other; + return compareValues(status, o.status, true) && compareValues(scheduledTime, o.scheduledTime, true) + && compareValues(orderedOn, o.orderedOn, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty()) + && (sender == null || sender.isEmpty()) && (recipient == null || recipient.isEmpty()) && (payload == null || payload.isEmpty()) + && (medium == null || medium.isEmpty()) && (requester == null || requester.isEmpty()) && (status == null || status.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (scheduledTime == null || scheduledTime.isEmpty()) + && (reason == null || reason.isEmpty()) && (orderedOn == null || orderedOn.isEmpty()) && (subject == null || subject.isEmpty()) + && (priority == null || priority.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.CommunicationRequest; + } + + @SearchParamDefinition(name="requester", path="CommunicationRequest.requester", description="Requester of communication", type="reference" ) + public static final String SP_REQUESTER = "requester"; + @SearchParamDefinition(name="identifier", path="CommunicationRequest.identifier", description="Unique identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="ordered", path="CommunicationRequest.orderedOn", description="When ordered or proposed", type="date" ) + public static final String SP_ORDERED = "ordered"; + @SearchParamDefinition(name="subject", path="CommunicationRequest.subject", description="Focus of message", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="medium", path="CommunicationRequest.medium", description="Communication medium", type="token" ) + public static final String SP_MEDIUM = "medium"; + @SearchParamDefinition(name="encounter", path="CommunicationRequest.encounter", description="Encounter leading to message", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + @SearchParamDefinition(name="priority", path="CommunicationRequest.priority", description="Message urgency", type="token" ) + public static final String SP_PRIORITY = "priority"; + @SearchParamDefinition(name="sender", path="CommunicationRequest.sender", description="Message sender", type="reference" ) + public static final String SP_SENDER = "sender"; + @SearchParamDefinition(name="patient", path="CommunicationRequest.subject", description="Focus of message", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="recipient", path="CommunicationRequest.recipient", description="Message recipient", type="reference" ) + public static final String SP_RECIPIENT = "recipient"; + @SearchParamDefinition(name="time", path="CommunicationRequest.scheduledTime", description="When scheduled", type="date" ) + public static final String SP_TIME = "time"; + @SearchParamDefinition(name="category", path="CommunicationRequest.category", description="Message category", type="token" ) + public static final String SP_CATEGORY = "category"; + @SearchParamDefinition(name="status", path="CommunicationRequest.status", description="proposed | planned | requested | received | accepted | in-progress | completed | suspended | rejected | failed", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Comparison.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Comparison.java index a1ab4135cd2..d2b4b3fceac 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Comparison.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Comparison.java @@ -1,129 +1,108 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import java.util.List; - -import org.hl7.fhir.utilities.Utilities; - -/** - * See http://www.healthintersections.com.au/?p=1941 - * - * @author Grahame - * - */ -public class Comparison { - - public class MatchProfile { - - } - - public static boolean matches(String c1, String c2, MatchProfile profile) { - if (Utilities.noString(c1) || Utilities.noString(c2)) - return false; - c1 = Utilities.normalize(c1); - c2 = Utilities.normalize(c2); - return c1.equals(c2); - } - - public static > boolean matches(Enumeration e1, Enumeration e2, MatchProfile profile) { - if (e1 == null || e2 == null) - return false; - return e1.getValue().equals(e2.getValue()); - } - - public static boolean matches(CodeableConcept c1, CodeableConcept c2, MatchProfile profile) throws 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 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.getType() == null && src.getType() != null) - dst.setType(src.getType()); - if (dst.getPeriod() == null && src.getPeriod() != null) - dst.setPeriod(src.getPeriod()); - if (dst.getAssigner() == null && src.getAssigner() != null) - dst.setAssigner(src.getAssigner()); - } - - public static boolean matches(ContactPoint c1, ContactPoint c2, Object profile) 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()); - } - -} +package org.hl7.fhir.instance.model; + +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 > boolean matches(Enumeration e1, Enumeration e2, MatchProfile profile) { + if (e1 == null || e2 == null) + return false; + return e1.getValue().equals(e2.getValue()); + } + + public static boolean matches(CodeableConcept c1, CodeableConcept c2, MatchProfile profile) throws 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 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.getType() == null && src.getType() != null) + dst.setType(src.getType()); + if (dst.getPeriod() == null && src.getPeriod() != null) + dst.setPeriod(src.getPeriod()); + if (dst.getAssigner() == null && src.getAssigner() != null) + dst.setAssigner(src.getAssigner()); + } + + public static boolean matches(ContactPoint c1, ContactPoint c2, Object profile) 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()); + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Composition.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Composition.java index 0fde111010c..b770a25bdaf 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Composition.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Composition.java @@ -1,1790 +1,1769 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. - */ -@ResourceDef(name="Composition", profile="http://hl7.org/fhir/Profile/Composition") -public class Composition extends DomainResource { - - public enum CompositionStatus { - /** - * This is a preliminary composition or document (also known as initial or interim). The content may be incomplete or unverified. - */ - PRELIMINARY, - /** - * This version of the composition is complete and verified by an appropriate person and no further work is planned. Any subsequent updates would be on a new version of the composition. - */ - FINAL, - /** - * The composition or document has been modified subsequent to being released as "final", and is complete and verified by an authorized person. The modifications added new information to the composition or document, but did not revise existing content. - */ - APPENDED, - /** - * The composition or document has been modified subsequent to being released as "final", and is complete and verified by an authorized person. - */ - AMENDED, - /** - * The composition or document was originally created/issued in error, and this is an amendment that marks that the entire series should not be considered as valid. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static CompositionStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("preliminary".equals(codeString)) - return PRELIMINARY; - if ("final".equals(codeString)) - return FINAL; - if ("appended".equals(codeString)) - return APPENDED; - if ("amended".equals(codeString)) - return AMENDED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new Exception("Unknown CompositionStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PRELIMINARY: return "preliminary"; - case FINAL: return "final"; - case APPENDED: return "appended"; - case AMENDED: return "amended"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PRELIMINARY: return ""; - case FINAL: return ""; - case APPENDED: return ""; - case AMENDED: return ""; - case ENTEREDINERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PRELIMINARY: return "This is a preliminary composition or document (also known as initial or interim). The content may be incomplete or unverified."; - case FINAL: return "This version of the composition is complete and verified by an appropriate person and no further work is planned. Any subsequent updates would be on a new version of the composition."; - case APPENDED: return "The composition or document has been modified subsequent to being released as 'final', and is complete and verified by an authorized person. The modifications added new information to the composition or document, but did not revise existing content."; - case AMENDED: return "The composition or document has been modified subsequent to being released as 'final', and is complete and verified by an authorized person."; - case ENTEREDINERROR: return "The composition or document was originally created/issued in error, and this is an amendment that marks that the entire series should not be considered as valid."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PRELIMINARY: return "Preliminary"; - case FINAL: return "Final"; - case APPENDED: return "Appended"; - case AMENDED: return "Amended"; - case ENTEREDINERROR: return "Entered In Error"; - default: return "?"; - } - } - } - - public static class CompositionStatusEnumFactory implements EnumFactory { - public CompositionStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("preliminary".equals(codeString)) - return CompositionStatus.PRELIMINARY; - if ("final".equals(codeString)) - return CompositionStatus.FINAL; - if ("appended".equals(codeString)) - return CompositionStatus.APPENDED; - if ("amended".equals(codeString)) - return CompositionStatus.AMENDED; - if ("entered-in-error".equals(codeString)) - return CompositionStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown CompositionStatus code '"+codeString+"'"); - } - public String toCode(CompositionStatus code) { - if (code == CompositionStatus.PRELIMINARY) - return "preliminary"; - if (code == CompositionStatus.FINAL) - return "final"; - if (code == CompositionStatus.APPENDED) - return "appended"; - if (code == CompositionStatus.AMENDED) - return "amended"; - if (code == CompositionStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - } - - public enum CompositionAttestationMode { - /** - * The person authenticated the content in their personal capacity. - */ - PERSONAL, - /** - * The person authenticated the content in their professional capacity. - */ - PROFESSIONAL, - /** - * The person authenticated the content and accepted legal responsibility for its content. - */ - LEGAL, - /** - * The organization authenticated the content as consistent with their policies and procedures. - */ - OFFICIAL, - /** - * added to help the parsers - */ - NULL; - public static CompositionAttestationMode fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("personal".equals(codeString)) - return PERSONAL; - if ("professional".equals(codeString)) - return PROFESSIONAL; - if ("legal".equals(codeString)) - return LEGAL; - if ("official".equals(codeString)) - return OFFICIAL; - throw new Exception("Unknown CompositionAttestationMode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PERSONAL: return "personal"; - case PROFESSIONAL: return "professional"; - case LEGAL: return "legal"; - case OFFICIAL: return "official"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PERSONAL: return ""; - case PROFESSIONAL: return ""; - case LEGAL: return ""; - case OFFICIAL: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PERSONAL: return "The person authenticated the content in their personal capacity."; - case PROFESSIONAL: return "The person authenticated the content in their professional capacity."; - case LEGAL: return "The person authenticated the content and accepted legal responsibility for its content."; - case OFFICIAL: return "The organization authenticated the content as consistent with their policies and procedures."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PERSONAL: return "Personal"; - case PROFESSIONAL: return "Professional"; - case LEGAL: return "Legal"; - case OFFICIAL: return "Official"; - default: return "?"; - } - } - } - - public static class CompositionAttestationModeEnumFactory implements EnumFactory { - public CompositionAttestationMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("personal".equals(codeString)) - return CompositionAttestationMode.PERSONAL; - if ("professional".equals(codeString)) - return CompositionAttestationMode.PROFESSIONAL; - if ("legal".equals(codeString)) - return CompositionAttestationMode.LEGAL; - if ("official".equals(codeString)) - return CompositionAttestationMode.OFFICIAL; - throw new IllegalArgumentException("Unknown CompositionAttestationMode code '"+codeString+"'"); - } - public String toCode(CompositionAttestationMode code) { - if (code == CompositionAttestationMode.PERSONAL) - return "personal"; - if (code == CompositionAttestationMode.PROFESSIONAL) - return "professional"; - if (code == CompositionAttestationMode.LEGAL) - return "legal"; - if (code == CompositionAttestationMode.OFFICIAL) - return "official"; - return "?"; - } - } - - @Block() - public static class CompositionAttesterComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The type of attestation the authenticator offers. - */ - @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="personal | professional | legal | official", formalDefinition="The type of attestation the authenticator offers." ) - protected List> mode; - - /** - * When composition was attested by the party. - */ - @Child(name = "time", type = {DateTimeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="When composition attested", formalDefinition="When composition was attested by the party." ) - protected DateTimeType time; - - /** - * Who attested the composition in the specified way. - */ - @Child(name = "party", type = {Patient.class, Practitioner.class, Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Who attested the composition", formalDefinition="Who attested the composition in the specified way." ) - protected Reference party; - - /** - * The actual object that is the target of the reference (Who attested the composition in the specified way.) - */ - protected Resource partyTarget; - - private static final long serialVersionUID = -436604745L; - - /* - * Constructor - */ - public CompositionAttesterComponent() { - super(); - } - - /** - * @return {@link #mode} (The type of attestation the authenticator offers.) - */ - public List> getMode() { - if (this.mode == null) - this.mode = new ArrayList>(); - return this.mode; - } - - public boolean hasMode() { - if (this.mode == null) - return false; - for (Enumeration item : this.mode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #mode} (The type of attestation the authenticator offers.) - */ - // syntactic sugar - public Enumeration addModeElement() {//2 - Enumeration t = new Enumeration(new CompositionAttestationModeEnumFactory()); - if (this.mode == null) - this.mode = new ArrayList>(); - this.mode.add(t); - return t; - } - - /** - * @param value {@link #mode} (The type of attestation the authenticator offers.) - */ - public CompositionAttesterComponent addMode(CompositionAttestationMode value) { //1 - Enumeration t = new Enumeration(new CompositionAttestationModeEnumFactory()); - t.setValue(value); - if (this.mode == null) - this.mode = new ArrayList>(); - this.mode.add(t); - return this; - } - - /** - * @param value {@link #mode} (The type of attestation the authenticator offers.) - */ - public boolean hasMode(CompositionAttestationMode value) { - if (this.mode == null) - return false; - for (Enumeration v : this.mode) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #time} (When composition was attested by the party.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value - */ - public DateTimeType getTimeElement() { - if (this.time == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompositionAttesterComponent.time"); - else if (Configuration.doAutoCreate()) - this.time = new DateTimeType(); // bb - return this.time; - } - - public boolean hasTimeElement() { - return this.time != null && !this.time.isEmpty(); - } - - public boolean hasTime() { - return this.time != null && !this.time.isEmpty(); - } - - /** - * @param value {@link #time} (When composition was attested by the party.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value - */ - public CompositionAttesterComponent setTimeElement(DateTimeType value) { - this.time = value; - return this; - } - - /** - * @return When composition was attested by the party. - */ - public Date getTime() { - return this.time == null ? null : this.time.getValue(); - } - - /** - * @param value When composition was attested by the party. - */ - public CompositionAttesterComponent setTime(Date value) { - if (value == null) - this.time = null; - else { - if (this.time == null) - this.time = new DateTimeType(); - this.time.setValue(value); - } - return this; - } - - /** - * @return {@link #party} (Who attested the composition in the specified way.) - */ - public Reference getParty() { - if (this.party == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompositionAttesterComponent.party"); - else if (Configuration.doAutoCreate()) - this.party = new Reference(); // cc - return this.party; - } - - public boolean hasParty() { - return this.party != null && !this.party.isEmpty(); - } - - /** - * @param value {@link #party} (Who attested the composition in the specified way.) - */ - public CompositionAttesterComponent setParty(Reference value) { - this.party = value; - return this; - } - - /** - * @return {@link #party} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who attested the composition in the specified way.) - */ - public Resource getPartyTarget() { - return this.partyTarget; - } - - /** - * @param value {@link #party} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who attested the composition in the specified way.) - */ - public CompositionAttesterComponent setPartyTarget(Resource value) { - this.partyTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("mode", "code", "The type of attestation the authenticator offers.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("time", "dateTime", "When composition was attested by the party.", 0, java.lang.Integer.MAX_VALUE, time)); - childrenList.add(new Property("party", "Reference(Patient|Practitioner|Organization)", "Who attested the composition in the specified way.", 0, java.lang.Integer.MAX_VALUE, party)); - } - - public CompositionAttesterComponent copy() { - CompositionAttesterComponent dst = new CompositionAttesterComponent(); - copyValues(dst); - if (mode != null) { - dst.mode = new ArrayList>(); - for (Enumeration i : mode) - dst.mode.add(i.copy()); - }; - dst.time = time == null ? null : time.copy(); - dst.party = party == null ? null : party.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CompositionAttesterComponent)) - return false; - CompositionAttesterComponent o = (CompositionAttesterComponent) other; - return compareDeep(mode, o.mode, true) && compareDeep(time, o.time, true) && compareDeep(party, o.party, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CompositionAttesterComponent)) - return false; - CompositionAttesterComponent o = (CompositionAttesterComponent) other; - return compareValues(mode, o.mode, true) && compareValues(time, o.time, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (mode == null || mode.isEmpty()) && (time == null || time.isEmpty()) - && (party == null || party.isEmpty()); - } - - } - - @Block() - public static class CompositionEventComponent extends BackboneElement implements IBaseBackboneElement { - /** - * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Code(s) that apply to the event being documented", formalDefinition="This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a 'History and Physical Report' in which the procedure being documented is necessarily a 'History and Physical' act." ) - protected List code; - - /** - * The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time. - */ - @Child(name = "period", type = {Period.class}, order=2, min=0, max=1) - @Description(shortDefinition="The period covered by the documentation", formalDefinition="The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time." ) - protected Period period; - - /** - * Full details for the event(s) the composition/documentation consents. - */ - @Child(name = "detail", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Full details for the event(s) the composition consents", formalDefinition="Full details for the event(s) the composition/documentation consents." ) - protected List detail; - /** - * The actual objects that are the target of the reference (Full details for the event(s) the composition/documentation consents.) - */ - protected List detailTarget; - - - private static final long serialVersionUID = -1581379774L; - - /* - * Constructor - */ - public CompositionEventComponent() { - super(); - } - - /** - * @return {@link #code} (This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.) - */ - public List getCode() { - if (this.code == null) - this.code = new ArrayList(); - return this.code; - } - - public boolean hasCode() { - if (this.code == null) - return false; - for (CodeableConcept item : this.code) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #code} (This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.) - */ - // syntactic sugar - public CodeableConcept addCode() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.code == null) - this.code = new ArrayList(); - this.code.add(t); - return t; - } - - // syntactic sugar - public CompositionEventComponent addCode(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.code == null) - this.code = new ArrayList(); - this.code.add(t); - return this; - } - - /** - * @return {@link #period} (The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompositionEventComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time.) - */ - public CompositionEventComponent setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #detail} (Full details for the event(s) the composition/documentation consents.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (Reference item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (Full details for the event(s) the composition/documentation consents.) - */ - // syntactic sugar - public Reference addDetail() { //3 - Reference t = new Reference(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - // syntactic sugar - public CompositionEventComponent addDetail(Reference t) { //3 - if (t == null) - return this; - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return this; - } - - /** - * @return {@link #detail} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Full details for the event(s) the composition/documentation consents.) - */ - public List getDetailTarget() { - if (this.detailTarget == null) - this.detailTarget = new ArrayList(); - return this.detailTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a 'History and Physical Report' in which the procedure being documented is necessarily a 'History and Physical' act.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("period", "Period", "The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("detail", "Reference(Any)", "Full details for the event(s) the composition/documentation consents.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - public CompositionEventComponent copy() { - CompositionEventComponent dst = new CompositionEventComponent(); - copyValues(dst); - if (code != null) { - dst.code = new ArrayList(); - for (CodeableConcept i : code) - dst.code.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - if (detail != null) { - dst.detail = new ArrayList(); - for (Reference i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CompositionEventComponent)) - return false; - CompositionEventComponent o = (CompositionEventComponent) other; - return compareDeep(code, o.code, true) && compareDeep(period, o.period, true) && compareDeep(detail, o.detail, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CompositionEventComponent)) - return false; - CompositionEventComponent o = (CompositionEventComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (period == null || period.isEmpty()) - && (detail == null || detail.isEmpty()); - } - - } - - @Block() - public static class SectionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents. - */ - @Child(name = "title", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Label for section (e.g. for ToC)", formalDefinition="The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents." ) - protected StringType title; - - /** - * A code identifying the kind of content contained within the section. This must be consistent with the section title. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Classification of section (recommended)", formalDefinition="A code identifying the kind of content contained within the section. This must be consistent with the section title." ) - protected CodeableConcept code; - - /** - * The content (narrative and data entries) associated with the section. - */ - @Child(name = "content", type = {List_.class}, order=3, min=0, max=1) - @Description(shortDefinition="The Content of the section (narrative + data entries)", formalDefinition="The content (narrative and data entries) associated with the section." ) - protected Reference content; - - /** - * The actual object that is the target of the reference (The content (narrative and data entries) associated with the section.) - */ - protected List_ contentTarget; - - /** - * A nested sub-section within this section. - */ - @Child(name = "section", type = {SectionComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Nested Section", formalDefinition="A nested sub-section within this section." ) - protected List section; - - private static final long serialVersionUID = -1683518435L; - - /* - * Constructor - */ - public SectionComponent() { - super(); - } - - /** - * @return {@link #title} (The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SectionComponent.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); // bb - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public SectionComponent setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents. - */ - public SectionComponent setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (A code identifying the kind of content contained within the section. This must be consistent with the section title.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SectionComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A code identifying the kind of content contained within the section. This must be consistent with the section title.) - */ - public SectionComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #content} (The content (narrative and data entries) associated with the section.) - */ - public Reference getContent() { - if (this.content == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SectionComponent.content"); - else if (Configuration.doAutoCreate()) - this.content = new Reference(); // cc - return this.content; - } - - public boolean hasContent() { - return this.content != null && !this.content.isEmpty(); - } - - /** - * @param value {@link #content} (The content (narrative and data entries) associated with the section.) - */ - public SectionComponent setContent(Reference value) { - this.content = value; - return this; - } - - /** - * @return {@link #content} The actual object that is the 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 content (narrative and data entries) associated with the section.) - */ - public List_ getContentTarget() { - if (this.contentTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SectionComponent.content"); - else if (Configuration.doAutoCreate()) - this.contentTarget = new List_(); // aa - return this.contentTarget; - } - - /** - * @param value {@link #content} The actual object that is the 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 content (narrative and data entries) associated with the section.) - */ - public SectionComponent setContentTarget(List_ value) { - this.contentTarget = value; - return this; - } - - /** - * @return {@link #section} (A nested sub-section within this section.) - */ - public List getSection() { - if (this.section == null) - this.section = new ArrayList(); - return this.section; - } - - public boolean hasSection() { - if (this.section == null) - return false; - for (SectionComponent item : this.section) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #section} (A nested sub-section within this section.) - */ - // syntactic sugar - public SectionComponent addSection() { //3 - SectionComponent t = new SectionComponent(); - if (this.section == null) - this.section = new ArrayList(); - this.section.add(t); - return t; - } - - // syntactic sugar - public SectionComponent addSection(SectionComponent t) { //3 - if (t == null) - return this; - if (this.section == null) - this.section = new ArrayList(); - this.section.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("title", "string", "The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("code", "CodeableConcept", "A code identifying the kind of content contained within the section. This must be consistent with the section title.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("content", "Reference(List)", "The content (narrative and data entries) associated with the section.", 0, java.lang.Integer.MAX_VALUE, content)); - childrenList.add(new Property("section", "@Composition.section", "A nested sub-section within this section.", 0, java.lang.Integer.MAX_VALUE, section)); - } - - public SectionComponent copy() { - SectionComponent dst = new SectionComponent(); - copyValues(dst); - dst.title = title == null ? null : title.copy(); - dst.code = code == null ? null : code.copy(); - dst.content = content == null ? null : content.copy(); - if (section != null) { - dst.section = new ArrayList(); - for (SectionComponent i : section) - dst.section.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SectionComponent)) - return false; - SectionComponent o = (SectionComponent) other; - return compareDeep(title, o.title, true) && compareDeep(code, o.code, true) && compareDeep(content, o.content, true) - && compareDeep(section, o.section, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SectionComponent)) - return false; - SectionComponent o = (SectionComponent) other; - return compareValues(title, o.title, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (title == null || title.isEmpty()) && (code == null || code.isEmpty()) - && (content == null || content.isEmpty()) && (section == null || section.isEmpty()); - } - - } - - /** - * Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1) - @Description(shortDefinition="Logical identifier of composition (version-independent)", formalDefinition="Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time." ) - protected Identifier identifier; - - /** - * The composition editing time, when the composition was last logically changed by the author. - */ - @Child(name = "date", type = {DateTimeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Composition editing time", formalDefinition="The composition editing time, when the composition was last logically changed by the author." ) - protected DateTimeType date; - - /** - * Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=2, min=1, max=1) - @Description(shortDefinition="Kind of composition (LOINC if possible)", formalDefinition="Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition." ) - protected CodeableConcept type; - - /** - * A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type. - */ - @Child(name = "class_", type = {CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Categorization of Composition", formalDefinition="A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type." ) - protected CodeableConcept class_; - - /** - * Official human-readable label for the composition. - */ - @Child(name = "title", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Human Readable name/title", formalDefinition="Official human-readable label for the composition." ) - protected StringType title; - - /** - * The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document. - */ - @Child(name = "status", type = {CodeType.class}, order=5, min=1, max=1) - @Description(shortDefinition="preliminary | final | appended | amended | entered-in-error", formalDefinition="The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document." ) - protected Enumeration status; - - /** - * The code specifying the level of confidentiality of the Composition. - */ - @Child(name = "confidentiality", type = {CodeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="As defined by affinity domain", formalDefinition="The code specifying the level of confidentiality of the Composition." ) - protected CodeType confidentiality; - - /** - * Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure). - */ - @Child(name = "subject", type = {}, order=7, min=1, max=1) - @Description(shortDefinition="Who and/or what the composition is about", formalDefinition="Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure)." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) - */ - protected Resource subjectTarget; - - /** - * Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.). - */ - @Child(name = "author", type = {Practitioner.class, Device.class, Patient.class, RelatedPerson.class}, order=8, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who and/or what authored the composition", formalDefinition="Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.)." ) - protected List author; - /** - * The actual objects that are the target of the reference (Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.).) - */ - protected List authorTarget; - - - /** - * A participant who has attested to the accuracy of the composition/document. - */ - @Child(name = "attester", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Attests to accuracy of composition", formalDefinition="A participant who has attested to the accuracy of the composition/document." ) - protected List attester; - - /** - * Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information. - */ - @Child(name = "custodian", type = {Organization.class}, order=10, min=0, max=1) - @Description(shortDefinition="Org which maintains the composition", formalDefinition="Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information." ) - protected Reference custodian; - - /** - * The actual object that is the target of the reference (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) - */ - protected Organization custodianTarget; - - /** - * The clinical service, such as a colonoscopy or an appendectomy, being documented. - */ - @Child(name = "event", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The clinical service(s) being documented", formalDefinition="The clinical service, such as a colonoscopy or an appendectomy, being documented." ) - protected List event; - - /** - * Describes the clinical encounter or type of care this documentation is associated with. - */ - @Child(name = "encounter", type = {Encounter.class}, order=12, min=0, max=1) - @Description(shortDefinition="Context of the conposition", formalDefinition="Describes the clinical encounter or type of care this documentation is associated with." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (Describes the clinical encounter or type of care this documentation is associated with.) - */ - protected Encounter encounterTarget; - - /** - * The root of the sections that make up the composition. - */ - @Child(name = "section", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Composition is broken into sections", formalDefinition="The root of the sections that make up the composition." ) - protected List section; - - private static final long serialVersionUID = 2127852326L; - - /* - * Constructor - */ - public Composition() { - super(); - } - - /* - * Constructor - */ - public Composition(DateTimeType date, CodeableConcept type, Enumeration status, Reference subject) { - super(); - this.date = date; - this.type = type; - this.status = status; - this.subject = subject; - } - - /** - * @return {@link #identifier} (Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time.) - */ - public Composition setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #date} (The composition editing time, when the composition was last logically changed by the author.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The composition editing time, when the composition was last logically changed by the author.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public Composition setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The composition editing time, when the composition was last logically changed by the author. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The composition editing time, when the composition was last logically changed by the author. - */ - public Composition setDate(Date value) { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - return this; - } - - /** - * @return {@link #type} (Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition.) - */ - public Composition setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #class_} (A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type.) - */ - public CodeableConcept getClass_() { - if (this.class_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.class_"); - else if (Configuration.doAutoCreate()) - this.class_ = new CodeableConcept(); // cc - return this.class_; - } - - public boolean hasClass_() { - return this.class_ != null && !this.class_.isEmpty(); - } - - /** - * @param value {@link #class_} (A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type.) - */ - public Composition setClass_(CodeableConcept value) { - this.class_ = value; - return this; - } - - /** - * @return {@link #title} (Official human-readable label for the composition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); // bb - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (Official human-readable label for the composition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public Composition setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return Official human-readable label for the composition. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value Official human-readable label for the composition. - */ - public Composition setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new CompositionStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Composition setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document. - */ - public CompositionStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document. - */ - public Composition setStatus(CompositionStatus value) { - if (this.status == null) - this.status = new Enumeration(new CompositionStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #confidentiality} (The code specifying the level of confidentiality of the Composition.). This is the underlying object with id, value and extensions. The accessor "getConfidentiality" gives direct access to the value - */ - public CodeType getConfidentialityElement() { - if (this.confidentiality == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.confidentiality"); - else if (Configuration.doAutoCreate()) - this.confidentiality = new CodeType(); // bb - return this.confidentiality; - } - - public boolean hasConfidentialityElement() { - return this.confidentiality != null && !this.confidentiality.isEmpty(); - } - - public boolean hasConfidentiality() { - return this.confidentiality != null && !this.confidentiality.isEmpty(); - } - - /** - * @param value {@link #confidentiality} (The code specifying the level of confidentiality of the Composition.). This is the underlying object with id, value and extensions. The accessor "getConfidentiality" gives direct access to the value - */ - public Composition setConfidentialityElement(CodeType value) { - this.confidentiality = value; - return this; - } - - /** - * @return The code specifying the level of confidentiality of the Composition. - */ - public String getConfidentiality() { - return this.confidentiality == null ? null : this.confidentiality.getValue(); - } - - /** - * @param value The code specifying the level of confidentiality of the Composition. - */ - public Composition setConfidentiality(String value) { - if (Utilities.noString(value)) - this.confidentiality = null; - else { - if (this.confidentiality == null) - this.confidentiality = new CodeType(); - this.confidentiality.setValue(value); - } - return this; - } - - /** - * @return {@link #subject} (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) - */ - public Composition setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) - */ - public Composition setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #author} (Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.).) - */ - public List getAuthor() { - if (this.author == null) - this.author = new ArrayList(); - return this.author; - } - - public boolean hasAuthor() { - if (this.author == null) - return false; - for (Reference item : this.author) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #author} (Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.).) - */ - // syntactic sugar - public Reference addAuthor() { //3 - Reference t = new Reference(); - if (this.author == null) - this.author = new ArrayList(); - this.author.add(t); - return t; - } - - // syntactic sugar - public Composition addAuthor(Reference t) { //3 - if (t == null) - return this; - if (this.author == null) - this.author = new ArrayList(); - this.author.add(t); - return this; - } - - /** - * @return {@link #author} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.).) - */ - public List getAuthorTarget() { - if (this.authorTarget == null) - this.authorTarget = new ArrayList(); - return this.authorTarget; - } - - /** - * @return {@link #attester} (A participant who has attested to the accuracy of the composition/document.) - */ - public List getAttester() { - if (this.attester == null) - this.attester = new ArrayList(); - return this.attester; - } - - public boolean hasAttester() { - if (this.attester == null) - return false; - for (CompositionAttesterComponent item : this.attester) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #attester} (A participant who has attested to the accuracy of the composition/document.) - */ - // syntactic sugar - public CompositionAttesterComponent addAttester() { //3 - CompositionAttesterComponent t = new CompositionAttesterComponent(); - if (this.attester == null) - this.attester = new ArrayList(); - this.attester.add(t); - return t; - } - - // syntactic sugar - public Composition addAttester(CompositionAttesterComponent t) { //3 - if (t == null) - return this; - if (this.attester == null) - this.attester = new ArrayList(); - this.attester.add(t); - return this; - } - - /** - * @return {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) - */ - public Reference getCustodian() { - if (this.custodian == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.custodian"); - else if (Configuration.doAutoCreate()) - this.custodian = new Reference(); // cc - return this.custodian; - } - - public boolean hasCustodian() { - return this.custodian != null && !this.custodian.isEmpty(); - } - - /** - * @param value {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) - */ - public Composition setCustodian(Reference value) { - this.custodian = value; - return this; - } - - /** - * @return {@link #custodian} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) - */ - public Organization getCustodianTarget() { - if (this.custodianTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.custodian"); - else if (Configuration.doAutoCreate()) - this.custodianTarget = new Organization(); // aa - return this.custodianTarget; - } - - /** - * @param value {@link #custodian} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) - */ - public Composition setCustodianTarget(Organization value) { - this.custodianTarget = value; - return this; - } - - /** - * @return {@link #event} (The clinical service, such as a colonoscopy or an appendectomy, being documented.) - */ - public List getEvent() { - if (this.event == null) - this.event = new ArrayList(); - return this.event; - } - - public boolean hasEvent() { - if (this.event == null) - return false; - for (CompositionEventComponent item : this.event) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #event} (The clinical service, such as a colonoscopy or an appendectomy, being documented.) - */ - // syntactic sugar - public CompositionEventComponent addEvent() { //3 - CompositionEventComponent t = new CompositionEventComponent(); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return t; - } - - // syntactic sugar - public Composition addEvent(CompositionEventComponent t) { //3 - if (t == null) - return this; - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return this; - } - - /** - * @return {@link #encounter} (Describes the clinical encounter or type of care this documentation is associated with.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (Describes the clinical encounter or type of care this documentation is associated with.) - */ - public Composition setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the clinical encounter or type of care this documentation is associated with.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the clinical encounter or type of care this documentation is associated with.) - */ - public Composition setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #section} (The root of the sections that make up the composition.) - */ - public List getSection() { - if (this.section == null) - this.section = new ArrayList(); - return this.section; - } - - public boolean hasSection() { - if (this.section == null) - return false; - for (SectionComponent item : this.section) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #section} (The root of the sections that make up the composition.) - */ - // syntactic sugar - public SectionComponent addSection() { //3 - SectionComponent t = new SectionComponent(); - if (this.section == null) - this.section = new ArrayList(); - this.section.add(t); - return t; - } - - // syntactic sugar - public Composition addSection(SectionComponent t) { //3 - if (t == null) - return this; - if (this.section == null) - this.section = new ArrayList(); - this.section.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("date", "dateTime", "The composition editing time, when the composition was last logically changed by the author.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("type", "CodeableConcept", "Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("class", "CodeableConcept", "A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type.", 0, java.lang.Integer.MAX_VALUE, class_)); - childrenList.add(new Property("title", "string", "Official human-readable label for the composition.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("status", "code", "The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("confidentiality", "code", "The code specifying the level of confidentiality of the Composition.", 0, java.lang.Integer.MAX_VALUE, confidentiality)); - childrenList.add(new Property("subject", "Reference(Any)", "Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("author", "Reference(Practitioner|Device|Patient|RelatedPerson)", "Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.).", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("attester", "", "A participant who has attested to the accuracy of the composition/document.", 0, java.lang.Integer.MAX_VALUE, attester)); - childrenList.add(new Property("custodian", "Reference(Organization)", "Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.", 0, java.lang.Integer.MAX_VALUE, custodian)); - childrenList.add(new Property("event", "", "The clinical service, such as a colonoscopy or an appendectomy, being documented.", 0, java.lang.Integer.MAX_VALUE, event)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "Describes the clinical encounter or type of care this documentation is associated with.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("section", "", "The root of the sections that make up the composition.", 0, java.lang.Integer.MAX_VALUE, section)); - } - - public Composition copy() { - Composition dst = new Composition(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.date = date == null ? null : date.copy(); - dst.type = type == null ? null : type.copy(); - dst.class_ = class_ == null ? null : class_.copy(); - dst.title = title == null ? null : title.copy(); - dst.status = status == null ? null : status.copy(); - dst.confidentiality = confidentiality == null ? null : confidentiality.copy(); - dst.subject = subject == null ? null : subject.copy(); - if (author != null) { - dst.author = new ArrayList(); - for (Reference i : author) - dst.author.add(i.copy()); - }; - if (attester != null) { - dst.attester = new ArrayList(); - for (CompositionAttesterComponent i : attester) - dst.attester.add(i.copy()); - }; - dst.custodian = custodian == null ? null : custodian.copy(); - if (event != null) { - dst.event = new ArrayList(); - for (CompositionEventComponent i : event) - dst.event.add(i.copy()); - }; - dst.encounter = encounter == null ? null : encounter.copy(); - if (section != null) { - dst.section = new ArrayList(); - for (SectionComponent i : section) - dst.section.add(i.copy()); - }; - return dst; - } - - protected Composition typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Composition)) - return false; - Composition o = (Composition) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(date, o.date, true) && compareDeep(type, o.type, true) - && compareDeep(class_, o.class_, true) && compareDeep(title, o.title, true) && compareDeep(status, o.status, true) - && compareDeep(confidentiality, o.confidentiality, true) && compareDeep(subject, o.subject, true) - && compareDeep(author, o.author, true) && compareDeep(attester, o.attester, true) && compareDeep(custodian, o.custodian, true) - && compareDeep(event, o.event, true) && compareDeep(encounter, o.encounter, true) && compareDeep(section, o.section, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Composition)) - return false; - Composition o = (Composition) other; - return compareValues(date, o.date, true) && compareValues(title, o.title, true) && compareValues(status, o.status, true) - && compareValues(confidentiality, o.confidentiality, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (date == null || date.isEmpty()) - && (type == null || type.isEmpty()) && (class_ == null || class_.isEmpty()) && (title == null || title.isEmpty()) - && (status == null || status.isEmpty()) && (confidentiality == null || confidentiality.isEmpty()) - && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) && (attester == null || attester.isEmpty()) - && (custodian == null || custodian.isEmpty()) && (event == null || event.isEmpty()) && (encounter == null || encounter.isEmpty()) - && (section == null || section.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Composition; - } - - @SearchParamDefinition(name="section-code", path="Composition.section.code", description="Classification of section (recommended)", type="token" ) - public static final String SP_SECTIONCODE = "section-code"; - @SearchParamDefinition(name="status", path="Composition.status", description="preliminary | final | appended | amended | entered-in-error", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="subject", path="Composition.subject", description="Who and/or what the composition is about", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="class", path="Composition.class", description="Categorization of Composition", type="token" ) - public static final String SP_CLASS = "class"; - @SearchParamDefinition(name="encounter", path="Composition.encounter", description="Context of the conposition", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - @SearchParamDefinition(name="period", path="Composition.event.period", description="The period covered by the documentation", type="date" ) - public static final String SP_PERIOD = "period"; - @SearchParamDefinition(name="type", path="Composition.type", description="Kind of composition (LOINC if possible)", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="date", path="Composition.date", description="Composition editing time", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="section", path="Composition.section.content", description="The Content of the section (narrative + data entries)", type="reference" ) - public static final String SP_SECTION = "section"; - @SearchParamDefinition(name="author", path="Composition.author", description="Who and/or what authored the composition", type="reference" ) - public static final String SP_AUTHOR = "author"; - @SearchParamDefinition(name="title", path="Composition.title", description="Human Readable name/title", type="string" ) - public static final String SP_TITLE = "title"; - @SearchParamDefinition(name="patient", path="Composition.subject", description="Who and/or what the composition is about", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="attester", path="Composition.attester.party", description="Who attested the composition", type="reference" ) - public static final String SP_ATTESTER = "attester"; - @SearchParamDefinition(name="confidentiality", path="Composition.confidentiality", description="As defined by affinity domain", type="token" ) - public static final String SP_CONFIDENTIALITY = "confidentiality"; - @SearchParamDefinition(name="context", path="Composition.event.code", description="Code(s) that apply to the event being documented", type="token" ) - public static final String SP_CONTEXT = "context"; - @SearchParamDefinition(name="identifier", path="Composition.identifier", description="Logical identifier of composition (version-independent)", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. + */ +@ResourceDef(name="Composition", profile="http://hl7.org/fhir/Profile/Composition") +public class Composition extends DomainResource { + + public enum CompositionStatus { + /** + * This is a preliminary composition or document (also known as initial or interim). The content may be incomplete or unverified. + */ + PRELIMINARY, + /** + * This version of the composition is complete and verified by an appropriate person and no further work is planned. Any subsequent updates would be on a new version of the composition. + */ + FINAL, + /** + * The composition or document has been modified subsequent to being released as "final", and is complete and verified by an authorized person. The modifications added new information to the composition or document, but did not revise existing content. + */ + APPENDED, + /** + * The composition or document has been modified subsequent to being released as "final", and is complete and verified by an authorized person. + */ + AMENDED, + /** + * The composition or document was originally created/issued in error, and this is an amendment that marks that the entire series should not be considered as valid. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static CompositionStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("preliminary".equals(codeString)) + return PRELIMINARY; + if ("final".equals(codeString)) + return FINAL; + if ("appended".equals(codeString)) + return APPENDED; + if ("amended".equals(codeString)) + return AMENDED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new Exception("Unknown CompositionStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PRELIMINARY: return "preliminary"; + case FINAL: return "final"; + case APPENDED: return "appended"; + case AMENDED: return "amended"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PRELIMINARY: return ""; + case FINAL: return ""; + case APPENDED: return ""; + case AMENDED: return ""; + case ENTEREDINERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PRELIMINARY: return "This is a preliminary composition or document (also known as initial or interim). The content may be incomplete or unverified."; + case FINAL: return "This version of the composition is complete and verified by an appropriate person and no further work is planned. Any subsequent updates would be on a new version of the composition."; + case APPENDED: return "The composition or document has been modified subsequent to being released as 'final', and is complete and verified by an authorized person. The modifications added new information to the composition or document, but did not revise existing content."; + case AMENDED: return "The composition or document has been modified subsequent to being released as 'final', and is complete and verified by an authorized person."; + case ENTEREDINERROR: return "The composition or document was originally created/issued in error, and this is an amendment that marks that the entire series should not be considered as valid."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PRELIMINARY: return "Preliminary"; + case FINAL: return "Final"; + case APPENDED: return "Appended"; + case AMENDED: return "Amended"; + case ENTEREDINERROR: return "Entered In Error"; + default: return "?"; + } + } + } + + public static class CompositionStatusEnumFactory implements EnumFactory { + public CompositionStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("preliminary".equals(codeString)) + return CompositionStatus.PRELIMINARY; + if ("final".equals(codeString)) + return CompositionStatus.FINAL; + if ("appended".equals(codeString)) + return CompositionStatus.APPENDED; + if ("amended".equals(codeString)) + return CompositionStatus.AMENDED; + if ("entered-in-error".equals(codeString)) + return CompositionStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown CompositionStatus code '"+codeString+"'"); + } + public String toCode(CompositionStatus code) { + if (code == CompositionStatus.PRELIMINARY) + return "preliminary"; + if (code == CompositionStatus.FINAL) + return "final"; + if (code == CompositionStatus.APPENDED) + return "appended"; + if (code == CompositionStatus.AMENDED) + return "amended"; + if (code == CompositionStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + } + + public enum CompositionAttestationMode { + /** + * The person authenticated the content in their personal capacity. + */ + PERSONAL, + /** + * The person authenticated the content in their professional capacity. + */ + PROFESSIONAL, + /** + * The person authenticated the content and accepted legal responsibility for its content. + */ + LEGAL, + /** + * The organization authenticated the content as consistent with their policies and procedures. + */ + OFFICIAL, + /** + * added to help the parsers + */ + NULL; + public static CompositionAttestationMode fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("personal".equals(codeString)) + return PERSONAL; + if ("professional".equals(codeString)) + return PROFESSIONAL; + if ("legal".equals(codeString)) + return LEGAL; + if ("official".equals(codeString)) + return OFFICIAL; + throw new Exception("Unknown CompositionAttestationMode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PERSONAL: return "personal"; + case PROFESSIONAL: return "professional"; + case LEGAL: return "legal"; + case OFFICIAL: return "official"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PERSONAL: return ""; + case PROFESSIONAL: return ""; + case LEGAL: return ""; + case OFFICIAL: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PERSONAL: return "The person authenticated the content in their personal capacity."; + case PROFESSIONAL: return "The person authenticated the content in their professional capacity."; + case LEGAL: return "The person authenticated the content and accepted legal responsibility for its content."; + case OFFICIAL: return "The organization authenticated the content as consistent with their policies and procedures."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PERSONAL: return "Personal"; + case PROFESSIONAL: return "Professional"; + case LEGAL: return "Legal"; + case OFFICIAL: return "Official"; + default: return "?"; + } + } + } + + public static class CompositionAttestationModeEnumFactory implements EnumFactory { + public CompositionAttestationMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("personal".equals(codeString)) + return CompositionAttestationMode.PERSONAL; + if ("professional".equals(codeString)) + return CompositionAttestationMode.PROFESSIONAL; + if ("legal".equals(codeString)) + return CompositionAttestationMode.LEGAL; + if ("official".equals(codeString)) + return CompositionAttestationMode.OFFICIAL; + throw new IllegalArgumentException("Unknown CompositionAttestationMode code '"+codeString+"'"); + } + public String toCode(CompositionAttestationMode code) { + if (code == CompositionAttestationMode.PERSONAL) + return "personal"; + if (code == CompositionAttestationMode.PROFESSIONAL) + return "professional"; + if (code == CompositionAttestationMode.LEGAL) + return "legal"; + if (code == CompositionAttestationMode.OFFICIAL) + return "official"; + return "?"; + } + } + + @Block() + public static class CompositionAttesterComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The type of attestation the authenticator offers. + */ + @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="personal | professional | legal | official", formalDefinition="The type of attestation the authenticator offers." ) + protected List> mode; + + /** + * When composition was attested by the party. + */ + @Child(name = "time", type = {DateTimeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="When composition attested", formalDefinition="When composition was attested by the party." ) + protected DateTimeType time; + + /** + * Who attested the composition in the specified way. + */ + @Child(name = "party", type = {Patient.class, Practitioner.class, Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Who attested the composition", formalDefinition="Who attested the composition in the specified way." ) + protected Reference party; + + /** + * The actual object that is the target of the reference (Who attested the composition in the specified way.) + */ + protected Resource partyTarget; + + private static final long serialVersionUID = -436604745L; + + /* + * Constructor + */ + public CompositionAttesterComponent() { + super(); + } + + /** + * @return {@link #mode} (The type of attestation the authenticator offers.) + */ + public List> getMode() { + if (this.mode == null) + this.mode = new ArrayList>(); + return this.mode; + } + + public boolean hasMode() { + if (this.mode == null) + return false; + for (Enumeration item : this.mode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #mode} (The type of attestation the authenticator offers.) + */ + // syntactic sugar + public Enumeration addModeElement() {//2 + Enumeration t = new Enumeration(new CompositionAttestationModeEnumFactory()); + if (this.mode == null) + this.mode = new ArrayList>(); + this.mode.add(t); + return t; + } + + /** + * @param value {@link #mode} (The type of attestation the authenticator offers.) + */ + public CompositionAttesterComponent addMode(CompositionAttestationMode value) { //1 + Enumeration t = new Enumeration(new CompositionAttestationModeEnumFactory()); + t.setValue(value); + if (this.mode == null) + this.mode = new ArrayList>(); + this.mode.add(t); + return this; + } + + /** + * @param value {@link #mode} (The type of attestation the authenticator offers.) + */ + public boolean hasMode(CompositionAttestationMode value) { + if (this.mode == null) + return false; + for (Enumeration v : this.mode) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #time} (When composition was attested by the party.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value + */ + public DateTimeType getTimeElement() { + if (this.time == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CompositionAttesterComponent.time"); + else if (Configuration.doAutoCreate()) + this.time = new DateTimeType(); // bb + return this.time; + } + + public boolean hasTimeElement() { + return this.time != null && !this.time.isEmpty(); + } + + public boolean hasTime() { + return this.time != null && !this.time.isEmpty(); + } + + /** + * @param value {@link #time} (When composition was attested by the party.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value + */ + public CompositionAttesterComponent setTimeElement(DateTimeType value) { + this.time = value; + return this; + } + + /** + * @return When composition was attested by the party. + */ + public Date getTime() { + return this.time == null ? null : this.time.getValue(); + } + + /** + * @param value When composition was attested by the party. + */ + public CompositionAttesterComponent setTime(Date value) { + if (value == null) + this.time = null; + else { + if (this.time == null) + this.time = new DateTimeType(); + this.time.setValue(value); + } + return this; + } + + /** + * @return {@link #party} (Who attested the composition in the specified way.) + */ + public Reference getParty() { + if (this.party == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CompositionAttesterComponent.party"); + else if (Configuration.doAutoCreate()) + this.party = new Reference(); // cc + return this.party; + } + + public boolean hasParty() { + return this.party != null && !this.party.isEmpty(); + } + + /** + * @param value {@link #party} (Who attested the composition in the specified way.) + */ + public CompositionAttesterComponent setParty(Reference value) { + this.party = value; + return this; + } + + /** + * @return {@link #party} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who attested the composition in the specified way.) + */ + public Resource getPartyTarget() { + return this.partyTarget; + } + + /** + * @param value {@link #party} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who attested the composition in the specified way.) + */ + public CompositionAttesterComponent setPartyTarget(Resource value) { + this.partyTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("mode", "code", "The type of attestation the authenticator offers.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("time", "dateTime", "When composition was attested by the party.", 0, java.lang.Integer.MAX_VALUE, time)); + childrenList.add(new Property("party", "Reference(Patient|Practitioner|Organization)", "Who attested the composition in the specified way.", 0, java.lang.Integer.MAX_VALUE, party)); + } + + public CompositionAttesterComponent copy() { + CompositionAttesterComponent dst = new CompositionAttesterComponent(); + copyValues(dst); + if (mode != null) { + dst.mode = new ArrayList>(); + for (Enumeration i : mode) + dst.mode.add(i.copy()); + }; + dst.time = time == null ? null : time.copy(); + dst.party = party == null ? null : party.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CompositionAttesterComponent)) + return false; + CompositionAttesterComponent o = (CompositionAttesterComponent) other; + return compareDeep(mode, o.mode, true) && compareDeep(time, o.time, true) && compareDeep(party, o.party, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CompositionAttesterComponent)) + return false; + CompositionAttesterComponent o = (CompositionAttesterComponent) other; + return compareValues(mode, o.mode, true) && compareValues(time, o.time, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (mode == null || mode.isEmpty()) && (time == null || time.isEmpty()) + && (party == null || party.isEmpty()); + } + + } + + @Block() + public static class CompositionEventComponent extends BackboneElement implements IBaseBackboneElement { + /** + * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Code(s) that apply to the event being documented", formalDefinition="This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a 'History and Physical Report' in which the procedure being documented is necessarily a 'History and Physical' act." ) + protected List code; + + /** + * The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time. + */ + @Child(name = "period", type = {Period.class}, order=2, min=0, max=1) + @Description(shortDefinition="The period covered by the documentation", formalDefinition="The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time." ) + protected Period period; + + /** + * Full details for the event(s) the composition/documentation consents. + */ + @Child(name = "detail", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Full details for the event(s) the composition consents", formalDefinition="Full details for the event(s) the composition/documentation consents." ) + protected List detail; + /** + * The actual objects that are the target of the reference (Full details for the event(s) the composition/documentation consents.) + */ + protected List detailTarget; + + + private static final long serialVersionUID = -1581379774L; + + /* + * Constructor + */ + public CompositionEventComponent() { + super(); + } + + /** + * @return {@link #code} (This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.) + */ + public List getCode() { + if (this.code == null) + this.code = new ArrayList(); + return this.code; + } + + public boolean hasCode() { + if (this.code == null) + return false; + for (CodeableConcept item : this.code) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #code} (This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.) + */ + // syntactic sugar + public CodeableConcept addCode() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.code == null) + this.code = new ArrayList(); + this.code.add(t); + return t; + } + + // syntactic sugar + public CompositionEventComponent addCode(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.code == null) + this.code = new ArrayList(); + this.code.add(t); + return this; + } + + /** + * @return {@link #period} (The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CompositionEventComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time.) + */ + public CompositionEventComponent setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #detail} (Full details for the event(s) the composition/documentation consents.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (Reference item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (Full details for the event(s) the composition/documentation consents.) + */ + // syntactic sugar + public Reference addDetail() { //3 + Reference t = new Reference(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + // syntactic sugar + public CompositionEventComponent addDetail(Reference t) { //3 + if (t == null) + return this; + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return this; + } + + /** + * @return {@link #detail} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Full details for the event(s) the composition/documentation consents.) + */ + public List getDetailTarget() { + if (this.detailTarget == null) + this.detailTarget = new ArrayList(); + return this.detailTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a 'History and Physical Report' in which the procedure being documented is necessarily a 'History and Physical' act.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("period", "Period", "The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("detail", "Reference(Any)", "Full details for the event(s) the composition/documentation consents.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public CompositionEventComponent copy() { + CompositionEventComponent dst = new CompositionEventComponent(); + copyValues(dst); + if (code != null) { + dst.code = new ArrayList(); + for (CodeableConcept i : code) + dst.code.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + if (detail != null) { + dst.detail = new ArrayList(); + for (Reference i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CompositionEventComponent)) + return false; + CompositionEventComponent o = (CompositionEventComponent) other; + return compareDeep(code, o.code, true) && compareDeep(period, o.period, true) && compareDeep(detail, o.detail, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CompositionEventComponent)) + return false; + CompositionEventComponent o = (CompositionEventComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (period == null || period.isEmpty()) + && (detail == null || detail.isEmpty()); + } + + } + + @Block() + public static class SectionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents. + */ + @Child(name = "title", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Label for section (e.g. for ToC)", formalDefinition="The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents." ) + protected StringType title; + + /** + * A code identifying the kind of content contained within the section. This must be consistent with the section title. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Classification of section (recommended)", formalDefinition="A code identifying the kind of content contained within the section. This must be consistent with the section title." ) + protected CodeableConcept code; + + /** + * The content (narrative and data entries) associated with the section. + */ + @Child(name = "content", type = {List_.class}, order=3, min=0, max=1) + @Description(shortDefinition="The Content of the section (narrative + data entries)", formalDefinition="The content (narrative and data entries) associated with the section." ) + protected Reference content; + + /** + * The actual object that is the target of the reference (The content (narrative and data entries) associated with the section.) + */ + protected List_ contentTarget; + + /** + * A nested sub-section within this section. + */ + @Child(name = "section", type = {SectionComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Nested Section", formalDefinition="A nested sub-section within this section." ) + protected List section; + + private static final long serialVersionUID = -1683518435L; + + /* + * Constructor + */ + public SectionComponent() { + super(); + } + + /** + * @return {@link #title} (The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SectionComponent.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); // bb + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public SectionComponent setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents. + */ + public SectionComponent setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (A code identifying the kind of content contained within the section. This must be consistent with the section title.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SectionComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A code identifying the kind of content contained within the section. This must be consistent with the section title.) + */ + public SectionComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #content} (The content (narrative and data entries) associated with the section.) + */ + public Reference getContent() { + if (this.content == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SectionComponent.content"); + else if (Configuration.doAutoCreate()) + this.content = new Reference(); // cc + return this.content; + } + + public boolean hasContent() { + return this.content != null && !this.content.isEmpty(); + } + + /** + * @param value {@link #content} (The content (narrative and data entries) associated with the section.) + */ + public SectionComponent setContent(Reference value) { + this.content = value; + return this; + } + + /** + * @return {@link #content} The actual object that is the 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 content (narrative and data entries) associated with the section.) + */ + public List_ getContentTarget() { + if (this.contentTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SectionComponent.content"); + else if (Configuration.doAutoCreate()) + this.contentTarget = new List_(); // aa + return this.contentTarget; + } + + /** + * @param value {@link #content} The actual object that is the 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 content (narrative and data entries) associated with the section.) + */ + public SectionComponent setContentTarget(List_ value) { + this.contentTarget = value; + return this; + } + + /** + * @return {@link #section} (A nested sub-section within this section.) + */ + public List getSection() { + if (this.section == null) + this.section = new ArrayList(); + return this.section; + } + + public boolean hasSection() { + if (this.section == null) + return false; + for (SectionComponent item : this.section) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #section} (A nested sub-section within this section.) + */ + // syntactic sugar + public SectionComponent addSection() { //3 + SectionComponent t = new SectionComponent(); + if (this.section == null) + this.section = new ArrayList(); + this.section.add(t); + return t; + } + + // syntactic sugar + public SectionComponent addSection(SectionComponent t) { //3 + if (t == null) + return this; + if (this.section == null) + this.section = new ArrayList(); + this.section.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("title", "string", "The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("code", "CodeableConcept", "A code identifying the kind of content contained within the section. This must be consistent with the section title.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("content", "Reference(List)", "The content (narrative and data entries) associated with the section.", 0, java.lang.Integer.MAX_VALUE, content)); + childrenList.add(new Property("section", "@Composition.section", "A nested sub-section within this section.", 0, java.lang.Integer.MAX_VALUE, section)); + } + + public SectionComponent copy() { + SectionComponent dst = new SectionComponent(); + copyValues(dst); + dst.title = title == null ? null : title.copy(); + dst.code = code == null ? null : code.copy(); + dst.content = content == null ? null : content.copy(); + if (section != null) { + dst.section = new ArrayList(); + for (SectionComponent i : section) + dst.section.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SectionComponent)) + return false; + SectionComponent o = (SectionComponent) other; + return compareDeep(title, o.title, true) && compareDeep(code, o.code, true) && compareDeep(content, o.content, true) + && compareDeep(section, o.section, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SectionComponent)) + return false; + SectionComponent o = (SectionComponent) other; + return compareValues(title, o.title, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (title == null || title.isEmpty()) && (code == null || code.isEmpty()) + && (content == null || content.isEmpty()) && (section == null || section.isEmpty()); + } + + } + + /** + * Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1) + @Description(shortDefinition="Logical identifier of composition (version-independent)", formalDefinition="Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time." ) + protected Identifier identifier; + + /** + * The composition editing time, when the composition was last logically changed by the author. + */ + @Child(name = "date", type = {DateTimeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Composition editing time", formalDefinition="The composition editing time, when the composition was last logically changed by the author." ) + protected DateTimeType date; + + /** + * Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=2, min=1, max=1) + @Description(shortDefinition="Kind of composition (LOINC if possible)", formalDefinition="Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition." ) + protected CodeableConcept type; + + /** + * A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type. + */ + @Child(name = "class_", type = {CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Categorization of Composition", formalDefinition="A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type." ) + protected CodeableConcept class_; + + /** + * Official human-readable label for the composition. + */ + @Child(name = "title", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Human Readable name/title", formalDefinition="Official human-readable label for the composition." ) + protected StringType title; + + /** + * The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document. + */ + @Child(name = "status", type = {CodeType.class}, order=5, min=1, max=1) + @Description(shortDefinition="preliminary | final | appended | amended | entered-in-error", formalDefinition="The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document." ) + protected Enumeration status; + + /** + * The code specifying the level of confidentiality of the Composition. + */ + @Child(name = "confidentiality", type = {CodeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="As defined by affinity domain", formalDefinition="The code specifying the level of confidentiality of the Composition." ) + protected CodeType confidentiality; + + /** + * Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure). + */ + @Child(name = "subject", type = {}, order=7, min=1, max=1) + @Description(shortDefinition="Who and/or what the composition is about", formalDefinition="Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure)." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) + */ + protected Resource subjectTarget; + + /** + * Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.). + */ + @Child(name = "author", type = {Practitioner.class, Device.class, Patient.class, RelatedPerson.class}, order=8, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who and/or what authored the composition", formalDefinition="Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.)." ) + protected List author; + /** + * The actual objects that are the target of the reference (Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.).) + */ + protected List authorTarget; + + + /** + * A participant who has attested to the accuracy of the composition/document. + */ + @Child(name = "attester", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Attests to accuracy of composition", formalDefinition="A participant who has attested to the accuracy of the composition/document." ) + protected List attester; + + /** + * Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information. + */ + @Child(name = "custodian", type = {Organization.class}, order=10, min=0, max=1) + @Description(shortDefinition="Org which maintains the composition", formalDefinition="Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information." ) + protected Reference custodian; + + /** + * The actual object that is the target of the reference (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) + */ + protected Organization custodianTarget; + + /** + * The clinical service, such as a colonoscopy or an appendectomy, being documented. + */ + @Child(name = "event", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The clinical service(s) being documented", formalDefinition="The clinical service, such as a colonoscopy or an appendectomy, being documented." ) + protected List event; + + /** + * Describes the clinical encounter or type of care this documentation is associated with. + */ + @Child(name = "encounter", type = {Encounter.class}, order=12, min=0, max=1) + @Description(shortDefinition="Context of the conposition", formalDefinition="Describes the clinical encounter or type of care this documentation is associated with." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (Describes the clinical encounter or type of care this documentation is associated with.) + */ + protected Encounter encounterTarget; + + /** + * The root of the sections that make up the composition. + */ + @Child(name = "section", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Composition is broken into sections", formalDefinition="The root of the sections that make up the composition." ) + protected List section; + + private static final long serialVersionUID = 2127852326L; + + /* + * Constructor + */ + public Composition() { + super(); + } + + /* + * Constructor + */ + public Composition(DateTimeType date, CodeableConcept type, Enumeration status, Reference subject) { + super(); + this.date = date; + this.type = type; + this.status = status; + this.subject = subject; + } + + /** + * @return {@link #identifier} (Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time.) + */ + public Composition setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #date} (The composition editing time, when the composition was last logically changed by the author.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The composition editing time, when the composition was last logically changed by the author.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public Composition setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The composition editing time, when the composition was last logically changed by the author. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The composition editing time, when the composition was last logically changed by the author. + */ + public Composition setDate(Date value) { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + return this; + } + + /** + * @return {@link #type} (Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition.) + */ + public Composition setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #class_} (A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type.) + */ + public CodeableConcept getClass_() { + if (this.class_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.class_"); + else if (Configuration.doAutoCreate()) + this.class_ = new CodeableConcept(); // cc + return this.class_; + } + + public boolean hasClass_() { + return this.class_ != null && !this.class_.isEmpty(); + } + + /** + * @param value {@link #class_} (A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type.) + */ + public Composition setClass_(CodeableConcept value) { + this.class_ = value; + return this; + } + + /** + * @return {@link #title} (Official human-readable label for the composition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); // bb + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (Official human-readable label for the composition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public Composition setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return Official human-readable label for the composition. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value Official human-readable label for the composition. + */ + public Composition setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new CompositionStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Composition setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document. + */ + public CompositionStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document. + */ + public Composition setStatus(CompositionStatus value) { + if (this.status == null) + this.status = new Enumeration(new CompositionStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #confidentiality} (The code specifying the level of confidentiality of the Composition.). This is the underlying object with id, value and extensions. The accessor "getConfidentiality" gives direct access to the value + */ + public CodeType getConfidentialityElement() { + if (this.confidentiality == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.confidentiality"); + else if (Configuration.doAutoCreate()) + this.confidentiality = new CodeType(); // bb + return this.confidentiality; + } + + public boolean hasConfidentialityElement() { + return this.confidentiality != null && !this.confidentiality.isEmpty(); + } + + public boolean hasConfidentiality() { + return this.confidentiality != null && !this.confidentiality.isEmpty(); + } + + /** + * @param value {@link #confidentiality} (The code specifying the level of confidentiality of the Composition.). This is the underlying object with id, value and extensions. The accessor "getConfidentiality" gives direct access to the value + */ + public Composition setConfidentialityElement(CodeType value) { + this.confidentiality = value; + return this; + } + + /** + * @return The code specifying the level of confidentiality of the Composition. + */ + public String getConfidentiality() { + return this.confidentiality == null ? null : this.confidentiality.getValue(); + } + + /** + * @param value The code specifying the level of confidentiality of the Composition. + */ + public Composition setConfidentiality(String value) { + if (Utilities.noString(value)) + this.confidentiality = null; + else { + if (this.confidentiality == null) + this.confidentiality = new CodeType(); + this.confidentiality.setValue(value); + } + return this; + } + + /** + * @return {@link #subject} (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) + */ + public Composition setSubject(Reference value) { + this.subject = value; + return this; + } + + /** + * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) + */ + public Resource getSubjectTarget() { + return this.subjectTarget; + } + + /** + * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) + */ + public Composition setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #author} (Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.).) + */ + public List getAuthor() { + if (this.author == null) + this.author = new ArrayList(); + return this.author; + } + + public boolean hasAuthor() { + if (this.author == null) + return false; + for (Reference item : this.author) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #author} (Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.).) + */ + // syntactic sugar + public Reference addAuthor() { //3 + Reference t = new Reference(); + if (this.author == null) + this.author = new ArrayList(); + this.author.add(t); + return t; + } + + // syntactic sugar + public Composition addAuthor(Reference t) { //3 + if (t == null) + return this; + if (this.author == null) + this.author = new ArrayList(); + this.author.add(t); + return this; + } + + /** + * @return {@link #author} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.).) + */ + public List getAuthorTarget() { + if (this.authorTarget == null) + this.authorTarget = new ArrayList(); + return this.authorTarget; + } + + /** + * @return {@link #attester} (A participant who has attested to the accuracy of the composition/document.) + */ + public List getAttester() { + if (this.attester == null) + this.attester = new ArrayList(); + return this.attester; + } + + public boolean hasAttester() { + if (this.attester == null) + return false; + for (CompositionAttesterComponent item : this.attester) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #attester} (A participant who has attested to the accuracy of the composition/document.) + */ + // syntactic sugar + public CompositionAttesterComponent addAttester() { //3 + CompositionAttesterComponent t = new CompositionAttesterComponent(); + if (this.attester == null) + this.attester = new ArrayList(); + this.attester.add(t); + return t; + } + + // syntactic sugar + public Composition addAttester(CompositionAttesterComponent t) { //3 + if (t == null) + return this; + if (this.attester == null) + this.attester = new ArrayList(); + this.attester.add(t); + return this; + } + + /** + * @return {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) + */ + public Reference getCustodian() { + if (this.custodian == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.custodian"); + else if (Configuration.doAutoCreate()) + this.custodian = new Reference(); // cc + return this.custodian; + } + + public boolean hasCustodian() { + return this.custodian != null && !this.custodian.isEmpty(); + } + + /** + * @param value {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) + */ + public Composition setCustodian(Reference value) { + this.custodian = value; + return this; + } + + /** + * @return {@link #custodian} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) + */ + public Organization getCustodianTarget() { + if (this.custodianTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.custodian"); + else if (Configuration.doAutoCreate()) + this.custodianTarget = new Organization(); // aa + return this.custodianTarget; + } + + /** + * @param value {@link #custodian} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) + */ + public Composition setCustodianTarget(Organization value) { + this.custodianTarget = value; + return this; + } + + /** + * @return {@link #event} (The clinical service, such as a colonoscopy or an appendectomy, being documented.) + */ + public List getEvent() { + if (this.event == null) + this.event = new ArrayList(); + return this.event; + } + + public boolean hasEvent() { + if (this.event == null) + return false; + for (CompositionEventComponent item : this.event) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #event} (The clinical service, such as a colonoscopy or an appendectomy, being documented.) + */ + // syntactic sugar + public CompositionEventComponent addEvent() { //3 + CompositionEventComponent t = new CompositionEventComponent(); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return t; + } + + // syntactic sugar + public Composition addEvent(CompositionEventComponent t) { //3 + if (t == null) + return this; + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return this; + } + + /** + * @return {@link #encounter} (Describes the clinical encounter or type of care this documentation is associated with.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (Describes the clinical encounter or type of care this documentation is associated with.) + */ + public Composition setEncounter(Reference value) { + this.encounter = value; + return this; + } + + /** + * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the clinical encounter or type of care this documentation is associated with.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + return this.encounterTarget; + } + + /** + * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the clinical encounter or type of care this documentation is associated with.) + */ + public Composition setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #section} (The root of the sections that make up the composition.) + */ + public List getSection() { + if (this.section == null) + this.section = new ArrayList(); + return this.section; + } + + public boolean hasSection() { + if (this.section == null) + return false; + for (SectionComponent item : this.section) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #section} (The root of the sections that make up the composition.) + */ + // syntactic sugar + public SectionComponent addSection() { //3 + SectionComponent t = new SectionComponent(); + if (this.section == null) + this.section = new ArrayList(); + this.section.add(t); + return t; + } + + // syntactic sugar + public Composition addSection(SectionComponent t) { //3 + if (t == null) + return this; + if (this.section == null) + this.section = new ArrayList(); + this.section.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("date", "dateTime", "The composition editing time, when the composition was last logically changed by the author.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("type", "CodeableConcept", "Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("class", "CodeableConcept", "A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type.", 0, java.lang.Integer.MAX_VALUE, class_)); + childrenList.add(new Property("title", "string", "Official human-readable label for the composition.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("status", "code", "The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("confidentiality", "code", "The code specifying the level of confidentiality of the Composition.", 0, java.lang.Integer.MAX_VALUE, confidentiality)); + childrenList.add(new Property("subject", "Reference(Any)", "Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("author", "Reference(Practitioner|Device|Patient|RelatedPerson)", "Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.).", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("attester", "", "A participant who has attested to the accuracy of the composition/document.", 0, java.lang.Integer.MAX_VALUE, attester)); + childrenList.add(new Property("custodian", "Reference(Organization)", "Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.", 0, java.lang.Integer.MAX_VALUE, custodian)); + childrenList.add(new Property("event", "", "The clinical service, such as a colonoscopy or an appendectomy, being documented.", 0, java.lang.Integer.MAX_VALUE, event)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "Describes the clinical encounter or type of care this documentation is associated with.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("section", "", "The root of the sections that make up the composition.", 0, java.lang.Integer.MAX_VALUE, section)); + } + + public Composition copy() { + Composition dst = new Composition(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.date = date == null ? null : date.copy(); + dst.type = type == null ? null : type.copy(); + dst.class_ = class_ == null ? null : class_.copy(); + dst.title = title == null ? null : title.copy(); + dst.status = status == null ? null : status.copy(); + dst.confidentiality = confidentiality == null ? null : confidentiality.copy(); + dst.subject = subject == null ? null : subject.copy(); + if (author != null) { + dst.author = new ArrayList(); + for (Reference i : author) + dst.author.add(i.copy()); + }; + if (attester != null) { + dst.attester = new ArrayList(); + for (CompositionAttesterComponent i : attester) + dst.attester.add(i.copy()); + }; + dst.custodian = custodian == null ? null : custodian.copy(); + if (event != null) { + dst.event = new ArrayList(); + for (CompositionEventComponent i : event) + dst.event.add(i.copy()); + }; + dst.encounter = encounter == null ? null : encounter.copy(); + if (section != null) { + dst.section = new ArrayList(); + for (SectionComponent i : section) + dst.section.add(i.copy()); + }; + return dst; + } + + protected Composition typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Composition)) + return false; + Composition o = (Composition) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(date, o.date, true) && compareDeep(type, o.type, true) + && compareDeep(class_, o.class_, true) && compareDeep(title, o.title, true) && compareDeep(status, o.status, true) + && compareDeep(confidentiality, o.confidentiality, true) && compareDeep(subject, o.subject, true) + && compareDeep(author, o.author, true) && compareDeep(attester, o.attester, true) && compareDeep(custodian, o.custodian, true) + && compareDeep(event, o.event, true) && compareDeep(encounter, o.encounter, true) && compareDeep(section, o.section, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Composition)) + return false; + Composition o = (Composition) other; + return compareValues(date, o.date, true) && compareValues(title, o.title, true) && compareValues(status, o.status, true) + && compareValues(confidentiality, o.confidentiality, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (date == null || date.isEmpty()) + && (type == null || type.isEmpty()) && (class_ == null || class_.isEmpty()) && (title == null || title.isEmpty()) + && (status == null || status.isEmpty()) && (confidentiality == null || confidentiality.isEmpty()) + && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) && (attester == null || attester.isEmpty()) + && (custodian == null || custodian.isEmpty()) && (event == null || event.isEmpty()) && (encounter == null || encounter.isEmpty()) + && (section == null || section.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Composition; + } + + @SearchParamDefinition(name="date", path="Composition.date", description="Composition editing time", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="Composition.identifier", description="Logical identifier of composition (version-independent)", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="period", path="Composition.event.period", description="The period covered by the documentation", type="date" ) + public static final String SP_PERIOD = "period"; + @SearchParamDefinition(name="subject", path="Composition.subject", description="Who and/or what the composition is about", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="author", path="Composition.author", description="Who and/or what authored the composition", type="reference" ) + public static final String SP_AUTHOR = "author"; + @SearchParamDefinition(name="confidentiality", path="Composition.confidentiality", description="As defined by affinity domain", type="token" ) + public static final String SP_CONFIDENTIALITY = "confidentiality"; + @SearchParamDefinition(name="section-code", path="Composition.section.code", description="Classification of section (recommended)", type="token" ) + public static final String SP_SECTIONCODE = "section-code"; + @SearchParamDefinition(name="section", path="Composition.section.content", description="The Content of the section (narrative + data entries)", type="reference" ) + public static final String SP_SECTION = "section"; + @SearchParamDefinition(name="encounter", path="Composition.encounter", description="Context of the conposition", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + @SearchParamDefinition(name="type", path="Composition.type", description="Kind of composition (LOINC if possible)", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="title", path="Composition.title", description="Human Readable name/title", type="string" ) + public static final String SP_TITLE = "title"; + @SearchParamDefinition(name="attester", path="Composition.attester.party", description="Who attested the composition", type="reference" ) + public static final String SP_ATTESTER = "attester"; + @SearchParamDefinition(name="patient", path="Composition.subject", description="Who and/or what the composition is about", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="context", path="Composition.event.code", description="Code(s) that apply to the event being documented", type="token" ) + public static final String SP_CONTEXT = "context"; + @SearchParamDefinition(name="class", path="Composition.class", description="Categorization of Composition", type="token" ) + public static final String SP_CLASS = "class"; + @SearchParamDefinition(name="status", path="Composition.status", description="preliminary | final | appended | amended | entered-in-error", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ConceptMap.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ConceptMap.java index 657bd0a791c..e919623b832 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ConceptMap.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ConceptMap.java @@ -1,2195 +1,2174 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import java.util.*; - -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.instance.model.Enumerations.*; -import org.hl7.fhir.instance.model.annotations.ResourceDef; -import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; -import org.hl7.fhir.instance.model.annotations.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models. - */ -@ResourceDef(name="ConceptMap", profile="http://hl7.org/fhir/Profile/ConceptMap") -public class ConceptMap extends DomainResource { - - public enum ConceptEquivalence { - /** - * The definitions of the concepts mean the same thing (including when structural implications of meaning are considered) (i.e. extensionally identical). - */ - EQUIVALENT, - /** - * The definitions of the concepts are exactly the same (i.e. only grammatical differences) and structural implications of meaning are identifical or irrelevant (i.e. intensionally identical). - */ - EQUAL, - /** - * The target mapping is wider in meaning than the source concept. - */ - WIDER, - /** - * The target mapping subsumes the meaning of the source concept (e.g. the source is-a target). - */ - SUBSUMES, - /** - * The target mapping is narrower in meaning that the source concept. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally. - */ - NARROWER, - /** - * The target mapping specialises the meaning of the source concept (e.g. the target is-a source). - */ - SPECIALISES, - /** - * The target mapping overlaps with the source concept, but both source and target cover additional meaning, or the definitions are imprecise and it is uncertain whether they have the same boundaries to their meaning. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally. - */ - INEXACT, - /** - * There is no match for this concept in the destination concept system. - */ - UNMATCHED, - /** - * This is an explicit assertion that there is no mapping between the source and target concept. - */ - DISJOINT, - /** - * added to help the parsers - */ - NULL; - public static ConceptEquivalence fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("equivalent".equals(codeString)) - return EQUIVALENT; - if ("equal".equals(codeString)) - return EQUAL; - if ("wider".equals(codeString)) - return WIDER; - if ("subsumes".equals(codeString)) - return SUBSUMES; - if ("narrower".equals(codeString)) - return NARROWER; - if ("specialises".equals(codeString)) - return SPECIALISES; - if ("inexact".equals(codeString)) - return INEXACT; - if ("unmatched".equals(codeString)) - return UNMATCHED; - if ("disjoint".equals(codeString)) - return DISJOINT; - throw new Exception("Unknown ConceptEquivalence code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case EQUIVALENT: return "equivalent"; - case EQUAL: return "equal"; - case WIDER: return "wider"; - case SUBSUMES: return "subsumes"; - case NARROWER: return "narrower"; - case SPECIALISES: return "specialises"; - case INEXACT: return "inexact"; - case UNMATCHED: return "unmatched"; - case DISJOINT: return "disjoint"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case EQUIVALENT: return ""; - case EQUAL: return ""; - case WIDER: return ""; - case SUBSUMES: return ""; - case NARROWER: return ""; - case SPECIALISES: return ""; - case INEXACT: return ""; - case UNMATCHED: return ""; - case DISJOINT: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case EQUIVALENT: return "The definitions of the concepts mean the same thing (including when structural implications of meaning are considered) (i.e. extensionally identical)."; - case EQUAL: return "The definitions of the concepts are exactly the same (i.e. only grammatical differences) and structural implications of meaning are identifical or irrelevant (i.e. intensionally identical)."; - case WIDER: return "The target mapping is wider in meaning than the source concept."; - case SUBSUMES: return "The target mapping subsumes the meaning of the source concept (e.g. the source is-a target)."; - case NARROWER: return "The target mapping is narrower in meaning that the source concept. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally."; - case SPECIALISES: return "The target mapping specialises the meaning of the source concept (e.g. the target is-a source)."; - case INEXACT: return "The target mapping overlaps with the source concept, but both source and target cover additional meaning, or the definitions are imprecise and it is uncertain whether they have the same boundaries to their meaning. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally."; - case UNMATCHED: return "There is no match for this concept in the destination concept system."; - case DISJOINT: return "This is an explicit assertion that there is no mapping between the source and target concept."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case EQUIVALENT: return "Equivalent"; - case EQUAL: return "Equal"; - case WIDER: return "Wider"; - case SUBSUMES: return "Subsumes"; - case NARROWER: return "Narrower"; - case SPECIALISES: return "Specialises"; - case INEXACT: return "Inexact"; - case UNMATCHED: return "Unmatched"; - case DISJOINT: return "Disjoint"; - default: return "?"; - } - } - } - - public static class ConceptEquivalenceEnumFactory implements EnumFactory { - public ConceptEquivalence fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("equivalent".equals(codeString)) - return ConceptEquivalence.EQUIVALENT; - if ("equal".equals(codeString)) - return ConceptEquivalence.EQUAL; - if ("wider".equals(codeString)) - return ConceptEquivalence.WIDER; - if ("subsumes".equals(codeString)) - return ConceptEquivalence.SUBSUMES; - if ("narrower".equals(codeString)) - return ConceptEquivalence.NARROWER; - if ("specialises".equals(codeString)) - return ConceptEquivalence.SPECIALISES; - if ("inexact".equals(codeString)) - return ConceptEquivalence.INEXACT; - if ("unmatched".equals(codeString)) - return ConceptEquivalence.UNMATCHED; - if ("disjoint".equals(codeString)) - return ConceptEquivalence.DISJOINT; - throw new IllegalArgumentException("Unknown ConceptEquivalence code '"+codeString+"'"); - } - public String toCode(ConceptEquivalence code) { - if (code == ConceptEquivalence.EQUIVALENT) - return "equivalent"; - if (code == ConceptEquivalence.EQUAL) - return "equal"; - if (code == ConceptEquivalence.WIDER) - return "wider"; - if (code == ConceptEquivalence.SUBSUMES) - return "subsumes"; - if (code == ConceptEquivalence.NARROWER) - return "narrower"; - if (code == ConceptEquivalence.SPECIALISES) - return "specialises"; - if (code == ConceptEquivalence.INEXACT) - return "inexact"; - if (code == ConceptEquivalence.UNMATCHED) - return "unmatched"; - if (code == ConceptEquivalence.DISJOINT) - return "disjoint"; - return "?"; - } - } - - @Block() - public static class ConceptMapContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the concept map. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Name of a individual to contact", formalDefinition="The name of an individual to contact regarding the concept map." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /* - * Constructor - */ - public ConceptMapContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the concept map.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMapContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the concept map.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ConceptMapContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the concept map. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the concept map. - */ - public ConceptMapContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public ConceptMapContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the concept map.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - public ConceptMapContactComponent copy() { - ConceptMapContactComponent dst = new ConceptMapContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConceptMapContactComponent)) - return false; - ConceptMapContactComponent o = (ConceptMapContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConceptMapContactComponent)) - return false; - ConceptMapContactComponent o = (ConceptMapContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - } - - @Block() - public static class ConceptMapElementComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An absolute URI that identifies the Code System (if the source is a value value set that crosses more than one code system). - */ - @Child(name = "codeSystem", type = {UriType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Code System (if value set crosses code systems)", formalDefinition="An absolute URI that identifies the Code System (if the source is a value value set that crosses more than one code system)." ) - protected UriType codeSystem; - - /** - * Identity (code or path) or the element/item being mapped. - */ - @Child(name = "code", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Identifies element being mapped", formalDefinition="Identity (code or path) or the element/item being mapped." ) - protected CodeType code; - - /** - * A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value. - */ - @Child(name = "dependsOn", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Other elements required for this mapping (from context)", formalDefinition="A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value." ) - protected List dependsOn; - - /** - * A concept from the target value set that this concept maps to. - */ - @Child(name = "map", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Target of this map", formalDefinition="A concept from the target value set that this concept maps to." ) - protected List map; - - private static final long serialVersionUID = 2079040744L; - - /* - * Constructor - */ - public ConceptMapElementComponent() { - super(); - } - - /** - * @return {@link #codeSystem} (An absolute URI that identifies the Code System (if the source is a value value set that crosses more than one code system).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value - */ - public UriType getCodeSystemElement() { - if (this.codeSystem == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMapElementComponent.codeSystem"); - else if (Configuration.doAutoCreate()) - this.codeSystem = new UriType(); // bb - return this.codeSystem; - } - - public boolean hasCodeSystemElement() { - return this.codeSystem != null && !this.codeSystem.isEmpty(); - } - - public boolean hasCodeSystem() { - return this.codeSystem != null && !this.codeSystem.isEmpty(); - } - - /** - * @param value {@link #codeSystem} (An absolute URI that identifies the Code System (if the source is a value value set that crosses more than one code system).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value - */ - public ConceptMapElementComponent setCodeSystemElement(UriType value) { - this.codeSystem = value; - return this; - } - - /** - * @return An absolute URI that identifies the Code System (if the source is a value value set that crosses more than one code system). - */ - public String getCodeSystem() { - return this.codeSystem == null ? null : this.codeSystem.getValue(); - } - - /** - * @param value An absolute URI that identifies the Code System (if the source is a value value set that crosses more than one code system). - */ - public ConceptMapElementComponent setCodeSystem(String value) { - if (Utilities.noString(value)) - this.codeSystem = null; - else { - if (this.codeSystem == null) - this.codeSystem = new UriType(); - this.codeSystem.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (Identity (code or path) or the element/item being mapped.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMapElementComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Identity (code or path) or the element/item being mapped.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public ConceptMapElementComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return Identity (code or path) or the element/item being mapped. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Identity (code or path) or the element/item being mapped. - */ - public ConceptMapElementComponent 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 #dependsOn} (A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.) - */ - public List getDependsOn() { - if (this.dependsOn == null) - this.dependsOn = new ArrayList(); - return this.dependsOn; - } - - public boolean hasDependsOn() { - if (this.dependsOn == null) - return false; - for (OtherElementComponent item : this.dependsOn) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dependsOn} (A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.) - */ - // syntactic sugar - public OtherElementComponent addDependsOn() { //3 - OtherElementComponent t = new OtherElementComponent(); - if (this.dependsOn == null) - this.dependsOn = new ArrayList(); - this.dependsOn.add(t); - return t; - } - - // syntactic sugar - public ConceptMapElementComponent addDependsOn(OtherElementComponent t) { //3 - if (t == null) - return this; - if (this.dependsOn == null) - this.dependsOn = new ArrayList(); - this.dependsOn.add(t); - return this; - } - - /** - * @return {@link #map} (A concept from the target value set that this concept maps to.) - */ - public List getMap() { - if (this.map == null) - this.map = new ArrayList(); - return this.map; - } - - public boolean hasMap() { - if (this.map == null) - return false; - for (ConceptMapElementMapComponent item : this.map) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #map} (A concept from the target value set that this concept maps to.) - */ - // syntactic sugar - public ConceptMapElementMapComponent addMap() { //3 - ConceptMapElementMapComponent t = new ConceptMapElementMapComponent(); - if (this.map == null) - this.map = new ArrayList(); - this.map.add(t); - return t; - } - - // syntactic sugar - public ConceptMapElementComponent addMap(ConceptMapElementMapComponent t) { //3 - if (t == null) - return this; - if (this.map == null) - this.map = new ArrayList(); - this.map.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("codeSystem", "uri", "An absolute URI that identifies the Code System (if the source is a value value set that crosses more than one code system).", 0, java.lang.Integer.MAX_VALUE, codeSystem)); - childrenList.add(new Property("code", "code", "Identity (code or path) or the element/item being mapped.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("dependsOn", "", "A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.", 0, java.lang.Integer.MAX_VALUE, dependsOn)); - childrenList.add(new Property("map", "", "A concept from the target value set that this concept maps to.", 0, java.lang.Integer.MAX_VALUE, map)); - } - - public ConceptMapElementComponent copy() { - ConceptMapElementComponent dst = new ConceptMapElementComponent(); - copyValues(dst); - dst.codeSystem = codeSystem == null ? null : codeSystem.copy(); - dst.code = code == null ? null : code.copy(); - if (dependsOn != null) { - dst.dependsOn = new ArrayList(); - for (OtherElementComponent i : dependsOn) - dst.dependsOn.add(i.copy()); - }; - if (map != null) { - dst.map = new ArrayList(); - for (ConceptMapElementMapComponent i : map) - dst.map.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConceptMapElementComponent)) - return false; - ConceptMapElementComponent o = (ConceptMapElementComponent) other; - return compareDeep(codeSystem, o.codeSystem, true) && compareDeep(code, o.code, true) && compareDeep(dependsOn, o.dependsOn, true) - && compareDeep(map, o.map, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConceptMapElementComponent)) - return false; - ConceptMapElementComponent o = (ConceptMapElementComponent) other; - return compareValues(codeSystem, o.codeSystem, true) && compareValues(code, o.code, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (codeSystem == null || codeSystem.isEmpty()) && (code == null || code.isEmpty()) - && (dependsOn == null || dependsOn.isEmpty()) && (map == null || map.isEmpty()); - } - - } - - @Block() - public static class OtherElementComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition. - */ - @Child(name = "element", type = {UriType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Reference to element/field/valueset mapping depends on", formalDefinition="A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition." ) - protected UriType element; - - /** - * An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that cross code systems). - */ - @Child(name = "codeSystem", type = {UriType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Code System (if necessary)", formalDefinition="An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that cross code systems)." ) - protected UriType codeSystem; - - /** - * Identity (code or path) or the element/item that the map depends on / refers to. - */ - @Child(name = "code", type = {StringType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Value of the referenced element", formalDefinition="Identity (code or path) or the element/item that the map depends on / refers to." ) - protected StringType code; - - private static final long serialVersionUID = 1488522448L; - - /* - * Constructor - */ - public OtherElementComponent() { - super(); - } - - /* - * Constructor - */ - public OtherElementComponent(UriType element, UriType codeSystem, StringType code) { - super(); - this.element = element; - this.codeSystem = codeSystem; - this.code = code; - } - - /** - * @return {@link #element} (A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value - */ - public UriType getElementElement() { - if (this.element == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OtherElementComponent.element"); - else if (Configuration.doAutoCreate()) - this.element = new UriType(); // bb - return this.element; - } - - public boolean hasElementElement() { - return this.element != null && !this.element.isEmpty(); - } - - public boolean hasElement() { - return this.element != null && !this.element.isEmpty(); - } - - /** - * @param value {@link #element} (A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value - */ - public OtherElementComponent setElementElement(UriType value) { - this.element = value; - return this; - } - - /** - * @return A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition. - */ - public String getElement() { - return this.element == null ? null : this.element.getValue(); - } - - /** - * @param value A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition. - */ - public OtherElementComponent setElement(String value) { - if (this.element == null) - this.element = new UriType(); - this.element.setValue(value); - return this; - } - - /** - * @return {@link #codeSystem} (An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that cross code systems).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value - */ - public UriType getCodeSystemElement() { - if (this.codeSystem == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OtherElementComponent.codeSystem"); - else if (Configuration.doAutoCreate()) - this.codeSystem = new UriType(); // bb - return this.codeSystem; - } - - public boolean hasCodeSystemElement() { - return this.codeSystem != null && !this.codeSystem.isEmpty(); - } - - public boolean hasCodeSystem() { - return this.codeSystem != null && !this.codeSystem.isEmpty(); - } - - /** - * @param value {@link #codeSystem} (An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that cross code systems).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value - */ - public OtherElementComponent setCodeSystemElement(UriType value) { - this.codeSystem = value; - return this; - } - - /** - * @return An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that cross code systems). - */ - public String getCodeSystem() { - return this.codeSystem == null ? null : this.codeSystem.getValue(); - } - - /** - * @param value An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that cross code systems). - */ - public OtherElementComponent setCodeSystem(String value) { - if (this.codeSystem == null) - this.codeSystem = new UriType(); - this.codeSystem.setValue(value); - return this; - } - - /** - * @return {@link #code} (Identity (code or path) or the element/item that the map depends on / refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public StringType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OtherElementComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new StringType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Identity (code or path) or the element/item that the map depends on / refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public OtherElementComponent setCodeElement(StringType value) { - this.code = value; - return this; - } - - /** - * @return Identity (code or path) or the element/item that the map depends on / refers to. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Identity (code or path) or the element/item that the map depends on / refers to. - */ - public OtherElementComponent setCode(String value) { - if (this.code == null) - this.code = new StringType(); - this.code.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("element", "uri", "A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition.", 0, java.lang.Integer.MAX_VALUE, element)); - childrenList.add(new Property("codeSystem", "uri", "An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that cross code systems).", 0, java.lang.Integer.MAX_VALUE, codeSystem)); - childrenList.add(new Property("code", "string", "Identity (code or path) or the element/item that the map depends on / refers to.", 0, java.lang.Integer.MAX_VALUE, code)); - } - - public OtherElementComponent copy() { - OtherElementComponent dst = new OtherElementComponent(); - copyValues(dst); - dst.element = element == null ? null : element.copy(); - dst.codeSystem = codeSystem == null ? null : codeSystem.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OtherElementComponent)) - return false; - OtherElementComponent o = (OtherElementComponent) other; - return compareDeep(element, o.element, true) && compareDeep(codeSystem, o.codeSystem, true) && compareDeep(code, o.code, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OtherElementComponent)) - return false; - OtherElementComponent o = (OtherElementComponent) other; - return compareValues(element, o.element, true) && compareValues(codeSystem, o.codeSystem, true) && compareValues(code, o.code, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (element == null || element.isEmpty()) && (codeSystem == null || codeSystem.isEmpty()) - && (code == null || code.isEmpty()); - } - - } - - @Block() - public static class ConceptMapElementMapComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems). - */ - @Child(name = "codeSystem", type = {UriType.class}, order=1, min=0, max=1) - @Description(shortDefinition="System of the target (if necessary)", formalDefinition="An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems)." ) - protected UriType codeSystem; - - /** - * Identity (code or path) or the element/item that the map refers to. - */ - @Child(name = "code", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Code that identifies the target element", formalDefinition="Identity (code or path) or the element/item that the map refers to." ) - protected CodeType code; - - /** - * The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target. - */ - @Child(name = "equivalence", type = {CodeType.class}, order=3, min=1, max=1) - @Description(shortDefinition="equivalent | equal | wider | subsumes | narrower | specialises | inexact | unmatched | disjoint", formalDefinition="The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target." ) - protected Enumeration equivalence; - - /** - * A description of status/issues in mapping that conveys additional information not represented in the structured data. - */ - @Child(name = "comments", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Description of status/issues in mapping", formalDefinition="A description of status/issues in mapping that conveys additional information not represented in the structured data." ) - protected StringType comments; - - /** - * A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on. - */ - @Child(name = "product", type = {OtherElementComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Other concepts that this mapping also produces", formalDefinition="A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on." ) - protected List product; - - private static final long serialVersionUID = 606421694L; - - /* - * Constructor - */ - public ConceptMapElementMapComponent() { - super(); - } - - /* - * Constructor - */ - public ConceptMapElementMapComponent(Enumeration equivalence) { - super(); - this.equivalence = equivalence; - } - - /** - * @return {@link #codeSystem} (An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value - */ - public UriType getCodeSystemElement() { - if (this.codeSystem == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMapElementMapComponent.codeSystem"); - else if (Configuration.doAutoCreate()) - this.codeSystem = new UriType(); // bb - return this.codeSystem; - } - - public boolean hasCodeSystemElement() { - return this.codeSystem != null && !this.codeSystem.isEmpty(); - } - - public boolean hasCodeSystem() { - return this.codeSystem != null && !this.codeSystem.isEmpty(); - } - - /** - * @param value {@link #codeSystem} (An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value - */ - public ConceptMapElementMapComponent setCodeSystemElement(UriType value) { - this.codeSystem = value; - return this; - } - - /** - * @return An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems). - */ - public String getCodeSystem() { - return this.codeSystem == null ? null : this.codeSystem.getValue(); - } - - /** - * @param value An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems). - */ - public ConceptMapElementMapComponent setCodeSystem(String value) { - if (Utilities.noString(value)) - this.codeSystem = null; - else { - if (this.codeSystem == null) - this.codeSystem = new UriType(); - this.codeSystem.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (Identity (code or path) or the element/item that the map refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMapElementMapComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Identity (code or path) or the element/item that the map refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public ConceptMapElementMapComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return Identity (code or path) or the element/item that the map refers to. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Identity (code or path) or the element/item that the map refers to. - */ - public ConceptMapElementMapComponent setCode(String value) { - if (Utilities.noString(value)) - this.code = null; - else { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - } - return this; - } - - /** - * @return {@link #equivalence} (The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target.). This is the underlying object with id, value and extensions. The accessor "getEquivalence" gives direct access to the value - */ - public Enumeration getEquivalenceElement() { - if (this.equivalence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMapElementMapComponent.equivalence"); - else if (Configuration.doAutoCreate()) - this.equivalence = new Enumeration(new ConceptEquivalenceEnumFactory()); // bb - return this.equivalence; - } - - public boolean hasEquivalenceElement() { - return this.equivalence != null && !this.equivalence.isEmpty(); - } - - public boolean hasEquivalence() { - return this.equivalence != null && !this.equivalence.isEmpty(); - } - - /** - * @param value {@link #equivalence} (The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target.). This is the underlying object with id, value and extensions. The accessor "getEquivalence" gives direct access to the value - */ - public ConceptMapElementMapComponent setEquivalenceElement(Enumeration value) { - this.equivalence = value; - return this; - } - - /** - * @return The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target. - */ - public ConceptEquivalence getEquivalence() { - return this.equivalence == null ? null : this.equivalence.getValue(); - } - - /** - * @param value The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target. - */ - public ConceptMapElementMapComponent setEquivalence(ConceptEquivalence value) { - if (this.equivalence == null) - this.equivalence = new Enumeration(new ConceptEquivalenceEnumFactory()); - this.equivalence.setValue(value); - return this; - } - - /** - * @return {@link #comments} (A description of status/issues in mapping that conveys additional information not represented in the structured data.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public StringType getCommentsElement() { - if (this.comments == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMapElementMapComponent.comments"); - else if (Configuration.doAutoCreate()) - this.comments = new StringType(); // bb - return this.comments; - } - - public boolean hasCommentsElement() { - return this.comments != null && !this.comments.isEmpty(); - } - - public boolean hasComments() { - return this.comments != null && !this.comments.isEmpty(); - } - - /** - * @param value {@link #comments} (A description of status/issues in mapping that conveys additional information not represented in the structured data.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public ConceptMapElementMapComponent setCommentsElement(StringType value) { - this.comments = value; - return this; - } - - /** - * @return A description of status/issues in mapping that conveys additional information not represented in the structured data. - */ - public String getComments() { - return this.comments == null ? null : this.comments.getValue(); - } - - /** - * @param value A description of status/issues in mapping that conveys additional information not represented in the structured data. - */ - public ConceptMapElementMapComponent setComments(String value) { - if (Utilities.noString(value)) - this.comments = null; - else { - if (this.comments == null) - this.comments = new StringType(); - this.comments.setValue(value); - } - return this; - } - - /** - * @return {@link #product} (A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.) - */ - public List getProduct() { - if (this.product == null) - this.product = new ArrayList(); - return this.product; - } - - public boolean hasProduct() { - if (this.product == null) - return false; - for (OtherElementComponent item : this.product) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #product} (A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.) - */ - // syntactic sugar - public OtherElementComponent addProduct() { //3 - OtherElementComponent t = new OtherElementComponent(); - if (this.product == null) - this.product = new ArrayList(); - this.product.add(t); - return t; - } - - // syntactic sugar - public ConceptMapElementMapComponent addProduct(OtherElementComponent t) { //3 - if (t == null) - return this; - if (this.product == null) - this.product = new ArrayList(); - this.product.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("codeSystem", "uri", "An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems).", 0, java.lang.Integer.MAX_VALUE, codeSystem)); - childrenList.add(new Property("code", "code", "Identity (code or path) or the element/item that the map refers to.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("equivalence", "code", "The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target.", 0, java.lang.Integer.MAX_VALUE, equivalence)); - childrenList.add(new Property("comments", "string", "A description of status/issues in mapping that conveys additional information not represented in the structured data.", 0, java.lang.Integer.MAX_VALUE, comments)); - childrenList.add(new Property("product", "@ConceptMap.element.dependsOn", "A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.", 0, java.lang.Integer.MAX_VALUE, product)); - } - - public ConceptMapElementMapComponent copy() { - ConceptMapElementMapComponent dst = new ConceptMapElementMapComponent(); - copyValues(dst); - dst.codeSystem = codeSystem == null ? null : codeSystem.copy(); - dst.code = code == null ? null : code.copy(); - dst.equivalence = equivalence == null ? null : equivalence.copy(); - dst.comments = comments == null ? null : comments.copy(); - if (product != null) { - dst.product = new ArrayList(); - for (OtherElementComponent i : product) - dst.product.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConceptMapElementMapComponent)) - return false; - ConceptMapElementMapComponent o = (ConceptMapElementMapComponent) other; - return compareDeep(codeSystem, o.codeSystem, true) && compareDeep(code, o.code, true) && compareDeep(equivalence, o.equivalence, true) - && compareDeep(comments, o.comments, true) && compareDeep(product, o.product, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConceptMapElementMapComponent)) - return false; - ConceptMapElementMapComponent o = (ConceptMapElementMapComponent) other; - return compareValues(codeSystem, o.codeSystem, true) && compareValues(code, o.code, true) && compareValues(equivalence, o.equivalence, true) - && compareValues(comments, o.comments, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (codeSystem == null || codeSystem.isEmpty()) && (code == null || code.isEmpty()) - && (equivalence == null || equivalence.isEmpty()) && (comments == null || comments.isEmpty()) - && (product == null || product.isEmpty()); - } - - } - - /** - * An absolute uri that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). - */ - @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Globally unique logical id for concept map", formalDefinition="An absolute uri that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:)." ) - protected UriType url; - - /** - * Formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) - @Description(shortDefinition="Additional identifier for the concept map", formalDefinition="Formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance." ) - protected Identifier identifier; - - /** - * The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Logical id for this version of the concept map", formalDefinition="The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) - protected StringType version; - - /** - * A free text natural language name describing the concept map. - */ - @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Informal name for this concept map", formalDefinition="A free text natural language name describing the concept map." ) - protected StringType name; - - /** - * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of concept maps. - */ - @Child(name = "useContext", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of concept maps." ) - protected List useContext; - - /** - * The name of the individual or organization that published the concept map. - */ - @Child(name = "publisher", type = {StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the concept map." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc. - */ - @Child(name = "description", type = {StringType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Human language description of the concept map", formalDefinition="A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc." ) - protected StringType description; - - /** - * Explains why this concept map is needed and why it's been constrained as it has. - */ - @Child(name = "requirements", type = {StringType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Why is this needed?", formalDefinition="Explains why this concept map is needed and why it's been constrained as it has." ) - protected StringType requirements; - - /** - * A copyright statement relating to the concept map and/or its contents. - */ - @Child(name = "copyright", type = {StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Use and/or Publishing restrictions", formalDefinition="A copyright statement relating to the concept map and/or its contents." ) - protected StringType copyright; - - /** - * The status of the concept map. - */ - @Child(name = "status", type = {CodeType.class}, order=10, min=1, max=1) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the concept map." ) - protected Enumeration status; - - /** - * This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name = "experimental", type = {BooleanType.class}, order=11, min=0, max=1) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The date that the concept map status was last changed. - */ - @Child(name = "date", type = {DateTimeType.class}, order=12, min=0, max=1) - @Description(shortDefinition="Date for given status", formalDefinition="The date that the concept map status was last changed." ) - protected DateTimeType date; - - /** - * The source value set that specifies the concepts that are being mapped. - */ - @Child(name = "source", type = {UriType.class, ValueSet.class, StructureDefinition.class}, order=13, min=1, max=1) - @Description(shortDefinition="Identifies the source of the concepts which are being mapped", formalDefinition="The source value set that specifies the concepts that are being mapped." ) - protected Type source; - - /** - * The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made. - */ - @Child(name = "target", type = {UriType.class, ValueSet.class, StructureDefinition.class}, order=14, min=1, max=1) - @Description(shortDefinition="Provides context to the mappings", formalDefinition="The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made." ) - protected Type target; - - /** - * Mappings for an individual concept in the source to one or more concepts in the target. - */ - @Child(name = "element", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Mappings for a concept from the source set", formalDefinition="Mappings for an individual concept in the source to one or more concepts in the target." ) - protected List element; - - private static final long serialVersionUID = 729155675L; - - /* - * Constructor - */ - public ConceptMap() { - super(); - } - - /* - * Constructor - */ - public ConceptMap(Enumeration status, Type source, Type target) { - super(); - this.status = status; - this.source = source; - this.target = target; - } - - /** - * @return {@link #url} (An absolute uri that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute uri that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public ConceptMap setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute uri that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute uri that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). - */ - public ConceptMap setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #identifier} (Formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance.) - */ - public ConceptMap setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #version} (The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ConceptMap setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public ConceptMap setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A free text natural language name describing the concept map.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A free text natural language name describing the concept map.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ConceptMap setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name describing the concept map. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name describing the concept map. - */ - public ConceptMap setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of concept maps.) - */ - public List getUseContext() { - if (this.useContext == null) - this.useContext = new ArrayList(); - return this.useContext; - } - - public boolean hasUseContext() { - if (this.useContext == null) - return false; - for (CodeableConcept item : this.useContext) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of concept maps.) - */ - // syntactic sugar - public CodeableConcept addUseContext() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return t; - } - - // syntactic sugar - public ConceptMap addUseContext(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the concept map.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the concept map.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public ConceptMap setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the concept map. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the concept map. - */ - public ConceptMap setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (ConceptMapContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public ConceptMapContactComponent addContact() { //3 - ConceptMapContactComponent t = new ConceptMapContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public ConceptMap addContact(ConceptMapContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #description} (A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ConceptMap setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc. - */ - public ConceptMap setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #requirements} (Explains why this concept map is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); // bb - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (Explains why this concept map is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public ConceptMap setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return Explains why this concept map is needed and why it's been constrained as it has. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value Explains why this concept map is needed and why it's been constrained as it has. - */ - public ConceptMap setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #copyright} (A copyright statement relating to the concept map and/or its contents.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public StringType getCopyrightElement() { - if (this.copyright == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.copyright"); - else if (Configuration.doAutoCreate()) - this.copyright = new StringType(); // bb - return this.copyright; - } - - public boolean hasCopyrightElement() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - public boolean hasCopyright() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - /** - * @param value {@link #copyright} (A copyright statement relating to the concept map and/or its contents.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public ConceptMap setCopyrightElement(StringType value) { - this.copyright = value; - return this; - } - - /** - * @return A copyright statement relating to the concept map and/or its contents. - */ - public String getCopyright() { - return this.copyright == null ? null : this.copyright.getValue(); - } - - /** - * @param value A copyright statement relating to the concept map and/or its contents. - */ - public ConceptMap setCopyright(String value) { - if (Utilities.noString(value)) - this.copyright = null; - else { - if (this.copyright == null) - this.copyright = new StringType(); - this.copyright.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of the concept map.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the concept map.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public ConceptMap setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the concept map. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the concept map. - */ - public ConceptMap setStatus(ConformanceResourceStatus value) { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #experimental} (This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); // bb - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public ConceptMap setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); - } - - /** - * @param value This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public ConceptMap setExperimental(boolean value) { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - return this; - } - - /** - * @return {@link #date} (The date that the concept map status was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date that the concept map status was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ConceptMap setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date that the concept map status was last changed. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date that the concept map status was last changed. - */ - public ConceptMap setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #source} (The source value set that specifies the concepts that are being mapped.) - */ - public Type getSource() { - return this.source; - } - - /** - * @return {@link #source} (The source value set that specifies the concepts that are being mapped.) - */ - public UriType getSourceUriType() throws Exception { - if (!(this.source instanceof UriType)) - throw new Exception("Type mismatch: the type UriType was expected, but "+this.source.getClass().getName()+" was encountered"); - return (UriType) this.source; - } - - /** - * @return {@link #source} (The source value set that specifies the concepts that are being mapped.) - */ - public Reference getSourceReference() throws Exception { - if (!(this.source instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.source.getClass().getName()+" was encountered"); - return (Reference) this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (The source value set that specifies the concepts that are being mapped.) - */ - public ConceptMap setSource(Type value) { - this.source = value; - return this; - } - - /** - * @return {@link #target} (The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.) - */ - public Type getTarget() { - return this.target; - } - - /** - * @return {@link #target} (The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.) - */ - public UriType getTargetUriType() throws Exception { - if (!(this.target instanceof UriType)) - throw new Exception("Type mismatch: the type UriType was expected, but "+this.target.getClass().getName()+" was encountered"); - return (UriType) this.target; - } - - /** - * @return {@link #target} (The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.) - */ - public Reference getTargetReference() throws Exception { - if (!(this.target instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.target.getClass().getName()+" was encountered"); - return (Reference) this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.) - */ - public ConceptMap setTarget(Type value) { - this.target = value; - return this; - } - - /** - * @return {@link #element} (Mappings for an individual concept in the source to one or more concepts in the target.) - */ - public List getElement() { - if (this.element == null) - this.element = new ArrayList(); - return this.element; - } - - public boolean hasElement() { - if (this.element == null) - return false; - for (ConceptMapElementComponent item : this.element) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #element} (Mappings for an individual concept in the source to one or more concepts in the target.) - */ - // syntactic sugar - public ConceptMapElementComponent addElement() { //3 - ConceptMapElementComponent t = new ConceptMapElementComponent(); - if (this.element == null) - this.element = new ArrayList(); - this.element.add(t); - return t; - } - - // syntactic sugar - public ConceptMap addElement(ConceptMapElementComponent t) { //3 - if (t == null) - return this; - if (this.element == null) - this.element = new ArrayList(); - this.element.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute uri that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("name", "string", "A free text natural language name describing the concept map.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of concept maps.", 0, java.lang.Integer.MAX_VALUE, useContext)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the concept map.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("description", "string", "A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("requirements", "string", "Explains why this concept map is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("copyright", "string", "A copyright statement relating to the concept map and/or its contents.", 0, java.lang.Integer.MAX_VALUE, copyright)); - childrenList.add(new Property("status", "code", "The status of the concept map.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("date", "dateTime", "The date that the concept map status was last changed.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("source[x]", "uri|Reference(ValueSet|StructureDefinition)", "The source value set that specifies the concepts that are being mapped.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("target[x]", "uri|Reference(ValueSet|StructureDefinition)", "The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("element", "", "Mappings for an individual concept in the source to one or more concepts in the target.", 0, java.lang.Integer.MAX_VALUE, element)); - } - - public ConceptMap copy() { - ConceptMap dst = new ConceptMap(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.version = version == null ? null : version.copy(); - dst.name = name == null ? null : name.copy(); - if (useContext != null) { - dst.useContext = new ArrayList(); - for (CodeableConcept i : useContext) - dst.useContext.add(i.copy()); - }; - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (ConceptMapContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - dst.requirements = requirements == null ? null : requirements.copy(); - dst.copyright = copyright == null ? null : copyright.copy(); - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.date = date == null ? null : date.copy(); - dst.source = source == null ? null : source.copy(); - dst.target = target == null ? null : target.copy(); - if (element != null) { - dst.element = new ArrayList(); - for (ConceptMapElementComponent i : element) - dst.element.add(i.copy()); - }; - return dst; - } - - protected ConceptMap typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConceptMap)) - return false; - ConceptMap o = (ConceptMap) other; - return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) - && compareDeep(name, o.name, true) && compareDeep(useContext, o.useContext, true) && compareDeep(publisher, o.publisher, true) - && compareDeep(contact, o.contact, true) && compareDeep(description, o.description, true) && compareDeep(requirements, o.requirements, true) - && compareDeep(copyright, o.copyright, true) && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) - && compareDeep(date, o.date, true) && compareDeep(source, o.source, true) && compareDeep(target, o.target, true) - && compareDeep(element, o.element, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConceptMap)) - return false; - ConceptMap o = (ConceptMap) other; - return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) - && compareValues(publisher, o.publisher, true) && compareValues(description, o.description, true) && compareValues(requirements, o.requirements, true) - && compareValues(copyright, o.copyright, true) && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) - && compareValues(date, o.date, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (useContext == null || useContext.isEmpty()) - && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) && (description == null || description.isEmpty()) - && (requirements == null || requirements.isEmpty()) && (copyright == null || copyright.isEmpty()) - && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) - && (date == null || date.isEmpty()) && (source == null || source.isEmpty()) && (target == null || target.isEmpty()) - && (element == null || element.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ConceptMap; - } - - @SearchParamDefinition(name="dependson", path="ConceptMap.element.dependsOn.element", description="Reference to element/field/valueset mapping depends on", type="uri" ) - public static final String SP_DEPENDSON = "dependson"; - @SearchParamDefinition(name="status", path="ConceptMap.status", description="Status of the concept map", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="date", path="ConceptMap.date", description="The concept map publication date", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="url", path="ConceptMap.url", description="The url of the concept map", type="uri" ) - public static final String SP_URL = "url"; - @SearchParamDefinition(name="version", path="ConceptMap.version", description="The version identifier of the concept map", type="token" ) - public static final String SP_VERSION = "version"; - @SearchParamDefinition(name="publisher", path="ConceptMap.publisher", description="Name of the publisher of the concept map", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - @SearchParamDefinition(name="product", path="ConceptMap.element.map.product.element", description="Reference to element/field/valueset mapping depends on", type="uri" ) - public static final String SP_PRODUCT = "product"; - @SearchParamDefinition(name="system", path="ConceptMap.element.map.codeSystem", description="The system for any destination concepts mapped by this map", type="uri" ) - public static final String SP_SYSTEM = "system"; - @SearchParamDefinition(name="source", path="ConceptMap.source[x]", description="The system for any concepts mapped by this concept map", type="reference" ) - public static final String SP_SOURCE = "source"; - @SearchParamDefinition(name="description", path="ConceptMap.description", description="Text search in the description of the concept map", type="string" ) - public static final String SP_DESCRIPTION = "description"; - @SearchParamDefinition(name="name", path="ConceptMap.name", description="Name of the concept map", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="context", path="ConceptMap.useContext", description="A use context assigned to the concept map", type="token" ) - public static final String SP_CONTEXT = "context"; - @SearchParamDefinition(name="target", path="ConceptMap.target[x]", description="Provides context to the mappings", type="reference" ) - public static final String SP_TARGET = "target"; - @SearchParamDefinition(name="identifier", path="ConceptMap.identifier", description="Additional identifier for the concept map", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import java.util.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.Enumerations.*; +import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models. + */ +@ResourceDef(name="ConceptMap", profile="http://hl7.org/fhir/Profile/ConceptMap") +public class ConceptMap extends DomainResource { + + public enum ConceptEquivalence { + /** + * The definitions of the concepts mean the same thing (including when structural implications of meaning are considered) (i.e. extensionally identical). + */ + EQUIVALENT, + /** + * The definitions of the concepts are exactly the same (i.e. only grammatical differences) and structural implications of meaning are identifical or irrelevant (i.e. intensionally identical). + */ + EQUAL, + /** + * The target mapping is wider in meaning than the source concept. + */ + WIDER, + /** + * The target mapping subsumes the meaning of the source concept (e.g. the source is-a target). + */ + SUBSUMES, + /** + * The target mapping is narrower in meaning that the source concept. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally. + */ + NARROWER, + /** + * The target mapping specialises the meaning of the source concept (e.g. the target is-a source). + */ + SPECIALISES, + /** + * The target mapping overlaps with the source concept, but both source and target cover additional meaning, or the definitions are imprecise and it is uncertain whether they have the same boundaries to their meaning. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally. + */ + INEXACT, + /** + * There is no match for this concept in the destination concept system. + */ + UNMATCHED, + /** + * This is an explicit assertion that there is no mapping between the source and target concept. + */ + DISJOINT, + /** + * added to help the parsers + */ + NULL; + public static ConceptEquivalence fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("equivalent".equals(codeString)) + return EQUIVALENT; + if ("equal".equals(codeString)) + return EQUAL; + if ("wider".equals(codeString)) + return WIDER; + if ("subsumes".equals(codeString)) + return SUBSUMES; + if ("narrower".equals(codeString)) + return NARROWER; + if ("specialises".equals(codeString)) + return SPECIALISES; + if ("inexact".equals(codeString)) + return INEXACT; + if ("unmatched".equals(codeString)) + return UNMATCHED; + if ("disjoint".equals(codeString)) + return DISJOINT; + throw new Exception("Unknown ConceptEquivalence code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case EQUIVALENT: return "equivalent"; + case EQUAL: return "equal"; + case WIDER: return "wider"; + case SUBSUMES: return "subsumes"; + case NARROWER: return "narrower"; + case SPECIALISES: return "specialises"; + case INEXACT: return "inexact"; + case UNMATCHED: return "unmatched"; + case DISJOINT: return "disjoint"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case EQUIVALENT: return ""; + case EQUAL: return ""; + case WIDER: return ""; + case SUBSUMES: return ""; + case NARROWER: return ""; + case SPECIALISES: return ""; + case INEXACT: return ""; + case UNMATCHED: return ""; + case DISJOINT: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case EQUIVALENT: return "The definitions of the concepts mean the same thing (including when structural implications of meaning are considered) (i.e. extensionally identical)."; + case EQUAL: return "The definitions of the concepts are exactly the same (i.e. only grammatical differences) and structural implications of meaning are identifical or irrelevant (i.e. intensionally identical)."; + case WIDER: return "The target mapping is wider in meaning than the source concept."; + case SUBSUMES: return "The target mapping subsumes the meaning of the source concept (e.g. the source is-a target)."; + case NARROWER: return "The target mapping is narrower in meaning that the source concept. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally."; + case SPECIALISES: return "The target mapping specialises the meaning of the source concept (e.g. the target is-a source)."; + case INEXACT: return "The target mapping overlaps with the source concept, but both source and target cover additional meaning, or the definitions are imprecise and it is uncertain whether they have the same boundaries to their meaning. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally."; + case UNMATCHED: return "There is no match for this concept in the destination concept system."; + case DISJOINT: return "This is an explicit assertion that there is no mapping between the source and target concept."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case EQUIVALENT: return "Equivalent"; + case EQUAL: return "Equal"; + case WIDER: return "Wider"; + case SUBSUMES: return "Subsumes"; + case NARROWER: return "Narrower"; + case SPECIALISES: return "Specialises"; + case INEXACT: return "Inexact"; + case UNMATCHED: return "Unmatched"; + case DISJOINT: return "Disjoint"; + default: return "?"; + } + } + } + + public static class ConceptEquivalenceEnumFactory implements EnumFactory { + public ConceptEquivalence fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("equivalent".equals(codeString)) + return ConceptEquivalence.EQUIVALENT; + if ("equal".equals(codeString)) + return ConceptEquivalence.EQUAL; + if ("wider".equals(codeString)) + return ConceptEquivalence.WIDER; + if ("subsumes".equals(codeString)) + return ConceptEquivalence.SUBSUMES; + if ("narrower".equals(codeString)) + return ConceptEquivalence.NARROWER; + if ("specialises".equals(codeString)) + return ConceptEquivalence.SPECIALISES; + if ("inexact".equals(codeString)) + return ConceptEquivalence.INEXACT; + if ("unmatched".equals(codeString)) + return ConceptEquivalence.UNMATCHED; + if ("disjoint".equals(codeString)) + return ConceptEquivalence.DISJOINT; + throw new IllegalArgumentException("Unknown ConceptEquivalence code '"+codeString+"'"); + } + public String toCode(ConceptEquivalence code) { + if (code == ConceptEquivalence.EQUIVALENT) + return "equivalent"; + if (code == ConceptEquivalence.EQUAL) + return "equal"; + if (code == ConceptEquivalence.WIDER) + return "wider"; + if (code == ConceptEquivalence.SUBSUMES) + return "subsumes"; + if (code == ConceptEquivalence.NARROWER) + return "narrower"; + if (code == ConceptEquivalence.SPECIALISES) + return "specialises"; + if (code == ConceptEquivalence.INEXACT) + return "inexact"; + if (code == ConceptEquivalence.UNMATCHED) + return "unmatched"; + if (code == ConceptEquivalence.DISJOINT) + return "disjoint"; + return "?"; + } + } + + @Block() + public static class ConceptMapContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the concept map. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Name of a individual to contact", formalDefinition="The name of an individual to contact regarding the concept map." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /* + * Constructor + */ + public ConceptMapContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the concept map.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMapContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The name of an individual to contact regarding the concept map.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ConceptMapContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the concept map. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the concept map. + */ + public ConceptMapContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public ConceptMapContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the concept map.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + public ConceptMapContactComponent copy() { + ConceptMapContactComponent dst = new ConceptMapContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConceptMapContactComponent)) + return false; + ConceptMapContactComponent o = (ConceptMapContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConceptMapContactComponent)) + return false; + ConceptMapContactComponent o = (ConceptMapContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + } + + @Block() + public static class ConceptMapElementComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An absolute URI that identifies the Code System (if the source is a value value set that crosses more than one code system). + */ + @Child(name = "codeSystem", type = {UriType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Code System (if value set crosses code systems)", formalDefinition="An absolute URI that identifies the Code System (if the source is a value value set that crosses more than one code system)." ) + protected UriType codeSystem; + + /** + * Identity (code or path) or the element/item being mapped. + */ + @Child(name = "code", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Identifies element being mapped", formalDefinition="Identity (code or path) or the element/item being mapped." ) + protected CodeType code; + + /** + * A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value. + */ + @Child(name = "dependsOn", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Other elements required for this mapping (from context)", formalDefinition="A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value." ) + protected List dependsOn; + + /** + * A concept from the target value set that this concept maps to. + */ + @Child(name = "map", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Target of this map", formalDefinition="A concept from the target value set that this concept maps to." ) + protected List map; + + private static final long serialVersionUID = 2079040744L; + + /* + * Constructor + */ + public ConceptMapElementComponent() { + super(); + } + + /** + * @return {@link #codeSystem} (An absolute URI that identifies the Code System (if the source is a value value set that crosses more than one code system).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value + */ + public UriType getCodeSystemElement() { + if (this.codeSystem == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMapElementComponent.codeSystem"); + else if (Configuration.doAutoCreate()) + this.codeSystem = new UriType(); // bb + return this.codeSystem; + } + + public boolean hasCodeSystemElement() { + return this.codeSystem != null && !this.codeSystem.isEmpty(); + } + + public boolean hasCodeSystem() { + return this.codeSystem != null && !this.codeSystem.isEmpty(); + } + + /** + * @param value {@link #codeSystem} (An absolute URI that identifies the Code System (if the source is a value value set that crosses more than one code system).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value + */ + public ConceptMapElementComponent setCodeSystemElement(UriType value) { + this.codeSystem = value; + return this; + } + + /** + * @return An absolute URI that identifies the Code System (if the source is a value value set that crosses more than one code system). + */ + public String getCodeSystem() { + return this.codeSystem == null ? null : this.codeSystem.getValue(); + } + + /** + * @param value An absolute URI that identifies the Code System (if the source is a value value set that crosses more than one code system). + */ + public ConceptMapElementComponent setCodeSystem(String value) { + if (Utilities.noString(value)) + this.codeSystem = null; + else { + if (this.codeSystem == null) + this.codeSystem = new UriType(); + this.codeSystem.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (Identity (code or path) or the element/item being mapped.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMapElementComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Identity (code or path) or the element/item being mapped.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public ConceptMapElementComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return Identity (code or path) or the element/item being mapped. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Identity (code or path) or the element/item being mapped. + */ + public ConceptMapElementComponent 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 #dependsOn} (A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.) + */ + public List getDependsOn() { + if (this.dependsOn == null) + this.dependsOn = new ArrayList(); + return this.dependsOn; + } + + public boolean hasDependsOn() { + if (this.dependsOn == null) + return false; + for (OtherElementComponent item : this.dependsOn) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dependsOn} (A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.) + */ + // syntactic sugar + public OtherElementComponent addDependsOn() { //3 + OtherElementComponent t = new OtherElementComponent(); + if (this.dependsOn == null) + this.dependsOn = new ArrayList(); + this.dependsOn.add(t); + return t; + } + + // syntactic sugar + public ConceptMapElementComponent addDependsOn(OtherElementComponent t) { //3 + if (t == null) + return this; + if (this.dependsOn == null) + this.dependsOn = new ArrayList(); + this.dependsOn.add(t); + return this; + } + + /** + * @return {@link #map} (A concept from the target value set that this concept maps to.) + */ + public List getMap() { + if (this.map == null) + this.map = new ArrayList(); + return this.map; + } + + public boolean hasMap() { + if (this.map == null) + return false; + for (ConceptMapElementMapComponent item : this.map) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #map} (A concept from the target value set that this concept maps to.) + */ + // syntactic sugar + public ConceptMapElementMapComponent addMap() { //3 + ConceptMapElementMapComponent t = new ConceptMapElementMapComponent(); + if (this.map == null) + this.map = new ArrayList(); + this.map.add(t); + return t; + } + + // syntactic sugar + public ConceptMapElementComponent addMap(ConceptMapElementMapComponent t) { //3 + if (t == null) + return this; + if (this.map == null) + this.map = new ArrayList(); + this.map.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("codeSystem", "uri", "An absolute URI that identifies the Code System (if the source is a value value set that crosses more than one code system).", 0, java.lang.Integer.MAX_VALUE, codeSystem)); + childrenList.add(new Property("code", "code", "Identity (code or path) or the element/item being mapped.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("dependsOn", "", "A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.", 0, java.lang.Integer.MAX_VALUE, dependsOn)); + childrenList.add(new Property("map", "", "A concept from the target value set that this concept maps to.", 0, java.lang.Integer.MAX_VALUE, map)); + } + + public ConceptMapElementComponent copy() { + ConceptMapElementComponent dst = new ConceptMapElementComponent(); + copyValues(dst); + dst.codeSystem = codeSystem == null ? null : codeSystem.copy(); + dst.code = code == null ? null : code.copy(); + if (dependsOn != null) { + dst.dependsOn = new ArrayList(); + for (OtherElementComponent i : dependsOn) + dst.dependsOn.add(i.copy()); + }; + if (map != null) { + dst.map = new ArrayList(); + for (ConceptMapElementMapComponent i : map) + dst.map.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConceptMapElementComponent)) + return false; + ConceptMapElementComponent o = (ConceptMapElementComponent) other; + return compareDeep(codeSystem, o.codeSystem, true) && compareDeep(code, o.code, true) && compareDeep(dependsOn, o.dependsOn, true) + && compareDeep(map, o.map, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConceptMapElementComponent)) + return false; + ConceptMapElementComponent o = (ConceptMapElementComponent) other; + return compareValues(codeSystem, o.codeSystem, true) && compareValues(code, o.code, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (codeSystem == null || codeSystem.isEmpty()) && (code == null || code.isEmpty()) + && (dependsOn == null || dependsOn.isEmpty()) && (map == null || map.isEmpty()); + } + + } + + @Block() + public static class OtherElementComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition. + */ + @Child(name = "element", type = {UriType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Reference to element/field/valueset mapping depends on", formalDefinition="A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition." ) + protected UriType element; + + /** + * An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that cross code systems). + */ + @Child(name = "codeSystem", type = {UriType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Code System (if necessary)", formalDefinition="An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that cross code systems)." ) + protected UriType codeSystem; + + /** + * Identity (code or path) or the element/item that the map depends on / refers to. + */ + @Child(name = "code", type = {StringType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Value of the referenced element", formalDefinition="Identity (code or path) or the element/item that the map depends on / refers to." ) + protected StringType code; + + private static final long serialVersionUID = 1488522448L; + + /* + * Constructor + */ + public OtherElementComponent() { + super(); + } + + /* + * Constructor + */ + public OtherElementComponent(UriType element, UriType codeSystem, StringType code) { + super(); + this.element = element; + this.codeSystem = codeSystem; + this.code = code; + } + + /** + * @return {@link #element} (A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value + */ + public UriType getElementElement() { + if (this.element == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OtherElementComponent.element"); + else if (Configuration.doAutoCreate()) + this.element = new UriType(); // bb + return this.element; + } + + public boolean hasElementElement() { + return this.element != null && !this.element.isEmpty(); + } + + public boolean hasElement() { + return this.element != null && !this.element.isEmpty(); + } + + /** + * @param value {@link #element} (A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value + */ + public OtherElementComponent setElementElement(UriType value) { + this.element = value; + return this; + } + + /** + * @return A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition. + */ + public String getElement() { + return this.element == null ? null : this.element.getValue(); + } + + /** + * @param value A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition. + */ + public OtherElementComponent setElement(String value) { + if (this.element == null) + this.element = new UriType(); + this.element.setValue(value); + return this; + } + + /** + * @return {@link #codeSystem} (An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that cross code systems).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value + */ + public UriType getCodeSystemElement() { + if (this.codeSystem == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OtherElementComponent.codeSystem"); + else if (Configuration.doAutoCreate()) + this.codeSystem = new UriType(); // bb + return this.codeSystem; + } + + public boolean hasCodeSystemElement() { + return this.codeSystem != null && !this.codeSystem.isEmpty(); + } + + public boolean hasCodeSystem() { + return this.codeSystem != null && !this.codeSystem.isEmpty(); + } + + /** + * @param value {@link #codeSystem} (An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that cross code systems).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value + */ + public OtherElementComponent setCodeSystemElement(UriType value) { + this.codeSystem = value; + return this; + } + + /** + * @return An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that cross code systems). + */ + public String getCodeSystem() { + return this.codeSystem == null ? null : this.codeSystem.getValue(); + } + + /** + * @param value An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that cross code systems). + */ + public OtherElementComponent setCodeSystem(String value) { + if (this.codeSystem == null) + this.codeSystem = new UriType(); + this.codeSystem.setValue(value); + return this; + } + + /** + * @return {@link #code} (Identity (code or path) or the element/item that the map depends on / refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public StringType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OtherElementComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new StringType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Identity (code or path) or the element/item that the map depends on / refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public OtherElementComponent setCodeElement(StringType value) { + this.code = value; + return this; + } + + /** + * @return Identity (code or path) or the element/item that the map depends on / refers to. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Identity (code or path) or the element/item that the map depends on / refers to. + */ + public OtherElementComponent setCode(String value) { + if (this.code == null) + this.code = new StringType(); + this.code.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("element", "uri", "A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition.", 0, java.lang.Integer.MAX_VALUE, element)); + childrenList.add(new Property("codeSystem", "uri", "An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that cross code systems).", 0, java.lang.Integer.MAX_VALUE, codeSystem)); + childrenList.add(new Property("code", "string", "Identity (code or path) or the element/item that the map depends on / refers to.", 0, java.lang.Integer.MAX_VALUE, code)); + } + + public OtherElementComponent copy() { + OtherElementComponent dst = new OtherElementComponent(); + copyValues(dst); + dst.element = element == null ? null : element.copy(); + dst.codeSystem = codeSystem == null ? null : codeSystem.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OtherElementComponent)) + return false; + OtherElementComponent o = (OtherElementComponent) other; + return compareDeep(element, o.element, true) && compareDeep(codeSystem, o.codeSystem, true) && compareDeep(code, o.code, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OtherElementComponent)) + return false; + OtherElementComponent o = (OtherElementComponent) other; + return compareValues(element, o.element, true) && compareValues(codeSystem, o.codeSystem, true) && compareValues(code, o.code, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (element == null || element.isEmpty()) && (codeSystem == null || codeSystem.isEmpty()) + && (code == null || code.isEmpty()); + } + + } + + @Block() + public static class ConceptMapElementMapComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems). + */ + @Child(name = "codeSystem", type = {UriType.class}, order=1, min=0, max=1) + @Description(shortDefinition="System of the target (if necessary)", formalDefinition="An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems)." ) + protected UriType codeSystem; + + /** + * Identity (code or path) or the element/item that the map refers to. + */ + @Child(name = "code", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Code that identifies the target element", formalDefinition="Identity (code or path) or the element/item that the map refers to." ) + protected CodeType code; + + /** + * The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target. + */ + @Child(name = "equivalence", type = {CodeType.class}, order=3, min=1, max=1) + @Description(shortDefinition="equivalent | equal | wider | subsumes | narrower | specialises | inexact | unmatched | disjoint", formalDefinition="The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target." ) + protected Enumeration equivalence; + + /** + * A description of status/issues in mapping that conveys additional information not represented in the structured data. + */ + @Child(name = "comments", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Description of status/issues in mapping", formalDefinition="A description of status/issues in mapping that conveys additional information not represented in the structured data." ) + protected StringType comments; + + /** + * A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on. + */ + @Child(name = "product", type = {OtherElementComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Other concepts that this mapping also produces", formalDefinition="A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on." ) + protected List product; + + private static final long serialVersionUID = 606421694L; + + /* + * Constructor + */ + public ConceptMapElementMapComponent() { + super(); + } + + /* + * Constructor + */ + public ConceptMapElementMapComponent(Enumeration equivalence) { + super(); + this.equivalence = equivalence; + } + + /** + * @return {@link #codeSystem} (An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value + */ + public UriType getCodeSystemElement() { + if (this.codeSystem == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMapElementMapComponent.codeSystem"); + else if (Configuration.doAutoCreate()) + this.codeSystem = new UriType(); // bb + return this.codeSystem; + } + + public boolean hasCodeSystemElement() { + return this.codeSystem != null && !this.codeSystem.isEmpty(); + } + + public boolean hasCodeSystem() { + return this.codeSystem != null && !this.codeSystem.isEmpty(); + } + + /** + * @param value {@link #codeSystem} (An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value + */ + public ConceptMapElementMapComponent setCodeSystemElement(UriType value) { + this.codeSystem = value; + return this; + } + + /** + * @return An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems). + */ + public String getCodeSystem() { + return this.codeSystem == null ? null : this.codeSystem.getValue(); + } + + /** + * @param value An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems). + */ + public ConceptMapElementMapComponent setCodeSystem(String value) { + if (Utilities.noString(value)) + this.codeSystem = null; + else { + if (this.codeSystem == null) + this.codeSystem = new UriType(); + this.codeSystem.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (Identity (code or path) or the element/item that the map refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMapElementMapComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Identity (code or path) or the element/item that the map refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public ConceptMapElementMapComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return Identity (code or path) or the element/item that the map refers to. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Identity (code or path) or the element/item that the map refers to. + */ + public ConceptMapElementMapComponent setCode(String value) { + if (Utilities.noString(value)) + this.code = null; + else { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + } + return this; + } + + /** + * @return {@link #equivalence} (The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target.). This is the underlying object with id, value and extensions. The accessor "getEquivalence" gives direct access to the value + */ + public Enumeration getEquivalenceElement() { + if (this.equivalence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMapElementMapComponent.equivalence"); + else if (Configuration.doAutoCreate()) + this.equivalence = new Enumeration(new ConceptEquivalenceEnumFactory()); // bb + return this.equivalence; + } + + public boolean hasEquivalenceElement() { + return this.equivalence != null && !this.equivalence.isEmpty(); + } + + public boolean hasEquivalence() { + return this.equivalence != null && !this.equivalence.isEmpty(); + } + + /** + * @param value {@link #equivalence} (The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target.). This is the underlying object with id, value and extensions. The accessor "getEquivalence" gives direct access to the value + */ + public ConceptMapElementMapComponent setEquivalenceElement(Enumeration value) { + this.equivalence = value; + return this; + } + + /** + * @return The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target. + */ + public ConceptEquivalence getEquivalence() { + return this.equivalence == null ? null : this.equivalence.getValue(); + } + + /** + * @param value The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target. + */ + public ConceptMapElementMapComponent setEquivalence(ConceptEquivalence value) { + if (this.equivalence == null) + this.equivalence = new Enumeration(new ConceptEquivalenceEnumFactory()); + this.equivalence.setValue(value); + return this; + } + + /** + * @return {@link #comments} (A description of status/issues in mapping that conveys additional information not represented in the structured data.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public StringType getCommentsElement() { + if (this.comments == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMapElementMapComponent.comments"); + else if (Configuration.doAutoCreate()) + this.comments = new StringType(); // bb + return this.comments; + } + + public boolean hasCommentsElement() { + return this.comments != null && !this.comments.isEmpty(); + } + + public boolean hasComments() { + return this.comments != null && !this.comments.isEmpty(); + } + + /** + * @param value {@link #comments} (A description of status/issues in mapping that conveys additional information not represented in the structured data.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public ConceptMapElementMapComponent setCommentsElement(StringType value) { + this.comments = value; + return this; + } + + /** + * @return A description of status/issues in mapping that conveys additional information not represented in the structured data. + */ + public String getComments() { + return this.comments == null ? null : this.comments.getValue(); + } + + /** + * @param value A description of status/issues in mapping that conveys additional information not represented in the structured data. + */ + public ConceptMapElementMapComponent setComments(String value) { + if (Utilities.noString(value)) + this.comments = null; + else { + if (this.comments == null) + this.comments = new StringType(); + this.comments.setValue(value); + } + return this; + } + + /** + * @return {@link #product} (A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.) + */ + public List getProduct() { + if (this.product == null) + this.product = new ArrayList(); + return this.product; + } + + public boolean hasProduct() { + if (this.product == null) + return false; + for (OtherElementComponent item : this.product) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #product} (A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.) + */ + // syntactic sugar + public OtherElementComponent addProduct() { //3 + OtherElementComponent t = new OtherElementComponent(); + if (this.product == null) + this.product = new ArrayList(); + this.product.add(t); + return t; + } + + // syntactic sugar + public ConceptMapElementMapComponent addProduct(OtherElementComponent t) { //3 + if (t == null) + return this; + if (this.product == null) + this.product = new ArrayList(); + this.product.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("codeSystem", "uri", "An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems).", 0, java.lang.Integer.MAX_VALUE, codeSystem)); + childrenList.add(new Property("code", "code", "Identity (code or path) or the element/item that the map refers to.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("equivalence", "code", "The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target.", 0, java.lang.Integer.MAX_VALUE, equivalence)); + childrenList.add(new Property("comments", "string", "A description of status/issues in mapping that conveys additional information not represented in the structured data.", 0, java.lang.Integer.MAX_VALUE, comments)); + childrenList.add(new Property("product", "@ConceptMap.element.dependsOn", "A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.", 0, java.lang.Integer.MAX_VALUE, product)); + } + + public ConceptMapElementMapComponent copy() { + ConceptMapElementMapComponent dst = new ConceptMapElementMapComponent(); + copyValues(dst); + dst.codeSystem = codeSystem == null ? null : codeSystem.copy(); + dst.code = code == null ? null : code.copy(); + dst.equivalence = equivalence == null ? null : equivalence.copy(); + dst.comments = comments == null ? null : comments.copy(); + if (product != null) { + dst.product = new ArrayList(); + for (OtherElementComponent i : product) + dst.product.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConceptMapElementMapComponent)) + return false; + ConceptMapElementMapComponent o = (ConceptMapElementMapComponent) other; + return compareDeep(codeSystem, o.codeSystem, true) && compareDeep(code, o.code, true) && compareDeep(equivalence, o.equivalence, true) + && compareDeep(comments, o.comments, true) && compareDeep(product, o.product, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConceptMapElementMapComponent)) + return false; + ConceptMapElementMapComponent o = (ConceptMapElementMapComponent) other; + return compareValues(codeSystem, o.codeSystem, true) && compareValues(code, o.code, true) && compareValues(equivalence, o.equivalence, true) + && compareValues(comments, o.comments, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (codeSystem == null || codeSystem.isEmpty()) && (code == null || code.isEmpty()) + && (equivalence == null || equivalence.isEmpty()) && (comments == null || comments.isEmpty()) + && (product == null || product.isEmpty()); + } + + } + + /** + * An absolute uri that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). + */ + @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Globally unique logical id for concept map", formalDefinition="An absolute uri that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:)." ) + protected UriType url; + + /** + * Formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) + @Description(shortDefinition="Additional identifier for the concept map", formalDefinition="Formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance." ) + protected Identifier identifier; + + /** + * The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Logical id for this version of the concept map", formalDefinition="The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) + protected StringType version; + + /** + * A free text natural language name describing the concept map. + */ + @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Informal name for this concept map", formalDefinition="A free text natural language name describing the concept map." ) + protected StringType name; + + /** + * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of concept maps. + */ + @Child(name = "useContext", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of concept maps." ) + protected List useContext; + + /** + * The name of the individual or organization that published the concept map. + */ + @Child(name = "publisher", type = {StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the concept map." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc. + */ + @Child(name = "description", type = {StringType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Human language description of the concept map", formalDefinition="A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc." ) + protected StringType description; + + /** + * Explains why this concept map is needed and why it's been constrained as it has. + */ + @Child(name = "requirements", type = {StringType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Why is this needed?", formalDefinition="Explains why this concept map is needed and why it's been constrained as it has." ) + protected StringType requirements; + + /** + * A copyright statement relating to the concept map and/or its contents. + */ + @Child(name = "copyright", type = {StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Use and/or Publishing restrictions", formalDefinition="A copyright statement relating to the concept map and/or its contents." ) + protected StringType copyright; + + /** + * The status of the concept map. + */ + @Child(name = "status", type = {CodeType.class}, order=10, min=1, max=1) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the concept map." ) + protected Enumeration status; + + /** + * This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name = "experimental", type = {BooleanType.class}, order=11, min=0, max=1) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The date that the concept map status was last changed. + */ + @Child(name = "date", type = {DateTimeType.class}, order=12, min=0, max=1) + @Description(shortDefinition="Date for given status", formalDefinition="The date that the concept map status was last changed." ) + protected DateTimeType date; + + /** + * The source value set that specifies the concepts that are being mapped. + */ + @Child(name = "source", type = {UriType.class, ValueSet.class, StructureDefinition.class}, order=13, min=1, max=1) + @Description(shortDefinition="Identifies the source of the concepts which are being mapped", formalDefinition="The source value set that specifies the concepts that are being mapped." ) + protected Type source; + + /** + * The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made. + */ + @Child(name = "target", type = {UriType.class, ValueSet.class, StructureDefinition.class}, order=14, min=1, max=1) + @Description(shortDefinition="Provides context to the mappings", formalDefinition="The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made." ) + protected Type target; + + /** + * Mappings for an individual concept in the source to one or more concepts in the target. + */ + @Child(name = "element", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Mappings for a concept from the source set", formalDefinition="Mappings for an individual concept in the source to one or more concepts in the target." ) + protected List element; + + private static final long serialVersionUID = 729155675L; + + /* + * Constructor + */ + public ConceptMap() { + super(); + } + + /* + * Constructor + */ + public ConceptMap(Enumeration status, Type source, Type target) { + super(); + this.status = status; + this.source = source; + this.target = target; + } + + /** + * @return {@link #url} (An absolute uri that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute uri that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public ConceptMap setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute uri that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute uri that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). + */ + public ConceptMap setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #identifier} (Formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance.) + */ + public ConceptMap setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #version} (The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ConceptMap setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public ConceptMap setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A free text natural language name describing the concept map.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A free text natural language name describing the concept map.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ConceptMap setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name describing the concept map. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name describing the concept map. + */ + public ConceptMap setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of concept maps.) + */ + public List getUseContext() { + if (this.useContext == null) + this.useContext = new ArrayList(); + return this.useContext; + } + + public boolean hasUseContext() { + if (this.useContext == null) + return false; + for (CodeableConcept item : this.useContext) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of concept maps.) + */ + // syntactic sugar + public CodeableConcept addUseContext() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return t; + } + + // syntactic sugar + public ConceptMap addUseContext(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the concept map.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the concept map.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public ConceptMap setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the concept map. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the concept map. + */ + public ConceptMap setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (ConceptMapContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public ConceptMapContactComponent addContact() { //3 + ConceptMapContactComponent t = new ConceptMapContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public ConceptMap addContact(ConceptMapContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #description} (A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ConceptMap setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc. + */ + public ConceptMap setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #requirements} (Explains why this concept map is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); // bb + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (Explains why this concept map is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public ConceptMap setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return Explains why this concept map is needed and why it's been constrained as it has. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value Explains why this concept map is needed and why it's been constrained as it has. + */ + public ConceptMap setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #copyright} (A copyright statement relating to the concept map and/or its contents.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public StringType getCopyrightElement() { + if (this.copyright == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.copyright"); + else if (Configuration.doAutoCreate()) + this.copyright = new StringType(); // bb + return this.copyright; + } + + public boolean hasCopyrightElement() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + public boolean hasCopyright() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + /** + * @param value {@link #copyright} (A copyright statement relating to the concept map and/or its contents.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public ConceptMap setCopyrightElement(StringType value) { + this.copyright = value; + return this; + } + + /** + * @return A copyright statement relating to the concept map and/or its contents. + */ + public String getCopyright() { + return this.copyright == null ? null : this.copyright.getValue(); + } + + /** + * @param value A copyright statement relating to the concept map and/or its contents. + */ + public ConceptMap setCopyright(String value) { + if (Utilities.noString(value)) + this.copyright = null; + else { + if (this.copyright == null) + this.copyright = new StringType(); + this.copyright.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of the concept map.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status of the concept map.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public ConceptMap setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the concept map. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the concept map. + */ + public ConceptMap setStatus(ConformanceResourceStatus value) { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #experimental} (This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public ConceptMap setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public ConceptMap setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #date} (The date that the concept map status was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date that the concept map status was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ConceptMap setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date that the concept map status was last changed. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date that the concept map status was last changed. + */ + public ConceptMap setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #source} (The source value set that specifies the concepts that are being mapped.) + */ + public Type getSource() { + return this.source; + } + + /** + * @return {@link #source} (The source value set that specifies the concepts that are being mapped.) + */ + public UriType getSourceUriType() throws Exception { + if (!(this.source instanceof UriType)) + throw new Exception("Type mismatch: the type UriType was expected, but "+this.source.getClass().getName()+" was encountered"); + return (UriType) this.source; + } + + /** + * @return {@link #source} (The source value set that specifies the concepts that are being mapped.) + */ + public Reference getSourceReference() throws Exception { + if (!(this.source instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.source.getClass().getName()+" was encountered"); + return (Reference) this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (The source value set that specifies the concepts that are being mapped.) + */ + public ConceptMap setSource(Type value) { + this.source = value; + return this; + } + + /** + * @return {@link #target} (The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.) + */ + public Type getTarget() { + return this.target; + } + + /** + * @return {@link #target} (The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.) + */ + public UriType getTargetUriType() throws Exception { + if (!(this.target instanceof UriType)) + throw new Exception("Type mismatch: the type UriType was expected, but "+this.target.getClass().getName()+" was encountered"); + return (UriType) this.target; + } + + /** + * @return {@link #target} (The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.) + */ + public Reference getTargetReference() throws Exception { + if (!(this.target instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.target.getClass().getName()+" was encountered"); + return (Reference) this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.) + */ + public ConceptMap setTarget(Type value) { + this.target = value; + return this; + } + + /** + * @return {@link #element} (Mappings for an individual concept in the source to one or more concepts in the target.) + */ + public List getElement() { + if (this.element == null) + this.element = new ArrayList(); + return this.element; + } + + public boolean hasElement() { + if (this.element == null) + return false; + for (ConceptMapElementComponent item : this.element) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #element} (Mappings for an individual concept in the source to one or more concepts in the target.) + */ + // syntactic sugar + public ConceptMapElementComponent addElement() { //3 + ConceptMapElementComponent t = new ConceptMapElementComponent(); + if (this.element == null) + this.element = new ArrayList(); + this.element.add(t); + return t; + } + + // syntactic sugar + public ConceptMap addElement(ConceptMapElementComponent t) { //3 + if (t == null) + return this; + if (this.element == null) + this.element = new ArrayList(); + this.element.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute uri that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "A free text natural language name describing the concept map.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of concept maps.", 0, java.lang.Integer.MAX_VALUE, useContext)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the concept map.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("description", "string", "A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("requirements", "string", "Explains why this concept map is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("copyright", "string", "A copyright statement relating to the concept map and/or its contents.", 0, java.lang.Integer.MAX_VALUE, copyright)); + childrenList.add(new Property("status", "code", "The status of the concept map.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("date", "dateTime", "The date that the concept map status was last changed.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("source[x]", "uri|Reference(ValueSet|StructureDefinition)", "The source value set that specifies the concepts that are being mapped.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("target[x]", "uri|Reference(ValueSet|StructureDefinition)", "The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("element", "", "Mappings for an individual concept in the source to one or more concepts in the target.", 0, java.lang.Integer.MAX_VALUE, element)); + } + + public ConceptMap copy() { + ConceptMap dst = new ConceptMap(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + if (useContext != null) { + dst.useContext = new ArrayList(); + for (CodeableConcept i : useContext) + dst.useContext.add(i.copy()); + }; + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (ConceptMapContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + dst.requirements = requirements == null ? null : requirements.copy(); + dst.copyright = copyright == null ? null : copyright.copy(); + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.date = date == null ? null : date.copy(); + dst.source = source == null ? null : source.copy(); + dst.target = target == null ? null : target.copy(); + if (element != null) { + dst.element = new ArrayList(); + for (ConceptMapElementComponent i : element) + dst.element.add(i.copy()); + }; + return dst; + } + + protected ConceptMap typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConceptMap)) + return false; + ConceptMap o = (ConceptMap) other; + return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) + && compareDeep(name, o.name, true) && compareDeep(useContext, o.useContext, true) && compareDeep(publisher, o.publisher, true) + && compareDeep(contact, o.contact, true) && compareDeep(description, o.description, true) && compareDeep(requirements, o.requirements, true) + && compareDeep(copyright, o.copyright, true) && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) + && compareDeep(date, o.date, true) && compareDeep(source, o.source, true) && compareDeep(target, o.target, true) + && compareDeep(element, o.element, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConceptMap)) + return false; + ConceptMap o = (ConceptMap) other; + return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) + && compareValues(publisher, o.publisher, true) && compareValues(description, o.description, true) && compareValues(requirements, o.requirements, true) + && compareValues(copyright, o.copyright, true) && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) + && compareValues(date, o.date, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (useContext == null || useContext.isEmpty()) + && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) && (description == null || description.isEmpty()) + && (requirements == null || requirements.isEmpty()) && (copyright == null || copyright.isEmpty()) + && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) + && (date == null || date.isEmpty()) && (source == null || source.isEmpty()) && (target == null || target.isEmpty()) + && (element == null || element.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ConceptMap; + } + + @SearchParamDefinition(name="date", path="ConceptMap.date", description="The concept map publication date", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="ConceptMap.identifier", description="Additional identifier for the concept map", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="product", path="ConceptMap.element.map.product.element", description="Reference to element/field/valueset mapping depends on", type="uri" ) + public static final String SP_PRODUCT = "product"; + @SearchParamDefinition(name="dependson", path="ConceptMap.element.dependsOn.element", description="Reference to element/field/valueset mapping depends on", type="uri" ) + public static final String SP_DEPENDSON = "dependson"; + @SearchParamDefinition(name="description", path="ConceptMap.description", description="Text search in the description of the concept map", type="string" ) + public static final String SP_DESCRIPTION = "description"; + @SearchParamDefinition(name="source", path="ConceptMap.source[x]", description="The system for any concepts mapped by this concept map", type="reference" ) + public static final String SP_SOURCE = "source"; + @SearchParamDefinition(name="version", path="ConceptMap.version", description="The version identifier of the concept map", type="token" ) + public static final String SP_VERSION = "version"; + @SearchParamDefinition(name="url", path="ConceptMap.url", description="The url of the concept map", type="uri" ) + public static final String SP_URL = "url"; + @SearchParamDefinition(name="target", path="ConceptMap.target[x]", description="Provides context to the mappings", type="reference" ) + public static final String SP_TARGET = "target"; + @SearchParamDefinition(name="system", path="ConceptMap.element.map.codeSystem", description="The system for any destination concepts mapped by this map", type="uri" ) + public static final String SP_SYSTEM = "system"; + @SearchParamDefinition(name="name", path="ConceptMap.name", description="Name of the concept map", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="context", path="ConceptMap.useContext", description="A use context assigned to the concept map", type="token" ) + public static final String SP_CONTEXT = "context"; + @SearchParamDefinition(name="publisher", path="ConceptMap.publisher", description="Name of the publisher of the concept map", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + @SearchParamDefinition(name="status", path="ConceptMap.status", description="Status of the concept map", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Condition.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Condition.java index 4486efd250c..2fa19bf5d26 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Condition.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Condition.java @@ -1,1860 +1,1839 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary. - */ -@ResourceDef(name="Condition", profile="http://hl7.org/fhir/Profile/Condition") -public class Condition extends DomainResource { - - public enum ConditionStatus { - /** - * This is a tentative diagnosis - still a candidate that is under consideration. - */ - PROVISIONAL, - /** - * The patient is being treated on the basis that this is the condition, but it is still not confirmed. - */ - WORKING, - /** - * There is sufficient diagnostic and/or clinical evidence to treat this as a confirmed condition. - */ - CONFIRMED, - /** - * This condition has been ruled out by diagnostic and clinical evidence. - */ - REFUTED, - /** - * The statement was entered in error and Is not valid. - */ - ENTEREDINERROR, - /** - * The condition status is unknown. Note that "unknown" is a value of last resort and every attempt should be made to provide a meaningful value other than "unknown". - */ - UNKNOWN, - /** - * added to help the parsers - */ - NULL; - public static ConditionStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("provisional".equals(codeString)) - return PROVISIONAL; - if ("working".equals(codeString)) - return WORKING; - if ("confirmed".equals(codeString)) - return CONFIRMED; - if ("refuted".equals(codeString)) - return REFUTED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - if ("unknown".equals(codeString)) - return UNKNOWN; - throw new Exception("Unknown ConditionStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PROVISIONAL: return "provisional"; - case WORKING: return "working"; - case CONFIRMED: return "confirmed"; - case REFUTED: return "refuted"; - case ENTEREDINERROR: return "entered-in-error"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PROVISIONAL: return ""; - case WORKING: return ""; - case CONFIRMED: return ""; - case REFUTED: return ""; - case ENTEREDINERROR: return ""; - case UNKNOWN: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PROVISIONAL: return "This is a tentative diagnosis - still a candidate that is under consideration."; - case WORKING: return "The patient is being treated on the basis that this is the condition, but it is still not confirmed."; - case CONFIRMED: return "There is sufficient diagnostic and/or clinical evidence to treat this as a confirmed condition."; - case REFUTED: return "This condition has been ruled out by diagnostic and clinical evidence."; - case ENTEREDINERROR: return "The statement was entered in error and Is not valid."; - case UNKNOWN: return "The condition status is unknown. Note that 'unknown' is a value of last resort and every attempt should be made to provide a meaningful value other than 'unknown'."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PROVISIONAL: return "Provisional"; - case WORKING: return "Working"; - case CONFIRMED: return "Confirmed"; - case REFUTED: return "Refuted"; - case ENTEREDINERROR: return "Entered In Error"; - case UNKNOWN: return "Unknown"; - default: return "?"; - } - } - } - - public static class ConditionStatusEnumFactory implements EnumFactory { - public ConditionStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("provisional".equals(codeString)) - return ConditionStatus.PROVISIONAL; - if ("working".equals(codeString)) - return ConditionStatus.WORKING; - if ("confirmed".equals(codeString)) - return ConditionStatus.CONFIRMED; - if ("refuted".equals(codeString)) - return ConditionStatus.REFUTED; - if ("entered-in-error".equals(codeString)) - return ConditionStatus.ENTEREDINERROR; - if ("unknown".equals(codeString)) - return ConditionStatus.UNKNOWN; - throw new IllegalArgumentException("Unknown ConditionStatus code '"+codeString+"'"); - } - public String toCode(ConditionStatus code) { - if (code == ConditionStatus.PROVISIONAL) - return "provisional"; - if (code == ConditionStatus.WORKING) - return "working"; - if (code == ConditionStatus.CONFIRMED) - return "confirmed"; - if (code == ConditionStatus.REFUTED) - return "refuted"; - if (code == ConditionStatus.ENTEREDINERROR) - return "entered-in-error"; - if (code == ConditionStatus.UNKNOWN) - return "unknown"; - return "?"; - } - } - - @Block() - public static class ConditionStageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific. - */ - @Child(name = "summary", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Simple summary (disease specific)", formalDefinition="A simple summary of the stage such as 'Stage 3'. The determination of the stage is disease-specific." ) - protected CodeableConcept summary; - - /** - * Reference to a formal record of the evidence on which the staging assessment is based. - */ - @Child(name = "assessment", type = {ClinicalImpression.class, DiagnosticReport.class, Observation.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Formal record of assessment", formalDefinition="Reference to a formal record of the evidence on which the staging assessment is based." ) - protected List assessment; - /** - * The actual objects that are the target of the reference (Reference to a formal record of the evidence on which the staging assessment is based.) - */ - protected List assessmentTarget; - - - private static final long serialVersionUID = -1961530405L; - - /* - * Constructor - */ - public ConditionStageComponent() { - super(); - } - - /** - * @return {@link #summary} (A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific.) - */ - public CodeableConcept getSummary() { - if (this.summary == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConditionStageComponent.summary"); - else if (Configuration.doAutoCreate()) - this.summary = new CodeableConcept(); // cc - return this.summary; - } - - public boolean hasSummary() { - return this.summary != null && !this.summary.isEmpty(); - } - - /** - * @param value {@link #summary} (A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific.) - */ - public ConditionStageComponent setSummary(CodeableConcept value) { - this.summary = value; - return this; - } - - /** - * @return {@link #assessment} (Reference to a formal record of the evidence on which the staging assessment is based.) - */ - public List getAssessment() { - if (this.assessment == null) - this.assessment = new ArrayList(); - return this.assessment; - } - - public boolean hasAssessment() { - if (this.assessment == null) - return false; - for (Reference item : this.assessment) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #assessment} (Reference to a formal record of the evidence on which the staging assessment is based.) - */ - // syntactic sugar - public Reference addAssessment() { //3 - Reference t = new Reference(); - if (this.assessment == null) - this.assessment = new ArrayList(); - this.assessment.add(t); - return t; - } - - // syntactic sugar - public ConditionStageComponent addAssessment(Reference t) { //3 - if (t == null) - return this; - if (this.assessment == null) - this.assessment = new ArrayList(); - this.assessment.add(t); - return this; - } - - /** - * @return {@link #assessment} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Reference to a formal record of the evidence on which the staging assessment is based.) - */ - public List getAssessmentTarget() { - if (this.assessmentTarget == null) - this.assessmentTarget = new ArrayList(); - return this.assessmentTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("summary", "CodeableConcept", "A simple summary of the stage such as 'Stage 3'. The determination of the stage is disease-specific.", 0, java.lang.Integer.MAX_VALUE, summary)); - childrenList.add(new Property("assessment", "Reference(ClinicalImpression|DiagnosticReport|Observation)", "Reference to a formal record of the evidence on which the staging assessment is based.", 0, java.lang.Integer.MAX_VALUE, assessment)); - } - - public ConditionStageComponent copy() { - ConditionStageComponent dst = new ConditionStageComponent(); - copyValues(dst); - dst.summary = summary == null ? null : summary.copy(); - if (assessment != null) { - dst.assessment = new ArrayList(); - for (Reference i : assessment) - dst.assessment.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConditionStageComponent)) - return false; - ConditionStageComponent o = (ConditionStageComponent) other; - return compareDeep(summary, o.summary, true) && compareDeep(assessment, o.assessment, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConditionStageComponent)) - return false; - ConditionStageComponent o = (ConditionStageComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (summary == null || summary.isEmpty()) && (assessment == null || assessment.isEmpty()) - ; - } - - } - - @Block() - public static class ConditionEvidenceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A manifestation or symptom that led to the recording of this condition. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Manifestation/symptom", formalDefinition="A manifestation or symptom that led to the recording of this condition." ) - protected CodeableConcept code; - - /** - * Links to other relevant information, including pathology reports. - */ - @Child(name = "detail", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Supporting information found elsewhere", formalDefinition="Links to other relevant information, including pathology reports." ) - protected List detail; - /** - * The actual objects that are the target of the reference (Links to other relevant information, including pathology reports.) - */ - protected List detailTarget; - - - private static final long serialVersionUID = 945689926L; - - /* - * Constructor - */ - public ConditionEvidenceComponent() { - super(); - } - - /** - * @return {@link #code} (A manifestation or symptom that led to the recording of this condition.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConditionEvidenceComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A manifestation or symptom that led to the recording of this condition.) - */ - public ConditionEvidenceComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #detail} (Links to other relevant information, including pathology reports.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (Reference item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (Links to other relevant information, including pathology reports.) - */ - // syntactic sugar - public Reference addDetail() { //3 - Reference t = new Reference(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - // syntactic sugar - public ConditionEvidenceComponent addDetail(Reference t) { //3 - if (t == null) - return this; - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return this; - } - - /** - * @return {@link #detail} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Links to other relevant information, including pathology reports.) - */ - public List getDetailTarget() { - if (this.detailTarget == null) - this.detailTarget = new ArrayList(); - return this.detailTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "A manifestation or symptom that led to the recording of this condition.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("detail", "Reference(Any)", "Links to other relevant information, including pathology reports.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - public ConditionEvidenceComponent copy() { - ConditionEvidenceComponent dst = new ConditionEvidenceComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - if (detail != null) { - dst.detail = new ArrayList(); - for (Reference i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConditionEvidenceComponent)) - return false; - ConditionEvidenceComponent o = (ConditionEvidenceComponent) other; - return compareDeep(code, o.code, true) && compareDeep(detail, o.detail, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConditionEvidenceComponent)) - return false; - ConditionEvidenceComponent o = (ConditionEvidenceComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (detail == null || detail.isEmpty()) - ; - } - - } - - @Block() - public static class ConditionLocationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code that identifies the structural location. - */ - @Child(name = "site", type = {CodeableConcept.class, BodySite.class}, order=1, min=0, max=1) - @Description(shortDefinition="Location - may include laterality", formalDefinition="Code that identifies the structural location." ) - protected Type site; - - private static final long serialVersionUID = 1429072605L; - - /* - * Constructor - */ - public ConditionLocationComponent() { - super(); - } - - /** - * @return {@link #site} (Code that identifies the structural location.) - */ - public Type getSite() { - return this.site; - } - - /** - * @return {@link #site} (Code that identifies the structural location.) - */ - public CodeableConcept getSiteCodeableConcept() throws Exception { - if (!(this.site instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.site.getClass().getName()+" was encountered"); - return (CodeableConcept) this.site; - } - - /** - * @return {@link #site} (Code that identifies the structural location.) - */ - public Reference getSiteReference() throws Exception { - if (!(this.site instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.site.getClass().getName()+" was encountered"); - return (Reference) this.site; - } - - public boolean hasSite() { - return this.site != null && !this.site.isEmpty(); - } - - /** - * @param value {@link #site} (Code that identifies the structural location.) - */ - public ConditionLocationComponent setSite(Type value) { - this.site = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("site[x]", "CodeableConcept|Reference(BodySite)", "Code that identifies the structural location.", 0, java.lang.Integer.MAX_VALUE, site)); - } - - public ConditionLocationComponent copy() { - ConditionLocationComponent dst = new ConditionLocationComponent(); - copyValues(dst); - dst.site = site == null ? null : site.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConditionLocationComponent)) - return false; - ConditionLocationComponent o = (ConditionLocationComponent) other; - return compareDeep(site, o.site, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConditionLocationComponent)) - return false; - ConditionLocationComponent o = (ConditionLocationComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (site == null || site.isEmpty()); - } - - } - - @Block() - public static class ConditionDueToComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code that identifies the target of this relationship. The code takes the place of a detailed instance target. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Relationship target by means of a predefined code", formalDefinition="Code that identifies the target of this relationship. The code takes the place of a detailed instance target." ) - protected CodeableConcept code; - - /** - * Target of the relationship. - */ - @Child(name = "target", type = {Condition.class, Procedure.class, MedicationAdministration.class, Immunization.class, MedicationStatement.class}, order=2, min=0, max=1) - @Description(shortDefinition="Relationship target resource", formalDefinition="Target of the relationship." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (Target of the relationship.) - */ - protected Resource targetTarget; - - private static final long serialVersionUID = -660755940L; - - /* - * Constructor - */ - public ConditionDueToComponent() { - super(); - } - - /** - * @return {@link #code} (Code that identifies the target of this relationship. The code takes the place of a detailed instance target.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConditionDueToComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code that identifies the target of this relationship. The code takes the place of a detailed instance target.) - */ - public ConditionDueToComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #target} (Target of the relationship.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConditionDueToComponent.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); // cc - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (Target of the relationship.) - */ - public ConditionDueToComponent 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. (Target of the relationship.) - */ - public Resource getTargetTarget() { - return this.targetTarget; - } - - /** - * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Target of the relationship.) - */ - public ConditionDueToComponent setTargetTarget(Resource value) { - this.targetTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "Code that identifies the target of this relationship. The code takes the place of a detailed instance target.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("target", "Reference(Condition|Procedure|MedicationAdministration|Immunization|MedicationStatement)", "Target of the relationship.", 0, java.lang.Integer.MAX_VALUE, target)); - } - - public ConditionDueToComponent copy() { - ConditionDueToComponent dst = new ConditionDueToComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.target = target == null ? null : target.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConditionDueToComponent)) - return false; - ConditionDueToComponent o = (ConditionDueToComponent) other; - return compareDeep(code, o.code, true) && compareDeep(target, o.target, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConditionDueToComponent)) - return false; - ConditionDueToComponent o = (ConditionDueToComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (target == null || target.isEmpty()) - ; - } - - } - - @Block() - public static class ConditionOccurredFollowingComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code that identifies the target of this relationship. The code takes the place of a detailed instance target. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Relationship target by means of a predefined code", formalDefinition="Code that identifies the target of this relationship. The code takes the place of a detailed instance target." ) - protected CodeableConcept code; - - /** - * Target of the relationship. - */ - @Child(name = "target", type = {Condition.class, Procedure.class, MedicationAdministration.class, Immunization.class, MedicationStatement.class}, order=2, min=0, max=1) - @Description(shortDefinition="Relationship target resource", formalDefinition="Target of the relationship." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (Target of the relationship.) - */ - protected Resource targetTarget; - - private static final long serialVersionUID = -660755940L; - - /* - * Constructor - */ - public ConditionOccurredFollowingComponent() { - super(); - } - - /** - * @return {@link #code} (Code that identifies the target of this relationship. The code takes the place of a detailed instance target.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConditionOccurredFollowingComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code that identifies the target of this relationship. The code takes the place of a detailed instance target.) - */ - public ConditionOccurredFollowingComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #target} (Target of the relationship.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConditionOccurredFollowingComponent.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); // cc - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (Target of the relationship.) - */ - public ConditionOccurredFollowingComponent 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. (Target of the relationship.) - */ - public Resource getTargetTarget() { - return this.targetTarget; - } - - /** - * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Target of the relationship.) - */ - public ConditionOccurredFollowingComponent setTargetTarget(Resource value) { - this.targetTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "Code that identifies the target of this relationship. The code takes the place of a detailed instance target.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("target", "Reference(Condition|Procedure|MedicationAdministration|Immunization|MedicationStatement)", "Target of the relationship.", 0, java.lang.Integer.MAX_VALUE, target)); - } - - public ConditionOccurredFollowingComponent copy() { - ConditionOccurredFollowingComponent dst = new ConditionOccurredFollowingComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.target = target == null ? null : target.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConditionOccurredFollowingComponent)) - return false; - ConditionOccurredFollowingComponent o = (ConditionOccurredFollowingComponent) other; - return compareDeep(code, o.code, true) && compareDeep(target, o.target, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConditionOccurredFollowingComponent)) - return false; - ConditionOccurredFollowingComponent o = (ConditionOccurredFollowingComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (target == null || target.isEmpty()) - ; - } - - } - - /** - * This records identifiers associated with this condition that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External Ids for this condition", formalDefinition="This records identifiers associated with this condition that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) - protected List identifier; - - /** - * Indicates the patient who the condition record is associated with. - */ - @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1) - @Description(shortDefinition="Who has the condition?", formalDefinition="Indicates the patient who the condition record is associated with." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (Indicates the patient who the condition record is associated with.) - */ - protected Patient patientTarget; - - /** - * Encounter during which the condition was first asserted. - */ - @Child(name = "encounter", type = {Encounter.class}, order=2, min=0, max=1) - @Description(shortDefinition="Encounter when condition first asserted", formalDefinition="Encounter during which the condition was first asserted." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (Encounter during which the condition was first asserted.) - */ - protected Encounter encounterTarget; - - /** - * Person who takes responsibility for asserting the existence of the condition as part of the electronic record. - */ - @Child(name = "asserter", type = {Practitioner.class, Patient.class}, order=3, min=0, max=1) - @Description(shortDefinition="Person who asserts this condition", formalDefinition="Person who takes responsibility for asserting the existence of the condition as part of the electronic record." ) - protected Reference asserter; - - /** - * The actual object that is the target of the reference (Person who takes responsibility for asserting the existence of the condition as part of the electronic record.) - */ - protected Resource asserterTarget; - - /** - * Estimated or actual date the condition/problem/diagnosis was first detected/suspected. - */ - @Child(name = "dateAsserted", type = {DateType.class}, order=4, min=0, max=1) - @Description(shortDefinition="When first detected/suspected/entered", formalDefinition="Estimated or actual date the condition/problem/diagnosis was first detected/suspected." ) - protected DateType dateAsserted; - - /** - * Identification of the condition, problem or diagnosis. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=5, min=1, max=1) - @Description(shortDefinition="Identification of the condition, problem or diagnosis", formalDefinition="Identification of the condition, problem or diagnosis." ) - protected CodeableConcept code; - - /** - * A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis. - */ - @Child(name = "category", type = {CodeableConcept.class}, order=6, min=0, max=1) - @Description(shortDefinition="E.g. complaint | symptom | finding | diagnosis", formalDefinition="A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis." ) - protected CodeableConcept category; - - /** - * The clinical status of the condition. - */ - @Child(name = "clinicalStatus", type = {CodeType.class}, order=7, min=1, max=1) - @Description(shortDefinition="provisional | working | confirmed | refuted | entered-in-error | unknown", formalDefinition="The clinical status of the condition." ) - protected Enumeration clinicalStatus; - - /** - * A subjective assessment of the severity of the condition as evaluated by the clinician. - */ - @Child(name = "severity", type = {CodeableConcept.class}, order=8, min=0, max=1) - @Description(shortDefinition="Subjective severity of condition", formalDefinition="A subjective assessment of the severity of the condition as evaluated by the clinician." ) - protected CodeableConcept severity; - - /** - * Estimated or actual date or date-time the condition began, in the opinion of the clinician. - */ - @Child(name = "onset", type = {DateTimeType.class, Age.class, Period.class, Range.class, StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Estimated or actual date, date-time, or age", formalDefinition="Estimated or actual date or date-time the condition began, in the opinion of the clinician." ) - protected Type onset; - - /** - * The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate. - */ - @Child(name = "abatement", type = {DateType.class, Age.class, BooleanType.class, Period.class, Range.class, StringType.class}, order=10, min=0, max=1) - @Description(shortDefinition="If/when in resolution/remission", formalDefinition="The date or estimated date that the condition resolved or went into remission. This is called 'abatement' because of the many overloaded connotations associated with 'remission' or 'resolution' - Conditions are never really resolved, but they can abate." ) - protected Type abatement; - - /** - * Clinical stage or grade of a condition. May include formal severity assessments. - */ - @Child(name = "stage", type = {}, order=11, min=0, max=1) - @Description(shortDefinition="Stage/grade, usually assessed formally", formalDefinition="Clinical stage or grade of a condition. May include formal severity assessments." ) - protected ConditionStageComponent stage; - - /** - * Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed. - */ - @Child(name = "evidence", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Supporting evidence", formalDefinition="Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed." ) - protected List evidence; - - /** - * The anatomical location where this condition manifests itself. - */ - @Child(name = "location", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Anatomical location, if relevant", formalDefinition="The anatomical location where this condition manifests itself." ) - protected List location; - - /** - * Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition. - */ - @Child(name = "dueTo", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Causes for this Condition", formalDefinition="Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition." ) - protected List dueTo; - - /** - * Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition. - */ - @Child(name = "occurredFollowing", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Precedent for this Condition", formalDefinition="Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition." ) - protected List occurredFollowing; - - /** - * Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis. - */ - @Child(name = "notes", type = {StringType.class}, order=16, min=0, max=1) - @Description(shortDefinition="Additional information about the Condition", formalDefinition="Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis." ) - protected StringType notes; - - private static final long serialVersionUID = -1018838673L; - - /* - * Constructor - */ - public Condition() { - super(); - } - - /* - * Constructor - */ - public Condition(Reference patient, CodeableConcept code, Enumeration clinicalStatus) { - super(); - this.patient = patient; - this.code = code; - this.clinicalStatus = clinicalStatus; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this condition that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this condition that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Condition addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #patient} (Indicates the patient who the condition record is associated with.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (Indicates the patient who the condition record is associated with.) - */ - public Condition setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates the patient who the condition record is associated with.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates the patient who the condition record is associated with.) - */ - public Condition setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #encounter} (Encounter during which the condition was first asserted.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (Encounter during which the condition was first asserted.) - */ - public Condition setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Encounter during which the condition was first asserted.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Encounter during which the condition was first asserted.) - */ - public Condition setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #asserter} (Person who takes responsibility for asserting the existence of the condition as part of the electronic record.) - */ - public Reference getAsserter() { - if (this.asserter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.asserter"); - else if (Configuration.doAutoCreate()) - this.asserter = new Reference(); // cc - return this.asserter; - } - - public boolean hasAsserter() { - return this.asserter != null && !this.asserter.isEmpty(); - } - - /** - * @param value {@link #asserter} (Person who takes responsibility for asserting the existence of the condition as part of the electronic record.) - */ - public Condition setAsserter(Reference value) { - this.asserter = value; - return this; - } - - /** - * @return {@link #asserter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Person who takes responsibility for asserting the existence of the condition as part of the electronic record.) - */ - public Resource getAsserterTarget() { - return this.asserterTarget; - } - - /** - * @param value {@link #asserter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Person who takes responsibility for asserting the existence of the condition as part of the electronic record.) - */ - public Condition setAsserterTarget(Resource value) { - this.asserterTarget = value; - return this; - } - - /** - * @return {@link #dateAsserted} (Estimated or actual date the condition/problem/diagnosis was first detected/suspected.). This is the underlying object with id, value and extensions. The accessor "getDateAsserted" gives direct access to the value - */ - public DateType getDateAssertedElement() { - if (this.dateAsserted == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.dateAsserted"); - else if (Configuration.doAutoCreate()) - this.dateAsserted = new DateType(); // bb - return this.dateAsserted; - } - - public boolean hasDateAssertedElement() { - return this.dateAsserted != null && !this.dateAsserted.isEmpty(); - } - - public boolean hasDateAsserted() { - return this.dateAsserted != null && !this.dateAsserted.isEmpty(); - } - - /** - * @param value {@link #dateAsserted} (Estimated or actual date the condition/problem/diagnosis was first detected/suspected.). This is the underlying object with id, value and extensions. The accessor "getDateAsserted" gives direct access to the value - */ - public Condition setDateAssertedElement(DateType value) { - this.dateAsserted = value; - return this; - } - - /** - * @return Estimated or actual date the condition/problem/diagnosis was first detected/suspected. - */ - public Date getDateAsserted() { - return this.dateAsserted == null ? null : this.dateAsserted.getValue(); - } - - /** - * @param value Estimated or actual date the condition/problem/diagnosis was first detected/suspected. - */ - public Condition setDateAsserted(Date value) { - if (value == null) - this.dateAsserted = null; - else { - if (this.dateAsserted == null) - this.dateAsserted = new DateType(); - this.dateAsserted.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (Identification of the condition, problem or diagnosis.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Identification of the condition, problem or diagnosis.) - */ - public Condition setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #category} (A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis.) - */ - public CodeableConcept getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.category"); - else if (Configuration.doAutoCreate()) - this.category = new CodeableConcept(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis.) - */ - public Condition setCategory(CodeableConcept value) { - this.category = value; - return this; - } - - /** - * @return {@link #clinicalStatus} (The clinical status of the condition.). This is the underlying object with id, value and extensions. The accessor "getClinicalStatus" gives direct access to the value - */ - public Enumeration getClinicalStatusElement() { - if (this.clinicalStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.clinicalStatus"); - else if (Configuration.doAutoCreate()) - this.clinicalStatus = new Enumeration(new ConditionStatusEnumFactory()); // bb - return this.clinicalStatus; - } - - public boolean hasClinicalStatusElement() { - return this.clinicalStatus != null && !this.clinicalStatus.isEmpty(); - } - - public boolean hasClinicalStatus() { - return this.clinicalStatus != null && !this.clinicalStatus.isEmpty(); - } - - /** - * @param value {@link #clinicalStatus} (The clinical status of the condition.). This is the underlying object with id, value and extensions. The accessor "getClinicalStatus" gives direct access to the value - */ - public Condition setClinicalStatusElement(Enumeration value) { - this.clinicalStatus = value; - return this; - } - - /** - * @return The clinical status of the condition. - */ - public ConditionStatus getClinicalStatus() { - return this.clinicalStatus == null ? null : this.clinicalStatus.getValue(); - } - - /** - * @param value The clinical status of the condition. - */ - public Condition setClinicalStatus(ConditionStatus value) { - if (this.clinicalStatus == null) - this.clinicalStatus = new Enumeration(new ConditionStatusEnumFactory()); - this.clinicalStatus.setValue(value); - return this; - } - - /** - * @return {@link #severity} (A subjective assessment of the severity of the condition as evaluated by the clinician.) - */ - public CodeableConcept getSeverity() { - if (this.severity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.severity"); - else if (Configuration.doAutoCreate()) - this.severity = new CodeableConcept(); // cc - return this.severity; - } - - public boolean hasSeverity() { - return this.severity != null && !this.severity.isEmpty(); - } - - /** - * @param value {@link #severity} (A subjective assessment of the severity of the condition as evaluated by the clinician.) - */ - public Condition setSeverity(CodeableConcept value) { - this.severity = value; - return this; - } - - /** - * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) - */ - public Type getOnset() { - return this.onset; - } - - /** - * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) - */ - public DateTimeType getOnsetDateTimeType() throws Exception { - if (!(this.onset instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (DateTimeType) this.onset; - } - - /** - * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) - */ - public Age getOnsetAge() throws Exception { - if (!(this.onset instanceof Age)) - throw new Exception("Type mismatch: the type Age was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (Age) this.onset; - } - - /** - * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) - */ - public Period getOnsetPeriod() throws Exception { - if (!(this.onset instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (Period) this.onset; - } - - /** - * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) - */ - public Range getOnsetRange() throws Exception { - if (!(this.onset instanceof Range)) - throw new Exception("Type mismatch: the type Range was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (Range) this.onset; - } - - /** - * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) - */ - public StringType getOnsetStringType() throws Exception { - if (!(this.onset instanceof StringType)) - throw new Exception("Type mismatch: the type StringType was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (StringType) this.onset; - } - - public boolean hasOnset() { - return this.onset != null && !this.onset.isEmpty(); - } - - /** - * @param value {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) - */ - public Condition setOnset(Type value) { - this.onset = value; - return this; - } - - /** - * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) - */ - public Type getAbatement() { - return this.abatement; - } - - /** - * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) - */ - public DateType getAbatementDateType() throws Exception { - if (!(this.abatement instanceof DateType)) - throw new Exception("Type mismatch: the type DateType was expected, but "+this.abatement.getClass().getName()+" was encountered"); - return (DateType) this.abatement; - } - - /** - * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) - */ - public Age getAbatementAge() throws Exception { - if (!(this.abatement instanceof Age)) - throw new Exception("Type mismatch: the type Age was expected, but "+this.abatement.getClass().getName()+" was encountered"); - return (Age) this.abatement; - } - - /** - * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) - */ - public BooleanType getAbatementBooleanType() throws Exception { - if (!(this.abatement instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.abatement.getClass().getName()+" was encountered"); - return (BooleanType) this.abatement; - } - - /** - * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) - */ - public Period getAbatementPeriod() throws Exception { - if (!(this.abatement instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.abatement.getClass().getName()+" was encountered"); - return (Period) this.abatement; - } - - /** - * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) - */ - public Range getAbatementRange() throws Exception { - if (!(this.abatement instanceof Range)) - throw new Exception("Type mismatch: the type Range was expected, but "+this.abatement.getClass().getName()+" was encountered"); - return (Range) this.abatement; - } - - /** - * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) - */ - public StringType getAbatementStringType() throws Exception { - if (!(this.abatement instanceof StringType)) - throw new Exception("Type mismatch: the type StringType was expected, but "+this.abatement.getClass().getName()+" was encountered"); - return (StringType) this.abatement; - } - - public boolean hasAbatement() { - return this.abatement != null && !this.abatement.isEmpty(); - } - - /** - * @param value {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) - */ - public Condition setAbatement(Type value) { - this.abatement = value; - return this; - } - - /** - * @return {@link #stage} (Clinical stage or grade of a condition. May include formal severity assessments.) - */ - public ConditionStageComponent getStage() { - if (this.stage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.stage"); - else if (Configuration.doAutoCreate()) - this.stage = new ConditionStageComponent(); // cc - return this.stage; - } - - public boolean hasStage() { - return this.stage != null && !this.stage.isEmpty(); - } - - /** - * @param value {@link #stage} (Clinical stage or grade of a condition. May include formal severity assessments.) - */ - public Condition setStage(ConditionStageComponent value) { - this.stage = value; - return this; - } - - /** - * @return {@link #evidence} (Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.) - */ - public List getEvidence() { - if (this.evidence == null) - this.evidence = new ArrayList(); - return this.evidence; - } - - public boolean hasEvidence() { - if (this.evidence == null) - return false; - for (ConditionEvidenceComponent item : this.evidence) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #evidence} (Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.) - */ - // syntactic sugar - public ConditionEvidenceComponent addEvidence() { //3 - ConditionEvidenceComponent t = new ConditionEvidenceComponent(); - if (this.evidence == null) - this.evidence = new ArrayList(); - this.evidence.add(t); - return t; - } - - // syntactic sugar - public Condition addEvidence(ConditionEvidenceComponent t) { //3 - if (t == null) - return this; - if (this.evidence == null) - this.evidence = new ArrayList(); - this.evidence.add(t); - return this; - } - - /** - * @return {@link #location} (The anatomical location where this condition manifests itself.) - */ - public List getLocation() { - if (this.location == null) - this.location = new ArrayList(); - return this.location; - } - - public boolean hasLocation() { - if (this.location == null) - return false; - for (ConditionLocationComponent item : this.location) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #location} (The anatomical location where this condition manifests itself.) - */ - // syntactic sugar - public ConditionLocationComponent addLocation() { //3 - ConditionLocationComponent t = new ConditionLocationComponent(); - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return t; - } - - // syntactic sugar - public Condition addLocation(ConditionLocationComponent t) { //3 - if (t == null) - return this; - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return this; - } - - /** - * @return {@link #dueTo} (Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition.) - */ - public List getDueTo() { - if (this.dueTo == null) - this.dueTo = new ArrayList(); - return this.dueTo; - } - - public boolean hasDueTo() { - if (this.dueTo == null) - return false; - for (ConditionDueToComponent item : this.dueTo) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dueTo} (Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition.) - */ - // syntactic sugar - public ConditionDueToComponent addDueTo() { //3 - ConditionDueToComponent t = new ConditionDueToComponent(); - if (this.dueTo == null) - this.dueTo = new ArrayList(); - this.dueTo.add(t); - return t; - } - - // syntactic sugar - public Condition addDueTo(ConditionDueToComponent t) { //3 - if (t == null) - return this; - if (this.dueTo == null) - this.dueTo = new ArrayList(); - this.dueTo.add(t); - return this; - } - - /** - * @return {@link #occurredFollowing} (Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition.) - */ - public List getOccurredFollowing() { - if (this.occurredFollowing == null) - this.occurredFollowing = new ArrayList(); - return this.occurredFollowing; - } - - public boolean hasOccurredFollowing() { - if (this.occurredFollowing == null) - return false; - for (ConditionOccurredFollowingComponent item : this.occurredFollowing) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #occurredFollowing} (Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition.) - */ - // syntactic sugar - public ConditionOccurredFollowingComponent addOccurredFollowing() { //3 - ConditionOccurredFollowingComponent t = new ConditionOccurredFollowingComponent(); - if (this.occurredFollowing == null) - this.occurredFollowing = new ArrayList(); - this.occurredFollowing.add(t); - return t; - } - - // syntactic sugar - public Condition addOccurredFollowing(ConditionOccurredFollowingComponent t) { //3 - if (t == null) - return this; - if (this.occurredFollowing == null) - this.occurredFollowing = new ArrayList(); - this.occurredFollowing.add(t); - return this; - } - - /** - * @return {@link #notes} (Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public StringType getNotesElement() { - if (this.notes == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.notes"); - else if (Configuration.doAutoCreate()) - this.notes = new StringType(); // bb - return this.notes; - } - - public boolean hasNotesElement() { - return this.notes != null && !this.notes.isEmpty(); - } - - public boolean hasNotes() { - return this.notes != null && !this.notes.isEmpty(); - } - - /** - * @param value {@link #notes} (Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public Condition setNotesElement(StringType value) { - this.notes = value; - return this; - } - - /** - * @return Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis. - */ - public String getNotes() { - return this.notes == null ? null : this.notes.getValue(); - } - - /** - * @param value Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis. - */ - public Condition setNotes(String value) { - if (Utilities.noString(value)) - this.notes = null; - else { - if (this.notes == null) - this.notes = new StringType(); - this.notes.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this condition that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("patient", "Reference(Patient)", "Indicates the patient who the condition record is associated with.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "Encounter during which the condition was first asserted.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("asserter", "Reference(Practitioner|Patient)", "Person who takes responsibility for asserting the existence of the condition as part of the electronic record.", 0, java.lang.Integer.MAX_VALUE, asserter)); - childrenList.add(new Property("dateAsserted", "date", "Estimated or actual date the condition/problem/diagnosis was first detected/suspected.", 0, java.lang.Integer.MAX_VALUE, dateAsserted)); - childrenList.add(new Property("code", "CodeableConcept", "Identification of the condition, problem or diagnosis.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("category", "CodeableConcept", "A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("clinicalStatus", "code", "The clinical status of the condition.", 0, java.lang.Integer.MAX_VALUE, clinicalStatus)); - childrenList.add(new Property("severity", "CodeableConcept", "A subjective assessment of the severity of the condition as evaluated by the clinician.", 0, java.lang.Integer.MAX_VALUE, severity)); - childrenList.add(new Property("onset[x]", "dateTime|Age|Period|Range|string", "Estimated or actual date or date-time the condition began, in the opinion of the clinician.", 0, java.lang.Integer.MAX_VALUE, onset)); - childrenList.add(new Property("abatement[x]", "date|Age|boolean|Period|Range|string", "The date or estimated date that the condition resolved or went into remission. This is called 'abatement' because of the many overloaded connotations associated with 'remission' or 'resolution' - Conditions are never really resolved, but they can abate.", 0, java.lang.Integer.MAX_VALUE, abatement)); - childrenList.add(new Property("stage", "", "Clinical stage or grade of a condition. May include formal severity assessments.", 0, java.lang.Integer.MAX_VALUE, stage)); - childrenList.add(new Property("evidence", "", "Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.", 0, java.lang.Integer.MAX_VALUE, evidence)); - childrenList.add(new Property("location", "", "The anatomical location where this condition manifests itself.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("dueTo", "", "Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition.", 0, java.lang.Integer.MAX_VALUE, dueTo)); - childrenList.add(new Property("occurredFollowing", "", "Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition.", 0, java.lang.Integer.MAX_VALUE, occurredFollowing)); - childrenList.add(new Property("notes", "string", "Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis.", 0, java.lang.Integer.MAX_VALUE, notes)); - } - - public Condition copy() { - Condition dst = new Condition(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.asserter = asserter == null ? null : asserter.copy(); - dst.dateAsserted = dateAsserted == null ? null : dateAsserted.copy(); - dst.code = code == null ? null : code.copy(); - dst.category = category == null ? null : category.copy(); - dst.clinicalStatus = clinicalStatus == null ? null : clinicalStatus.copy(); - dst.severity = severity == null ? null : severity.copy(); - dst.onset = onset == null ? null : onset.copy(); - dst.abatement = abatement == null ? null : abatement.copy(); - dst.stage = stage == null ? null : stage.copy(); - if (evidence != null) { - dst.evidence = new ArrayList(); - for (ConditionEvidenceComponent i : evidence) - dst.evidence.add(i.copy()); - }; - if (location != null) { - dst.location = new ArrayList(); - for (ConditionLocationComponent i : location) - dst.location.add(i.copy()); - }; - if (dueTo != null) { - dst.dueTo = new ArrayList(); - for (ConditionDueToComponent i : dueTo) - dst.dueTo.add(i.copy()); - }; - if (occurredFollowing != null) { - dst.occurredFollowing = new ArrayList(); - for (ConditionOccurredFollowingComponent i : occurredFollowing) - dst.occurredFollowing.add(i.copy()); - }; - dst.notes = notes == null ? null : notes.copy(); - return dst; - } - - protected Condition typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Condition)) - return false; - Condition o = (Condition) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(encounter, o.encounter, true) - && compareDeep(asserter, o.asserter, true) && compareDeep(dateAsserted, o.dateAsserted, true) && compareDeep(code, o.code, true) - && compareDeep(category, o.category, true) && compareDeep(clinicalStatus, o.clinicalStatus, true) - && compareDeep(severity, o.severity, true) && compareDeep(onset, o.onset, true) && compareDeep(abatement, o.abatement, true) - && compareDeep(stage, o.stage, true) && compareDeep(evidence, o.evidence, true) && compareDeep(location, o.location, true) - && compareDeep(dueTo, o.dueTo, true) && compareDeep(occurredFollowing, o.occurredFollowing, true) - && compareDeep(notes, o.notes, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Condition)) - return false; - Condition o = (Condition) other; - return compareValues(dateAsserted, o.dateAsserted, true) && compareValues(clinicalStatus, o.clinicalStatus, true) - && compareValues(notes, o.notes, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (asserter == null || asserter.isEmpty()) - && (dateAsserted == null || dateAsserted.isEmpty()) && (code == null || code.isEmpty()) && (category == null || category.isEmpty()) - && (clinicalStatus == null || clinicalStatus.isEmpty()) && (severity == null || severity.isEmpty()) - && (onset == null || onset.isEmpty()) && (abatement == null || abatement.isEmpty()) && (stage == null || stage.isEmpty()) - && (evidence == null || evidence.isEmpty()) && (location == null || location.isEmpty()) && (dueTo == null || dueTo.isEmpty()) - && (occurredFollowing == null || occurredFollowing.isEmpty()) && (notes == null || notes.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Condition; - } - - @SearchParamDefinition(name="asserter", path="Condition.asserter", description="Person who asserts this condition", type="reference" ) - public static final String SP_ASSERTER = "asserter"; - @SearchParamDefinition(name="following-code", path="Condition.occurredFollowing.code", description="Relationship target by means of a predefined code", type="token" ) - public static final String SP_FOLLOWINGCODE = "following-code"; - @SearchParamDefinition(name="dueto-code", path="Condition.dueTo.code", description="Relationship target by means of a predefined code", type="token" ) - public static final String SP_DUETOCODE = "dueto-code"; - @SearchParamDefinition(name="location", path="Condition.location.site[x]", description="Location - may include laterality", type="token" ) - public static final String SP_LOCATION = "location"; - @SearchParamDefinition(name="subject", path="Condition.patient", description="Who has the condition?", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="onset", path="Condition.onset[x]", description="Date related onsets (dateTime and Period)", type="date" ) - public static final String SP_ONSET = "onset"; - @SearchParamDefinition(name="evidence", path="Condition.evidence.code", description="Manifestation/symptom", type="token" ) - public static final String SP_EVIDENCE = "evidence"; - @SearchParamDefinition(name="onset-info", path="Condition.onset[x]", description="Other onsets (boolean, age, range, string)", type="string" ) - public static final String SP_ONSETINFO = "onset-info"; - @SearchParamDefinition(name="following-item", path="Condition.occurredFollowing.target", description="Relationship target resource", type="reference" ) - public static final String SP_FOLLOWINGITEM = "following-item"; - @SearchParamDefinition(name="severity", path="Condition.severity", description="The severity of the condition", type="token" ) - public static final String SP_SEVERITY = "severity"; - @SearchParamDefinition(name="code", path="Condition.code", description="Code for the condition", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="encounter", path="Condition.encounter", description="Encounter when condition first asserted", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - @SearchParamDefinition(name="date-asserted", path="Condition.dateAsserted", description="When first detected/suspected/entered", type="date" ) - public static final String SP_DATEASSERTED = "date-asserted"; - @SearchParamDefinition(name="stage", path="Condition.stage.summary", description="Simple summary (disease specific)", type="token" ) - public static final String SP_STAGE = "stage"; - @SearchParamDefinition(name="category", path="Condition.category", description="The category of the condition", type="token" ) - public static final String SP_CATEGORY = "category"; - @SearchParamDefinition(name="patient", path="Condition.patient", description="Who has the condition?", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="dueto-item", path="Condition.dueTo.target", description="Relationship target resource", type="reference" ) - public static final String SP_DUETOITEM = "dueto-item"; - @SearchParamDefinition(name="clinicalstatus", path="Condition.clinicalStatus", description="The clinical status of the condition", type="token" ) - public static final String SP_CLINICALSTATUS = "clinicalstatus"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary. + */ +@ResourceDef(name="Condition", profile="http://hl7.org/fhir/Profile/Condition") +public class Condition extends DomainResource { + + public enum ConditionStatus { + /** + * This is a tentative diagnosis - still a candidate that is under consideration. + */ + PROVISIONAL, + /** + * The patient is being treated on the basis that this is the condition, but it is still not confirmed. + */ + WORKING, + /** + * There is sufficient diagnostic and/or clinical evidence to treat this as a confirmed condition. + */ + CONFIRMED, + /** + * This condition has been ruled out by diagnostic and clinical evidence. + */ + REFUTED, + /** + * The statement was entered in error and Is not valid. + */ + ENTEREDINERROR, + /** + * The condition status is unknown. Note that "unknown" is a value of last resort and every attempt should be made to provide a meaningful value other than "unknown". + */ + UNKNOWN, + /** + * added to help the parsers + */ + NULL; + public static ConditionStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("provisional".equals(codeString)) + return PROVISIONAL; + if ("working".equals(codeString)) + return WORKING; + if ("confirmed".equals(codeString)) + return CONFIRMED; + if ("refuted".equals(codeString)) + return REFUTED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + if ("unknown".equals(codeString)) + return UNKNOWN; + throw new Exception("Unknown ConditionStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROVISIONAL: return "provisional"; + case WORKING: return "working"; + case CONFIRMED: return "confirmed"; + case REFUTED: return "refuted"; + case ENTEREDINERROR: return "entered-in-error"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROVISIONAL: return ""; + case WORKING: return ""; + case CONFIRMED: return ""; + case REFUTED: return ""; + case ENTEREDINERROR: return ""; + case UNKNOWN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROVISIONAL: return "This is a tentative diagnosis - still a candidate that is under consideration."; + case WORKING: return "The patient is being treated on the basis that this is the condition, but it is still not confirmed."; + case CONFIRMED: return "There is sufficient diagnostic and/or clinical evidence to treat this as a confirmed condition."; + case REFUTED: return "This condition has been ruled out by diagnostic and clinical evidence."; + case ENTEREDINERROR: return "The statement was entered in error and Is not valid."; + case UNKNOWN: return "The condition status is unknown. Note that 'unknown' is a value of last resort and every attempt should be made to provide a meaningful value other than 'unknown'."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROVISIONAL: return "Provisional"; + case WORKING: return "Working"; + case CONFIRMED: return "Confirmed"; + case REFUTED: return "Refuted"; + case ENTEREDINERROR: return "Entered In Error"; + case UNKNOWN: return "Unknown"; + default: return "?"; + } + } + } + + public static class ConditionStatusEnumFactory implements EnumFactory { + public ConditionStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("provisional".equals(codeString)) + return ConditionStatus.PROVISIONAL; + if ("working".equals(codeString)) + return ConditionStatus.WORKING; + if ("confirmed".equals(codeString)) + return ConditionStatus.CONFIRMED; + if ("refuted".equals(codeString)) + return ConditionStatus.REFUTED; + if ("entered-in-error".equals(codeString)) + return ConditionStatus.ENTEREDINERROR; + if ("unknown".equals(codeString)) + return ConditionStatus.UNKNOWN; + throw new IllegalArgumentException("Unknown ConditionStatus code '"+codeString+"'"); + } + public String toCode(ConditionStatus code) { + if (code == ConditionStatus.PROVISIONAL) + return "provisional"; + if (code == ConditionStatus.WORKING) + return "working"; + if (code == ConditionStatus.CONFIRMED) + return "confirmed"; + if (code == ConditionStatus.REFUTED) + return "refuted"; + if (code == ConditionStatus.ENTEREDINERROR) + return "entered-in-error"; + if (code == ConditionStatus.UNKNOWN) + return "unknown"; + return "?"; + } + } + + @Block() + public static class ConditionStageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific. + */ + @Child(name = "summary", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Simple summary (disease specific)", formalDefinition="A simple summary of the stage such as 'Stage 3'. The determination of the stage is disease-specific." ) + protected CodeableConcept summary; + + /** + * Reference to a formal record of the evidence on which the staging assessment is based. + */ + @Child(name = "assessment", type = {ClinicalImpression.class, DiagnosticReport.class, Observation.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Formal record of assessment", formalDefinition="Reference to a formal record of the evidence on which the staging assessment is based." ) + protected List assessment; + /** + * The actual objects that are the target of the reference (Reference to a formal record of the evidence on which the staging assessment is based.) + */ + protected List assessmentTarget; + + + private static final long serialVersionUID = -1961530405L; + + /* + * Constructor + */ + public ConditionStageComponent() { + super(); + } + + /** + * @return {@link #summary} (A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific.) + */ + public CodeableConcept getSummary() { + if (this.summary == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConditionStageComponent.summary"); + else if (Configuration.doAutoCreate()) + this.summary = new CodeableConcept(); // cc + return this.summary; + } + + public boolean hasSummary() { + return this.summary != null && !this.summary.isEmpty(); + } + + /** + * @param value {@link #summary} (A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific.) + */ + public ConditionStageComponent setSummary(CodeableConcept value) { + this.summary = value; + return this; + } + + /** + * @return {@link #assessment} (Reference to a formal record of the evidence on which the staging assessment is based.) + */ + public List getAssessment() { + if (this.assessment == null) + this.assessment = new ArrayList(); + return this.assessment; + } + + public boolean hasAssessment() { + if (this.assessment == null) + return false; + for (Reference item : this.assessment) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #assessment} (Reference to a formal record of the evidence on which the staging assessment is based.) + */ + // syntactic sugar + public Reference addAssessment() { //3 + Reference t = new Reference(); + if (this.assessment == null) + this.assessment = new ArrayList(); + this.assessment.add(t); + return t; + } + + // syntactic sugar + public ConditionStageComponent addAssessment(Reference t) { //3 + if (t == null) + return this; + if (this.assessment == null) + this.assessment = new ArrayList(); + this.assessment.add(t); + return this; + } + + /** + * @return {@link #assessment} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Reference to a formal record of the evidence on which the staging assessment is based.) + */ + public List getAssessmentTarget() { + if (this.assessmentTarget == null) + this.assessmentTarget = new ArrayList(); + return this.assessmentTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("summary", "CodeableConcept", "A simple summary of the stage such as 'Stage 3'. The determination of the stage is disease-specific.", 0, java.lang.Integer.MAX_VALUE, summary)); + childrenList.add(new Property("assessment", "Reference(ClinicalImpression|DiagnosticReport|Observation)", "Reference to a formal record of the evidence on which the staging assessment is based.", 0, java.lang.Integer.MAX_VALUE, assessment)); + } + + public ConditionStageComponent copy() { + ConditionStageComponent dst = new ConditionStageComponent(); + copyValues(dst); + dst.summary = summary == null ? null : summary.copy(); + if (assessment != null) { + dst.assessment = new ArrayList(); + for (Reference i : assessment) + dst.assessment.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConditionStageComponent)) + return false; + ConditionStageComponent o = (ConditionStageComponent) other; + return compareDeep(summary, o.summary, true) && compareDeep(assessment, o.assessment, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConditionStageComponent)) + return false; + ConditionStageComponent o = (ConditionStageComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (summary == null || summary.isEmpty()) && (assessment == null || assessment.isEmpty()) + ; + } + + } + + @Block() + public static class ConditionEvidenceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A manifestation or symptom that led to the recording of this condition. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Manifestation/symptom", formalDefinition="A manifestation or symptom that led to the recording of this condition." ) + protected CodeableConcept code; + + /** + * Links to other relevant information, including pathology reports. + */ + @Child(name = "detail", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Supporting information found elsewhere", formalDefinition="Links to other relevant information, including pathology reports." ) + protected List detail; + /** + * The actual objects that are the target of the reference (Links to other relevant information, including pathology reports.) + */ + protected List detailTarget; + + + private static final long serialVersionUID = 945689926L; + + /* + * Constructor + */ + public ConditionEvidenceComponent() { + super(); + } + + /** + * @return {@link #code} (A manifestation or symptom that led to the recording of this condition.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConditionEvidenceComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A manifestation or symptom that led to the recording of this condition.) + */ + public ConditionEvidenceComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #detail} (Links to other relevant information, including pathology reports.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (Reference item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (Links to other relevant information, including pathology reports.) + */ + // syntactic sugar + public Reference addDetail() { //3 + Reference t = new Reference(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + // syntactic sugar + public ConditionEvidenceComponent addDetail(Reference t) { //3 + if (t == null) + return this; + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return this; + } + + /** + * @return {@link #detail} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Links to other relevant information, including pathology reports.) + */ + public List getDetailTarget() { + if (this.detailTarget == null) + this.detailTarget = new ArrayList(); + return this.detailTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "A manifestation or symptom that led to the recording of this condition.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("detail", "Reference(Any)", "Links to other relevant information, including pathology reports.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public ConditionEvidenceComponent copy() { + ConditionEvidenceComponent dst = new ConditionEvidenceComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + if (detail != null) { + dst.detail = new ArrayList(); + for (Reference i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConditionEvidenceComponent)) + return false; + ConditionEvidenceComponent o = (ConditionEvidenceComponent) other; + return compareDeep(code, o.code, true) && compareDeep(detail, o.detail, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConditionEvidenceComponent)) + return false; + ConditionEvidenceComponent o = (ConditionEvidenceComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (detail == null || detail.isEmpty()) + ; + } + + } + + @Block() + public static class ConditionLocationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code that identifies the structural location. + */ + @Child(name = "site", type = {CodeableConcept.class, BodySite.class}, order=1, min=0, max=1) + @Description(shortDefinition="Location - may include laterality", formalDefinition="Code that identifies the structural location." ) + protected Type site; + + private static final long serialVersionUID = 1429072605L; + + /* + * Constructor + */ + public ConditionLocationComponent() { + super(); + } + + /** + * @return {@link #site} (Code that identifies the structural location.) + */ + public Type getSite() { + return this.site; + } + + /** + * @return {@link #site} (Code that identifies the structural location.) + */ + public CodeableConcept getSiteCodeableConcept() throws Exception { + if (!(this.site instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.site.getClass().getName()+" was encountered"); + return (CodeableConcept) this.site; + } + + /** + * @return {@link #site} (Code that identifies the structural location.) + */ + public Reference getSiteReference() throws Exception { + if (!(this.site instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.site.getClass().getName()+" was encountered"); + return (Reference) this.site; + } + + public boolean hasSite() { + return this.site != null && !this.site.isEmpty(); + } + + /** + * @param value {@link #site} (Code that identifies the structural location.) + */ + public ConditionLocationComponent setSite(Type value) { + this.site = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("site[x]", "CodeableConcept|Reference(BodySite)", "Code that identifies the structural location.", 0, java.lang.Integer.MAX_VALUE, site)); + } + + public ConditionLocationComponent copy() { + ConditionLocationComponent dst = new ConditionLocationComponent(); + copyValues(dst); + dst.site = site == null ? null : site.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConditionLocationComponent)) + return false; + ConditionLocationComponent o = (ConditionLocationComponent) other; + return compareDeep(site, o.site, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConditionLocationComponent)) + return false; + ConditionLocationComponent o = (ConditionLocationComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (site == null || site.isEmpty()); + } + + } + + @Block() + public static class ConditionDueToComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code that identifies the target of this relationship. The code takes the place of a detailed instance target. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Relationship target by means of a predefined code", formalDefinition="Code that identifies the target of this relationship. The code takes the place of a detailed instance target." ) + protected CodeableConcept code; + + /** + * Target of the relationship. + */ + @Child(name = "target", type = {Condition.class, Procedure.class, MedicationAdministration.class, Immunization.class, MedicationStatement.class}, order=2, min=0, max=1) + @Description(shortDefinition="Relationship target resource", formalDefinition="Target of the relationship." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (Target of the relationship.) + */ + protected Resource targetTarget; + + private static final long serialVersionUID = -660755940L; + + /* + * Constructor + */ + public ConditionDueToComponent() { + super(); + } + + /** + * @return {@link #code} (Code that identifies the target of this relationship. The code takes the place of a detailed instance target.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConditionDueToComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code that identifies the target of this relationship. The code takes the place of a detailed instance target.) + */ + public ConditionDueToComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #target} (Target of the relationship.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConditionDueToComponent.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); // cc + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Target of the relationship.) + */ + public ConditionDueToComponent 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. (Target of the relationship.) + */ + public Resource getTargetTarget() { + return this.targetTarget; + } + + /** + * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Target of the relationship.) + */ + public ConditionDueToComponent setTargetTarget(Resource value) { + this.targetTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "Code that identifies the target of this relationship. The code takes the place of a detailed instance target.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("target", "Reference(Condition|Procedure|MedicationAdministration|Immunization|MedicationStatement)", "Target of the relationship.", 0, java.lang.Integer.MAX_VALUE, target)); + } + + public ConditionDueToComponent copy() { + ConditionDueToComponent dst = new ConditionDueToComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.target = target == null ? null : target.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConditionDueToComponent)) + return false; + ConditionDueToComponent o = (ConditionDueToComponent) other; + return compareDeep(code, o.code, true) && compareDeep(target, o.target, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConditionDueToComponent)) + return false; + ConditionDueToComponent o = (ConditionDueToComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (target == null || target.isEmpty()) + ; + } + + } + + @Block() + public static class ConditionOccurredFollowingComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code that identifies the target of this relationship. The code takes the place of a detailed instance target. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Relationship target by means of a predefined code", formalDefinition="Code that identifies the target of this relationship. The code takes the place of a detailed instance target." ) + protected CodeableConcept code; + + /** + * Target of the relationship. + */ + @Child(name = "target", type = {Condition.class, Procedure.class, MedicationAdministration.class, Immunization.class, MedicationStatement.class}, order=2, min=0, max=1) + @Description(shortDefinition="Relationship target resource", formalDefinition="Target of the relationship." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (Target of the relationship.) + */ + protected Resource targetTarget; + + private static final long serialVersionUID = -660755940L; + + /* + * Constructor + */ + public ConditionOccurredFollowingComponent() { + super(); + } + + /** + * @return {@link #code} (Code that identifies the target of this relationship. The code takes the place of a detailed instance target.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConditionOccurredFollowingComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code that identifies the target of this relationship. The code takes the place of a detailed instance target.) + */ + public ConditionOccurredFollowingComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #target} (Target of the relationship.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConditionOccurredFollowingComponent.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); // cc + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Target of the relationship.) + */ + public ConditionOccurredFollowingComponent 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. (Target of the relationship.) + */ + public Resource getTargetTarget() { + return this.targetTarget; + } + + /** + * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Target of the relationship.) + */ + public ConditionOccurredFollowingComponent setTargetTarget(Resource value) { + this.targetTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "Code that identifies the target of this relationship. The code takes the place of a detailed instance target.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("target", "Reference(Condition|Procedure|MedicationAdministration|Immunization|MedicationStatement)", "Target of the relationship.", 0, java.lang.Integer.MAX_VALUE, target)); + } + + public ConditionOccurredFollowingComponent copy() { + ConditionOccurredFollowingComponent dst = new ConditionOccurredFollowingComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.target = target == null ? null : target.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConditionOccurredFollowingComponent)) + return false; + ConditionOccurredFollowingComponent o = (ConditionOccurredFollowingComponent) other; + return compareDeep(code, o.code, true) && compareDeep(target, o.target, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConditionOccurredFollowingComponent)) + return false; + ConditionOccurredFollowingComponent o = (ConditionOccurredFollowingComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (target == null || target.isEmpty()) + ; + } + + } + + /** + * This records identifiers associated with this condition that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Ids for this condition", formalDefinition="This records identifiers associated with this condition that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) + protected List identifier; + + /** + * Indicates the patient who the condition record is associated with. + */ + @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1) + @Description(shortDefinition="Who has the condition?", formalDefinition="Indicates the patient who the condition record is associated with." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Indicates the patient who the condition record is associated with.) + */ + protected Patient patientTarget; + + /** + * Encounter during which the condition was first asserted. + */ + @Child(name = "encounter", type = {Encounter.class}, order=2, min=0, max=1) + @Description(shortDefinition="Encounter when condition first asserted", formalDefinition="Encounter during which the condition was first asserted." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (Encounter during which the condition was first asserted.) + */ + protected Encounter encounterTarget; + + /** + * Person who takes responsibility for asserting the existence of the condition as part of the electronic record. + */ + @Child(name = "asserter", type = {Practitioner.class, Patient.class}, order=3, min=0, max=1) + @Description(shortDefinition="Person who asserts this condition", formalDefinition="Person who takes responsibility for asserting the existence of the condition as part of the electronic record." ) + protected Reference asserter; + + /** + * The actual object that is the target of the reference (Person who takes responsibility for asserting the existence of the condition as part of the electronic record.) + */ + protected Resource asserterTarget; + + /** + * Estimated or actual date the condition/problem/diagnosis was first detected/suspected. + */ + @Child(name = "dateAsserted", type = {DateType.class}, order=4, min=0, max=1) + @Description(shortDefinition="When first detected/suspected/entered", formalDefinition="Estimated or actual date the condition/problem/diagnosis was first detected/suspected." ) + protected DateType dateAsserted; + + /** + * Identification of the condition, problem or diagnosis. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=5, min=1, max=1) + @Description(shortDefinition="Identification of the condition, problem or diagnosis", formalDefinition="Identification of the condition, problem or diagnosis." ) + protected CodeableConcept code; + + /** + * A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis. + */ + @Child(name = "category", type = {CodeableConcept.class}, order=6, min=0, max=1) + @Description(shortDefinition="E.g. complaint | symptom | finding | diagnosis", formalDefinition="A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis." ) + protected CodeableConcept category; + + /** + * The clinical status of the condition. + */ + @Child(name = "clinicalStatus", type = {CodeType.class}, order=7, min=1, max=1) + @Description(shortDefinition="provisional | working | confirmed | refuted | entered-in-error | unknown", formalDefinition="The clinical status of the condition." ) + protected Enumeration clinicalStatus; + + /** + * A subjective assessment of the severity of the condition as evaluated by the clinician. + */ + @Child(name = "severity", type = {CodeableConcept.class}, order=8, min=0, max=1) + @Description(shortDefinition="Subjective severity of condition", formalDefinition="A subjective assessment of the severity of the condition as evaluated by the clinician." ) + protected CodeableConcept severity; + + /** + * Estimated or actual date or date-time the condition began, in the opinion of the clinician. + */ + @Child(name = "onset", type = {DateTimeType.class, Age.class, Period.class, Range.class, StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Estimated or actual date, date-time, or age", formalDefinition="Estimated or actual date or date-time the condition began, in the opinion of the clinician." ) + protected Type onset; + + /** + * The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate. + */ + @Child(name = "abatement", type = {DateType.class, Age.class, BooleanType.class, Period.class, Range.class, StringType.class}, order=10, min=0, max=1) + @Description(shortDefinition="If/when in resolution/remission", formalDefinition="The date or estimated date that the condition resolved or went into remission. This is called 'abatement' because of the many overloaded connotations associated with 'remission' or 'resolution' - Conditions are never really resolved, but they can abate." ) + protected Type abatement; + + /** + * Clinical stage or grade of a condition. May include formal severity assessments. + */ + @Child(name = "stage", type = {}, order=11, min=0, max=1) + @Description(shortDefinition="Stage/grade, usually assessed formally", formalDefinition="Clinical stage or grade of a condition. May include formal severity assessments." ) + protected ConditionStageComponent stage; + + /** + * Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed. + */ + @Child(name = "evidence", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Supporting evidence", formalDefinition="Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed." ) + protected List evidence; + + /** + * The anatomical location where this condition manifests itself. + */ + @Child(name = "location", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Anatomical location, if relevant", formalDefinition="The anatomical location where this condition manifests itself." ) + protected List location; + + /** + * Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition. + */ + @Child(name = "dueTo", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Causes for this Condition", formalDefinition="Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition." ) + protected List dueTo; + + /** + * Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition. + */ + @Child(name = "occurredFollowing", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Precedent for this Condition", formalDefinition="Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition." ) + protected List occurredFollowing; + + /** + * Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis. + */ + @Child(name = "notes", type = {StringType.class}, order=16, min=0, max=1) + @Description(shortDefinition="Additional information about the Condition", formalDefinition="Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis." ) + protected StringType notes; + + private static final long serialVersionUID = -1018838673L; + + /* + * Constructor + */ + public Condition() { + super(); + } + + /* + * Constructor + */ + public Condition(Reference patient, CodeableConcept code, Enumeration clinicalStatus) { + super(); + this.patient = patient; + this.code = code; + this.clinicalStatus = clinicalStatus; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this condition that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this condition that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Condition addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #patient} (Indicates the patient who the condition record is associated with.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Indicates the patient who the condition record is associated with.) + */ + public Condition setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates the patient who the condition record is associated with.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates the patient who the condition record is associated with.) + */ + public Condition setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #encounter} (Encounter during which the condition was first asserted.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (Encounter during which the condition was first asserted.) + */ + public Condition setEncounter(Reference value) { + this.encounter = value; + return this; + } + + /** + * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Encounter during which the condition was first asserted.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + return this.encounterTarget; + } + + /** + * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Encounter during which the condition was first asserted.) + */ + public Condition setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #asserter} (Person who takes responsibility for asserting the existence of the condition as part of the electronic record.) + */ + public Reference getAsserter() { + if (this.asserter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.asserter"); + else if (Configuration.doAutoCreate()) + this.asserter = new Reference(); // cc + return this.asserter; + } + + public boolean hasAsserter() { + return this.asserter != null && !this.asserter.isEmpty(); + } + + /** + * @param value {@link #asserter} (Person who takes responsibility for asserting the existence of the condition as part of the electronic record.) + */ + public Condition setAsserter(Reference value) { + this.asserter = value; + return this; + } + + /** + * @return {@link #asserter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Person who takes responsibility for asserting the existence of the condition as part of the electronic record.) + */ + public Resource getAsserterTarget() { + return this.asserterTarget; + } + + /** + * @param value {@link #asserter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Person who takes responsibility for asserting the existence of the condition as part of the electronic record.) + */ + public Condition setAsserterTarget(Resource value) { + this.asserterTarget = value; + return this; + } + + /** + * @return {@link #dateAsserted} (Estimated or actual date the condition/problem/diagnosis was first detected/suspected.). This is the underlying object with id, value and extensions. The accessor "getDateAsserted" gives direct access to the value + */ + public DateType getDateAssertedElement() { + if (this.dateAsserted == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.dateAsserted"); + else if (Configuration.doAutoCreate()) + this.dateAsserted = new DateType(); // bb + return this.dateAsserted; + } + + public boolean hasDateAssertedElement() { + return this.dateAsserted != null && !this.dateAsserted.isEmpty(); + } + + public boolean hasDateAsserted() { + return this.dateAsserted != null && !this.dateAsserted.isEmpty(); + } + + /** + * @param value {@link #dateAsserted} (Estimated or actual date the condition/problem/diagnosis was first detected/suspected.). This is the underlying object with id, value and extensions. The accessor "getDateAsserted" gives direct access to the value + */ + public Condition setDateAssertedElement(DateType value) { + this.dateAsserted = value; + return this; + } + + /** + * @return Estimated or actual date the condition/problem/diagnosis was first detected/suspected. + */ + public Date getDateAsserted() { + return this.dateAsserted == null ? null : this.dateAsserted.getValue(); + } + + /** + * @param value Estimated or actual date the condition/problem/diagnosis was first detected/suspected. + */ + public Condition setDateAsserted(Date value) { + if (value == null) + this.dateAsserted = null; + else { + if (this.dateAsserted == null) + this.dateAsserted = new DateType(); + this.dateAsserted.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (Identification of the condition, problem or diagnosis.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Identification of the condition, problem or diagnosis.) + */ + public Condition setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #category} (A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis.) + */ + public CodeableConcept getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.category"); + else if (Configuration.doAutoCreate()) + this.category = new CodeableConcept(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis.) + */ + public Condition setCategory(CodeableConcept value) { + this.category = value; + return this; + } + + /** + * @return {@link #clinicalStatus} (The clinical status of the condition.). This is the underlying object with id, value and extensions. The accessor "getClinicalStatus" gives direct access to the value + */ + public Enumeration getClinicalStatusElement() { + if (this.clinicalStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.clinicalStatus"); + else if (Configuration.doAutoCreate()) + this.clinicalStatus = new Enumeration(new ConditionStatusEnumFactory()); // bb + return this.clinicalStatus; + } + + public boolean hasClinicalStatusElement() { + return this.clinicalStatus != null && !this.clinicalStatus.isEmpty(); + } + + public boolean hasClinicalStatus() { + return this.clinicalStatus != null && !this.clinicalStatus.isEmpty(); + } + + /** + * @param value {@link #clinicalStatus} (The clinical status of the condition.). This is the underlying object with id, value and extensions. The accessor "getClinicalStatus" gives direct access to the value + */ + public Condition setClinicalStatusElement(Enumeration value) { + this.clinicalStatus = value; + return this; + } + + /** + * @return The clinical status of the condition. + */ + public ConditionStatus getClinicalStatus() { + return this.clinicalStatus == null ? null : this.clinicalStatus.getValue(); + } + + /** + * @param value The clinical status of the condition. + */ + public Condition setClinicalStatus(ConditionStatus value) { + if (this.clinicalStatus == null) + this.clinicalStatus = new Enumeration(new ConditionStatusEnumFactory()); + this.clinicalStatus.setValue(value); + return this; + } + + /** + * @return {@link #severity} (A subjective assessment of the severity of the condition as evaluated by the clinician.) + */ + public CodeableConcept getSeverity() { + if (this.severity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.severity"); + else if (Configuration.doAutoCreate()) + this.severity = new CodeableConcept(); // cc + return this.severity; + } + + public boolean hasSeverity() { + return this.severity != null && !this.severity.isEmpty(); + } + + /** + * @param value {@link #severity} (A subjective assessment of the severity of the condition as evaluated by the clinician.) + */ + public Condition setSeverity(CodeableConcept value) { + this.severity = value; + return this; + } + + /** + * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) + */ + public Type getOnset() { + return this.onset; + } + + /** + * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) + */ + public DateTimeType getOnsetDateTimeType() throws Exception { + if (!(this.onset instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (DateTimeType) this.onset; + } + + /** + * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) + */ + public Age getOnsetAge() throws Exception { + if (!(this.onset instanceof Age)) + throw new Exception("Type mismatch: the type Age was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (Age) this.onset; + } + + /** + * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) + */ + public Period getOnsetPeriod() throws Exception { + if (!(this.onset instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (Period) this.onset; + } + + /** + * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) + */ + public Range getOnsetRange() throws Exception { + if (!(this.onset instanceof Range)) + throw new Exception("Type mismatch: the type Range was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (Range) this.onset; + } + + /** + * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) + */ + public StringType getOnsetStringType() throws Exception { + if (!(this.onset instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (StringType) this.onset; + } + + public boolean hasOnset() { + return this.onset != null && !this.onset.isEmpty(); + } + + /** + * @param value {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) + */ + public Condition setOnset(Type value) { + this.onset = value; + return this; + } + + /** + * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) + */ + public Type getAbatement() { + return this.abatement; + } + + /** + * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) + */ + public DateType getAbatementDateType() throws Exception { + if (!(this.abatement instanceof DateType)) + throw new Exception("Type mismatch: the type DateType was expected, but "+this.abatement.getClass().getName()+" was encountered"); + return (DateType) this.abatement; + } + + /** + * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) + */ + public Age getAbatementAge() throws Exception { + if (!(this.abatement instanceof Age)) + throw new Exception("Type mismatch: the type Age was expected, but "+this.abatement.getClass().getName()+" was encountered"); + return (Age) this.abatement; + } + + /** + * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) + */ + public BooleanType getAbatementBooleanType() throws Exception { + if (!(this.abatement instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.abatement.getClass().getName()+" was encountered"); + return (BooleanType) this.abatement; + } + + /** + * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) + */ + public Period getAbatementPeriod() throws Exception { + if (!(this.abatement instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.abatement.getClass().getName()+" was encountered"); + return (Period) this.abatement; + } + + /** + * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) + */ + public Range getAbatementRange() throws Exception { + if (!(this.abatement instanceof Range)) + throw new Exception("Type mismatch: the type Range was expected, but "+this.abatement.getClass().getName()+" was encountered"); + return (Range) this.abatement; + } + + /** + * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) + */ + public StringType getAbatementStringType() throws Exception { + if (!(this.abatement instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.abatement.getClass().getName()+" was encountered"); + return (StringType) this.abatement; + } + + public boolean hasAbatement() { + return this.abatement != null && !this.abatement.isEmpty(); + } + + /** + * @param value {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) + */ + public Condition setAbatement(Type value) { + this.abatement = value; + return this; + } + + /** + * @return {@link #stage} (Clinical stage or grade of a condition. May include formal severity assessments.) + */ + public ConditionStageComponent getStage() { + if (this.stage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.stage"); + else if (Configuration.doAutoCreate()) + this.stage = new ConditionStageComponent(); // cc + return this.stage; + } + + public boolean hasStage() { + return this.stage != null && !this.stage.isEmpty(); + } + + /** + * @param value {@link #stage} (Clinical stage or grade of a condition. May include formal severity assessments.) + */ + public Condition setStage(ConditionStageComponent value) { + this.stage = value; + return this; + } + + /** + * @return {@link #evidence} (Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.) + */ + public List getEvidence() { + if (this.evidence == null) + this.evidence = new ArrayList(); + return this.evidence; + } + + public boolean hasEvidence() { + if (this.evidence == null) + return false; + for (ConditionEvidenceComponent item : this.evidence) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #evidence} (Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.) + */ + // syntactic sugar + public ConditionEvidenceComponent addEvidence() { //3 + ConditionEvidenceComponent t = new ConditionEvidenceComponent(); + if (this.evidence == null) + this.evidence = new ArrayList(); + this.evidence.add(t); + return t; + } + + // syntactic sugar + public Condition addEvidence(ConditionEvidenceComponent t) { //3 + if (t == null) + return this; + if (this.evidence == null) + this.evidence = new ArrayList(); + this.evidence.add(t); + return this; + } + + /** + * @return {@link #location} (The anatomical location where this condition manifests itself.) + */ + public List getLocation() { + if (this.location == null) + this.location = new ArrayList(); + return this.location; + } + + public boolean hasLocation() { + if (this.location == null) + return false; + for (ConditionLocationComponent item : this.location) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #location} (The anatomical location where this condition manifests itself.) + */ + // syntactic sugar + public ConditionLocationComponent addLocation() { //3 + ConditionLocationComponent t = new ConditionLocationComponent(); + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return t; + } + + // syntactic sugar + public Condition addLocation(ConditionLocationComponent t) { //3 + if (t == null) + return this; + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return this; + } + + /** + * @return {@link #dueTo} (Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition.) + */ + public List getDueTo() { + if (this.dueTo == null) + this.dueTo = new ArrayList(); + return this.dueTo; + } + + public boolean hasDueTo() { + if (this.dueTo == null) + return false; + for (ConditionDueToComponent item : this.dueTo) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dueTo} (Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition.) + */ + // syntactic sugar + public ConditionDueToComponent addDueTo() { //3 + ConditionDueToComponent t = new ConditionDueToComponent(); + if (this.dueTo == null) + this.dueTo = new ArrayList(); + this.dueTo.add(t); + return t; + } + + // syntactic sugar + public Condition addDueTo(ConditionDueToComponent t) { //3 + if (t == null) + return this; + if (this.dueTo == null) + this.dueTo = new ArrayList(); + this.dueTo.add(t); + return this; + } + + /** + * @return {@link #occurredFollowing} (Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition.) + */ + public List getOccurredFollowing() { + if (this.occurredFollowing == null) + this.occurredFollowing = new ArrayList(); + return this.occurredFollowing; + } + + public boolean hasOccurredFollowing() { + if (this.occurredFollowing == null) + return false; + for (ConditionOccurredFollowingComponent item : this.occurredFollowing) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #occurredFollowing} (Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition.) + */ + // syntactic sugar + public ConditionOccurredFollowingComponent addOccurredFollowing() { //3 + ConditionOccurredFollowingComponent t = new ConditionOccurredFollowingComponent(); + if (this.occurredFollowing == null) + this.occurredFollowing = new ArrayList(); + this.occurredFollowing.add(t); + return t; + } + + // syntactic sugar + public Condition addOccurredFollowing(ConditionOccurredFollowingComponent t) { //3 + if (t == null) + return this; + if (this.occurredFollowing == null) + this.occurredFollowing = new ArrayList(); + this.occurredFollowing.add(t); + return this; + } + + /** + * @return {@link #notes} (Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public StringType getNotesElement() { + if (this.notes == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.notes"); + else if (Configuration.doAutoCreate()) + this.notes = new StringType(); // bb + return this.notes; + } + + public boolean hasNotesElement() { + return this.notes != null && !this.notes.isEmpty(); + } + + public boolean hasNotes() { + return this.notes != null && !this.notes.isEmpty(); + } + + /** + * @param value {@link #notes} (Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public Condition setNotesElement(StringType value) { + this.notes = value; + return this; + } + + /** + * @return Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis. + */ + public String getNotes() { + return this.notes == null ? null : this.notes.getValue(); + } + + /** + * @param value Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis. + */ + public Condition setNotes(String value) { + if (Utilities.noString(value)) + this.notes = null; + else { + if (this.notes == null) + this.notes = new StringType(); + this.notes.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this condition that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("patient", "Reference(Patient)", "Indicates the patient who the condition record is associated with.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "Encounter during which the condition was first asserted.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("asserter", "Reference(Practitioner|Patient)", "Person who takes responsibility for asserting the existence of the condition as part of the electronic record.", 0, java.lang.Integer.MAX_VALUE, asserter)); + childrenList.add(new Property("dateAsserted", "date", "Estimated or actual date the condition/problem/diagnosis was first detected/suspected.", 0, java.lang.Integer.MAX_VALUE, dateAsserted)); + childrenList.add(new Property("code", "CodeableConcept", "Identification of the condition, problem or diagnosis.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("category", "CodeableConcept", "A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("clinicalStatus", "code", "The clinical status of the condition.", 0, java.lang.Integer.MAX_VALUE, clinicalStatus)); + childrenList.add(new Property("severity", "CodeableConcept", "A subjective assessment of the severity of the condition as evaluated by the clinician.", 0, java.lang.Integer.MAX_VALUE, severity)); + childrenList.add(new Property("onset[x]", "dateTime|Age|Period|Range|string", "Estimated or actual date or date-time the condition began, in the opinion of the clinician.", 0, java.lang.Integer.MAX_VALUE, onset)); + childrenList.add(new Property("abatement[x]", "date|Age|boolean|Period|Range|string", "The date or estimated date that the condition resolved or went into remission. This is called 'abatement' because of the many overloaded connotations associated with 'remission' or 'resolution' - Conditions are never really resolved, but they can abate.", 0, java.lang.Integer.MAX_VALUE, abatement)); + childrenList.add(new Property("stage", "", "Clinical stage or grade of a condition. May include formal severity assessments.", 0, java.lang.Integer.MAX_VALUE, stage)); + childrenList.add(new Property("evidence", "", "Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.", 0, java.lang.Integer.MAX_VALUE, evidence)); + childrenList.add(new Property("location", "", "The anatomical location where this condition manifests itself.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("dueTo", "", "Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition.", 0, java.lang.Integer.MAX_VALUE, dueTo)); + childrenList.add(new Property("occurredFollowing", "", "Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition.", 0, java.lang.Integer.MAX_VALUE, occurredFollowing)); + childrenList.add(new Property("notes", "string", "Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis.", 0, java.lang.Integer.MAX_VALUE, notes)); + } + + public Condition copy() { + Condition dst = new Condition(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.asserter = asserter == null ? null : asserter.copy(); + dst.dateAsserted = dateAsserted == null ? null : dateAsserted.copy(); + dst.code = code == null ? null : code.copy(); + dst.category = category == null ? null : category.copy(); + dst.clinicalStatus = clinicalStatus == null ? null : clinicalStatus.copy(); + dst.severity = severity == null ? null : severity.copy(); + dst.onset = onset == null ? null : onset.copy(); + dst.abatement = abatement == null ? null : abatement.copy(); + dst.stage = stage == null ? null : stage.copy(); + if (evidence != null) { + dst.evidence = new ArrayList(); + for (ConditionEvidenceComponent i : evidence) + dst.evidence.add(i.copy()); + }; + if (location != null) { + dst.location = new ArrayList(); + for (ConditionLocationComponent i : location) + dst.location.add(i.copy()); + }; + if (dueTo != null) { + dst.dueTo = new ArrayList(); + for (ConditionDueToComponent i : dueTo) + dst.dueTo.add(i.copy()); + }; + if (occurredFollowing != null) { + dst.occurredFollowing = new ArrayList(); + for (ConditionOccurredFollowingComponent i : occurredFollowing) + dst.occurredFollowing.add(i.copy()); + }; + dst.notes = notes == null ? null : notes.copy(); + return dst; + } + + protected Condition typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Condition)) + return false; + Condition o = (Condition) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(encounter, o.encounter, true) + && compareDeep(asserter, o.asserter, true) && compareDeep(dateAsserted, o.dateAsserted, true) && compareDeep(code, o.code, true) + && compareDeep(category, o.category, true) && compareDeep(clinicalStatus, o.clinicalStatus, true) + && compareDeep(severity, o.severity, true) && compareDeep(onset, o.onset, true) && compareDeep(abatement, o.abatement, true) + && compareDeep(stage, o.stage, true) && compareDeep(evidence, o.evidence, true) && compareDeep(location, o.location, true) + && compareDeep(dueTo, o.dueTo, true) && compareDeep(occurredFollowing, o.occurredFollowing, true) + && compareDeep(notes, o.notes, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Condition)) + return false; + Condition o = (Condition) other; + return compareValues(dateAsserted, o.dateAsserted, true) && compareValues(clinicalStatus, o.clinicalStatus, true) + && compareValues(notes, o.notes, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (asserter == null || asserter.isEmpty()) + && (dateAsserted == null || dateAsserted.isEmpty()) && (code == null || code.isEmpty()) && (category == null || category.isEmpty()) + && (clinicalStatus == null || clinicalStatus.isEmpty()) && (severity == null || severity.isEmpty()) + && (onset == null || onset.isEmpty()) && (abatement == null || abatement.isEmpty()) && (stage == null || stage.isEmpty()) + && (evidence == null || evidence.isEmpty()) && (location == null || location.isEmpty()) && (dueTo == null || dueTo.isEmpty()) + && (occurredFollowing == null || occurredFollowing.isEmpty()) && (notes == null || notes.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Condition; + } + + @SearchParamDefinition(name="severity", path="Condition.severity", description="The severity of the condition", type="token" ) + public static final String SP_SEVERITY = "severity"; + @SearchParamDefinition(name="clinicalstatus", path="Condition.clinicalStatus", description="The clinical status of the condition", type="token" ) + public static final String SP_CLINICALSTATUS = "clinicalstatus"; + @SearchParamDefinition(name="onset-info", path="Condition.onset[x]", description="Other onsets (boolean, age, range, string)", type="string" ) + public static final String SP_ONSETINFO = "onset-info"; + @SearchParamDefinition(name="code", path="Condition.code", description="Code for the condition", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="evidence", path="Condition.evidence.code", description="Manifestation/symptom", type="token" ) + public static final String SP_EVIDENCE = "evidence"; + @SearchParamDefinition(name="date-asserted", path="Condition.dateAsserted", description="When first detected/suspected/entered", type="date" ) + public static final String SP_DATEASSERTED = "date-asserted"; + @SearchParamDefinition(name="subject", path="Condition.patient", description="Who has the condition?", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="dueto-item", path="Condition.dueTo.target", description="Relationship target resource", type="reference" ) + public static final String SP_DUETOITEM = "dueto-item"; + @SearchParamDefinition(name="encounter", path="Condition.encounter", description="Encounter when condition first asserted", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + @SearchParamDefinition(name="onset", path="Condition.onset[x]", description="Date related onsets (dateTime and Period)", type="date" ) + public static final String SP_ONSET = "onset"; + @SearchParamDefinition(name="asserter", path="Condition.asserter", description="Person who asserts this condition", type="reference" ) + public static final String SP_ASSERTER = "asserter"; + @SearchParamDefinition(name="stage", path="Condition.stage.summary", description="Simple summary (disease specific)", type="token" ) + public static final String SP_STAGE = "stage"; + @SearchParamDefinition(name="following-item", path="Condition.occurredFollowing.target", description="Relationship target resource", type="reference" ) + public static final String SP_FOLLOWINGITEM = "following-item"; + @SearchParamDefinition(name="patient", path="Condition.patient", description="Who has the condition?", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="dueto-code", path="Condition.dueTo.code", description="Relationship target by means of a predefined code", type="token" ) + public static final String SP_DUETOCODE = "dueto-code"; + @SearchParamDefinition(name="location", path="Condition.location.site[x]", description="Location - may include laterality", type="token" ) + public static final String SP_LOCATION = "location"; + @SearchParamDefinition(name="category", path="Condition.category", description="The category of the condition", type="token" ) + public static final String SP_CATEGORY = "category"; + @SearchParamDefinition(name="following-code", path="Condition.occurredFollowing.code", description="Relationship target by means of a predefined code", type="token" ) + public static final String SP_FOLLOWINGCODE = "following-code"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Configuration.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Configuration.java index 8cb94c8f041..40f69c6884b 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Configuration.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Configuration.java @@ -1,127 +1,106 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* -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; - } - -} +package org.hl7.fhir.instance.model; + +/* +Copyright (c) 2011+, HL7, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +*/ + +/** + * This class is created to help implementers deal with a change to + * the API that was made between versions 0.81 and 0.9 + * + * The change is the behaviour of the .getX() where the cardinality of + * x is 0..1 or 1..1. Before the change, these routines would return + * null if the object had not previously been assigned, and after the ' + * change, they will automatically create the object if it had not + * been assigned (unless the object is polymorphic, in which case, + * only the type specific getters create the object) + * + * When making the transition from the old style to the new style, + * the main change is that when testing for presence or abssense + * of the element, instead of doing one of these two: + * + * if (obj.getProperty() == null) + * if (obj.getProperty() != null) + * + * you instead do + * + * if (!obj.hasProperty()) + * if (obj.hasProperty()) + * + * or else one of these two: + * + * if (obj.getProperty().isEmpty()) + * if (!obj.getProperty().isEmpty()) + * + * The only way to sort this out is by finding all these things + * in the code, and changing them. + * + * To help with that, you can set the status field of this class + * to change how this API behaves. Note: the status value is tied + * to the way that you program. The intent of this class is to + * help make developers the transiition to status = 0. The old + * behaviour is status = 2. To make the transition, set the + * status code to 1. This way, any time a .getX routine needs + * to automatically create an object, an exception will be + * raised instead. The expected use of this is: + * - set status = 1 + * - test your code (all paths) + * - when an exception happens, change the code to use .hasX() or .isEmpty() + * - when all execution paths don't raise an exception, set status = 0 + * - start programming to the new style. + * + * You can set status = 2 and leave it like that, but this is not + * compatible with the utilities and validation code, nor with the + * HAPI code. So everyone shoul make this transition + * + * This is a difficult change to make to an API. Most users should engage with it + * as they migrate from DSTU1 to DSTU2, at the same time as they encounter + * other changes. This change was made in order to align the two java reference + * implementations on a common object model, which is an important outcome that + * justifies making this change to implementers (sorry for any pain caused) + * + * @author Grahame + * + */ +public class Configuration { + + private static int status = 0; + // 0: auto-create + // 1: error + // 2: return null + + public static boolean errorOnAutoCreate() { + return status == 1; + } + + + public static boolean doAutoCreate() { + return status == 0; + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Conformance.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Conformance.java index b2db7d02aea..ceb5423f36a 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Conformance.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Conformance.java @@ -1,6177 +1,6156 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import java.util.*; - -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.instance.model.Enumerations.*; -import org.hl7.fhir.instance.model.annotations.ResourceDef; -import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; -import org.hl7.fhir.instance.model.annotations.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. - */ -@ResourceDef(name="Conformance", profile="http://hl7.org/fhir/Profile/Conformance") -public class Conformance extends DomainResource { - - public enum RestfulConformanceMode { - /** - * The application acts as a client for this resource. - */ - CLIENT, - /** - * The application acts as a server for this resource. - */ - SERVER, - /** - * added to help the parsers - */ - NULL; - public static RestfulConformanceMode fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("client".equals(codeString)) - return CLIENT; - if ("server".equals(codeString)) - return SERVER; - throw new Exception("Unknown RestfulConformanceMode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CLIENT: return "client"; - case SERVER: return "server"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CLIENT: return ""; - case SERVER: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CLIENT: return "The application acts as a client for this resource."; - case SERVER: return "The application acts as a server for this resource."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CLIENT: return "Client"; - case SERVER: return "Server"; - default: return "?"; - } - } - } - - public static class RestfulConformanceModeEnumFactory implements EnumFactory { - public RestfulConformanceMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("client".equals(codeString)) - return RestfulConformanceMode.CLIENT; - if ("server".equals(codeString)) - return RestfulConformanceMode.SERVER; - throw new IllegalArgumentException("Unknown RestfulConformanceMode code '"+codeString+"'"); - } - public String toCode(RestfulConformanceMode code) { - if (code == RestfulConformanceMode.CLIENT) - return "client"; - if (code == RestfulConformanceMode.SERVER) - return "server"; - return "?"; - } - } - - public enum TypeRestfulInteraction { - /** - * - */ - READ, - /** - * - */ - VREAD, - /** - * - */ - UPDATE, - /** - * - */ - DELETE, - /** - * - */ - HISTORYINSTANCE, - /** - * - */ - VALIDATE, - /** - * - */ - HISTORYTYPE, - /** - * - */ - CREATE, - /** - * - */ - SEARCHTYPE, - /** - * added to help the parsers - */ - NULL; - public static TypeRestfulInteraction fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("read".equals(codeString)) - return READ; - if ("vread".equals(codeString)) - return VREAD; - if ("update".equals(codeString)) - return UPDATE; - if ("delete".equals(codeString)) - return DELETE; - if ("history-instance".equals(codeString)) - return HISTORYINSTANCE; - if ("validate".equals(codeString)) - return VALIDATE; - if ("history-type".equals(codeString)) - return HISTORYTYPE; - if ("create".equals(codeString)) - return CREATE; - if ("search-type".equals(codeString)) - return SEARCHTYPE; - throw new Exception("Unknown TypeRestfulInteraction code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case READ: return "read"; - case VREAD: return "vread"; - case UPDATE: return "update"; - case DELETE: return "delete"; - case HISTORYINSTANCE: return "history-instance"; - case VALIDATE: return "validate"; - case HISTORYTYPE: return "history-type"; - case CREATE: return "create"; - case SEARCHTYPE: return "search-type"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case READ: return "http://hl7.org/fhir/restful-interaction"; - case VREAD: return "http://hl7.org/fhir/restful-interaction"; - case UPDATE: return "http://hl7.org/fhir/restful-interaction"; - case DELETE: return "http://hl7.org/fhir/restful-interaction"; - case HISTORYINSTANCE: return "http://hl7.org/fhir/restful-interaction"; - case VALIDATE: return "http://hl7.org/fhir/restful-interaction"; - case HISTORYTYPE: return "http://hl7.org/fhir/restful-interaction"; - case CREATE: return "http://hl7.org/fhir/restful-interaction"; - case SEARCHTYPE: return "http://hl7.org/fhir/restful-interaction"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case READ: return ""; - case VREAD: return ""; - case UPDATE: return ""; - case DELETE: return ""; - case HISTORYINSTANCE: return ""; - case VALIDATE: return ""; - case HISTORYTYPE: return ""; - case CREATE: return ""; - case SEARCHTYPE: return ""; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case READ: return "Read"; - case VREAD: return "Vread"; - case UPDATE: return "Update"; - case DELETE: return "Delete"; - case HISTORYINSTANCE: return "History Instance"; - case VALIDATE: return "Validate"; - case HISTORYTYPE: return "History Type"; - case CREATE: return "Create"; - case SEARCHTYPE: return "Search Type"; - default: return "?"; - } - } - } - - public static class TypeRestfulInteractionEnumFactory implements EnumFactory { - public TypeRestfulInteraction fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("read".equals(codeString)) - return TypeRestfulInteraction.READ; - if ("vread".equals(codeString)) - return TypeRestfulInteraction.VREAD; - if ("update".equals(codeString)) - return TypeRestfulInteraction.UPDATE; - if ("delete".equals(codeString)) - return TypeRestfulInteraction.DELETE; - if ("history-instance".equals(codeString)) - return TypeRestfulInteraction.HISTORYINSTANCE; - if ("validate".equals(codeString)) - return TypeRestfulInteraction.VALIDATE; - if ("history-type".equals(codeString)) - return TypeRestfulInteraction.HISTORYTYPE; - if ("create".equals(codeString)) - return TypeRestfulInteraction.CREATE; - if ("search-type".equals(codeString)) - return TypeRestfulInteraction.SEARCHTYPE; - throw new IllegalArgumentException("Unknown TypeRestfulInteraction code '"+codeString+"'"); - } - public String toCode(TypeRestfulInteraction code) { - if (code == TypeRestfulInteraction.READ) - return "read"; - if (code == TypeRestfulInteraction.VREAD) - return "vread"; - if (code == TypeRestfulInteraction.UPDATE) - return "update"; - if (code == TypeRestfulInteraction.DELETE) - return "delete"; - if (code == TypeRestfulInteraction.HISTORYINSTANCE) - return "history-instance"; - if (code == TypeRestfulInteraction.VALIDATE) - return "validate"; - if (code == TypeRestfulInteraction.HISTORYTYPE) - return "history-type"; - if (code == TypeRestfulInteraction.CREATE) - return "create"; - if (code == TypeRestfulInteraction.SEARCHTYPE) - return "search-type"; - return "?"; - } - } - - public enum VersioningPolicy { - /** - * VersionId meta-property is not suppoerted (server) or used (client). - */ - NOVERSION, - /** - * VersionId meta-property is suppoerted (server) or used (client). - */ - VERSIONED, - /** - * VersionId is must be correct for updates (server) or will be specified (If-match header) for updates (client). - */ - VERSIONEDUPDATE, - /** - * added to help the parsers - */ - NULL; - public static VersioningPolicy fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("no-version".equals(codeString)) - return NOVERSION; - if ("versioned".equals(codeString)) - return VERSIONED; - if ("versioned-update".equals(codeString)) - return VERSIONEDUPDATE; - throw new Exception("Unknown VersioningPolicy code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case NOVERSION: return "no-version"; - case VERSIONED: return "versioned"; - case VERSIONEDUPDATE: return "versioned-update"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case NOVERSION: return ""; - case VERSIONED: return ""; - case VERSIONEDUPDATE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case NOVERSION: return "VersionId meta-property is not suppoerted (server) or used (client)."; - case VERSIONED: return "VersionId meta-property is suppoerted (server) or used (client)."; - case VERSIONEDUPDATE: return "VersionId is must be correct for updates (server) or will be specified (If-match header) for updates (client)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case NOVERSION: return "No VersionId Support"; - case VERSIONED: return "Versioned"; - case VERSIONEDUPDATE: return "VersionId tracked fully"; - default: return "?"; - } - } - } - - public static class VersioningPolicyEnumFactory implements EnumFactory { - public VersioningPolicy fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("no-version".equals(codeString)) - return VersioningPolicy.NOVERSION; - if ("versioned".equals(codeString)) - return VersioningPolicy.VERSIONED; - if ("versioned-update".equals(codeString)) - return VersioningPolicy.VERSIONEDUPDATE; - throw new IllegalArgumentException("Unknown VersioningPolicy code '"+codeString+"'"); - } - public String toCode(VersioningPolicy code) { - if (code == VersioningPolicy.NOVERSION) - return "no-version"; - if (code == VersioningPolicy.VERSIONED) - return "versioned"; - if (code == VersioningPolicy.VERSIONEDUPDATE) - return "versioned-update"; - return "?"; - } - } - - public enum SearchParamType { - /** - * Search parameter SHALL be a number (a whole number, or a decimal). - */ - NUMBER, - /** - * Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported. - */ - DATE, - /** - * Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces. - */ - STRING, - /** - * Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a "|", depending on the modifier used. - */ - TOKEN, - /** - * A reference to another resource. - */ - REFERENCE, - /** - * A composite search parameter that combines a search on two values together. - */ - COMPOSITE, - /** - * A search parameter that searches on a quantity. - */ - QUANTITY, - /** - * A search parameter that searches on a URI (RFC 3986). - */ - URI, - /** - * added to help the parsers - */ - NULL; - public static SearchParamType fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("number".equals(codeString)) - return NUMBER; - if ("date".equals(codeString)) - return DATE; - if ("string".equals(codeString)) - return STRING; - if ("token".equals(codeString)) - return TOKEN; - if ("reference".equals(codeString)) - return REFERENCE; - if ("composite".equals(codeString)) - return COMPOSITE; - if ("quantity".equals(codeString)) - return QUANTITY; - if ("uri".equals(codeString)) - return URI; - throw new Exception("Unknown SearchParamType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case NUMBER: return "number"; - case DATE: return "date"; - case STRING: return "string"; - case TOKEN: return "token"; - case REFERENCE: return "reference"; - case COMPOSITE: return "composite"; - case QUANTITY: return "quantity"; - case URI: return "uri"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case NUMBER: return ""; - case DATE: return ""; - case STRING: return ""; - case TOKEN: return ""; - case REFERENCE: return ""; - case COMPOSITE: return ""; - case QUANTITY: return ""; - case URI: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case NUMBER: return "Search parameter SHALL be a number (a whole number, or a decimal)."; - case DATE: return "Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported."; - case STRING: return "Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces."; - case TOKEN: return "Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a '|', depending on the modifier used."; - case REFERENCE: return "A reference to another resource."; - case COMPOSITE: return "A composite search parameter that combines a search on two values together."; - case QUANTITY: return "A search parameter that searches on a quantity."; - case URI: return "A search parameter that searches on a URI (RFC 3986)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case NUMBER: return "Number"; - case DATE: return "Date/DateTime"; - case STRING: return "String"; - case TOKEN: return "Token"; - case REFERENCE: return "Reference"; - case COMPOSITE: return "Composite"; - case QUANTITY: return "Quantity"; - case URI: return "URI"; - default: return "?"; - } - } - } - - public static class SearchParamTypeEnumFactory implements EnumFactory { - public SearchParamType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("number".equals(codeString)) - return SearchParamType.NUMBER; - if ("date".equals(codeString)) - return SearchParamType.DATE; - if ("string".equals(codeString)) - return SearchParamType.STRING; - if ("token".equals(codeString)) - return SearchParamType.TOKEN; - if ("reference".equals(codeString)) - return SearchParamType.REFERENCE; - if ("composite".equals(codeString)) - return SearchParamType.COMPOSITE; - if ("quantity".equals(codeString)) - return SearchParamType.QUANTITY; - if ("uri".equals(codeString)) - return SearchParamType.URI; - throw new IllegalArgumentException("Unknown SearchParamType code '"+codeString+"'"); - } - public String toCode(SearchParamType code) { - if (code == SearchParamType.NUMBER) - return "number"; - if (code == SearchParamType.DATE) - return "date"; - if (code == SearchParamType.STRING) - return "string"; - if (code == SearchParamType.TOKEN) - return "token"; - if (code == SearchParamType.REFERENCE) - return "reference"; - if (code == SearchParamType.COMPOSITE) - return "composite"; - if (code == SearchParamType.QUANTITY) - return "quantity"; - if (code == SearchParamType.URI) - return "uri"; - return "?"; - } - } - - public enum SystemRestfulInteraction { - /** - * - */ - TRANSACTION, - /** - * - */ - SEARCHSYSTEM, - /** - * - */ - HISTORYSYSTEM, - /** - * added to help the parsers - */ - NULL; - public static SystemRestfulInteraction fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("transaction".equals(codeString)) - return TRANSACTION; - if ("search-system".equals(codeString)) - return SEARCHSYSTEM; - if ("history-system".equals(codeString)) - return HISTORYSYSTEM; - throw new Exception("Unknown SystemRestfulInteraction code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case TRANSACTION: return "transaction"; - case SEARCHSYSTEM: return "search-system"; - case HISTORYSYSTEM: return "history-system"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case TRANSACTION: return "http://hl7.org/fhir/restful-interaction"; - case SEARCHSYSTEM: return "http://hl7.org/fhir/restful-interaction"; - case HISTORYSYSTEM: return "http://hl7.org/fhir/restful-interaction"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case TRANSACTION: return ""; - case SEARCHSYSTEM: return ""; - case HISTORYSYSTEM: return ""; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case TRANSACTION: return "Transaction"; - case SEARCHSYSTEM: return "Search System"; - case HISTORYSYSTEM: return "History System"; - default: return "?"; - } - } - } - - public static class SystemRestfulInteractionEnumFactory implements EnumFactory { - public SystemRestfulInteraction fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("transaction".equals(codeString)) - return SystemRestfulInteraction.TRANSACTION; - if ("search-system".equals(codeString)) - return SystemRestfulInteraction.SEARCHSYSTEM; - if ("history-system".equals(codeString)) - return SystemRestfulInteraction.HISTORYSYSTEM; - throw new IllegalArgumentException("Unknown SystemRestfulInteraction code '"+codeString+"'"); - } - public String toCode(SystemRestfulInteraction code) { - if (code == SystemRestfulInteraction.TRANSACTION) - return "transaction"; - if (code == SystemRestfulInteraction.SEARCHSYSTEM) - return "search-system"; - if (code == SystemRestfulInteraction.HISTORYSYSTEM) - return "history-system"; - return "?"; - } - } - - public enum MessageSignificanceCategory { - /** - * The message represents/requests a change that should not be processed more than once. E.g. Making a booking for an appointment. - */ - CONSEQUENCE, - /** - * The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful. - */ - CURRENCY, - /** - * The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications. - */ - NOTIFICATION, - /** - * added to help the parsers - */ - NULL; - public static MessageSignificanceCategory fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("Consequence".equals(codeString)) - return CONSEQUENCE; - if ("Currency".equals(codeString)) - return CURRENCY; - if ("Notification".equals(codeString)) - return NOTIFICATION; - throw new Exception("Unknown MessageSignificanceCategory code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CONSEQUENCE: return "Consequence"; - case CURRENCY: return "Currency"; - case NOTIFICATION: return "Notification"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CONSEQUENCE: return ""; - case CURRENCY: return ""; - case NOTIFICATION: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CONSEQUENCE: return "The message represents/requests a change that should not be processed more than once. E.g. Making a booking for an appointment."; - case CURRENCY: return "The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful."; - case NOTIFICATION: return "The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CONSEQUENCE: return "Consequence"; - case CURRENCY: return "Currency"; - case NOTIFICATION: return "Notification"; - default: return "?"; - } - } - } - - public static class MessageSignificanceCategoryEnumFactory implements EnumFactory { - public MessageSignificanceCategory fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("Consequence".equals(codeString)) - return MessageSignificanceCategory.CONSEQUENCE; - if ("Currency".equals(codeString)) - return MessageSignificanceCategory.CURRENCY; - if ("Notification".equals(codeString)) - return MessageSignificanceCategory.NOTIFICATION; - throw new IllegalArgumentException("Unknown MessageSignificanceCategory code '"+codeString+"'"); - } - public String toCode(MessageSignificanceCategory code) { - if (code == MessageSignificanceCategory.CONSEQUENCE) - return "Consequence"; - if (code == MessageSignificanceCategory.CURRENCY) - return "Currency"; - if (code == MessageSignificanceCategory.NOTIFICATION) - return "Notification"; - return "?"; - } - } - - public enum MessageConformanceEventMode { - /** - * The application sends requests and receives responses. - */ - SENDER, - /** - * The application receives requests and sends responses. - */ - RECEIVER, - /** - * added to help the parsers - */ - NULL; - public static MessageConformanceEventMode fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("sender".equals(codeString)) - return SENDER; - if ("receiver".equals(codeString)) - return RECEIVER; - throw new Exception("Unknown MessageConformanceEventMode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case SENDER: return "sender"; - case RECEIVER: return "receiver"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case SENDER: return ""; - case RECEIVER: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case SENDER: return "The application sends requests and receives responses."; - case RECEIVER: return "The application receives requests and sends responses."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case SENDER: return "Sender"; - case RECEIVER: return "Receiver"; - default: return "?"; - } - } - } - - public static class MessageConformanceEventModeEnumFactory implements EnumFactory { - public MessageConformanceEventMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("sender".equals(codeString)) - return MessageConformanceEventMode.SENDER; - if ("receiver".equals(codeString)) - return MessageConformanceEventMode.RECEIVER; - throw new IllegalArgumentException("Unknown MessageConformanceEventMode code '"+codeString+"'"); - } - public String toCode(MessageConformanceEventMode code) { - if (code == MessageConformanceEventMode.SENDER) - return "sender"; - if (code == MessageConformanceEventMode.RECEIVER) - return "receiver"; - return "?"; - } - } - - public enum DocumentMode { - /** - * The application produces documents of the specified type. - */ - PRODUCER, - /** - * The application consumes documents of the specified type. - */ - CONSUMER, - /** - * added to help the parsers - */ - NULL; - public static DocumentMode fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("producer".equals(codeString)) - return PRODUCER; - if ("consumer".equals(codeString)) - return CONSUMER; - throw new Exception("Unknown DocumentMode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PRODUCER: return "producer"; - case CONSUMER: return "consumer"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PRODUCER: return ""; - case CONSUMER: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PRODUCER: return "The application produces documents of the specified type."; - case CONSUMER: return "The application consumes documents of the specified type."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PRODUCER: return "Producer"; - case CONSUMER: return "Consumer"; - default: return "?"; - } - } - } - - public static class DocumentModeEnumFactory implements EnumFactory { - public DocumentMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("producer".equals(codeString)) - return DocumentMode.PRODUCER; - if ("consumer".equals(codeString)) - return DocumentMode.CONSUMER; - throw new IllegalArgumentException("Unknown DocumentMode code '"+codeString+"'"); - } - public String toCode(DocumentMode code) { - if (code == DocumentMode.PRODUCER) - return "producer"; - if (code == DocumentMode.CONSUMER) - return "consumer"; - return "?"; - } - } - - @Block() - public static class ConformanceContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the conformance. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Name of a individual to contact", formalDefinition="The name of an individual to contact regarding the conformance." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /* - * Constructor - */ - public ConformanceContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the conformance.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the conformance.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ConformanceContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the conformance. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the conformance. - */ - public ConformanceContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public ConformanceContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the conformance.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - public ConformanceContactComponent copy() { - ConformanceContactComponent dst = new ConformanceContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceContactComponent)) - return false; - ConformanceContactComponent o = (ConformanceContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceContactComponent)) - return false; - ConformanceContactComponent o = (ConformanceContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - } - - @Block() - public static class ConformanceSoftwareComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Name software is known by. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="A name the software is known by", formalDefinition="Name software is known by." ) - protected StringType name; - - /** - * The version identifier for the software covered by this statement. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Version covered by this statement", formalDefinition="The version identifier for the software covered by this statement." ) - protected StringType version; - - /** - * Date this version of the software released. - */ - @Child(name = "releaseDate", type = {DateTimeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Date this version released", formalDefinition="Date this version of the software released." ) - protected DateTimeType releaseDate; - - private static final long serialVersionUID = 1819769027L; - - /* - * Constructor - */ - public ConformanceSoftwareComponent() { - super(); - } - - /* - * Constructor - */ - public ConformanceSoftwareComponent(StringType name) { - super(); - this.name = name; - } - - /** - * @return {@link #name} (Name software is known by.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceSoftwareComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Name software is known by.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ConformanceSoftwareComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Name software is known by. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Name software is known by. - */ - public ConformanceSoftwareComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #version} (The version identifier for the software covered by this statement.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceSoftwareComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version identifier for the software covered by this statement.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ConformanceSoftwareComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version identifier for the software covered by this statement. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version identifier for the software covered by this statement. - */ - public ConformanceSoftwareComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #releaseDate} (Date this version of the software released.). This is the underlying object with id, value and extensions. The accessor "getReleaseDate" gives direct access to the value - */ - public DateTimeType getReleaseDateElement() { - if (this.releaseDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceSoftwareComponent.releaseDate"); - else if (Configuration.doAutoCreate()) - this.releaseDate = new DateTimeType(); // bb - return this.releaseDate; - } - - public boolean hasReleaseDateElement() { - return this.releaseDate != null && !this.releaseDate.isEmpty(); - } - - public boolean hasReleaseDate() { - return this.releaseDate != null && !this.releaseDate.isEmpty(); - } - - /** - * @param value {@link #releaseDate} (Date this version of the software released.). This is the underlying object with id, value and extensions. The accessor "getReleaseDate" gives direct access to the value - */ - public ConformanceSoftwareComponent setReleaseDateElement(DateTimeType value) { - this.releaseDate = value; - return this; - } - - /** - * @return Date this version of the software released. - */ - public Date getReleaseDate() { - return this.releaseDate == null ? null : this.releaseDate.getValue(); - } - - /** - * @param value Date this version of the software released. - */ - public ConformanceSoftwareComponent setReleaseDate(Date value) { - if (value == null) - this.releaseDate = null; - else { - if (this.releaseDate == null) - this.releaseDate = new DateTimeType(); - this.releaseDate.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "Name software is known by.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("version", "string", "The version identifier for the software covered by this statement.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("releaseDate", "dateTime", "Date this version of the software released.", 0, java.lang.Integer.MAX_VALUE, releaseDate)); - } - - public ConformanceSoftwareComponent copy() { - ConformanceSoftwareComponent dst = new ConformanceSoftwareComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.version = version == null ? null : version.copy(); - dst.releaseDate = releaseDate == null ? null : releaseDate.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceSoftwareComponent)) - return false; - ConformanceSoftwareComponent o = (ConformanceSoftwareComponent) other; - return compareDeep(name, o.name, true) && compareDeep(version, o.version, true) && compareDeep(releaseDate, o.releaseDate, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceSoftwareComponent)) - return false; - ConformanceSoftwareComponent o = (ConformanceSoftwareComponent) other; - return compareValues(name, o.name, true) && compareValues(version, o.version, true) && compareValues(releaseDate, o.releaseDate, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (version == null || version.isEmpty()) - && (releaseDate == null || releaseDate.isEmpty()); - } - - } - - @Block() - public static class ConformanceImplementationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Information about the specific installation that this conformance statement relates to. - */ - @Child(name = "description", type = {StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Describes this specific instance", formalDefinition="Information about the specific installation that this conformance statement relates to." ) - protected StringType description; - - /** - * An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. - */ - @Child(name = "url", type = {UriType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Base URL for the installation", formalDefinition="An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces." ) - protected UriType url; - - private static final long serialVersionUID = -289238508L; - - /* - * Constructor - */ - public ConformanceImplementationComponent() { - super(); - } - - /* - * Constructor - */ - public ConformanceImplementationComponent(StringType description) { - super(); - this.description = description; - } - - /** - * @return {@link #description} (Information about the specific installation that this conformance statement relates to.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceImplementationComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Information about the specific installation that this conformance statement relates to.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ConformanceImplementationComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Information about the specific installation that this conformance statement relates to. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Information about the specific installation that this conformance statement relates to. - */ - public ConformanceImplementationComponent setDescription(String value) { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - return this; - } - - /** - * @return {@link #url} (An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceImplementationComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public ConformanceImplementationComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. - */ - public ConformanceImplementationComponent setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("description", "string", "Information about the specific installation that this conformance statement relates to.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("url", "uri", "An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces.", 0, java.lang.Integer.MAX_VALUE, url)); - } - - public ConformanceImplementationComponent copy() { - ConformanceImplementationComponent dst = new ConformanceImplementationComponent(); - copyValues(dst); - dst.description = description == null ? null : description.copy(); - dst.url = url == null ? null : url.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceImplementationComponent)) - return false; - ConformanceImplementationComponent o = (ConformanceImplementationComponent) other; - return compareDeep(description, o.description, true) && compareDeep(url, o.url, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceImplementationComponent)) - return false; - ConformanceImplementationComponent o = (ConformanceImplementationComponent) other; - return compareValues(description, o.description, true) && compareValues(url, o.url, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (description == null || description.isEmpty()) && (url == null || url.isEmpty()) - ; - } - - } - - @Block() - public static class ConformanceRestComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifies whether this portion of the statement is describing ability to initiate or receive restful operations. - */ - @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="client | server", formalDefinition="Identifies whether this portion of the statement is describing ability to initiate or receive restful operations." ) - protected Enumeration mode; - - /** - * Information about the system's restful capabilities that apply across all applications, such as security. - */ - @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="General description of implementation", formalDefinition="Information about the system's restful capabilities that apply across all applications, such as security." ) - protected StringType documentation; - - /** - * Information about security implementation from an interface perspective - what a client needs to know. - */ - @Child(name = "security", type = {}, order=3, min=0, max=1) - @Description(shortDefinition="Information about security of implementation", formalDefinition="Information about security implementation from an interface perspective - what a client needs to know." ) - protected ConformanceRestSecurityComponent security; - - /** - * A specification of the restful capabilities of the solution for a specific resource type. - */ - @Child(name = "resource", type = {}, order=4, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Resource served on the REST interface", formalDefinition="A specification of the restful capabilities of the solution for a specific resource type." ) - protected List resource; - - /** - * A specification of restful operations supported by the system. - */ - @Child(name = "interaction", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="What operations are supported?", formalDefinition="A specification of restful operations supported by the system." ) - protected List interaction; - - /** - * Definition of an operation or a named query and with its parameters and their meaning and type. - */ - @Child(name = "operation", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Definition of an operation or a custom query", formalDefinition="Definition of an operation or a named query and with its parameters and their meaning and type." ) - protected List operation; - - /** - * A list of absolute URIs that identify profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose. - */ - @Child(name = "documentMailbox", type = {UriType.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="How documents are accepted in /Mailbox", formalDefinition="A list of absolute URIs that identify profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier 'http://hl7.org/fhir/documents/mailbox'. Other specifications can declare their own identifier for this purpose." ) - protected List documentMailbox; - - /** - * An absolute URI which is a reference to the definition of a compartment hosted by the system. - */ - @Child(name = "compartment", type = {UriType.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Compartments served/used by system", formalDefinition="An absolute URI which is a reference to the definition of a compartment hosted by the system." ) - protected List compartment; - - private static final long serialVersionUID = -535980615L; - - /* - * Constructor - */ - public ConformanceRestComponent() { - super(); - } - - /* - * Constructor - */ - public ConformanceRestComponent(Enumeration mode) { - super(); - this.mode = mode; - } - - /** - * @return {@link #mode} (Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Enumeration getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestComponent.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(new RestfulConformanceModeEnumFactory()); // bb - return this.mode; - } - - public boolean hasModeElement() { - return this.mode != null && !this.mode.isEmpty(); - } - - public boolean hasMode() { - return this.mode != null && !this.mode.isEmpty(); - } - - /** - * @param value {@link #mode} (Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public ConformanceRestComponent setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return Identifies whether this portion of the statement is describing ability to initiate or receive restful operations. - */ - public RestfulConformanceMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value Identifies whether this portion of the statement is describing ability to initiate or receive restful operations. - */ - public ConformanceRestComponent setMode(RestfulConformanceMode value) { - if (this.mode == null) - this.mode = new Enumeration(new RestfulConformanceModeEnumFactory()); - this.mode.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (Information about the system's restful capabilities that apply across all applications, such as security.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (Information about the system's restful capabilities that apply across all applications, such as security.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public ConformanceRestComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Information about the system's restful capabilities that apply across all applications, such as security. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Information about the system's restful capabilities that apply across all applications, such as security. - */ - public ConformanceRestComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - /** - * @return {@link #security} (Information about security implementation from an interface perspective - what a client needs to know.) - */ - public ConformanceRestSecurityComponent getSecurity() { - if (this.security == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestComponent.security"); - else if (Configuration.doAutoCreate()) - this.security = new ConformanceRestSecurityComponent(); // cc - return this.security; - } - - public boolean hasSecurity() { - return this.security != null && !this.security.isEmpty(); - } - - /** - * @param value {@link #security} (Information about security implementation from an interface perspective - what a client needs to know.) - */ - public ConformanceRestComponent setSecurity(ConformanceRestSecurityComponent value) { - this.security = value; - return this; - } - - /** - * @return {@link #resource} (A specification of the restful capabilities of the solution for a specific resource type.) - */ - public List getResource() { - if (this.resource == null) - this.resource = new ArrayList(); - return this.resource; - } - - public boolean hasResource() { - if (this.resource == null) - return false; - for (ConformanceRestResourceComponent item : this.resource) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #resource} (A specification of the restful capabilities of the solution for a specific resource type.) - */ - // syntactic sugar - public ConformanceRestResourceComponent addResource() { //3 - ConformanceRestResourceComponent t = new ConformanceRestResourceComponent(); - if (this.resource == null) - this.resource = new ArrayList(); - this.resource.add(t); - return t; - } - - // syntactic sugar - public ConformanceRestComponent addResource(ConformanceRestResourceComponent t) { //3 - if (t == null) - return this; - if (this.resource == null) - this.resource = new ArrayList(); - this.resource.add(t); - return this; - } - - /** - * @return {@link #interaction} (A specification of restful operations supported by the system.) - */ - public List getInteraction() { - if (this.interaction == null) - this.interaction = new ArrayList(); - return this.interaction; - } - - public boolean hasInteraction() { - if (this.interaction == null) - return false; - for (SystemInteractionComponent item : this.interaction) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #interaction} (A specification of restful operations supported by the system.) - */ - // syntactic sugar - public SystemInteractionComponent addInteraction() { //3 - SystemInteractionComponent t = new SystemInteractionComponent(); - if (this.interaction == null) - this.interaction = new ArrayList(); - this.interaction.add(t); - return t; - } - - // syntactic sugar - public ConformanceRestComponent addInteraction(SystemInteractionComponent t) { //3 - if (t == null) - return this; - if (this.interaction == null) - this.interaction = new ArrayList(); - this.interaction.add(t); - return this; - } - - /** - * @return {@link #operation} (Definition of an operation or a named query and with its parameters and their meaning and type.) - */ - public List getOperation() { - if (this.operation == null) - this.operation = new ArrayList(); - return this.operation; - } - - public boolean hasOperation() { - if (this.operation == null) - return false; - for (ConformanceRestOperationComponent item : this.operation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #operation} (Definition of an operation or a named query and with its parameters and their meaning and type.) - */ - // syntactic sugar - public ConformanceRestOperationComponent addOperation() { //3 - ConformanceRestOperationComponent t = new ConformanceRestOperationComponent(); - if (this.operation == null) - this.operation = new ArrayList(); - this.operation.add(t); - return t; - } - - // syntactic sugar - public ConformanceRestComponent addOperation(ConformanceRestOperationComponent t) { //3 - if (t == null) - return this; - if (this.operation == null) - this.operation = new ArrayList(); - this.operation.add(t); - return this; - } - - /** - * @return {@link #documentMailbox} (A list of absolute URIs that identify profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose.) - */ - public List getDocumentMailbox() { - if (this.documentMailbox == null) - this.documentMailbox = new ArrayList(); - return this.documentMailbox; - } - - public boolean hasDocumentMailbox() { - if (this.documentMailbox == null) - return false; - for (UriType item : this.documentMailbox) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #documentMailbox} (A list of absolute URIs that identify profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose.) - */ - // syntactic sugar - public UriType addDocumentMailboxElement() {//2 - UriType t = new UriType(); - if (this.documentMailbox == null) - this.documentMailbox = new ArrayList(); - this.documentMailbox.add(t); - return t; - } - - /** - * @param value {@link #documentMailbox} (A list of absolute URIs that identify profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose.) - */ - public ConformanceRestComponent addDocumentMailbox(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.documentMailbox == null) - this.documentMailbox = new ArrayList(); - this.documentMailbox.add(t); - return this; - } - - /** - * @param value {@link #documentMailbox} (A list of absolute URIs that identify profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose.) - */ - public boolean hasDocumentMailbox(String value) { - if (this.documentMailbox == null) - return false; - for (UriType v : this.documentMailbox) - if (v.equals(value)) // uri - return true; - return false; - } - - /** - * @return {@link #compartment} (An absolute URI which is a reference to the definition of a compartment hosted by the system.) - */ - public List getCompartment() { - if (this.compartment == null) - this.compartment = new ArrayList(); - return this.compartment; - } - - public boolean hasCompartment() { - if (this.compartment == null) - return false; - for (UriType item : this.compartment) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #compartment} (An absolute URI which is a reference to the definition of a compartment hosted by the system.) - */ - // syntactic sugar - public UriType addCompartmentElement() {//2 - UriType t = new UriType(); - if (this.compartment == null) - this.compartment = new ArrayList(); - this.compartment.add(t); - return t; - } - - /** - * @param value {@link #compartment} (An absolute URI which is a reference to the definition of a compartment hosted by the system.) - */ - public ConformanceRestComponent addCompartment(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.compartment == null) - this.compartment = new ArrayList(); - this.compartment.add(t); - return this; - } - - /** - * @param value {@link #compartment} (An absolute URI which is a reference to the definition of a compartment hosted by the system.) - */ - public boolean hasCompartment(String value) { - if (this.compartment == null) - return false; - for (UriType v : this.compartment) - if (v.equals(value)) // uri - return true; - return false; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("mode", "code", "Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("documentation", "string", "Information about the system's restful capabilities that apply across all applications, such as security.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("security", "", "Information about security implementation from an interface perspective - what a client needs to know.", 0, java.lang.Integer.MAX_VALUE, security)); - childrenList.add(new Property("resource", "", "A specification of the restful capabilities of the solution for a specific resource type.", 0, java.lang.Integer.MAX_VALUE, resource)); - childrenList.add(new Property("interaction", "", "A specification of restful operations supported by the system.", 0, java.lang.Integer.MAX_VALUE, interaction)); - childrenList.add(new Property("operation", "", "Definition of an operation or a named query and with its parameters and their meaning and type.", 0, java.lang.Integer.MAX_VALUE, operation)); - childrenList.add(new Property("documentMailbox", "uri", "A list of absolute URIs that identify profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier 'http://hl7.org/fhir/documents/mailbox'. Other specifications can declare their own identifier for this purpose.", 0, java.lang.Integer.MAX_VALUE, documentMailbox)); - childrenList.add(new Property("compartment", "uri", "An absolute URI which is a reference to the definition of a compartment hosted by the system.", 0, java.lang.Integer.MAX_VALUE, compartment)); - } - - public ConformanceRestComponent copy() { - ConformanceRestComponent dst = new ConformanceRestComponent(); - copyValues(dst); - dst.mode = mode == null ? null : mode.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - dst.security = security == null ? null : security.copy(); - if (resource != null) { - dst.resource = new ArrayList(); - for (ConformanceRestResourceComponent i : resource) - dst.resource.add(i.copy()); - }; - if (interaction != null) { - dst.interaction = new ArrayList(); - for (SystemInteractionComponent i : interaction) - dst.interaction.add(i.copy()); - }; - if (operation != null) { - dst.operation = new ArrayList(); - for (ConformanceRestOperationComponent i : operation) - dst.operation.add(i.copy()); - }; - if (documentMailbox != null) { - dst.documentMailbox = new ArrayList(); - for (UriType i : documentMailbox) - dst.documentMailbox.add(i.copy()); - }; - if (compartment != null) { - dst.compartment = new ArrayList(); - for (UriType i : compartment) - dst.compartment.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceRestComponent)) - return false; - ConformanceRestComponent o = (ConformanceRestComponent) other; - return compareDeep(mode, o.mode, true) && compareDeep(documentation, o.documentation, true) && compareDeep(security, o.security, true) - && compareDeep(resource, o.resource, true) && compareDeep(interaction, o.interaction, true) && compareDeep(operation, o.operation, true) - && compareDeep(documentMailbox, o.documentMailbox, true) && compareDeep(compartment, o.compartment, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceRestComponent)) - return false; - ConformanceRestComponent o = (ConformanceRestComponent) other; - return compareValues(mode, o.mode, true) && compareValues(documentation, o.documentation, true) && compareValues(documentMailbox, o.documentMailbox, true) - && compareValues(compartment, o.compartment, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (mode == null || mode.isEmpty()) && (documentation == null || documentation.isEmpty()) - && (security == null || security.isEmpty()) && (resource == null || resource.isEmpty()) && (interaction == null || interaction.isEmpty()) - && (operation == null || operation.isEmpty()) && (documentMailbox == null || documentMailbox.isEmpty()) - && (compartment == null || compartment.isEmpty()); - } - - } - - @Block() - public static class ConformanceRestSecurityComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Server adds CORS headers when responding to requests - this enables javascript applications to use the server. - */ - @Child(name = "cors", type = {BooleanType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Adds CORS Headers (http://enable-cors.org/)", formalDefinition="Server adds CORS headers when responding to requests - this enables javascript applications to use the server." ) - protected BooleanType cors; - - /** - * Types of security services are supported/required by the system. - */ - @Child(name = "service", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="OAuth | OAuth2 | NTLM | Basic | Kerberos", formalDefinition="Types of security services are supported/required by the system." ) - protected List service; - - /** - * General description of how security works. - */ - @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="General description of how security works", formalDefinition="General description of how security works." ) - protected StringType description; - - /** - * Certificates associated with security profiles. - */ - @Child(name = "certificate", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Certificates associated with security profiles", formalDefinition="Certificates associated with security profiles." ) - protected List certificate; - - private static final long serialVersionUID = 391663952L; - - /* - * Constructor - */ - public ConformanceRestSecurityComponent() { - super(); - } - - /** - * @return {@link #cors} (Server adds CORS headers when responding to requests - this enables javascript applications to use the server.). This is the underlying object with id, value and extensions. The accessor "getCors" gives direct access to the value - */ - public BooleanType getCorsElement() { - if (this.cors == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestSecurityComponent.cors"); - else if (Configuration.doAutoCreate()) - this.cors = new BooleanType(); // bb - return this.cors; - } - - public boolean hasCorsElement() { - return this.cors != null && !this.cors.isEmpty(); - } - - public boolean hasCors() { - return this.cors != null && !this.cors.isEmpty(); - } - - /** - * @param value {@link #cors} (Server adds CORS headers when responding to requests - this enables javascript applications to use the server.). This is the underlying object with id, value and extensions. The accessor "getCors" gives direct access to the value - */ - public ConformanceRestSecurityComponent setCorsElement(BooleanType value) { - this.cors = value; - return this; - } - - /** - * @return Server adds CORS headers when responding to requests - this enables javascript applications to use the server. - */ - public boolean getCors() { - return this.cors == null || this.cors.isEmpty() ? false : this.cors.getValue(); - } - - /** - * @param value Server adds CORS headers when responding to requests - this enables javascript applications to use the server. - */ - public ConformanceRestSecurityComponent setCors(boolean value) { - if (this.cors == null) - this.cors = new BooleanType(); - this.cors.setValue(value); - return this; - } - - /** - * @return {@link #service} (Types of security services are supported/required by the system.) - */ - public List getService() { - if (this.service == null) - this.service = new ArrayList(); - return this.service; - } - - public boolean hasService() { - if (this.service == null) - return false; - for (CodeableConcept item : this.service) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #service} (Types of security services are supported/required by the system.) - */ - // syntactic sugar - public CodeableConcept addService() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.service == null) - this.service = new ArrayList(); - this.service.add(t); - return t; - } - - // syntactic sugar - public ConformanceRestSecurityComponent addService(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.service == null) - this.service = new ArrayList(); - this.service.add(t); - return this; - } - - /** - * @return {@link #description} (General description of how security works.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestSecurityComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (General description of how security works.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ConformanceRestSecurityComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return General description of how security works. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value General description of how security works. - */ - public ConformanceRestSecurityComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #certificate} (Certificates associated with security profiles.) - */ - public List getCertificate() { - if (this.certificate == null) - this.certificate = new ArrayList(); - return this.certificate; - } - - public boolean hasCertificate() { - if (this.certificate == null) - return false; - for (ConformanceRestSecurityCertificateComponent item : this.certificate) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #certificate} (Certificates associated with security profiles.) - */ - // syntactic sugar - public ConformanceRestSecurityCertificateComponent addCertificate() { //3 - ConformanceRestSecurityCertificateComponent t = new ConformanceRestSecurityCertificateComponent(); - if (this.certificate == null) - this.certificate = new ArrayList(); - this.certificate.add(t); - return t; - } - - // syntactic sugar - public ConformanceRestSecurityComponent addCertificate(ConformanceRestSecurityCertificateComponent t) { //3 - if (t == null) - return this; - if (this.certificate == null) - this.certificate = new ArrayList(); - this.certificate.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("cors", "boolean", "Server adds CORS headers when responding to requests - this enables javascript applications to use the server.", 0, java.lang.Integer.MAX_VALUE, cors)); - childrenList.add(new Property("service", "CodeableConcept", "Types of security services are supported/required by the system.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("description", "string", "General description of how security works.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("certificate", "", "Certificates associated with security profiles.", 0, java.lang.Integer.MAX_VALUE, certificate)); - } - - public ConformanceRestSecurityComponent copy() { - ConformanceRestSecurityComponent dst = new ConformanceRestSecurityComponent(); - copyValues(dst); - dst.cors = cors == null ? null : cors.copy(); - if (service != null) { - dst.service = new ArrayList(); - for (CodeableConcept i : service) - dst.service.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - if (certificate != null) { - dst.certificate = new ArrayList(); - for (ConformanceRestSecurityCertificateComponent i : certificate) - dst.certificate.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceRestSecurityComponent)) - return false; - ConformanceRestSecurityComponent o = (ConformanceRestSecurityComponent) other; - return compareDeep(cors, o.cors, true) && compareDeep(service, o.service, true) && compareDeep(description, o.description, true) - && compareDeep(certificate, o.certificate, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceRestSecurityComponent)) - return false; - ConformanceRestSecurityComponent o = (ConformanceRestSecurityComponent) other; - return compareValues(cors, o.cors, true) && compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (cors == null || cors.isEmpty()) && (service == null || service.isEmpty()) - && (description == null || description.isEmpty()) && (certificate == null || certificate.isEmpty()) - ; - } - - } - - @Block() - public static class ConformanceRestSecurityCertificateComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Mime type for certificate. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Mime type for certificate", formalDefinition="Mime type for certificate." ) - protected CodeType type; - - /** - * Actual certificate. - */ - @Child(name = "blob", type = {Base64BinaryType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Actual certificate", formalDefinition="Actual certificate." ) - protected Base64BinaryType blob; - - private static final long serialVersionUID = 2092655854L; - - /* - * Constructor - */ - public ConformanceRestSecurityCertificateComponent() { - super(); - } - - /** - * @return {@link #type} (Mime type for certificate.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public CodeType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestSecurityCertificateComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeType(); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Mime type for certificate.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ConformanceRestSecurityCertificateComponent setTypeElement(CodeType value) { - this.type = value; - return this; - } - - /** - * @return Mime type for certificate. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Mime type for certificate. - */ - public ConformanceRestSecurityCertificateComponent setType(String value) { - if (Utilities.noString(value)) - this.type = null; - else { - if (this.type == null) - this.type = new CodeType(); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #blob} (Actual certificate.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value - */ - public Base64BinaryType getBlobElement() { - if (this.blob == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestSecurityCertificateComponent.blob"); - else if (Configuration.doAutoCreate()) - this.blob = new Base64BinaryType(); // bb - return this.blob; - } - - public boolean hasBlobElement() { - return this.blob != null && !this.blob.isEmpty(); - } - - public boolean hasBlob() { - return this.blob != null && !this.blob.isEmpty(); - } - - /** - * @param value {@link #blob} (Actual certificate.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value - */ - public ConformanceRestSecurityCertificateComponent setBlobElement(Base64BinaryType value) { - this.blob = value; - return this; - } - - /** - * @return Actual certificate. - */ - public byte[] getBlob() { - return this.blob == null ? null : this.blob.getValue(); - } - - /** - * @param value Actual certificate. - */ - public ConformanceRestSecurityCertificateComponent setBlob(byte[] value) { - if (value == null) - this.blob = null; - else { - if (this.blob == null) - this.blob = new Base64BinaryType(); - this.blob.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Mime type for certificate.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("blob", "base64Binary", "Actual certificate.", 0, java.lang.Integer.MAX_VALUE, blob)); - } - - public ConformanceRestSecurityCertificateComponent copy() { - ConformanceRestSecurityCertificateComponent dst = new ConformanceRestSecurityCertificateComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.blob = blob == null ? null : blob.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceRestSecurityCertificateComponent)) - return false; - ConformanceRestSecurityCertificateComponent o = (ConformanceRestSecurityCertificateComponent) other; - return compareDeep(type, o.type, true) && compareDeep(blob, o.blob, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceRestSecurityCertificateComponent)) - return false; - ConformanceRestSecurityCertificateComponent o = (ConformanceRestSecurityCertificateComponent) other; - return compareValues(type, o.type, true) && compareValues(blob, o.blob, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (blob == null || blob.isEmpty()) - ; - } - - } - - @Block() - public static class ConformanceRestResourceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A type of resource exposed via the restful interface. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="A resource type that is supported", formalDefinition="A type of resource exposed via the restful interface." ) - protected CodeType type; - - /** - * A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. - */ - @Child(name = "profile", type = {StructureDefinition.class}, order=2, min=0, max=1) - @Description(shortDefinition="What structural features are supported", formalDefinition="A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations." ) - protected Reference profile; - - /** - * The actual object that is the target of the reference (A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.) - */ - protected StructureDefinition profileTarget; - - /** - * Identifies a restful operation supported by the solution. - */ - @Child(name = "interaction", type = {}, order=3, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="What operations are supported?", formalDefinition="Identifies a restful operation supported by the solution." ) - protected List interaction; - - /** - * Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources. - */ - @Child(name = "versioning", type = {CodeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="no-version | versioned | versioned-update", formalDefinition="Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources." ) - protected Enumeration versioning; - - /** - * A flag for whether the server is able to return past versions as part of the vRead operation. - */ - @Child(name = "readHistory", type = {BooleanType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Whether vRead can return past versions", formalDefinition="A flag for whether the server is able to return past versions as part of the vRead operation." ) - protected BooleanType readHistory; - - /** - * A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server. - */ - @Child(name = "updateCreate", type = {BooleanType.class}, order=6, min=0, max=1) - @Description(shortDefinition="If update can commit to a new identity", formalDefinition="A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server." ) - protected BooleanType updateCreate; - - /** - * A flag that indicates that the server supports conditional create. - */ - @Child(name = "conditionalCreate", type = {BooleanType.class}, order=7, min=0, max=1) - @Description(shortDefinition="If allows/uses conditional create", formalDefinition="A flag that indicates that the server supports conditional create." ) - protected BooleanType conditionalCreate; - - /** - * A flag that indicates that the server supports conditional update. - */ - @Child(name = "conditionalUpdate", type = {BooleanType.class}, order=8, min=0, max=1) - @Description(shortDefinition="If allows/uses conditional update", formalDefinition="A flag that indicates that the server supports conditional update." ) - protected BooleanType conditionalUpdate; - - /** - * A flag that indicates that the server supports conditional delete. - */ - @Child(name = "conditionalDelete", type = {BooleanType.class}, order=9, min=0, max=1) - @Description(shortDefinition="If allows/uses conditional delete", formalDefinition="A flag that indicates that the server supports conditional delete." ) - protected BooleanType conditionalDelete; - - /** - * A list of _include values supported by the server. - */ - @Child(name = "searchInclude", type = {StringType.class}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="_include values supported by the server", formalDefinition="A list of _include values supported by the server." ) - protected List searchInclude; - - /** - * Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation. - */ - @Child(name = "searchParam", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Search params supported by implementation", formalDefinition="Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation." ) - protected List searchParam; - - private static final long serialVersionUID = 1477462605L; - - /* - * Constructor - */ - public ConformanceRestResourceComponent() { - super(); - } - - /* - * Constructor - */ - public ConformanceRestResourceComponent(CodeType type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (A type of resource exposed via the restful interface.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public CodeType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeType(); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (A type of resource exposed via the restful interface.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ConformanceRestResourceComponent setTypeElement(CodeType value) { - this.type = value; - return this; - } - - /** - * @return A type of resource exposed via the restful interface. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value A type of resource exposed via the restful interface. - */ - public ConformanceRestResourceComponent setType(String value) { - if (this.type == null) - this.type = new CodeType(); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #profile} (A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.) - */ - public Reference getProfile() { - if (this.profile == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profile = new Reference(); // cc - return this.profile; - } - - public boolean hasProfile() { - return this.profile != null && !this.profile.isEmpty(); - } - - /** - * @param value {@link #profile} (A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.) - */ - public ConformanceRestResourceComponent setProfile(Reference value) { - this.profile = value; - return this; - } - - /** - * @return {@link #profile} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.) - */ - public StructureDefinition getProfileTarget() { - if (this.profileTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profileTarget = new StructureDefinition(); // aa - return this.profileTarget; - } - - /** - * @param value {@link #profile} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.) - */ - public ConformanceRestResourceComponent setProfileTarget(StructureDefinition value) { - this.profileTarget = value; - return this; - } - - /** - * @return {@link #interaction} (Identifies a restful operation supported by the solution.) - */ - public List getInteraction() { - if (this.interaction == null) - this.interaction = new ArrayList(); - return this.interaction; - } - - public boolean hasInteraction() { - if (this.interaction == null) - return false; - for (ResourceInteractionComponent item : this.interaction) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #interaction} (Identifies a restful operation supported by the solution.) - */ - // syntactic sugar - public ResourceInteractionComponent addInteraction() { //3 - ResourceInteractionComponent t = new ResourceInteractionComponent(); - if (this.interaction == null) - this.interaction = new ArrayList(); - this.interaction.add(t); - return t; - } - - // syntactic sugar - public ConformanceRestResourceComponent addInteraction(ResourceInteractionComponent t) { //3 - if (t == null) - return this; - if (this.interaction == null) - this.interaction = new ArrayList(); - this.interaction.add(t); - return this; - } - - /** - * @return {@link #versioning} (Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value - */ - public Enumeration getVersioningElement() { - if (this.versioning == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.versioning"); - else if (Configuration.doAutoCreate()) - this.versioning = new Enumeration(new VersioningPolicyEnumFactory()); // bb - return this.versioning; - } - - public boolean hasVersioningElement() { - return this.versioning != null && !this.versioning.isEmpty(); - } - - public boolean hasVersioning() { - return this.versioning != null && !this.versioning.isEmpty(); - } - - /** - * @param value {@link #versioning} (Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value - */ - public ConformanceRestResourceComponent setVersioningElement(Enumeration value) { - this.versioning = value; - return this; - } - - /** - * @return Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources. - */ - public VersioningPolicy getVersioning() { - return this.versioning == null ? null : this.versioning.getValue(); - } - - /** - * @param value Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources. - */ - public ConformanceRestResourceComponent setVersioning(VersioningPolicy value) { - if (value == null) - this.versioning = null; - else { - if (this.versioning == null) - this.versioning = new Enumeration(new VersioningPolicyEnumFactory()); - this.versioning.setValue(value); - } - return this; - } - - /** - * @return {@link #readHistory} (A flag for whether the server is able to return past versions as part of the vRead operation.). This is the underlying object with id, value and extensions. The accessor "getReadHistory" gives direct access to the value - */ - public BooleanType getReadHistoryElement() { - if (this.readHistory == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.readHistory"); - else if (Configuration.doAutoCreate()) - this.readHistory = new BooleanType(); // bb - return this.readHistory; - } - - public boolean hasReadHistoryElement() { - return this.readHistory != null && !this.readHistory.isEmpty(); - } - - public boolean hasReadHistory() { - return this.readHistory != null && !this.readHistory.isEmpty(); - } - - /** - * @param value {@link #readHistory} (A flag for whether the server is able to return past versions as part of the vRead operation.). This is the underlying object with id, value and extensions. The accessor "getReadHistory" gives direct access to the value - */ - public ConformanceRestResourceComponent setReadHistoryElement(BooleanType value) { - this.readHistory = value; - return this; - } - - /** - * @return A flag for whether the server is able to return past versions as part of the vRead operation. - */ - public boolean getReadHistory() { - return this.readHistory == null || this.readHistory.isEmpty() ? false : this.readHistory.getValue(); - } - - /** - * @param value A flag for whether the server is able to return past versions as part of the vRead operation. - */ - public ConformanceRestResourceComponent setReadHistory(boolean value) { - if (this.readHistory == null) - this.readHistory = new BooleanType(); - this.readHistory.setValue(value); - return this; - } - - /** - * @return {@link #updateCreate} (A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.). This is the underlying object with id, value and extensions. The accessor "getUpdateCreate" gives direct access to the value - */ - public BooleanType getUpdateCreateElement() { - if (this.updateCreate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.updateCreate"); - else if (Configuration.doAutoCreate()) - this.updateCreate = new BooleanType(); // bb - return this.updateCreate; - } - - public boolean hasUpdateCreateElement() { - return this.updateCreate != null && !this.updateCreate.isEmpty(); - } - - public boolean hasUpdateCreate() { - return this.updateCreate != null && !this.updateCreate.isEmpty(); - } - - /** - * @param value {@link #updateCreate} (A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.). This is the underlying object with id, value and extensions. The accessor "getUpdateCreate" gives direct access to the value - */ - public ConformanceRestResourceComponent setUpdateCreateElement(BooleanType value) { - this.updateCreate = value; - return this; - } - - /** - * @return A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server. - */ - public boolean getUpdateCreate() { - return this.updateCreate == null || this.updateCreate.isEmpty() ? false : this.updateCreate.getValue(); - } - - /** - * @param value A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server. - */ - public ConformanceRestResourceComponent setUpdateCreate(boolean value) { - if (this.updateCreate == null) - this.updateCreate = new BooleanType(); - this.updateCreate.setValue(value); - return this; - } - - /** - * @return {@link #conditionalCreate} (A flag that indicates that the server supports conditional create.). This is the underlying object with id, value and extensions. The accessor "getConditionalCreate" gives direct access to the value - */ - public BooleanType getConditionalCreateElement() { - if (this.conditionalCreate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.conditionalCreate"); - else if (Configuration.doAutoCreate()) - this.conditionalCreate = new BooleanType(); // bb - return this.conditionalCreate; - } - - public boolean hasConditionalCreateElement() { - return this.conditionalCreate != null && !this.conditionalCreate.isEmpty(); - } - - public boolean hasConditionalCreate() { - return this.conditionalCreate != null && !this.conditionalCreate.isEmpty(); - } - - /** - * @param value {@link #conditionalCreate} (A flag that indicates that the server supports conditional create.). This is the underlying object with id, value and extensions. The accessor "getConditionalCreate" gives direct access to the value - */ - public ConformanceRestResourceComponent setConditionalCreateElement(BooleanType value) { - this.conditionalCreate = value; - return this; - } - - /** - * @return A flag that indicates that the server supports conditional create. - */ - public boolean getConditionalCreate() { - return this.conditionalCreate == null || this.conditionalCreate.isEmpty() ? false : this.conditionalCreate.getValue(); - } - - /** - * @param value A flag that indicates that the server supports conditional create. - */ - public ConformanceRestResourceComponent setConditionalCreate(boolean value) { - if (this.conditionalCreate == null) - this.conditionalCreate = new BooleanType(); - this.conditionalCreate.setValue(value); - return this; - } - - /** - * @return {@link #conditionalUpdate} (A flag that indicates that the server supports conditional update.). This is the underlying object with id, value and extensions. The accessor "getConditionalUpdate" gives direct access to the value - */ - public BooleanType getConditionalUpdateElement() { - if (this.conditionalUpdate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.conditionalUpdate"); - else if (Configuration.doAutoCreate()) - this.conditionalUpdate = new BooleanType(); // bb - return this.conditionalUpdate; - } - - public boolean hasConditionalUpdateElement() { - return this.conditionalUpdate != null && !this.conditionalUpdate.isEmpty(); - } - - public boolean hasConditionalUpdate() { - return this.conditionalUpdate != null && !this.conditionalUpdate.isEmpty(); - } - - /** - * @param value {@link #conditionalUpdate} (A flag that indicates that the server supports conditional update.). This is the underlying object with id, value and extensions. The accessor "getConditionalUpdate" gives direct access to the value - */ - public ConformanceRestResourceComponent setConditionalUpdateElement(BooleanType value) { - this.conditionalUpdate = value; - return this; - } - - /** - * @return A flag that indicates that the server supports conditional update. - */ - public boolean getConditionalUpdate() { - return this.conditionalUpdate == null || this.conditionalUpdate.isEmpty() ? false : this.conditionalUpdate.getValue(); - } - - /** - * @param value A flag that indicates that the server supports conditional update. - */ - public ConformanceRestResourceComponent setConditionalUpdate(boolean value) { - if (this.conditionalUpdate == null) - this.conditionalUpdate = new BooleanType(); - this.conditionalUpdate.setValue(value); - return this; - } - - /** - * @return {@link #conditionalDelete} (A flag that indicates that the server supports conditional delete.). This is the underlying object with id, value and extensions. The accessor "getConditionalDelete" gives direct access to the value - */ - public BooleanType getConditionalDeleteElement() { - if (this.conditionalDelete == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.conditionalDelete"); - else if (Configuration.doAutoCreate()) - this.conditionalDelete = new BooleanType(); // bb - return this.conditionalDelete; - } - - public boolean hasConditionalDeleteElement() { - return this.conditionalDelete != null && !this.conditionalDelete.isEmpty(); - } - - public boolean hasConditionalDelete() { - return this.conditionalDelete != null && !this.conditionalDelete.isEmpty(); - } - - /** - * @param value {@link #conditionalDelete} (A flag that indicates that the server supports conditional delete.). This is the underlying object with id, value and extensions. The accessor "getConditionalDelete" gives direct access to the value - */ - public ConformanceRestResourceComponent setConditionalDeleteElement(BooleanType value) { - this.conditionalDelete = value; - return this; - } - - /** - * @return A flag that indicates that the server supports conditional delete. - */ - public boolean getConditionalDelete() { - return this.conditionalDelete == null || this.conditionalDelete.isEmpty() ? false : this.conditionalDelete.getValue(); - } - - /** - * @param value A flag that indicates that the server supports conditional delete. - */ - public ConformanceRestResourceComponent setConditionalDelete(boolean value) { - if (this.conditionalDelete == null) - this.conditionalDelete = new BooleanType(); - this.conditionalDelete.setValue(value); - return this; - } - - /** - * @return {@link #searchInclude} (A list of _include values supported by the server.) - */ - public List getSearchInclude() { - if (this.searchInclude == null) - this.searchInclude = new ArrayList(); - return this.searchInclude; - } - - public boolean hasSearchInclude() { - if (this.searchInclude == null) - return false; - for (StringType item : this.searchInclude) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #searchInclude} (A list of _include values supported by the server.) - */ - // syntactic sugar - public StringType addSearchIncludeElement() {//2 - StringType t = new StringType(); - if (this.searchInclude == null) - this.searchInclude = new ArrayList(); - this.searchInclude.add(t); - return t; - } - - /** - * @param value {@link #searchInclude} (A list of _include values supported by the server.) - */ - public ConformanceRestResourceComponent addSearchInclude(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.searchInclude == null) - this.searchInclude = new ArrayList(); - this.searchInclude.add(t); - return this; - } - - /** - * @param value {@link #searchInclude} (A list of _include values supported by the server.) - */ - public boolean hasSearchInclude(String value) { - if (this.searchInclude == null) - return false; - for (StringType v : this.searchInclude) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #searchParam} (Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.) - */ - public List getSearchParam() { - if (this.searchParam == null) - this.searchParam = new ArrayList(); - return this.searchParam; - } - - public boolean hasSearchParam() { - if (this.searchParam == null) - return false; - for (ConformanceRestResourceSearchParamComponent item : this.searchParam) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #searchParam} (Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.) - */ - // syntactic sugar - public ConformanceRestResourceSearchParamComponent addSearchParam() { //3 - ConformanceRestResourceSearchParamComponent t = new ConformanceRestResourceSearchParamComponent(); - if (this.searchParam == null) - this.searchParam = new ArrayList(); - this.searchParam.add(t); - return t; - } - - // syntactic sugar - public ConformanceRestResourceComponent addSearchParam(ConformanceRestResourceSearchParamComponent t) { //3 - if (t == null) - return this; - if (this.searchParam == null) - this.searchParam = new ArrayList(); - this.searchParam.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "A type of resource exposed via the restful interface.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.", 0, java.lang.Integer.MAX_VALUE, profile)); - childrenList.add(new Property("interaction", "", "Identifies a restful operation supported by the solution.", 0, java.lang.Integer.MAX_VALUE, interaction)); - childrenList.add(new Property("versioning", "code", "Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources.", 0, java.lang.Integer.MAX_VALUE, versioning)); - childrenList.add(new Property("readHistory", "boolean", "A flag for whether the server is able to return past versions as part of the vRead operation.", 0, java.lang.Integer.MAX_VALUE, readHistory)); - childrenList.add(new Property("updateCreate", "boolean", "A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.", 0, java.lang.Integer.MAX_VALUE, updateCreate)); - childrenList.add(new Property("conditionalCreate", "boolean", "A flag that indicates that the server supports conditional create.", 0, java.lang.Integer.MAX_VALUE, conditionalCreate)); - childrenList.add(new Property("conditionalUpdate", "boolean", "A flag that indicates that the server supports conditional update.", 0, java.lang.Integer.MAX_VALUE, conditionalUpdate)); - childrenList.add(new Property("conditionalDelete", "boolean", "A flag that indicates that the server supports conditional delete.", 0, java.lang.Integer.MAX_VALUE, conditionalDelete)); - childrenList.add(new Property("searchInclude", "string", "A list of _include values supported by the server.", 0, java.lang.Integer.MAX_VALUE, searchInclude)); - childrenList.add(new Property("searchParam", "", "Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.", 0, java.lang.Integer.MAX_VALUE, searchParam)); - } - - public ConformanceRestResourceComponent copy() { - ConformanceRestResourceComponent dst = new ConformanceRestResourceComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.profile = profile == null ? null : profile.copy(); - if (interaction != null) { - dst.interaction = new ArrayList(); - for (ResourceInteractionComponent i : interaction) - dst.interaction.add(i.copy()); - }; - dst.versioning = versioning == null ? null : versioning.copy(); - dst.readHistory = readHistory == null ? null : readHistory.copy(); - dst.updateCreate = updateCreate == null ? null : updateCreate.copy(); - dst.conditionalCreate = conditionalCreate == null ? null : conditionalCreate.copy(); - dst.conditionalUpdate = conditionalUpdate == null ? null : conditionalUpdate.copy(); - dst.conditionalDelete = conditionalDelete == null ? null : conditionalDelete.copy(); - if (searchInclude != null) { - dst.searchInclude = new ArrayList(); - for (StringType i : searchInclude) - dst.searchInclude.add(i.copy()); - }; - if (searchParam != null) { - dst.searchParam = new ArrayList(); - for (ConformanceRestResourceSearchParamComponent i : searchParam) - dst.searchParam.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceRestResourceComponent)) - return false; - ConformanceRestResourceComponent o = (ConformanceRestResourceComponent) other; - return compareDeep(type, o.type, true) && compareDeep(profile, o.profile, true) && compareDeep(interaction, o.interaction, true) - && compareDeep(versioning, o.versioning, true) && compareDeep(readHistory, o.readHistory, true) - && compareDeep(updateCreate, o.updateCreate, true) && compareDeep(conditionalCreate, o.conditionalCreate, true) - && compareDeep(conditionalUpdate, o.conditionalUpdate, true) && compareDeep(conditionalDelete, o.conditionalDelete, true) - && compareDeep(searchInclude, o.searchInclude, true) && compareDeep(searchParam, o.searchParam, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceRestResourceComponent)) - return false; - ConformanceRestResourceComponent o = (ConformanceRestResourceComponent) other; - return compareValues(type, o.type, true) && compareValues(versioning, o.versioning, true) && compareValues(readHistory, o.readHistory, true) - && compareValues(updateCreate, o.updateCreate, true) && compareValues(conditionalCreate, o.conditionalCreate, true) - && compareValues(conditionalUpdate, o.conditionalUpdate, true) && compareValues(conditionalDelete, o.conditionalDelete, true) - && compareValues(searchInclude, o.searchInclude, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (profile == null || profile.isEmpty()) - && (interaction == null || interaction.isEmpty()) && (versioning == null || versioning.isEmpty()) - && (readHistory == null || readHistory.isEmpty()) && (updateCreate == null || updateCreate.isEmpty()) - && (conditionalCreate == null || conditionalCreate.isEmpty()) && (conditionalUpdate == null || conditionalUpdate.isEmpty()) - && (conditionalDelete == null || conditionalDelete.isEmpty()) && (searchInclude == null || searchInclude.isEmpty()) - && (searchParam == null || searchParam.isEmpty()); - } - - } - - @Block() - public static class ResourceInteractionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Coded identifier of the operation, supported by the system resource. - */ - @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="read | vread | update | delete | history-instance | validate | history-type | create | search-type", formalDefinition="Coded identifier of the operation, supported by the system resource." ) - protected Enumeration code; - - /** - * Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'. - */ - @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Anything special about operation behavior", formalDefinition="Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'." ) - protected StringType documentation; - - private static final long serialVersionUID = -437507806L; - - /* - * Constructor - */ - public ResourceInteractionComponent() { - super(); - } - - /* - * Constructor - */ - public ResourceInteractionComponent(Enumeration code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Coded identifier of the operation, supported by the system resource.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Enumeration getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ResourceInteractionComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Enumeration(new TypeRestfulInteractionEnumFactory()); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Coded identifier of the operation, supported by the system resource.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public ResourceInteractionComponent setCodeElement(Enumeration value) { - this.code = value; - return this; - } - - /** - * @return Coded identifier of the operation, supported by the system resource. - */ - public TypeRestfulInteraction getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Coded identifier of the operation, supported by the system resource. - */ - public ResourceInteractionComponent setCode(TypeRestfulInteraction value) { - if (this.code == null) - this.code = new Enumeration(new TypeRestfulInteractionEnumFactory()); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ResourceInteractionComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public ResourceInteractionComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'. - */ - public ResourceInteractionComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "Coded identifier of the operation, supported by the system resource.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("documentation", "string", "Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.", 0, java.lang.Integer.MAX_VALUE, documentation)); - } - - public ResourceInteractionComponent copy() { - ResourceInteractionComponent dst = new ResourceInteractionComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ResourceInteractionComponent)) - return false; - ResourceInteractionComponent o = (ResourceInteractionComponent) other; - return compareDeep(code, o.code, true) && compareDeep(documentation, o.documentation, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ResourceInteractionComponent)) - return false; - ResourceInteractionComponent o = (ResourceInteractionComponent) other; - return compareValues(code, o.code, true) && compareValues(documentation, o.documentation, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (documentation == null || documentation.isEmpty()) - ; - } - - } - - @Block() - public static class ConformanceRestResourceSearchParamComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of the search parameter used in the interface. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Name of search parameter", formalDefinition="The name of the search parameter used in the interface." ) - protected StringType name; - - /** - * An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]). - */ - @Child(name = "definition", type = {UriType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Source of definition for parameter", formalDefinition="An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]])." ) - protected UriType definition; - - /** - * The type of value a search parameter refers to, and how the content is interpreted. - */ - @Child(name = "type", type = {CodeType.class}, order=3, min=1, max=1) - @Description(shortDefinition="number | date | string | token | reference | composite | quantity | uri", formalDefinition="The type of value a search parameter refers to, and how the content is interpreted." ) - protected Enumeration type; - - /** - * This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. - */ - @Child(name = "documentation", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Server-specific usage", formalDefinition="This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms." ) - protected StringType documentation; - - /** - * Types of resource (if a resource is referenced). - */ - @Child(name = "target", type = {CodeType.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Types of resource (if a resource reference)", formalDefinition="Types of resource (if a resource is referenced)." ) - protected List target; - - /** - * Chained names supported. - */ - @Child(name = "chain", type = {StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Chained names supported", formalDefinition="Chained names supported." ) - protected List chain; - - private static final long serialVersionUID = 938312816L; - - /* - * Constructor - */ - public ConformanceRestResourceSearchParamComponent() { - super(); - } - - /* - * Constructor - */ - public ConformanceRestResourceSearchParamComponent(StringType name, Enumeration type) { - super(); - this.name = name; - this.type = type; - } - - /** - * @return {@link #name} (The name of the search parameter used in the interface.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceSearchParamComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of the search parameter used in the interface.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ConformanceRestResourceSearchParamComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of the search parameter used in the interface. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of the search parameter used in the interface. - */ - public ConformanceRestResourceSearchParamComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #definition} (An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public UriType getDefinitionElement() { - if (this.definition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceSearchParamComponent.definition"); - else if (Configuration.doAutoCreate()) - this.definition = new UriType(); // bb - return this.definition; - } - - public boolean hasDefinitionElement() { - return this.definition != null && !this.definition.isEmpty(); - } - - public boolean hasDefinition() { - return this.definition != null && !this.definition.isEmpty(); - } - - /** - * @param value {@link #definition} (An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public ConformanceRestResourceSearchParamComponent setDefinitionElement(UriType value) { - this.definition = value; - return this; - } - - /** - * @return An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]). - */ - public String getDefinition() { - return this.definition == null ? null : this.definition.getValue(); - } - - /** - * @param value An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]). - */ - public ConformanceRestResourceSearchParamComponent setDefinition(String value) { - if (Utilities.noString(value)) - this.definition = null; - else { - if (this.definition == null) - this.definition = new UriType(); - this.definition.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceSearchParamComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new SearchParamTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ConformanceRestResourceSearchParamComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The type of value a search parameter refers to, and how the content is interpreted. - */ - public SearchParamType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of value a search parameter refers to, and how the content is interpreted. - */ - public ConformanceRestResourceSearchParamComponent setType(SearchParamType value) { - if (this.type == null) - this.type = new Enumeration(new SearchParamTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceSearchParamComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public ConformanceRestResourceSearchParamComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. - */ - public ConformanceRestResourceSearchParamComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (Types of resource (if a resource is referenced).) - */ - public List getTarget() { - if (this.target == null) - this.target = new ArrayList(); - return this.target; - } - - public boolean hasTarget() { - if (this.target == null) - return false; - for (CodeType item : this.target) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #target} (Types of resource (if a resource is referenced).) - */ - // syntactic sugar - public CodeType addTargetElement() {//2 - CodeType t = new CodeType(); - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return t; - } - - /** - * @param value {@link #target} (Types of resource (if a resource is referenced).) - */ - public ConformanceRestResourceSearchParamComponent addTarget(String value) { //1 - CodeType t = new CodeType(); - t.setValue(value); - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return this; - } - - /** - * @param value {@link #target} (Types of resource (if a resource is referenced).) - */ - public boolean hasTarget(String value) { - if (this.target == null) - return false; - for (CodeType v : this.target) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #chain} (Chained names supported.) - */ - public List getChain() { - if (this.chain == null) - this.chain = new ArrayList(); - return this.chain; - } - - public boolean hasChain() { - if (this.chain == null) - return false; - for (StringType item : this.chain) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #chain} (Chained names supported.) - */ - // syntactic sugar - public StringType addChainElement() {//2 - StringType t = new StringType(); - if (this.chain == null) - this.chain = new ArrayList(); - this.chain.add(t); - return t; - } - - /** - * @param value {@link #chain} (Chained names supported.) - */ - public ConformanceRestResourceSearchParamComponent addChain(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.chain == null) - this.chain = new ArrayList(); - this.chain.add(t); - return this; - } - - /** - * @param value {@link #chain} (Chained names supported.) - */ - public boolean hasChain(String value) { - if (this.chain == null) - return false; - for (StringType v : this.chain) - if (v.equals(value)) // string - return true; - return false; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of the search parameter used in the interface.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("definition", "uri", "An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).", 0, java.lang.Integer.MAX_VALUE, definition)); - childrenList.add(new Property("type", "code", "The type of value a search parameter refers to, and how the content is interpreted.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("documentation", "string", "This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("target", "code", "Types of resource (if a resource is referenced).", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("chain", "string", "Chained names supported.", 0, java.lang.Integer.MAX_VALUE, chain)); - } - - public ConformanceRestResourceSearchParamComponent copy() { - ConformanceRestResourceSearchParamComponent dst = new ConformanceRestResourceSearchParamComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.definition = definition == null ? null : definition.copy(); - dst.type = type == null ? null : type.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - if (target != null) { - dst.target = new ArrayList(); - for (CodeType i : target) - dst.target.add(i.copy()); - }; - if (chain != null) { - dst.chain = new ArrayList(); - for (StringType i : chain) - dst.chain.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceRestResourceSearchParamComponent)) - return false; - ConformanceRestResourceSearchParamComponent o = (ConformanceRestResourceSearchParamComponent) other; - return compareDeep(name, o.name, true) && compareDeep(definition, o.definition, true) && compareDeep(type, o.type, true) - && compareDeep(documentation, o.documentation, true) && compareDeep(target, o.target, true) && compareDeep(chain, o.chain, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceRestResourceSearchParamComponent)) - return false; - ConformanceRestResourceSearchParamComponent o = (ConformanceRestResourceSearchParamComponent) other; - return compareValues(name, o.name, true) && compareValues(definition, o.definition, true) && compareValues(type, o.type, true) - && compareValues(documentation, o.documentation, true) && compareValues(target, o.target, true) && compareValues(chain, o.chain, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (definition == null || definition.isEmpty()) - && (type == null || type.isEmpty()) && (documentation == null || documentation.isEmpty()) - && (target == null || target.isEmpty()) && (chain == null || chain.isEmpty()); - } - - } - - @Block() - public static class SystemInteractionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A coded identifier of the operation, supported by the system. - */ - @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="transaction | search-system | history-system", formalDefinition="A coded identifier of the operation, supported by the system." ) - protected Enumeration code; - - /** - * Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented. - */ - @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Anything special about operation behavior", formalDefinition="Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented." ) - protected StringType documentation; - - private static final long serialVersionUID = 510675287L; - - /* - * Constructor - */ - public SystemInteractionComponent() { - super(); - } - - /* - * Constructor - */ - public SystemInteractionComponent(Enumeration code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (A coded identifier of the operation, supported by the system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Enumeration getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SystemInteractionComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Enumeration(new SystemRestfulInteractionEnumFactory()); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A coded identifier of the operation, supported by the system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public SystemInteractionComponent setCodeElement(Enumeration value) { - this.code = value; - return this; - } - - /** - * @return A coded identifier of the operation, supported by the system. - */ - public SystemRestfulInteraction getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value A coded identifier of the operation, supported by the system. - */ - public SystemInteractionComponent setCode(SystemRestfulInteraction value) { - if (this.code == null) - this.code = new Enumeration(new SystemRestfulInteractionEnumFactory()); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SystemInteractionComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public SystemInteractionComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented. - */ - public SystemInteractionComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "A coded identifier of the operation, supported by the system.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("documentation", "string", "Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.", 0, java.lang.Integer.MAX_VALUE, documentation)); - } - - public SystemInteractionComponent copy() { - SystemInteractionComponent dst = new SystemInteractionComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SystemInteractionComponent)) - return false; - SystemInteractionComponent o = (SystemInteractionComponent) other; - return compareDeep(code, o.code, true) && compareDeep(documentation, o.documentation, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SystemInteractionComponent)) - return false; - SystemInteractionComponent o = (SystemInteractionComponent) other; - return compareValues(code, o.code, true) && compareValues(documentation, o.documentation, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (documentation == null || documentation.isEmpty()) - ; - } - - } - - @Block() - public static class ConformanceRestOperationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of a query, which is used in the _query parameter when the query is called. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Name by which the operation/query is invoked", formalDefinition="The name of a query, which is used in the _query parameter when the query is called." ) - protected StringType name; - - /** - * Where the formal definition can be found. - */ - @Child(name = "definition", type = {OperationDefinition.class}, order=2, min=1, max=1) - @Description(shortDefinition="The defined operation/query", formalDefinition="Where the formal definition can be found." ) - protected Reference definition; - - /** - * The actual object that is the target of the reference (Where the formal definition can be found.) - */ - protected OperationDefinition definitionTarget; - - private static final long serialVersionUID = 122107272L; - - /* - * Constructor - */ - public ConformanceRestOperationComponent() { - super(); - } - - /* - * Constructor - */ - public ConformanceRestOperationComponent(StringType name, Reference definition) { - super(); - this.name = name; - this.definition = definition; - } - - /** - * @return {@link #name} (The name of a query, which is used in the _query parameter when the query is called.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestOperationComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of a query, which is used in the _query parameter when the query is called.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ConformanceRestOperationComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of a query, which is used in the _query parameter when the query is called. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of a query, which is used in the _query parameter when the query is called. - */ - public ConformanceRestOperationComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #definition} (Where the formal definition can be found.) - */ - public Reference getDefinition() { - if (this.definition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestOperationComponent.definition"); - else if (Configuration.doAutoCreate()) - this.definition = new Reference(); // cc - return this.definition; - } - - public boolean hasDefinition() { - return this.definition != null && !this.definition.isEmpty(); - } - - /** - * @param value {@link #definition} (Where the formal definition can be found.) - */ - public ConformanceRestOperationComponent setDefinition(Reference value) { - this.definition = value; - return this; - } - - /** - * @return {@link #definition} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Where the formal definition can be found.) - */ - public OperationDefinition getDefinitionTarget() { - if (this.definitionTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestOperationComponent.definition"); - else if (Configuration.doAutoCreate()) - this.definitionTarget = new OperationDefinition(); // aa - return this.definitionTarget; - } - - /** - * @param value {@link #definition} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Where the formal definition can be found.) - */ - public ConformanceRestOperationComponent setDefinitionTarget(OperationDefinition value) { - this.definitionTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of a query, which is used in the _query parameter when the query is called.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("definition", "Reference(OperationDefinition)", "Where the formal definition can be found.", 0, java.lang.Integer.MAX_VALUE, definition)); - } - - public ConformanceRestOperationComponent copy() { - ConformanceRestOperationComponent dst = new ConformanceRestOperationComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.definition = definition == null ? null : definition.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceRestOperationComponent)) - return false; - ConformanceRestOperationComponent o = (ConformanceRestOperationComponent) other; - return compareDeep(name, o.name, true) && compareDeep(definition, o.definition, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceRestOperationComponent)) - return false; - ConformanceRestOperationComponent o = (ConformanceRestOperationComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (definition == null || definition.isEmpty()) - ; - } - - } - - @Block() - public static class ConformanceMessagingComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An address to which messages and/or replies are to be sent. - */ - @Child(name = "endpoint", type = {UriType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Actual endpoint being described", formalDefinition="An address to which messages and/or replies are to be sent." ) - protected UriType endpoint; - - /** - * Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender). - */ - @Child(name = "reliableCache", type = {UnsignedIntType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Reliable Message Cache Length (min)", formalDefinition="Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender)." ) - protected UnsignedIntType reliableCache; - - /** - * Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner. - */ - @Child(name = "documentation", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Messaging interface behavior details", formalDefinition="Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner." ) - protected StringType documentation; - - /** - * A description of the solution's support for an event at this end point. - */ - @Child(name = "event", type = {}, order=4, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Declare support for this event", formalDefinition="A description of the solution's support for an event at this end point." ) - protected List event; - - private static final long serialVersionUID = -1356115534L; - - /* - * Constructor - */ - public ConformanceMessagingComponent() { - super(); - } - - /** - * @return {@link #endpoint} (An address to which messages and/or replies are to be sent.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value - */ - public UriType getEndpointElement() { - if (this.endpoint == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingComponent.endpoint"); - else if (Configuration.doAutoCreate()) - this.endpoint = new UriType(); // bb - return this.endpoint; - } - - public boolean hasEndpointElement() { - return this.endpoint != null && !this.endpoint.isEmpty(); - } - - public boolean hasEndpoint() { - return this.endpoint != null && !this.endpoint.isEmpty(); - } - - /** - * @param value {@link #endpoint} (An address to which messages and/or replies are to be sent.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value - */ - public ConformanceMessagingComponent setEndpointElement(UriType value) { - this.endpoint = value; - return this; - } - - /** - * @return An address to which messages and/or replies are to be sent. - */ - public String getEndpoint() { - return this.endpoint == null ? null : this.endpoint.getValue(); - } - - /** - * @param value An address to which messages and/or replies are to be sent. - */ - public ConformanceMessagingComponent setEndpoint(String value) { - if (Utilities.noString(value)) - this.endpoint = null; - else { - if (this.endpoint == null) - this.endpoint = new UriType(); - this.endpoint.setValue(value); - } - return this; - } - - /** - * @return {@link #reliableCache} (Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).). This is the underlying object with id, value and extensions. The accessor "getReliableCache" gives direct access to the value - */ - public UnsignedIntType getReliableCacheElement() { - if (this.reliableCache == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingComponent.reliableCache"); - else if (Configuration.doAutoCreate()) - this.reliableCache = new UnsignedIntType(); // bb - return this.reliableCache; - } - - public boolean hasReliableCacheElement() { - return this.reliableCache != null && !this.reliableCache.isEmpty(); - } - - public boolean hasReliableCache() { - return this.reliableCache != null && !this.reliableCache.isEmpty(); - } - - /** - * @param value {@link #reliableCache} (Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).). This is the underlying object with id, value and extensions. The accessor "getReliableCache" gives direct access to the value - */ - public ConformanceMessagingComponent setReliableCacheElement(UnsignedIntType value) { - this.reliableCache = value; - return this; - } - - /** - * @return Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender). - */ - public int getReliableCache() { - return this.reliableCache == null || this.reliableCache.isEmpty() ? 0 : this.reliableCache.getValue(); - } - - /** - * @param value Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender). - */ - public ConformanceMessagingComponent setReliableCache(int value) { - if (this.reliableCache == null) - this.reliableCache = new UnsignedIntType(); - this.reliableCache.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public ConformanceMessagingComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner. - */ - public ConformanceMessagingComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - /** - * @return {@link #event} (A description of the solution's support for an event at this end point.) - */ - public List getEvent() { - if (this.event == null) - this.event = new ArrayList(); - return this.event; - } - - public boolean hasEvent() { - if (this.event == null) - return false; - for (ConformanceMessagingEventComponent item : this.event) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #event} (A description of the solution's support for an event at this end point.) - */ - // syntactic sugar - public ConformanceMessagingEventComponent addEvent() { //3 - ConformanceMessagingEventComponent t = new ConformanceMessagingEventComponent(); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return t; - } - - // syntactic sugar - public ConformanceMessagingComponent addEvent(ConformanceMessagingEventComponent t) { //3 - if (t == null) - return this; - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("endpoint", "uri", "An address to which messages and/or replies are to be sent.", 0, java.lang.Integer.MAX_VALUE, endpoint)); - childrenList.add(new Property("reliableCache", "unsignedInt", "Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).", 0, java.lang.Integer.MAX_VALUE, reliableCache)); - childrenList.add(new Property("documentation", "string", "Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("event", "", "A description of the solution's support for an event at this end point.", 0, java.lang.Integer.MAX_VALUE, event)); - } - - public ConformanceMessagingComponent copy() { - ConformanceMessagingComponent dst = new ConformanceMessagingComponent(); - copyValues(dst); - dst.endpoint = endpoint == null ? null : endpoint.copy(); - dst.reliableCache = reliableCache == null ? null : reliableCache.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - if (event != null) { - dst.event = new ArrayList(); - for (ConformanceMessagingEventComponent i : event) - dst.event.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceMessagingComponent)) - return false; - ConformanceMessagingComponent o = (ConformanceMessagingComponent) other; - return compareDeep(endpoint, o.endpoint, true) && compareDeep(reliableCache, o.reliableCache, true) - && compareDeep(documentation, o.documentation, true) && compareDeep(event, o.event, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceMessagingComponent)) - return false; - ConformanceMessagingComponent o = (ConformanceMessagingComponent) other; - return compareValues(endpoint, o.endpoint, true) && compareValues(reliableCache, o.reliableCache, true) - && compareValues(documentation, o.documentation, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (endpoint == null || endpoint.isEmpty()) && (reliableCache == null || reliableCache.isEmpty()) - && (documentation == null || documentation.isEmpty()) && (event == null || event.isEmpty()) - ; - } - - } - - @Block() - public static class ConformanceMessagingEventComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A coded identifier of a supported messaging event. - */ - @Child(name = "code", type = {Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Event type", formalDefinition="A coded identifier of a supported messaging event." ) - protected Coding code; - - /** - * The impact of the content of the message. - */ - @Child(name = "category", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Consequence | Currency | Notification", formalDefinition="The impact of the content of the message." ) - protected Enumeration category; - - /** - * The mode of this event declaration - whether application is sender or receiver. - */ - @Child(name = "mode", type = {CodeType.class}, order=3, min=1, max=1) - @Description(shortDefinition="sender | receiver", formalDefinition="The mode of this event declaration - whether application is sender or receiver." ) - protected Enumeration mode; - - /** - * A list of the messaging transport protocol(s) identifiers, supported by this endpoint. - */ - @Child(name = "protocol", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="http | ftp | mllp +", formalDefinition="A list of the messaging transport protocol(s) identifiers, supported by this endpoint." ) - protected List protocol; - - /** - * A resource associated with the event. This is the resource that defines the event. - */ - @Child(name = "focus", type = {CodeType.class}, order=5, min=1, max=1) - @Description(shortDefinition="Resource that's focus of message", formalDefinition="A resource associated with the event. This is the resource that defines the event." ) - protected CodeType focus; - - /** - * Information about the request for this event. - */ - @Child(name = "request", type = {StructureDefinition.class}, order=6, min=1, max=1) - @Description(shortDefinition="Profile that describes the request", formalDefinition="Information about the request for this event." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (Information about the request for this event.) - */ - protected StructureDefinition requestTarget; - - /** - * Information about the response for this event. - */ - @Child(name = "response", type = {StructureDefinition.class}, order=7, min=1, max=1) - @Description(shortDefinition="Profile that describes the response", formalDefinition="Information about the response for this event." ) - protected Reference response; - - /** - * The actual object that is the target of the reference (Information about the response for this event.) - */ - protected StructureDefinition responseTarget; - - /** - * Guidance on how this event is handled, such as internal system trigger points, business rules, etc. - */ - @Child(name = "documentation", type = {StringType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Endpoint-specific event documentation", formalDefinition="Guidance on how this event is handled, such as internal system trigger points, business rules, etc." ) - protected StringType documentation; - - private static final long serialVersionUID = 1680159501L; - - /* - * Constructor - */ - public ConformanceMessagingEventComponent() { - super(); - } - - /* - * Constructor - */ - public ConformanceMessagingEventComponent(Coding code, Enumeration mode, CodeType focus, Reference request, Reference response) { - super(); - this.code = code; - this.mode = mode; - this.focus = focus; - this.request = request; - this.response = response; - } - - /** - * @return {@link #code} (A coded identifier of a supported messaging event.) - */ - public Coding getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Coding(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A coded identifier of a supported messaging event.) - */ - public ConformanceMessagingEventComponent setCode(Coding value) { - this.code = value; - return this; - } - - /** - * @return {@link #category} (The impact of the content of the message.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public Enumeration getCategoryElement() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.category"); - else if (Configuration.doAutoCreate()) - this.category = new Enumeration(new MessageSignificanceCategoryEnumFactory()); // bb - return this.category; - } - - public boolean hasCategoryElement() { - return this.category != null && !this.category.isEmpty(); - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (The impact of the content of the message.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public ConformanceMessagingEventComponent setCategoryElement(Enumeration value) { - this.category = value; - return this; - } - - /** - * @return The impact of the content of the message. - */ - public MessageSignificanceCategory getCategory() { - return this.category == null ? null : this.category.getValue(); - } - - /** - * @param value The impact of the content of the message. - */ - public ConformanceMessagingEventComponent setCategory(MessageSignificanceCategory value) { - if (value == null) - this.category = null; - else { - if (this.category == null) - this.category = new Enumeration(new MessageSignificanceCategoryEnumFactory()); - this.category.setValue(value); - } - return this; - } - - /** - * @return {@link #mode} (The mode of this event declaration - whether application is sender or receiver.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Enumeration getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(new MessageConformanceEventModeEnumFactory()); // bb - return this.mode; - } - - public boolean hasModeElement() { - return this.mode != null && !this.mode.isEmpty(); - } - - public boolean hasMode() { - return this.mode != null && !this.mode.isEmpty(); - } - - /** - * @param value {@link #mode} (The mode of this event declaration - whether application is sender or receiver.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public ConformanceMessagingEventComponent setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return The mode of this event declaration - whether application is sender or receiver. - */ - public MessageConformanceEventMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value The mode of this event declaration - whether application is sender or receiver. - */ - public ConformanceMessagingEventComponent setMode(MessageConformanceEventMode value) { - if (this.mode == null) - this.mode = new Enumeration(new MessageConformanceEventModeEnumFactory()); - this.mode.setValue(value); - return this; - } - - /** - * @return {@link #protocol} (A list of the messaging transport protocol(s) identifiers, supported by this endpoint.) - */ - public List getProtocol() { - if (this.protocol == null) - this.protocol = new ArrayList(); - return this.protocol; - } - - public boolean hasProtocol() { - if (this.protocol == null) - return false; - for (Coding item : this.protocol) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #protocol} (A list of the messaging transport protocol(s) identifiers, supported by this endpoint.) - */ - // syntactic sugar - public Coding addProtocol() { //3 - Coding t = new Coding(); - if (this.protocol == null) - this.protocol = new ArrayList(); - this.protocol.add(t); - return t; - } - - // syntactic sugar - public ConformanceMessagingEventComponent addProtocol(Coding t) { //3 - if (t == null) - return this; - if (this.protocol == null) - this.protocol = new ArrayList(); - this.protocol.add(t); - return this; - } - - /** - * @return {@link #focus} (A resource associated with the event. This is the resource that defines the event.). This is the underlying object with id, value and extensions. The accessor "getFocus" gives direct access to the value - */ - public CodeType getFocusElement() { - if (this.focus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.focus"); - else if (Configuration.doAutoCreate()) - this.focus = new CodeType(); // bb - return this.focus; - } - - public boolean hasFocusElement() { - return this.focus != null && !this.focus.isEmpty(); - } - - public boolean hasFocus() { - return this.focus != null && !this.focus.isEmpty(); - } - - /** - * @param value {@link #focus} (A resource associated with the event. This is the resource that defines the event.). This is the underlying object with id, value and extensions. The accessor "getFocus" gives direct access to the value - */ - public ConformanceMessagingEventComponent setFocusElement(CodeType value) { - this.focus = value; - return this; - } - - /** - * @return A resource associated with the event. This is the resource that defines the event. - */ - public String getFocus() { - return this.focus == null ? null : this.focus.getValue(); - } - - /** - * @param value A resource associated with the event. This is the resource that defines the event. - */ - public ConformanceMessagingEventComponent setFocus(String value) { - if (this.focus == null) - this.focus = new CodeType(); - this.focus.setValue(value); - return this; - } - - /** - * @return {@link #request} (Information about the request for this event.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); // cc - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Information about the request for this event.) - */ - public ConformanceMessagingEventComponent setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Information about the request for this event.) - */ - public StructureDefinition getRequestTarget() { - if (this.requestTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.request"); - else if (Configuration.doAutoCreate()) - this.requestTarget = new StructureDefinition(); // aa - return this.requestTarget; - } - - /** - * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Information about the request for this event.) - */ - public ConformanceMessagingEventComponent setRequestTarget(StructureDefinition value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #response} (Information about the response for this event.) - */ - public Reference getResponse() { - if (this.response == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.response"); - else if (Configuration.doAutoCreate()) - this.response = new Reference(); // cc - return this.response; - } - - public boolean hasResponse() { - return this.response != null && !this.response.isEmpty(); - } - - /** - * @param value {@link #response} (Information about the response for this event.) - */ - public ConformanceMessagingEventComponent setResponse(Reference value) { - this.response = value; - return this; - } - - /** - * @return {@link #response} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Information about the response for this event.) - */ - public StructureDefinition getResponseTarget() { - if (this.responseTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.response"); - else if (Configuration.doAutoCreate()) - this.responseTarget = new StructureDefinition(); // aa - return this.responseTarget; - } - - /** - * @param value {@link #response} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Information about the response for this event.) - */ - public ConformanceMessagingEventComponent setResponseTarget(StructureDefinition value) { - this.responseTarget = value; - return this; - } - - /** - * @return {@link #documentation} (Guidance on how this event is handled, such as internal system trigger points, business rules, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (Guidance on how this event is handled, such as internal system trigger points, business rules, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public ConformanceMessagingEventComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Guidance on how this event is handled, such as internal system trigger points, business rules, etc. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Guidance on how this event is handled, such as internal system trigger points, business rules, etc. - */ - public ConformanceMessagingEventComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "Coding", "A coded identifier of a supported messaging event.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("category", "code", "The impact of the content of the message.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("mode", "code", "The mode of this event declaration - whether application is sender or receiver.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("protocol", "Coding", "A list of the messaging transport protocol(s) identifiers, supported by this endpoint.", 0, java.lang.Integer.MAX_VALUE, protocol)); - childrenList.add(new Property("focus", "code", "A resource associated with the event. This is the resource that defines the event.", 0, java.lang.Integer.MAX_VALUE, focus)); - childrenList.add(new Property("request", "Reference(StructureDefinition)", "Information about the request for this event.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("response", "Reference(StructureDefinition)", "Information about the response for this event.", 0, java.lang.Integer.MAX_VALUE, response)); - childrenList.add(new Property("documentation", "string", "Guidance on how this event is handled, such as internal system trigger points, business rules, etc.", 0, java.lang.Integer.MAX_VALUE, documentation)); - } - - public ConformanceMessagingEventComponent copy() { - ConformanceMessagingEventComponent dst = new ConformanceMessagingEventComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.category = category == null ? null : category.copy(); - dst.mode = mode == null ? null : mode.copy(); - if (protocol != null) { - dst.protocol = new ArrayList(); - for (Coding i : protocol) - dst.protocol.add(i.copy()); - }; - dst.focus = focus == null ? null : focus.copy(); - dst.request = request == null ? null : request.copy(); - dst.response = response == null ? null : response.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceMessagingEventComponent)) - return false; - ConformanceMessagingEventComponent o = (ConformanceMessagingEventComponent) other; - return compareDeep(code, o.code, true) && compareDeep(category, o.category, true) && compareDeep(mode, o.mode, true) - && compareDeep(protocol, o.protocol, true) && compareDeep(focus, o.focus, true) && compareDeep(request, o.request, true) - && compareDeep(response, o.response, true) && compareDeep(documentation, o.documentation, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceMessagingEventComponent)) - return false; - ConformanceMessagingEventComponent o = (ConformanceMessagingEventComponent) other; - return compareValues(category, o.category, true) && compareValues(mode, o.mode, true) && compareValues(focus, o.focus, true) - && compareValues(documentation, o.documentation, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (category == null || category.isEmpty()) - && (mode == null || mode.isEmpty()) && (protocol == null || protocol.isEmpty()) && (focus == null || focus.isEmpty()) - && (request == null || request.isEmpty()) && (response == null || response.isEmpty()) && (documentation == null || documentation.isEmpty()) - ; - } - - } - - @Block() - public static class ConformanceDocumentComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Mode of this document declaration - whether application is producer or consumer. - */ - @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="producer | consumer", formalDefinition="Mode of this document declaration - whether application is producer or consumer." ) - protected Enumeration mode; - - /** - * A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc. - */ - @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Description of document support", formalDefinition="A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc." ) - protected StringType documentation; - - /** - * A constraint on a resource used in the document. - */ - @Child(name = "profile", type = {StructureDefinition.class}, order=3, min=1, max=1) - @Description(shortDefinition="Constraint on a resource used in the document", formalDefinition="A constraint on a resource used in the document." ) - protected Reference profile; - - /** - * The actual object that is the target of the reference (A constraint on a resource used in the document.) - */ - protected StructureDefinition profileTarget; - - private static final long serialVersionUID = -1059555053L; - - /* - * Constructor - */ - public ConformanceDocumentComponent() { - super(); - } - - /* - * Constructor - */ - public ConformanceDocumentComponent(Enumeration mode, Reference profile) { - super(); - this.mode = mode; - this.profile = profile; - } - - /** - * @return {@link #mode} (Mode of this document declaration - whether application is producer or consumer.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Enumeration getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceDocumentComponent.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(new DocumentModeEnumFactory()); // bb - return this.mode; - } - - public boolean hasModeElement() { - return this.mode != null && !this.mode.isEmpty(); - } - - public boolean hasMode() { - return this.mode != null && !this.mode.isEmpty(); - } - - /** - * @param value {@link #mode} (Mode of this document declaration - whether application is producer or consumer.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public ConformanceDocumentComponent setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return Mode of this document declaration - whether application is producer or consumer. - */ - public DocumentMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value Mode of this document declaration - whether application is producer or consumer. - */ - public ConformanceDocumentComponent setMode(DocumentMode value) { - if (this.mode == null) - this.mode = new Enumeration(new DocumentModeEnumFactory()); - this.mode.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceDocumentComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public ConformanceDocumentComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc. - */ - public ConformanceDocumentComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - /** - * @return {@link #profile} (A constraint on a resource used in the document.) - */ - public Reference getProfile() { - if (this.profile == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceDocumentComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profile = new Reference(); // cc - return this.profile; - } - - public boolean hasProfile() { - return this.profile != null && !this.profile.isEmpty(); - } - - /** - * @param value {@link #profile} (A constraint on a resource used in the document.) - */ - public ConformanceDocumentComponent setProfile(Reference value) { - this.profile = value; - return this; - } - - /** - * @return {@link #profile} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A constraint on a resource used in the document.) - */ - public StructureDefinition getProfileTarget() { - if (this.profileTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceDocumentComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profileTarget = new StructureDefinition(); // aa - return this.profileTarget; - } - - /** - * @param value {@link #profile} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A constraint on a resource used in the document.) - */ - public ConformanceDocumentComponent setProfileTarget(StructureDefinition value) { - this.profileTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("mode", "code", "Mode of this document declaration - whether application is producer or consumer.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("documentation", "string", "A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A constraint on a resource used in the document.", 0, java.lang.Integer.MAX_VALUE, profile)); - } - - public ConformanceDocumentComponent copy() { - ConformanceDocumentComponent dst = new ConformanceDocumentComponent(); - copyValues(dst); - dst.mode = mode == null ? null : mode.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - dst.profile = profile == null ? null : profile.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceDocumentComponent)) - return false; - ConformanceDocumentComponent o = (ConformanceDocumentComponent) other; - return compareDeep(mode, o.mode, true) && compareDeep(documentation, o.documentation, true) && compareDeep(profile, o.profile, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceDocumentComponent)) - return false; - ConformanceDocumentComponent o = (ConformanceDocumentComponent) other; - return compareValues(mode, o.mode, true) && compareValues(documentation, o.documentation, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (mode == null || mode.isEmpty()) && (documentation == null || documentation.isEmpty()) - && (profile == null || profile.isEmpty()); - } - - } - - /** - * An absolute uri that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). - */ - @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Logical uri to reference this statement", formalDefinition="An absolute uri that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:)." ) - protected UriType url; - - /** - * The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Logical id for this version of the statement", formalDefinition="The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) - protected StringType version; - - /** - * A free text natural language name identifying the conformance statement. - */ - @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Informal name for this conformance statement", formalDefinition="A free text natural language name identifying the conformance statement." ) - protected StringType name; - - /** - * The name of the individual or organization that published the conformance. - */ - @Child(name = "publisher", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the conformance." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. - */ - @Child(name = "description", type = {StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Human description of the conformance statement", formalDefinition="A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP." ) - protected StringType description; - - /** - * Explains why this conformance statement is needed and why it's been constrained as it has. - */ - @Child(name = "requirements", type = {StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Why is this needed?", formalDefinition="Explains why this conformance statement is needed and why it's been constrained as it has." ) - protected StringType requirements; - - /** - * A copyright statement relating to the conformamce statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement. - */ - @Child(name = "copyright", type = {StringType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Use and/or Publishing restrictions", formalDefinition="A copyright statement relating to the conformamce statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement." ) - protected StringType copyright; - - /** - * The status of this conformance statement. - */ - @Child(name = "status", type = {CodeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of this conformance statement." ) - protected Enumeration status; - - /** - * A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name = "experimental", type = {BooleanType.class}, order=9, min=0, max=1) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The date (and optionally time) when the conformance statement was published. - */ - @Child(name = "date", type = {DateTimeType.class}, order=10, min=1, max=1) - @Description(shortDefinition="Publication Date(/time)", formalDefinition="The date (and optionally time) when the conformance statement was published." ) - protected DateTimeType date; - - /** - * Software that is covered by this conformance statement. It is used when the conformance statement describes the capabilities of a particular software version, independent of an installation. - */ - @Child(name = "software", type = {}, order=11, min=0, max=1) - @Description(shortDefinition="Software that is covered by this conformance statement", formalDefinition="Software that is covered by this conformance statement. It is used when the conformance statement describes the capabilities of a particular software version, independent of an installation." ) - protected ConformanceSoftwareComponent software; - - /** - * Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program. - */ - @Child(name = "implementation", type = {}, order=12, min=0, max=1) - @Description(shortDefinition="If this describes a specific instance", formalDefinition="Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program." ) - protected ConformanceImplementationComponent implementation; - - /** - * The version of the FHIR specification on which this conformance statement is based. - */ - @Child(name = "fhirVersion", type = {IdType.class}, order=13, min=1, max=1) - @Description(shortDefinition="FHIR Version", formalDefinition="The version of the FHIR specification on which this conformance statement is based." ) - protected IdType fhirVersion; - - /** - * A flag that indicates whether the application accepts unknown elements as part of a resource. - */ - @Child(name = "acceptUnknown", type = {BooleanType.class}, order=14, min=1, max=1) - @Description(shortDefinition="True if application accepts unknown elements", formalDefinition="A flag that indicates whether the application accepts unknown elements as part of a resource." ) - protected BooleanType acceptUnknown; - - /** - * A list of the formats supported by this implementation using their content types. - */ - @Child(name = "format", type = {CodeType.class}, order=15, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="formats supported (xml | json | mime type)", formalDefinition="A list of the formats supported by this implementation using their content types." ) - protected List format; - - /** - * A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. - */ - @Child(name = "profile", type = {StructureDefinition.class}, order=16, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Profiles supported by the system", formalDefinition="A list of profiles supported by the system. For a server, 'supported by the system' means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile." ) - protected List profile; - /** - * The actual objects that are the target of the reference (A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.) - */ - protected List profileTarget; - - - /** - * A definition of the restful capabilities of the solution, if any. - */ - @Child(name = "rest", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="If the endpoint is a RESTful one", formalDefinition="A definition of the restful capabilities of the solution, if any." ) - protected List rest; - - /** - * A description of the messaging capabilities of the solution. - */ - @Child(name = "messaging", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="If messaging is supported", formalDefinition="A description of the messaging capabilities of the solution." ) - protected List messaging; - - /** - * A document definition. - */ - @Child(name = "document", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Document definition", formalDefinition="A document definition." ) - protected List document; - - private static final long serialVersionUID = 1631871430L; - - /* - * Constructor - */ - public Conformance() { - super(); - } - - /* - * Constructor - */ - public Conformance(DateTimeType date, IdType fhirVersion, BooleanType acceptUnknown) { - super(); - this.date = date; - this.fhirVersion = fhirVersion; - this.acceptUnknown = acceptUnknown; - } - - /** - * @return {@link #url} (An absolute uri that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute uri that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public Conformance setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute uri that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute uri that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). - */ - public Conformance setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #version} (The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public Conformance setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public Conformance setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A free text natural language name identifying the conformance statement.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A free text natural language name identifying the conformance statement.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public Conformance setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name identifying the conformance statement. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name identifying the conformance statement. - */ - public Conformance setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the conformance.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the conformance.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public Conformance setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the conformance. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the conformance. - */ - public Conformance setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (ConformanceContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public ConformanceContactComponent addContact() { //3 - ConformanceContactComponent t = new ConformanceContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public Conformance addContact(ConformanceContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #description} (A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public Conformance setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. - */ - public Conformance setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #requirements} (Explains why this conformance statement is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); // bb - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (Explains why this conformance statement is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public Conformance setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return Explains why this conformance statement is needed and why it's been constrained as it has. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value Explains why this conformance statement is needed and why it's been constrained as it has. - */ - public Conformance setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #copyright} (A copyright statement relating to the conformamce statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public StringType getCopyrightElement() { - if (this.copyright == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.copyright"); - else if (Configuration.doAutoCreate()) - this.copyright = new StringType(); // bb - return this.copyright; - } - - public boolean hasCopyrightElement() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - public boolean hasCopyright() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - /** - * @param value {@link #copyright} (A copyright statement relating to the conformamce statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public Conformance setCopyrightElement(StringType value) { - this.copyright = value; - return this; - } - - /** - * @return A copyright statement relating to the conformamce statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement. - */ - public String getCopyright() { - return this.copyright == null ? null : this.copyright.getValue(); - } - - /** - * @param value A copyright statement relating to the conformamce statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement. - */ - public Conformance setCopyright(String value) { - if (Utilities.noString(value)) - this.copyright = null; - else { - if (this.copyright == null) - this.copyright = new StringType(); - this.copyright.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of this conformance statement.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of this conformance statement.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Conformance setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of this conformance statement. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of this conformance statement. - */ - public Conformance setStatus(ConformanceResourceStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #experimental} (A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); // bb - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public Conformance setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); - } - - /** - * @param value A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public Conformance setExperimental(boolean value) { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - return this; - } - - /** - * @return {@link #date} (The date (and optionally time) when the conformance statement was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date (and optionally time) when the conformance statement was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public Conformance setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date (and optionally time) when the conformance statement was published. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date (and optionally time) when the conformance statement was published. - */ - public Conformance setDate(Date value) { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - return this; - } - - /** - * @return {@link #software} (Software that is covered by this conformance statement. It is used when the conformance statement describes the capabilities of a particular software version, independent of an installation.) - */ - public ConformanceSoftwareComponent getSoftware() { - if (this.software == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.software"); - else if (Configuration.doAutoCreate()) - this.software = new ConformanceSoftwareComponent(); // cc - return this.software; - } - - public boolean hasSoftware() { - return this.software != null && !this.software.isEmpty(); - } - - /** - * @param value {@link #software} (Software that is covered by this conformance statement. It is used when the conformance statement describes the capabilities of a particular software version, independent of an installation.) - */ - public Conformance setSoftware(ConformanceSoftwareComponent value) { - this.software = value; - return this; - } - - /** - * @return {@link #implementation} (Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program.) - */ - public ConformanceImplementationComponent getImplementation() { - if (this.implementation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.implementation"); - else if (Configuration.doAutoCreate()) - this.implementation = new ConformanceImplementationComponent(); // cc - return this.implementation; - } - - public boolean hasImplementation() { - return this.implementation != null && !this.implementation.isEmpty(); - } - - /** - * @param value {@link #implementation} (Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program.) - */ - public Conformance setImplementation(ConformanceImplementationComponent value) { - this.implementation = value; - return this; - } - - /** - * @return {@link #fhirVersion} (The version of the FHIR specification on which this conformance statement is based.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value - */ - public IdType getFhirVersionElement() { - if (this.fhirVersion == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.fhirVersion"); - else if (Configuration.doAutoCreate()) - this.fhirVersion = new IdType(); // bb - return this.fhirVersion; - } - - public boolean hasFhirVersionElement() { - return this.fhirVersion != null && !this.fhirVersion.isEmpty(); - } - - public boolean hasFhirVersion() { - return this.fhirVersion != null && !this.fhirVersion.isEmpty(); - } - - /** - * @param value {@link #fhirVersion} (The version of the FHIR specification on which this conformance statement is based.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value - */ - public Conformance setFhirVersionElement(IdType value) { - this.fhirVersion = value; - return this; - } - - /** - * @return The version of the FHIR specification on which this conformance statement is based. - */ - public String getFhirVersion() { - return this.fhirVersion == null ? null : this.fhirVersion.getValue(); - } - - /** - * @param value The version of the FHIR specification on which this conformance statement is based. - */ - public Conformance setFhirVersion(String value) { - if (this.fhirVersion == null) - this.fhirVersion = new IdType(); - this.fhirVersion.setValue(value); - return this; - } - - /** - * @return {@link #acceptUnknown} (A flag that indicates whether the application accepts unknown elements as part of a resource.). This is the underlying object with id, value and extensions. The accessor "getAcceptUnknown" gives direct access to the value - */ - public BooleanType getAcceptUnknownElement() { - if (this.acceptUnknown == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.acceptUnknown"); - else if (Configuration.doAutoCreate()) - this.acceptUnknown = new BooleanType(); // bb - return this.acceptUnknown; - } - - public boolean hasAcceptUnknownElement() { - return this.acceptUnknown != null && !this.acceptUnknown.isEmpty(); - } - - public boolean hasAcceptUnknown() { - return this.acceptUnknown != null && !this.acceptUnknown.isEmpty(); - } - - /** - * @param value {@link #acceptUnknown} (A flag that indicates whether the application accepts unknown elements as part of a resource.). This is the underlying object with id, value and extensions. The accessor "getAcceptUnknown" gives direct access to the value - */ - public Conformance setAcceptUnknownElement(BooleanType value) { - this.acceptUnknown = value; - return this; - } - - /** - * @return A flag that indicates whether the application accepts unknown elements as part of a resource. - */ - public boolean getAcceptUnknown() { - return this.acceptUnknown == null || this.acceptUnknown.isEmpty() ? false : this.acceptUnknown.getValue(); - } - - /** - * @param value A flag that indicates whether the application accepts unknown elements as part of a resource. - */ - public Conformance setAcceptUnknown(boolean value) { - if (this.acceptUnknown == null) - this.acceptUnknown = new BooleanType(); - this.acceptUnknown.setValue(value); - return this; - } - - /** - * @return {@link #format} (A list of the formats supported by this implementation using their content types.) - */ - public List getFormat() { - if (this.format == null) - this.format = new ArrayList(); - return this.format; - } - - public boolean hasFormat() { - if (this.format == null) - return false; - for (CodeType item : this.format) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #format} (A list of the formats supported by this implementation using their content types.) - */ - // syntactic sugar - public CodeType addFormatElement() {//2 - CodeType t = new CodeType(); - if (this.format == null) - this.format = new ArrayList(); - this.format.add(t); - return t; - } - - /** - * @param value {@link #format} (A list of the formats supported by this implementation using their content types.) - */ - public Conformance addFormat(String value) { //1 - CodeType t = new CodeType(); - t.setValue(value); - if (this.format == null) - this.format = new ArrayList(); - this.format.add(t); - return this; - } - - /** - * @param value {@link #format} (A list of the formats supported by this implementation using their content types.) - */ - public boolean hasFormat(String value) { - if (this.format == null) - return false; - for (CodeType v : this.format) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #profile} (A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.) - */ - public List getProfile() { - if (this.profile == null) - this.profile = new ArrayList(); - return this.profile; - } - - public boolean hasProfile() { - if (this.profile == null) - return false; - for (Reference item : this.profile) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #profile} (A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.) - */ - // syntactic sugar - public Reference addProfile() { //3 - Reference t = new Reference(); - if (this.profile == null) - this.profile = new ArrayList(); - this.profile.add(t); - return t; - } - - // syntactic sugar - public Conformance addProfile(Reference t) { //3 - if (t == null) - return this; - if (this.profile == null) - this.profile = new ArrayList(); - this.profile.add(t); - return this; - } - - /** - * @return {@link #profile} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.) - */ - public List getProfileTarget() { - if (this.profileTarget == null) - this.profileTarget = new ArrayList(); - return this.profileTarget; - } - - // syntactic sugar - /** - * @return {@link #profile} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.) - */ - public StructureDefinition addProfileTarget() { - StructureDefinition r = new StructureDefinition(); - if (this.profileTarget == null) - this.profileTarget = new ArrayList(); - this.profileTarget.add(r); - return r; - } - - /** - * @return {@link #rest} (A definition of the restful capabilities of the solution, if any.) - */ - public List getRest() { - if (this.rest == null) - this.rest = new ArrayList(); - return this.rest; - } - - public boolean hasRest() { - if (this.rest == null) - return false; - for (ConformanceRestComponent item : this.rest) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #rest} (A definition of the restful capabilities of the solution, if any.) - */ - // syntactic sugar - public ConformanceRestComponent addRest() { //3 - ConformanceRestComponent t = new ConformanceRestComponent(); - if (this.rest == null) - this.rest = new ArrayList(); - this.rest.add(t); - return t; - } - - // syntactic sugar - public Conformance addRest(ConformanceRestComponent t) { //3 - if (t == null) - return this; - if (this.rest == null) - this.rest = new ArrayList(); - this.rest.add(t); - return this; - } - - /** - * @return {@link #messaging} (A description of the messaging capabilities of the solution.) - */ - public List getMessaging() { - if (this.messaging == null) - this.messaging = new ArrayList(); - return this.messaging; - } - - public boolean hasMessaging() { - if (this.messaging == null) - return false; - for (ConformanceMessagingComponent item : this.messaging) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #messaging} (A description of the messaging capabilities of the solution.) - */ - // syntactic sugar - public ConformanceMessagingComponent addMessaging() { //3 - ConformanceMessagingComponent t = new ConformanceMessagingComponent(); - if (this.messaging == null) - this.messaging = new ArrayList(); - this.messaging.add(t); - return t; - } - - // syntactic sugar - public Conformance addMessaging(ConformanceMessagingComponent t) { //3 - if (t == null) - return this; - if (this.messaging == null) - this.messaging = new ArrayList(); - this.messaging.add(t); - return this; - } - - /** - * @return {@link #document} (A document definition.) - */ - public List getDocument() { - if (this.document == null) - this.document = new ArrayList(); - return this.document; - } - - public boolean hasDocument() { - if (this.document == null) - return false; - for (ConformanceDocumentComponent item : this.document) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #document} (A document definition.) - */ - // syntactic sugar - public ConformanceDocumentComponent addDocument() { //3 - ConformanceDocumentComponent t = new ConformanceDocumentComponent(); - if (this.document == null) - this.document = new ArrayList(); - this.document.add(t); - return t; - } - - // syntactic sugar - public Conformance addDocument(ConformanceDocumentComponent t) { //3 - if (t == null) - return this; - if (this.document == null) - this.document = new ArrayList(); - this.document.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute uri that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("name", "string", "A free text natural language name identifying the conformance statement.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the conformance.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("description", "string", "A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("requirements", "string", "Explains why this conformance statement is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("copyright", "string", "A copyright statement relating to the conformamce statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement.", 0, java.lang.Integer.MAX_VALUE, copyright)); - childrenList.add(new Property("status", "code", "The status of this conformance statement.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("date", "dateTime", "The date (and optionally time) when the conformance statement was published.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("software", "", "Software that is covered by this conformance statement. It is used when the conformance statement describes the capabilities of a particular software version, independent of an installation.", 0, java.lang.Integer.MAX_VALUE, software)); - childrenList.add(new Property("implementation", "", "Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program.", 0, java.lang.Integer.MAX_VALUE, implementation)); - childrenList.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this conformance statement is based.", 0, java.lang.Integer.MAX_VALUE, fhirVersion)); - childrenList.add(new Property("acceptUnknown", "boolean", "A flag that indicates whether the application accepts unknown elements as part of a resource.", 0, java.lang.Integer.MAX_VALUE, acceptUnknown)); - childrenList.add(new Property("format", "code", "A list of the formats supported by this implementation using their content types.", 0, java.lang.Integer.MAX_VALUE, format)); - childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A list of profiles supported by the system. For a server, 'supported by the system' means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.", 0, java.lang.Integer.MAX_VALUE, profile)); - childrenList.add(new Property("rest", "", "A definition of the restful capabilities of the solution, if any.", 0, java.lang.Integer.MAX_VALUE, rest)); - childrenList.add(new Property("messaging", "", "A description of the messaging capabilities of the solution.", 0, java.lang.Integer.MAX_VALUE, messaging)); - childrenList.add(new Property("document", "", "A document definition.", 0, java.lang.Integer.MAX_VALUE, document)); - } - - public Conformance copy() { - Conformance dst = new Conformance(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.version = version == null ? null : version.copy(); - dst.name = name == null ? null : name.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (ConformanceContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - dst.requirements = requirements == null ? null : requirements.copy(); - dst.copyright = copyright == null ? null : copyright.copy(); - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.date = date == null ? null : date.copy(); - dst.software = software == null ? null : software.copy(); - dst.implementation = implementation == null ? null : implementation.copy(); - dst.fhirVersion = fhirVersion == null ? null : fhirVersion.copy(); - dst.acceptUnknown = acceptUnknown == null ? null : acceptUnknown.copy(); - if (format != null) { - dst.format = new ArrayList(); - for (CodeType i : format) - dst.format.add(i.copy()); - }; - if (profile != null) { - dst.profile = new ArrayList(); - for (Reference i : profile) - dst.profile.add(i.copy()); - }; - if (rest != null) { - dst.rest = new ArrayList(); - for (ConformanceRestComponent i : rest) - dst.rest.add(i.copy()); - }; - if (messaging != null) { - dst.messaging = new ArrayList(); - for (ConformanceMessagingComponent i : messaging) - dst.messaging.add(i.copy()); - }; - if (document != null) { - dst.document = new ArrayList(); - for (ConformanceDocumentComponent i : document) - dst.document.add(i.copy()); - }; - return dst; - } - - protected Conformance typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Conformance)) - return false; - Conformance o = (Conformance) other; - return compareDeep(url, o.url, true) && compareDeep(version, o.version, true) && compareDeep(name, o.name, true) - && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(description, o.description, true) - && compareDeep(requirements, o.requirements, true) && compareDeep(copyright, o.copyright, true) - && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) && compareDeep(date, o.date, true) - && compareDeep(software, o.software, true) && compareDeep(implementation, o.implementation, true) - && compareDeep(fhirVersion, o.fhirVersion, true) && compareDeep(acceptUnknown, o.acceptUnknown, true) - && compareDeep(format, o.format, true) && compareDeep(profile, o.profile, true) && compareDeep(rest, o.rest, true) - && compareDeep(messaging, o.messaging, true) && compareDeep(document, o.document, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Conformance)) - return false; - Conformance o = (Conformance) other; - return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) - && compareValues(publisher, o.publisher, true) && compareValues(description, o.description, true) && compareValues(requirements, o.requirements, true) - && compareValues(copyright, o.copyright, true) && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) - && compareValues(date, o.date, true) && compareValues(fhirVersion, o.fhirVersion, true) && compareValues(acceptUnknown, o.acceptUnknown, true) - && compareValues(format, o.format, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (version == null || version.isEmpty()) - && (name == null || name.isEmpty()) && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) - && (description == null || description.isEmpty()) && (requirements == null || requirements.isEmpty()) - && (copyright == null || copyright.isEmpty()) && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) - && (date == null || date.isEmpty()) && (software == null || software.isEmpty()) && (implementation == null || implementation.isEmpty()) - && (fhirVersion == null || fhirVersion.isEmpty()) && (acceptUnknown == null || acceptUnknown.isEmpty()) - && (format == null || format.isEmpty()) && (profile == null || profile.isEmpty()) && (rest == null || rest.isEmpty()) - && (messaging == null || messaging.isEmpty()) && (document == null || document.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Conformance; - } - - @SearchParamDefinition(name="status", path="Conformance.status", description="The current status of the conformance statement", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="resource", path="Conformance.rest.resource.type", description="Name of a resource mentioned in a conformance statement", type="token" ) - public static final String SP_RESOURCE = "resource"; - @SearchParamDefinition(name="security", path="Conformance.rest.security", description="Information about security of implementation", type="token" ) - public static final String SP_SECURITY = "security"; - @SearchParamDefinition(name="format", path="Conformance.format", description="formats supported (xml | json | mime type)", type="token" ) - public static final String SP_FORMAT = "format"; - @SearchParamDefinition(name="date", path="Conformance.date", description="The conformance statement publication date", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="url", path="Conformance.url", description="The uri that identifies the conformance statement", type="uri" ) - public static final String SP_URL = "url"; - @SearchParamDefinition(name="version", path="Conformance.version", description="The version identifier of the conformance statement", type="token" ) - public static final String SP_VERSION = "version"; - @SearchParamDefinition(name="publisher", path="Conformance.publisher", description="Name of the publisher of the conformance statement", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - @SearchParamDefinition(name="mode", path="Conformance.rest.mode", description="Mode - restful (server/client) or messaging (sender/receiver)", type="token" ) - public static final String SP_MODE = "mode"; - @SearchParamDefinition(name="software", path="Conformance.software.name", description="Part of a the name of a software application", type="string" ) - public static final String SP_SOFTWARE = "software"; - @SearchParamDefinition(name="description", path="Conformance.description", description="Text search in the description of the conformance statement", type="string" ) - public static final String SP_DESCRIPTION = "description"; - @SearchParamDefinition(name="event", path="Conformance.messaging.event.code", description="Event code in a conformance statement", type="token" ) - public static final String SP_EVENT = "event"; - @SearchParamDefinition(name="name", path="Conformance.name", description="Name of the conformance statement", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="supported-profile", path="Conformance.profile", description="Profiles supported by the system", type="reference" ) - public static final String SP_SUPPORTEDPROFILE = "supported-profile"; - @SearchParamDefinition(name="fhirversion", path="Conformance.version", description="The version of FHIR", type="token" ) - public static final String SP_FHIRVERSION = "fhirversion"; - @SearchParamDefinition(name="profile", path="Conformance.rest.resource.profile", description="A profile id invoked in a conformance statement", type="reference" ) - public static final String SP_PROFILE = "profile"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import java.util.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.Enumerations.*; +import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. + */ +@ResourceDef(name="Conformance", profile="http://hl7.org/fhir/Profile/Conformance") +public class Conformance extends DomainResource { + + public enum RestfulConformanceMode { + /** + * The application acts as a client for this resource. + */ + CLIENT, + /** + * The application acts as a server for this resource. + */ + SERVER, + /** + * added to help the parsers + */ + NULL; + public static RestfulConformanceMode fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("client".equals(codeString)) + return CLIENT; + if ("server".equals(codeString)) + return SERVER; + throw new Exception("Unknown RestfulConformanceMode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CLIENT: return "client"; + case SERVER: return "server"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CLIENT: return ""; + case SERVER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CLIENT: return "The application acts as a client for this resource."; + case SERVER: return "The application acts as a server for this resource."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CLIENT: return "Client"; + case SERVER: return "Server"; + default: return "?"; + } + } + } + + public static class RestfulConformanceModeEnumFactory implements EnumFactory { + public RestfulConformanceMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("client".equals(codeString)) + return RestfulConformanceMode.CLIENT; + if ("server".equals(codeString)) + return RestfulConformanceMode.SERVER; + throw new IllegalArgumentException("Unknown RestfulConformanceMode code '"+codeString+"'"); + } + public String toCode(RestfulConformanceMode code) { + if (code == RestfulConformanceMode.CLIENT) + return "client"; + if (code == RestfulConformanceMode.SERVER) + return "server"; + return "?"; + } + } + + public enum TypeRestfulInteraction { + /** + * + */ + READ, + /** + * + */ + VREAD, + /** + * + */ + UPDATE, + /** + * + */ + DELETE, + /** + * + */ + HISTORYINSTANCE, + /** + * + */ + VALIDATE, + /** + * + */ + HISTORYTYPE, + /** + * + */ + CREATE, + /** + * + */ + SEARCHTYPE, + /** + * added to help the parsers + */ + NULL; + public static TypeRestfulInteraction fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("read".equals(codeString)) + return READ; + if ("vread".equals(codeString)) + return VREAD; + if ("update".equals(codeString)) + return UPDATE; + if ("delete".equals(codeString)) + return DELETE; + if ("history-instance".equals(codeString)) + return HISTORYINSTANCE; + if ("validate".equals(codeString)) + return VALIDATE; + if ("history-type".equals(codeString)) + return HISTORYTYPE; + if ("create".equals(codeString)) + return CREATE; + if ("search-type".equals(codeString)) + return SEARCHTYPE; + throw new Exception("Unknown TypeRestfulInteraction code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case READ: return "read"; + case VREAD: return "vread"; + case UPDATE: return "update"; + case DELETE: return "delete"; + case HISTORYINSTANCE: return "history-instance"; + case VALIDATE: return "validate"; + case HISTORYTYPE: return "history-type"; + case CREATE: return "create"; + case SEARCHTYPE: return "search-type"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case READ: return "http://hl7.org/fhir/restful-interaction"; + case VREAD: return "http://hl7.org/fhir/restful-interaction"; + case UPDATE: return "http://hl7.org/fhir/restful-interaction"; + case DELETE: return "http://hl7.org/fhir/restful-interaction"; + case HISTORYINSTANCE: return "http://hl7.org/fhir/restful-interaction"; + case VALIDATE: return "http://hl7.org/fhir/restful-interaction"; + case HISTORYTYPE: return "http://hl7.org/fhir/restful-interaction"; + case CREATE: return "http://hl7.org/fhir/restful-interaction"; + case SEARCHTYPE: return "http://hl7.org/fhir/restful-interaction"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case READ: return ""; + case VREAD: return ""; + case UPDATE: return ""; + case DELETE: return ""; + case HISTORYINSTANCE: return ""; + case VALIDATE: return ""; + case HISTORYTYPE: return ""; + case CREATE: return ""; + case SEARCHTYPE: return ""; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case READ: return "Read"; + case VREAD: return "Vread"; + case UPDATE: return "Update"; + case DELETE: return "Delete"; + case HISTORYINSTANCE: return "History Instance"; + case VALIDATE: return "Validate"; + case HISTORYTYPE: return "History Type"; + case CREATE: return "Create"; + case SEARCHTYPE: return "Search Type"; + default: return "?"; + } + } + } + + public static class TypeRestfulInteractionEnumFactory implements EnumFactory { + public TypeRestfulInteraction fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("read".equals(codeString)) + return TypeRestfulInteraction.READ; + if ("vread".equals(codeString)) + return TypeRestfulInteraction.VREAD; + if ("update".equals(codeString)) + return TypeRestfulInteraction.UPDATE; + if ("delete".equals(codeString)) + return TypeRestfulInteraction.DELETE; + if ("history-instance".equals(codeString)) + return TypeRestfulInteraction.HISTORYINSTANCE; + if ("validate".equals(codeString)) + return TypeRestfulInteraction.VALIDATE; + if ("history-type".equals(codeString)) + return TypeRestfulInteraction.HISTORYTYPE; + if ("create".equals(codeString)) + return TypeRestfulInteraction.CREATE; + if ("search-type".equals(codeString)) + return TypeRestfulInteraction.SEARCHTYPE; + throw new IllegalArgumentException("Unknown TypeRestfulInteraction code '"+codeString+"'"); + } + public String toCode(TypeRestfulInteraction code) { + if (code == TypeRestfulInteraction.READ) + return "read"; + if (code == TypeRestfulInteraction.VREAD) + return "vread"; + if (code == TypeRestfulInteraction.UPDATE) + return "update"; + if (code == TypeRestfulInteraction.DELETE) + return "delete"; + if (code == TypeRestfulInteraction.HISTORYINSTANCE) + return "history-instance"; + if (code == TypeRestfulInteraction.VALIDATE) + return "validate"; + if (code == TypeRestfulInteraction.HISTORYTYPE) + return "history-type"; + if (code == TypeRestfulInteraction.CREATE) + return "create"; + if (code == TypeRestfulInteraction.SEARCHTYPE) + return "search-type"; + return "?"; + } + } + + public enum VersioningPolicy { + /** + * VersionId meta-property is not suppoerted (server) or used (client). + */ + NOVERSION, + /** + * VersionId meta-property is suppoerted (server) or used (client). + */ + VERSIONED, + /** + * VersionId is must be correct for updates (server) or will be specified (If-match header) for updates (client). + */ + VERSIONEDUPDATE, + /** + * added to help the parsers + */ + NULL; + public static VersioningPolicy fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("no-version".equals(codeString)) + return NOVERSION; + if ("versioned".equals(codeString)) + return VERSIONED; + if ("versioned-update".equals(codeString)) + return VERSIONEDUPDATE; + throw new Exception("Unknown VersioningPolicy code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case NOVERSION: return "no-version"; + case VERSIONED: return "versioned"; + case VERSIONEDUPDATE: return "versioned-update"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case NOVERSION: return ""; + case VERSIONED: return ""; + case VERSIONEDUPDATE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case NOVERSION: return "VersionId meta-property is not suppoerted (server) or used (client)."; + case VERSIONED: return "VersionId meta-property is suppoerted (server) or used (client)."; + case VERSIONEDUPDATE: return "VersionId is must be correct for updates (server) or will be specified (If-match header) for updates (client)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NOVERSION: return "No VersionId Support"; + case VERSIONED: return "Versioned"; + case VERSIONEDUPDATE: return "VersionId tracked fully"; + default: return "?"; + } + } + } + + public static class VersioningPolicyEnumFactory implements EnumFactory { + public VersioningPolicy fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("no-version".equals(codeString)) + return VersioningPolicy.NOVERSION; + if ("versioned".equals(codeString)) + return VersioningPolicy.VERSIONED; + if ("versioned-update".equals(codeString)) + return VersioningPolicy.VERSIONEDUPDATE; + throw new IllegalArgumentException("Unknown VersioningPolicy code '"+codeString+"'"); + } + public String toCode(VersioningPolicy code) { + if (code == VersioningPolicy.NOVERSION) + return "no-version"; + if (code == VersioningPolicy.VERSIONED) + return "versioned"; + if (code == VersioningPolicy.VERSIONEDUPDATE) + return "versioned-update"; + return "?"; + } + } + + public enum SearchParamType { + /** + * Search parameter SHALL be a number (a whole number, or a decimal). + */ + NUMBER, + /** + * Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported. + */ + DATE, + /** + * Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces. + */ + STRING, + /** + * Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a "|", depending on the modifier used. + */ + TOKEN, + /** + * A reference to another resource. + */ + REFERENCE, + /** + * A composite search parameter that combines a search on two values together. + */ + COMPOSITE, + /** + * A search parameter that searches on a quantity. + */ + QUANTITY, + /** + * A search parameter that searches on a URI (RFC 3986). + */ + URI, + /** + * added to help the parsers + */ + NULL; + public static SearchParamType fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("number".equals(codeString)) + return NUMBER; + if ("date".equals(codeString)) + return DATE; + if ("string".equals(codeString)) + return STRING; + if ("token".equals(codeString)) + return TOKEN; + if ("reference".equals(codeString)) + return REFERENCE; + if ("composite".equals(codeString)) + return COMPOSITE; + if ("quantity".equals(codeString)) + return QUANTITY; + if ("uri".equals(codeString)) + return URI; + throw new Exception("Unknown SearchParamType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case NUMBER: return "number"; + case DATE: return "date"; + case STRING: return "string"; + case TOKEN: return "token"; + case REFERENCE: return "reference"; + case COMPOSITE: return "composite"; + case QUANTITY: return "quantity"; + case URI: return "uri"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case NUMBER: return ""; + case DATE: return ""; + case STRING: return ""; + case TOKEN: return ""; + case REFERENCE: return ""; + case COMPOSITE: return ""; + case QUANTITY: return ""; + case URI: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case NUMBER: return "Search parameter SHALL be a number (a whole number, or a decimal)."; + case DATE: return "Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported."; + case STRING: return "Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces."; + case TOKEN: return "Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a '|', depending on the modifier used."; + case REFERENCE: return "A reference to another resource."; + case COMPOSITE: return "A composite search parameter that combines a search on two values together."; + case QUANTITY: return "A search parameter that searches on a quantity."; + case URI: return "A search parameter that searches on a URI (RFC 3986)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NUMBER: return "Number"; + case DATE: return "Date/DateTime"; + case STRING: return "String"; + case TOKEN: return "Token"; + case REFERENCE: return "Reference"; + case COMPOSITE: return "Composite"; + case QUANTITY: return "Quantity"; + case URI: return "URI"; + default: return "?"; + } + } + } + + public static class SearchParamTypeEnumFactory implements EnumFactory { + public SearchParamType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("number".equals(codeString)) + return SearchParamType.NUMBER; + if ("date".equals(codeString)) + return SearchParamType.DATE; + if ("string".equals(codeString)) + return SearchParamType.STRING; + if ("token".equals(codeString)) + return SearchParamType.TOKEN; + if ("reference".equals(codeString)) + return SearchParamType.REFERENCE; + if ("composite".equals(codeString)) + return SearchParamType.COMPOSITE; + if ("quantity".equals(codeString)) + return SearchParamType.QUANTITY; + if ("uri".equals(codeString)) + return SearchParamType.URI; + throw new IllegalArgumentException("Unknown SearchParamType code '"+codeString+"'"); + } + public String toCode(SearchParamType code) { + if (code == SearchParamType.NUMBER) + return "number"; + if (code == SearchParamType.DATE) + return "date"; + if (code == SearchParamType.STRING) + return "string"; + if (code == SearchParamType.TOKEN) + return "token"; + if (code == SearchParamType.REFERENCE) + return "reference"; + if (code == SearchParamType.COMPOSITE) + return "composite"; + if (code == SearchParamType.QUANTITY) + return "quantity"; + if (code == SearchParamType.URI) + return "uri"; + return "?"; + } + } + + public enum SystemRestfulInteraction { + /** + * + */ + TRANSACTION, + /** + * + */ + SEARCHSYSTEM, + /** + * + */ + HISTORYSYSTEM, + /** + * added to help the parsers + */ + NULL; + public static SystemRestfulInteraction fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("transaction".equals(codeString)) + return TRANSACTION; + if ("search-system".equals(codeString)) + return SEARCHSYSTEM; + if ("history-system".equals(codeString)) + return HISTORYSYSTEM; + throw new Exception("Unknown SystemRestfulInteraction code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case TRANSACTION: return "transaction"; + case SEARCHSYSTEM: return "search-system"; + case HISTORYSYSTEM: return "history-system"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case TRANSACTION: return "http://hl7.org/fhir/restful-interaction"; + case SEARCHSYSTEM: return "http://hl7.org/fhir/restful-interaction"; + case HISTORYSYSTEM: return "http://hl7.org/fhir/restful-interaction"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case TRANSACTION: return ""; + case SEARCHSYSTEM: return ""; + case HISTORYSYSTEM: return ""; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case TRANSACTION: return "Transaction"; + case SEARCHSYSTEM: return "Search System"; + case HISTORYSYSTEM: return "History System"; + default: return "?"; + } + } + } + + public static class SystemRestfulInteractionEnumFactory implements EnumFactory { + public SystemRestfulInteraction fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("transaction".equals(codeString)) + return SystemRestfulInteraction.TRANSACTION; + if ("search-system".equals(codeString)) + return SystemRestfulInteraction.SEARCHSYSTEM; + if ("history-system".equals(codeString)) + return SystemRestfulInteraction.HISTORYSYSTEM; + throw new IllegalArgumentException("Unknown SystemRestfulInteraction code '"+codeString+"'"); + } + public String toCode(SystemRestfulInteraction code) { + if (code == SystemRestfulInteraction.TRANSACTION) + return "transaction"; + if (code == SystemRestfulInteraction.SEARCHSYSTEM) + return "search-system"; + if (code == SystemRestfulInteraction.HISTORYSYSTEM) + return "history-system"; + return "?"; + } + } + + public enum MessageSignificanceCategory { + /** + * The message represents/requests a change that should not be processed more than once. E.g. Making a booking for an appointment. + */ + CONSEQUENCE, + /** + * The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful. + */ + CURRENCY, + /** + * The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications. + */ + NOTIFICATION, + /** + * added to help the parsers + */ + NULL; + public static MessageSignificanceCategory fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("Consequence".equals(codeString)) + return CONSEQUENCE; + if ("Currency".equals(codeString)) + return CURRENCY; + if ("Notification".equals(codeString)) + return NOTIFICATION; + throw new Exception("Unknown MessageSignificanceCategory code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CONSEQUENCE: return "Consequence"; + case CURRENCY: return "Currency"; + case NOTIFICATION: return "Notification"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CONSEQUENCE: return ""; + case CURRENCY: return ""; + case NOTIFICATION: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CONSEQUENCE: return "The message represents/requests a change that should not be processed more than once. E.g. Making a booking for an appointment."; + case CURRENCY: return "The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful."; + case NOTIFICATION: return "The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CONSEQUENCE: return "Consequence"; + case CURRENCY: return "Currency"; + case NOTIFICATION: return "Notification"; + default: return "?"; + } + } + } + + public static class MessageSignificanceCategoryEnumFactory implements EnumFactory { + public MessageSignificanceCategory fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("Consequence".equals(codeString)) + return MessageSignificanceCategory.CONSEQUENCE; + if ("Currency".equals(codeString)) + return MessageSignificanceCategory.CURRENCY; + if ("Notification".equals(codeString)) + return MessageSignificanceCategory.NOTIFICATION; + throw new IllegalArgumentException("Unknown MessageSignificanceCategory code '"+codeString+"'"); + } + public String toCode(MessageSignificanceCategory code) { + if (code == MessageSignificanceCategory.CONSEQUENCE) + return "Consequence"; + if (code == MessageSignificanceCategory.CURRENCY) + return "Currency"; + if (code == MessageSignificanceCategory.NOTIFICATION) + return "Notification"; + return "?"; + } + } + + public enum MessageConformanceEventMode { + /** + * The application sends requests and receives responses. + */ + SENDER, + /** + * The application receives requests and sends responses. + */ + RECEIVER, + /** + * added to help the parsers + */ + NULL; + public static MessageConformanceEventMode fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("sender".equals(codeString)) + return SENDER; + if ("receiver".equals(codeString)) + return RECEIVER; + throw new Exception("Unknown MessageConformanceEventMode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case SENDER: return "sender"; + case RECEIVER: return "receiver"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case SENDER: return ""; + case RECEIVER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case SENDER: return "The application sends requests and receives responses."; + case RECEIVER: return "The application receives requests and sends responses."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case SENDER: return "Sender"; + case RECEIVER: return "Receiver"; + default: return "?"; + } + } + } + + public static class MessageConformanceEventModeEnumFactory implements EnumFactory { + public MessageConformanceEventMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("sender".equals(codeString)) + return MessageConformanceEventMode.SENDER; + if ("receiver".equals(codeString)) + return MessageConformanceEventMode.RECEIVER; + throw new IllegalArgumentException("Unknown MessageConformanceEventMode code '"+codeString+"'"); + } + public String toCode(MessageConformanceEventMode code) { + if (code == MessageConformanceEventMode.SENDER) + return "sender"; + if (code == MessageConformanceEventMode.RECEIVER) + return "receiver"; + return "?"; + } + } + + public enum DocumentMode { + /** + * The application produces documents of the specified type. + */ + PRODUCER, + /** + * The application consumes documents of the specified type. + */ + CONSUMER, + /** + * added to help the parsers + */ + NULL; + public static DocumentMode fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("producer".equals(codeString)) + return PRODUCER; + if ("consumer".equals(codeString)) + return CONSUMER; + throw new Exception("Unknown DocumentMode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PRODUCER: return "producer"; + case CONSUMER: return "consumer"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PRODUCER: return ""; + case CONSUMER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PRODUCER: return "The application produces documents of the specified type."; + case CONSUMER: return "The application consumes documents of the specified type."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PRODUCER: return "Producer"; + case CONSUMER: return "Consumer"; + default: return "?"; + } + } + } + + public static class DocumentModeEnumFactory implements EnumFactory { + public DocumentMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("producer".equals(codeString)) + return DocumentMode.PRODUCER; + if ("consumer".equals(codeString)) + return DocumentMode.CONSUMER; + throw new IllegalArgumentException("Unknown DocumentMode code '"+codeString+"'"); + } + public String toCode(DocumentMode code) { + if (code == DocumentMode.PRODUCER) + return "producer"; + if (code == DocumentMode.CONSUMER) + return "consumer"; + return "?"; + } + } + + @Block() + public static class ConformanceContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the conformance. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Name of a individual to contact", formalDefinition="The name of an individual to contact regarding the conformance." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /* + * Constructor + */ + public ConformanceContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the conformance.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The name of an individual to contact regarding the conformance.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ConformanceContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the conformance. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the conformance. + */ + public ConformanceContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public ConformanceContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the conformance.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + public ConformanceContactComponent copy() { + ConformanceContactComponent dst = new ConformanceContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceContactComponent)) + return false; + ConformanceContactComponent o = (ConformanceContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceContactComponent)) + return false; + ConformanceContactComponent o = (ConformanceContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + } + + @Block() + public static class ConformanceSoftwareComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Name software is known by. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="A name the software is known by", formalDefinition="Name software is known by." ) + protected StringType name; + + /** + * The version identifier for the software covered by this statement. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Version covered by this statement", formalDefinition="The version identifier for the software covered by this statement." ) + protected StringType version; + + /** + * Date this version of the software released. + */ + @Child(name = "releaseDate", type = {DateTimeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Date this version released", formalDefinition="Date this version of the software released." ) + protected DateTimeType releaseDate; + + private static final long serialVersionUID = 1819769027L; + + /* + * Constructor + */ + public ConformanceSoftwareComponent() { + super(); + } + + /* + * Constructor + */ + public ConformanceSoftwareComponent(StringType name) { + super(); + this.name = name; + } + + /** + * @return {@link #name} (Name software is known by.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceSoftwareComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (Name software is known by.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ConformanceSoftwareComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Name software is known by. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Name software is known by. + */ + public ConformanceSoftwareComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #version} (The version identifier for the software covered by this statement.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceSoftwareComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version identifier for the software covered by this statement.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ConformanceSoftwareComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version identifier for the software covered by this statement. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version identifier for the software covered by this statement. + */ + public ConformanceSoftwareComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #releaseDate} (Date this version of the software released.). This is the underlying object with id, value and extensions. The accessor "getReleaseDate" gives direct access to the value + */ + public DateTimeType getReleaseDateElement() { + if (this.releaseDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceSoftwareComponent.releaseDate"); + else if (Configuration.doAutoCreate()) + this.releaseDate = new DateTimeType(); // bb + return this.releaseDate; + } + + public boolean hasReleaseDateElement() { + return this.releaseDate != null && !this.releaseDate.isEmpty(); + } + + public boolean hasReleaseDate() { + return this.releaseDate != null && !this.releaseDate.isEmpty(); + } + + /** + * @param value {@link #releaseDate} (Date this version of the software released.). This is the underlying object with id, value and extensions. The accessor "getReleaseDate" gives direct access to the value + */ + public ConformanceSoftwareComponent setReleaseDateElement(DateTimeType value) { + this.releaseDate = value; + return this; + } + + /** + * @return Date this version of the software released. + */ + public Date getReleaseDate() { + return this.releaseDate == null ? null : this.releaseDate.getValue(); + } + + /** + * @param value Date this version of the software released. + */ + public ConformanceSoftwareComponent setReleaseDate(Date value) { + if (value == null) + this.releaseDate = null; + else { + if (this.releaseDate == null) + this.releaseDate = new DateTimeType(); + this.releaseDate.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "Name software is known by.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("version", "string", "The version identifier for the software covered by this statement.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("releaseDate", "dateTime", "Date this version of the software released.", 0, java.lang.Integer.MAX_VALUE, releaseDate)); + } + + public ConformanceSoftwareComponent copy() { + ConformanceSoftwareComponent dst = new ConformanceSoftwareComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.version = version == null ? null : version.copy(); + dst.releaseDate = releaseDate == null ? null : releaseDate.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceSoftwareComponent)) + return false; + ConformanceSoftwareComponent o = (ConformanceSoftwareComponent) other; + return compareDeep(name, o.name, true) && compareDeep(version, o.version, true) && compareDeep(releaseDate, o.releaseDate, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceSoftwareComponent)) + return false; + ConformanceSoftwareComponent o = (ConformanceSoftwareComponent) other; + return compareValues(name, o.name, true) && compareValues(version, o.version, true) && compareValues(releaseDate, o.releaseDate, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (version == null || version.isEmpty()) + && (releaseDate == null || releaseDate.isEmpty()); + } + + } + + @Block() + public static class ConformanceImplementationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Information about the specific installation that this conformance statement relates to. + */ + @Child(name = "description", type = {StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Describes this specific instance", formalDefinition="Information about the specific installation that this conformance statement relates to." ) + protected StringType description; + + /** + * An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. + */ + @Child(name = "url", type = {UriType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Base URL for the installation", formalDefinition="An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces." ) + protected UriType url; + + private static final long serialVersionUID = -289238508L; + + /* + * Constructor + */ + public ConformanceImplementationComponent() { + super(); + } + + /* + * Constructor + */ + public ConformanceImplementationComponent(StringType description) { + super(); + this.description = description; + } + + /** + * @return {@link #description} (Information about the specific installation that this conformance statement relates to.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceImplementationComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Information about the specific installation that this conformance statement relates to.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ConformanceImplementationComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Information about the specific installation that this conformance statement relates to. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Information about the specific installation that this conformance statement relates to. + */ + public ConformanceImplementationComponent setDescription(String value) { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + return this; + } + + /** + * @return {@link #url} (An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceImplementationComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public ConformanceImplementationComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. + */ + public ConformanceImplementationComponent setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("description", "string", "Information about the specific installation that this conformance statement relates to.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("url", "uri", "An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces.", 0, java.lang.Integer.MAX_VALUE, url)); + } + + public ConformanceImplementationComponent copy() { + ConformanceImplementationComponent dst = new ConformanceImplementationComponent(); + copyValues(dst); + dst.description = description == null ? null : description.copy(); + dst.url = url == null ? null : url.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceImplementationComponent)) + return false; + ConformanceImplementationComponent o = (ConformanceImplementationComponent) other; + return compareDeep(description, o.description, true) && compareDeep(url, o.url, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceImplementationComponent)) + return false; + ConformanceImplementationComponent o = (ConformanceImplementationComponent) other; + return compareValues(description, o.description, true) && compareValues(url, o.url, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (description == null || description.isEmpty()) && (url == null || url.isEmpty()) + ; + } + + } + + @Block() + public static class ConformanceRestComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifies whether this portion of the statement is describing ability to initiate or receive restful operations. + */ + @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="client | server", formalDefinition="Identifies whether this portion of the statement is describing ability to initiate or receive restful operations." ) + protected Enumeration mode; + + /** + * Information about the system's restful capabilities that apply across all applications, such as security. + */ + @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="General description of implementation", formalDefinition="Information about the system's restful capabilities that apply across all applications, such as security." ) + protected StringType documentation; + + /** + * Information about security implementation from an interface perspective - what a client needs to know. + */ + @Child(name = "security", type = {}, order=3, min=0, max=1) + @Description(shortDefinition="Information about security of implementation", formalDefinition="Information about security implementation from an interface perspective - what a client needs to know." ) + protected ConformanceRestSecurityComponent security; + + /** + * A specification of the restful capabilities of the solution for a specific resource type. + */ + @Child(name = "resource", type = {}, order=4, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Resource served on the REST interface", formalDefinition="A specification of the restful capabilities of the solution for a specific resource type." ) + protected List resource; + + /** + * A specification of restful operations supported by the system. + */ + @Child(name = "interaction", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="What operations are supported?", formalDefinition="A specification of restful operations supported by the system." ) + protected List interaction; + + /** + * Definition of an operation or a named query and with its parameters and their meaning and type. + */ + @Child(name = "operation", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Definition of an operation or a custom query", formalDefinition="Definition of an operation or a named query and with its parameters and their meaning and type." ) + protected List operation; + + /** + * A list of absolute URIs that identify profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose. + */ + @Child(name = "documentMailbox", type = {UriType.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="How documents are accepted in /Mailbox", formalDefinition="A list of absolute URIs that identify profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier 'http://hl7.org/fhir/documents/mailbox'. Other specifications can declare their own identifier for this purpose." ) + protected List documentMailbox; + + /** + * An absolute URI which is a reference to the definition of a compartment hosted by the system. + */ + @Child(name = "compartment", type = {UriType.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Compartments served/used by system", formalDefinition="An absolute URI which is a reference to the definition of a compartment hosted by the system." ) + protected List compartment; + + private static final long serialVersionUID = -535980615L; + + /* + * Constructor + */ + public ConformanceRestComponent() { + super(); + } + + /* + * Constructor + */ + public ConformanceRestComponent(Enumeration mode) { + super(); + this.mode = mode; + } + + /** + * @return {@link #mode} (Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public Enumeration getModeElement() { + if (this.mode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestComponent.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(new RestfulConformanceModeEnumFactory()); // bb + return this.mode; + } + + public boolean hasModeElement() { + return this.mode != null && !this.mode.isEmpty(); + } + + public boolean hasMode() { + return this.mode != null && !this.mode.isEmpty(); + } + + /** + * @param value {@link #mode} (Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public ConformanceRestComponent setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return Identifies whether this portion of the statement is describing ability to initiate or receive restful operations. + */ + public RestfulConformanceMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value Identifies whether this portion of the statement is describing ability to initiate or receive restful operations. + */ + public ConformanceRestComponent setMode(RestfulConformanceMode value) { + if (this.mode == null) + this.mode = new Enumeration(new RestfulConformanceModeEnumFactory()); + this.mode.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (Information about the system's restful capabilities that apply across all applications, such as security.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public StringType getDocumentationElement() { + if (this.documentation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + return this.documentation; + } + + public boolean hasDocumentationElement() { + return this.documentation != null && !this.documentation.isEmpty(); + } + + public boolean hasDocumentation() { + return this.documentation != null && !this.documentation.isEmpty(); + } + + /** + * @param value {@link #documentation} (Information about the system's restful capabilities that apply across all applications, such as security.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public ConformanceRestComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Information about the system's restful capabilities that apply across all applications, such as security. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Information about the system's restful capabilities that apply across all applications, such as security. + */ + public ConformanceRestComponent setDocumentation(String value) { + if (Utilities.noString(value)) + this.documentation = null; + else { + if (this.documentation == null) + this.documentation = new StringType(); + this.documentation.setValue(value); + } + return this; + } + + /** + * @return {@link #security} (Information about security implementation from an interface perspective - what a client needs to know.) + */ + public ConformanceRestSecurityComponent getSecurity() { + if (this.security == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestComponent.security"); + else if (Configuration.doAutoCreate()) + this.security = new ConformanceRestSecurityComponent(); // cc + return this.security; + } + + public boolean hasSecurity() { + return this.security != null && !this.security.isEmpty(); + } + + /** + * @param value {@link #security} (Information about security implementation from an interface perspective - what a client needs to know.) + */ + public ConformanceRestComponent setSecurity(ConformanceRestSecurityComponent value) { + this.security = value; + return this; + } + + /** + * @return {@link #resource} (A specification of the restful capabilities of the solution for a specific resource type.) + */ + public List getResource() { + if (this.resource == null) + this.resource = new ArrayList(); + return this.resource; + } + + public boolean hasResource() { + if (this.resource == null) + return false; + for (ConformanceRestResourceComponent item : this.resource) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #resource} (A specification of the restful capabilities of the solution for a specific resource type.) + */ + // syntactic sugar + public ConformanceRestResourceComponent addResource() { //3 + ConformanceRestResourceComponent t = new ConformanceRestResourceComponent(); + if (this.resource == null) + this.resource = new ArrayList(); + this.resource.add(t); + return t; + } + + // syntactic sugar + public ConformanceRestComponent addResource(ConformanceRestResourceComponent t) { //3 + if (t == null) + return this; + if (this.resource == null) + this.resource = new ArrayList(); + this.resource.add(t); + return this; + } + + /** + * @return {@link #interaction} (A specification of restful operations supported by the system.) + */ + public List getInteraction() { + if (this.interaction == null) + this.interaction = new ArrayList(); + return this.interaction; + } + + public boolean hasInteraction() { + if (this.interaction == null) + return false; + for (SystemInteractionComponent item : this.interaction) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #interaction} (A specification of restful operations supported by the system.) + */ + // syntactic sugar + public SystemInteractionComponent addInteraction() { //3 + SystemInteractionComponent t = new SystemInteractionComponent(); + if (this.interaction == null) + this.interaction = new ArrayList(); + this.interaction.add(t); + return t; + } + + // syntactic sugar + public ConformanceRestComponent addInteraction(SystemInteractionComponent t) { //3 + if (t == null) + return this; + if (this.interaction == null) + this.interaction = new ArrayList(); + this.interaction.add(t); + return this; + } + + /** + * @return {@link #operation} (Definition of an operation or a named query and with its parameters and their meaning and type.) + */ + public List getOperation() { + if (this.operation == null) + this.operation = new ArrayList(); + return this.operation; + } + + public boolean hasOperation() { + if (this.operation == null) + return false; + for (ConformanceRestOperationComponent item : this.operation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #operation} (Definition of an operation or a named query and with its parameters and their meaning and type.) + */ + // syntactic sugar + public ConformanceRestOperationComponent addOperation() { //3 + ConformanceRestOperationComponent t = new ConformanceRestOperationComponent(); + if (this.operation == null) + this.operation = new ArrayList(); + this.operation.add(t); + return t; + } + + // syntactic sugar + public ConformanceRestComponent addOperation(ConformanceRestOperationComponent t) { //3 + if (t == null) + return this; + if (this.operation == null) + this.operation = new ArrayList(); + this.operation.add(t); + return this; + } + + /** + * @return {@link #documentMailbox} (A list of absolute URIs that identify profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose.) + */ + public List getDocumentMailbox() { + if (this.documentMailbox == null) + this.documentMailbox = new ArrayList(); + return this.documentMailbox; + } + + public boolean hasDocumentMailbox() { + if (this.documentMailbox == null) + return false; + for (UriType item : this.documentMailbox) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #documentMailbox} (A list of absolute URIs that identify profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose.) + */ + // syntactic sugar + public UriType addDocumentMailboxElement() {//2 + UriType t = new UriType(); + if (this.documentMailbox == null) + this.documentMailbox = new ArrayList(); + this.documentMailbox.add(t); + return t; + } + + /** + * @param value {@link #documentMailbox} (A list of absolute URIs that identify profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose.) + */ + public ConformanceRestComponent addDocumentMailbox(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.documentMailbox == null) + this.documentMailbox = new ArrayList(); + this.documentMailbox.add(t); + return this; + } + + /** + * @param value {@link #documentMailbox} (A list of absolute URIs that identify profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose.) + */ + public boolean hasDocumentMailbox(String value) { + if (this.documentMailbox == null) + return false; + for (UriType v : this.documentMailbox) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #compartment} (An absolute URI which is a reference to the definition of a compartment hosted by the system.) + */ + public List getCompartment() { + if (this.compartment == null) + this.compartment = new ArrayList(); + return this.compartment; + } + + public boolean hasCompartment() { + if (this.compartment == null) + return false; + for (UriType item : this.compartment) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #compartment} (An absolute URI which is a reference to the definition of a compartment hosted by the system.) + */ + // syntactic sugar + public UriType addCompartmentElement() {//2 + UriType t = new UriType(); + if (this.compartment == null) + this.compartment = new ArrayList(); + this.compartment.add(t); + return t; + } + + /** + * @param value {@link #compartment} (An absolute URI which is a reference to the definition of a compartment hosted by the system.) + */ + public ConformanceRestComponent addCompartment(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.compartment == null) + this.compartment = new ArrayList(); + this.compartment.add(t); + return this; + } + + /** + * @param value {@link #compartment} (An absolute URI which is a reference to the definition of a compartment hosted by the system.) + */ + public boolean hasCompartment(String value) { + if (this.compartment == null) + return false; + for (UriType v : this.compartment) + if (v.equals(value)) // uri + return true; + return false; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("mode", "code", "Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("documentation", "string", "Information about the system's restful capabilities that apply across all applications, such as security.", 0, java.lang.Integer.MAX_VALUE, documentation)); + childrenList.add(new Property("security", "", "Information about security implementation from an interface perspective - what a client needs to know.", 0, java.lang.Integer.MAX_VALUE, security)); + childrenList.add(new Property("resource", "", "A specification of the restful capabilities of the solution for a specific resource type.", 0, java.lang.Integer.MAX_VALUE, resource)); + childrenList.add(new Property("interaction", "", "A specification of restful operations supported by the system.", 0, java.lang.Integer.MAX_VALUE, interaction)); + childrenList.add(new Property("operation", "", "Definition of an operation or a named query and with its parameters and their meaning and type.", 0, java.lang.Integer.MAX_VALUE, operation)); + childrenList.add(new Property("documentMailbox", "uri", "A list of absolute URIs that identify profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier 'http://hl7.org/fhir/documents/mailbox'. Other specifications can declare their own identifier for this purpose.", 0, java.lang.Integer.MAX_VALUE, documentMailbox)); + childrenList.add(new Property("compartment", "uri", "An absolute URI which is a reference to the definition of a compartment hosted by the system.", 0, java.lang.Integer.MAX_VALUE, compartment)); + } + + public ConformanceRestComponent copy() { + ConformanceRestComponent dst = new ConformanceRestComponent(); + copyValues(dst); + dst.mode = mode == null ? null : mode.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + dst.security = security == null ? null : security.copy(); + if (resource != null) { + dst.resource = new ArrayList(); + for (ConformanceRestResourceComponent i : resource) + dst.resource.add(i.copy()); + }; + if (interaction != null) { + dst.interaction = new ArrayList(); + for (SystemInteractionComponent i : interaction) + dst.interaction.add(i.copy()); + }; + if (operation != null) { + dst.operation = new ArrayList(); + for (ConformanceRestOperationComponent i : operation) + dst.operation.add(i.copy()); + }; + if (documentMailbox != null) { + dst.documentMailbox = new ArrayList(); + for (UriType i : documentMailbox) + dst.documentMailbox.add(i.copy()); + }; + if (compartment != null) { + dst.compartment = new ArrayList(); + for (UriType i : compartment) + dst.compartment.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceRestComponent)) + return false; + ConformanceRestComponent o = (ConformanceRestComponent) other; + return compareDeep(mode, o.mode, true) && compareDeep(documentation, o.documentation, true) && compareDeep(security, o.security, true) + && compareDeep(resource, o.resource, true) && compareDeep(interaction, o.interaction, true) && compareDeep(operation, o.operation, true) + && compareDeep(documentMailbox, o.documentMailbox, true) && compareDeep(compartment, o.compartment, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceRestComponent)) + return false; + ConformanceRestComponent o = (ConformanceRestComponent) other; + return compareValues(mode, o.mode, true) && compareValues(documentation, o.documentation, true) && compareValues(documentMailbox, o.documentMailbox, true) + && compareValues(compartment, o.compartment, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (mode == null || mode.isEmpty()) && (documentation == null || documentation.isEmpty()) + && (security == null || security.isEmpty()) && (resource == null || resource.isEmpty()) && (interaction == null || interaction.isEmpty()) + && (operation == null || operation.isEmpty()) && (documentMailbox == null || documentMailbox.isEmpty()) + && (compartment == null || compartment.isEmpty()); + } + + } + + @Block() + public static class ConformanceRestSecurityComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Server adds CORS headers when responding to requests - this enables javascript applications to use the server. + */ + @Child(name = "cors", type = {BooleanType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Adds CORS Headers (http://enable-cors.org/)", formalDefinition="Server adds CORS headers when responding to requests - this enables javascript applications to use the server." ) + protected BooleanType cors; + + /** + * Types of security services are supported/required by the system. + */ + @Child(name = "service", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="OAuth | OAuth2 | NTLM | Basic | Kerberos", formalDefinition="Types of security services are supported/required by the system." ) + protected List service; + + /** + * General description of how security works. + */ + @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="General description of how security works", formalDefinition="General description of how security works." ) + protected StringType description; + + /** + * Certificates associated with security profiles. + */ + @Child(name = "certificate", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Certificates associated with security profiles", formalDefinition="Certificates associated with security profiles." ) + protected List certificate; + + private static final long serialVersionUID = 391663952L; + + /* + * Constructor + */ + public ConformanceRestSecurityComponent() { + super(); + } + + /** + * @return {@link #cors} (Server adds CORS headers when responding to requests - this enables javascript applications to use the server.). This is the underlying object with id, value and extensions. The accessor "getCors" gives direct access to the value + */ + public BooleanType getCorsElement() { + if (this.cors == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestSecurityComponent.cors"); + else if (Configuration.doAutoCreate()) + this.cors = new BooleanType(); // bb + return this.cors; + } + + public boolean hasCorsElement() { + return this.cors != null && !this.cors.isEmpty(); + } + + public boolean hasCors() { + return this.cors != null && !this.cors.isEmpty(); + } + + /** + * @param value {@link #cors} (Server adds CORS headers when responding to requests - this enables javascript applications to use the server.). This is the underlying object with id, value and extensions. The accessor "getCors" gives direct access to the value + */ + public ConformanceRestSecurityComponent setCorsElement(BooleanType value) { + this.cors = value; + return this; + } + + /** + * @return Server adds CORS headers when responding to requests - this enables javascript applications to use the server. + */ + public boolean getCors() { + return this.cors == null || this.cors.isEmpty() ? false : this.cors.getValue(); + } + + /** + * @param value Server adds CORS headers when responding to requests - this enables javascript applications to use the server. + */ + public ConformanceRestSecurityComponent setCors(boolean value) { + if (this.cors == null) + this.cors = new BooleanType(); + this.cors.setValue(value); + return this; + } + + /** + * @return {@link #service} (Types of security services are supported/required by the system.) + */ + public List getService() { + if (this.service == null) + this.service = new ArrayList(); + return this.service; + } + + public boolean hasService() { + if (this.service == null) + return false; + for (CodeableConcept item : this.service) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #service} (Types of security services are supported/required by the system.) + */ + // syntactic sugar + public CodeableConcept addService() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.service == null) + this.service = new ArrayList(); + this.service.add(t); + return t; + } + + // syntactic sugar + public ConformanceRestSecurityComponent addService(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.service == null) + this.service = new ArrayList(); + this.service.add(t); + return this; + } + + /** + * @return {@link #description} (General description of how security works.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestSecurityComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (General description of how security works.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ConformanceRestSecurityComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return General description of how security works. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value General description of how security works. + */ + public ConformanceRestSecurityComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #certificate} (Certificates associated with security profiles.) + */ + public List getCertificate() { + if (this.certificate == null) + this.certificate = new ArrayList(); + return this.certificate; + } + + public boolean hasCertificate() { + if (this.certificate == null) + return false; + for (ConformanceRestSecurityCertificateComponent item : this.certificate) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #certificate} (Certificates associated with security profiles.) + */ + // syntactic sugar + public ConformanceRestSecurityCertificateComponent addCertificate() { //3 + ConformanceRestSecurityCertificateComponent t = new ConformanceRestSecurityCertificateComponent(); + if (this.certificate == null) + this.certificate = new ArrayList(); + this.certificate.add(t); + return t; + } + + // syntactic sugar + public ConformanceRestSecurityComponent addCertificate(ConformanceRestSecurityCertificateComponent t) { //3 + if (t == null) + return this; + if (this.certificate == null) + this.certificate = new ArrayList(); + this.certificate.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("cors", "boolean", "Server adds CORS headers when responding to requests - this enables javascript applications to use the server.", 0, java.lang.Integer.MAX_VALUE, cors)); + childrenList.add(new Property("service", "CodeableConcept", "Types of security services are supported/required by the system.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("description", "string", "General description of how security works.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("certificate", "", "Certificates associated with security profiles.", 0, java.lang.Integer.MAX_VALUE, certificate)); + } + + public ConformanceRestSecurityComponent copy() { + ConformanceRestSecurityComponent dst = new ConformanceRestSecurityComponent(); + copyValues(dst); + dst.cors = cors == null ? null : cors.copy(); + if (service != null) { + dst.service = new ArrayList(); + for (CodeableConcept i : service) + dst.service.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + if (certificate != null) { + dst.certificate = new ArrayList(); + for (ConformanceRestSecurityCertificateComponent i : certificate) + dst.certificate.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceRestSecurityComponent)) + return false; + ConformanceRestSecurityComponent o = (ConformanceRestSecurityComponent) other; + return compareDeep(cors, o.cors, true) && compareDeep(service, o.service, true) && compareDeep(description, o.description, true) + && compareDeep(certificate, o.certificate, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceRestSecurityComponent)) + return false; + ConformanceRestSecurityComponent o = (ConformanceRestSecurityComponent) other; + return compareValues(cors, o.cors, true) && compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (cors == null || cors.isEmpty()) && (service == null || service.isEmpty()) + && (description == null || description.isEmpty()) && (certificate == null || certificate.isEmpty()) + ; + } + + } + + @Block() + public static class ConformanceRestSecurityCertificateComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Mime type for certificate. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Mime type for certificate", formalDefinition="Mime type for certificate." ) + protected CodeType type; + + /** + * Actual certificate. + */ + @Child(name = "blob", type = {Base64BinaryType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Actual certificate", formalDefinition="Actual certificate." ) + protected Base64BinaryType blob; + + private static final long serialVersionUID = 2092655854L; + + /* + * Constructor + */ + public ConformanceRestSecurityCertificateComponent() { + super(); + } + + /** + * @return {@link #type} (Mime type for certificate.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public CodeType getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestSecurityCertificateComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeType(); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Mime type for certificate.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ConformanceRestSecurityCertificateComponent setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return Mime type for certificate. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Mime type for certificate. + */ + public ConformanceRestSecurityCertificateComponent setType(String value) { + if (Utilities.noString(value)) + this.type = null; + else { + if (this.type == null) + this.type = new CodeType(); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #blob} (Actual certificate.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value + */ + public Base64BinaryType getBlobElement() { + if (this.blob == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestSecurityCertificateComponent.blob"); + else if (Configuration.doAutoCreate()) + this.blob = new Base64BinaryType(); // bb + return this.blob; + } + + public boolean hasBlobElement() { + return this.blob != null && !this.blob.isEmpty(); + } + + public boolean hasBlob() { + return this.blob != null && !this.blob.isEmpty(); + } + + /** + * @param value {@link #blob} (Actual certificate.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value + */ + public ConformanceRestSecurityCertificateComponent setBlobElement(Base64BinaryType value) { + this.blob = value; + return this; + } + + /** + * @return Actual certificate. + */ + public byte[] getBlob() { + return this.blob == null ? null : this.blob.getValue(); + } + + /** + * @param value Actual certificate. + */ + public ConformanceRestSecurityCertificateComponent setBlob(byte[] value) { + if (value == null) + this.blob = null; + else { + if (this.blob == null) + this.blob = new Base64BinaryType(); + this.blob.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Mime type for certificate.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("blob", "base64Binary", "Actual certificate.", 0, java.lang.Integer.MAX_VALUE, blob)); + } + + public ConformanceRestSecurityCertificateComponent copy() { + ConformanceRestSecurityCertificateComponent dst = new ConformanceRestSecurityCertificateComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.blob = blob == null ? null : blob.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceRestSecurityCertificateComponent)) + return false; + ConformanceRestSecurityCertificateComponent o = (ConformanceRestSecurityCertificateComponent) other; + return compareDeep(type, o.type, true) && compareDeep(blob, o.blob, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceRestSecurityCertificateComponent)) + return false; + ConformanceRestSecurityCertificateComponent o = (ConformanceRestSecurityCertificateComponent) other; + return compareValues(type, o.type, true) && compareValues(blob, o.blob, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (blob == null || blob.isEmpty()) + ; + } + + } + + @Block() + public static class ConformanceRestResourceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A type of resource exposed via the restful interface. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="A resource type that is supported", formalDefinition="A type of resource exposed via the restful interface." ) + protected CodeType type; + + /** + * A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. + */ + @Child(name = "profile", type = {StructureDefinition.class}, order=2, min=0, max=1) + @Description(shortDefinition="What structural features are supported", formalDefinition="A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations." ) + protected Reference profile; + + /** + * The actual object that is the target of the reference (A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.) + */ + protected StructureDefinition profileTarget; + + /** + * Identifies a restful operation supported by the solution. + */ + @Child(name = "interaction", type = {}, order=3, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="What operations are supported?", formalDefinition="Identifies a restful operation supported by the solution." ) + protected List interaction; + + /** + * Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources. + */ + @Child(name = "versioning", type = {CodeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="no-version | versioned | versioned-update", formalDefinition="Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources." ) + protected Enumeration versioning; + + /** + * A flag for whether the server is able to return past versions as part of the vRead operation. + */ + @Child(name = "readHistory", type = {BooleanType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Whether vRead can return past versions", formalDefinition="A flag for whether the server is able to return past versions as part of the vRead operation." ) + protected BooleanType readHistory; + + /** + * A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server. + */ + @Child(name = "updateCreate", type = {BooleanType.class}, order=6, min=0, max=1) + @Description(shortDefinition="If update can commit to a new identity", formalDefinition="A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server." ) + protected BooleanType updateCreate; + + /** + * A flag that indicates that the server supports conditional create. + */ + @Child(name = "conditionalCreate", type = {BooleanType.class}, order=7, min=0, max=1) + @Description(shortDefinition="If allows/uses conditional create", formalDefinition="A flag that indicates that the server supports conditional create." ) + protected BooleanType conditionalCreate; + + /** + * A flag that indicates that the server supports conditional update. + */ + @Child(name = "conditionalUpdate", type = {BooleanType.class}, order=8, min=0, max=1) + @Description(shortDefinition="If allows/uses conditional update", formalDefinition="A flag that indicates that the server supports conditional update." ) + protected BooleanType conditionalUpdate; + + /** + * A flag that indicates that the server supports conditional delete. + */ + @Child(name = "conditionalDelete", type = {BooleanType.class}, order=9, min=0, max=1) + @Description(shortDefinition="If allows/uses conditional delete", formalDefinition="A flag that indicates that the server supports conditional delete." ) + protected BooleanType conditionalDelete; + + /** + * A list of _include values supported by the server. + */ + @Child(name = "searchInclude", type = {StringType.class}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="_include values supported by the server", formalDefinition="A list of _include values supported by the server." ) + protected List searchInclude; + + /** + * Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation. + */ + @Child(name = "searchParam", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Search params supported by implementation", formalDefinition="Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation." ) + protected List searchParam; + + private static final long serialVersionUID = 1477462605L; + + /* + * Constructor + */ + public ConformanceRestResourceComponent() { + super(); + } + + /* + * Constructor + */ + public ConformanceRestResourceComponent(CodeType type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (A type of resource exposed via the restful interface.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public CodeType getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeType(); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (A type of resource exposed via the restful interface.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ConformanceRestResourceComponent setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return A type of resource exposed via the restful interface. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value A type of resource exposed via the restful interface. + */ + public ConformanceRestResourceComponent setType(String value) { + if (this.type == null) + this.type = new CodeType(); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #profile} (A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.) + */ + public Reference getProfile() { + if (this.profile == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profile = new Reference(); // cc + return this.profile; + } + + public boolean hasProfile() { + return this.profile != null && !this.profile.isEmpty(); + } + + /** + * @param value {@link #profile} (A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.) + */ + public ConformanceRestResourceComponent setProfile(Reference value) { + this.profile = value; + return this; + } + + /** + * @return {@link #profile} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.) + */ + public StructureDefinition getProfileTarget() { + if (this.profileTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profileTarget = new StructureDefinition(); // aa + return this.profileTarget; + } + + /** + * @param value {@link #profile} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.) + */ + public ConformanceRestResourceComponent setProfileTarget(StructureDefinition value) { + this.profileTarget = value; + return this; + } + + /** + * @return {@link #interaction} (Identifies a restful operation supported by the solution.) + */ + public List getInteraction() { + if (this.interaction == null) + this.interaction = new ArrayList(); + return this.interaction; + } + + public boolean hasInteraction() { + if (this.interaction == null) + return false; + for (ResourceInteractionComponent item : this.interaction) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #interaction} (Identifies a restful operation supported by the solution.) + */ + // syntactic sugar + public ResourceInteractionComponent addInteraction() { //3 + ResourceInteractionComponent t = new ResourceInteractionComponent(); + if (this.interaction == null) + this.interaction = new ArrayList(); + this.interaction.add(t); + return t; + } + + // syntactic sugar + public ConformanceRestResourceComponent addInteraction(ResourceInteractionComponent t) { //3 + if (t == null) + return this; + if (this.interaction == null) + this.interaction = new ArrayList(); + this.interaction.add(t); + return this; + } + + /** + * @return {@link #versioning} (Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value + */ + public Enumeration getVersioningElement() { + if (this.versioning == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.versioning"); + else if (Configuration.doAutoCreate()) + this.versioning = new Enumeration(new VersioningPolicyEnumFactory()); // bb + return this.versioning; + } + + public boolean hasVersioningElement() { + return this.versioning != null && !this.versioning.isEmpty(); + } + + public boolean hasVersioning() { + return this.versioning != null && !this.versioning.isEmpty(); + } + + /** + * @param value {@link #versioning} (Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value + */ + public ConformanceRestResourceComponent setVersioningElement(Enumeration value) { + this.versioning = value; + return this; + } + + /** + * @return Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources. + */ + public VersioningPolicy getVersioning() { + return this.versioning == null ? null : this.versioning.getValue(); + } + + /** + * @param value Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources. + */ + public ConformanceRestResourceComponent setVersioning(VersioningPolicy value) { + if (value == null) + this.versioning = null; + else { + if (this.versioning == null) + this.versioning = new Enumeration(new VersioningPolicyEnumFactory()); + this.versioning.setValue(value); + } + return this; + } + + /** + * @return {@link #readHistory} (A flag for whether the server is able to return past versions as part of the vRead operation.). This is the underlying object with id, value and extensions. The accessor "getReadHistory" gives direct access to the value + */ + public BooleanType getReadHistoryElement() { + if (this.readHistory == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.readHistory"); + else if (Configuration.doAutoCreate()) + this.readHistory = new BooleanType(); // bb + return this.readHistory; + } + + public boolean hasReadHistoryElement() { + return this.readHistory != null && !this.readHistory.isEmpty(); + } + + public boolean hasReadHistory() { + return this.readHistory != null && !this.readHistory.isEmpty(); + } + + /** + * @param value {@link #readHistory} (A flag for whether the server is able to return past versions as part of the vRead operation.). This is the underlying object with id, value and extensions. The accessor "getReadHistory" gives direct access to the value + */ + public ConformanceRestResourceComponent setReadHistoryElement(BooleanType value) { + this.readHistory = value; + return this; + } + + /** + * @return A flag for whether the server is able to return past versions as part of the vRead operation. + */ + public boolean getReadHistory() { + return this.readHistory == null || this.readHistory.isEmpty() ? false : this.readHistory.getValue(); + } + + /** + * @param value A flag for whether the server is able to return past versions as part of the vRead operation. + */ + public ConformanceRestResourceComponent setReadHistory(boolean value) { + if (this.readHistory == null) + this.readHistory = new BooleanType(); + this.readHistory.setValue(value); + return this; + } + + /** + * @return {@link #updateCreate} (A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.). This is the underlying object with id, value and extensions. The accessor "getUpdateCreate" gives direct access to the value + */ + public BooleanType getUpdateCreateElement() { + if (this.updateCreate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.updateCreate"); + else if (Configuration.doAutoCreate()) + this.updateCreate = new BooleanType(); // bb + return this.updateCreate; + } + + public boolean hasUpdateCreateElement() { + return this.updateCreate != null && !this.updateCreate.isEmpty(); + } + + public boolean hasUpdateCreate() { + return this.updateCreate != null && !this.updateCreate.isEmpty(); + } + + /** + * @param value {@link #updateCreate} (A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.). This is the underlying object with id, value and extensions. The accessor "getUpdateCreate" gives direct access to the value + */ + public ConformanceRestResourceComponent setUpdateCreateElement(BooleanType value) { + this.updateCreate = value; + return this; + } + + /** + * @return A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server. + */ + public boolean getUpdateCreate() { + return this.updateCreate == null || this.updateCreate.isEmpty() ? false : this.updateCreate.getValue(); + } + + /** + * @param value A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server. + */ + public ConformanceRestResourceComponent setUpdateCreate(boolean value) { + if (this.updateCreate == null) + this.updateCreate = new BooleanType(); + this.updateCreate.setValue(value); + return this; + } + + /** + * @return {@link #conditionalCreate} (A flag that indicates that the server supports conditional create.). This is the underlying object with id, value and extensions. The accessor "getConditionalCreate" gives direct access to the value + */ + public BooleanType getConditionalCreateElement() { + if (this.conditionalCreate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.conditionalCreate"); + else if (Configuration.doAutoCreate()) + this.conditionalCreate = new BooleanType(); // bb + return this.conditionalCreate; + } + + public boolean hasConditionalCreateElement() { + return this.conditionalCreate != null && !this.conditionalCreate.isEmpty(); + } + + public boolean hasConditionalCreate() { + return this.conditionalCreate != null && !this.conditionalCreate.isEmpty(); + } + + /** + * @param value {@link #conditionalCreate} (A flag that indicates that the server supports conditional create.). This is the underlying object with id, value and extensions. The accessor "getConditionalCreate" gives direct access to the value + */ + public ConformanceRestResourceComponent setConditionalCreateElement(BooleanType value) { + this.conditionalCreate = value; + return this; + } + + /** + * @return A flag that indicates that the server supports conditional create. + */ + public boolean getConditionalCreate() { + return this.conditionalCreate == null || this.conditionalCreate.isEmpty() ? false : this.conditionalCreate.getValue(); + } + + /** + * @param value A flag that indicates that the server supports conditional create. + */ + public ConformanceRestResourceComponent setConditionalCreate(boolean value) { + if (this.conditionalCreate == null) + this.conditionalCreate = new BooleanType(); + this.conditionalCreate.setValue(value); + return this; + } + + /** + * @return {@link #conditionalUpdate} (A flag that indicates that the server supports conditional update.). This is the underlying object with id, value and extensions. The accessor "getConditionalUpdate" gives direct access to the value + */ + public BooleanType getConditionalUpdateElement() { + if (this.conditionalUpdate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.conditionalUpdate"); + else if (Configuration.doAutoCreate()) + this.conditionalUpdate = new BooleanType(); // bb + return this.conditionalUpdate; + } + + public boolean hasConditionalUpdateElement() { + return this.conditionalUpdate != null && !this.conditionalUpdate.isEmpty(); + } + + public boolean hasConditionalUpdate() { + return this.conditionalUpdate != null && !this.conditionalUpdate.isEmpty(); + } + + /** + * @param value {@link #conditionalUpdate} (A flag that indicates that the server supports conditional update.). This is the underlying object with id, value and extensions. The accessor "getConditionalUpdate" gives direct access to the value + */ + public ConformanceRestResourceComponent setConditionalUpdateElement(BooleanType value) { + this.conditionalUpdate = value; + return this; + } + + /** + * @return A flag that indicates that the server supports conditional update. + */ + public boolean getConditionalUpdate() { + return this.conditionalUpdate == null || this.conditionalUpdate.isEmpty() ? false : this.conditionalUpdate.getValue(); + } + + /** + * @param value A flag that indicates that the server supports conditional update. + */ + public ConformanceRestResourceComponent setConditionalUpdate(boolean value) { + if (this.conditionalUpdate == null) + this.conditionalUpdate = new BooleanType(); + this.conditionalUpdate.setValue(value); + return this; + } + + /** + * @return {@link #conditionalDelete} (A flag that indicates that the server supports conditional delete.). This is the underlying object with id, value and extensions. The accessor "getConditionalDelete" gives direct access to the value + */ + public BooleanType getConditionalDeleteElement() { + if (this.conditionalDelete == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.conditionalDelete"); + else if (Configuration.doAutoCreate()) + this.conditionalDelete = new BooleanType(); // bb + return this.conditionalDelete; + } + + public boolean hasConditionalDeleteElement() { + return this.conditionalDelete != null && !this.conditionalDelete.isEmpty(); + } + + public boolean hasConditionalDelete() { + return this.conditionalDelete != null && !this.conditionalDelete.isEmpty(); + } + + /** + * @param value {@link #conditionalDelete} (A flag that indicates that the server supports conditional delete.). This is the underlying object with id, value and extensions. The accessor "getConditionalDelete" gives direct access to the value + */ + public ConformanceRestResourceComponent setConditionalDeleteElement(BooleanType value) { + this.conditionalDelete = value; + return this; + } + + /** + * @return A flag that indicates that the server supports conditional delete. + */ + public boolean getConditionalDelete() { + return this.conditionalDelete == null || this.conditionalDelete.isEmpty() ? false : this.conditionalDelete.getValue(); + } + + /** + * @param value A flag that indicates that the server supports conditional delete. + */ + public ConformanceRestResourceComponent setConditionalDelete(boolean value) { + if (this.conditionalDelete == null) + this.conditionalDelete = new BooleanType(); + this.conditionalDelete.setValue(value); + return this; + } + + /** + * @return {@link #searchInclude} (A list of _include values supported by the server.) + */ + public List getSearchInclude() { + if (this.searchInclude == null) + this.searchInclude = new ArrayList(); + return this.searchInclude; + } + + public boolean hasSearchInclude() { + if (this.searchInclude == null) + return false; + for (StringType item : this.searchInclude) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #searchInclude} (A list of _include values supported by the server.) + */ + // syntactic sugar + public StringType addSearchIncludeElement() {//2 + StringType t = new StringType(); + if (this.searchInclude == null) + this.searchInclude = new ArrayList(); + this.searchInclude.add(t); + return t; + } + + /** + * @param value {@link #searchInclude} (A list of _include values supported by the server.) + */ + public ConformanceRestResourceComponent addSearchInclude(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.searchInclude == null) + this.searchInclude = new ArrayList(); + this.searchInclude.add(t); + return this; + } + + /** + * @param value {@link #searchInclude} (A list of _include values supported by the server.) + */ + public boolean hasSearchInclude(String value) { + if (this.searchInclude == null) + return false; + for (StringType v : this.searchInclude) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #searchParam} (Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.) + */ + public List getSearchParam() { + if (this.searchParam == null) + this.searchParam = new ArrayList(); + return this.searchParam; + } + + public boolean hasSearchParam() { + if (this.searchParam == null) + return false; + for (ConformanceRestResourceSearchParamComponent item : this.searchParam) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #searchParam} (Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.) + */ + // syntactic sugar + public ConformanceRestResourceSearchParamComponent addSearchParam() { //3 + ConformanceRestResourceSearchParamComponent t = new ConformanceRestResourceSearchParamComponent(); + if (this.searchParam == null) + this.searchParam = new ArrayList(); + this.searchParam.add(t); + return t; + } + + // syntactic sugar + public ConformanceRestResourceComponent addSearchParam(ConformanceRestResourceSearchParamComponent t) { //3 + if (t == null) + return this; + if (this.searchParam == null) + this.searchParam = new ArrayList(); + this.searchParam.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "A type of resource exposed via the restful interface.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("interaction", "", "Identifies a restful operation supported by the solution.", 0, java.lang.Integer.MAX_VALUE, interaction)); + childrenList.add(new Property("versioning", "code", "Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources.", 0, java.lang.Integer.MAX_VALUE, versioning)); + childrenList.add(new Property("readHistory", "boolean", "A flag for whether the server is able to return past versions as part of the vRead operation.", 0, java.lang.Integer.MAX_VALUE, readHistory)); + childrenList.add(new Property("updateCreate", "boolean", "A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.", 0, java.lang.Integer.MAX_VALUE, updateCreate)); + childrenList.add(new Property("conditionalCreate", "boolean", "A flag that indicates that the server supports conditional create.", 0, java.lang.Integer.MAX_VALUE, conditionalCreate)); + childrenList.add(new Property("conditionalUpdate", "boolean", "A flag that indicates that the server supports conditional update.", 0, java.lang.Integer.MAX_VALUE, conditionalUpdate)); + childrenList.add(new Property("conditionalDelete", "boolean", "A flag that indicates that the server supports conditional delete.", 0, java.lang.Integer.MAX_VALUE, conditionalDelete)); + childrenList.add(new Property("searchInclude", "string", "A list of _include values supported by the server.", 0, java.lang.Integer.MAX_VALUE, searchInclude)); + childrenList.add(new Property("searchParam", "", "Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.", 0, java.lang.Integer.MAX_VALUE, searchParam)); + } + + public ConformanceRestResourceComponent copy() { + ConformanceRestResourceComponent dst = new ConformanceRestResourceComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.profile = profile == null ? null : profile.copy(); + if (interaction != null) { + dst.interaction = new ArrayList(); + for (ResourceInteractionComponent i : interaction) + dst.interaction.add(i.copy()); + }; + dst.versioning = versioning == null ? null : versioning.copy(); + dst.readHistory = readHistory == null ? null : readHistory.copy(); + dst.updateCreate = updateCreate == null ? null : updateCreate.copy(); + dst.conditionalCreate = conditionalCreate == null ? null : conditionalCreate.copy(); + dst.conditionalUpdate = conditionalUpdate == null ? null : conditionalUpdate.copy(); + dst.conditionalDelete = conditionalDelete == null ? null : conditionalDelete.copy(); + if (searchInclude != null) { + dst.searchInclude = new ArrayList(); + for (StringType i : searchInclude) + dst.searchInclude.add(i.copy()); + }; + if (searchParam != null) { + dst.searchParam = new ArrayList(); + for (ConformanceRestResourceSearchParamComponent i : searchParam) + dst.searchParam.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceRestResourceComponent)) + return false; + ConformanceRestResourceComponent o = (ConformanceRestResourceComponent) other; + return compareDeep(type, o.type, true) && compareDeep(profile, o.profile, true) && compareDeep(interaction, o.interaction, true) + && compareDeep(versioning, o.versioning, true) && compareDeep(readHistory, o.readHistory, true) + && compareDeep(updateCreate, o.updateCreate, true) && compareDeep(conditionalCreate, o.conditionalCreate, true) + && compareDeep(conditionalUpdate, o.conditionalUpdate, true) && compareDeep(conditionalDelete, o.conditionalDelete, true) + && compareDeep(searchInclude, o.searchInclude, true) && compareDeep(searchParam, o.searchParam, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceRestResourceComponent)) + return false; + ConformanceRestResourceComponent o = (ConformanceRestResourceComponent) other; + return compareValues(type, o.type, true) && compareValues(versioning, o.versioning, true) && compareValues(readHistory, o.readHistory, true) + && compareValues(updateCreate, o.updateCreate, true) && compareValues(conditionalCreate, o.conditionalCreate, true) + && compareValues(conditionalUpdate, o.conditionalUpdate, true) && compareValues(conditionalDelete, o.conditionalDelete, true) + && compareValues(searchInclude, o.searchInclude, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (profile == null || profile.isEmpty()) + && (interaction == null || interaction.isEmpty()) && (versioning == null || versioning.isEmpty()) + && (readHistory == null || readHistory.isEmpty()) && (updateCreate == null || updateCreate.isEmpty()) + && (conditionalCreate == null || conditionalCreate.isEmpty()) && (conditionalUpdate == null || conditionalUpdate.isEmpty()) + && (conditionalDelete == null || conditionalDelete.isEmpty()) && (searchInclude == null || searchInclude.isEmpty()) + && (searchParam == null || searchParam.isEmpty()); + } + + } + + @Block() + public static class ResourceInteractionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Coded identifier of the operation, supported by the system resource. + */ + @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="read | vread | update | delete | history-instance | validate | history-type | create | search-type", formalDefinition="Coded identifier of the operation, supported by the system resource." ) + protected Enumeration code; + + /** + * Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'. + */ + @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Anything special about operation behavior", formalDefinition="Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'." ) + protected StringType documentation; + + private static final long serialVersionUID = -437507806L; + + /* + * Constructor + */ + public ResourceInteractionComponent() { + super(); + } + + /* + * Constructor + */ + public ResourceInteractionComponent(Enumeration code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Coded identifier of the operation, supported by the system resource.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Enumeration getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResourceInteractionComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Enumeration(new TypeRestfulInteractionEnumFactory()); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Coded identifier of the operation, supported by the system resource.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public ResourceInteractionComponent setCodeElement(Enumeration value) { + this.code = value; + return this; + } + + /** + * @return Coded identifier of the operation, supported by the system resource. + */ + public TypeRestfulInteraction getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Coded identifier of the operation, supported by the system resource. + */ + public ResourceInteractionComponent setCode(TypeRestfulInteraction value) { + if (this.code == null) + this.code = new Enumeration(new TypeRestfulInteractionEnumFactory()); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public StringType getDocumentationElement() { + if (this.documentation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResourceInteractionComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + return this.documentation; + } + + public boolean hasDocumentationElement() { + return this.documentation != null && !this.documentation.isEmpty(); + } + + public boolean hasDocumentation() { + return this.documentation != null && !this.documentation.isEmpty(); + } + + /** + * @param value {@link #documentation} (Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public ResourceInteractionComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'. + */ + public ResourceInteractionComponent setDocumentation(String value) { + if (Utilities.noString(value)) + this.documentation = null; + else { + if (this.documentation == null) + this.documentation = new StringType(); + this.documentation.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "Coded identifier of the operation, supported by the system resource.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("documentation", "string", "Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.", 0, java.lang.Integer.MAX_VALUE, documentation)); + } + + public ResourceInteractionComponent copy() { + ResourceInteractionComponent dst = new ResourceInteractionComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ResourceInteractionComponent)) + return false; + ResourceInteractionComponent o = (ResourceInteractionComponent) other; + return compareDeep(code, o.code, true) && compareDeep(documentation, o.documentation, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ResourceInteractionComponent)) + return false; + ResourceInteractionComponent o = (ResourceInteractionComponent) other; + return compareValues(code, o.code, true) && compareValues(documentation, o.documentation, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (documentation == null || documentation.isEmpty()) + ; + } + + } + + @Block() + public static class ConformanceRestResourceSearchParamComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of the search parameter used in the interface. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Name of search parameter", formalDefinition="The name of the search parameter used in the interface." ) + protected StringType name; + + /** + * An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]). + */ + @Child(name = "definition", type = {UriType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Source of definition for parameter", formalDefinition="An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]])." ) + protected UriType definition; + + /** + * The type of value a search parameter refers to, and how the content is interpreted. + */ + @Child(name = "type", type = {CodeType.class}, order=3, min=1, max=1) + @Description(shortDefinition="number | date | string | token | reference | composite | quantity | uri", formalDefinition="The type of value a search parameter refers to, and how the content is interpreted." ) + protected Enumeration type; + + /** + * This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. + */ + @Child(name = "documentation", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Server-specific usage", formalDefinition="This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms." ) + protected StringType documentation; + + /** + * Types of resource (if a resource is referenced). + */ + @Child(name = "target", type = {CodeType.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Types of resource (if a resource reference)", formalDefinition="Types of resource (if a resource is referenced)." ) + protected List target; + + /** + * Chained names supported. + */ + @Child(name = "chain", type = {StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Chained names supported", formalDefinition="Chained names supported." ) + protected List chain; + + private static final long serialVersionUID = 938312816L; + + /* + * Constructor + */ + public ConformanceRestResourceSearchParamComponent() { + super(); + } + + /* + * Constructor + */ + public ConformanceRestResourceSearchParamComponent(StringType name, Enumeration type) { + super(); + this.name = name; + this.type = type; + } + + /** + * @return {@link #name} (The name of the search parameter used in the interface.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceSearchParamComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The name of the search parameter used in the interface.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ConformanceRestResourceSearchParamComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of the search parameter used in the interface. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of the search parameter used in the interface. + */ + public ConformanceRestResourceSearchParamComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #definition} (An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public UriType getDefinitionElement() { + if (this.definition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceSearchParamComponent.definition"); + else if (Configuration.doAutoCreate()) + this.definition = new UriType(); // bb + return this.definition; + } + + public boolean hasDefinitionElement() { + return this.definition != null && !this.definition.isEmpty(); + } + + public boolean hasDefinition() { + return this.definition != null && !this.definition.isEmpty(); + } + + /** + * @param value {@link #definition} (An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public ConformanceRestResourceSearchParamComponent setDefinitionElement(UriType value) { + this.definition = value; + return this; + } + + /** + * @return An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]). + */ + public String getDefinition() { + return this.definition == null ? null : this.definition.getValue(); + } + + /** + * @param value An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]). + */ + public ConformanceRestResourceSearchParamComponent setDefinition(String value) { + if (Utilities.noString(value)) + this.definition = null; + else { + if (this.definition == null) + this.definition = new UriType(); + this.definition.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceSearchParamComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new SearchParamTypeEnumFactory()); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ConformanceRestResourceSearchParamComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The type of value a search parameter refers to, and how the content is interpreted. + */ + public SearchParamType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of value a search parameter refers to, and how the content is interpreted. + */ + public ConformanceRestResourceSearchParamComponent setType(SearchParamType value) { + if (this.type == null) + this.type = new Enumeration(new SearchParamTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public StringType getDocumentationElement() { + if (this.documentation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceSearchParamComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + return this.documentation; + } + + public boolean hasDocumentationElement() { + return this.documentation != null && !this.documentation.isEmpty(); + } + + public boolean hasDocumentation() { + return this.documentation != null && !this.documentation.isEmpty(); + } + + /** + * @param value {@link #documentation} (This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public ConformanceRestResourceSearchParamComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. + */ + public ConformanceRestResourceSearchParamComponent setDocumentation(String value) { + if (Utilities.noString(value)) + this.documentation = null; + else { + if (this.documentation == null) + this.documentation = new StringType(); + this.documentation.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (Types of resource (if a resource is referenced).) + */ + public List getTarget() { + if (this.target == null) + this.target = new ArrayList(); + return this.target; + } + + public boolean hasTarget() { + if (this.target == null) + return false; + for (CodeType item : this.target) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #target} (Types of resource (if a resource is referenced).) + */ + // syntactic sugar + public CodeType addTargetElement() {//2 + CodeType t = new CodeType(); + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return t; + } + + /** + * @param value {@link #target} (Types of resource (if a resource is referenced).) + */ + public ConformanceRestResourceSearchParamComponent addTarget(String value) { //1 + CodeType t = new CodeType(); + t.setValue(value); + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return this; + } + + /** + * @param value {@link #target} (Types of resource (if a resource is referenced).) + */ + public boolean hasTarget(String value) { + if (this.target == null) + return false; + for (CodeType v : this.target) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #chain} (Chained names supported.) + */ + public List getChain() { + if (this.chain == null) + this.chain = new ArrayList(); + return this.chain; + } + + public boolean hasChain() { + if (this.chain == null) + return false; + for (StringType item : this.chain) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #chain} (Chained names supported.) + */ + // syntactic sugar + public StringType addChainElement() {//2 + StringType t = new StringType(); + if (this.chain == null) + this.chain = new ArrayList(); + this.chain.add(t); + return t; + } + + /** + * @param value {@link #chain} (Chained names supported.) + */ + public ConformanceRestResourceSearchParamComponent addChain(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.chain == null) + this.chain = new ArrayList(); + this.chain.add(t); + return this; + } + + /** + * @param value {@link #chain} (Chained names supported.) + */ + public boolean hasChain(String value) { + if (this.chain == null) + return false; + for (StringType v : this.chain) + if (v.equals(value)) // string + return true; + return false; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of the search parameter used in the interface.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("definition", "uri", "An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).", 0, java.lang.Integer.MAX_VALUE, definition)); + childrenList.add(new Property("type", "code", "The type of value a search parameter refers to, and how the content is interpreted.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("documentation", "string", "This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms.", 0, java.lang.Integer.MAX_VALUE, documentation)); + childrenList.add(new Property("target", "code", "Types of resource (if a resource is referenced).", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("chain", "string", "Chained names supported.", 0, java.lang.Integer.MAX_VALUE, chain)); + } + + public ConformanceRestResourceSearchParamComponent copy() { + ConformanceRestResourceSearchParamComponent dst = new ConformanceRestResourceSearchParamComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.definition = definition == null ? null : definition.copy(); + dst.type = type == null ? null : type.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + if (target != null) { + dst.target = new ArrayList(); + for (CodeType i : target) + dst.target.add(i.copy()); + }; + if (chain != null) { + dst.chain = new ArrayList(); + for (StringType i : chain) + dst.chain.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceRestResourceSearchParamComponent)) + return false; + ConformanceRestResourceSearchParamComponent o = (ConformanceRestResourceSearchParamComponent) other; + return compareDeep(name, o.name, true) && compareDeep(definition, o.definition, true) && compareDeep(type, o.type, true) + && compareDeep(documentation, o.documentation, true) && compareDeep(target, o.target, true) && compareDeep(chain, o.chain, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceRestResourceSearchParamComponent)) + return false; + ConformanceRestResourceSearchParamComponent o = (ConformanceRestResourceSearchParamComponent) other; + return compareValues(name, o.name, true) && compareValues(definition, o.definition, true) && compareValues(type, o.type, true) + && compareValues(documentation, o.documentation, true) && compareValues(target, o.target, true) && compareValues(chain, o.chain, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (definition == null || definition.isEmpty()) + && (type == null || type.isEmpty()) && (documentation == null || documentation.isEmpty()) + && (target == null || target.isEmpty()) && (chain == null || chain.isEmpty()); + } + + } + + @Block() + public static class SystemInteractionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A coded identifier of the operation, supported by the system. + */ + @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="transaction | search-system | history-system", formalDefinition="A coded identifier of the operation, supported by the system." ) + protected Enumeration code; + + /** + * Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented. + */ + @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Anything special about operation behavior", formalDefinition="Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented." ) + protected StringType documentation; + + private static final long serialVersionUID = 510675287L; + + /* + * Constructor + */ + public SystemInteractionComponent() { + super(); + } + + /* + * Constructor + */ + public SystemInteractionComponent(Enumeration code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (A coded identifier of the operation, supported by the system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Enumeration getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SystemInteractionComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Enumeration(new SystemRestfulInteractionEnumFactory()); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A coded identifier of the operation, supported by the system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public SystemInteractionComponent setCodeElement(Enumeration value) { + this.code = value; + return this; + } + + /** + * @return A coded identifier of the operation, supported by the system. + */ + public SystemRestfulInteraction getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value A coded identifier of the operation, supported by the system. + */ + public SystemInteractionComponent setCode(SystemRestfulInteraction value) { + if (this.code == null) + this.code = new Enumeration(new SystemRestfulInteractionEnumFactory()); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public StringType getDocumentationElement() { + if (this.documentation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SystemInteractionComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + return this.documentation; + } + + public boolean hasDocumentationElement() { + return this.documentation != null && !this.documentation.isEmpty(); + } + + public boolean hasDocumentation() { + return this.documentation != null && !this.documentation.isEmpty(); + } + + /** + * @param value {@link #documentation} (Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public SystemInteractionComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented. + */ + public SystemInteractionComponent setDocumentation(String value) { + if (Utilities.noString(value)) + this.documentation = null; + else { + if (this.documentation == null) + this.documentation = new StringType(); + this.documentation.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "A coded identifier of the operation, supported by the system.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("documentation", "string", "Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.", 0, java.lang.Integer.MAX_VALUE, documentation)); + } + + public SystemInteractionComponent copy() { + SystemInteractionComponent dst = new SystemInteractionComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SystemInteractionComponent)) + return false; + SystemInteractionComponent o = (SystemInteractionComponent) other; + return compareDeep(code, o.code, true) && compareDeep(documentation, o.documentation, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SystemInteractionComponent)) + return false; + SystemInteractionComponent o = (SystemInteractionComponent) other; + return compareValues(code, o.code, true) && compareValues(documentation, o.documentation, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (documentation == null || documentation.isEmpty()) + ; + } + + } + + @Block() + public static class ConformanceRestOperationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of a query, which is used in the _query parameter when the query is called. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Name by which the operation/query is invoked", formalDefinition="The name of a query, which is used in the _query parameter when the query is called." ) + protected StringType name; + + /** + * Where the formal definition can be found. + */ + @Child(name = "definition", type = {OperationDefinition.class}, order=2, min=1, max=1) + @Description(shortDefinition="The defined operation/query", formalDefinition="Where the formal definition can be found." ) + protected Reference definition; + + /** + * The actual object that is the target of the reference (Where the formal definition can be found.) + */ + protected OperationDefinition definitionTarget; + + private static final long serialVersionUID = 122107272L; + + /* + * Constructor + */ + public ConformanceRestOperationComponent() { + super(); + } + + /* + * Constructor + */ + public ConformanceRestOperationComponent(StringType name, Reference definition) { + super(); + this.name = name; + this.definition = definition; + } + + /** + * @return {@link #name} (The name of a query, which is used in the _query parameter when the query is called.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestOperationComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The name of a query, which is used in the _query parameter when the query is called.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ConformanceRestOperationComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of a query, which is used in the _query parameter when the query is called. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of a query, which is used in the _query parameter when the query is called. + */ + public ConformanceRestOperationComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #definition} (Where the formal definition can be found.) + */ + public Reference getDefinition() { + if (this.definition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestOperationComponent.definition"); + else if (Configuration.doAutoCreate()) + this.definition = new Reference(); // cc + return this.definition; + } + + public boolean hasDefinition() { + return this.definition != null && !this.definition.isEmpty(); + } + + /** + * @param value {@link #definition} (Where the formal definition can be found.) + */ + public ConformanceRestOperationComponent setDefinition(Reference value) { + this.definition = value; + return this; + } + + /** + * @return {@link #definition} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Where the formal definition can be found.) + */ + public OperationDefinition getDefinitionTarget() { + if (this.definitionTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestOperationComponent.definition"); + else if (Configuration.doAutoCreate()) + this.definitionTarget = new OperationDefinition(); // aa + return this.definitionTarget; + } + + /** + * @param value {@link #definition} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Where the formal definition can be found.) + */ + public ConformanceRestOperationComponent setDefinitionTarget(OperationDefinition value) { + this.definitionTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of a query, which is used in the _query parameter when the query is called.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("definition", "Reference(OperationDefinition)", "Where the formal definition can be found.", 0, java.lang.Integer.MAX_VALUE, definition)); + } + + public ConformanceRestOperationComponent copy() { + ConformanceRestOperationComponent dst = new ConformanceRestOperationComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.definition = definition == null ? null : definition.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceRestOperationComponent)) + return false; + ConformanceRestOperationComponent o = (ConformanceRestOperationComponent) other; + return compareDeep(name, o.name, true) && compareDeep(definition, o.definition, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceRestOperationComponent)) + return false; + ConformanceRestOperationComponent o = (ConformanceRestOperationComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (definition == null || definition.isEmpty()) + ; + } + + } + + @Block() + public static class ConformanceMessagingComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An address to which messages and/or replies are to be sent. + */ + @Child(name = "endpoint", type = {UriType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Actual endpoint being described", formalDefinition="An address to which messages and/or replies are to be sent." ) + protected UriType endpoint; + + /** + * Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender). + */ + @Child(name = "reliableCache", type = {UnsignedIntType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Reliable Message Cache Length (min)", formalDefinition="Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender)." ) + protected UnsignedIntType reliableCache; + + /** + * Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner. + */ + @Child(name = "documentation", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Messaging interface behavior details", formalDefinition="Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner." ) + protected StringType documentation; + + /** + * A description of the solution's support for an event at this end point. + */ + @Child(name = "event", type = {}, order=4, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Declare support for this event", formalDefinition="A description of the solution's support for an event at this end point." ) + protected List event; + + private static final long serialVersionUID = -1356115534L; + + /* + * Constructor + */ + public ConformanceMessagingComponent() { + super(); + } + + /** + * @return {@link #endpoint} (An address to which messages and/or replies are to be sent.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value + */ + public UriType getEndpointElement() { + if (this.endpoint == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingComponent.endpoint"); + else if (Configuration.doAutoCreate()) + this.endpoint = new UriType(); // bb + return this.endpoint; + } + + public boolean hasEndpointElement() { + return this.endpoint != null && !this.endpoint.isEmpty(); + } + + public boolean hasEndpoint() { + return this.endpoint != null && !this.endpoint.isEmpty(); + } + + /** + * @param value {@link #endpoint} (An address to which messages and/or replies are to be sent.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value + */ + public ConformanceMessagingComponent setEndpointElement(UriType value) { + this.endpoint = value; + return this; + } + + /** + * @return An address to which messages and/or replies are to be sent. + */ + public String getEndpoint() { + return this.endpoint == null ? null : this.endpoint.getValue(); + } + + /** + * @param value An address to which messages and/or replies are to be sent. + */ + public ConformanceMessagingComponent setEndpoint(String value) { + if (Utilities.noString(value)) + this.endpoint = null; + else { + if (this.endpoint == null) + this.endpoint = new UriType(); + this.endpoint.setValue(value); + } + return this; + } + + /** + * @return {@link #reliableCache} (Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).). This is the underlying object with id, value and extensions. The accessor "getReliableCache" gives direct access to the value + */ + public UnsignedIntType getReliableCacheElement() { + if (this.reliableCache == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingComponent.reliableCache"); + else if (Configuration.doAutoCreate()) + this.reliableCache = new UnsignedIntType(); // bb + return this.reliableCache; + } + + public boolean hasReliableCacheElement() { + return this.reliableCache != null && !this.reliableCache.isEmpty(); + } + + public boolean hasReliableCache() { + return this.reliableCache != null && !this.reliableCache.isEmpty(); + } + + /** + * @param value {@link #reliableCache} (Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).). This is the underlying object with id, value and extensions. The accessor "getReliableCache" gives direct access to the value + */ + public ConformanceMessagingComponent setReliableCacheElement(UnsignedIntType value) { + this.reliableCache = value; + return this; + } + + /** + * @return Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender). + */ + public int getReliableCache() { + return this.reliableCache == null || this.reliableCache.isEmpty() ? 0 : this.reliableCache.getValue(); + } + + /** + * @param value Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender). + */ + public ConformanceMessagingComponent setReliableCache(int value) { + if (this.reliableCache == null) + this.reliableCache = new UnsignedIntType(); + this.reliableCache.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public StringType getDocumentationElement() { + if (this.documentation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + return this.documentation; + } + + public boolean hasDocumentationElement() { + return this.documentation != null && !this.documentation.isEmpty(); + } + + public boolean hasDocumentation() { + return this.documentation != null && !this.documentation.isEmpty(); + } + + /** + * @param value {@link #documentation} (Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public ConformanceMessagingComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner. + */ + public ConformanceMessagingComponent setDocumentation(String value) { + if (Utilities.noString(value)) + this.documentation = null; + else { + if (this.documentation == null) + this.documentation = new StringType(); + this.documentation.setValue(value); + } + return this; + } + + /** + * @return {@link #event} (A description of the solution's support for an event at this end point.) + */ + public List getEvent() { + if (this.event == null) + this.event = new ArrayList(); + return this.event; + } + + public boolean hasEvent() { + if (this.event == null) + return false; + for (ConformanceMessagingEventComponent item : this.event) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #event} (A description of the solution's support for an event at this end point.) + */ + // syntactic sugar + public ConformanceMessagingEventComponent addEvent() { //3 + ConformanceMessagingEventComponent t = new ConformanceMessagingEventComponent(); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return t; + } + + // syntactic sugar + public ConformanceMessagingComponent addEvent(ConformanceMessagingEventComponent t) { //3 + if (t == null) + return this; + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("endpoint", "uri", "An address to which messages and/or replies are to be sent.", 0, java.lang.Integer.MAX_VALUE, endpoint)); + childrenList.add(new Property("reliableCache", "unsignedInt", "Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).", 0, java.lang.Integer.MAX_VALUE, reliableCache)); + childrenList.add(new Property("documentation", "string", "Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner.", 0, java.lang.Integer.MAX_VALUE, documentation)); + childrenList.add(new Property("event", "", "A description of the solution's support for an event at this end point.", 0, java.lang.Integer.MAX_VALUE, event)); + } + + public ConformanceMessagingComponent copy() { + ConformanceMessagingComponent dst = new ConformanceMessagingComponent(); + copyValues(dst); + dst.endpoint = endpoint == null ? null : endpoint.copy(); + dst.reliableCache = reliableCache == null ? null : reliableCache.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + if (event != null) { + dst.event = new ArrayList(); + for (ConformanceMessagingEventComponent i : event) + dst.event.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceMessagingComponent)) + return false; + ConformanceMessagingComponent o = (ConformanceMessagingComponent) other; + return compareDeep(endpoint, o.endpoint, true) && compareDeep(reliableCache, o.reliableCache, true) + && compareDeep(documentation, o.documentation, true) && compareDeep(event, o.event, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceMessagingComponent)) + return false; + ConformanceMessagingComponent o = (ConformanceMessagingComponent) other; + return compareValues(endpoint, o.endpoint, true) && compareValues(reliableCache, o.reliableCache, true) + && compareValues(documentation, o.documentation, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (endpoint == null || endpoint.isEmpty()) && (reliableCache == null || reliableCache.isEmpty()) + && (documentation == null || documentation.isEmpty()) && (event == null || event.isEmpty()) + ; + } + + } + + @Block() + public static class ConformanceMessagingEventComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A coded identifier of a supported messaging event. + */ + @Child(name = "code", type = {Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Event type", formalDefinition="A coded identifier of a supported messaging event." ) + protected Coding code; + + /** + * The impact of the content of the message. + */ + @Child(name = "category", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Consequence | Currency | Notification", formalDefinition="The impact of the content of the message." ) + protected Enumeration category; + + /** + * The mode of this event declaration - whether application is sender or receiver. + */ + @Child(name = "mode", type = {CodeType.class}, order=3, min=1, max=1) + @Description(shortDefinition="sender | receiver", formalDefinition="The mode of this event declaration - whether application is sender or receiver." ) + protected Enumeration mode; + + /** + * A list of the messaging transport protocol(s) identifiers, supported by this endpoint. + */ + @Child(name = "protocol", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="http | ftp | mllp +", formalDefinition="A list of the messaging transport protocol(s) identifiers, supported by this endpoint." ) + protected List protocol; + + /** + * A resource associated with the event. This is the resource that defines the event. + */ + @Child(name = "focus", type = {CodeType.class}, order=5, min=1, max=1) + @Description(shortDefinition="Resource that's focus of message", formalDefinition="A resource associated with the event. This is the resource that defines the event." ) + protected CodeType focus; + + /** + * Information about the request for this event. + */ + @Child(name = "request", type = {StructureDefinition.class}, order=6, min=1, max=1) + @Description(shortDefinition="Profile that describes the request", formalDefinition="Information about the request for this event." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (Information about the request for this event.) + */ + protected StructureDefinition requestTarget; + + /** + * Information about the response for this event. + */ + @Child(name = "response", type = {StructureDefinition.class}, order=7, min=1, max=1) + @Description(shortDefinition="Profile that describes the response", formalDefinition="Information about the response for this event." ) + protected Reference response; + + /** + * The actual object that is the target of the reference (Information about the response for this event.) + */ + protected StructureDefinition responseTarget; + + /** + * Guidance on how this event is handled, such as internal system trigger points, business rules, etc. + */ + @Child(name = "documentation", type = {StringType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Endpoint-specific event documentation", formalDefinition="Guidance on how this event is handled, such as internal system trigger points, business rules, etc." ) + protected StringType documentation; + + private static final long serialVersionUID = 1680159501L; + + /* + * Constructor + */ + public ConformanceMessagingEventComponent() { + super(); + } + + /* + * Constructor + */ + public ConformanceMessagingEventComponent(Coding code, Enumeration mode, CodeType focus, Reference request, Reference response) { + super(); + this.code = code; + this.mode = mode; + this.focus = focus; + this.request = request; + this.response = response; + } + + /** + * @return {@link #code} (A coded identifier of a supported messaging event.) + */ + public Coding getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Coding(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A coded identifier of a supported messaging event.) + */ + public ConformanceMessagingEventComponent setCode(Coding value) { + this.code = value; + return this; + } + + /** + * @return {@link #category} (The impact of the content of the message.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public Enumeration getCategoryElement() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.category"); + else if (Configuration.doAutoCreate()) + this.category = new Enumeration(new MessageSignificanceCategoryEnumFactory()); // bb + return this.category; + } + + public boolean hasCategoryElement() { + return this.category != null && !this.category.isEmpty(); + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (The impact of the content of the message.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public ConformanceMessagingEventComponent setCategoryElement(Enumeration value) { + this.category = value; + return this; + } + + /** + * @return The impact of the content of the message. + */ + public MessageSignificanceCategory getCategory() { + return this.category == null ? null : this.category.getValue(); + } + + /** + * @param value The impact of the content of the message. + */ + public ConformanceMessagingEventComponent setCategory(MessageSignificanceCategory value) { + if (value == null) + this.category = null; + else { + if (this.category == null) + this.category = new Enumeration(new MessageSignificanceCategoryEnumFactory()); + this.category.setValue(value); + } + return this; + } + + /** + * @return {@link #mode} (The mode of this event declaration - whether application is sender or receiver.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public Enumeration getModeElement() { + if (this.mode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(new MessageConformanceEventModeEnumFactory()); // bb + return this.mode; + } + + public boolean hasModeElement() { + return this.mode != null && !this.mode.isEmpty(); + } + + public boolean hasMode() { + return this.mode != null && !this.mode.isEmpty(); + } + + /** + * @param value {@link #mode} (The mode of this event declaration - whether application is sender or receiver.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public ConformanceMessagingEventComponent setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return The mode of this event declaration - whether application is sender or receiver. + */ + public MessageConformanceEventMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value The mode of this event declaration - whether application is sender or receiver. + */ + public ConformanceMessagingEventComponent setMode(MessageConformanceEventMode value) { + if (this.mode == null) + this.mode = new Enumeration(new MessageConformanceEventModeEnumFactory()); + this.mode.setValue(value); + return this; + } + + /** + * @return {@link #protocol} (A list of the messaging transport protocol(s) identifiers, supported by this endpoint.) + */ + public List getProtocol() { + if (this.protocol == null) + this.protocol = new ArrayList(); + return this.protocol; + } + + public boolean hasProtocol() { + if (this.protocol == null) + return false; + for (Coding item : this.protocol) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #protocol} (A list of the messaging transport protocol(s) identifiers, supported by this endpoint.) + */ + // syntactic sugar + public Coding addProtocol() { //3 + Coding t = new Coding(); + if (this.protocol == null) + this.protocol = new ArrayList(); + this.protocol.add(t); + return t; + } + + // syntactic sugar + public ConformanceMessagingEventComponent addProtocol(Coding t) { //3 + if (t == null) + return this; + if (this.protocol == null) + this.protocol = new ArrayList(); + this.protocol.add(t); + return this; + } + + /** + * @return {@link #focus} (A resource associated with the event. This is the resource that defines the event.). This is the underlying object with id, value and extensions. The accessor "getFocus" gives direct access to the value + */ + public CodeType getFocusElement() { + if (this.focus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.focus"); + else if (Configuration.doAutoCreate()) + this.focus = new CodeType(); // bb + return this.focus; + } + + public boolean hasFocusElement() { + return this.focus != null && !this.focus.isEmpty(); + } + + public boolean hasFocus() { + return this.focus != null && !this.focus.isEmpty(); + } + + /** + * @param value {@link #focus} (A resource associated with the event. This is the resource that defines the event.). This is the underlying object with id, value and extensions. The accessor "getFocus" gives direct access to the value + */ + public ConformanceMessagingEventComponent setFocusElement(CodeType value) { + this.focus = value; + return this; + } + + /** + * @return A resource associated with the event. This is the resource that defines the event. + */ + public String getFocus() { + return this.focus == null ? null : this.focus.getValue(); + } + + /** + * @param value A resource associated with the event. This is the resource that defines the event. + */ + public ConformanceMessagingEventComponent setFocus(String value) { + if (this.focus == null) + this.focus = new CodeType(); + this.focus.setValue(value); + return this; + } + + /** + * @return {@link #request} (Information about the request for this event.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); // cc + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Information about the request for this event.) + */ + public ConformanceMessagingEventComponent setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Information about the request for this event.) + */ + public StructureDefinition getRequestTarget() { + if (this.requestTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.request"); + else if (Configuration.doAutoCreate()) + this.requestTarget = new StructureDefinition(); // aa + return this.requestTarget; + } + + /** + * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Information about the request for this event.) + */ + public ConformanceMessagingEventComponent setRequestTarget(StructureDefinition value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #response} (Information about the response for this event.) + */ + public Reference getResponse() { + if (this.response == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.response"); + else if (Configuration.doAutoCreate()) + this.response = new Reference(); // cc + return this.response; + } + + public boolean hasResponse() { + return this.response != null && !this.response.isEmpty(); + } + + /** + * @param value {@link #response} (Information about the response for this event.) + */ + public ConformanceMessagingEventComponent setResponse(Reference value) { + this.response = value; + return this; + } + + /** + * @return {@link #response} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Information about the response for this event.) + */ + public StructureDefinition getResponseTarget() { + if (this.responseTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.response"); + else if (Configuration.doAutoCreate()) + this.responseTarget = new StructureDefinition(); // aa + return this.responseTarget; + } + + /** + * @param value {@link #response} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Information about the response for this event.) + */ + public ConformanceMessagingEventComponent setResponseTarget(StructureDefinition value) { + this.responseTarget = value; + return this; + } + + /** + * @return {@link #documentation} (Guidance on how this event is handled, such as internal system trigger points, business rules, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public StringType getDocumentationElement() { + if (this.documentation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + return this.documentation; + } + + public boolean hasDocumentationElement() { + return this.documentation != null && !this.documentation.isEmpty(); + } + + public boolean hasDocumentation() { + return this.documentation != null && !this.documentation.isEmpty(); + } + + /** + * @param value {@link #documentation} (Guidance on how this event is handled, such as internal system trigger points, business rules, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public ConformanceMessagingEventComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Guidance on how this event is handled, such as internal system trigger points, business rules, etc. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Guidance on how this event is handled, such as internal system trigger points, business rules, etc. + */ + public ConformanceMessagingEventComponent setDocumentation(String value) { + if (Utilities.noString(value)) + this.documentation = null; + else { + if (this.documentation == null) + this.documentation = new StringType(); + this.documentation.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "Coding", "A coded identifier of a supported messaging event.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("category", "code", "The impact of the content of the message.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("mode", "code", "The mode of this event declaration - whether application is sender or receiver.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("protocol", "Coding", "A list of the messaging transport protocol(s) identifiers, supported by this endpoint.", 0, java.lang.Integer.MAX_VALUE, protocol)); + childrenList.add(new Property("focus", "code", "A resource associated with the event. This is the resource that defines the event.", 0, java.lang.Integer.MAX_VALUE, focus)); + childrenList.add(new Property("request", "Reference(StructureDefinition)", "Information about the request for this event.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("response", "Reference(StructureDefinition)", "Information about the response for this event.", 0, java.lang.Integer.MAX_VALUE, response)); + childrenList.add(new Property("documentation", "string", "Guidance on how this event is handled, such as internal system trigger points, business rules, etc.", 0, java.lang.Integer.MAX_VALUE, documentation)); + } + + public ConformanceMessagingEventComponent copy() { + ConformanceMessagingEventComponent dst = new ConformanceMessagingEventComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.category = category == null ? null : category.copy(); + dst.mode = mode == null ? null : mode.copy(); + if (protocol != null) { + dst.protocol = new ArrayList(); + for (Coding i : protocol) + dst.protocol.add(i.copy()); + }; + dst.focus = focus == null ? null : focus.copy(); + dst.request = request == null ? null : request.copy(); + dst.response = response == null ? null : response.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceMessagingEventComponent)) + return false; + ConformanceMessagingEventComponent o = (ConformanceMessagingEventComponent) other; + return compareDeep(code, o.code, true) && compareDeep(category, o.category, true) && compareDeep(mode, o.mode, true) + && compareDeep(protocol, o.protocol, true) && compareDeep(focus, o.focus, true) && compareDeep(request, o.request, true) + && compareDeep(response, o.response, true) && compareDeep(documentation, o.documentation, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceMessagingEventComponent)) + return false; + ConformanceMessagingEventComponent o = (ConformanceMessagingEventComponent) other; + return compareValues(category, o.category, true) && compareValues(mode, o.mode, true) && compareValues(focus, o.focus, true) + && compareValues(documentation, o.documentation, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (category == null || category.isEmpty()) + && (mode == null || mode.isEmpty()) && (protocol == null || protocol.isEmpty()) && (focus == null || focus.isEmpty()) + && (request == null || request.isEmpty()) && (response == null || response.isEmpty()) && (documentation == null || documentation.isEmpty()) + ; + } + + } + + @Block() + public static class ConformanceDocumentComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Mode of this document declaration - whether application is producer or consumer. + */ + @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="producer | consumer", formalDefinition="Mode of this document declaration - whether application is producer or consumer." ) + protected Enumeration mode; + + /** + * A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc. + */ + @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Description of document support", formalDefinition="A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc." ) + protected StringType documentation; + + /** + * A constraint on a resource used in the document. + */ + @Child(name = "profile", type = {StructureDefinition.class}, order=3, min=1, max=1) + @Description(shortDefinition="Constraint on a resource used in the document", formalDefinition="A constraint on a resource used in the document." ) + protected Reference profile; + + /** + * The actual object that is the target of the reference (A constraint on a resource used in the document.) + */ + protected StructureDefinition profileTarget; + + private static final long serialVersionUID = -1059555053L; + + /* + * Constructor + */ + public ConformanceDocumentComponent() { + super(); + } + + /* + * Constructor + */ + public ConformanceDocumentComponent(Enumeration mode, Reference profile) { + super(); + this.mode = mode; + this.profile = profile; + } + + /** + * @return {@link #mode} (Mode of this document declaration - whether application is producer or consumer.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public Enumeration getModeElement() { + if (this.mode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceDocumentComponent.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(new DocumentModeEnumFactory()); // bb + return this.mode; + } + + public boolean hasModeElement() { + return this.mode != null && !this.mode.isEmpty(); + } + + public boolean hasMode() { + return this.mode != null && !this.mode.isEmpty(); + } + + /** + * @param value {@link #mode} (Mode of this document declaration - whether application is producer or consumer.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public ConformanceDocumentComponent setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return Mode of this document declaration - whether application is producer or consumer. + */ + public DocumentMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value Mode of this document declaration - whether application is producer or consumer. + */ + public ConformanceDocumentComponent setMode(DocumentMode value) { + if (this.mode == null) + this.mode = new Enumeration(new DocumentModeEnumFactory()); + this.mode.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public StringType getDocumentationElement() { + if (this.documentation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceDocumentComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + return this.documentation; + } + + public boolean hasDocumentationElement() { + return this.documentation != null && !this.documentation.isEmpty(); + } + + public boolean hasDocumentation() { + return this.documentation != null && !this.documentation.isEmpty(); + } + + /** + * @param value {@link #documentation} (A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public ConformanceDocumentComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc. + */ + public ConformanceDocumentComponent setDocumentation(String value) { + if (Utilities.noString(value)) + this.documentation = null; + else { + if (this.documentation == null) + this.documentation = new StringType(); + this.documentation.setValue(value); + } + return this; + } + + /** + * @return {@link #profile} (A constraint on a resource used in the document.) + */ + public Reference getProfile() { + if (this.profile == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceDocumentComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profile = new Reference(); // cc + return this.profile; + } + + public boolean hasProfile() { + return this.profile != null && !this.profile.isEmpty(); + } + + /** + * @param value {@link #profile} (A constraint on a resource used in the document.) + */ + public ConformanceDocumentComponent setProfile(Reference value) { + this.profile = value; + return this; + } + + /** + * @return {@link #profile} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A constraint on a resource used in the document.) + */ + public StructureDefinition getProfileTarget() { + if (this.profileTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceDocumentComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profileTarget = new StructureDefinition(); // aa + return this.profileTarget; + } + + /** + * @param value {@link #profile} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A constraint on a resource used in the document.) + */ + public ConformanceDocumentComponent setProfileTarget(StructureDefinition value) { + this.profileTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("mode", "code", "Mode of this document declaration - whether application is producer or consumer.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("documentation", "string", "A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc.", 0, java.lang.Integer.MAX_VALUE, documentation)); + childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A constraint on a resource used in the document.", 0, java.lang.Integer.MAX_VALUE, profile)); + } + + public ConformanceDocumentComponent copy() { + ConformanceDocumentComponent dst = new ConformanceDocumentComponent(); + copyValues(dst); + dst.mode = mode == null ? null : mode.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + dst.profile = profile == null ? null : profile.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceDocumentComponent)) + return false; + ConformanceDocumentComponent o = (ConformanceDocumentComponent) other; + return compareDeep(mode, o.mode, true) && compareDeep(documentation, o.documentation, true) && compareDeep(profile, o.profile, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceDocumentComponent)) + return false; + ConformanceDocumentComponent o = (ConformanceDocumentComponent) other; + return compareValues(mode, o.mode, true) && compareValues(documentation, o.documentation, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (mode == null || mode.isEmpty()) && (documentation == null || documentation.isEmpty()) + && (profile == null || profile.isEmpty()); + } + + } + + /** + * An absolute uri that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). + */ + @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Logical uri to reference this statement", formalDefinition="An absolute uri that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:)." ) + protected UriType url; + + /** + * The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Logical id for this version of the statement", formalDefinition="The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) + protected StringType version; + + /** + * A free text natural language name identifying the conformance statement. + */ + @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Informal name for this conformance statement", formalDefinition="A free text natural language name identifying the conformance statement." ) + protected StringType name; + + /** + * The name of the individual or organization that published the conformance. + */ + @Child(name = "publisher", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the conformance." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. + */ + @Child(name = "description", type = {StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Human description of the conformance statement", formalDefinition="A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP." ) + protected StringType description; + + /** + * Explains why this conformance statement is needed and why it's been constrained as it has. + */ + @Child(name = "requirements", type = {StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Why is this needed?", formalDefinition="Explains why this conformance statement is needed and why it's been constrained as it has." ) + protected StringType requirements; + + /** + * A copyright statement relating to the conformamce statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement. + */ + @Child(name = "copyright", type = {StringType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Use and/or Publishing restrictions", formalDefinition="A copyright statement relating to the conformamce statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement." ) + protected StringType copyright; + + /** + * The status of this conformance statement. + */ + @Child(name = "status", type = {CodeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of this conformance statement." ) + protected Enumeration status; + + /** + * A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name = "experimental", type = {BooleanType.class}, order=9, min=0, max=1) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The date (and optionally time) when the conformance statement was published. + */ + @Child(name = "date", type = {DateTimeType.class}, order=10, min=1, max=1) + @Description(shortDefinition="Publication Date(/time)", formalDefinition="The date (and optionally time) when the conformance statement was published." ) + protected DateTimeType date; + + /** + * Software that is covered by this conformance statement. It is used when the conformance statement describes the capabilities of a particular software version, independent of an installation. + */ + @Child(name = "software", type = {}, order=11, min=0, max=1) + @Description(shortDefinition="Software that is covered by this conformance statement", formalDefinition="Software that is covered by this conformance statement. It is used when the conformance statement describes the capabilities of a particular software version, independent of an installation." ) + protected ConformanceSoftwareComponent software; + + /** + * Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program. + */ + @Child(name = "implementation", type = {}, order=12, min=0, max=1) + @Description(shortDefinition="If this describes a specific instance", formalDefinition="Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program." ) + protected ConformanceImplementationComponent implementation; + + /** + * The version of the FHIR specification on which this conformance statement is based. + */ + @Child(name = "fhirVersion", type = {IdType.class}, order=13, min=1, max=1) + @Description(shortDefinition="FHIR Version", formalDefinition="The version of the FHIR specification on which this conformance statement is based." ) + protected IdType fhirVersion; + + /** + * A flag that indicates whether the application accepts unknown elements as part of a resource. + */ + @Child(name = "acceptUnknown", type = {BooleanType.class}, order=14, min=1, max=1) + @Description(shortDefinition="True if application accepts unknown elements", formalDefinition="A flag that indicates whether the application accepts unknown elements as part of a resource." ) + protected BooleanType acceptUnknown; + + /** + * A list of the formats supported by this implementation using their content types. + */ + @Child(name = "format", type = {CodeType.class}, order=15, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="formats supported (xml | json | mime type)", formalDefinition="A list of the formats supported by this implementation using their content types." ) + protected List format; + + /** + * A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. + */ + @Child(name = "profile", type = {StructureDefinition.class}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Profiles supported by the system", formalDefinition="A list of profiles supported by the system. For a server, 'supported by the system' means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile." ) + protected List profile; + /** + * The actual objects that are the target of the reference (A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.) + */ + protected List profileTarget; + + + /** + * A definition of the restful capabilities of the solution, if any. + */ + @Child(name = "rest", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="If the endpoint is a RESTful one", formalDefinition="A definition of the restful capabilities of the solution, if any." ) + protected List rest; + + /** + * A description of the messaging capabilities of the solution. + */ + @Child(name = "messaging", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="If messaging is supported", formalDefinition="A description of the messaging capabilities of the solution." ) + protected List messaging; + + /** + * A document definition. + */ + @Child(name = "document", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Document definition", formalDefinition="A document definition." ) + protected List document; + + private static final long serialVersionUID = 1631871430L; + + /* + * Constructor + */ + public Conformance() { + super(); + } + + /* + * Constructor + */ + public Conformance(DateTimeType date, IdType fhirVersion, BooleanType acceptUnknown) { + super(); + this.date = date; + this.fhirVersion = fhirVersion; + this.acceptUnknown = acceptUnknown; + } + + /** + * @return {@link #url} (An absolute uri that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute uri that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public Conformance setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute uri that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute uri that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). + */ + public Conformance setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public Conformance setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public Conformance setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A free text natural language name identifying the conformance statement.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A free text natural language name identifying the conformance statement.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public Conformance setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name identifying the conformance statement. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name identifying the conformance statement. + */ + public Conformance setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the conformance.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the conformance.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public Conformance setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the conformance. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the conformance. + */ + public Conformance setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (ConformanceContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public ConformanceContactComponent addContact() { //3 + ConformanceContactComponent t = new ConformanceContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public Conformance addContact(ConformanceContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #description} (A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public Conformance setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. + */ + public Conformance setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #requirements} (Explains why this conformance statement is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); // bb + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (Explains why this conformance statement is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public Conformance setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return Explains why this conformance statement is needed and why it's been constrained as it has. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value Explains why this conformance statement is needed and why it's been constrained as it has. + */ + public Conformance setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #copyright} (A copyright statement relating to the conformamce statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public StringType getCopyrightElement() { + if (this.copyright == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.copyright"); + else if (Configuration.doAutoCreate()) + this.copyright = new StringType(); // bb + return this.copyright; + } + + public boolean hasCopyrightElement() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + public boolean hasCopyright() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + /** + * @param value {@link #copyright} (A copyright statement relating to the conformamce statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public Conformance setCopyrightElement(StringType value) { + this.copyright = value; + return this; + } + + /** + * @return A copyright statement relating to the conformamce statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement. + */ + public String getCopyright() { + return this.copyright == null ? null : this.copyright.getValue(); + } + + /** + * @param value A copyright statement relating to the conformamce statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement. + */ + public Conformance setCopyright(String value) { + if (Utilities.noString(value)) + this.copyright = null; + else { + if (this.copyright == null) + this.copyright = new StringType(); + this.copyright.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of this conformance statement.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status of this conformance statement.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Conformance setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of this conformance statement. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of this conformance statement. + */ + public Conformance setStatus(ConformanceResourceStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #experimental} (A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public Conformance setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public Conformance setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #date} (The date (and optionally time) when the conformance statement was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date (and optionally time) when the conformance statement was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public Conformance setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date (and optionally time) when the conformance statement was published. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date (and optionally time) when the conformance statement was published. + */ + public Conformance setDate(Date value) { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + return this; + } + + /** + * @return {@link #software} (Software that is covered by this conformance statement. It is used when the conformance statement describes the capabilities of a particular software version, independent of an installation.) + */ + public ConformanceSoftwareComponent getSoftware() { + if (this.software == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.software"); + else if (Configuration.doAutoCreate()) + this.software = new ConformanceSoftwareComponent(); // cc + return this.software; + } + + public boolean hasSoftware() { + return this.software != null && !this.software.isEmpty(); + } + + /** + * @param value {@link #software} (Software that is covered by this conformance statement. It is used when the conformance statement describes the capabilities of a particular software version, independent of an installation.) + */ + public Conformance setSoftware(ConformanceSoftwareComponent value) { + this.software = value; + return this; + } + + /** + * @return {@link #implementation} (Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program.) + */ + public ConformanceImplementationComponent getImplementation() { + if (this.implementation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.implementation"); + else if (Configuration.doAutoCreate()) + this.implementation = new ConformanceImplementationComponent(); // cc + return this.implementation; + } + + public boolean hasImplementation() { + return this.implementation != null && !this.implementation.isEmpty(); + } + + /** + * @param value {@link #implementation} (Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program.) + */ + public Conformance setImplementation(ConformanceImplementationComponent value) { + this.implementation = value; + return this; + } + + /** + * @return {@link #fhirVersion} (The version of the FHIR specification on which this conformance statement is based.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value + */ + public IdType getFhirVersionElement() { + if (this.fhirVersion == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.fhirVersion"); + else if (Configuration.doAutoCreate()) + this.fhirVersion = new IdType(); // bb + return this.fhirVersion; + } + + public boolean hasFhirVersionElement() { + return this.fhirVersion != null && !this.fhirVersion.isEmpty(); + } + + public boolean hasFhirVersion() { + return this.fhirVersion != null && !this.fhirVersion.isEmpty(); + } + + /** + * @param value {@link #fhirVersion} (The version of the FHIR specification on which this conformance statement is based.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value + */ + public Conformance setFhirVersionElement(IdType value) { + this.fhirVersion = value; + return this; + } + + /** + * @return The version of the FHIR specification on which this conformance statement is based. + */ + public String getFhirVersion() { + return this.fhirVersion == null ? null : this.fhirVersion.getValue(); + } + + /** + * @param value The version of the FHIR specification on which this conformance statement is based. + */ + public Conformance setFhirVersion(String value) { + if (this.fhirVersion == null) + this.fhirVersion = new IdType(); + this.fhirVersion.setValue(value); + return this; + } + + /** + * @return {@link #acceptUnknown} (A flag that indicates whether the application accepts unknown elements as part of a resource.). This is the underlying object with id, value and extensions. The accessor "getAcceptUnknown" gives direct access to the value + */ + public BooleanType getAcceptUnknownElement() { + if (this.acceptUnknown == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.acceptUnknown"); + else if (Configuration.doAutoCreate()) + this.acceptUnknown = new BooleanType(); // bb + return this.acceptUnknown; + } + + public boolean hasAcceptUnknownElement() { + return this.acceptUnknown != null && !this.acceptUnknown.isEmpty(); + } + + public boolean hasAcceptUnknown() { + return this.acceptUnknown != null && !this.acceptUnknown.isEmpty(); + } + + /** + * @param value {@link #acceptUnknown} (A flag that indicates whether the application accepts unknown elements as part of a resource.). This is the underlying object with id, value and extensions. The accessor "getAcceptUnknown" gives direct access to the value + */ + public Conformance setAcceptUnknownElement(BooleanType value) { + this.acceptUnknown = value; + return this; + } + + /** + * @return A flag that indicates whether the application accepts unknown elements as part of a resource. + */ + public boolean getAcceptUnknown() { + return this.acceptUnknown == null || this.acceptUnknown.isEmpty() ? false : this.acceptUnknown.getValue(); + } + + /** + * @param value A flag that indicates whether the application accepts unknown elements as part of a resource. + */ + public Conformance setAcceptUnknown(boolean value) { + if (this.acceptUnknown == null) + this.acceptUnknown = new BooleanType(); + this.acceptUnknown.setValue(value); + return this; + } + + /** + * @return {@link #format} (A list of the formats supported by this implementation using their content types.) + */ + public List getFormat() { + if (this.format == null) + this.format = new ArrayList(); + return this.format; + } + + public boolean hasFormat() { + if (this.format == null) + return false; + for (CodeType item : this.format) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #format} (A list of the formats supported by this implementation using their content types.) + */ + // syntactic sugar + public CodeType addFormatElement() {//2 + CodeType t = new CodeType(); + if (this.format == null) + this.format = new ArrayList(); + this.format.add(t); + return t; + } + + /** + * @param value {@link #format} (A list of the formats supported by this implementation using their content types.) + */ + public Conformance addFormat(String value) { //1 + CodeType t = new CodeType(); + t.setValue(value); + if (this.format == null) + this.format = new ArrayList(); + this.format.add(t); + return this; + } + + /** + * @param value {@link #format} (A list of the formats supported by this implementation using their content types.) + */ + public boolean hasFormat(String value) { + if (this.format == null) + return false; + for (CodeType v : this.format) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #profile} (A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.) + */ + public List getProfile() { + if (this.profile == null) + this.profile = new ArrayList(); + return this.profile; + } + + public boolean hasProfile() { + if (this.profile == null) + return false; + for (Reference item : this.profile) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #profile} (A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.) + */ + // syntactic sugar + public Reference addProfile() { //3 + Reference t = new Reference(); + if (this.profile == null) + this.profile = new ArrayList(); + this.profile.add(t); + return t; + } + + // syntactic sugar + public Conformance addProfile(Reference t) { //3 + if (t == null) + return this; + if (this.profile == null) + this.profile = new ArrayList(); + this.profile.add(t); + return this; + } + + /** + * @return {@link #profile} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.) + */ + public List getProfileTarget() { + if (this.profileTarget == null) + this.profileTarget = new ArrayList(); + return this.profileTarget; + } + + // syntactic sugar + /** + * @return {@link #profile} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.) + */ + public StructureDefinition addProfileTarget() { + StructureDefinition r = new StructureDefinition(); + if (this.profileTarget == null) + this.profileTarget = new ArrayList(); + this.profileTarget.add(r); + return r; + } + + /** + * @return {@link #rest} (A definition of the restful capabilities of the solution, if any.) + */ + public List getRest() { + if (this.rest == null) + this.rest = new ArrayList(); + return this.rest; + } + + public boolean hasRest() { + if (this.rest == null) + return false; + for (ConformanceRestComponent item : this.rest) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #rest} (A definition of the restful capabilities of the solution, if any.) + */ + // syntactic sugar + public ConformanceRestComponent addRest() { //3 + ConformanceRestComponent t = new ConformanceRestComponent(); + if (this.rest == null) + this.rest = new ArrayList(); + this.rest.add(t); + return t; + } + + // syntactic sugar + public Conformance addRest(ConformanceRestComponent t) { //3 + if (t == null) + return this; + if (this.rest == null) + this.rest = new ArrayList(); + this.rest.add(t); + return this; + } + + /** + * @return {@link #messaging} (A description of the messaging capabilities of the solution.) + */ + public List getMessaging() { + if (this.messaging == null) + this.messaging = new ArrayList(); + return this.messaging; + } + + public boolean hasMessaging() { + if (this.messaging == null) + return false; + for (ConformanceMessagingComponent item : this.messaging) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #messaging} (A description of the messaging capabilities of the solution.) + */ + // syntactic sugar + public ConformanceMessagingComponent addMessaging() { //3 + ConformanceMessagingComponent t = new ConformanceMessagingComponent(); + if (this.messaging == null) + this.messaging = new ArrayList(); + this.messaging.add(t); + return t; + } + + // syntactic sugar + public Conformance addMessaging(ConformanceMessagingComponent t) { //3 + if (t == null) + return this; + if (this.messaging == null) + this.messaging = new ArrayList(); + this.messaging.add(t); + return this; + } + + /** + * @return {@link #document} (A document definition.) + */ + public List getDocument() { + if (this.document == null) + this.document = new ArrayList(); + return this.document; + } + + public boolean hasDocument() { + if (this.document == null) + return false; + for (ConformanceDocumentComponent item : this.document) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #document} (A document definition.) + */ + // syntactic sugar + public ConformanceDocumentComponent addDocument() { //3 + ConformanceDocumentComponent t = new ConformanceDocumentComponent(); + if (this.document == null) + this.document = new ArrayList(); + this.document.add(t); + return t; + } + + // syntactic sugar + public Conformance addDocument(ConformanceDocumentComponent t) { //3 + if (t == null) + return this; + if (this.document == null) + this.document = new ArrayList(); + this.document.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute uri that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "A free text natural language name identifying the conformance statement.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the conformance.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("description", "string", "A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("requirements", "string", "Explains why this conformance statement is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("copyright", "string", "A copyright statement relating to the conformamce statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement.", 0, java.lang.Integer.MAX_VALUE, copyright)); + childrenList.add(new Property("status", "code", "The status of this conformance statement.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("date", "dateTime", "The date (and optionally time) when the conformance statement was published.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("software", "", "Software that is covered by this conformance statement. It is used when the conformance statement describes the capabilities of a particular software version, independent of an installation.", 0, java.lang.Integer.MAX_VALUE, software)); + childrenList.add(new Property("implementation", "", "Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program.", 0, java.lang.Integer.MAX_VALUE, implementation)); + childrenList.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this conformance statement is based.", 0, java.lang.Integer.MAX_VALUE, fhirVersion)); + childrenList.add(new Property("acceptUnknown", "boolean", "A flag that indicates whether the application accepts unknown elements as part of a resource.", 0, java.lang.Integer.MAX_VALUE, acceptUnknown)); + childrenList.add(new Property("format", "code", "A list of the formats supported by this implementation using their content types.", 0, java.lang.Integer.MAX_VALUE, format)); + childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A list of profiles supported by the system. For a server, 'supported by the system' means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("rest", "", "A definition of the restful capabilities of the solution, if any.", 0, java.lang.Integer.MAX_VALUE, rest)); + childrenList.add(new Property("messaging", "", "A description of the messaging capabilities of the solution.", 0, java.lang.Integer.MAX_VALUE, messaging)); + childrenList.add(new Property("document", "", "A document definition.", 0, java.lang.Integer.MAX_VALUE, document)); + } + + public Conformance copy() { + Conformance dst = new Conformance(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (ConformanceContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + dst.requirements = requirements == null ? null : requirements.copy(); + dst.copyright = copyright == null ? null : copyright.copy(); + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.date = date == null ? null : date.copy(); + dst.software = software == null ? null : software.copy(); + dst.implementation = implementation == null ? null : implementation.copy(); + dst.fhirVersion = fhirVersion == null ? null : fhirVersion.copy(); + dst.acceptUnknown = acceptUnknown == null ? null : acceptUnknown.copy(); + if (format != null) { + dst.format = new ArrayList(); + for (CodeType i : format) + dst.format.add(i.copy()); + }; + if (profile != null) { + dst.profile = new ArrayList(); + for (Reference i : profile) + dst.profile.add(i.copy()); + }; + if (rest != null) { + dst.rest = new ArrayList(); + for (ConformanceRestComponent i : rest) + dst.rest.add(i.copy()); + }; + if (messaging != null) { + dst.messaging = new ArrayList(); + for (ConformanceMessagingComponent i : messaging) + dst.messaging.add(i.copy()); + }; + if (document != null) { + dst.document = new ArrayList(); + for (ConformanceDocumentComponent i : document) + dst.document.add(i.copy()); + }; + return dst; + } + + protected Conformance typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Conformance)) + return false; + Conformance o = (Conformance) other; + return compareDeep(url, o.url, true) && compareDeep(version, o.version, true) && compareDeep(name, o.name, true) + && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(description, o.description, true) + && compareDeep(requirements, o.requirements, true) && compareDeep(copyright, o.copyright, true) + && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) && compareDeep(date, o.date, true) + && compareDeep(software, o.software, true) && compareDeep(implementation, o.implementation, true) + && compareDeep(fhirVersion, o.fhirVersion, true) && compareDeep(acceptUnknown, o.acceptUnknown, true) + && compareDeep(format, o.format, true) && compareDeep(profile, o.profile, true) && compareDeep(rest, o.rest, true) + && compareDeep(messaging, o.messaging, true) && compareDeep(document, o.document, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Conformance)) + return false; + Conformance o = (Conformance) other; + return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) + && compareValues(publisher, o.publisher, true) && compareValues(description, o.description, true) && compareValues(requirements, o.requirements, true) + && compareValues(copyright, o.copyright, true) && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) + && compareValues(date, o.date, true) && compareValues(fhirVersion, o.fhirVersion, true) && compareValues(acceptUnknown, o.acceptUnknown, true) + && compareValues(format, o.format, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (version == null || version.isEmpty()) + && (name == null || name.isEmpty()) && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) + && (description == null || description.isEmpty()) && (requirements == null || requirements.isEmpty()) + && (copyright == null || copyright.isEmpty()) && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) + && (date == null || date.isEmpty()) && (software == null || software.isEmpty()) && (implementation == null || implementation.isEmpty()) + && (fhirVersion == null || fhirVersion.isEmpty()) && (acceptUnknown == null || acceptUnknown.isEmpty()) + && (format == null || format.isEmpty()) && (profile == null || profile.isEmpty()) && (rest == null || rest.isEmpty()) + && (messaging == null || messaging.isEmpty()) && (document == null || document.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Conformance; + } + + @SearchParamDefinition(name="date", path="Conformance.date", description="The conformance statement publication date", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="software", path="Conformance.software.name", description="Part of a the name of a software application", type="string" ) + public static final String SP_SOFTWARE = "software"; + @SearchParamDefinition(name="resource", path="Conformance.rest.resource.type", description="Name of a resource mentioned in a conformance statement", type="token" ) + public static final String SP_RESOURCE = "resource"; + @SearchParamDefinition(name="profile", path="Conformance.rest.resource.profile", description="A profile id invoked in a conformance statement", type="reference" ) + public static final String SP_PROFILE = "profile"; + @SearchParamDefinition(name="format", path="Conformance.format", description="formats supported (xml | json | mime type)", type="token" ) + public static final String SP_FORMAT = "format"; + @SearchParamDefinition(name="description", path="Conformance.description", description="Text search in the description of the conformance statement", type="string" ) + public static final String SP_DESCRIPTION = "description"; + @SearchParamDefinition(name="fhirversion", path="Conformance.version", description="The version of FHIR", type="token" ) + public static final String SP_FHIRVERSION = "fhirversion"; + @SearchParamDefinition(name="version", path="Conformance.version", description="The version identifier of the conformance statement", type="token" ) + public static final String SP_VERSION = "version"; + @SearchParamDefinition(name="url", path="Conformance.url", description="The uri that identifies the conformance statement", type="uri" ) + public static final String SP_URL = "url"; + @SearchParamDefinition(name="supported-profile", path="Conformance.profile", description="Profiles supported by the system", type="reference" ) + public static final String SP_SUPPORTEDPROFILE = "supported-profile"; + @SearchParamDefinition(name="mode", path="Conformance.rest.mode", description="Mode - restful (server/client) or messaging (sender/receiver)", type="token" ) + public static final String SP_MODE = "mode"; + @SearchParamDefinition(name="security", path="Conformance.rest.security", description="Information about security of implementation", type="token" ) + public static final String SP_SECURITY = "security"; + @SearchParamDefinition(name="name", path="Conformance.name", description="Name of the conformance statement", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="publisher", path="Conformance.publisher", description="Name of the publisher of the conformance statement", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + @SearchParamDefinition(name="event", path="Conformance.messaging.event.code", description="Event code in a conformance statement", type="token" ) + public static final String SP_EVENT = "event"; + @SearchParamDefinition(name="status", path="Conformance.status", description="The current status of the conformance statement", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Constants.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Constants.java index 8ac7babad68..599fc11b239 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Constants.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Constants.java @@ -1,61 +1,40 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - - -public class Constants { - - public final static String VERSION = "0.5.0"; - public final static String REVISION = "5239"; - public final static String DATE = "Tue May 05 16:13:57 EDT 2015"; -} +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + + +public class Constants { + + public final static String VERSION = "0.5.0"; + public final static String REVISION = "5283"; + public final static String DATE = "Fri May 22 17:15:32 EDT 2015"; +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ContactPoint.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ContactPoint.java index 0fec644c538..ad170273ca0 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ContactPoint.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ContactPoint.java @@ -1,542 +1,521 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Details for All kinds of technology mediated contact points for a person or organization, including telephone, email, etc. - */ -@DatatypeDef(name="ContactPoint") -public class ContactPoint extends Type implements ICompositeType { - - public enum ContactPointSystem { - /** - * The value is a telephone number used for voice calls. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required. - */ - PHONE, - /** - * The value is a fax machine. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required. - */ - FAX, - /** - * The value is an email address. - */ - EMAIL, - /** - * The value is a url. This is intended for various personal contacts including blogs, Twitter, Facebook, etc. Do not use for email addresses. - */ - URL, - /** - * added to help the parsers - */ - NULL; - public static ContactPointSystem fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("phone".equals(codeString)) - return PHONE; - if ("fax".equals(codeString)) - return FAX; - if ("email".equals(codeString)) - return EMAIL; - if ("url".equals(codeString)) - return URL; - throw new Exception("Unknown ContactPointSystem code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PHONE: return "phone"; - case FAX: return "fax"; - case EMAIL: return "email"; - case URL: return "url"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PHONE: return ""; - case FAX: return ""; - case EMAIL: return ""; - case URL: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PHONE: return "The value is a telephone number used for voice calls. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required."; - case FAX: return "The value is a fax machine. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required."; - case EMAIL: return "The value is an email address."; - case URL: return "The value is a url. This is intended for various personal contacts including blogs, Twitter, Facebook, etc. Do not use for email addresses."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PHONE: return "Phone"; - case FAX: return "Fax"; - case EMAIL: return "Email"; - case URL: return "Url"; - default: return "?"; - } - } - } - - public static class ContactPointSystemEnumFactory implements EnumFactory { - public ContactPointSystem fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("phone".equals(codeString)) - return ContactPointSystem.PHONE; - if ("fax".equals(codeString)) - return ContactPointSystem.FAX; - if ("email".equals(codeString)) - return ContactPointSystem.EMAIL; - if ("url".equals(codeString)) - return ContactPointSystem.URL; - throw new IllegalArgumentException("Unknown ContactPointSystem code '"+codeString+"'"); - } - public String toCode(ContactPointSystem code) { - if (code == ContactPointSystem.PHONE) - return "phone"; - if (code == ContactPointSystem.FAX) - return "fax"; - if (code == ContactPointSystem.EMAIL) - return "email"; - if (code == ContactPointSystem.URL) - return "url"; - return "?"; - } - } - - public enum ContactPointUse { - /** - * A communication contact point at a home; attempted contacts for business purposes might intrude privacy and chances are one will contact family or other household members instead of the person one wishes to call. Typically used with urgent cases, or if no other contacts are available. - */ - HOME, - /** - * An office contact point. First choice for business related contacts during business hours. - */ - WORK, - /** - * A temporary contact point. The period can provide more detailed information. - */ - TEMP, - /** - * This contact point is no longer in use (or was never correct, but retained for records). - */ - OLD, - /** - * A telecommunication device that moves and stays with its owner. May have characteristics of all other use codes, suitable for urgent matters, not the first choice for routine business. - */ - MOBILE, - /** - * added to help the parsers - */ - NULL; - public static ContactPointUse fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("home".equals(codeString)) - return HOME; - if ("work".equals(codeString)) - return WORK; - if ("temp".equals(codeString)) - return TEMP; - if ("old".equals(codeString)) - return OLD; - if ("mobile".equals(codeString)) - return MOBILE; - throw new Exception("Unknown ContactPointUse code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case HOME: return "home"; - case WORK: return "work"; - case TEMP: return "temp"; - case OLD: return "old"; - case MOBILE: return "mobile"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case HOME: return ""; - case WORK: return ""; - case TEMP: return ""; - case OLD: return ""; - case MOBILE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case HOME: return "A communication contact point at a home; attempted contacts for business purposes might intrude privacy and chances are one will contact family or other household members instead of the person one wishes to call. Typically used with urgent cases, or if no other contacts are available."; - case WORK: return "An office contact point. First choice for business related contacts during business hours."; - case TEMP: return "A temporary contact point. The period can provide more detailed information."; - case OLD: return "This contact point is no longer in use (or was never correct, but retained for records)."; - case MOBILE: return "A telecommunication device that moves and stays with its owner. May have characteristics of all other use codes, suitable for urgent matters, not the first choice for routine business."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case HOME: return "Home"; - case WORK: return "Work"; - case TEMP: return "Temp"; - case OLD: return "Old"; - case MOBILE: return "Mobile"; - default: return "?"; - } - } - } - - public static class ContactPointUseEnumFactory implements EnumFactory { - public ContactPointUse fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("home".equals(codeString)) - return ContactPointUse.HOME; - if ("work".equals(codeString)) - return ContactPointUse.WORK; - if ("temp".equals(codeString)) - return ContactPointUse.TEMP; - if ("old".equals(codeString)) - return ContactPointUse.OLD; - if ("mobile".equals(codeString)) - return ContactPointUse.MOBILE; - throw new IllegalArgumentException("Unknown ContactPointUse code '"+codeString+"'"); - } - public String toCode(ContactPointUse code) { - if (code == ContactPointUse.HOME) - return "home"; - if (code == ContactPointUse.WORK) - return "work"; - if (code == ContactPointUse.TEMP) - return "temp"; - if (code == ContactPointUse.OLD) - return "old"; - if (code == ContactPointUse.MOBILE) - return "mobile"; - return "?"; - } - } - - /** - * Telecommunications form for contact point - what communications system is required to make use of the contact. - */ - @Child(name = "system", type = {CodeType.class}, order=0, min=0, max=1) - @Description(shortDefinition="phone | fax | email | url", formalDefinition="Telecommunications form for contact point - what communications system is required to make use of the contact." ) - protected Enumeration system; - - /** - * The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). - */ - @Child(name = "value", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="The actual contact point details", formalDefinition="The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address)." ) - protected StringType value; - - /** - * Identifies the purpose for the contact point. - */ - @Child(name = "use", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="home | work | temp | old | mobile - purpose of this contact point", formalDefinition="Identifies the purpose for the contact point." ) - protected Enumeration use; - - /** - * Time period when the contact point was/is in use. - */ - @Child(name = "period", type = {Period.class}, order=3, min=0, max=1) - @Description(shortDefinition="Time period when the contact point was/is in use", formalDefinition="Time period when the contact point was/is in use." ) - protected Period period; - - private static final long serialVersionUID = 1972725348L; - - /* - * Constructor - */ - public ContactPoint() { - super(); - } - - /** - * @return {@link #system} (Telecommunications form for contact point - what communications system is required to make use of the contact.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public Enumeration getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactPoint.system"); - else if (Configuration.doAutoCreate()) - this.system = new Enumeration(new ContactPointSystemEnumFactory()); // bb - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (Telecommunications form for contact point - what communications system is required to make use of the contact.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public ContactPoint setSystemElement(Enumeration value) { - this.system = value; - return this; - } - - /** - * @return Telecommunications form for contact point - what communications system is required to make use of the contact. - */ - public ContactPointSystem getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value Telecommunications form for contact point - what communications system is required to make use of the contact. - */ - public ContactPoint setSystem(ContactPointSystem value) { - if (value == null) - this.system = null; - else { - if (this.system == null) - this.system = new Enumeration(new ContactPointSystemEnumFactory()); - this.system.setValue(value); - } - return this; - } - - /** - * @return {@link #value} (The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactPoint.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public ContactPoint setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). - */ - public ContactPoint setValue(String value) { - if (Utilities.noString(value)) - this.value = null; - else { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - } - return this; - } - - /** - * @return {@link #use} (Identifies the purpose for the contact point.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactPoint.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(new ContactPointUseEnumFactory()); // bb - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (Identifies the purpose for the contact point.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public ContactPoint setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return Identifies the purpose for the contact point. - */ - public ContactPointUse getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value Identifies the purpose for the contact point. - */ - public ContactPoint setUse(ContactPointUse value) { - if (value == null) - this.use = null; - else { - if (this.use == null) - this.use = new Enumeration(new ContactPointUseEnumFactory()); - this.use.setValue(value); - } - return this; - } - - /** - * @return {@link #period} (Time period when the contact point was/is in use.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactPoint.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (Time period when the contact point was/is in use.) - */ - public ContactPoint setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("system", "code", "Telecommunications form for contact point - what communications system is required to make use of the contact.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("value", "string", "The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("use", "code", "Identifies the purpose for the contact point.", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("period", "Period", "Time period when the contact point was/is in use.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - public ContactPoint copy() { - ContactPoint dst = new ContactPoint(); - copyValues(dst); - dst.system = system == null ? null : system.copy(); - dst.value = value == null ? null : value.copy(); - dst.use = use == null ? null : use.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - protected ContactPoint typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ContactPoint)) - return false; - ContactPoint o = (ContactPoint) other; - return compareDeep(system, o.system, true) && compareDeep(value, o.value, true) && compareDeep(use, o.use, true) - && compareDeep(period, o.period, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ContactPoint)) - return false; - ContactPoint o = (ContactPoint) other; - return compareValues(system, o.system, true) && compareValues(value, o.value, true) && compareValues(use, o.use, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (system == null || system.isEmpty()) && (value == null || value.isEmpty()) - && (use == null || use.isEmpty()) && (period == null || period.isEmpty()); - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Details for All kinds of technology mediated contact points for a person or organization, including telephone, email, etc. + */ +@DatatypeDef(name="ContactPoint") +public class ContactPoint extends Type implements ICompositeType { + + public enum ContactPointSystem { + /** + * The value is a telephone number used for voice calls. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required. + */ + PHONE, + /** + * The value is a fax machine. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required. + */ + FAX, + /** + * The value is an email address. + */ + EMAIL, + /** + * The value is a url. This is intended for various personal contacts including blogs, Twitter, Facebook, etc. Do not use for email addresses. + */ + URL, + /** + * added to help the parsers + */ + NULL; + public static ContactPointSystem fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("phone".equals(codeString)) + return PHONE; + if ("fax".equals(codeString)) + return FAX; + if ("email".equals(codeString)) + return EMAIL; + if ("url".equals(codeString)) + return URL; + throw new Exception("Unknown ContactPointSystem code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PHONE: return "phone"; + case FAX: return "fax"; + case EMAIL: return "email"; + case URL: return "url"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PHONE: return ""; + case FAX: return ""; + case EMAIL: return ""; + case URL: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PHONE: return "The value is a telephone number used for voice calls. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required."; + case FAX: return "The value is a fax machine. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required."; + case EMAIL: return "The value is an email address."; + case URL: return "The value is a url. This is intended for various personal contacts including blogs, Twitter, Facebook, etc. Do not use for email addresses."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PHONE: return "Phone"; + case FAX: return "Fax"; + case EMAIL: return "Email"; + case URL: return "Url"; + default: return "?"; + } + } + } + + public static class ContactPointSystemEnumFactory implements EnumFactory { + public ContactPointSystem fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("phone".equals(codeString)) + return ContactPointSystem.PHONE; + if ("fax".equals(codeString)) + return ContactPointSystem.FAX; + if ("email".equals(codeString)) + return ContactPointSystem.EMAIL; + if ("url".equals(codeString)) + return ContactPointSystem.URL; + throw new IllegalArgumentException("Unknown ContactPointSystem code '"+codeString+"'"); + } + public String toCode(ContactPointSystem code) { + if (code == ContactPointSystem.PHONE) + return "phone"; + if (code == ContactPointSystem.FAX) + return "fax"; + if (code == ContactPointSystem.EMAIL) + return "email"; + if (code == ContactPointSystem.URL) + return "url"; + return "?"; + } + } + + public enum ContactPointUse { + /** + * A communication contact point at a home; attempted contacts for business purposes might intrude privacy and chances are one will contact family or other household members instead of the person one wishes to call. Typically used with urgent cases, or if no other contacts are available. + */ + HOME, + /** + * An office contact point. First choice for business related contacts during business hours. + */ + WORK, + /** + * A temporary contact point. The period can provide more detailed information. + */ + TEMP, + /** + * This contact point is no longer in use (or was never correct, but retained for records). + */ + OLD, + /** + * A telecommunication device that moves and stays with its owner. May have characteristics of all other use codes, suitable for urgent matters, not the first choice for routine business. + */ + MOBILE, + /** + * added to help the parsers + */ + NULL; + public static ContactPointUse fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("home".equals(codeString)) + return HOME; + if ("work".equals(codeString)) + return WORK; + if ("temp".equals(codeString)) + return TEMP; + if ("old".equals(codeString)) + return OLD; + if ("mobile".equals(codeString)) + return MOBILE; + throw new Exception("Unknown ContactPointUse code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case HOME: return "home"; + case WORK: return "work"; + case TEMP: return "temp"; + case OLD: return "old"; + case MOBILE: return "mobile"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case HOME: return ""; + case WORK: return ""; + case TEMP: return ""; + case OLD: return ""; + case MOBILE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case HOME: return "A communication contact point at a home; attempted contacts for business purposes might intrude privacy and chances are one will contact family or other household members instead of the person one wishes to call. Typically used with urgent cases, or if no other contacts are available."; + case WORK: return "An office contact point. First choice for business related contacts during business hours."; + case TEMP: return "A temporary contact point. The period can provide more detailed information."; + case OLD: return "This contact point is no longer in use (or was never correct, but retained for records)."; + case MOBILE: return "A telecommunication device that moves and stays with its owner. May have characteristics of all other use codes, suitable for urgent matters, not the first choice for routine business."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case HOME: return "Home"; + case WORK: return "Work"; + case TEMP: return "Temp"; + case OLD: return "Old"; + case MOBILE: return "Mobile"; + default: return "?"; + } + } + } + + public static class ContactPointUseEnumFactory implements EnumFactory { + public ContactPointUse fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("home".equals(codeString)) + return ContactPointUse.HOME; + if ("work".equals(codeString)) + return ContactPointUse.WORK; + if ("temp".equals(codeString)) + return ContactPointUse.TEMP; + if ("old".equals(codeString)) + return ContactPointUse.OLD; + if ("mobile".equals(codeString)) + return ContactPointUse.MOBILE; + throw new IllegalArgumentException("Unknown ContactPointUse code '"+codeString+"'"); + } + public String toCode(ContactPointUse code) { + if (code == ContactPointUse.HOME) + return "home"; + if (code == ContactPointUse.WORK) + return "work"; + if (code == ContactPointUse.TEMP) + return "temp"; + if (code == ContactPointUse.OLD) + return "old"; + if (code == ContactPointUse.MOBILE) + return "mobile"; + return "?"; + } + } + + /** + * Telecommunications form for contact point - what communications system is required to make use of the contact. + */ + @Child(name = "system", type = {CodeType.class}, order=0, min=0, max=1) + @Description(shortDefinition="phone | fax | email | url", formalDefinition="Telecommunications form for contact point - what communications system is required to make use of the contact." ) + protected Enumeration system; + + /** + * The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). + */ + @Child(name = "value", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="The actual contact point details", formalDefinition="The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address)." ) + protected StringType value; + + /** + * Identifies the purpose for the contact point. + */ + @Child(name = "use", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="home | work | temp | old | mobile - purpose of this contact point", formalDefinition="Identifies the purpose for the contact point." ) + protected Enumeration use; + + /** + * Time period when the contact point was/is in use. + */ + @Child(name = "period", type = {Period.class}, order=3, min=0, max=1) + @Description(shortDefinition="Time period when the contact point was/is in use", formalDefinition="Time period when the contact point was/is in use." ) + protected Period period; + + private static final long serialVersionUID = 1972725348L; + + /* + * Constructor + */ + public ContactPoint() { + super(); + } + + /** + * @return {@link #system} (Telecommunications form for contact point - what communications system is required to make use of the contact.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public Enumeration getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactPoint.system"); + else if (Configuration.doAutoCreate()) + this.system = new Enumeration(new ContactPointSystemEnumFactory()); // bb + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (Telecommunications form for contact point - what communications system is required to make use of the contact.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public ContactPoint setSystemElement(Enumeration value) { + this.system = value; + return this; + } + + /** + * @return Telecommunications form for contact point - what communications system is required to make use of the contact. + */ + public ContactPointSystem getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value Telecommunications form for contact point - what communications system is required to make use of the contact. + */ + public ContactPoint setSystem(ContactPointSystem value) { + if (value == null) + this.system = null; + else { + if (this.system == null) + this.system = new Enumeration(new ContactPointSystemEnumFactory()); + this.system.setValue(value); + } + return this; + } + + /** + * @return {@link #value} (The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactPoint.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public ContactPoint setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). + */ + public ContactPoint setValue(String value) { + if (Utilities.noString(value)) + this.value = null; + else { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + } + return this; + } + + /** + * @return {@link #use} (Identifies the purpose for the contact point.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Enumeration getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactPoint.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(new ContactPointUseEnumFactory()); // bb + return this.use; + } + + public boolean hasUseElement() { + return this.use != null && !this.use.isEmpty(); + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (Identifies the purpose for the contact point.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public ContactPoint setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return Identifies the purpose for the contact point. + */ + public ContactPointUse getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value Identifies the purpose for the contact point. + */ + public ContactPoint setUse(ContactPointUse value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(new ContactPointUseEnumFactory()); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #period} (Time period when the contact point was/is in use.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactPoint.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Time period when the contact point was/is in use.) + */ + public ContactPoint setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("system", "code", "Telecommunications form for contact point - what communications system is required to make use of the contact.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("value", "string", "The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("use", "code", "Identifies the purpose for the contact point.", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("period", "Period", "Time period when the contact point was/is in use.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + public ContactPoint copy() { + ContactPoint dst = new ContactPoint(); + copyValues(dst); + dst.system = system == null ? null : system.copy(); + dst.value = value == null ? null : value.copy(); + dst.use = use == null ? null : use.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + protected ContactPoint typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ContactPoint)) + return false; + ContactPoint o = (ContactPoint) other; + return compareDeep(system, o.system, true) && compareDeep(value, o.value, true) && compareDeep(use, o.use, true) + && compareDeep(period, o.period, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ContactPoint)) + return false; + ContactPoint o = (ContactPoint) other; + return compareValues(system, o.system, true) && compareValues(value, o.value, true) && compareValues(use, o.use, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (system == null || system.isEmpty()) && (value == null || value.isEmpty()) + && (use == null || use.isEmpty()) && (period == null || period.isEmpty()); + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Contract.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Contract.java index 586971573a7..62472ec516a 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Contract.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Contract.java @@ -1,3362 +1,3341 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import java.util.*; - -import java.math.*; -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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A formal agreement between parties regarding the conduct of business, exchange of information or other matters. - */ -@ResourceDef(name="Contract", profile="http://hl7.org/fhir/Profile/Contract") -public class Contract extends DomainResource { - - @Block() - public static class ActorComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Who or what actors are assigned roles in this Contract. - */ - @Child(name = "entity", type = {Contract.class, Device.class, Group.class, Location.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class, Substance.class, Supply.class}, order=1, min=1, max=1) - @Description(shortDefinition="Contract Actor Type", formalDefinition="Who or what actors are assigned roles in this Contract." ) - protected Reference entity; - - /** - * The actual object that is the target of the reference (Who or what actors are assigned roles in this Contract.) - */ - protected Resource entityTarget; - - /** - * Role type of actors assigned roles in this Contract. - */ - @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contract Actor Role", formalDefinition="Role type of actors assigned roles in this Contract." ) - protected List role; - - private static final long serialVersionUID = 1371245689L; - - /* - * Constructor - */ - public ActorComponent() { - super(); - } - - /* - * Constructor - */ - public ActorComponent(Reference entity) { - super(); - this.entity = entity; - } - - /** - * @return {@link #entity} (Who or what actors are assigned roles in this Contract.) - */ - public Reference getEntity() { - if (this.entity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ActorComponent.entity"); - else if (Configuration.doAutoCreate()) - this.entity = new Reference(); // cc - return this.entity; - } - - public boolean hasEntity() { - return this.entity != null && !this.entity.isEmpty(); - } - - /** - * @param value {@link #entity} (Who or what actors are assigned roles in this Contract.) - */ - public ActorComponent setEntity(Reference value) { - this.entity = value; - return this; - } - - /** - * @return {@link #entity} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who or what actors are assigned roles in this Contract.) - */ - public Resource getEntityTarget() { - return this.entityTarget; - } - - /** - * @param value {@link #entity} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who or what actors are assigned roles in this Contract.) - */ - public ActorComponent setEntityTarget(Resource value) { - this.entityTarget = value; - return this; - } - - /** - * @return {@link #role} (Role type of actors assigned roles in this Contract.) - */ - public List getRole() { - if (this.role == null) - this.role = new ArrayList(); - return this.role; - } - - public boolean hasRole() { - if (this.role == null) - return false; - for (CodeableConcept item : this.role) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #role} (Role type of actors assigned roles in this Contract.) - */ - // syntactic sugar - public CodeableConcept addRole() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.role == null) - this.role = new ArrayList(); - this.role.add(t); - return t; - } - - // syntactic sugar - public ActorComponent addRole(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.role == null) - this.role = new ArrayList(); - this.role.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("entity", "Reference(Contract|Device|Group|Location|Organization|Patient|Practitioner|RelatedPerson|Substance|Supply)", "Who or what actors are assigned roles in this Contract.", 0, java.lang.Integer.MAX_VALUE, entity)); - childrenList.add(new Property("role", "CodeableConcept", "Role type of actors assigned roles in this Contract.", 0, java.lang.Integer.MAX_VALUE, role)); - } - - public ActorComponent copy() { - ActorComponent dst = new ActorComponent(); - copyValues(dst); - dst.entity = entity == null ? null : entity.copy(); - if (role != null) { - dst.role = new ArrayList(); - for (CodeableConcept i : role) - dst.role.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ActorComponent)) - return false; - ActorComponent o = (ActorComponent) other; - return compareDeep(entity, o.entity, true) && compareDeep(role, o.role, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ActorComponent)) - return false; - ActorComponent o = (ActorComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (entity == null || entity.isEmpty()) && (role == null || role.isEmpty()) - ; - } - - } - - @Block() - public static class ValuedItemComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Specific type of Contract Valued Item that may be priced. - */ - @Child(name = "entity", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Contract Valued Item Type", formalDefinition="Specific type of Contract Valued Item that may be priced." ) - protected Type entity; - - /** - * Identifies a Contract Valued Item instance. - */ - @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=1) - @Description(shortDefinition="Contract Valued Item Identifier", formalDefinition="Identifies a Contract Valued Item instance." ) - protected Identifier identifier; - - /** - * Indicates the time during which this Contract ValuedItem information is effective. - */ - @Child(name = "effectiveTime", type = {DateTimeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Contract Valued Item Effective Tiem", formalDefinition="Indicates the time during which this Contract ValuedItem information is effective." ) - protected DateTimeType effectiveTime; - - /** - * Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances. - */ - @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1) - @Description(shortDefinition="Count of Contract Valued Items", formalDefinition="Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances." ) - protected Quantity quantity; - - /** - * A Contract Valued Item unit valuation measure. - */ - @Child(name = "unitPrice", type = {Money.class}, order=5, min=0, max=1) - @Description(shortDefinition="Contract Valued Item fee, charge, or cost", formalDefinition="A Contract Valued Item unit valuation measure." ) - protected Money unitPrice; - - /** - * A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - @Child(name = "factor", type = {DecimalType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Contract Valued Item Price Scaling Factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) - protected DecimalType factor; - - /** - * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point. - */ - @Child(name = "points", type = {DecimalType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Contract Valued Item Difficulty Scaling Factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point." ) - protected DecimalType points; - - /** - * Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. - */ - @Child(name = "net", type = {Money.class}, order=8, min=0, max=1) - @Description(shortDefinition="Total Contract Valued Item Value", formalDefinition="Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) - protected Money net; - - private static final long serialVersionUID = 1311183770L; - - /* - * Constructor - */ - public ValuedItemComponent() { - super(); - } - - /** - * @return {@link #entity} (Specific type of Contract Valued Item that may be priced.) - */ - public Type getEntity() { - return this.entity; - } - - /** - * @return {@link #entity} (Specific type of Contract Valued Item that may be priced.) - */ - public CodeableConcept getEntityCodeableConcept() throws Exception { - if (!(this.entity instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.entity.getClass().getName()+" was encountered"); - return (CodeableConcept) this.entity; - } - - /** - * @return {@link #entity} (Specific type of Contract Valued Item that may be priced.) - */ - public Reference getEntityReference() throws Exception { - if (!(this.entity instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.entity.getClass().getName()+" was encountered"); - return (Reference) this.entity; - } - - public boolean hasEntity() { - return this.entity != null && !this.entity.isEmpty(); - } - - /** - * @param value {@link #entity} (Specific type of Contract Valued Item that may be priced.) - */ - public ValuedItemComponent setEntity(Type value) { - this.entity = value; - return this; - } - - /** - * @return {@link #identifier} (Identifies a Contract Valued Item instance.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValuedItemComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifies a Contract Valued Item instance.) - */ - public ValuedItemComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #effectiveTime} (Indicates the time during which this Contract ValuedItem information is effective.). This is the underlying object with id, value and extensions. The accessor "getEffectiveTime" gives direct access to the value - */ - public DateTimeType getEffectiveTimeElement() { - if (this.effectiveTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValuedItemComponent.effectiveTime"); - else if (Configuration.doAutoCreate()) - this.effectiveTime = new DateTimeType(); // bb - return this.effectiveTime; - } - - public boolean hasEffectiveTimeElement() { - return this.effectiveTime != null && !this.effectiveTime.isEmpty(); - } - - public boolean hasEffectiveTime() { - return this.effectiveTime != null && !this.effectiveTime.isEmpty(); - } - - /** - * @param value {@link #effectiveTime} (Indicates the time during which this Contract ValuedItem information is effective.). This is the underlying object with id, value and extensions. The accessor "getEffectiveTime" gives direct access to the value - */ - public ValuedItemComponent setEffectiveTimeElement(DateTimeType value) { - this.effectiveTime = value; - return this; - } - - /** - * @return Indicates the time during which this Contract ValuedItem information is effective. - */ - public Date getEffectiveTime() { - return this.effectiveTime == null ? null : this.effectiveTime.getValue(); - } - - /** - * @param value Indicates the time during which this Contract ValuedItem information is effective. - */ - public ValuedItemComponent setEffectiveTime(Date value) { - if (value == null) - this.effectiveTime = null; - else { - if (this.effectiveTime == null) - this.effectiveTime = new DateTimeType(); - this.effectiveTime.setValue(value); - } - return this; - } - - /** - * @return {@link #quantity} (Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValuedItemComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.) - */ - public ValuedItemComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (A Contract Valued Item unit valuation measure.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValuedItemComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); // cc - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (A Contract Valued Item unit valuation measure.) - */ - public ValuedItemComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValuedItemComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); // bb - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public ValuedItemComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public ValuedItemComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValuedItemComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); // bb - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public ValuedItemComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point. - */ - public ValuedItemComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValuedItemComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); // cc - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public ValuedItemComponent setNet(Money value) { - this.net = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("entity[x]", "CodeableConcept|Reference(Any)", "Specific type of Contract Valued Item that may be priced.", 0, java.lang.Integer.MAX_VALUE, entity)); - childrenList.add(new Property("identifier", "Identifier", "Identifies a Contract Valued Item instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("effectiveTime", "dateTime", "Indicates the time during which this Contract ValuedItem information is effective.", 0, java.lang.Integer.MAX_VALUE, effectiveTime)); - childrenList.add(new Property("quantity", "Quantity", "Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "A Contract Valued Item unit valuation measure.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); - } - - public ValuedItemComponent copy() { - ValuedItemComponent dst = new ValuedItemComponent(); - copyValues(dst); - dst.entity = entity == null ? null : entity.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.effectiveTime = effectiveTime == null ? null : effectiveTime.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ValuedItemComponent)) - return false; - ValuedItemComponent o = (ValuedItemComponent) other; - return compareDeep(entity, o.entity, true) && compareDeep(identifier, o.identifier, true) && compareDeep(effectiveTime, o.effectiveTime, true) - && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true) - && compareDeep(points, o.points, true) && compareDeep(net, o.net, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ValuedItemComponent)) - return false; - ValuedItemComponent o = (ValuedItemComponent) other; - return compareValues(effectiveTime, o.effectiveTime, true) && compareValues(factor, o.factor, true) - && compareValues(points, o.points, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (entity == null || entity.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (effectiveTime == null || effectiveTime.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (unitPrice == null || unitPrice.isEmpty()) && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) - && (net == null || net.isEmpty()); - } - - } - - @Block() - public static class SignatoryComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Role of this Contract signer, e.g., notary, grantee. - */ - @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Contract Signer Type", formalDefinition="Role of this Contract signer, e.g., notary, grantee." ) - protected Coding type; - - /** - * Party which is a signator to this Contract. - */ - @Child(name = "party", type = {Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=2, min=1, max=1) - @Description(shortDefinition="Contract Signatory Party", formalDefinition="Party which is a signator to this Contract." ) - protected Reference party; - - /** - * The actual object that is the target of the reference (Party which is a signator to this Contract.) - */ - protected Resource partyTarget; - - /** - * Legally binding Contract DSIG signature contents in Base64. - */ - @Child(name = "signature", type = {StringType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Contract Documentation Signature", formalDefinition="Legally binding Contract DSIG signature contents in Base64." ) - protected StringType signature; - - private static final long serialVersionUID = -1870392043L; - - /* - * Constructor - */ - public SignatoryComponent() { - super(); - } - - /* - * Constructor - */ - public SignatoryComponent(Coding type, Reference party, StringType signature) { - super(); - this.type = type; - this.party = party; - this.signature = signature; - } - - /** - * @return {@link #type} (Role of this Contract signer, e.g., notary, grantee.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SignatoryComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Role of this Contract signer, e.g., notary, grantee.) - */ - public SignatoryComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #party} (Party which is a signator to this Contract.) - */ - public Reference getParty() { - if (this.party == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SignatoryComponent.party"); - else if (Configuration.doAutoCreate()) - this.party = new Reference(); // cc - return this.party; - } - - public boolean hasParty() { - return this.party != null && !this.party.isEmpty(); - } - - /** - * @param value {@link #party} (Party which is a signator to this Contract.) - */ - public SignatoryComponent setParty(Reference value) { - this.party = value; - return this; - } - - /** - * @return {@link #party} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Party which is a signator to this Contract.) - */ - public Resource getPartyTarget() { - return this.partyTarget; - } - - /** - * @param value {@link #party} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Party which is a signator to this Contract.) - */ - public SignatoryComponent setPartyTarget(Resource value) { - this.partyTarget = value; - return this; - } - - /** - * @return {@link #signature} (Legally binding Contract DSIG signature contents in Base64.). This is the underlying object with id, value and extensions. The accessor "getSignature" gives direct access to the value - */ - public StringType getSignatureElement() { - if (this.signature == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SignatoryComponent.signature"); - else if (Configuration.doAutoCreate()) - this.signature = new StringType(); // bb - return this.signature; - } - - public boolean hasSignatureElement() { - return this.signature != null && !this.signature.isEmpty(); - } - - public boolean hasSignature() { - return this.signature != null && !this.signature.isEmpty(); - } - - /** - * @param value {@link #signature} (Legally binding Contract DSIG signature contents in Base64.). This is the underlying object with id, value and extensions. The accessor "getSignature" gives direct access to the value - */ - public SignatoryComponent setSignatureElement(StringType value) { - this.signature = value; - return this; - } - - /** - * @return Legally binding Contract DSIG signature contents in Base64. - */ - public String getSignature() { - return this.signature == null ? null : this.signature.getValue(); - } - - /** - * @param value Legally binding Contract DSIG signature contents in Base64. - */ - public SignatoryComponent setSignature(String value) { - if (this.signature == null) - this.signature = new StringType(); - this.signature.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Role of this Contract signer, e.g., notary, grantee.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("party", "Reference(Organization|Patient|Practitioner|RelatedPerson)", "Party which is a signator to this Contract.", 0, java.lang.Integer.MAX_VALUE, party)); - childrenList.add(new Property("signature", "string", "Legally binding Contract DSIG signature contents in Base64.", 0, java.lang.Integer.MAX_VALUE, signature)); - } - - public SignatoryComponent copy() { - SignatoryComponent dst = new SignatoryComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.party = party == null ? null : party.copy(); - dst.signature = signature == null ? null : signature.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SignatoryComponent)) - return false; - SignatoryComponent o = (SignatoryComponent) other; - return compareDeep(type, o.type, true) && compareDeep(party, o.party, true) && compareDeep(signature, o.signature, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SignatoryComponent)) - return false; - SignatoryComponent o = (SignatoryComponent) other; - return compareValues(signature, o.signature, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (party == null || party.isEmpty()) - && (signature == null || signature.isEmpty()); - } - - } - - @Block() - public static class TermComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Unique identifier for this particular Contract Provision. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) - @Description(shortDefinition="Contract Term identifier", formalDefinition="Unique identifier for this particular Contract Provision." ) - protected Identifier identifier; - - /** - * When this Contract Provision was issued. - */ - @Child(name = "issued", type = {DateTimeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Contract Term Issue Date Time", formalDefinition="When this Contract Provision was issued." ) - protected DateTimeType issued; - - /** - * Relevant time or time-period when this Contract Provision is applicable. - */ - @Child(name = "applies", type = {Period.class}, order=3, min=0, max=1) - @Description(shortDefinition="Contract Term Effective Time", formalDefinition="Relevant time or time-period when this Contract Provision is applicable." ) - protected Period applies; - - /** - * Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g., life time maximum benefit. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=1) - @Description(shortDefinition="Contract Term Type", formalDefinition="Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g., life time maximum benefit." ) - protected CodeableConcept type; - - /** - * Subtype of this Contract Provision, e.g., life time maximum payment for a contract term for specific valued item, e.g., disability payment. - */ - @Child(name = "subType", type = {CodeableConcept.class}, order=5, min=0, max=1) - @Description(shortDefinition="Contract Term Subtype", formalDefinition="Subtype of this Contract Provision, e.g., life time maximum payment for a contract term for specific valued item, e.g., disability payment." ) - protected CodeableConcept subType; - - /** - * Who or what this Contract Provision is about. - */ - @Child(name = "subject", type = {}, order=6, min=0, max=1) - @Description(shortDefinition="Subject of this Contract Term", formalDefinition="Who or what this Contract Provision is about." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Who or what this Contract Provision is about.) - */ - protected Resource subjectTarget; - - /** - * Action stipulated by this Contract Provision. - */ - @Child(name = "action", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contract Term Action", formalDefinition="Action stipulated by this Contract Provision." ) - protected List action; - - /** - * Reason or purpose for the action stipulated by this Contract Provision. - */ - @Child(name = "actionReason", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contract Term Action Reason", formalDefinition="Reason or purpose for the action stipulated by this Contract Provision." ) - protected List actionReason; - - /** - * List of actors participating in this Contract Provision. - */ - @Child(name = "actor", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contract Term Actor List", formalDefinition="List of actors participating in this Contract Provision." ) - protected List actor; - - /** - * Human readable form of this Contract Provision. - */ - @Child(name = "text", type = {StringType.class}, order=10, min=0, max=1) - @Description(shortDefinition="Human readable Contract term text", formalDefinition="Human readable form of this Contract Provision." ) - protected StringType text; - - /** - * Contract Provision Valued Item List. - */ - @Child(name = "valuedItem", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contract Term Valued Item", formalDefinition="Contract Provision Valued Item List." ) - protected List valuedItem; - - /** - * Nested group of Contract Provisions. - */ - @Child(name = "group", type = {TermComponent.class}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Nested Contract Term Group", formalDefinition="Nested group of Contract Provisions." ) - protected List group; - - private static final long serialVersionUID = -1137577465L; - - /* - * Constructor - */ - public TermComponent() { - super(); - } - - /** - * @return {@link #identifier} (Unique identifier for this particular Contract Provision.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Unique identifier for this particular Contract Provision.) - */ - public TermComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #issued} (When this Contract Provision was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public DateTimeType getIssuedElement() { - if (this.issued == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermComponent.issued"); - else if (Configuration.doAutoCreate()) - this.issued = new DateTimeType(); // bb - return this.issued; - } - - public boolean hasIssuedElement() { - return this.issued != null && !this.issued.isEmpty(); - } - - public boolean hasIssued() { - return this.issued != null && !this.issued.isEmpty(); - } - - /** - * @param value {@link #issued} (When this Contract Provision was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public TermComponent setIssuedElement(DateTimeType value) { - this.issued = value; - return this; - } - - /** - * @return When this Contract Provision was issued. - */ - public Date getIssued() { - return this.issued == null ? null : this.issued.getValue(); - } - - /** - * @param value When this Contract Provision was issued. - */ - public TermComponent setIssued(Date value) { - if (value == null) - this.issued = null; - else { - if (this.issued == null) - this.issued = new DateTimeType(); - this.issued.setValue(value); - } - return this; - } - - /** - * @return {@link #applies} (Relevant time or time-period when this Contract Provision is applicable.) - */ - public Period getApplies() { - if (this.applies == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermComponent.applies"); - else if (Configuration.doAutoCreate()) - this.applies = new Period(); // cc - return this.applies; - } - - public boolean hasApplies() { - return this.applies != null && !this.applies.isEmpty(); - } - - /** - * @param value {@link #applies} (Relevant time or time-period when this Contract Provision is applicable.) - */ - public TermComponent setApplies(Period value) { - this.applies = value; - return this; - } - - /** - * @return {@link #type} (Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g., life time maximum benefit.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g., life time maximum benefit.) - */ - public TermComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #subType} (Subtype of this Contract Provision, e.g., life time maximum payment for a contract term for specific valued item, e.g., disability payment.) - */ - public CodeableConcept getSubType() { - if (this.subType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermComponent.subType"); - else if (Configuration.doAutoCreate()) - this.subType = new CodeableConcept(); // cc - return this.subType; - } - - public boolean hasSubType() { - return this.subType != null && !this.subType.isEmpty(); - } - - /** - * @param value {@link #subType} (Subtype of this Contract Provision, e.g., life time maximum payment for a contract term for specific valued item, e.g., disability payment.) - */ - public TermComponent setSubType(CodeableConcept value) { - this.subType = value; - return this; - } - - /** - * @return {@link #subject} (Who or what this Contract Provision is about.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermComponent.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (Who or what this Contract Provision is about.) - */ - public TermComponent setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who or what this Contract Provision is about.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who or what this Contract Provision is about.) - */ - public TermComponent setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #action} (Action stipulated by this Contract Provision.) - */ - public List getAction() { - if (this.action == null) - this.action = new ArrayList(); - return this.action; - } - - public boolean hasAction() { - if (this.action == null) - return false; - for (CodeableConcept item : this.action) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #action} (Action stipulated by this Contract Provision.) - */ - // syntactic sugar - public CodeableConcept addAction() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return t; - } - - // syntactic sugar - public TermComponent addAction(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return this; - } - - /** - * @return {@link #actionReason} (Reason or purpose for the action stipulated by this Contract Provision.) - */ - public List getActionReason() { - if (this.actionReason == null) - this.actionReason = new ArrayList(); - return this.actionReason; - } - - public boolean hasActionReason() { - if (this.actionReason == null) - return false; - for (CodeableConcept item : this.actionReason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #actionReason} (Reason or purpose for the action stipulated by this Contract Provision.) - */ - // syntactic sugar - public CodeableConcept addActionReason() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.actionReason == null) - this.actionReason = new ArrayList(); - this.actionReason.add(t); - return t; - } - - // syntactic sugar - public TermComponent addActionReason(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.actionReason == null) - this.actionReason = new ArrayList(); - this.actionReason.add(t); - return this; - } - - /** - * @return {@link #actor} (List of actors participating in this Contract Provision.) - */ - public List getActor() { - if (this.actor == null) - this.actor = new ArrayList(); - return this.actor; - } - - public boolean hasActor() { - if (this.actor == null) - return false; - for (TermActorComponent item : this.actor) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #actor} (List of actors participating in this Contract Provision.) - */ - // syntactic sugar - public TermActorComponent addActor() { //3 - TermActorComponent t = new TermActorComponent(); - if (this.actor == null) - this.actor = new ArrayList(); - this.actor.add(t); - return t; - } - - // syntactic sugar - public TermComponent addActor(TermActorComponent t) { //3 - if (t == null) - return this; - if (this.actor == null) - this.actor = new ArrayList(); - this.actor.add(t); - return this; - } - - /** - * @return {@link #text} (Human readable form of this Contract Provision.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (Human readable form of this Contract Provision.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public TermComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return Human readable form of this Contract Provision. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value Human readable form of this Contract Provision. - */ - public TermComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #valuedItem} (Contract Provision Valued Item List.) - */ - public List getValuedItem() { - if (this.valuedItem == null) - this.valuedItem = new ArrayList(); - return this.valuedItem; - } - - public boolean hasValuedItem() { - if (this.valuedItem == null) - return false; - for (TermValuedItemComponent item : this.valuedItem) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #valuedItem} (Contract Provision Valued Item List.) - */ - // syntactic sugar - public TermValuedItemComponent addValuedItem() { //3 - TermValuedItemComponent t = new TermValuedItemComponent(); - if (this.valuedItem == null) - this.valuedItem = new ArrayList(); - this.valuedItem.add(t); - return t; - } - - // syntactic sugar - public TermComponent addValuedItem(TermValuedItemComponent t) { //3 - if (t == null) - return this; - if (this.valuedItem == null) - this.valuedItem = new ArrayList(); - this.valuedItem.add(t); - return this; - } - - /** - * @return {@link #group} (Nested group of Contract Provisions.) - */ - public List getGroup() { - if (this.group == null) - this.group = new ArrayList(); - return this.group; - } - - public boolean hasGroup() { - if (this.group == null) - return false; - for (TermComponent item : this.group) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #group} (Nested group of Contract Provisions.) - */ - // syntactic sugar - public TermComponent addGroup() { //3 - TermComponent t = new TermComponent(); - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return t; - } - - // syntactic sugar - public TermComponent addGroup(TermComponent t) { //3 - if (t == null) - return this; - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Unique identifier for this particular Contract Provision.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("issued", "dateTime", "When this Contract Provision was issued.", 0, java.lang.Integer.MAX_VALUE, issued)); - childrenList.add(new Property("applies", "Period", "Relevant time or time-period when this Contract Provision is applicable.", 0, java.lang.Integer.MAX_VALUE, applies)); - childrenList.add(new Property("type", "CodeableConcept", "Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g., life time maximum benefit.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("subType", "CodeableConcept", "Subtype of this Contract Provision, e.g., life time maximum payment for a contract term for specific valued item, e.g., disability payment.", 0, java.lang.Integer.MAX_VALUE, subType)); - childrenList.add(new Property("subject", "Reference(Any)", "Who or what this Contract Provision is about.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("action", "CodeableConcept", "Action stipulated by this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, action)); - childrenList.add(new Property("actionReason", "CodeableConcept", "Reason or purpose for the action stipulated by this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, actionReason)); - childrenList.add(new Property("actor", "", "List of actors participating in this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, actor)); - childrenList.add(new Property("text", "string", "Human readable form of this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("valuedItem", "", "Contract Provision Valued Item List.", 0, java.lang.Integer.MAX_VALUE, valuedItem)); - childrenList.add(new Property("group", "@Contract.term", "Nested group of Contract Provisions.", 0, java.lang.Integer.MAX_VALUE, group)); - } - - public TermComponent copy() { - TermComponent dst = new TermComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.issued = issued == null ? null : issued.copy(); - dst.applies = applies == null ? null : applies.copy(); - dst.type = type == null ? null : type.copy(); - dst.subType = subType == null ? null : subType.copy(); - dst.subject = subject == null ? null : subject.copy(); - if (action != null) { - dst.action = new ArrayList(); - for (CodeableConcept i : action) - dst.action.add(i.copy()); - }; - if (actionReason != null) { - dst.actionReason = new ArrayList(); - for (CodeableConcept i : actionReason) - dst.actionReason.add(i.copy()); - }; - if (actor != null) { - dst.actor = new ArrayList(); - for (TermActorComponent i : actor) - dst.actor.add(i.copy()); - }; - dst.text = text == null ? null : text.copy(); - if (valuedItem != null) { - dst.valuedItem = new ArrayList(); - for (TermValuedItemComponent i : valuedItem) - dst.valuedItem.add(i.copy()); - }; - if (group != null) { - dst.group = new ArrayList(); - for (TermComponent i : group) - dst.group.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TermComponent)) - return false; - TermComponent o = (TermComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(issued, o.issued, true) && compareDeep(applies, o.applies, true) - && compareDeep(type, o.type, true) && compareDeep(subType, o.subType, true) && compareDeep(subject, o.subject, true) - && compareDeep(action, o.action, true) && compareDeep(actionReason, o.actionReason, true) && compareDeep(actor, o.actor, true) - && compareDeep(text, o.text, true) && compareDeep(valuedItem, o.valuedItem, true) && compareDeep(group, o.group, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TermComponent)) - return false; - TermComponent o = (TermComponent) other; - return compareValues(issued, o.issued, true) && compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (issued == null || issued.isEmpty()) - && (applies == null || applies.isEmpty()) && (type == null || type.isEmpty()) && (subType == null || subType.isEmpty()) - && (subject == null || subject.isEmpty()) && (action == null || action.isEmpty()) && (actionReason == null || actionReason.isEmpty()) - && (actor == null || actor.isEmpty()) && (text == null || text.isEmpty()) && (valuedItem == null || valuedItem.isEmpty()) - && (group == null || group.isEmpty()); - } - - } - - @Block() - public static class TermActorComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The actor assigned a role in this Contract Provision. - */ - @Child(name = "entity", type = {Contract.class, Device.class, Group.class, Location.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class, Substance.class, Supply.class}, order=1, min=1, max=1) - @Description(shortDefinition="Contract Term Actor", formalDefinition="The actor assigned a role in this Contract Provision." ) - protected Reference entity; - - /** - * The actual object that is the target of the reference (The actor assigned a role in this Contract Provision.) - */ - protected Resource entityTarget; - - /** - * Role played by the actor assigned this role in this Contract Provision. - */ - @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contract Term Actor Role", formalDefinition="Role played by the actor assigned this role in this Contract Provision." ) - protected List role; - - private static final long serialVersionUID = 1371245689L; - - /* - * Constructor - */ - public TermActorComponent() { - super(); - } - - /* - * Constructor - */ - public TermActorComponent(Reference entity) { - super(); - this.entity = entity; - } - - /** - * @return {@link #entity} (The actor assigned a role in this Contract Provision.) - */ - public Reference getEntity() { - if (this.entity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermActorComponent.entity"); - else if (Configuration.doAutoCreate()) - this.entity = new Reference(); // cc - return this.entity; - } - - public boolean hasEntity() { - return this.entity != null && !this.entity.isEmpty(); - } - - /** - * @param value {@link #entity} (The actor assigned a role in this Contract Provision.) - */ - public TermActorComponent setEntity(Reference value) { - this.entity = value; - return this; - } - - /** - * @return {@link #entity} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The actor assigned a role in this Contract Provision.) - */ - public Resource getEntityTarget() { - return this.entityTarget; - } - - /** - * @param value {@link #entity} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The actor assigned a role in this Contract Provision.) - */ - public TermActorComponent setEntityTarget(Resource value) { - this.entityTarget = value; - return this; - } - - /** - * @return {@link #role} (Role played by the actor assigned this role in this Contract Provision.) - */ - public List getRole() { - if (this.role == null) - this.role = new ArrayList(); - return this.role; - } - - public boolean hasRole() { - if (this.role == null) - return false; - for (CodeableConcept item : this.role) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #role} (Role played by the actor assigned this role in this Contract Provision.) - */ - // syntactic sugar - public CodeableConcept addRole() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.role == null) - this.role = new ArrayList(); - this.role.add(t); - return t; - } - - // syntactic sugar - public TermActorComponent addRole(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.role == null) - this.role = new ArrayList(); - this.role.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("entity", "Reference(Contract|Device|Group|Location|Organization|Patient|Practitioner|RelatedPerson|Substance|Supply)", "The actor assigned a role in this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, entity)); - childrenList.add(new Property("role", "CodeableConcept", "Role played by the actor assigned this role in this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, role)); - } - - public TermActorComponent copy() { - TermActorComponent dst = new TermActorComponent(); - copyValues(dst); - dst.entity = entity == null ? null : entity.copy(); - if (role != null) { - dst.role = new ArrayList(); - for (CodeableConcept i : role) - dst.role.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TermActorComponent)) - return false; - TermActorComponent o = (TermActorComponent) other; - return compareDeep(entity, o.entity, true) && compareDeep(role, o.role, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TermActorComponent)) - return false; - TermActorComponent o = (TermActorComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (entity == null || entity.isEmpty()) && (role == null || role.isEmpty()) - ; - } - - } - - @Block() - public static class TermValuedItemComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Specific type of Contract Provision Valued Item that may be priced. - */ - @Child(name = "entity", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Contract Term Valued Item Type", formalDefinition="Specific type of Contract Provision Valued Item that may be priced." ) - protected Type entity; - - /** - * Identifies a Contract Provision Valued Item instance. - */ - @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=1) - @Description(shortDefinition="Contract Term Valued Item Identifier", formalDefinition="Identifies a Contract Provision Valued Item instance." ) - protected Identifier identifier; - - /** - * Indicates the time during which this Contract Term ValuedItem information is effective. - */ - @Child(name = "effectiveTime", type = {DateTimeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Contract Term Valued Item Effective Tiem", formalDefinition="Indicates the time during which this Contract Term ValuedItem information is effective." ) - protected DateTimeType effectiveTime; - - /** - * Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances. - */ - @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1) - @Description(shortDefinition="Contract Term Valued Item Count", formalDefinition="Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances." ) - protected Quantity quantity; - - /** - * A Contract Provision Valued Item unit valuation measure. - */ - @Child(name = "unitPrice", type = {Money.class}, order=5, min=0, max=1) - @Description(shortDefinition="Contract Term Valued Item fee, charge, or cost", formalDefinition="A Contract Provision Valued Item unit valuation measure." ) - protected Money unitPrice; - - /** - * A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - @Child(name = "factor", type = {DecimalType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Contract Term Valued Item Price Scaling Factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) - protected DecimalType factor; - - /** - * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point. - */ - @Child(name = "points", type = {DecimalType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Contract Term Valued Item Difficulty Scaling Factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point." ) - protected DecimalType points; - - /** - * Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. - */ - @Child(name = "net", type = {Money.class}, order=8, min=0, max=1) - @Description(shortDefinition="Total Contract Term Valued Item Value", formalDefinition="Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) - protected Money net; - - private static final long serialVersionUID = 1311183770L; - - /* - * Constructor - */ - public TermValuedItemComponent() { - super(); - } - - /** - * @return {@link #entity} (Specific type of Contract Provision Valued Item that may be priced.) - */ - public Type getEntity() { - return this.entity; - } - - /** - * @return {@link #entity} (Specific type of Contract Provision Valued Item that may be priced.) - */ - public CodeableConcept getEntityCodeableConcept() throws Exception { - if (!(this.entity instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.entity.getClass().getName()+" was encountered"); - return (CodeableConcept) this.entity; - } - - /** - * @return {@link #entity} (Specific type of Contract Provision Valued Item that may be priced.) - */ - public Reference getEntityReference() throws Exception { - if (!(this.entity instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.entity.getClass().getName()+" was encountered"); - return (Reference) this.entity; - } - - public boolean hasEntity() { - return this.entity != null && !this.entity.isEmpty(); - } - - /** - * @param value {@link #entity} (Specific type of Contract Provision Valued Item that may be priced.) - */ - public TermValuedItemComponent setEntity(Type value) { - this.entity = value; - return this; - } - - /** - * @return {@link #identifier} (Identifies a Contract Provision Valued Item instance.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermValuedItemComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifies a Contract Provision Valued Item instance.) - */ - public TermValuedItemComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #effectiveTime} (Indicates the time during which this Contract Term ValuedItem information is effective.). This is the underlying object with id, value and extensions. The accessor "getEffectiveTime" gives direct access to the value - */ - public DateTimeType getEffectiveTimeElement() { - if (this.effectiveTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermValuedItemComponent.effectiveTime"); - else if (Configuration.doAutoCreate()) - this.effectiveTime = new DateTimeType(); // bb - return this.effectiveTime; - } - - public boolean hasEffectiveTimeElement() { - return this.effectiveTime != null && !this.effectiveTime.isEmpty(); - } - - public boolean hasEffectiveTime() { - return this.effectiveTime != null && !this.effectiveTime.isEmpty(); - } - - /** - * @param value {@link #effectiveTime} (Indicates the time during which this Contract Term ValuedItem information is effective.). This is the underlying object with id, value and extensions. The accessor "getEffectiveTime" gives direct access to the value - */ - public TermValuedItemComponent setEffectiveTimeElement(DateTimeType value) { - this.effectiveTime = value; - return this; - } - - /** - * @return Indicates the time during which this Contract Term ValuedItem information is effective. - */ - public Date getEffectiveTime() { - return this.effectiveTime == null ? null : this.effectiveTime.getValue(); - } - - /** - * @param value Indicates the time during which this Contract Term ValuedItem information is effective. - */ - public TermValuedItemComponent setEffectiveTime(Date value) { - if (value == null) - this.effectiveTime = null; - else { - if (this.effectiveTime == null) - this.effectiveTime = new DateTimeType(); - this.effectiveTime.setValue(value); - } - return this; - } - - /** - * @return {@link #quantity} (Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermValuedItemComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances.) - */ - public TermValuedItemComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (A Contract Provision Valued Item unit valuation measure.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermValuedItemComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); // cc - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (A Contract Provision Valued Item unit valuation measure.) - */ - public TermValuedItemComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermValuedItemComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); // bb - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public TermValuedItemComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public TermValuedItemComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermValuedItemComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); // bb - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public TermValuedItemComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point. - */ - public TermValuedItemComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermValuedItemComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); // cc - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public TermValuedItemComponent setNet(Money value) { - this.net = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("entity[x]", "CodeableConcept|Reference(Any)", "Specific type of Contract Provision Valued Item that may be priced.", 0, java.lang.Integer.MAX_VALUE, entity)); - childrenList.add(new Property("identifier", "Identifier", "Identifies a Contract Provision Valued Item instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("effectiveTime", "dateTime", "Indicates the time during which this Contract Term ValuedItem information is effective.", 0, java.lang.Integer.MAX_VALUE, effectiveTime)); - childrenList.add(new Property("quantity", "Quantity", "Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "A Contract Provision Valued Item unit valuation measure.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); - } - - public TermValuedItemComponent copy() { - TermValuedItemComponent dst = new TermValuedItemComponent(); - copyValues(dst); - dst.entity = entity == null ? null : entity.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.effectiveTime = effectiveTime == null ? null : effectiveTime.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TermValuedItemComponent)) - return false; - TermValuedItemComponent o = (TermValuedItemComponent) other; - return compareDeep(entity, o.entity, true) && compareDeep(identifier, o.identifier, true) && compareDeep(effectiveTime, o.effectiveTime, true) - && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true) - && compareDeep(points, o.points, true) && compareDeep(net, o.net, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TermValuedItemComponent)) - return false; - TermValuedItemComponent o = (TermValuedItemComponent) other; - return compareValues(effectiveTime, o.effectiveTime, true) && compareValues(factor, o.factor, true) - && compareValues(points, o.points, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (entity == null || entity.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (effectiveTime == null || effectiveTime.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (unitPrice == null || unitPrice.isEmpty()) && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) - && (net == null || net.isEmpty()); - } - - } - - @Block() - public static class FriendlyLanguageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability. - */ - @Child(name = "content", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireAnswers.class}, order=1, min=1, max=1) - @Description(shortDefinition="Easily comprehended representation of this Contract", formalDefinition="Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability." ) - protected Type content; - - private static final long serialVersionUID = -1763459053L; - - /* - * Constructor - */ - public FriendlyLanguageComponent() { - super(); - } - - /* - * Constructor - */ - public FriendlyLanguageComponent(Type content) { - super(); - this.content = content; - } - - /** - * @return {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.) - */ - public Type getContent() { - return this.content; - } - - /** - * @return {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.) - */ - public Attachment getContentAttachment() throws Exception { - if (!(this.content instanceof Attachment)) - throw new Exception("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered"); - return (Attachment) this.content; - } - - /** - * @return {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.) - */ - public Reference getContentReference() throws Exception { - if (!(this.content instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered"); - return (Reference) this.content; - } - - public boolean hasContent() { - return this.content != null && !this.content.isEmpty(); - } - - /** - * @param value {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.) - */ - public FriendlyLanguageComponent setContent(Type value) { - this.content = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireAnswers)", "Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.", 0, java.lang.Integer.MAX_VALUE, content)); - } - - public FriendlyLanguageComponent copy() { - FriendlyLanguageComponent dst = new FriendlyLanguageComponent(); - copyValues(dst); - dst.content = content == null ? null : content.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof FriendlyLanguageComponent)) - return false; - FriendlyLanguageComponent o = (FriendlyLanguageComponent) other; - return compareDeep(content, o.content, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof FriendlyLanguageComponent)) - return false; - FriendlyLanguageComponent o = (FriendlyLanguageComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (content == null || content.isEmpty()); - } - - } - - @Block() - public static class LegalLanguageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Contract legal text in human renderable form. - */ - @Child(name = "content", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireAnswers.class}, order=1, min=1, max=1) - @Description(shortDefinition="Contract Legal Text", formalDefinition="Contract legal text in human renderable form." ) - protected Type content; - - private static final long serialVersionUID = -1763459053L; - - /* - * Constructor - */ - public LegalLanguageComponent() { - super(); - } - - /* - * Constructor - */ - public LegalLanguageComponent(Type content) { - super(); - this.content = content; - } - - /** - * @return {@link #content} (Contract legal text in human renderable form.) - */ - public Type getContent() { - return this.content; - } - - /** - * @return {@link #content} (Contract legal text in human renderable form.) - */ - public Attachment getContentAttachment() throws Exception { - if (!(this.content instanceof Attachment)) - throw new Exception("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered"); - return (Attachment) this.content; - } - - /** - * @return {@link #content} (Contract legal text in human renderable form.) - */ - public Reference getContentReference() throws Exception { - if (!(this.content instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered"); - return (Reference) this.content; - } - - public boolean hasContent() { - return this.content != null && !this.content.isEmpty(); - } - - /** - * @param value {@link #content} (Contract legal text in human renderable form.) - */ - public LegalLanguageComponent setContent(Type value) { - this.content = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireAnswers)", "Contract legal text in human renderable form.", 0, java.lang.Integer.MAX_VALUE, content)); - } - - public LegalLanguageComponent copy() { - LegalLanguageComponent dst = new LegalLanguageComponent(); - copyValues(dst); - dst.content = content == null ? null : content.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof LegalLanguageComponent)) - return false; - LegalLanguageComponent o = (LegalLanguageComponent) other; - return compareDeep(content, o.content, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof LegalLanguageComponent)) - return false; - LegalLanguageComponent o = (LegalLanguageComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (content == null || content.isEmpty()); - } - - } - - @Block() - public static class ComputableLanguageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal). - */ - @Child(name = "content", type = {Attachment.class, DocumentReference.class}, order=1, min=1, max=1) - @Description(shortDefinition="Computable Contract Rules", formalDefinition="Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal)." ) - protected Type content; - - private static final long serialVersionUID = -1763459053L; - - /* - * Constructor - */ - public ComputableLanguageComponent() { - super(); - } - - /* - * Constructor - */ - public ComputableLanguageComponent(Type content) { - super(); - this.content = content; - } - - /** - * @return {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).) - */ - public Type getContent() { - return this.content; - } - - /** - * @return {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).) - */ - public Attachment getContentAttachment() throws Exception { - if (!(this.content instanceof Attachment)) - throw new Exception("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered"); - return (Attachment) this.content; - } - - /** - * @return {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).) - */ - public Reference getContentReference() throws Exception { - if (!(this.content instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered"); - return (Reference) this.content; - } - - public boolean hasContent() { - return this.content != null && !this.content.isEmpty(); - } - - /** - * @param value {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).) - */ - public ComputableLanguageComponent setContent(Type value) { - this.content = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("content[x]", "Attachment|Reference(DocumentReference)", "Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).", 0, java.lang.Integer.MAX_VALUE, content)); - } - - public ComputableLanguageComponent copy() { - ComputableLanguageComponent dst = new ComputableLanguageComponent(); - copyValues(dst); - dst.content = content == null ? null : content.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ComputableLanguageComponent)) - return false; - ComputableLanguageComponent o = (ComputableLanguageComponent) other; - return compareDeep(content, o.content, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ComputableLanguageComponent)) - return false; - ComputableLanguageComponent o = (ComputableLanguageComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (content == null || content.isEmpty()); - } - - } - - /** - * Unique identifier for this Contract. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1) - @Description(shortDefinition="Contract identifier", formalDefinition="Unique identifier for this Contract." ) - protected Identifier identifier; - - /** - * When this Contract was issued. - */ - @Child(name = "issued", type = {DateTimeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="When this Contract was issued", formalDefinition="When this Contract was issued." ) - protected DateTimeType issued; - - /** - * Relevant time or time-period when this Contract is applicable. - */ - @Child(name = "applies", type = {Period.class}, order=2, min=0, max=1) - @Description(shortDefinition="Effective time", formalDefinition="Relevant time or time-period when this Contract is applicable." ) - protected Period applies; - - /** - * Who and/or what this Contract is about: typically a Patient, Organization, or valued items such as goods and services. - */ - @Child(name = "subject", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Subject of this Contract", formalDefinition="Who and/or what this Contract is about: typically a Patient, Organization, or valued items such as goods and services." ) - protected List subject; - /** - * The actual objects that are the target of the reference (Who and/or what this Contract is about: typically a Patient, Organization, or valued items such as goods and services.) - */ - protected List subjectTarget; - - - /** - * A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies. - */ - @Child(name = "authority", type = {Organization.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Authority under which this Contract has standing", formalDefinition="A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies." ) - protected List authority; - /** - * The actual objects that are the target of the reference (A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.) - */ - protected List authorityTarget; - - - /** - * Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources. - */ - @Child(name = "domain", type = {Location.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Domain in which this Contract applies", formalDefinition="Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources." ) - protected List domain; - /** - * The actual objects that are the target of the reference (Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.) - */ - protected List domainTarget; - - - /** - * Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=6, min=0, max=1) - @Description(shortDefinition="Contract Tyoe", formalDefinition="Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc." ) - protected CodeableConcept type; - - /** - * More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent. - */ - @Child(name = "subType", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contract Subtype", formalDefinition="More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent." ) - protected List subType; - - /** - * Action stipulated by this Contract. - */ - @Child(name = "action", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contract Action", formalDefinition="Action stipulated by this Contract." ) - protected List action; - - /** - * Reason for action stipulated by this Contract. - */ - @Child(name = "actionReason", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contract Action Reason", formalDefinition="Reason for action stipulated by this Contract." ) - protected List actionReason; - - /** - * List of Contract actors. - */ - @Child(name = "actor", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contract Actor", formalDefinition="List of Contract actors." ) - protected List actor; - - /** - * Contract Valued Item List. - */ - @Child(name = "valuedItem", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contract Valued Item", formalDefinition="Contract Valued Item List." ) - protected List valuedItem; - - /** - * Party signing this Contract. - */ - @Child(name = "signer", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contract Signer", formalDefinition="Party signing this Contract." ) - protected List signer; - - /** - * One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups. - */ - @Child(name = "term", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contract Term List", formalDefinition="One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups." ) - protected List term; - - /** - * Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract. - */ - @Child(name = "binding", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireAnswers.class}, order=14, min=0, max=1) - @Description(shortDefinition="Binding Contract", formalDefinition="Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the 'source of truth' and which would be the basis for legal action related to enforcement of this Contract." ) - protected Type binding; - - /** - * The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement. - */ - @Child(name = "friendly", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contract Friendly Language", formalDefinition="The 'patient friendly language' versionof the Contract in whole or in parts. 'Patient friendly language' means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement." ) - protected List friendly; - - /** - * List of Legal expressions or representations of this Contract. - */ - @Child(name = "legal", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contract Legal Language", formalDefinition="List of Legal expressions or representations of this Contract." ) - protected List legal; - - /** - * List of Computable Policy Rule Language Representations of this Contract. - */ - @Child(name = "rule", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Computable Contract Language", formalDefinition="List of Computable Policy Rule Language Representations of this Contract." ) - protected List rule; - - private static final long serialVersionUID = -1785608373L; - - /* - * Constructor - */ - public Contract() { - super(); - } - - /** - * @return {@link #identifier} (Unique identifier for this Contract.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Unique identifier for this Contract.) - */ - public Contract setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #issued} (When this Contract was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public DateTimeType getIssuedElement() { - if (this.issued == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.issued"); - else if (Configuration.doAutoCreate()) - this.issued = new DateTimeType(); // bb - return this.issued; - } - - public boolean hasIssuedElement() { - return this.issued != null && !this.issued.isEmpty(); - } - - public boolean hasIssued() { - return this.issued != null && !this.issued.isEmpty(); - } - - /** - * @param value {@link #issued} (When this Contract was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public Contract setIssuedElement(DateTimeType value) { - this.issued = value; - return this; - } - - /** - * @return When this Contract was issued. - */ - public Date getIssued() { - return this.issued == null ? null : this.issued.getValue(); - } - - /** - * @param value When this Contract was issued. - */ - public Contract setIssued(Date value) { - if (value == null) - this.issued = null; - else { - if (this.issued == null) - this.issued = new DateTimeType(); - this.issued.setValue(value); - } - return this; - } - - /** - * @return {@link #applies} (Relevant time or time-period when this Contract is applicable.) - */ - public Period getApplies() { - if (this.applies == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.applies"); - else if (Configuration.doAutoCreate()) - this.applies = new Period(); // cc - return this.applies; - } - - public boolean hasApplies() { - return this.applies != null && !this.applies.isEmpty(); - } - - /** - * @param value {@link #applies} (Relevant time or time-period when this Contract is applicable.) - */ - public Contract setApplies(Period value) { - this.applies = value; - return this; - } - - /** - * @return {@link #subject} (Who and/or what this Contract is about: typically a Patient, Organization, or valued items such as goods and services.) - */ - public List getSubject() { - if (this.subject == null) - this.subject = new ArrayList(); - return this.subject; - } - - public boolean hasSubject() { - if (this.subject == null) - return false; - for (Reference item : this.subject) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subject} (Who and/or what this Contract is about: typically a Patient, Organization, or valued items such as goods and services.) - */ - // syntactic sugar - public Reference addSubject() { //3 - Reference t = new Reference(); - if (this.subject == null) - this.subject = new ArrayList(); - this.subject.add(t); - return t; - } - - // syntactic sugar - public Contract addSubject(Reference t) { //3 - if (t == null) - return this; - if (this.subject == null) - this.subject = new ArrayList(); - this.subject.add(t); - return this; - } - - /** - * @return {@link #subject} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Who and/or what this Contract is about: typically a Patient, Organization, or valued items such as goods and services.) - */ - public List getSubjectTarget() { - if (this.subjectTarget == null) - this.subjectTarget = new ArrayList(); - return this.subjectTarget; - } - - /** - * @return {@link #authority} (A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.) - */ - public List getAuthority() { - if (this.authority == null) - this.authority = new ArrayList(); - return this.authority; - } - - public boolean hasAuthority() { - if (this.authority == null) - return false; - for (Reference item : this.authority) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #authority} (A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.) - */ - // syntactic sugar - public Reference addAuthority() { //3 - Reference t = new Reference(); - if (this.authority == null) - this.authority = new ArrayList(); - this.authority.add(t); - return t; - } - - // syntactic sugar - public Contract addAuthority(Reference t) { //3 - if (t == null) - return this; - if (this.authority == null) - this.authority = new ArrayList(); - this.authority.add(t); - return this; - } - - /** - * @return {@link #authority} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.) - */ - public List getAuthorityTarget() { - if (this.authorityTarget == null) - this.authorityTarget = new ArrayList(); - return this.authorityTarget; - } - - // syntactic sugar - /** - * @return {@link #authority} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.) - */ - public Organization addAuthorityTarget() { - Organization r = new Organization(); - if (this.authorityTarget == null) - this.authorityTarget = new ArrayList(); - this.authorityTarget.add(r); - return r; - } - - /** - * @return {@link #domain} (Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.) - */ - public List getDomain() { - if (this.domain == null) - this.domain = new ArrayList(); - return this.domain; - } - - public boolean hasDomain() { - if (this.domain == null) - return false; - for (Reference item : this.domain) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #domain} (Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.) - */ - // syntactic sugar - public Reference addDomain() { //3 - Reference t = new Reference(); - if (this.domain == null) - this.domain = new ArrayList(); - this.domain.add(t); - return t; - } - - // syntactic sugar - public Contract addDomain(Reference t) { //3 - if (t == null) - return this; - if (this.domain == null) - this.domain = new ArrayList(); - this.domain.add(t); - return this; - } - - /** - * @return {@link #domain} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.) - */ - public List getDomainTarget() { - if (this.domainTarget == null) - this.domainTarget = new ArrayList(); - return this.domainTarget; - } - - // syntactic sugar - /** - * @return {@link #domain} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.) - */ - public Location addDomainTarget() { - Location r = new Location(); - if (this.domainTarget == null) - this.domainTarget = new ArrayList(); - this.domainTarget.add(r); - return r; - } - - /** - * @return {@link #type} (Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc.) - */ - public Contract setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #subType} (More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent.) - */ - public List getSubType() { - if (this.subType == null) - this.subType = new ArrayList(); - return this.subType; - } - - public boolean hasSubType() { - if (this.subType == null) - return false; - for (CodeableConcept item : this.subType) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subType} (More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent.) - */ - // syntactic sugar - public CodeableConcept addSubType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.subType == null) - this.subType = new ArrayList(); - this.subType.add(t); - return t; - } - - // syntactic sugar - public Contract addSubType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.subType == null) - this.subType = new ArrayList(); - this.subType.add(t); - return this; - } - - /** - * @return {@link #action} (Action stipulated by this Contract.) - */ - public List getAction() { - if (this.action == null) - this.action = new ArrayList(); - return this.action; - } - - public boolean hasAction() { - if (this.action == null) - return false; - for (CodeableConcept item : this.action) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #action} (Action stipulated by this Contract.) - */ - // syntactic sugar - public CodeableConcept addAction() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return t; - } - - // syntactic sugar - public Contract addAction(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return this; - } - - /** - * @return {@link #actionReason} (Reason for action stipulated by this Contract.) - */ - public List getActionReason() { - if (this.actionReason == null) - this.actionReason = new ArrayList(); - return this.actionReason; - } - - public boolean hasActionReason() { - if (this.actionReason == null) - return false; - for (CodeableConcept item : this.actionReason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #actionReason} (Reason for action stipulated by this Contract.) - */ - // syntactic sugar - public CodeableConcept addActionReason() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.actionReason == null) - this.actionReason = new ArrayList(); - this.actionReason.add(t); - return t; - } - - // syntactic sugar - public Contract addActionReason(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.actionReason == null) - this.actionReason = new ArrayList(); - this.actionReason.add(t); - return this; - } - - /** - * @return {@link #actor} (List of Contract actors.) - */ - public List getActor() { - if (this.actor == null) - this.actor = new ArrayList(); - return this.actor; - } - - public boolean hasActor() { - if (this.actor == null) - return false; - for (ActorComponent item : this.actor) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #actor} (List of Contract actors.) - */ - // syntactic sugar - public ActorComponent addActor() { //3 - ActorComponent t = new ActorComponent(); - if (this.actor == null) - this.actor = new ArrayList(); - this.actor.add(t); - return t; - } - - // syntactic sugar - public Contract addActor(ActorComponent t) { //3 - if (t == null) - return this; - if (this.actor == null) - this.actor = new ArrayList(); - this.actor.add(t); - return this; - } - - /** - * @return {@link #valuedItem} (Contract Valued Item List.) - */ - public List getValuedItem() { - if (this.valuedItem == null) - this.valuedItem = new ArrayList(); - return this.valuedItem; - } - - public boolean hasValuedItem() { - if (this.valuedItem == null) - return false; - for (ValuedItemComponent item : this.valuedItem) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #valuedItem} (Contract Valued Item List.) - */ - // syntactic sugar - public ValuedItemComponent addValuedItem() { //3 - ValuedItemComponent t = new ValuedItemComponent(); - if (this.valuedItem == null) - this.valuedItem = new ArrayList(); - this.valuedItem.add(t); - return t; - } - - // syntactic sugar - public Contract addValuedItem(ValuedItemComponent t) { //3 - if (t == null) - return this; - if (this.valuedItem == null) - this.valuedItem = new ArrayList(); - this.valuedItem.add(t); - return this; - } - - /** - * @return {@link #signer} (Party signing this Contract.) - */ - public List getSigner() { - if (this.signer == null) - this.signer = new ArrayList(); - return this.signer; - } - - public boolean hasSigner() { - if (this.signer == null) - return false; - for (SignatoryComponent item : this.signer) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #signer} (Party signing this Contract.) - */ - // syntactic sugar - public SignatoryComponent addSigner() { //3 - SignatoryComponent t = new SignatoryComponent(); - if (this.signer == null) - this.signer = new ArrayList(); - this.signer.add(t); - return t; - } - - // syntactic sugar - public Contract addSigner(SignatoryComponent t) { //3 - if (t == null) - return this; - if (this.signer == null) - this.signer = new ArrayList(); - this.signer.add(t); - return this; - } - - /** - * @return {@link #term} (One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.) - */ - public List getTerm() { - if (this.term == null) - this.term = new ArrayList(); - return this.term; - } - - public boolean hasTerm() { - if (this.term == null) - return false; - for (TermComponent item : this.term) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #term} (One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.) - */ - // syntactic sugar - public TermComponent addTerm() { //3 - TermComponent t = new TermComponent(); - if (this.term == null) - this.term = new ArrayList(); - this.term.add(t); - return t; - } - - // syntactic sugar - public Contract addTerm(TermComponent t) { //3 - if (t == null) - return this; - if (this.term == null) - this.term = new ArrayList(); - this.term.add(t); - return this; - } - - /** - * @return {@link #binding} (Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.) - */ - public Type getBinding() { - return this.binding; - } - - /** - * @return {@link #binding} (Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.) - */ - public Attachment getBindingAttachment() throws Exception { - if (!(this.binding instanceof Attachment)) - throw new Exception("Type mismatch: the type Attachment was expected, but "+this.binding.getClass().getName()+" was encountered"); - return (Attachment) this.binding; - } - - /** - * @return {@link #binding} (Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.) - */ - public Reference getBindingReference() throws Exception { - if (!(this.binding instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.binding.getClass().getName()+" was encountered"); - return (Reference) this.binding; - } - - public boolean hasBinding() { - return this.binding != null && !this.binding.isEmpty(); - } - - /** - * @param value {@link #binding} (Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.) - */ - public Contract setBinding(Type value) { - this.binding = value; - return this; - } - - /** - * @return {@link #friendly} (The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement.) - */ - public List getFriendly() { - if (this.friendly == null) - this.friendly = new ArrayList(); - return this.friendly; - } - - public boolean hasFriendly() { - if (this.friendly == null) - return false; - for (FriendlyLanguageComponent item : this.friendly) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #friendly} (The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement.) - */ - // syntactic sugar - public FriendlyLanguageComponent addFriendly() { //3 - FriendlyLanguageComponent t = new FriendlyLanguageComponent(); - if (this.friendly == null) - this.friendly = new ArrayList(); - this.friendly.add(t); - return t; - } - - // syntactic sugar - public Contract addFriendly(FriendlyLanguageComponent t) { //3 - if (t == null) - return this; - if (this.friendly == null) - this.friendly = new ArrayList(); - this.friendly.add(t); - return this; - } - - /** - * @return {@link #legal} (List of Legal expressions or representations of this Contract.) - */ - public List getLegal() { - if (this.legal == null) - this.legal = new ArrayList(); - return this.legal; - } - - public boolean hasLegal() { - if (this.legal == null) - return false; - for (LegalLanguageComponent item : this.legal) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #legal} (List of Legal expressions or representations of this Contract.) - */ - // syntactic sugar - public LegalLanguageComponent addLegal() { //3 - LegalLanguageComponent t = new LegalLanguageComponent(); - if (this.legal == null) - this.legal = new ArrayList(); - this.legal.add(t); - return t; - } - - // syntactic sugar - public Contract addLegal(LegalLanguageComponent t) { //3 - if (t == null) - return this; - if (this.legal == null) - this.legal = new ArrayList(); - this.legal.add(t); - return this; - } - - /** - * @return {@link #rule} (List of Computable Policy Rule Language Representations of this Contract.) - */ - public List getRule() { - if (this.rule == null) - this.rule = new ArrayList(); - return this.rule; - } - - public boolean hasRule() { - if (this.rule == null) - return false; - for (ComputableLanguageComponent item : this.rule) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #rule} (List of Computable Policy Rule Language Representations of this Contract.) - */ - // syntactic sugar - public ComputableLanguageComponent addRule() { //3 - ComputableLanguageComponent t = new ComputableLanguageComponent(); - if (this.rule == null) - this.rule = new ArrayList(); - this.rule.add(t); - return t; - } - - // syntactic sugar - public Contract addRule(ComputableLanguageComponent t) { //3 - if (t == null) - return this; - if (this.rule == null) - this.rule = new ArrayList(); - this.rule.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Unique identifier for this Contract.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("issued", "dateTime", "When this Contract was issued.", 0, java.lang.Integer.MAX_VALUE, issued)); - childrenList.add(new Property("applies", "Period", "Relevant time or time-period when this Contract is applicable.", 0, java.lang.Integer.MAX_VALUE, applies)); - childrenList.add(new Property("subject", "Reference(Any)", "Who and/or what this Contract is about: typically a Patient, Organization, or valued items such as goods and services.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("authority", "Reference(Organization)", "A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.", 0, java.lang.Integer.MAX_VALUE, authority)); - childrenList.add(new Property("domain", "Reference(Location)", "Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.", 0, java.lang.Integer.MAX_VALUE, domain)); - childrenList.add(new Property("type", "CodeableConcept", "Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("subType", "CodeableConcept", "More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent.", 0, java.lang.Integer.MAX_VALUE, subType)); - childrenList.add(new Property("action", "CodeableConcept", "Action stipulated by this Contract.", 0, java.lang.Integer.MAX_VALUE, action)); - childrenList.add(new Property("actionReason", "CodeableConcept", "Reason for action stipulated by this Contract.", 0, java.lang.Integer.MAX_VALUE, actionReason)); - childrenList.add(new Property("actor", "", "List of Contract actors.", 0, java.lang.Integer.MAX_VALUE, actor)); - childrenList.add(new Property("valuedItem", "", "Contract Valued Item List.", 0, java.lang.Integer.MAX_VALUE, valuedItem)); - childrenList.add(new Property("signer", "", "Party signing this Contract.", 0, java.lang.Integer.MAX_VALUE, signer)); - childrenList.add(new Property("term", "", "One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.", 0, java.lang.Integer.MAX_VALUE, term)); - childrenList.add(new Property("binding[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireAnswers)", "Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the 'source of truth' and which would be the basis for legal action related to enforcement of this Contract.", 0, java.lang.Integer.MAX_VALUE, binding)); - childrenList.add(new Property("friendly", "", "The 'patient friendly language' versionof the Contract in whole or in parts. 'Patient friendly language' means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement.", 0, java.lang.Integer.MAX_VALUE, friendly)); - childrenList.add(new Property("legal", "", "List of Legal expressions or representations of this Contract.", 0, java.lang.Integer.MAX_VALUE, legal)); - childrenList.add(new Property("rule", "", "List of Computable Policy Rule Language Representations of this Contract.", 0, java.lang.Integer.MAX_VALUE, rule)); - } - - public Contract copy() { - Contract dst = new Contract(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.issued = issued == null ? null : issued.copy(); - dst.applies = applies == null ? null : applies.copy(); - if (subject != null) { - dst.subject = new ArrayList(); - for (Reference i : subject) - dst.subject.add(i.copy()); - }; - if (authority != null) { - dst.authority = new ArrayList(); - for (Reference i : authority) - dst.authority.add(i.copy()); - }; - if (domain != null) { - dst.domain = new ArrayList(); - for (Reference i : domain) - dst.domain.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - if (subType != null) { - dst.subType = new ArrayList(); - for (CodeableConcept i : subType) - dst.subType.add(i.copy()); - }; - if (action != null) { - dst.action = new ArrayList(); - for (CodeableConcept i : action) - dst.action.add(i.copy()); - }; - if (actionReason != null) { - dst.actionReason = new ArrayList(); - for (CodeableConcept i : actionReason) - dst.actionReason.add(i.copy()); - }; - if (actor != null) { - dst.actor = new ArrayList(); - for (ActorComponent i : actor) - dst.actor.add(i.copy()); - }; - if (valuedItem != null) { - dst.valuedItem = new ArrayList(); - for (ValuedItemComponent i : valuedItem) - dst.valuedItem.add(i.copy()); - }; - if (signer != null) { - dst.signer = new ArrayList(); - for (SignatoryComponent i : signer) - dst.signer.add(i.copy()); - }; - if (term != null) { - dst.term = new ArrayList(); - for (TermComponent i : term) - dst.term.add(i.copy()); - }; - dst.binding = binding == null ? null : binding.copy(); - if (friendly != null) { - dst.friendly = new ArrayList(); - for (FriendlyLanguageComponent i : friendly) - dst.friendly.add(i.copy()); - }; - if (legal != null) { - dst.legal = new ArrayList(); - for (LegalLanguageComponent i : legal) - dst.legal.add(i.copy()); - }; - if (rule != null) { - dst.rule = new ArrayList(); - for (ComputableLanguageComponent i : rule) - dst.rule.add(i.copy()); - }; - return dst; - } - - protected Contract typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Contract)) - return false; - Contract o = (Contract) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(issued, o.issued, true) && compareDeep(applies, o.applies, true) - && compareDeep(subject, o.subject, true) && compareDeep(authority, o.authority, true) && compareDeep(domain, o.domain, true) - && compareDeep(type, o.type, true) && compareDeep(subType, o.subType, true) && compareDeep(action, o.action, true) - && compareDeep(actionReason, o.actionReason, true) && compareDeep(actor, o.actor, true) && compareDeep(valuedItem, o.valuedItem, true) - && compareDeep(signer, o.signer, true) && compareDeep(term, o.term, true) && compareDeep(binding, o.binding, true) - && compareDeep(friendly, o.friendly, true) && compareDeep(legal, o.legal, true) && compareDeep(rule, o.rule, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Contract)) - return false; - Contract o = (Contract) other; - return compareValues(issued, o.issued, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (issued == null || issued.isEmpty()) - && (applies == null || applies.isEmpty()) && (subject == null || subject.isEmpty()) && (authority == null || authority.isEmpty()) - && (domain == null || domain.isEmpty()) && (type == null || type.isEmpty()) && (subType == null || subType.isEmpty()) - && (action == null || action.isEmpty()) && (actionReason == null || actionReason.isEmpty()) - && (actor == null || actor.isEmpty()) && (valuedItem == null || valuedItem.isEmpty()) && (signer == null || signer.isEmpty()) - && (term == null || term.isEmpty()) && (binding == null || binding.isEmpty()) && (friendly == null || friendly.isEmpty()) - && (legal == null || legal.isEmpty()) && (rule == null || rule.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Contract; - } - - @SearchParamDefinition(name="signer", path="Contract.signer.party", description="Contract Signatory Party", type="reference" ) - public static final String SP_SIGNER = "signer"; - @SearchParamDefinition(name="patient", path="Contract.subject", description="The identity of the target of the contract (if a patient)", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="subject", path="Contract.subject", description="The identity of the target of the contract", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="actor", path="Contract.actor.entity", description="Contract Actor Type", type="reference" ) - public static final String SP_ACTOR = "actor"; - @SearchParamDefinition(name="identifier", path="Contract.identifier", description="The identity of the contract", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import java.util.*; + +import java.math.*; +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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A formal agreement between parties regarding the conduct of business, exchange of information or other matters. + */ +@ResourceDef(name="Contract", profile="http://hl7.org/fhir/Profile/Contract") +public class Contract extends DomainResource { + + @Block() + public static class ActorComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Who or what actors are assigned roles in this Contract. + */ + @Child(name = "entity", type = {Contract.class, Device.class, Group.class, Location.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class, Substance.class, Supply.class}, order=1, min=1, max=1) + @Description(shortDefinition="Contract Actor Type", formalDefinition="Who or what actors are assigned roles in this Contract." ) + protected Reference entity; + + /** + * The actual object that is the target of the reference (Who or what actors are assigned roles in this Contract.) + */ + protected Resource entityTarget; + + /** + * Role type of actors assigned roles in this Contract. + */ + @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contract Actor Role", formalDefinition="Role type of actors assigned roles in this Contract." ) + protected List role; + + private static final long serialVersionUID = 1371245689L; + + /* + * Constructor + */ + public ActorComponent() { + super(); + } + + /* + * Constructor + */ + public ActorComponent(Reference entity) { + super(); + this.entity = entity; + } + + /** + * @return {@link #entity} (Who or what actors are assigned roles in this Contract.) + */ + public Reference getEntity() { + if (this.entity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ActorComponent.entity"); + else if (Configuration.doAutoCreate()) + this.entity = new Reference(); // cc + return this.entity; + } + + public boolean hasEntity() { + return this.entity != null && !this.entity.isEmpty(); + } + + /** + * @param value {@link #entity} (Who or what actors are assigned roles in this Contract.) + */ + public ActorComponent setEntity(Reference value) { + this.entity = value; + return this; + } + + /** + * @return {@link #entity} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who or what actors are assigned roles in this Contract.) + */ + public Resource getEntityTarget() { + return this.entityTarget; + } + + /** + * @param value {@link #entity} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who or what actors are assigned roles in this Contract.) + */ + public ActorComponent setEntityTarget(Resource value) { + this.entityTarget = value; + return this; + } + + /** + * @return {@link #role} (Role type of actors assigned roles in this Contract.) + */ + public List getRole() { + if (this.role == null) + this.role = new ArrayList(); + return this.role; + } + + public boolean hasRole() { + if (this.role == null) + return false; + for (CodeableConcept item : this.role) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #role} (Role type of actors assigned roles in this Contract.) + */ + // syntactic sugar + public CodeableConcept addRole() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.role == null) + this.role = new ArrayList(); + this.role.add(t); + return t; + } + + // syntactic sugar + public ActorComponent addRole(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.role == null) + this.role = new ArrayList(); + this.role.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("entity", "Reference(Contract|Device|Group|Location|Organization|Patient|Practitioner|RelatedPerson|Substance|Supply)", "Who or what actors are assigned roles in this Contract.", 0, java.lang.Integer.MAX_VALUE, entity)); + childrenList.add(new Property("role", "CodeableConcept", "Role type of actors assigned roles in this Contract.", 0, java.lang.Integer.MAX_VALUE, role)); + } + + public ActorComponent copy() { + ActorComponent dst = new ActorComponent(); + copyValues(dst); + dst.entity = entity == null ? null : entity.copy(); + if (role != null) { + dst.role = new ArrayList(); + for (CodeableConcept i : role) + dst.role.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ActorComponent)) + return false; + ActorComponent o = (ActorComponent) other; + return compareDeep(entity, o.entity, true) && compareDeep(role, o.role, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ActorComponent)) + return false; + ActorComponent o = (ActorComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (entity == null || entity.isEmpty()) && (role == null || role.isEmpty()) + ; + } + + } + + @Block() + public static class ValuedItemComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Specific type of Contract Valued Item that may be priced. + */ + @Child(name = "entity", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Contract Valued Item Type", formalDefinition="Specific type of Contract Valued Item that may be priced." ) + protected Type entity; + + /** + * Identifies a Contract Valued Item instance. + */ + @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=1) + @Description(shortDefinition="Contract Valued Item Identifier", formalDefinition="Identifies a Contract Valued Item instance." ) + protected Identifier identifier; + + /** + * Indicates the time during which this Contract ValuedItem information is effective. + */ + @Child(name = "effectiveTime", type = {DateTimeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Contract Valued Item Effective Tiem", formalDefinition="Indicates the time during which this Contract ValuedItem information is effective." ) + protected DateTimeType effectiveTime; + + /** + * Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances. + */ + @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Count of Contract Valued Items", formalDefinition="Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances." ) + protected Quantity quantity; + + /** + * A Contract Valued Item unit valuation measure. + */ + @Child(name = "unitPrice", type = {Money.class}, order=5, min=0, max=1) + @Description(shortDefinition="Contract Valued Item fee, charge, or cost", formalDefinition="A Contract Valued Item unit valuation measure." ) + protected Money unitPrice; + + /** + * A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + @Child(name = "factor", type = {DecimalType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Contract Valued Item Price Scaling Factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) + protected DecimalType factor; + + /** + * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point. + */ + @Child(name = "points", type = {DecimalType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Contract Valued Item Difficulty Scaling Factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point." ) + protected DecimalType points; + + /** + * Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + */ + @Child(name = "net", type = {Money.class}, order=8, min=0, max=1) + @Description(shortDefinition="Total Contract Valued Item Value", formalDefinition="Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) + protected Money net; + + private static final long serialVersionUID = 1311183770L; + + /* + * Constructor + */ + public ValuedItemComponent() { + super(); + } + + /** + * @return {@link #entity} (Specific type of Contract Valued Item that may be priced.) + */ + public Type getEntity() { + return this.entity; + } + + /** + * @return {@link #entity} (Specific type of Contract Valued Item that may be priced.) + */ + public CodeableConcept getEntityCodeableConcept() throws Exception { + if (!(this.entity instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.entity.getClass().getName()+" was encountered"); + return (CodeableConcept) this.entity; + } + + /** + * @return {@link #entity} (Specific type of Contract Valued Item that may be priced.) + */ + public Reference getEntityReference() throws Exception { + if (!(this.entity instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.entity.getClass().getName()+" was encountered"); + return (Reference) this.entity; + } + + public boolean hasEntity() { + return this.entity != null && !this.entity.isEmpty(); + } + + /** + * @param value {@link #entity} (Specific type of Contract Valued Item that may be priced.) + */ + public ValuedItemComponent setEntity(Type value) { + this.entity = value; + return this; + } + + /** + * @return {@link #identifier} (Identifies a Contract Valued Item instance.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValuedItemComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifies a Contract Valued Item instance.) + */ + public ValuedItemComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #effectiveTime} (Indicates the time during which this Contract ValuedItem information is effective.). This is the underlying object with id, value and extensions. The accessor "getEffectiveTime" gives direct access to the value + */ + public DateTimeType getEffectiveTimeElement() { + if (this.effectiveTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValuedItemComponent.effectiveTime"); + else if (Configuration.doAutoCreate()) + this.effectiveTime = new DateTimeType(); // bb + return this.effectiveTime; + } + + public boolean hasEffectiveTimeElement() { + return this.effectiveTime != null && !this.effectiveTime.isEmpty(); + } + + public boolean hasEffectiveTime() { + return this.effectiveTime != null && !this.effectiveTime.isEmpty(); + } + + /** + * @param value {@link #effectiveTime} (Indicates the time during which this Contract ValuedItem information is effective.). This is the underlying object with id, value and extensions. The accessor "getEffectiveTime" gives direct access to the value + */ + public ValuedItemComponent setEffectiveTimeElement(DateTimeType value) { + this.effectiveTime = value; + return this; + } + + /** + * @return Indicates the time during which this Contract ValuedItem information is effective. + */ + public Date getEffectiveTime() { + return this.effectiveTime == null ? null : this.effectiveTime.getValue(); + } + + /** + * @param value Indicates the time during which this Contract ValuedItem information is effective. + */ + public ValuedItemComponent setEffectiveTime(Date value) { + if (value == null) + this.effectiveTime = null; + else { + if (this.effectiveTime == null) + this.effectiveTime = new DateTimeType(); + this.effectiveTime.setValue(value); + } + return this; + } + + /** + * @return {@link #quantity} (Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValuedItemComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.) + */ + public ValuedItemComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (A Contract Valued Item unit valuation measure.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValuedItemComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); // cc + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (A Contract Valued Item unit valuation measure.) + */ + public ValuedItemComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValuedItemComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); // bb + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public ValuedItemComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public ValuedItemComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValuedItemComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); // bb + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public ValuedItemComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point. + */ + public ValuedItemComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValuedItemComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); // cc + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public ValuedItemComponent setNet(Money value) { + this.net = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("entity[x]", "CodeableConcept|Reference(Any)", "Specific type of Contract Valued Item that may be priced.", 0, java.lang.Integer.MAX_VALUE, entity)); + childrenList.add(new Property("identifier", "Identifier", "Identifies a Contract Valued Item instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("effectiveTime", "dateTime", "Indicates the time during which this Contract ValuedItem information is effective.", 0, java.lang.Integer.MAX_VALUE, effectiveTime)); + childrenList.add(new Property("quantity", "Quantity", "Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "A Contract Valued Item unit valuation measure.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); + } + + public ValuedItemComponent copy() { + ValuedItemComponent dst = new ValuedItemComponent(); + copyValues(dst); + dst.entity = entity == null ? null : entity.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.effectiveTime = effectiveTime == null ? null : effectiveTime.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ValuedItemComponent)) + return false; + ValuedItemComponent o = (ValuedItemComponent) other; + return compareDeep(entity, o.entity, true) && compareDeep(identifier, o.identifier, true) && compareDeep(effectiveTime, o.effectiveTime, true) + && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true) + && compareDeep(points, o.points, true) && compareDeep(net, o.net, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ValuedItemComponent)) + return false; + ValuedItemComponent o = (ValuedItemComponent) other; + return compareValues(effectiveTime, o.effectiveTime, true) && compareValues(factor, o.factor, true) + && compareValues(points, o.points, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (entity == null || entity.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (effectiveTime == null || effectiveTime.isEmpty()) && (quantity == null || quantity.isEmpty()) + && (unitPrice == null || unitPrice.isEmpty()) && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) + && (net == null || net.isEmpty()); + } + + } + + @Block() + public static class SignatoryComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Role of this Contract signer, e.g., notary, grantee. + */ + @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Contract Signer Type", formalDefinition="Role of this Contract signer, e.g., notary, grantee." ) + protected Coding type; + + /** + * Party which is a signator to this Contract. + */ + @Child(name = "party", type = {Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=2, min=1, max=1) + @Description(shortDefinition="Contract Signatory Party", formalDefinition="Party which is a signator to this Contract." ) + protected Reference party; + + /** + * The actual object that is the target of the reference (Party which is a signator to this Contract.) + */ + protected Resource partyTarget; + + /** + * Legally binding Contract DSIG signature contents in Base64. + */ + @Child(name = "signature", type = {StringType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Contract Documentation Signature", formalDefinition="Legally binding Contract DSIG signature contents in Base64." ) + protected StringType signature; + + private static final long serialVersionUID = -1870392043L; + + /* + * Constructor + */ + public SignatoryComponent() { + super(); + } + + /* + * Constructor + */ + public SignatoryComponent(Coding type, Reference party, StringType signature) { + super(); + this.type = type; + this.party = party; + this.signature = signature; + } + + /** + * @return {@link #type} (Role of this Contract signer, e.g., notary, grantee.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SignatoryComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Role of this Contract signer, e.g., notary, grantee.) + */ + public SignatoryComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #party} (Party which is a signator to this Contract.) + */ + public Reference getParty() { + if (this.party == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SignatoryComponent.party"); + else if (Configuration.doAutoCreate()) + this.party = new Reference(); // cc + return this.party; + } + + public boolean hasParty() { + return this.party != null && !this.party.isEmpty(); + } + + /** + * @param value {@link #party} (Party which is a signator to this Contract.) + */ + public SignatoryComponent setParty(Reference value) { + this.party = value; + return this; + } + + /** + * @return {@link #party} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Party which is a signator to this Contract.) + */ + public Resource getPartyTarget() { + return this.partyTarget; + } + + /** + * @param value {@link #party} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Party which is a signator to this Contract.) + */ + public SignatoryComponent setPartyTarget(Resource value) { + this.partyTarget = value; + return this; + } + + /** + * @return {@link #signature} (Legally binding Contract DSIG signature contents in Base64.). This is the underlying object with id, value and extensions. The accessor "getSignature" gives direct access to the value + */ + public StringType getSignatureElement() { + if (this.signature == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SignatoryComponent.signature"); + else if (Configuration.doAutoCreate()) + this.signature = new StringType(); // bb + return this.signature; + } + + public boolean hasSignatureElement() { + return this.signature != null && !this.signature.isEmpty(); + } + + public boolean hasSignature() { + return this.signature != null && !this.signature.isEmpty(); + } + + /** + * @param value {@link #signature} (Legally binding Contract DSIG signature contents in Base64.). This is the underlying object with id, value and extensions. The accessor "getSignature" gives direct access to the value + */ + public SignatoryComponent setSignatureElement(StringType value) { + this.signature = value; + return this; + } + + /** + * @return Legally binding Contract DSIG signature contents in Base64. + */ + public String getSignature() { + return this.signature == null ? null : this.signature.getValue(); + } + + /** + * @param value Legally binding Contract DSIG signature contents in Base64. + */ + public SignatoryComponent setSignature(String value) { + if (this.signature == null) + this.signature = new StringType(); + this.signature.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Role of this Contract signer, e.g., notary, grantee.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("party", "Reference(Organization|Patient|Practitioner|RelatedPerson)", "Party which is a signator to this Contract.", 0, java.lang.Integer.MAX_VALUE, party)); + childrenList.add(new Property("signature", "string", "Legally binding Contract DSIG signature contents in Base64.", 0, java.lang.Integer.MAX_VALUE, signature)); + } + + public SignatoryComponent copy() { + SignatoryComponent dst = new SignatoryComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.party = party == null ? null : party.copy(); + dst.signature = signature == null ? null : signature.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SignatoryComponent)) + return false; + SignatoryComponent o = (SignatoryComponent) other; + return compareDeep(type, o.type, true) && compareDeep(party, o.party, true) && compareDeep(signature, o.signature, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SignatoryComponent)) + return false; + SignatoryComponent o = (SignatoryComponent) other; + return compareValues(signature, o.signature, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (party == null || party.isEmpty()) + && (signature == null || signature.isEmpty()); + } + + } + + @Block() + public static class TermComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Unique identifier for this particular Contract Provision. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) + @Description(shortDefinition="Contract Term identifier", formalDefinition="Unique identifier for this particular Contract Provision." ) + protected Identifier identifier; + + /** + * When this Contract Provision was issued. + */ + @Child(name = "issued", type = {DateTimeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Contract Term Issue Date Time", formalDefinition="When this Contract Provision was issued." ) + protected DateTimeType issued; + + /** + * Relevant time or time-period when this Contract Provision is applicable. + */ + @Child(name = "applies", type = {Period.class}, order=3, min=0, max=1) + @Description(shortDefinition="Contract Term Effective Time", formalDefinition="Relevant time or time-period when this Contract Provision is applicable." ) + protected Period applies; + + /** + * Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g., life time maximum benefit. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=1) + @Description(shortDefinition="Contract Term Type", formalDefinition="Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g., life time maximum benefit." ) + protected CodeableConcept type; + + /** + * Subtype of this Contract Provision, e.g., life time maximum payment for a contract term for specific valued item, e.g., disability payment. + */ + @Child(name = "subType", type = {CodeableConcept.class}, order=5, min=0, max=1) + @Description(shortDefinition="Contract Term Subtype", formalDefinition="Subtype of this Contract Provision, e.g., life time maximum payment for a contract term for specific valued item, e.g., disability payment." ) + protected CodeableConcept subType; + + /** + * Who or what this Contract Provision is about. + */ + @Child(name = "subject", type = {}, order=6, min=0, max=1) + @Description(shortDefinition="Subject of this Contract Term", formalDefinition="Who or what this Contract Provision is about." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Who or what this Contract Provision is about.) + */ + protected Resource subjectTarget; + + /** + * Action stipulated by this Contract Provision. + */ + @Child(name = "action", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contract Term Action", formalDefinition="Action stipulated by this Contract Provision." ) + protected List action; + + /** + * Reason or purpose for the action stipulated by this Contract Provision. + */ + @Child(name = "actionReason", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contract Term Action Reason", formalDefinition="Reason or purpose for the action stipulated by this Contract Provision." ) + protected List actionReason; + + /** + * List of actors participating in this Contract Provision. + */ + @Child(name = "actor", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contract Term Actor List", formalDefinition="List of actors participating in this Contract Provision." ) + protected List actor; + + /** + * Human readable form of this Contract Provision. + */ + @Child(name = "text", type = {StringType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Human readable Contract term text", formalDefinition="Human readable form of this Contract Provision." ) + protected StringType text; + + /** + * Contract Provision Valued Item List. + */ + @Child(name = "valuedItem", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contract Term Valued Item", formalDefinition="Contract Provision Valued Item List." ) + protected List valuedItem; + + /** + * Nested group of Contract Provisions. + */ + @Child(name = "group", type = {TermComponent.class}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Nested Contract Term Group", formalDefinition="Nested group of Contract Provisions." ) + protected List group; + + private static final long serialVersionUID = -1137577465L; + + /* + * Constructor + */ + public TermComponent() { + super(); + } + + /** + * @return {@link #identifier} (Unique identifier for this particular Contract Provision.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Unique identifier for this particular Contract Provision.) + */ + public TermComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #issued} (When this Contract Provision was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public DateTimeType getIssuedElement() { + if (this.issued == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermComponent.issued"); + else if (Configuration.doAutoCreate()) + this.issued = new DateTimeType(); // bb + return this.issued; + } + + public boolean hasIssuedElement() { + return this.issued != null && !this.issued.isEmpty(); + } + + public boolean hasIssued() { + return this.issued != null && !this.issued.isEmpty(); + } + + /** + * @param value {@link #issued} (When this Contract Provision was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public TermComponent setIssuedElement(DateTimeType value) { + this.issued = value; + return this; + } + + /** + * @return When this Contract Provision was issued. + */ + public Date getIssued() { + return this.issued == null ? null : this.issued.getValue(); + } + + /** + * @param value When this Contract Provision was issued. + */ + public TermComponent setIssued(Date value) { + if (value == null) + this.issued = null; + else { + if (this.issued == null) + this.issued = new DateTimeType(); + this.issued.setValue(value); + } + return this; + } + + /** + * @return {@link #applies} (Relevant time or time-period when this Contract Provision is applicable.) + */ + public Period getApplies() { + if (this.applies == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermComponent.applies"); + else if (Configuration.doAutoCreate()) + this.applies = new Period(); // cc + return this.applies; + } + + public boolean hasApplies() { + return this.applies != null && !this.applies.isEmpty(); + } + + /** + * @param value {@link #applies} (Relevant time or time-period when this Contract Provision is applicable.) + */ + public TermComponent setApplies(Period value) { + this.applies = value; + return this; + } + + /** + * @return {@link #type} (Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g., life time maximum benefit.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g., life time maximum benefit.) + */ + public TermComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #subType} (Subtype of this Contract Provision, e.g., life time maximum payment for a contract term for specific valued item, e.g., disability payment.) + */ + public CodeableConcept getSubType() { + if (this.subType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermComponent.subType"); + else if (Configuration.doAutoCreate()) + this.subType = new CodeableConcept(); // cc + return this.subType; + } + + public boolean hasSubType() { + return this.subType != null && !this.subType.isEmpty(); + } + + /** + * @param value {@link #subType} (Subtype of this Contract Provision, e.g., life time maximum payment for a contract term for specific valued item, e.g., disability payment.) + */ + public TermComponent setSubType(CodeableConcept value) { + this.subType = value; + return this; + } + + /** + * @return {@link #subject} (Who or what this Contract Provision is about.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermComponent.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Who or what this Contract Provision is about.) + */ + public TermComponent setSubject(Reference value) { + this.subject = value; + return this; + } + + /** + * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who or what this Contract Provision is about.) + */ + public Resource getSubjectTarget() { + return this.subjectTarget; + } + + /** + * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who or what this Contract Provision is about.) + */ + public TermComponent setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #action} (Action stipulated by this Contract Provision.) + */ + public List getAction() { + if (this.action == null) + this.action = new ArrayList(); + return this.action; + } + + public boolean hasAction() { + if (this.action == null) + return false; + for (CodeableConcept item : this.action) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #action} (Action stipulated by this Contract Provision.) + */ + // syntactic sugar + public CodeableConcept addAction() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return t; + } + + // syntactic sugar + public TermComponent addAction(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return this; + } + + /** + * @return {@link #actionReason} (Reason or purpose for the action stipulated by this Contract Provision.) + */ + public List getActionReason() { + if (this.actionReason == null) + this.actionReason = new ArrayList(); + return this.actionReason; + } + + public boolean hasActionReason() { + if (this.actionReason == null) + return false; + for (CodeableConcept item : this.actionReason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #actionReason} (Reason or purpose for the action stipulated by this Contract Provision.) + */ + // syntactic sugar + public CodeableConcept addActionReason() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.actionReason == null) + this.actionReason = new ArrayList(); + this.actionReason.add(t); + return t; + } + + // syntactic sugar + public TermComponent addActionReason(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.actionReason == null) + this.actionReason = new ArrayList(); + this.actionReason.add(t); + return this; + } + + /** + * @return {@link #actor} (List of actors participating in this Contract Provision.) + */ + public List getActor() { + if (this.actor == null) + this.actor = new ArrayList(); + return this.actor; + } + + public boolean hasActor() { + if (this.actor == null) + return false; + for (TermActorComponent item : this.actor) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #actor} (List of actors participating in this Contract Provision.) + */ + // syntactic sugar + public TermActorComponent addActor() { //3 + TermActorComponent t = new TermActorComponent(); + if (this.actor == null) + this.actor = new ArrayList(); + this.actor.add(t); + return t; + } + + // syntactic sugar + public TermComponent addActor(TermActorComponent t) { //3 + if (t == null) + return this; + if (this.actor == null) + this.actor = new ArrayList(); + this.actor.add(t); + return this; + } + + /** + * @return {@link #text} (Human readable form of this Contract Provision.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Human readable form of this Contract Provision.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public TermComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Human readable form of this Contract Provision. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Human readable form of this Contract Provision. + */ + public TermComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #valuedItem} (Contract Provision Valued Item List.) + */ + public List getValuedItem() { + if (this.valuedItem == null) + this.valuedItem = new ArrayList(); + return this.valuedItem; + } + + public boolean hasValuedItem() { + if (this.valuedItem == null) + return false; + for (TermValuedItemComponent item : this.valuedItem) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #valuedItem} (Contract Provision Valued Item List.) + */ + // syntactic sugar + public TermValuedItemComponent addValuedItem() { //3 + TermValuedItemComponent t = new TermValuedItemComponent(); + if (this.valuedItem == null) + this.valuedItem = new ArrayList(); + this.valuedItem.add(t); + return t; + } + + // syntactic sugar + public TermComponent addValuedItem(TermValuedItemComponent t) { //3 + if (t == null) + return this; + if (this.valuedItem == null) + this.valuedItem = new ArrayList(); + this.valuedItem.add(t); + return this; + } + + /** + * @return {@link #group} (Nested group of Contract Provisions.) + */ + public List getGroup() { + if (this.group == null) + this.group = new ArrayList(); + return this.group; + } + + public boolean hasGroup() { + if (this.group == null) + return false; + for (TermComponent item : this.group) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #group} (Nested group of Contract Provisions.) + */ + // syntactic sugar + public TermComponent addGroup() { //3 + TermComponent t = new TermComponent(); + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return t; + } + + // syntactic sugar + public TermComponent addGroup(TermComponent t) { //3 + if (t == null) + return this; + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Unique identifier for this particular Contract Provision.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("issued", "dateTime", "When this Contract Provision was issued.", 0, java.lang.Integer.MAX_VALUE, issued)); + childrenList.add(new Property("applies", "Period", "Relevant time or time-period when this Contract Provision is applicable.", 0, java.lang.Integer.MAX_VALUE, applies)); + childrenList.add(new Property("type", "CodeableConcept", "Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g., life time maximum benefit.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("subType", "CodeableConcept", "Subtype of this Contract Provision, e.g., life time maximum payment for a contract term for specific valued item, e.g., disability payment.", 0, java.lang.Integer.MAX_VALUE, subType)); + childrenList.add(new Property("subject", "Reference(Any)", "Who or what this Contract Provision is about.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("action", "CodeableConcept", "Action stipulated by this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, action)); + childrenList.add(new Property("actionReason", "CodeableConcept", "Reason or purpose for the action stipulated by this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, actionReason)); + childrenList.add(new Property("actor", "", "List of actors participating in this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, actor)); + childrenList.add(new Property("text", "string", "Human readable form of this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("valuedItem", "", "Contract Provision Valued Item List.", 0, java.lang.Integer.MAX_VALUE, valuedItem)); + childrenList.add(new Property("group", "@Contract.term", "Nested group of Contract Provisions.", 0, java.lang.Integer.MAX_VALUE, group)); + } + + public TermComponent copy() { + TermComponent dst = new TermComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.issued = issued == null ? null : issued.copy(); + dst.applies = applies == null ? null : applies.copy(); + dst.type = type == null ? null : type.copy(); + dst.subType = subType == null ? null : subType.copy(); + dst.subject = subject == null ? null : subject.copy(); + if (action != null) { + dst.action = new ArrayList(); + for (CodeableConcept i : action) + dst.action.add(i.copy()); + }; + if (actionReason != null) { + dst.actionReason = new ArrayList(); + for (CodeableConcept i : actionReason) + dst.actionReason.add(i.copy()); + }; + if (actor != null) { + dst.actor = new ArrayList(); + for (TermActorComponent i : actor) + dst.actor.add(i.copy()); + }; + dst.text = text == null ? null : text.copy(); + if (valuedItem != null) { + dst.valuedItem = new ArrayList(); + for (TermValuedItemComponent i : valuedItem) + dst.valuedItem.add(i.copy()); + }; + if (group != null) { + dst.group = new ArrayList(); + for (TermComponent i : group) + dst.group.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TermComponent)) + return false; + TermComponent o = (TermComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(issued, o.issued, true) && compareDeep(applies, o.applies, true) + && compareDeep(type, o.type, true) && compareDeep(subType, o.subType, true) && compareDeep(subject, o.subject, true) + && compareDeep(action, o.action, true) && compareDeep(actionReason, o.actionReason, true) && compareDeep(actor, o.actor, true) + && compareDeep(text, o.text, true) && compareDeep(valuedItem, o.valuedItem, true) && compareDeep(group, o.group, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TermComponent)) + return false; + TermComponent o = (TermComponent) other; + return compareValues(issued, o.issued, true) && compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (issued == null || issued.isEmpty()) + && (applies == null || applies.isEmpty()) && (type == null || type.isEmpty()) && (subType == null || subType.isEmpty()) + && (subject == null || subject.isEmpty()) && (action == null || action.isEmpty()) && (actionReason == null || actionReason.isEmpty()) + && (actor == null || actor.isEmpty()) && (text == null || text.isEmpty()) && (valuedItem == null || valuedItem.isEmpty()) + && (group == null || group.isEmpty()); + } + + } + + @Block() + public static class TermActorComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The actor assigned a role in this Contract Provision. + */ + @Child(name = "entity", type = {Contract.class, Device.class, Group.class, Location.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class, Substance.class, Supply.class}, order=1, min=1, max=1) + @Description(shortDefinition="Contract Term Actor", formalDefinition="The actor assigned a role in this Contract Provision." ) + protected Reference entity; + + /** + * The actual object that is the target of the reference (The actor assigned a role in this Contract Provision.) + */ + protected Resource entityTarget; + + /** + * Role played by the actor assigned this role in this Contract Provision. + */ + @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contract Term Actor Role", formalDefinition="Role played by the actor assigned this role in this Contract Provision." ) + protected List role; + + private static final long serialVersionUID = 1371245689L; + + /* + * Constructor + */ + public TermActorComponent() { + super(); + } + + /* + * Constructor + */ + public TermActorComponent(Reference entity) { + super(); + this.entity = entity; + } + + /** + * @return {@link #entity} (The actor assigned a role in this Contract Provision.) + */ + public Reference getEntity() { + if (this.entity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermActorComponent.entity"); + else if (Configuration.doAutoCreate()) + this.entity = new Reference(); // cc + return this.entity; + } + + public boolean hasEntity() { + return this.entity != null && !this.entity.isEmpty(); + } + + /** + * @param value {@link #entity} (The actor assigned a role in this Contract Provision.) + */ + public TermActorComponent setEntity(Reference value) { + this.entity = value; + return this; + } + + /** + * @return {@link #entity} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The actor assigned a role in this Contract Provision.) + */ + public Resource getEntityTarget() { + return this.entityTarget; + } + + /** + * @param value {@link #entity} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The actor assigned a role in this Contract Provision.) + */ + public TermActorComponent setEntityTarget(Resource value) { + this.entityTarget = value; + return this; + } + + /** + * @return {@link #role} (Role played by the actor assigned this role in this Contract Provision.) + */ + public List getRole() { + if (this.role == null) + this.role = new ArrayList(); + return this.role; + } + + public boolean hasRole() { + if (this.role == null) + return false; + for (CodeableConcept item : this.role) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #role} (Role played by the actor assigned this role in this Contract Provision.) + */ + // syntactic sugar + public CodeableConcept addRole() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.role == null) + this.role = new ArrayList(); + this.role.add(t); + return t; + } + + // syntactic sugar + public TermActorComponent addRole(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.role == null) + this.role = new ArrayList(); + this.role.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("entity", "Reference(Contract|Device|Group|Location|Organization|Patient|Practitioner|RelatedPerson|Substance|Supply)", "The actor assigned a role in this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, entity)); + childrenList.add(new Property("role", "CodeableConcept", "Role played by the actor assigned this role in this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, role)); + } + + public TermActorComponent copy() { + TermActorComponent dst = new TermActorComponent(); + copyValues(dst); + dst.entity = entity == null ? null : entity.copy(); + if (role != null) { + dst.role = new ArrayList(); + for (CodeableConcept i : role) + dst.role.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TermActorComponent)) + return false; + TermActorComponent o = (TermActorComponent) other; + return compareDeep(entity, o.entity, true) && compareDeep(role, o.role, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TermActorComponent)) + return false; + TermActorComponent o = (TermActorComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (entity == null || entity.isEmpty()) && (role == null || role.isEmpty()) + ; + } + + } + + @Block() + public static class TermValuedItemComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Specific type of Contract Provision Valued Item that may be priced. + */ + @Child(name = "entity", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Contract Term Valued Item Type", formalDefinition="Specific type of Contract Provision Valued Item that may be priced." ) + protected Type entity; + + /** + * Identifies a Contract Provision Valued Item instance. + */ + @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=1) + @Description(shortDefinition="Contract Term Valued Item Identifier", formalDefinition="Identifies a Contract Provision Valued Item instance." ) + protected Identifier identifier; + + /** + * Indicates the time during which this Contract Term ValuedItem information is effective. + */ + @Child(name = "effectiveTime", type = {DateTimeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Contract Term Valued Item Effective Tiem", formalDefinition="Indicates the time during which this Contract Term ValuedItem information is effective." ) + protected DateTimeType effectiveTime; + + /** + * Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances. + */ + @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Contract Term Valued Item Count", formalDefinition="Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances." ) + protected Quantity quantity; + + /** + * A Contract Provision Valued Item unit valuation measure. + */ + @Child(name = "unitPrice", type = {Money.class}, order=5, min=0, max=1) + @Description(shortDefinition="Contract Term Valued Item fee, charge, or cost", formalDefinition="A Contract Provision Valued Item unit valuation measure." ) + protected Money unitPrice; + + /** + * A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + @Child(name = "factor", type = {DecimalType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Contract Term Valued Item Price Scaling Factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) + protected DecimalType factor; + + /** + * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point. + */ + @Child(name = "points", type = {DecimalType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Contract Term Valued Item Difficulty Scaling Factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point." ) + protected DecimalType points; + + /** + * Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + */ + @Child(name = "net", type = {Money.class}, order=8, min=0, max=1) + @Description(shortDefinition="Total Contract Term Valued Item Value", formalDefinition="Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) + protected Money net; + + private static final long serialVersionUID = 1311183770L; + + /* + * Constructor + */ + public TermValuedItemComponent() { + super(); + } + + /** + * @return {@link #entity} (Specific type of Contract Provision Valued Item that may be priced.) + */ + public Type getEntity() { + return this.entity; + } + + /** + * @return {@link #entity} (Specific type of Contract Provision Valued Item that may be priced.) + */ + public CodeableConcept getEntityCodeableConcept() throws Exception { + if (!(this.entity instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.entity.getClass().getName()+" was encountered"); + return (CodeableConcept) this.entity; + } + + /** + * @return {@link #entity} (Specific type of Contract Provision Valued Item that may be priced.) + */ + public Reference getEntityReference() throws Exception { + if (!(this.entity instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.entity.getClass().getName()+" was encountered"); + return (Reference) this.entity; + } + + public boolean hasEntity() { + return this.entity != null && !this.entity.isEmpty(); + } + + /** + * @param value {@link #entity} (Specific type of Contract Provision Valued Item that may be priced.) + */ + public TermValuedItemComponent setEntity(Type value) { + this.entity = value; + return this; + } + + /** + * @return {@link #identifier} (Identifies a Contract Provision Valued Item instance.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermValuedItemComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifies a Contract Provision Valued Item instance.) + */ + public TermValuedItemComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #effectiveTime} (Indicates the time during which this Contract Term ValuedItem information is effective.). This is the underlying object with id, value and extensions. The accessor "getEffectiveTime" gives direct access to the value + */ + public DateTimeType getEffectiveTimeElement() { + if (this.effectiveTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermValuedItemComponent.effectiveTime"); + else if (Configuration.doAutoCreate()) + this.effectiveTime = new DateTimeType(); // bb + return this.effectiveTime; + } + + public boolean hasEffectiveTimeElement() { + return this.effectiveTime != null && !this.effectiveTime.isEmpty(); + } + + public boolean hasEffectiveTime() { + return this.effectiveTime != null && !this.effectiveTime.isEmpty(); + } + + /** + * @param value {@link #effectiveTime} (Indicates the time during which this Contract Term ValuedItem information is effective.). This is the underlying object with id, value and extensions. The accessor "getEffectiveTime" gives direct access to the value + */ + public TermValuedItemComponent setEffectiveTimeElement(DateTimeType value) { + this.effectiveTime = value; + return this; + } + + /** + * @return Indicates the time during which this Contract Term ValuedItem information is effective. + */ + public Date getEffectiveTime() { + return this.effectiveTime == null ? null : this.effectiveTime.getValue(); + } + + /** + * @param value Indicates the time during which this Contract Term ValuedItem information is effective. + */ + public TermValuedItemComponent setEffectiveTime(Date value) { + if (value == null) + this.effectiveTime = null; + else { + if (this.effectiveTime == null) + this.effectiveTime = new DateTimeType(); + this.effectiveTime.setValue(value); + } + return this; + } + + /** + * @return {@link #quantity} (Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermValuedItemComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances.) + */ + public TermValuedItemComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (A Contract Provision Valued Item unit valuation measure.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermValuedItemComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); // cc + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (A Contract Provision Valued Item unit valuation measure.) + */ + public TermValuedItemComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermValuedItemComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); // bb + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public TermValuedItemComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public TermValuedItemComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermValuedItemComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); // bb + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public TermValuedItemComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point. + */ + public TermValuedItemComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermValuedItemComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); // cc + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public TermValuedItemComponent setNet(Money value) { + this.net = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("entity[x]", "CodeableConcept|Reference(Any)", "Specific type of Contract Provision Valued Item that may be priced.", 0, java.lang.Integer.MAX_VALUE, entity)); + childrenList.add(new Property("identifier", "Identifier", "Identifies a Contract Provision Valued Item instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("effectiveTime", "dateTime", "Indicates the time during which this Contract Term ValuedItem information is effective.", 0, java.lang.Integer.MAX_VALUE, effectiveTime)); + childrenList.add(new Property("quantity", "Quantity", "Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "A Contract Provision Valued Item unit valuation measure.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); + } + + public TermValuedItemComponent copy() { + TermValuedItemComponent dst = new TermValuedItemComponent(); + copyValues(dst); + dst.entity = entity == null ? null : entity.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.effectiveTime = effectiveTime == null ? null : effectiveTime.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TermValuedItemComponent)) + return false; + TermValuedItemComponent o = (TermValuedItemComponent) other; + return compareDeep(entity, o.entity, true) && compareDeep(identifier, o.identifier, true) && compareDeep(effectiveTime, o.effectiveTime, true) + && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true) + && compareDeep(points, o.points, true) && compareDeep(net, o.net, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TermValuedItemComponent)) + return false; + TermValuedItemComponent o = (TermValuedItemComponent) other; + return compareValues(effectiveTime, o.effectiveTime, true) && compareValues(factor, o.factor, true) + && compareValues(points, o.points, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (entity == null || entity.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (effectiveTime == null || effectiveTime.isEmpty()) && (quantity == null || quantity.isEmpty()) + && (unitPrice == null || unitPrice.isEmpty()) && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) + && (net == null || net.isEmpty()); + } + + } + + @Block() + public static class FriendlyLanguageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability. + */ + @Child(name = "content", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireAnswers.class}, order=1, min=1, max=1) + @Description(shortDefinition="Easily comprehended representation of this Contract", formalDefinition="Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability." ) + protected Type content; + + private static final long serialVersionUID = -1763459053L; + + /* + * Constructor + */ + public FriendlyLanguageComponent() { + super(); + } + + /* + * Constructor + */ + public FriendlyLanguageComponent(Type content) { + super(); + this.content = content; + } + + /** + * @return {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.) + */ + public Type getContent() { + return this.content; + } + + /** + * @return {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.) + */ + public Attachment getContentAttachment() throws Exception { + if (!(this.content instanceof Attachment)) + throw new Exception("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Attachment) this.content; + } + + /** + * @return {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.) + */ + public Reference getContentReference() throws Exception { + if (!(this.content instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Reference) this.content; + } + + public boolean hasContent() { + return this.content != null && !this.content.isEmpty(); + } + + /** + * @param value {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.) + */ + public FriendlyLanguageComponent setContent(Type value) { + this.content = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireAnswers)", "Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.", 0, java.lang.Integer.MAX_VALUE, content)); + } + + public FriendlyLanguageComponent copy() { + FriendlyLanguageComponent dst = new FriendlyLanguageComponent(); + copyValues(dst); + dst.content = content == null ? null : content.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof FriendlyLanguageComponent)) + return false; + FriendlyLanguageComponent o = (FriendlyLanguageComponent) other; + return compareDeep(content, o.content, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof FriendlyLanguageComponent)) + return false; + FriendlyLanguageComponent o = (FriendlyLanguageComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (content == null || content.isEmpty()); + } + + } + + @Block() + public static class LegalLanguageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Contract legal text in human renderable form. + */ + @Child(name = "content", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireAnswers.class}, order=1, min=1, max=1) + @Description(shortDefinition="Contract Legal Text", formalDefinition="Contract legal text in human renderable form." ) + protected Type content; + + private static final long serialVersionUID = -1763459053L; + + /* + * Constructor + */ + public LegalLanguageComponent() { + super(); + } + + /* + * Constructor + */ + public LegalLanguageComponent(Type content) { + super(); + this.content = content; + } + + /** + * @return {@link #content} (Contract legal text in human renderable form.) + */ + public Type getContent() { + return this.content; + } + + /** + * @return {@link #content} (Contract legal text in human renderable form.) + */ + public Attachment getContentAttachment() throws Exception { + if (!(this.content instanceof Attachment)) + throw new Exception("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Attachment) this.content; + } + + /** + * @return {@link #content} (Contract legal text in human renderable form.) + */ + public Reference getContentReference() throws Exception { + if (!(this.content instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Reference) this.content; + } + + public boolean hasContent() { + return this.content != null && !this.content.isEmpty(); + } + + /** + * @param value {@link #content} (Contract legal text in human renderable form.) + */ + public LegalLanguageComponent setContent(Type value) { + this.content = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireAnswers)", "Contract legal text in human renderable form.", 0, java.lang.Integer.MAX_VALUE, content)); + } + + public LegalLanguageComponent copy() { + LegalLanguageComponent dst = new LegalLanguageComponent(); + copyValues(dst); + dst.content = content == null ? null : content.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof LegalLanguageComponent)) + return false; + LegalLanguageComponent o = (LegalLanguageComponent) other; + return compareDeep(content, o.content, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof LegalLanguageComponent)) + return false; + LegalLanguageComponent o = (LegalLanguageComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (content == null || content.isEmpty()); + } + + } + + @Block() + public static class ComputableLanguageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal). + */ + @Child(name = "content", type = {Attachment.class, DocumentReference.class}, order=1, min=1, max=1) + @Description(shortDefinition="Computable Contract Rules", formalDefinition="Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal)." ) + protected Type content; + + private static final long serialVersionUID = -1763459053L; + + /* + * Constructor + */ + public ComputableLanguageComponent() { + super(); + } + + /* + * Constructor + */ + public ComputableLanguageComponent(Type content) { + super(); + this.content = content; + } + + /** + * @return {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).) + */ + public Type getContent() { + return this.content; + } + + /** + * @return {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).) + */ + public Attachment getContentAttachment() throws Exception { + if (!(this.content instanceof Attachment)) + throw new Exception("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Attachment) this.content; + } + + /** + * @return {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).) + */ + public Reference getContentReference() throws Exception { + if (!(this.content instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Reference) this.content; + } + + public boolean hasContent() { + return this.content != null && !this.content.isEmpty(); + } + + /** + * @param value {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).) + */ + public ComputableLanguageComponent setContent(Type value) { + this.content = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("content[x]", "Attachment|Reference(DocumentReference)", "Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).", 0, java.lang.Integer.MAX_VALUE, content)); + } + + public ComputableLanguageComponent copy() { + ComputableLanguageComponent dst = new ComputableLanguageComponent(); + copyValues(dst); + dst.content = content == null ? null : content.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ComputableLanguageComponent)) + return false; + ComputableLanguageComponent o = (ComputableLanguageComponent) other; + return compareDeep(content, o.content, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ComputableLanguageComponent)) + return false; + ComputableLanguageComponent o = (ComputableLanguageComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (content == null || content.isEmpty()); + } + + } + + /** + * Unique identifier for this Contract. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1) + @Description(shortDefinition="Contract identifier", formalDefinition="Unique identifier for this Contract." ) + protected Identifier identifier; + + /** + * When this Contract was issued. + */ + @Child(name = "issued", type = {DateTimeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="When this Contract was issued", formalDefinition="When this Contract was issued." ) + protected DateTimeType issued; + + /** + * Relevant time or time-period when this Contract is applicable. + */ + @Child(name = "applies", type = {Period.class}, order=2, min=0, max=1) + @Description(shortDefinition="Effective time", formalDefinition="Relevant time or time-period when this Contract is applicable." ) + protected Period applies; + + /** + * Who and/or what this Contract is about: typically a Patient, Organization, or valued items such as goods and services. + */ + @Child(name = "subject", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Subject of this Contract", formalDefinition="Who and/or what this Contract is about: typically a Patient, Organization, or valued items such as goods and services." ) + protected List subject; + /** + * The actual objects that are the target of the reference (Who and/or what this Contract is about: typically a Patient, Organization, or valued items such as goods and services.) + */ + protected List subjectTarget; + + + /** + * A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies. + */ + @Child(name = "authority", type = {Organization.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Authority under which this Contract has standing", formalDefinition="A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies." ) + protected List authority; + /** + * The actual objects that are the target of the reference (A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.) + */ + protected List authorityTarget; + + + /** + * Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources. + */ + @Child(name = "domain", type = {Location.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Domain in which this Contract applies", formalDefinition="Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources." ) + protected List domain; + /** + * The actual objects that are the target of the reference (Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.) + */ + protected List domainTarget; + + + /** + * Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=6, min=0, max=1) + @Description(shortDefinition="Contract Tyoe", formalDefinition="Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc." ) + protected CodeableConcept type; + + /** + * More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent. + */ + @Child(name = "subType", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contract Subtype", formalDefinition="More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent." ) + protected List subType; + + /** + * Action stipulated by this Contract. + */ + @Child(name = "action", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contract Action", formalDefinition="Action stipulated by this Contract." ) + protected List action; + + /** + * Reason for action stipulated by this Contract. + */ + @Child(name = "actionReason", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contract Action Reason", formalDefinition="Reason for action stipulated by this Contract." ) + protected List actionReason; + + /** + * List of Contract actors. + */ + @Child(name = "actor", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contract Actor", formalDefinition="List of Contract actors." ) + protected List actor; + + /** + * Contract Valued Item List. + */ + @Child(name = "valuedItem", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contract Valued Item", formalDefinition="Contract Valued Item List." ) + protected List valuedItem; + + /** + * Party signing this Contract. + */ + @Child(name = "signer", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contract Signer", formalDefinition="Party signing this Contract." ) + protected List signer; + + /** + * One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups. + */ + @Child(name = "term", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contract Term List", formalDefinition="One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups." ) + protected List term; + + /** + * Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract. + */ + @Child(name = "binding", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireAnswers.class}, order=14, min=0, max=1) + @Description(shortDefinition="Binding Contract", formalDefinition="Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the 'source of truth' and which would be the basis for legal action related to enforcement of this Contract." ) + protected Type binding; + + /** + * The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement. + */ + @Child(name = "friendly", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contract Friendly Language", formalDefinition="The 'patient friendly language' versionof the Contract in whole or in parts. 'Patient friendly language' means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement." ) + protected List friendly; + + /** + * List of Legal expressions or representations of this Contract. + */ + @Child(name = "legal", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contract Legal Language", formalDefinition="List of Legal expressions or representations of this Contract." ) + protected List legal; + + /** + * List of Computable Policy Rule Language Representations of this Contract. + */ + @Child(name = "rule", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Computable Contract Language", formalDefinition="List of Computable Policy Rule Language Representations of this Contract." ) + protected List rule; + + private static final long serialVersionUID = -1785608373L; + + /* + * Constructor + */ + public Contract() { + super(); + } + + /** + * @return {@link #identifier} (Unique identifier for this Contract.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Unique identifier for this Contract.) + */ + public Contract setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #issued} (When this Contract was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public DateTimeType getIssuedElement() { + if (this.issued == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.issued"); + else if (Configuration.doAutoCreate()) + this.issued = new DateTimeType(); // bb + return this.issued; + } + + public boolean hasIssuedElement() { + return this.issued != null && !this.issued.isEmpty(); + } + + public boolean hasIssued() { + return this.issued != null && !this.issued.isEmpty(); + } + + /** + * @param value {@link #issued} (When this Contract was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public Contract setIssuedElement(DateTimeType value) { + this.issued = value; + return this; + } + + /** + * @return When this Contract was issued. + */ + public Date getIssued() { + return this.issued == null ? null : this.issued.getValue(); + } + + /** + * @param value When this Contract was issued. + */ + public Contract setIssued(Date value) { + if (value == null) + this.issued = null; + else { + if (this.issued == null) + this.issued = new DateTimeType(); + this.issued.setValue(value); + } + return this; + } + + /** + * @return {@link #applies} (Relevant time or time-period when this Contract is applicable.) + */ + public Period getApplies() { + if (this.applies == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.applies"); + else if (Configuration.doAutoCreate()) + this.applies = new Period(); // cc + return this.applies; + } + + public boolean hasApplies() { + return this.applies != null && !this.applies.isEmpty(); + } + + /** + * @param value {@link #applies} (Relevant time or time-period when this Contract is applicable.) + */ + public Contract setApplies(Period value) { + this.applies = value; + return this; + } + + /** + * @return {@link #subject} (Who and/or what this Contract is about: typically a Patient, Organization, or valued items such as goods and services.) + */ + public List getSubject() { + if (this.subject == null) + this.subject = new ArrayList(); + return this.subject; + } + + public boolean hasSubject() { + if (this.subject == null) + return false; + for (Reference item : this.subject) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subject} (Who and/or what this Contract is about: typically a Patient, Organization, or valued items such as goods and services.) + */ + // syntactic sugar + public Reference addSubject() { //3 + Reference t = new Reference(); + if (this.subject == null) + this.subject = new ArrayList(); + this.subject.add(t); + return t; + } + + // syntactic sugar + public Contract addSubject(Reference t) { //3 + if (t == null) + return this; + if (this.subject == null) + this.subject = new ArrayList(); + this.subject.add(t); + return this; + } + + /** + * @return {@link #subject} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Who and/or what this Contract is about: typically a Patient, Organization, or valued items such as goods and services.) + */ + public List getSubjectTarget() { + if (this.subjectTarget == null) + this.subjectTarget = new ArrayList(); + return this.subjectTarget; + } + + /** + * @return {@link #authority} (A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.) + */ + public List getAuthority() { + if (this.authority == null) + this.authority = new ArrayList(); + return this.authority; + } + + public boolean hasAuthority() { + if (this.authority == null) + return false; + for (Reference item : this.authority) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #authority} (A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.) + */ + // syntactic sugar + public Reference addAuthority() { //3 + Reference t = new Reference(); + if (this.authority == null) + this.authority = new ArrayList(); + this.authority.add(t); + return t; + } + + // syntactic sugar + public Contract addAuthority(Reference t) { //3 + if (t == null) + return this; + if (this.authority == null) + this.authority = new ArrayList(); + this.authority.add(t); + return this; + } + + /** + * @return {@link #authority} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.) + */ + public List getAuthorityTarget() { + if (this.authorityTarget == null) + this.authorityTarget = new ArrayList(); + return this.authorityTarget; + } + + // syntactic sugar + /** + * @return {@link #authority} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.) + */ + public Organization addAuthorityTarget() { + Organization r = new Organization(); + if (this.authorityTarget == null) + this.authorityTarget = new ArrayList(); + this.authorityTarget.add(r); + return r; + } + + /** + * @return {@link #domain} (Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.) + */ + public List getDomain() { + if (this.domain == null) + this.domain = new ArrayList(); + return this.domain; + } + + public boolean hasDomain() { + if (this.domain == null) + return false; + for (Reference item : this.domain) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #domain} (Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.) + */ + // syntactic sugar + public Reference addDomain() { //3 + Reference t = new Reference(); + if (this.domain == null) + this.domain = new ArrayList(); + this.domain.add(t); + return t; + } + + // syntactic sugar + public Contract addDomain(Reference t) { //3 + if (t == null) + return this; + if (this.domain == null) + this.domain = new ArrayList(); + this.domain.add(t); + return this; + } + + /** + * @return {@link #domain} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.) + */ + public List getDomainTarget() { + if (this.domainTarget == null) + this.domainTarget = new ArrayList(); + return this.domainTarget; + } + + // syntactic sugar + /** + * @return {@link #domain} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.) + */ + public Location addDomainTarget() { + Location r = new Location(); + if (this.domainTarget == null) + this.domainTarget = new ArrayList(); + this.domainTarget.add(r); + return r; + } + + /** + * @return {@link #type} (Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc.) + */ + public Contract setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #subType} (More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent.) + */ + public List getSubType() { + if (this.subType == null) + this.subType = new ArrayList(); + return this.subType; + } + + public boolean hasSubType() { + if (this.subType == null) + return false; + for (CodeableConcept item : this.subType) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subType} (More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent.) + */ + // syntactic sugar + public CodeableConcept addSubType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.subType == null) + this.subType = new ArrayList(); + this.subType.add(t); + return t; + } + + // syntactic sugar + public Contract addSubType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.subType == null) + this.subType = new ArrayList(); + this.subType.add(t); + return this; + } + + /** + * @return {@link #action} (Action stipulated by this Contract.) + */ + public List getAction() { + if (this.action == null) + this.action = new ArrayList(); + return this.action; + } + + public boolean hasAction() { + if (this.action == null) + return false; + for (CodeableConcept item : this.action) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #action} (Action stipulated by this Contract.) + */ + // syntactic sugar + public CodeableConcept addAction() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return t; + } + + // syntactic sugar + public Contract addAction(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return this; + } + + /** + * @return {@link #actionReason} (Reason for action stipulated by this Contract.) + */ + public List getActionReason() { + if (this.actionReason == null) + this.actionReason = new ArrayList(); + return this.actionReason; + } + + public boolean hasActionReason() { + if (this.actionReason == null) + return false; + for (CodeableConcept item : this.actionReason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #actionReason} (Reason for action stipulated by this Contract.) + */ + // syntactic sugar + public CodeableConcept addActionReason() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.actionReason == null) + this.actionReason = new ArrayList(); + this.actionReason.add(t); + return t; + } + + // syntactic sugar + public Contract addActionReason(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.actionReason == null) + this.actionReason = new ArrayList(); + this.actionReason.add(t); + return this; + } + + /** + * @return {@link #actor} (List of Contract actors.) + */ + public List getActor() { + if (this.actor == null) + this.actor = new ArrayList(); + return this.actor; + } + + public boolean hasActor() { + if (this.actor == null) + return false; + for (ActorComponent item : this.actor) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #actor} (List of Contract actors.) + */ + // syntactic sugar + public ActorComponent addActor() { //3 + ActorComponent t = new ActorComponent(); + if (this.actor == null) + this.actor = new ArrayList(); + this.actor.add(t); + return t; + } + + // syntactic sugar + public Contract addActor(ActorComponent t) { //3 + if (t == null) + return this; + if (this.actor == null) + this.actor = new ArrayList(); + this.actor.add(t); + return this; + } + + /** + * @return {@link #valuedItem} (Contract Valued Item List.) + */ + public List getValuedItem() { + if (this.valuedItem == null) + this.valuedItem = new ArrayList(); + return this.valuedItem; + } + + public boolean hasValuedItem() { + if (this.valuedItem == null) + return false; + for (ValuedItemComponent item : this.valuedItem) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #valuedItem} (Contract Valued Item List.) + */ + // syntactic sugar + public ValuedItemComponent addValuedItem() { //3 + ValuedItemComponent t = new ValuedItemComponent(); + if (this.valuedItem == null) + this.valuedItem = new ArrayList(); + this.valuedItem.add(t); + return t; + } + + // syntactic sugar + public Contract addValuedItem(ValuedItemComponent t) { //3 + if (t == null) + return this; + if (this.valuedItem == null) + this.valuedItem = new ArrayList(); + this.valuedItem.add(t); + return this; + } + + /** + * @return {@link #signer} (Party signing this Contract.) + */ + public List getSigner() { + if (this.signer == null) + this.signer = new ArrayList(); + return this.signer; + } + + public boolean hasSigner() { + if (this.signer == null) + return false; + for (SignatoryComponent item : this.signer) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #signer} (Party signing this Contract.) + */ + // syntactic sugar + public SignatoryComponent addSigner() { //3 + SignatoryComponent t = new SignatoryComponent(); + if (this.signer == null) + this.signer = new ArrayList(); + this.signer.add(t); + return t; + } + + // syntactic sugar + public Contract addSigner(SignatoryComponent t) { //3 + if (t == null) + return this; + if (this.signer == null) + this.signer = new ArrayList(); + this.signer.add(t); + return this; + } + + /** + * @return {@link #term} (One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.) + */ + public List getTerm() { + if (this.term == null) + this.term = new ArrayList(); + return this.term; + } + + public boolean hasTerm() { + if (this.term == null) + return false; + for (TermComponent item : this.term) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #term} (One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.) + */ + // syntactic sugar + public TermComponent addTerm() { //3 + TermComponent t = new TermComponent(); + if (this.term == null) + this.term = new ArrayList(); + this.term.add(t); + return t; + } + + // syntactic sugar + public Contract addTerm(TermComponent t) { //3 + if (t == null) + return this; + if (this.term == null) + this.term = new ArrayList(); + this.term.add(t); + return this; + } + + /** + * @return {@link #binding} (Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.) + */ + public Type getBinding() { + return this.binding; + } + + /** + * @return {@link #binding} (Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.) + */ + public Attachment getBindingAttachment() throws Exception { + if (!(this.binding instanceof Attachment)) + throw new Exception("Type mismatch: the type Attachment was expected, but "+this.binding.getClass().getName()+" was encountered"); + return (Attachment) this.binding; + } + + /** + * @return {@link #binding} (Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.) + */ + public Reference getBindingReference() throws Exception { + if (!(this.binding instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.binding.getClass().getName()+" was encountered"); + return (Reference) this.binding; + } + + public boolean hasBinding() { + return this.binding != null && !this.binding.isEmpty(); + } + + /** + * @param value {@link #binding} (Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.) + */ + public Contract setBinding(Type value) { + this.binding = value; + return this; + } + + /** + * @return {@link #friendly} (The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement.) + */ + public List getFriendly() { + if (this.friendly == null) + this.friendly = new ArrayList(); + return this.friendly; + } + + public boolean hasFriendly() { + if (this.friendly == null) + return false; + for (FriendlyLanguageComponent item : this.friendly) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #friendly} (The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement.) + */ + // syntactic sugar + public FriendlyLanguageComponent addFriendly() { //3 + FriendlyLanguageComponent t = new FriendlyLanguageComponent(); + if (this.friendly == null) + this.friendly = new ArrayList(); + this.friendly.add(t); + return t; + } + + // syntactic sugar + public Contract addFriendly(FriendlyLanguageComponent t) { //3 + if (t == null) + return this; + if (this.friendly == null) + this.friendly = new ArrayList(); + this.friendly.add(t); + return this; + } + + /** + * @return {@link #legal} (List of Legal expressions or representations of this Contract.) + */ + public List getLegal() { + if (this.legal == null) + this.legal = new ArrayList(); + return this.legal; + } + + public boolean hasLegal() { + if (this.legal == null) + return false; + for (LegalLanguageComponent item : this.legal) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #legal} (List of Legal expressions or representations of this Contract.) + */ + // syntactic sugar + public LegalLanguageComponent addLegal() { //3 + LegalLanguageComponent t = new LegalLanguageComponent(); + if (this.legal == null) + this.legal = new ArrayList(); + this.legal.add(t); + return t; + } + + // syntactic sugar + public Contract addLegal(LegalLanguageComponent t) { //3 + if (t == null) + return this; + if (this.legal == null) + this.legal = new ArrayList(); + this.legal.add(t); + return this; + } + + /** + * @return {@link #rule} (List of Computable Policy Rule Language Representations of this Contract.) + */ + public List getRule() { + if (this.rule == null) + this.rule = new ArrayList(); + return this.rule; + } + + public boolean hasRule() { + if (this.rule == null) + return false; + for (ComputableLanguageComponent item : this.rule) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #rule} (List of Computable Policy Rule Language Representations of this Contract.) + */ + // syntactic sugar + public ComputableLanguageComponent addRule() { //3 + ComputableLanguageComponent t = new ComputableLanguageComponent(); + if (this.rule == null) + this.rule = new ArrayList(); + this.rule.add(t); + return t; + } + + // syntactic sugar + public Contract addRule(ComputableLanguageComponent t) { //3 + if (t == null) + return this; + if (this.rule == null) + this.rule = new ArrayList(); + this.rule.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Unique identifier for this Contract.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("issued", "dateTime", "When this Contract was issued.", 0, java.lang.Integer.MAX_VALUE, issued)); + childrenList.add(new Property("applies", "Period", "Relevant time or time-period when this Contract is applicable.", 0, java.lang.Integer.MAX_VALUE, applies)); + childrenList.add(new Property("subject", "Reference(Any)", "Who and/or what this Contract is about: typically a Patient, Organization, or valued items such as goods and services.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("authority", "Reference(Organization)", "A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.", 0, java.lang.Integer.MAX_VALUE, authority)); + childrenList.add(new Property("domain", "Reference(Location)", "Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.", 0, java.lang.Integer.MAX_VALUE, domain)); + childrenList.add(new Property("type", "CodeableConcept", "Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("subType", "CodeableConcept", "More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent.", 0, java.lang.Integer.MAX_VALUE, subType)); + childrenList.add(new Property("action", "CodeableConcept", "Action stipulated by this Contract.", 0, java.lang.Integer.MAX_VALUE, action)); + childrenList.add(new Property("actionReason", "CodeableConcept", "Reason for action stipulated by this Contract.", 0, java.lang.Integer.MAX_VALUE, actionReason)); + childrenList.add(new Property("actor", "", "List of Contract actors.", 0, java.lang.Integer.MAX_VALUE, actor)); + childrenList.add(new Property("valuedItem", "", "Contract Valued Item List.", 0, java.lang.Integer.MAX_VALUE, valuedItem)); + childrenList.add(new Property("signer", "", "Party signing this Contract.", 0, java.lang.Integer.MAX_VALUE, signer)); + childrenList.add(new Property("term", "", "One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.", 0, java.lang.Integer.MAX_VALUE, term)); + childrenList.add(new Property("binding[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireAnswers)", "Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the 'source of truth' and which would be the basis for legal action related to enforcement of this Contract.", 0, java.lang.Integer.MAX_VALUE, binding)); + childrenList.add(new Property("friendly", "", "The 'patient friendly language' versionof the Contract in whole or in parts. 'Patient friendly language' means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement.", 0, java.lang.Integer.MAX_VALUE, friendly)); + childrenList.add(new Property("legal", "", "List of Legal expressions or representations of this Contract.", 0, java.lang.Integer.MAX_VALUE, legal)); + childrenList.add(new Property("rule", "", "List of Computable Policy Rule Language Representations of this Contract.", 0, java.lang.Integer.MAX_VALUE, rule)); + } + + public Contract copy() { + Contract dst = new Contract(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.issued = issued == null ? null : issued.copy(); + dst.applies = applies == null ? null : applies.copy(); + if (subject != null) { + dst.subject = new ArrayList(); + for (Reference i : subject) + dst.subject.add(i.copy()); + }; + if (authority != null) { + dst.authority = new ArrayList(); + for (Reference i : authority) + dst.authority.add(i.copy()); + }; + if (domain != null) { + dst.domain = new ArrayList(); + for (Reference i : domain) + dst.domain.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + if (subType != null) { + dst.subType = new ArrayList(); + for (CodeableConcept i : subType) + dst.subType.add(i.copy()); + }; + if (action != null) { + dst.action = new ArrayList(); + for (CodeableConcept i : action) + dst.action.add(i.copy()); + }; + if (actionReason != null) { + dst.actionReason = new ArrayList(); + for (CodeableConcept i : actionReason) + dst.actionReason.add(i.copy()); + }; + if (actor != null) { + dst.actor = new ArrayList(); + for (ActorComponent i : actor) + dst.actor.add(i.copy()); + }; + if (valuedItem != null) { + dst.valuedItem = new ArrayList(); + for (ValuedItemComponent i : valuedItem) + dst.valuedItem.add(i.copy()); + }; + if (signer != null) { + dst.signer = new ArrayList(); + for (SignatoryComponent i : signer) + dst.signer.add(i.copy()); + }; + if (term != null) { + dst.term = new ArrayList(); + for (TermComponent i : term) + dst.term.add(i.copy()); + }; + dst.binding = binding == null ? null : binding.copy(); + if (friendly != null) { + dst.friendly = new ArrayList(); + for (FriendlyLanguageComponent i : friendly) + dst.friendly.add(i.copy()); + }; + if (legal != null) { + dst.legal = new ArrayList(); + for (LegalLanguageComponent i : legal) + dst.legal.add(i.copy()); + }; + if (rule != null) { + dst.rule = new ArrayList(); + for (ComputableLanguageComponent i : rule) + dst.rule.add(i.copy()); + }; + return dst; + } + + protected Contract typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Contract)) + return false; + Contract o = (Contract) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(issued, o.issued, true) && compareDeep(applies, o.applies, true) + && compareDeep(subject, o.subject, true) && compareDeep(authority, o.authority, true) && compareDeep(domain, o.domain, true) + && compareDeep(type, o.type, true) && compareDeep(subType, o.subType, true) && compareDeep(action, o.action, true) + && compareDeep(actionReason, o.actionReason, true) && compareDeep(actor, o.actor, true) && compareDeep(valuedItem, o.valuedItem, true) + && compareDeep(signer, o.signer, true) && compareDeep(term, o.term, true) && compareDeep(binding, o.binding, true) + && compareDeep(friendly, o.friendly, true) && compareDeep(legal, o.legal, true) && compareDeep(rule, o.rule, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Contract)) + return false; + Contract o = (Contract) other; + return compareValues(issued, o.issued, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (issued == null || issued.isEmpty()) + && (applies == null || applies.isEmpty()) && (subject == null || subject.isEmpty()) && (authority == null || authority.isEmpty()) + && (domain == null || domain.isEmpty()) && (type == null || type.isEmpty()) && (subType == null || subType.isEmpty()) + && (action == null || action.isEmpty()) && (actionReason == null || actionReason.isEmpty()) + && (actor == null || actor.isEmpty()) && (valuedItem == null || valuedItem.isEmpty()) && (signer == null || signer.isEmpty()) + && (term == null || term.isEmpty()) && (binding == null || binding.isEmpty()) && (friendly == null || friendly.isEmpty()) + && (legal == null || legal.isEmpty()) && (rule == null || rule.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Contract; + } + + @SearchParamDefinition(name="actor", path="Contract.actor.entity", description="Contract Actor Type", type="reference" ) + public static final String SP_ACTOR = "actor"; + @SearchParamDefinition(name="identifier", path="Contract.identifier", description="The identity of the contract", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="subject", path="Contract.subject", description="The identity of the target of the contract", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="patient", path="Contract.subject", description="The identity of the target of the contract (if a patient)", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="signer", path="Contract.signer.party", description="Contract Signatory Party", type="reference" ) + public static final String SP_SIGNER = "signer"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Contraindication.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Contraindication.java index 381d6134aac..0d424585d84 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Contraindication.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Contraindication.java @@ -1,879 +1,858 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient. E.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. - */ -@ResourceDef(name="Contraindication", profile="http://hl7.org/fhir/Profile/Contraindication") -public class Contraindication extends DomainResource { - - @Block() - public static class ContraindicationMitigationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication. - */ - @Child(name = "action", type = {CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="What mitigation?", formalDefinition="Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication." ) - protected CodeableConcept action; - - /** - * Indicates when the mitigating action was documented. - */ - @Child(name = "date", type = {DateTimeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Date committed", formalDefinition="Indicates when the mitigating action was documented." ) - protected DateTimeType date; - - /** - * Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring. - */ - @Child(name = "author", type = {Practitioner.class}, order=3, min=0, max=1) - @Description(shortDefinition="Who is committing?", formalDefinition="Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) - */ - protected Practitioner authorTarget; - - private static final long serialVersionUID = -1994768436L; - - /* - * Constructor - */ - public ContraindicationMitigationComponent() { - super(); - } - - /* - * Constructor - */ - public ContraindicationMitigationComponent(CodeableConcept action) { - super(); - this.action = action; - } - - /** - * @return {@link #action} (Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication.) - */ - public CodeableConcept getAction() { - if (this.action == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContraindicationMitigationComponent.action"); - else if (Configuration.doAutoCreate()) - this.action = new CodeableConcept(); // cc - return this.action; - } - - public boolean hasAction() { - return this.action != null && !this.action.isEmpty(); - } - - /** - * @param value {@link #action} (Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication.) - */ - public ContraindicationMitigationComponent setAction(CodeableConcept value) { - this.action = value; - return this; - } - - /** - * @return {@link #date} (Indicates when the mitigating action was documented.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContraindicationMitigationComponent.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (Indicates when the mitigating action was documented.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ContraindicationMitigationComponent setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return Indicates when the mitigating action was documented. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value Indicates when the mitigating action was documented. - */ - public ContraindicationMitigationComponent setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #author} (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContraindicationMitigationComponent.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); // cc - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) - */ - public ContraindicationMitigationComponent setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) - */ - public Practitioner getAuthorTarget() { - if (this.authorTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContraindicationMitigationComponent.author"); - else if (Configuration.doAutoCreate()) - this.authorTarget = new Practitioner(); // aa - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) - */ - public ContraindicationMitigationComponent setAuthorTarget(Practitioner value) { - this.authorTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("action", "CodeableConcept", "Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication.", 0, java.lang.Integer.MAX_VALUE, action)); - childrenList.add(new Property("date", "dateTime", "Indicates when the mitigating action was documented.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("author", "Reference(Practitioner)", "Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.", 0, java.lang.Integer.MAX_VALUE, author)); - } - - public ContraindicationMitigationComponent copy() { - ContraindicationMitigationComponent dst = new ContraindicationMitigationComponent(); - copyValues(dst); - dst.action = action == null ? null : action.copy(); - dst.date = date == null ? null : date.copy(); - dst.author = author == null ? null : author.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ContraindicationMitigationComponent)) - return false; - ContraindicationMitigationComponent o = (ContraindicationMitigationComponent) other; - return compareDeep(action, o.action, true) && compareDeep(date, o.date, true) && compareDeep(author, o.author, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ContraindicationMitigationComponent)) - return false; - ContraindicationMitigationComponent o = (ContraindicationMitigationComponent) other; - return compareValues(date, o.date, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (action == null || action.isEmpty()) && (date == null || date.isEmpty()) - && (author == null || author.isEmpty()); - } - - } - - /** - * Indicates the patient whose record the contraindication is associated with. - */ - @Child(name = "patient", type = {Patient.class}, order=0, min=0, max=1) - @Description(shortDefinition="Associated patient", formalDefinition="Indicates the patient whose record the contraindication is associated with." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (Indicates the patient whose record the contraindication is associated with.) - */ - protected Patient patientTarget; - - /** - * Identifies the general type of issue identified. - */ - @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="E.g. Drug-drug, duplicate therapy, etc.", formalDefinition="Identifies the general type of issue identified." ) - protected CodeableConcept category; - - /** - * Indicates the degree of importance associated with the identified issue based on the potential impact on the patient. - */ - @Child(name = "severity", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="high | medium | low", formalDefinition="Indicates the degree of importance associated with the identified issue based on the potential impact on the patient." ) - protected CodeType severity; - - /** - * Indicates the resource representing the current activity or proposed activity that. - */ - @Child(name = "implicated", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Problem resource", formalDefinition="Indicates the resource representing the current activity or proposed activity that." ) - protected List implicated; - /** - * The actual objects that are the target of the reference (Indicates the resource representing the current activity or proposed activity that.) - */ - protected List implicatedTarget; - - - /** - * A textual explanation of the contraindication. - */ - @Child(name = "detail", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Description and context", formalDefinition="A textual explanation of the contraindication." ) - protected StringType detail; - - /** - * The date or date-time when the contraindication was initially identified. - */ - @Child(name = "date", type = {DateTimeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="When identified", formalDefinition="The date or date-time when the contraindication was initially identified." ) - protected DateTimeType date; - - /** - * Identifies the provider or software that identified the. - */ - @Child(name = "author", type = {Practitioner.class, Device.class}, order=6, min=0, max=1) - @Description(shortDefinition="Who found issue?", formalDefinition="Identifies the provider or software that identified the." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (Identifies the provider or software that identified the.) - */ - protected Resource authorTarget; - - /** - * Business identifier associated with the contraindication record. - */ - @Child(name = "identifier", type = {Identifier.class}, order=7, min=0, max=1) - @Description(shortDefinition="Unique id for the contraindication", formalDefinition="Business identifier associated with the contraindication record." ) - protected Identifier identifier; - - /** - * The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified. - */ - @Child(name = "reference", type = {UriType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Authority for issue", formalDefinition="The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified." ) - protected UriType reference; - - /** - * Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action. - */ - @Child(name = "mitigation", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Step taken to address", formalDefinition="Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action." ) - protected List mitigation; - - private static final long serialVersionUID = 528603336L; - - /* - * Constructor - */ - public Contraindication() { - super(); - } - - /** - * @return {@link #patient} (Indicates the patient whose record the contraindication is associated with.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contraindication.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (Indicates the patient whose record the contraindication is associated with.) - */ - public Contraindication setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates the patient whose record the contraindication is associated with.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contraindication.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates the patient whose record the contraindication is associated with.) - */ - public Contraindication setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #category} (Identifies the general type of issue identified.) - */ - public CodeableConcept getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contraindication.category"); - else if (Configuration.doAutoCreate()) - this.category = new CodeableConcept(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Identifies the general type of issue identified.) - */ - public Contraindication setCategory(CodeableConcept value) { - this.category = value; - return this; - } - - /** - * @return {@link #severity} (Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public CodeType getSeverityElement() { - if (this.severity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contraindication.severity"); - else if (Configuration.doAutoCreate()) - this.severity = new CodeType(); // bb - return this.severity; - } - - public boolean hasSeverityElement() { - return this.severity != null && !this.severity.isEmpty(); - } - - public boolean hasSeverity() { - return this.severity != null && !this.severity.isEmpty(); - } - - /** - * @param value {@link #severity} (Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public Contraindication setSeverityElement(CodeType value) { - this.severity = value; - return this; - } - - /** - * @return Indicates the degree of importance associated with the identified issue based on the potential impact on the patient. - */ - public String getSeverity() { - return this.severity == null ? null : this.severity.getValue(); - } - - /** - * @param value Indicates the degree of importance associated with the identified issue based on the potential impact on the patient. - */ - public Contraindication setSeverity(String value) { - if (Utilities.noString(value)) - this.severity = null; - else { - if (this.severity == null) - this.severity = new CodeType(); - this.severity.setValue(value); - } - return this; - } - - /** - * @return {@link #implicated} (Indicates the resource representing the current activity or proposed activity that.) - */ - public List getImplicated() { - if (this.implicated == null) - this.implicated = new ArrayList(); - return this.implicated; - } - - public boolean hasImplicated() { - if (this.implicated == null) - return false; - for (Reference item : this.implicated) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #implicated} (Indicates the resource representing the current activity or proposed activity that.) - */ - // syntactic sugar - public Reference addImplicated() { //3 - Reference t = new Reference(); - if (this.implicated == null) - this.implicated = new ArrayList(); - this.implicated.add(t); - return t; - } - - // syntactic sugar - public Contraindication addImplicated(Reference t) { //3 - if (t == null) - return this; - if (this.implicated == null) - this.implicated = new ArrayList(); - this.implicated.add(t); - return this; - } - - /** - * @return {@link #implicated} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Indicates the resource representing the current activity or proposed activity that.) - */ - public List getImplicatedTarget() { - if (this.implicatedTarget == null) - this.implicatedTarget = new ArrayList(); - return this.implicatedTarget; - } - - /** - * @return {@link #detail} (A textual explanation of the contraindication.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value - */ - public StringType getDetailElement() { - if (this.detail == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contraindication.detail"); - else if (Configuration.doAutoCreate()) - this.detail = new StringType(); // bb - return this.detail; - } - - public boolean hasDetailElement() { - return this.detail != null && !this.detail.isEmpty(); - } - - public boolean hasDetail() { - return this.detail != null && !this.detail.isEmpty(); - } - - /** - * @param value {@link #detail} (A textual explanation of the contraindication.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value - */ - public Contraindication setDetailElement(StringType value) { - this.detail = value; - return this; - } - - /** - * @return A textual explanation of the contraindication. - */ - public String getDetail() { - return this.detail == null ? null : this.detail.getValue(); - } - - /** - * @param value A textual explanation of the contraindication. - */ - public Contraindication setDetail(String value) { - if (Utilities.noString(value)) - this.detail = null; - else { - if (this.detail == null) - this.detail = new StringType(); - this.detail.setValue(value); - } - return this; - } - - /** - * @return {@link #date} (The date or date-time when the contraindication was initially identified.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contraindication.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date or date-time when the contraindication was initially identified.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public Contraindication setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date or date-time when the contraindication was initially identified. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date or date-time when the contraindication was initially identified. - */ - public Contraindication setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #author} (Identifies the provider or software that identified the.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contraindication.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); // cc - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Identifies the provider or software that identified the.) - */ - public Contraindication setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the provider or software that identified the.) - */ - public Resource getAuthorTarget() { - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the provider or software that identified the.) - */ - public Contraindication setAuthorTarget(Resource value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #identifier} (Business identifier associated with the contraindication record.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contraindication.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Business identifier associated with the contraindication record.) - */ - public Contraindication setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #reference} (The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public UriType getReferenceElement() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contraindication.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new UriType(); // bb - return this.reference; - } - - public boolean hasReferenceElement() { - return this.reference != null && !this.reference.isEmpty(); - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public Contraindication setReferenceElement(UriType value) { - this.reference = value; - return this; - } - - /** - * @return The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified. - */ - public String getReference() { - return this.reference == null ? null : this.reference.getValue(); - } - - /** - * @param value The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified. - */ - public Contraindication setReference(String value) { - if (Utilities.noString(value)) - this.reference = null; - else { - if (this.reference == null) - this.reference = new UriType(); - this.reference.setValue(value); - } - return this; - } - - /** - * @return {@link #mitigation} (Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.) - */ - public List getMitigation() { - if (this.mitigation == null) - this.mitigation = new ArrayList(); - return this.mitigation; - } - - public boolean hasMitigation() { - if (this.mitigation == null) - return false; - for (ContraindicationMitigationComponent item : this.mitigation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #mitigation} (Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.) - */ - // syntactic sugar - public ContraindicationMitigationComponent addMitigation() { //3 - ContraindicationMitigationComponent t = new ContraindicationMitigationComponent(); - if (this.mitigation == null) - this.mitigation = new ArrayList(); - this.mitigation.add(t); - return t; - } - - // syntactic sugar - public Contraindication addMitigation(ContraindicationMitigationComponent t) { //3 - if (t == null) - return this; - if (this.mitigation == null) - this.mitigation = new ArrayList(); - this.mitigation.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("patient", "Reference(Patient)", "Indicates the patient whose record the contraindication is associated with.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("category", "CodeableConcept", "Identifies the general type of issue identified.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("severity", "code", "Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.", 0, java.lang.Integer.MAX_VALUE, severity)); - childrenList.add(new Property("implicated", "Reference(Any)", "Indicates the resource representing the current activity or proposed activity that.", 0, java.lang.Integer.MAX_VALUE, implicated)); - childrenList.add(new Property("detail", "string", "A textual explanation of the contraindication.", 0, java.lang.Integer.MAX_VALUE, detail)); - childrenList.add(new Property("date", "dateTime", "The date or date-time when the contraindication was initially identified.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("author", "Reference(Practitioner|Device)", "Identifies the provider or software that identified the.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("identifier", "Identifier", "Business identifier associated with the contraindication record.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("reference", "uri", "The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("mitigation", "", "Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.", 0, java.lang.Integer.MAX_VALUE, mitigation)); - } - - public Contraindication copy() { - Contraindication dst = new Contraindication(); - copyValues(dst); - dst.patient = patient == null ? null : patient.copy(); - dst.category = category == null ? null : category.copy(); - dst.severity = severity == null ? null : severity.copy(); - if (implicated != null) { - dst.implicated = new ArrayList(); - for (Reference i : implicated) - dst.implicated.add(i.copy()); - }; - dst.detail = detail == null ? null : detail.copy(); - dst.date = date == null ? null : date.copy(); - dst.author = author == null ? null : author.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.reference = reference == null ? null : reference.copy(); - if (mitigation != null) { - dst.mitigation = new ArrayList(); - for (ContraindicationMitigationComponent i : mitigation) - dst.mitigation.add(i.copy()); - }; - return dst; - } - - protected Contraindication typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Contraindication)) - return false; - Contraindication o = (Contraindication) other; - return compareDeep(patient, o.patient, true) && compareDeep(category, o.category, true) && compareDeep(severity, o.severity, true) - && compareDeep(implicated, o.implicated, true) && compareDeep(detail, o.detail, true) && compareDeep(date, o.date, true) - && compareDeep(author, o.author, true) && compareDeep(identifier, o.identifier, true) && compareDeep(reference, o.reference, true) - && compareDeep(mitigation, o.mitigation, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Contraindication)) - return false; - Contraindication o = (Contraindication) other; - return compareValues(severity, o.severity, true) && compareValues(detail, o.detail, true) && compareValues(date, o.date, true) - && compareValues(reference, o.reference, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (patient == null || patient.isEmpty()) && (category == null || category.isEmpty()) - && (severity == null || severity.isEmpty()) && (implicated == null || implicated.isEmpty()) - && (detail == null || detail.isEmpty()) && (date == null || date.isEmpty()) && (author == null || author.isEmpty()) - && (identifier == null || identifier.isEmpty()) && (reference == null || reference.isEmpty()) - && (mitigation == null || mitigation.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Contraindication; - } - - @SearchParamDefinition(name="author", path="Contraindication.author", description="Who found issue?", type="reference" ) - public static final String SP_AUTHOR = "author"; - @SearchParamDefinition(name="category", path="Contraindication.category", description="E.g. Drug-drug, duplicate therapy, etc.", type="token" ) - public static final String SP_CATEGORY = "category"; - @SearchParamDefinition(name="implicated", path="Contraindication.implicated", description="Problem resource", type="reference" ) - public static final String SP_IMPLICATED = "implicated"; - @SearchParamDefinition(name="patient", path="Contraindication.patient", description="Associated patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="date", path="Contraindication.date", description="When identified", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="identifier", path="Contraindication.identifier", description="Unique id for the contraindication", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient. E.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. + */ +@ResourceDef(name="Contraindication", profile="http://hl7.org/fhir/Profile/Contraindication") +public class Contraindication extends DomainResource { + + @Block() + public static class ContraindicationMitigationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication. + */ + @Child(name = "action", type = {CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="What mitigation?", formalDefinition="Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication." ) + protected CodeableConcept action; + + /** + * Indicates when the mitigating action was documented. + */ + @Child(name = "date", type = {DateTimeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Date committed", formalDefinition="Indicates when the mitigating action was documented." ) + protected DateTimeType date; + + /** + * Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring. + */ + @Child(name = "author", type = {Practitioner.class}, order=3, min=0, max=1) + @Description(shortDefinition="Who is committing?", formalDefinition="Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) + */ + protected Practitioner authorTarget; + + private static final long serialVersionUID = -1994768436L; + + /* + * Constructor + */ + public ContraindicationMitigationComponent() { + super(); + } + + /* + * Constructor + */ + public ContraindicationMitigationComponent(CodeableConcept action) { + super(); + this.action = action; + } + + /** + * @return {@link #action} (Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication.) + */ + public CodeableConcept getAction() { + if (this.action == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContraindicationMitigationComponent.action"); + else if (Configuration.doAutoCreate()) + this.action = new CodeableConcept(); // cc + return this.action; + } + + public boolean hasAction() { + return this.action != null && !this.action.isEmpty(); + } + + /** + * @param value {@link #action} (Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication.) + */ + public ContraindicationMitigationComponent setAction(CodeableConcept value) { + this.action = value; + return this; + } + + /** + * @return {@link #date} (Indicates when the mitigating action was documented.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContraindicationMitigationComponent.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (Indicates when the mitigating action was documented.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ContraindicationMitigationComponent setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return Indicates when the mitigating action was documented. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value Indicates when the mitigating action was documented. + */ + public ContraindicationMitigationComponent setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #author} (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContraindicationMitigationComponent.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); // cc + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) + */ + public ContraindicationMitigationComponent setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) + */ + public Practitioner getAuthorTarget() { + if (this.authorTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContraindicationMitigationComponent.author"); + else if (Configuration.doAutoCreate()) + this.authorTarget = new Practitioner(); // aa + return this.authorTarget; + } + + /** + * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) + */ + public ContraindicationMitigationComponent setAuthorTarget(Practitioner value) { + this.authorTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("action", "CodeableConcept", "Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication.", 0, java.lang.Integer.MAX_VALUE, action)); + childrenList.add(new Property("date", "dateTime", "Indicates when the mitigating action was documented.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("author", "Reference(Practitioner)", "Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.", 0, java.lang.Integer.MAX_VALUE, author)); + } + + public ContraindicationMitigationComponent copy() { + ContraindicationMitigationComponent dst = new ContraindicationMitigationComponent(); + copyValues(dst); + dst.action = action == null ? null : action.copy(); + dst.date = date == null ? null : date.copy(); + dst.author = author == null ? null : author.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ContraindicationMitigationComponent)) + return false; + ContraindicationMitigationComponent o = (ContraindicationMitigationComponent) other; + return compareDeep(action, o.action, true) && compareDeep(date, o.date, true) && compareDeep(author, o.author, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ContraindicationMitigationComponent)) + return false; + ContraindicationMitigationComponent o = (ContraindicationMitigationComponent) other; + return compareValues(date, o.date, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (action == null || action.isEmpty()) && (date == null || date.isEmpty()) + && (author == null || author.isEmpty()); + } + + } + + /** + * Indicates the patient whose record the contraindication is associated with. + */ + @Child(name = "patient", type = {Patient.class}, order=0, min=0, max=1) + @Description(shortDefinition="Associated patient", formalDefinition="Indicates the patient whose record the contraindication is associated with." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Indicates the patient whose record the contraindication is associated with.) + */ + protected Patient patientTarget; + + /** + * Identifies the general type of issue identified. + */ + @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="E.g. Drug-drug, duplicate therapy, etc.", formalDefinition="Identifies the general type of issue identified." ) + protected CodeableConcept category; + + /** + * Indicates the degree of importance associated with the identified issue based on the potential impact on the patient. + */ + @Child(name = "severity", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="high | medium | low", formalDefinition="Indicates the degree of importance associated with the identified issue based on the potential impact on the patient." ) + protected CodeType severity; + + /** + * Indicates the resource representing the current activity or proposed activity that. + */ + @Child(name = "implicated", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Problem resource", formalDefinition="Indicates the resource representing the current activity or proposed activity that." ) + protected List implicated; + /** + * The actual objects that are the target of the reference (Indicates the resource representing the current activity or proposed activity that.) + */ + protected List implicatedTarget; + + + /** + * A textual explanation of the contraindication. + */ + @Child(name = "detail", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Description and context", formalDefinition="A textual explanation of the contraindication." ) + protected StringType detail; + + /** + * The date or date-time when the contraindication was initially identified. + */ + @Child(name = "date", type = {DateTimeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="When identified", formalDefinition="The date or date-time when the contraindication was initially identified." ) + protected DateTimeType date; + + /** + * Identifies the provider or software that identified the. + */ + @Child(name = "author", type = {Practitioner.class, Device.class}, order=6, min=0, max=1) + @Description(shortDefinition="Who found issue?", formalDefinition="Identifies the provider or software that identified the." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (Identifies the provider or software that identified the.) + */ + protected Resource authorTarget; + + /** + * Business identifier associated with the contraindication record. + */ + @Child(name = "identifier", type = {Identifier.class}, order=7, min=0, max=1) + @Description(shortDefinition="Unique id for the contraindication", formalDefinition="Business identifier associated with the contraindication record." ) + protected Identifier identifier; + + /** + * The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified. + */ + @Child(name = "reference", type = {UriType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Authority for issue", formalDefinition="The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified." ) + protected UriType reference; + + /** + * Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action. + */ + @Child(name = "mitigation", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Step taken to address", formalDefinition="Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action." ) + protected List mitigation; + + private static final long serialVersionUID = 528603336L; + + /* + * Constructor + */ + public Contraindication() { + super(); + } + + /** + * @return {@link #patient} (Indicates the patient whose record the contraindication is associated with.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contraindication.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Indicates the patient whose record the contraindication is associated with.) + */ + public Contraindication setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates the patient whose record the contraindication is associated with.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contraindication.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates the patient whose record the contraindication is associated with.) + */ + public Contraindication setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #category} (Identifies the general type of issue identified.) + */ + public CodeableConcept getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contraindication.category"); + else if (Configuration.doAutoCreate()) + this.category = new CodeableConcept(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Identifies the general type of issue identified.) + */ + public Contraindication setCategory(CodeableConcept value) { + this.category = value; + return this; + } + + /** + * @return {@link #severity} (Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public CodeType getSeverityElement() { + if (this.severity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contraindication.severity"); + else if (Configuration.doAutoCreate()) + this.severity = new CodeType(); // bb + return this.severity; + } + + public boolean hasSeverityElement() { + return this.severity != null && !this.severity.isEmpty(); + } + + public boolean hasSeverity() { + return this.severity != null && !this.severity.isEmpty(); + } + + /** + * @param value {@link #severity} (Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public Contraindication setSeverityElement(CodeType value) { + this.severity = value; + return this; + } + + /** + * @return Indicates the degree of importance associated with the identified issue based on the potential impact on the patient. + */ + public String getSeverity() { + return this.severity == null ? null : this.severity.getValue(); + } + + /** + * @param value Indicates the degree of importance associated with the identified issue based on the potential impact on the patient. + */ + public Contraindication setSeverity(String value) { + if (Utilities.noString(value)) + this.severity = null; + else { + if (this.severity == null) + this.severity = new CodeType(); + this.severity.setValue(value); + } + return this; + } + + /** + * @return {@link #implicated} (Indicates the resource representing the current activity or proposed activity that.) + */ + public List getImplicated() { + if (this.implicated == null) + this.implicated = new ArrayList(); + return this.implicated; + } + + public boolean hasImplicated() { + if (this.implicated == null) + return false; + for (Reference item : this.implicated) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #implicated} (Indicates the resource representing the current activity or proposed activity that.) + */ + // syntactic sugar + public Reference addImplicated() { //3 + Reference t = new Reference(); + if (this.implicated == null) + this.implicated = new ArrayList(); + this.implicated.add(t); + return t; + } + + // syntactic sugar + public Contraindication addImplicated(Reference t) { //3 + if (t == null) + return this; + if (this.implicated == null) + this.implicated = new ArrayList(); + this.implicated.add(t); + return this; + } + + /** + * @return {@link #implicated} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Indicates the resource representing the current activity or proposed activity that.) + */ + public List getImplicatedTarget() { + if (this.implicatedTarget == null) + this.implicatedTarget = new ArrayList(); + return this.implicatedTarget; + } + + /** + * @return {@link #detail} (A textual explanation of the contraindication.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value + */ + public StringType getDetailElement() { + if (this.detail == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contraindication.detail"); + else if (Configuration.doAutoCreate()) + this.detail = new StringType(); // bb + return this.detail; + } + + public boolean hasDetailElement() { + return this.detail != null && !this.detail.isEmpty(); + } + + public boolean hasDetail() { + return this.detail != null && !this.detail.isEmpty(); + } + + /** + * @param value {@link #detail} (A textual explanation of the contraindication.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value + */ + public Contraindication setDetailElement(StringType value) { + this.detail = value; + return this; + } + + /** + * @return A textual explanation of the contraindication. + */ + public String getDetail() { + return this.detail == null ? null : this.detail.getValue(); + } + + /** + * @param value A textual explanation of the contraindication. + */ + public Contraindication setDetail(String value) { + if (Utilities.noString(value)) + this.detail = null; + else { + if (this.detail == null) + this.detail = new StringType(); + this.detail.setValue(value); + } + return this; + } + + /** + * @return {@link #date} (The date or date-time when the contraindication was initially identified.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contraindication.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date or date-time when the contraindication was initially identified.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public Contraindication setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date or date-time when the contraindication was initially identified. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date or date-time when the contraindication was initially identified. + */ + public Contraindication setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #author} (Identifies the provider or software that identified the.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contraindication.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); // cc + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Identifies the provider or software that identified the.) + */ + public Contraindication setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the provider or software that identified the.) + */ + public Resource getAuthorTarget() { + return this.authorTarget; + } + + /** + * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the provider or software that identified the.) + */ + public Contraindication setAuthorTarget(Resource value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #identifier} (Business identifier associated with the contraindication record.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contraindication.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Business identifier associated with the contraindication record.) + */ + public Contraindication setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #reference} (The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public UriType getReferenceElement() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contraindication.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new UriType(); // bb + return this.reference; + } + + public boolean hasReferenceElement() { + return this.reference != null && !this.reference.isEmpty(); + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public Contraindication setReferenceElement(UriType value) { + this.reference = value; + return this; + } + + /** + * @return The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified. + */ + public String getReference() { + return this.reference == null ? null : this.reference.getValue(); + } + + /** + * @param value The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified. + */ + public Contraindication setReference(String value) { + if (Utilities.noString(value)) + this.reference = null; + else { + if (this.reference == null) + this.reference = new UriType(); + this.reference.setValue(value); + } + return this; + } + + /** + * @return {@link #mitigation} (Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.) + */ + public List getMitigation() { + if (this.mitigation == null) + this.mitigation = new ArrayList(); + return this.mitigation; + } + + public boolean hasMitigation() { + if (this.mitigation == null) + return false; + for (ContraindicationMitigationComponent item : this.mitigation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #mitigation} (Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.) + */ + // syntactic sugar + public ContraindicationMitigationComponent addMitigation() { //3 + ContraindicationMitigationComponent t = new ContraindicationMitigationComponent(); + if (this.mitigation == null) + this.mitigation = new ArrayList(); + this.mitigation.add(t); + return t; + } + + // syntactic sugar + public Contraindication addMitigation(ContraindicationMitigationComponent t) { //3 + if (t == null) + return this; + if (this.mitigation == null) + this.mitigation = new ArrayList(); + this.mitigation.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("patient", "Reference(Patient)", "Indicates the patient whose record the contraindication is associated with.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("category", "CodeableConcept", "Identifies the general type of issue identified.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("severity", "code", "Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.", 0, java.lang.Integer.MAX_VALUE, severity)); + childrenList.add(new Property("implicated", "Reference(Any)", "Indicates the resource representing the current activity or proposed activity that.", 0, java.lang.Integer.MAX_VALUE, implicated)); + childrenList.add(new Property("detail", "string", "A textual explanation of the contraindication.", 0, java.lang.Integer.MAX_VALUE, detail)); + childrenList.add(new Property("date", "dateTime", "The date or date-time when the contraindication was initially identified.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("author", "Reference(Practitioner|Device)", "Identifies the provider or software that identified the.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("identifier", "Identifier", "Business identifier associated with the contraindication record.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("reference", "uri", "The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("mitigation", "", "Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.", 0, java.lang.Integer.MAX_VALUE, mitigation)); + } + + public Contraindication copy() { + Contraindication dst = new Contraindication(); + copyValues(dst); + dst.patient = patient == null ? null : patient.copy(); + dst.category = category == null ? null : category.copy(); + dst.severity = severity == null ? null : severity.copy(); + if (implicated != null) { + dst.implicated = new ArrayList(); + for (Reference i : implicated) + dst.implicated.add(i.copy()); + }; + dst.detail = detail == null ? null : detail.copy(); + dst.date = date == null ? null : date.copy(); + dst.author = author == null ? null : author.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.reference = reference == null ? null : reference.copy(); + if (mitigation != null) { + dst.mitigation = new ArrayList(); + for (ContraindicationMitigationComponent i : mitigation) + dst.mitigation.add(i.copy()); + }; + return dst; + } + + protected Contraindication typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Contraindication)) + return false; + Contraindication o = (Contraindication) other; + return compareDeep(patient, o.patient, true) && compareDeep(category, o.category, true) && compareDeep(severity, o.severity, true) + && compareDeep(implicated, o.implicated, true) && compareDeep(detail, o.detail, true) && compareDeep(date, o.date, true) + && compareDeep(author, o.author, true) && compareDeep(identifier, o.identifier, true) && compareDeep(reference, o.reference, true) + && compareDeep(mitigation, o.mitigation, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Contraindication)) + return false; + Contraindication o = (Contraindication) other; + return compareValues(severity, o.severity, true) && compareValues(detail, o.detail, true) && compareValues(date, o.date, true) + && compareValues(reference, o.reference, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (patient == null || patient.isEmpty()) && (category == null || category.isEmpty()) + && (severity == null || severity.isEmpty()) && (implicated == null || implicated.isEmpty()) + && (detail == null || detail.isEmpty()) && (date == null || date.isEmpty()) && (author == null || author.isEmpty()) + && (identifier == null || identifier.isEmpty()) && (reference == null || reference.isEmpty()) + && (mitigation == null || mitigation.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Contraindication; + } + + @SearchParamDefinition(name="date", path="Contraindication.date", description="When identified", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="Contraindication.identifier", description="Unique id for the contraindication", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="patient", path="Contraindication.patient", description="Associated patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="author", path="Contraindication.author", description="Who found issue?", type="reference" ) + public static final String SP_AUTHOR = "author"; + @SearchParamDefinition(name="implicated", path="Contraindication.implicated", description="Problem resource", type="reference" ) + public static final String SP_IMPLICATED = "implicated"; + @SearchParamDefinition(name="category", path="Contraindication.category", description="E.g. Drug-drug, duplicate therapy, etc.", type="token" ) + public static final String SP_CATEGORY = "category"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Count.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Count.java index 9d0c9f81ddb..447074bc30b 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Count.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Count.java @@ -1,111 +1,90 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * 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(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Count)) - return false; - Count o = (Count) other; - return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(units, o.units, true) - && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Count)) - return false; - Count o = (Count) other; - return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(units, o.units, true) - && compareValues(system, o.system, true) && compareValues(code, o.code, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) - && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * 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(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Count)) + return false; + Count o = (Count) other; + return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(units, o.units, true) + && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Count)) + return false; + Count o = (Count) other; + return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(units, o.units, true) + && compareValues(system, o.system, true) && compareValues(code, o.code, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) + && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Coverage.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Coverage.java index 8a6bedddfd7..253afd88078 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Coverage.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Coverage.java @@ -1,845 +1,824 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Financial instrument which may be used to pay for or reimburse for health care products and services. - */ -@ResourceDef(name="Coverage", profile="http://hl7.org/fhir/Profile/Coverage") -public class Coverage extends DomainResource { - - /** - * The program or plan underwriter or payor. - */ - @Child(name = "issuer", type = {Organization.class}, order=0, min=0, max=1) - @Description(shortDefinition="An identifier for the plan issuer", formalDefinition="The program or plan underwriter or payor." ) - protected Reference issuer; - - /** - * The actual object that is the target of the reference (The program or plan underwriter or payor.) - */ - protected Organization issuerTarget; - - /** - * Business Identification Number (BIN number) used to identify the routing of eclaims if the insurer themselves don't have a BIN number for all of their business. - */ - @Child(name = "bin", type = {Identifier.class}, order=1, min=0, max=1) - @Description(shortDefinition="BIN Number", formalDefinition="Business Identification Number (BIN number) used to identify the routing of eclaims if the insurer themselves don't have a BIN number for all of their business." ) - protected Identifier bin; - - /** - * Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force. - */ - @Child(name = "period", type = {Period.class}, order=2, min=0, max=1) - @Description(shortDefinition="Coverage start and end dates", formalDefinition="Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force." ) - protected Period period; - - /** - * The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health. - */ - @Child(name = "type", type = {Coding.class}, order=3, min=0, max=1) - @Description(shortDefinition="Type of coverage", formalDefinition="The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health." ) - protected Coding type; - - /** - * The id issued to the subscriber. - */ - @Child(name = "subscriberId", type = {Identifier.class}, order=4, min=0, max=1) - @Description(shortDefinition="Subscriber ID", formalDefinition="The id issued to the subscriber." ) - protected Identifier subscriberId; - - /** - * The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID. - */ - @Child(name = "identifier", type = {Identifier.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The primary coverage ID", formalDefinition="The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID." ) - protected List identifier; - - /** - * Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. - */ - @Child(name = "group", type = {StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="An identifier for the group", formalDefinition="Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID." ) - protected StringType group; - - /** - * Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. - */ - @Child(name = "plan", type = {StringType.class}, order=7, min=0, max=1) - @Description(shortDefinition="An identifier for the plan", formalDefinition="Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID." ) - protected StringType plan; - - /** - * Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. - */ - @Child(name = "subPlan", type = {StringType.class}, order=8, min=0, max=1) - @Description(shortDefinition="An identifier for the subsection of the plan", formalDefinition="Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID." ) - protected StringType subPlan; - - /** - * A unique identifier for a dependent under the coverage. - */ - @Child(name = "dependent", type = {PositiveIntType.class}, order=9, min=0, max=1) - @Description(shortDefinition="The dependent number", formalDefinition="A unique identifier for a dependent under the coverage." ) - protected PositiveIntType dependent; - - /** - * An optional counter for a particular instance of the identified coverage which increments upon each renewal. - */ - @Child(name = "sequence", type = {PositiveIntType.class}, order=10, min=0, max=1) - @Description(shortDefinition="The plan instance or sequence counter", formalDefinition="An optional counter for a particular instance of the identified coverage which increments upon each renewal." ) - protected PositiveIntType sequence; - - /** - * The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due. - */ - @Child(name = "subscriber", type = {Patient.class}, order=11, min=0, max=1) - @Description(shortDefinition="Plan holder information", formalDefinition="The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due." ) - protected Reference subscriber; - - /** - * The actual object that is the target of the reference (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) - */ - protected Patient subscriberTarget; - - /** - * The identifier for a community of providers. - */ - @Child(name = "network", type = {Identifier.class}, order=12, min=0, max=1) - @Description(shortDefinition="Insurer network", formalDefinition="The identifier for a community of providers." ) - protected Identifier network; - - /** - * The policy(s) which constitute this insurance coverage. - */ - @Child(name = "contract", type = {Contract.class}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contract details", formalDefinition="The policy(s) which constitute this insurance coverage." ) - protected List contract; - /** - * The actual objects that are the target of the reference (The policy(s) which constitute this insurance coverage.) - */ - protected List contractTarget; - - - private static final long serialVersionUID = -1312031251L; - - /* - * Constructor - */ - public Coverage() { - super(); - } - - /** - * @return {@link #issuer} (The program or plan underwriter or payor.) - */ - public Reference getIssuer() { - if (this.issuer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.issuer"); - else if (Configuration.doAutoCreate()) - this.issuer = new Reference(); // cc - return this.issuer; - } - - public boolean hasIssuer() { - return this.issuer != null && !this.issuer.isEmpty(); - } - - /** - * @param value {@link #issuer} (The program or plan underwriter or payor.) - */ - public Coverage setIssuer(Reference value) { - this.issuer = value; - return this; - } - - /** - * @return {@link #issuer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The program or plan underwriter or payor.) - */ - public Organization getIssuerTarget() { - if (this.issuerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.issuer"); - else if (Configuration.doAutoCreate()) - this.issuerTarget = new Organization(); // aa - return this.issuerTarget; - } - - /** - * @param value {@link #issuer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The program or plan underwriter or payor.) - */ - public Coverage setIssuerTarget(Organization value) { - this.issuerTarget = value; - return this; - } - - /** - * @return {@link #bin} (Business Identification Number (BIN number) used to identify the routing of eclaims if the insurer themselves don't have a BIN number for all of their business.) - */ - public Identifier getBin() { - if (this.bin == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.bin"); - else if (Configuration.doAutoCreate()) - this.bin = new Identifier(); // cc - return this.bin; - } - - public boolean hasBin() { - return this.bin != null && !this.bin.isEmpty(); - } - - /** - * @param value {@link #bin} (Business Identification Number (BIN number) used to identify the routing of eclaims if the insurer themselves don't have a BIN number for all of their business.) - */ - public Coverage setBin(Identifier value) { - this.bin = value; - return this; - } - - /** - * @return {@link #period} (Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.) - */ - public Coverage setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #type} (The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.) - */ - public Coverage setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #subscriberId} (The id issued to the subscriber.) - */ - public Identifier getSubscriberId() { - if (this.subscriberId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.subscriberId"); - else if (Configuration.doAutoCreate()) - this.subscriberId = new Identifier(); // cc - return this.subscriberId; - } - - public boolean hasSubscriberId() { - return this.subscriberId != null && !this.subscriberId.isEmpty(); - } - - /** - * @param value {@link #subscriberId} (The id issued to the subscriber.) - */ - public Coverage setSubscriberId(Identifier value) { - this.subscriberId = value; - return this; - } - - /** - * @return {@link #identifier} (The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Coverage addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #group} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getGroup" gives direct access to the value - */ - public StringType getGroupElement() { - if (this.group == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.group"); - else if (Configuration.doAutoCreate()) - this.group = new StringType(); // bb - return this.group; - } - - public boolean hasGroupElement() { - return this.group != null && !this.group.isEmpty(); - } - - public boolean hasGroup() { - return this.group != null && !this.group.isEmpty(); - } - - /** - * @param value {@link #group} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getGroup" gives direct access to the value - */ - public Coverage setGroupElement(StringType value) { - this.group = value; - return this; - } - - /** - * @return Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. - */ - public String getGroup() { - return this.group == null ? null : this.group.getValue(); - } - - /** - * @param value Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. - */ - public Coverage setGroup(String value) { - if (Utilities.noString(value)) - this.group = null; - else { - if (this.group == null) - this.group = new StringType(); - this.group.setValue(value); - } - return this; - } - - /** - * @return {@link #plan} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getPlan" gives direct access to the value - */ - public StringType getPlanElement() { - if (this.plan == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.plan"); - else if (Configuration.doAutoCreate()) - this.plan = new StringType(); // bb - return this.plan; - } - - public boolean hasPlanElement() { - return this.plan != null && !this.plan.isEmpty(); - } - - public boolean hasPlan() { - return this.plan != null && !this.plan.isEmpty(); - } - - /** - * @param value {@link #plan} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getPlan" gives direct access to the value - */ - public Coverage setPlanElement(StringType value) { - this.plan = value; - return this; - } - - /** - * @return Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. - */ - public String getPlan() { - return this.plan == null ? null : this.plan.getValue(); - } - - /** - * @param value Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. - */ - public Coverage setPlan(String value) { - if (Utilities.noString(value)) - this.plan = null; - else { - if (this.plan == null) - this.plan = new StringType(); - this.plan.setValue(value); - } - return this; - } - - /** - * @return {@link #subPlan} (Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID.). This is the underlying object with id, value and extensions. The accessor "getSubPlan" gives direct access to the value - */ - public StringType getSubPlanElement() { - if (this.subPlan == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.subPlan"); - else if (Configuration.doAutoCreate()) - this.subPlan = new StringType(); // bb - return this.subPlan; - } - - public boolean hasSubPlanElement() { - return this.subPlan != null && !this.subPlan.isEmpty(); - } - - public boolean hasSubPlan() { - return this.subPlan != null && !this.subPlan.isEmpty(); - } - - /** - * @param value {@link #subPlan} (Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID.). This is the underlying object with id, value and extensions. The accessor "getSubPlan" gives direct access to the value - */ - public Coverage setSubPlanElement(StringType value) { - this.subPlan = value; - return this; - } - - /** - * @return Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. - */ - public String getSubPlan() { - return this.subPlan == null ? null : this.subPlan.getValue(); - } - - /** - * @param value Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. - */ - public Coverage setSubPlan(String value) { - if (Utilities.noString(value)) - this.subPlan = null; - else { - if (this.subPlan == null) - this.subPlan = new StringType(); - this.subPlan.setValue(value); - } - return this; - } - - /** - * @return {@link #dependent} (A unique identifier for a dependent under the coverage.). This is the underlying object with id, value and extensions. The accessor "getDependent" gives direct access to the value - */ - public PositiveIntType getDependentElement() { - if (this.dependent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.dependent"); - else if (Configuration.doAutoCreate()) - this.dependent = new PositiveIntType(); // bb - return this.dependent; - } - - public boolean hasDependentElement() { - return this.dependent != null && !this.dependent.isEmpty(); - } - - public boolean hasDependent() { - return this.dependent != null && !this.dependent.isEmpty(); - } - - /** - * @param value {@link #dependent} (A unique identifier for a dependent under the coverage.). This is the underlying object with id, value and extensions. The accessor "getDependent" gives direct access to the value - */ - public Coverage setDependentElement(PositiveIntType value) { - this.dependent = value; - return this; - } - - /** - * @return A unique identifier for a dependent under the coverage. - */ - public int getDependent() { - return this.dependent == null || this.dependent.isEmpty() ? 0 : this.dependent.getValue(); - } - - /** - * @param value A unique identifier for a dependent under the coverage. - */ - public Coverage setDependent(int value) { - if (this.dependent == null) - this.dependent = new PositiveIntType(); - this.dependent.setValue(value); - return this; - } - - /** - * @return {@link #sequence} (An optional counter for a particular instance of the identified coverage which increments upon each renewal.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public PositiveIntType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new PositiveIntType(); // bb - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (An optional counter for a particular instance of the identified coverage which increments upon each renewal.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public Coverage setSequenceElement(PositiveIntType value) { - this.sequence = value; - return this; - } - - /** - * @return An optional counter for a particular instance of the identified coverage which increments upon each renewal. - */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); - } - - /** - * @param value An optional counter for a particular instance of the identified coverage which increments upon each renewal. - */ - public Coverage setSequence(int value) { - if (this.sequence == null) - this.sequence = new PositiveIntType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #subscriber} (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) - */ - public Reference getSubscriber() { - if (this.subscriber == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.subscriber"); - else if (Configuration.doAutoCreate()) - this.subscriber = new Reference(); // cc - return this.subscriber; - } - - public boolean hasSubscriber() { - return this.subscriber != null && !this.subscriber.isEmpty(); - } - - /** - * @param value {@link #subscriber} (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) - */ - public Coverage setSubscriber(Reference value) { - this.subscriber = value; - return this; - } - - /** - * @return {@link #subscriber} The actual object that is the 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 party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) - */ - public Patient getSubscriberTarget() { - if (this.subscriberTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.subscriber"); - else if (Configuration.doAutoCreate()) - this.subscriberTarget = new Patient(); // aa - return this.subscriberTarget; - } - - /** - * @param value {@link #subscriber} The actual object that is the 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 party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) - */ - public Coverage setSubscriberTarget(Patient value) { - this.subscriberTarget = value; - return this; - } - - /** - * @return {@link #network} (The identifier for a community of providers.) - */ - public Identifier getNetwork() { - if (this.network == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.network"); - else if (Configuration.doAutoCreate()) - this.network = new Identifier(); // cc - return this.network; - } - - public boolean hasNetwork() { - return this.network != null && !this.network.isEmpty(); - } - - /** - * @param value {@link #network} (The identifier for a community of providers.) - */ - public Coverage setNetwork(Identifier value) { - this.network = value; - return this; - } - - /** - * @return {@link #contract} (The policy(s) which constitute this insurance coverage.) - */ - public List getContract() { - if (this.contract == null) - this.contract = new ArrayList(); - return this.contract; - } - - public boolean hasContract() { - if (this.contract == null) - return false; - for (Reference item : this.contract) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contract} (The policy(s) which constitute this insurance coverage.) - */ - // syntactic sugar - public Reference addContract() { //3 - Reference t = new Reference(); - if (this.contract == null) - this.contract = new ArrayList(); - this.contract.add(t); - return t; - } - - // syntactic sugar - public Coverage addContract(Reference t) { //3 - if (t == null) - return this; - if (this.contract == null) - this.contract = new ArrayList(); - this.contract.add(t); - return this; - } - - /** - * @return {@link #contract} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The policy(s) which constitute this insurance coverage.) - */ - public List getContractTarget() { - if (this.contractTarget == null) - this.contractTarget = new ArrayList(); - return this.contractTarget; - } - - // syntactic sugar - /** - * @return {@link #contract} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The policy(s) which constitute this insurance coverage.) - */ - public Contract addContractTarget() { - Contract r = new Contract(); - if (this.contractTarget == null) - this.contractTarget = new ArrayList(); - this.contractTarget.add(r); - return r; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("issuer", "Reference(Organization)", "The program or plan underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, issuer)); - childrenList.add(new Property("bin", "Identifier", "Business Identification Number (BIN number) used to identify the routing of eclaims if the insurer themselves don't have a BIN number for all of their business.", 0, java.lang.Integer.MAX_VALUE, bin)); - childrenList.add(new Property("period", "Period", "Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("type", "Coding", "The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("subscriberId", "Identifier", "The id issued to the subscriber.", 0, java.lang.Integer.MAX_VALUE, subscriberId)); - childrenList.add(new Property("identifier", "Identifier", "The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("group", "string", "Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.", 0, java.lang.Integer.MAX_VALUE, group)); - childrenList.add(new Property("plan", "string", "Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.", 0, java.lang.Integer.MAX_VALUE, plan)); - childrenList.add(new Property("subPlan", "string", "Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID.", 0, java.lang.Integer.MAX_VALUE, subPlan)); - childrenList.add(new Property("dependent", "positiveInt", "A unique identifier for a dependent under the coverage.", 0, java.lang.Integer.MAX_VALUE, dependent)); - childrenList.add(new Property("sequence", "positiveInt", "An optional counter for a particular instance of the identified coverage which increments upon each renewal.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("subscriber", "Reference(Patient)", "The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.", 0, java.lang.Integer.MAX_VALUE, subscriber)); - childrenList.add(new Property("network", "Identifier", "The identifier for a community of providers.", 0, java.lang.Integer.MAX_VALUE, network)); - childrenList.add(new Property("contract", "Reference(Contract)", "The policy(s) which constitute this insurance coverage.", 0, java.lang.Integer.MAX_VALUE, contract)); - } - - public Coverage copy() { - Coverage dst = new Coverage(); - copyValues(dst); - dst.issuer = issuer == null ? null : issuer.copy(); - dst.bin = bin == null ? null : bin.copy(); - dst.period = period == null ? null : period.copy(); - dst.type = type == null ? null : type.copy(); - dst.subscriberId = subscriberId == null ? null : subscriberId.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.group = group == null ? null : group.copy(); - dst.plan = plan == null ? null : plan.copy(); - dst.subPlan = subPlan == null ? null : subPlan.copy(); - dst.dependent = dependent == null ? null : dependent.copy(); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.subscriber = subscriber == null ? null : subscriber.copy(); - dst.network = network == null ? null : network.copy(); - if (contract != null) { - dst.contract = new ArrayList(); - for (Reference i : contract) - dst.contract.add(i.copy()); - }; - return dst; - } - - protected Coverage typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Coverage)) - return false; - Coverage o = (Coverage) other; - return compareDeep(issuer, o.issuer, true) && compareDeep(bin, o.bin, true) && compareDeep(period, o.period, true) - && compareDeep(type, o.type, true) && compareDeep(subscriberId, o.subscriberId, true) && compareDeep(identifier, o.identifier, true) - && compareDeep(group, o.group, true) && compareDeep(plan, o.plan, true) && compareDeep(subPlan, o.subPlan, true) - && compareDeep(dependent, o.dependent, true) && compareDeep(sequence, o.sequence, true) && compareDeep(subscriber, o.subscriber, true) - && compareDeep(network, o.network, true) && compareDeep(contract, o.contract, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Coverage)) - return false; - Coverage o = (Coverage) other; - return compareValues(group, o.group, true) && compareValues(plan, o.plan, true) && compareValues(subPlan, o.subPlan, true) - && compareValues(dependent, o.dependent, true) && compareValues(sequence, o.sequence, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (issuer == null || issuer.isEmpty()) && (bin == null || bin.isEmpty()) - && (period == null || period.isEmpty()) && (type == null || type.isEmpty()) && (subscriberId == null || subscriberId.isEmpty()) - && (identifier == null || identifier.isEmpty()) && (group == null || group.isEmpty()) && (plan == null || plan.isEmpty()) - && (subPlan == null || subPlan.isEmpty()) && (dependent == null || dependent.isEmpty()) && (sequence == null || sequence.isEmpty()) - && (subscriber == null || subscriber.isEmpty()) && (network == null || network.isEmpty()) - && (contract == null || contract.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Coverage; - } - - @SearchParamDefinition(name="plan", path="Coverage.plan", description="A plan or policy identifier", type="token" ) - public static final String SP_PLAN = "plan"; - @SearchParamDefinition(name="issuer", path="Coverage.issuer", description="The identity of the insurer", type="reference" ) - public static final String SP_ISSUER = "issuer"; - @SearchParamDefinition(name="sequence", path="Coverage.sequence", description="Sequence number", type="token" ) - public static final String SP_SEQUENCE = "sequence"; - @SearchParamDefinition(name="dependent", path="Coverage.dependent", description="Dependent number", type="token" ) - public static final String SP_DEPENDENT = "dependent"; - @SearchParamDefinition(name="group", path="Coverage.group", description="Group identifier", type="token" ) - public static final String SP_GROUP = "group"; - @SearchParamDefinition(name="type", path="Coverage.type", description="The kind of coverage", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="identifier", path="Coverage.identifier", description="The primary identifier of the insured", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="subplan", path="Coverage.subPlan", description="Sub-plan identifier", type="token" ) - public static final String SP_SUBPLAN = "subplan"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Financial instrument which may be used to pay for or reimburse for health care products and services. + */ +@ResourceDef(name="Coverage", profile="http://hl7.org/fhir/Profile/Coverage") +public class Coverage extends DomainResource { + + /** + * The program or plan underwriter or payor. + */ + @Child(name = "issuer", type = {Organization.class}, order=0, min=0, max=1) + @Description(shortDefinition="An identifier for the plan issuer", formalDefinition="The program or plan underwriter or payor." ) + protected Reference issuer; + + /** + * The actual object that is the target of the reference (The program or plan underwriter or payor.) + */ + protected Organization issuerTarget; + + /** + * Business Identification Number (BIN number) used to identify the routing of eclaims if the insurer themselves don't have a BIN number for all of their business. + */ + @Child(name = "bin", type = {Identifier.class}, order=1, min=0, max=1) + @Description(shortDefinition="BIN Number", formalDefinition="Business Identification Number (BIN number) used to identify the routing of eclaims if the insurer themselves don't have a BIN number for all of their business." ) + protected Identifier bin; + + /** + * Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force. + */ + @Child(name = "period", type = {Period.class}, order=2, min=0, max=1) + @Description(shortDefinition="Coverage start and end dates", formalDefinition="Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force." ) + protected Period period; + + /** + * The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health. + */ + @Child(name = "type", type = {Coding.class}, order=3, min=0, max=1) + @Description(shortDefinition="Type of coverage", formalDefinition="The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health." ) + protected Coding type; + + /** + * The id issued to the subscriber. + */ + @Child(name = "subscriberId", type = {Identifier.class}, order=4, min=0, max=1) + @Description(shortDefinition="Subscriber ID", formalDefinition="The id issued to the subscriber." ) + protected Identifier subscriberId; + + /** + * The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID. + */ + @Child(name = "identifier", type = {Identifier.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The primary coverage ID", formalDefinition="The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID." ) + protected List identifier; + + /** + * Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. + */ + @Child(name = "group", type = {StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="An identifier for the group", formalDefinition="Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID." ) + protected StringType group; + + /** + * Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. + */ + @Child(name = "plan", type = {StringType.class}, order=7, min=0, max=1) + @Description(shortDefinition="An identifier for the plan", formalDefinition="Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID." ) + protected StringType plan; + + /** + * Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. + */ + @Child(name = "subPlan", type = {StringType.class}, order=8, min=0, max=1) + @Description(shortDefinition="An identifier for the subsection of the plan", formalDefinition="Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID." ) + protected StringType subPlan; + + /** + * A unique identifier for a dependent under the coverage. + */ + @Child(name = "dependent", type = {PositiveIntType.class}, order=9, min=0, max=1) + @Description(shortDefinition="The dependent number", formalDefinition="A unique identifier for a dependent under the coverage." ) + protected PositiveIntType dependent; + + /** + * An optional counter for a particular instance of the identified coverage which increments upon each renewal. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=10, min=0, max=1) + @Description(shortDefinition="The plan instance or sequence counter", formalDefinition="An optional counter for a particular instance of the identified coverage which increments upon each renewal." ) + protected PositiveIntType sequence; + + /** + * The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due. + */ + @Child(name = "subscriber", type = {Patient.class}, order=11, min=0, max=1) + @Description(shortDefinition="Plan holder information", formalDefinition="The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due." ) + protected Reference subscriber; + + /** + * The actual object that is the target of the reference (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) + */ + protected Patient subscriberTarget; + + /** + * The identifier for a community of providers. + */ + @Child(name = "network", type = {Identifier.class}, order=12, min=0, max=1) + @Description(shortDefinition="Insurer network", formalDefinition="The identifier for a community of providers." ) + protected Identifier network; + + /** + * The policy(s) which constitute this insurance coverage. + */ + @Child(name = "contract", type = {Contract.class}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contract details", formalDefinition="The policy(s) which constitute this insurance coverage." ) + protected List contract; + /** + * The actual objects that are the target of the reference (The policy(s) which constitute this insurance coverage.) + */ + protected List contractTarget; + + + private static final long serialVersionUID = -1312031251L; + + /* + * Constructor + */ + public Coverage() { + super(); + } + + /** + * @return {@link #issuer} (The program or plan underwriter or payor.) + */ + public Reference getIssuer() { + if (this.issuer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.issuer"); + else if (Configuration.doAutoCreate()) + this.issuer = new Reference(); // cc + return this.issuer; + } + + public boolean hasIssuer() { + return this.issuer != null && !this.issuer.isEmpty(); + } + + /** + * @param value {@link #issuer} (The program or plan underwriter or payor.) + */ + public Coverage setIssuer(Reference value) { + this.issuer = value; + return this; + } + + /** + * @return {@link #issuer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The program or plan underwriter or payor.) + */ + public Organization getIssuerTarget() { + if (this.issuerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.issuer"); + else if (Configuration.doAutoCreate()) + this.issuerTarget = new Organization(); // aa + return this.issuerTarget; + } + + /** + * @param value {@link #issuer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The program or plan underwriter or payor.) + */ + public Coverage setIssuerTarget(Organization value) { + this.issuerTarget = value; + return this; + } + + /** + * @return {@link #bin} (Business Identification Number (BIN number) used to identify the routing of eclaims if the insurer themselves don't have a BIN number for all of their business.) + */ + public Identifier getBin() { + if (this.bin == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.bin"); + else if (Configuration.doAutoCreate()) + this.bin = new Identifier(); // cc + return this.bin; + } + + public boolean hasBin() { + return this.bin != null && !this.bin.isEmpty(); + } + + /** + * @param value {@link #bin} (Business Identification Number (BIN number) used to identify the routing of eclaims if the insurer themselves don't have a BIN number for all of their business.) + */ + public Coverage setBin(Identifier value) { + this.bin = value; + return this; + } + + /** + * @return {@link #period} (Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.) + */ + public Coverage setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #type} (The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.) + */ + public Coverage setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #subscriberId} (The id issued to the subscriber.) + */ + public Identifier getSubscriberId() { + if (this.subscriberId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.subscriberId"); + else if (Configuration.doAutoCreate()) + this.subscriberId = new Identifier(); // cc + return this.subscriberId; + } + + public boolean hasSubscriberId() { + return this.subscriberId != null && !this.subscriberId.isEmpty(); + } + + /** + * @param value {@link #subscriberId} (The id issued to the subscriber.) + */ + public Coverage setSubscriberId(Identifier value) { + this.subscriberId = value; + return this; + } + + /** + * @return {@link #identifier} (The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Coverage addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #group} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getGroup" gives direct access to the value + */ + public StringType getGroupElement() { + if (this.group == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.group"); + else if (Configuration.doAutoCreate()) + this.group = new StringType(); // bb + return this.group; + } + + public boolean hasGroupElement() { + return this.group != null && !this.group.isEmpty(); + } + + public boolean hasGroup() { + return this.group != null && !this.group.isEmpty(); + } + + /** + * @param value {@link #group} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getGroup" gives direct access to the value + */ + public Coverage setGroupElement(StringType value) { + this.group = value; + return this; + } + + /** + * @return Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. + */ + public String getGroup() { + return this.group == null ? null : this.group.getValue(); + } + + /** + * @param value Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. + */ + public Coverage setGroup(String value) { + if (Utilities.noString(value)) + this.group = null; + else { + if (this.group == null) + this.group = new StringType(); + this.group.setValue(value); + } + return this; + } + + /** + * @return {@link #plan} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getPlan" gives direct access to the value + */ + public StringType getPlanElement() { + if (this.plan == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.plan"); + else if (Configuration.doAutoCreate()) + this.plan = new StringType(); // bb + return this.plan; + } + + public boolean hasPlanElement() { + return this.plan != null && !this.plan.isEmpty(); + } + + public boolean hasPlan() { + return this.plan != null && !this.plan.isEmpty(); + } + + /** + * @param value {@link #plan} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getPlan" gives direct access to the value + */ + public Coverage setPlanElement(StringType value) { + this.plan = value; + return this; + } + + /** + * @return Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. + */ + public String getPlan() { + return this.plan == null ? null : this.plan.getValue(); + } + + /** + * @param value Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. + */ + public Coverage setPlan(String value) { + if (Utilities.noString(value)) + this.plan = null; + else { + if (this.plan == null) + this.plan = new StringType(); + this.plan.setValue(value); + } + return this; + } + + /** + * @return {@link #subPlan} (Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID.). This is the underlying object with id, value and extensions. The accessor "getSubPlan" gives direct access to the value + */ + public StringType getSubPlanElement() { + if (this.subPlan == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.subPlan"); + else if (Configuration.doAutoCreate()) + this.subPlan = new StringType(); // bb + return this.subPlan; + } + + public boolean hasSubPlanElement() { + return this.subPlan != null && !this.subPlan.isEmpty(); + } + + public boolean hasSubPlan() { + return this.subPlan != null && !this.subPlan.isEmpty(); + } + + /** + * @param value {@link #subPlan} (Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID.). This is the underlying object with id, value and extensions. The accessor "getSubPlan" gives direct access to the value + */ + public Coverage setSubPlanElement(StringType value) { + this.subPlan = value; + return this; + } + + /** + * @return Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. + */ + public String getSubPlan() { + return this.subPlan == null ? null : this.subPlan.getValue(); + } + + /** + * @param value Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. + */ + public Coverage setSubPlan(String value) { + if (Utilities.noString(value)) + this.subPlan = null; + else { + if (this.subPlan == null) + this.subPlan = new StringType(); + this.subPlan.setValue(value); + } + return this; + } + + /** + * @return {@link #dependent} (A unique identifier for a dependent under the coverage.). This is the underlying object with id, value and extensions. The accessor "getDependent" gives direct access to the value + */ + public PositiveIntType getDependentElement() { + if (this.dependent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.dependent"); + else if (Configuration.doAutoCreate()) + this.dependent = new PositiveIntType(); // bb + return this.dependent; + } + + public boolean hasDependentElement() { + return this.dependent != null && !this.dependent.isEmpty(); + } + + public boolean hasDependent() { + return this.dependent != null && !this.dependent.isEmpty(); + } + + /** + * @param value {@link #dependent} (A unique identifier for a dependent under the coverage.). This is the underlying object with id, value and extensions. The accessor "getDependent" gives direct access to the value + */ + public Coverage setDependentElement(PositiveIntType value) { + this.dependent = value; + return this; + } + + /** + * @return A unique identifier for a dependent under the coverage. + */ + public int getDependent() { + return this.dependent == null || this.dependent.isEmpty() ? 0 : this.dependent.getValue(); + } + + /** + * @param value A unique identifier for a dependent under the coverage. + */ + public Coverage setDependent(int value) { + if (this.dependent == null) + this.dependent = new PositiveIntType(); + this.dependent.setValue(value); + return this; + } + + /** + * @return {@link #sequence} (An optional counter for a particular instance of the identified coverage which increments upon each renewal.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (An optional counter for a particular instance of the identified coverage which increments upon each renewal.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public Coverage setSequenceElement(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return An optional counter for a particular instance of the identified coverage which increments upon each renewal. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value An optional counter for a particular instance of the identified coverage which increments upon each renewal. + */ + public Coverage setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #subscriber} (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) + */ + public Reference getSubscriber() { + if (this.subscriber == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.subscriber"); + else if (Configuration.doAutoCreate()) + this.subscriber = new Reference(); // cc + return this.subscriber; + } + + public boolean hasSubscriber() { + return this.subscriber != null && !this.subscriber.isEmpty(); + } + + /** + * @param value {@link #subscriber} (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) + */ + public Coverage setSubscriber(Reference value) { + this.subscriber = value; + return this; + } + + /** + * @return {@link #subscriber} The actual object that is the 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 party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) + */ + public Patient getSubscriberTarget() { + if (this.subscriberTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.subscriber"); + else if (Configuration.doAutoCreate()) + this.subscriberTarget = new Patient(); // aa + return this.subscriberTarget; + } + + /** + * @param value {@link #subscriber} The actual object that is the 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 party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) + */ + public Coverage setSubscriberTarget(Patient value) { + this.subscriberTarget = value; + return this; + } + + /** + * @return {@link #network} (The identifier for a community of providers.) + */ + public Identifier getNetwork() { + if (this.network == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.network"); + else if (Configuration.doAutoCreate()) + this.network = new Identifier(); // cc + return this.network; + } + + public boolean hasNetwork() { + return this.network != null && !this.network.isEmpty(); + } + + /** + * @param value {@link #network} (The identifier for a community of providers.) + */ + public Coverage setNetwork(Identifier value) { + this.network = value; + return this; + } + + /** + * @return {@link #contract} (The policy(s) which constitute this insurance coverage.) + */ + public List getContract() { + if (this.contract == null) + this.contract = new ArrayList(); + return this.contract; + } + + public boolean hasContract() { + if (this.contract == null) + return false; + for (Reference item : this.contract) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contract} (The policy(s) which constitute this insurance coverage.) + */ + // syntactic sugar + public Reference addContract() { //3 + Reference t = new Reference(); + if (this.contract == null) + this.contract = new ArrayList(); + this.contract.add(t); + return t; + } + + // syntactic sugar + public Coverage addContract(Reference t) { //3 + if (t == null) + return this; + if (this.contract == null) + this.contract = new ArrayList(); + this.contract.add(t); + return this; + } + + /** + * @return {@link #contract} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The policy(s) which constitute this insurance coverage.) + */ + public List getContractTarget() { + if (this.contractTarget == null) + this.contractTarget = new ArrayList(); + return this.contractTarget; + } + + // syntactic sugar + /** + * @return {@link #contract} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The policy(s) which constitute this insurance coverage.) + */ + public Contract addContractTarget() { + Contract r = new Contract(); + if (this.contractTarget == null) + this.contractTarget = new ArrayList(); + this.contractTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("issuer", "Reference(Organization)", "The program or plan underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, issuer)); + childrenList.add(new Property("bin", "Identifier", "Business Identification Number (BIN number) used to identify the routing of eclaims if the insurer themselves don't have a BIN number for all of their business.", 0, java.lang.Integer.MAX_VALUE, bin)); + childrenList.add(new Property("period", "Period", "Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("type", "Coding", "The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("subscriberId", "Identifier", "The id issued to the subscriber.", 0, java.lang.Integer.MAX_VALUE, subscriberId)); + childrenList.add(new Property("identifier", "Identifier", "The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("group", "string", "Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.", 0, java.lang.Integer.MAX_VALUE, group)); + childrenList.add(new Property("plan", "string", "Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.", 0, java.lang.Integer.MAX_VALUE, plan)); + childrenList.add(new Property("subPlan", "string", "Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID.", 0, java.lang.Integer.MAX_VALUE, subPlan)); + childrenList.add(new Property("dependent", "positiveInt", "A unique identifier for a dependent under the coverage.", 0, java.lang.Integer.MAX_VALUE, dependent)); + childrenList.add(new Property("sequence", "positiveInt", "An optional counter for a particular instance of the identified coverage which increments upon each renewal.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("subscriber", "Reference(Patient)", "The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.", 0, java.lang.Integer.MAX_VALUE, subscriber)); + childrenList.add(new Property("network", "Identifier", "The identifier for a community of providers.", 0, java.lang.Integer.MAX_VALUE, network)); + childrenList.add(new Property("contract", "Reference(Contract)", "The policy(s) which constitute this insurance coverage.", 0, java.lang.Integer.MAX_VALUE, contract)); + } + + public Coverage copy() { + Coverage dst = new Coverage(); + copyValues(dst); + dst.issuer = issuer == null ? null : issuer.copy(); + dst.bin = bin == null ? null : bin.copy(); + dst.period = period == null ? null : period.copy(); + dst.type = type == null ? null : type.copy(); + dst.subscriberId = subscriberId == null ? null : subscriberId.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.group = group == null ? null : group.copy(); + dst.plan = plan == null ? null : plan.copy(); + dst.subPlan = subPlan == null ? null : subPlan.copy(); + dst.dependent = dependent == null ? null : dependent.copy(); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.subscriber = subscriber == null ? null : subscriber.copy(); + dst.network = network == null ? null : network.copy(); + if (contract != null) { + dst.contract = new ArrayList(); + for (Reference i : contract) + dst.contract.add(i.copy()); + }; + return dst; + } + + protected Coverage typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Coverage)) + return false; + Coverage o = (Coverage) other; + return compareDeep(issuer, o.issuer, true) && compareDeep(bin, o.bin, true) && compareDeep(period, o.period, true) + && compareDeep(type, o.type, true) && compareDeep(subscriberId, o.subscriberId, true) && compareDeep(identifier, o.identifier, true) + && compareDeep(group, o.group, true) && compareDeep(plan, o.plan, true) && compareDeep(subPlan, o.subPlan, true) + && compareDeep(dependent, o.dependent, true) && compareDeep(sequence, o.sequence, true) && compareDeep(subscriber, o.subscriber, true) + && compareDeep(network, o.network, true) && compareDeep(contract, o.contract, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Coverage)) + return false; + Coverage o = (Coverage) other; + return compareValues(group, o.group, true) && compareValues(plan, o.plan, true) && compareValues(subPlan, o.subPlan, true) + && compareValues(dependent, o.dependent, true) && compareValues(sequence, o.sequence, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (issuer == null || issuer.isEmpty()) && (bin == null || bin.isEmpty()) + && (period == null || period.isEmpty()) && (type == null || type.isEmpty()) && (subscriberId == null || subscriberId.isEmpty()) + && (identifier == null || identifier.isEmpty()) && (group == null || group.isEmpty()) && (plan == null || plan.isEmpty()) + && (subPlan == null || subPlan.isEmpty()) && (dependent == null || dependent.isEmpty()) && (sequence == null || sequence.isEmpty()) + && (subscriber == null || subscriber.isEmpty()) && (network == null || network.isEmpty()) + && (contract == null || contract.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Coverage; + } + + @SearchParamDefinition(name="identifier", path="Coverage.identifier", description="The primary identifier of the insured", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="sequence", path="Coverage.sequence", description="Sequence number", type="token" ) + public static final String SP_SEQUENCE = "sequence"; + @SearchParamDefinition(name="subplan", path="Coverage.subPlan", description="Sub-plan identifier", type="token" ) + public static final String SP_SUBPLAN = "subplan"; + @SearchParamDefinition(name="type", path="Coverage.type", description="The kind of coverage", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="plan", path="Coverage.plan", description="A plan or policy identifier", type="token" ) + public static final String SP_PLAN = "plan"; + @SearchParamDefinition(name="dependent", path="Coverage.dependent", description="Dependent number", type="token" ) + public static final String SP_DEPENDENT = "dependent"; + @SearchParamDefinition(name="issuer", path="Coverage.issuer", description="The identity of the insurer", type="reference" ) + public static final String SP_ISSUER = "issuer"; + @SearchParamDefinition(name="group", path="Coverage.group", description="Group identifier", type="token" ) + public static final String SP_GROUP = "group"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DataElement.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DataElement.java index d93b44bbfb6..b58aed3bdb8 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DataElement.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DataElement.java @@ -1,1497 +1,1476 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import java.util.*; - -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.instance.model.Enumerations.*; -import org.hl7.fhir.instance.model.annotations.ResourceDef; -import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; -import org.hl7.fhir.instance.model.annotations.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * The formal description of a single piece of information that can be gathered and reported. - */ -@ResourceDef(name="DataElement", profile="http://hl7.org/fhir/Profile/DataElement") -public class DataElement extends DomainResource { - - public enum DataelementSpecificity { - /** - * The data element is sufficiently well-constrained that multiple pieces of data captured according to the constraints of the data element will be comparable (though in some cases, a degree of automated conversion/normalization may be required). - */ - COMPARABLE, - /** - * The data element is fully specified down to a single value set, single unit of measure, single data type, etc. Multiple pieces of data associated with this data element are fully compareable. - */ - FULLYSPECIFIED, - /** - * The data element allows multiple units of measure having equivalent meaning. E.g. "cc" (cubic centimeter) and "mL". - */ - EQUIVALENT, - /** - * The data element allows multiple units of measure that are convertable between each other (e.g. Inches and centimeters) and/or allows data to be captured in multiple value sets for which a known mapping exists allowing conversion of meaning. - */ - CONVERTABLE, - /** - * A convertable data element where unit conversions are different only by a power of 10. E.g. g, mg, kg. - */ - SCALEABLE, - /** - * The data element is unconstrained in units, choice of data types and/or choice of vocabulary such that automated comparison of data captured using the data element is not possible. - */ - FLEXIBLE, - /** - * added to help the parsers - */ - NULL; - public static DataelementSpecificity fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("comparable".equals(codeString)) - return COMPARABLE; - if ("fully-specified".equals(codeString)) - return FULLYSPECIFIED; - if ("equivalent".equals(codeString)) - return EQUIVALENT; - if ("convertable".equals(codeString)) - return CONVERTABLE; - if ("scaleable".equals(codeString)) - return SCALEABLE; - if ("flexible".equals(codeString)) - return FLEXIBLE; - throw new Exception("Unknown DataelementSpecificity code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case COMPARABLE: return "comparable"; - case FULLYSPECIFIED: return "fully-specified"; - case EQUIVALENT: return "equivalent"; - case CONVERTABLE: return "convertable"; - case SCALEABLE: return "scaleable"; - case FLEXIBLE: return "flexible"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case COMPARABLE: return ""; - case FULLYSPECIFIED: return ""; - case EQUIVALENT: return ""; - case CONVERTABLE: return ""; - case SCALEABLE: return ""; - case FLEXIBLE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case COMPARABLE: return "The data element is sufficiently well-constrained that multiple pieces of data captured according to the constraints of the data element will be comparable (though in some cases, a degree of automated conversion/normalization may be required)."; - case FULLYSPECIFIED: return "The data element is fully specified down to a single value set, single unit of measure, single data type, etc. Multiple pieces of data associated with this data element are fully compareable."; - case EQUIVALENT: return "The data element allows multiple units of measure having equivalent meaning. E.g. 'cc' (cubic centimeter) and 'mL'."; - case CONVERTABLE: return "The data element allows multiple units of measure that are convertable between each other (e.g. Inches and centimeters) and/or allows data to be captured in multiple value sets for which a known mapping exists allowing conversion of meaning."; - case SCALEABLE: return "A convertable data element where unit conversions are different only by a power of 10. E.g. g, mg, kg."; - case FLEXIBLE: return "The data element is unconstrained in units, choice of data types and/or choice of vocabulary such that automated comparison of data captured using the data element is not possible."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case COMPARABLE: return "Comparable"; - case FULLYSPECIFIED: return "Fully Specified"; - case EQUIVALENT: return "Equivalent"; - case CONVERTABLE: return "Convertable"; - case SCALEABLE: return "Scaleable"; - case FLEXIBLE: return "Flexible"; - default: return "?"; - } - } - } - - public static class DataelementSpecificityEnumFactory implements EnumFactory { - public DataelementSpecificity fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("comparable".equals(codeString)) - return DataelementSpecificity.COMPARABLE; - if ("fully-specified".equals(codeString)) - return DataelementSpecificity.FULLYSPECIFIED; - if ("equivalent".equals(codeString)) - return DataelementSpecificity.EQUIVALENT; - if ("convertable".equals(codeString)) - return DataelementSpecificity.CONVERTABLE; - if ("scaleable".equals(codeString)) - return DataelementSpecificity.SCALEABLE; - if ("flexible".equals(codeString)) - return DataelementSpecificity.FLEXIBLE; - throw new IllegalArgumentException("Unknown DataelementSpecificity code '"+codeString+"'"); - } - public String toCode(DataelementSpecificity code) { - if (code == DataelementSpecificity.COMPARABLE) - return "comparable"; - if (code == DataelementSpecificity.FULLYSPECIFIED) - return "fully-specified"; - if (code == DataelementSpecificity.EQUIVALENT) - return "equivalent"; - if (code == DataelementSpecificity.CONVERTABLE) - return "convertable"; - if (code == DataelementSpecificity.SCALEABLE) - return "scaleable"; - if (code == DataelementSpecificity.FLEXIBLE) - return "flexible"; - return "?"; - } - } - - @Block() - public static class DataElementContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the data element. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Name of a individual to contact", formalDefinition="The name of an individual to contact regarding the data element." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /* - * Constructor - */ - public DataElementContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the data element.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElementContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the data element.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public DataElementContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the data element. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the data element. - */ - public DataElementContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public DataElementContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the data element.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - public DataElementContactComponent copy() { - DataElementContactComponent dst = new DataElementContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DataElementContactComponent)) - return false; - DataElementContactComponent o = (DataElementContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DataElementContactComponent)) - return false; - DataElementContactComponent o = (DataElementContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - } - - @Block() - public static class DataElementMappingComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An Internal id that is used to identify this mapping set when specific mappings are made on a per-element basis. - */ - @Child(name = "identity", type = {IdType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Internal id when this mapping is used", formalDefinition="An Internal id that is used to identify this mapping set when specific mappings are made on a per-element basis." ) - protected IdType identity; - - /** - * An absolute URI that identifies the specification that this mapping is expressed to. - */ - @Child(name = "uri", type = {UriType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Identifies what this mapping refers to", formalDefinition="An absolute URI that identifies the specification that this mapping is expressed to." ) - protected UriType uri; - - /** - * A name for the specification that is being mapped to. - */ - @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Names what this mapping refers to", formalDefinition="A name for the specification that is being mapped to." ) - protected StringType name; - - /** - * Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. - */ - @Child(name = "comments", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Versions, Issues, Scope limitations etc", formalDefinition="Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage." ) - protected StringType comments; - - private static final long serialVersionUID = 299630820L; - - /* - * Constructor - */ - public DataElementMappingComponent() { - super(); - } - - /* - * Constructor - */ - public DataElementMappingComponent(IdType identity) { - super(); - this.identity = identity; - } - - /** - * @return {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made on a per-element basis.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value - */ - public IdType getIdentityElement() { - if (this.identity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElementMappingComponent.identity"); - else if (Configuration.doAutoCreate()) - this.identity = new IdType(); // bb - return this.identity; - } - - public boolean hasIdentityElement() { - return this.identity != null && !this.identity.isEmpty(); - } - - public boolean hasIdentity() { - return this.identity != null && !this.identity.isEmpty(); - } - - /** - * @param value {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made on a per-element basis.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value - */ - public DataElementMappingComponent setIdentityElement(IdType value) { - this.identity = value; - return this; - } - - /** - * @return An Internal id that is used to identify this mapping set when specific mappings are made on a per-element basis. - */ - public String getIdentity() { - return this.identity == null ? null : this.identity.getValue(); - } - - /** - * @param value An Internal id that is used to identify this mapping set when specific mappings are made on a per-element basis. - */ - public DataElementMappingComponent setIdentity(String value) { - if (this.identity == null) - this.identity = new IdType(); - this.identity.setValue(value); - return this; - } - - /** - * @return {@link #uri} (An absolute URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value - */ - public UriType getUriElement() { - if (this.uri == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElementMappingComponent.uri"); - else if (Configuration.doAutoCreate()) - this.uri = new UriType(); // bb - return this.uri; - } - - public boolean hasUriElement() { - return this.uri != null && !this.uri.isEmpty(); - } - - public boolean hasUri() { - return this.uri != null && !this.uri.isEmpty(); - } - - /** - * @param value {@link #uri} (An absolute URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value - */ - public DataElementMappingComponent setUriElement(UriType value) { - this.uri = value; - return this; - } - - /** - * @return An absolute URI that identifies the specification that this mapping is expressed to. - */ - public String getUri() { - return this.uri == null ? null : this.uri.getValue(); - } - - /** - * @param value An absolute URI that identifies the specification that this mapping is expressed to. - */ - public DataElementMappingComponent setUri(String value) { - if (Utilities.noString(value)) - this.uri = null; - else { - if (this.uri == null) - this.uri = new UriType(); - this.uri.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A name for the specification that is being mapped to.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElementMappingComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A name for the specification that is being mapped to.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public DataElementMappingComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A name for the specification that is being mapped to. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A name for the specification that is being mapped to. - */ - public DataElementMappingComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public StringType getCommentsElement() { - if (this.comments == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElementMappingComponent.comments"); - else if (Configuration.doAutoCreate()) - this.comments = new StringType(); // bb - return this.comments; - } - - public boolean hasCommentsElement() { - return this.comments != null && !this.comments.isEmpty(); - } - - public boolean hasComments() { - return this.comments != null && !this.comments.isEmpty(); - } - - /** - * @param value {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public DataElementMappingComponent setCommentsElement(StringType value) { - this.comments = value; - return this; - } - - /** - * @return Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. - */ - public String getComments() { - return this.comments == null ? null : this.comments.getValue(); - } - - /** - * @param value Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. - */ - public DataElementMappingComponent setComments(String value) { - if (Utilities.noString(value)) - this.comments = null; - else { - if (this.comments == null) - this.comments = new StringType(); - this.comments.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identity", "id", "An Internal id that is used to identify this mapping set when specific mappings are made on a per-element basis.", 0, java.lang.Integer.MAX_VALUE, identity)); - childrenList.add(new Property("uri", "uri", "An absolute URI that identifies the specification that this mapping is expressed to.", 0, java.lang.Integer.MAX_VALUE, uri)); - childrenList.add(new Property("name", "string", "A name for the specification that is being mapped to.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("comments", "string", "Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.", 0, java.lang.Integer.MAX_VALUE, comments)); - } - - public DataElementMappingComponent copy() { - DataElementMappingComponent dst = new DataElementMappingComponent(); - copyValues(dst); - dst.identity = identity == null ? null : identity.copy(); - dst.uri = uri == null ? null : uri.copy(); - dst.name = name == null ? null : name.copy(); - dst.comments = comments == null ? null : comments.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DataElementMappingComponent)) - return false; - DataElementMappingComponent o = (DataElementMappingComponent) other; - return compareDeep(identity, o.identity, true) && compareDeep(uri, o.uri, true) && compareDeep(name, o.name, true) - && compareDeep(comments, o.comments, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DataElementMappingComponent)) - return false; - DataElementMappingComponent o = (DataElementMappingComponent) other; - return compareValues(identity, o.identity, true) && compareValues(uri, o.uri, true) && compareValues(name, o.name, true) - && compareValues(comments, o.comments, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identity == null || identity.isEmpty()) && (uri == null || uri.isEmpty()) - && (name == null || name.isEmpty()) && (comments == null || comments.isEmpty()); - } - - } - - /** - * An absolute uri that is used to identify this element when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). - */ - @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Globally unique logical id for data element", formalDefinition="An absolute uri that is used to identify this element when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:)." ) - protected UriType url; - - /** - * Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) - @Description(shortDefinition="Logical id to reference this data element", formalDefinition="Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance." ) - protected Identifier identifier; - - /** - * The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Logical id for this version of the data element", formalDefinition="The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually." ) - protected StringType version; - - /** - * The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used. - */ - @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Descriptive label for this element definition", formalDefinition="The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used." ) - protected StringType name; - - /** - * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions. - */ - @Child(name = "useContext", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions." ) - protected List useContext; - - /** - * A flag to indicate that this search data elemnt definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name = "experimental", type = {BooleanType.class}, order=5, min=0, max=1) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="A flag to indicate that this search data elemnt definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The status of the data element. - */ - @Child(name = "status", type = {CodeType.class}, order=6, min=1, max=1) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the data element." ) - protected Enumeration status; - - /** - * The date that the status for this business version of the data element became effective. (I.e. Date the draft was created, date element became active or date element became retired). - */ - @Child(name = "date", type = {DateTimeType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Date for this version of the data element", formalDefinition="The date that the status for this business version of the data element became effective. (I.e. Date the draft was created, date element became active or date element became retired)." ) - protected DateTimeType date; - - /** - * A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element. - */ - @Child(name = "copyright", type = {StringType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Use and/or Publishing restrictions", formalDefinition="A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element." ) - protected StringType copyright; - - /** - * The name of the individual or organization that published the data element. - */ - @Child(name = "publisher", type = {StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the data element." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * Identifies how precise the data element is in its definition. - */ - @Child(name = "specificity", type = {CodeType.class}, order=11, min=0, max=1) - @Description(shortDefinition="comparable | fully-specified | equivalent | convertable | scaleable | flexible", formalDefinition="Identifies how precise the data element is in its definition." ) - protected Enumeration specificity; - - /** - * Identifies a specification (other than a terminology) that the elements that make up the DataElement hav some correspondance with. - */ - @Child(name = "mapping", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External specification mapped to", formalDefinition="Identifies a specification (other than a terminology) that the elements that make up the DataElement hav some correspondance with." ) - protected List mapping; - - /** - * Defines the structure, type, allowed values and other constraining characteristics of the data element. - */ - @Child(name = "element", type = {ElementDefinition.class}, order=13, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Definition of element", formalDefinition="Defines the structure, type, allowed values and other constraining characteristics of the data element." ) - protected List element; - - private static final long serialVersionUID = -1444116299L; - - /* - * Constructor - */ - public DataElement() { - super(); - } - - /* - * Constructor - */ - public DataElement(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #url} (An absolute uri that is used to identify this element when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute uri that is used to identify this element when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public DataElement setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute uri that is used to identify this element when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute uri that is used to identify this element when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). - */ - public DataElement setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #identifier} (Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance.) - */ - public DataElement setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #version} (The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public DataElement setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually. - */ - public DataElement setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public DataElement setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used. - */ - public DataElement setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions.) - */ - public List getUseContext() { - if (this.useContext == null) - this.useContext = new ArrayList(); - return this.useContext; - } - - public boolean hasUseContext() { - if (this.useContext == null) - return false; - for (CodeableConcept item : this.useContext) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions.) - */ - // syntactic sugar - public CodeableConcept addUseContext() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return t; - } - - // syntactic sugar - public DataElement addUseContext(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return this; - } - - /** - * @return {@link #experimental} (A flag to indicate that this search data elemnt definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); // bb - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (A flag to indicate that this search data elemnt definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public DataElement setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return A flag to indicate that this search data elemnt definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); - } - - /** - * @param value A flag to indicate that this search data elemnt definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public DataElement setExperimental(boolean value) { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - return this; - } - - /** - * @return {@link #status} (The status of the data element.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the data element.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DataElement setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the data element. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the data element. - */ - public DataElement setStatus(ConformanceResourceStatus value) { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #date} (The date that the status for this business version of the data element became effective. (I.e. Date the draft was created, date element became active or date element became retired).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date that the status for this business version of the data element became effective. (I.e. Date the draft was created, date element became active or date element became retired).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DataElement setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date that the status for this business version of the data element became effective. (I.e. Date the draft was created, date element became active or date element became retired). - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date that the status for this business version of the data element became effective. (I.e. Date the draft was created, date element became active or date element became retired). - */ - public DataElement setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #copyright} (A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public StringType getCopyrightElement() { - if (this.copyright == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.copyright"); - else if (Configuration.doAutoCreate()) - this.copyright = new StringType(); // bb - return this.copyright; - } - - public boolean hasCopyrightElement() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - public boolean hasCopyright() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - /** - * @param value {@link #copyright} (A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public DataElement setCopyrightElement(StringType value) { - this.copyright = value; - return this; - } - - /** - * @return A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element. - */ - public String getCopyright() { - return this.copyright == null ? null : this.copyright.getValue(); - } - - /** - * @param value A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element. - */ - public DataElement setCopyright(String value) { - if (Utilities.noString(value)) - this.copyright = null; - else { - if (this.copyright == null) - this.copyright = new StringType(); - this.copyright.setValue(value); - } - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the data element.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the data element.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public DataElement setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the data element. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the data element. - */ - public DataElement setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (DataElementContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public DataElementContactComponent addContact() { //3 - DataElementContactComponent t = new DataElementContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public DataElement addContact(DataElementContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #specificity} (Identifies how precise the data element is in its definition.). This is the underlying object with id, value and extensions. The accessor "getSpecificity" gives direct access to the value - */ - public Enumeration getSpecificityElement() { - if (this.specificity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.specificity"); - else if (Configuration.doAutoCreate()) - this.specificity = new Enumeration(new DataelementSpecificityEnumFactory()); // bb - return this.specificity; - } - - public boolean hasSpecificityElement() { - return this.specificity != null && !this.specificity.isEmpty(); - } - - public boolean hasSpecificity() { - return this.specificity != null && !this.specificity.isEmpty(); - } - - /** - * @param value {@link #specificity} (Identifies how precise the data element is in its definition.). This is the underlying object with id, value and extensions. The accessor "getSpecificity" gives direct access to the value - */ - public DataElement setSpecificityElement(Enumeration value) { - this.specificity = value; - return this; - } - - /** - * @return Identifies how precise the data element is in its definition. - */ - public DataelementSpecificity getSpecificity() { - return this.specificity == null ? null : this.specificity.getValue(); - } - - /** - * @param value Identifies how precise the data element is in its definition. - */ - public DataElement setSpecificity(DataelementSpecificity value) { - if (value == null) - this.specificity = null; - else { - if (this.specificity == null) - this.specificity = new Enumeration(new DataelementSpecificityEnumFactory()); - this.specificity.setValue(value); - } - return this; - } - - /** - * @return {@link #mapping} (Identifies a specification (other than a terminology) that the elements that make up the DataElement hav some correspondance with.) - */ - public List getMapping() { - if (this.mapping == null) - this.mapping = new ArrayList(); - return this.mapping; - } - - public boolean hasMapping() { - if (this.mapping == null) - return false; - for (DataElementMappingComponent item : this.mapping) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #mapping} (Identifies a specification (other than a terminology) that the elements that make up the DataElement hav some correspondance with.) - */ - // syntactic sugar - public DataElementMappingComponent addMapping() { //3 - DataElementMappingComponent t = new DataElementMappingComponent(); - if (this.mapping == null) - this.mapping = new ArrayList(); - this.mapping.add(t); - return t; - } - - // syntactic sugar - public DataElement addMapping(DataElementMappingComponent t) { //3 - if (t == null) - return this; - if (this.mapping == null) - this.mapping = new ArrayList(); - this.mapping.add(t); - return this; - } - - /** - * @return {@link #element} (Defines the structure, type, allowed values and other constraining characteristics of the data element.) - */ - public List getElement() { - if (this.element == null) - this.element = new ArrayList(); - return this.element; - } - - public boolean hasElement() { - if (this.element == null) - return false; - for (ElementDefinition item : this.element) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #element} (Defines the structure, type, allowed values and other constraining characteristics of the data element.) - */ - // syntactic sugar - public ElementDefinition addElement() { //3 - ElementDefinition t = new ElementDefinition(); - if (this.element == null) - this.element = new ArrayList(); - this.element.add(t); - return t; - } - - // syntactic sugar - public DataElement addElement(ElementDefinition t) { //3 - if (t == null) - return this; - if (this.element == null) - this.element = new ArrayList(); - this.element.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute uri that is used to identify this element when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("name", "string", "The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions.", 0, java.lang.Integer.MAX_VALUE, useContext)); - childrenList.add(new Property("experimental", "boolean", "A flag to indicate that this search data elemnt definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("status", "code", "The status of the data element.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("date", "dateTime", "The date that the status for this business version of the data element became effective. (I.e. Date the draft was created, date element became active or date element became retired).", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("copyright", "string", "A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element.", 0, java.lang.Integer.MAX_VALUE, copyright)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the data element.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("specificity", "code", "Identifies how precise the data element is in its definition.", 0, java.lang.Integer.MAX_VALUE, specificity)); - childrenList.add(new Property("mapping", "", "Identifies a specification (other than a terminology) that the elements that make up the DataElement hav some correspondance with.", 0, java.lang.Integer.MAX_VALUE, mapping)); - childrenList.add(new Property("element", "ElementDefinition", "Defines the structure, type, allowed values and other constraining characteristics of the data element.", 0, java.lang.Integer.MAX_VALUE, element)); - } - - public DataElement copy() { - DataElement dst = new DataElement(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.version = version == null ? null : version.copy(); - dst.name = name == null ? null : name.copy(); - if (useContext != null) { - dst.useContext = new ArrayList(); - for (CodeableConcept i : useContext) - dst.useContext.add(i.copy()); - }; - dst.experimental = experimental == null ? null : experimental.copy(); - dst.status = status == null ? null : status.copy(); - dst.date = date == null ? null : date.copy(); - dst.copyright = copyright == null ? null : copyright.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (DataElementContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.specificity = specificity == null ? null : specificity.copy(); - if (mapping != null) { - dst.mapping = new ArrayList(); - for (DataElementMappingComponent i : mapping) - dst.mapping.add(i.copy()); - }; - if (element != null) { - dst.element = new ArrayList(); - for (ElementDefinition i : element) - dst.element.add(i.copy()); - }; - return dst; - } - - protected DataElement typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DataElement)) - return false; - DataElement o = (DataElement) other; - return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) - && compareDeep(name, o.name, true) && compareDeep(useContext, o.useContext, true) && compareDeep(experimental, o.experimental, true) - && compareDeep(status, o.status, true) && compareDeep(date, o.date, true) && compareDeep(copyright, o.copyright, true) - && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(specificity, o.specificity, true) - && compareDeep(mapping, o.mapping, true) && compareDeep(element, o.element, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DataElement)) - return false; - DataElement o = (DataElement) other; - return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) - && compareValues(experimental, o.experimental, true) && compareValues(status, o.status, true) && compareValues(date, o.date, true) - && compareValues(copyright, o.copyright, true) && compareValues(publisher, o.publisher, true) && compareValues(specificity, o.specificity, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (useContext == null || useContext.isEmpty()) - && (experimental == null || experimental.isEmpty()) && (status == null || status.isEmpty()) - && (date == null || date.isEmpty()) && (copyright == null || copyright.isEmpty()) && (publisher == null || publisher.isEmpty()) - && (contact == null || contact.isEmpty()) && (specificity == null || specificity.isEmpty()) - && (mapping == null || mapping.isEmpty()) && (element == null || element.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DataElement; - } - - @SearchParamDefinition(name="status", path="DataElement.status", description="The current status of the data element", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="description", path="DataElement.element.definition", description="Text search in the description of the data element. This corresponds to the definition of the first DataElement.element.", type="string" ) - public static final String SP_DESCRIPTION = "description"; - @SearchParamDefinition(name="name", path="DataElement.name", description="Name of the data element", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="context", path="DataElement.useContext", description="A use context assigned to the data element", type="token" ) - public static final String SP_CONTEXT = "context"; - @SearchParamDefinition(name="code", path="DataElement.element.code", description="A code for the data element (server may choose to do subsumption)", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="date", path="DataElement.date", description="The data element publication date", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="identifier", path="DataElement.identifier", description="The identifier of the data element", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="url", path="DataElement.url", description="The official URL for the data element", type="uri" ) - public static final String SP_URL = "url"; - @SearchParamDefinition(name="publisher", path="DataElement.publisher", description="Name of the publisher of the data element", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - @SearchParamDefinition(name="version", path="DataElement.version", description="The version identifier of the data element", type="string" ) - public static final String SP_VERSION = "version"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import java.util.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.Enumerations.*; +import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * The formal description of a single piece of information that can be gathered and reported. + */ +@ResourceDef(name="DataElement", profile="http://hl7.org/fhir/Profile/DataElement") +public class DataElement extends DomainResource { + + public enum DataelementSpecificity { + /** + * The data element is sufficiently well-constrained that multiple pieces of data captured according to the constraints of the data element will be comparable (though in some cases, a degree of automated conversion/normalization may be required). + */ + COMPARABLE, + /** + * The data element is fully specified down to a single value set, single unit of measure, single data type, etc. Multiple pieces of data associated with this data element are fully compareable. + */ + FULLYSPECIFIED, + /** + * The data element allows multiple units of measure having equivalent meaning. E.g. "cc" (cubic centimeter) and "mL". + */ + EQUIVALENT, + /** + * The data element allows multiple units of measure that are convertable between each other (e.g. Inches and centimeters) and/or allows data to be captured in multiple value sets for which a known mapping exists allowing conversion of meaning. + */ + CONVERTABLE, + /** + * A convertable data element where unit conversions are different only by a power of 10. E.g. g, mg, kg. + */ + SCALEABLE, + /** + * The data element is unconstrained in units, choice of data types and/or choice of vocabulary such that automated comparison of data captured using the data element is not possible. + */ + FLEXIBLE, + /** + * added to help the parsers + */ + NULL; + public static DataelementSpecificity fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("comparable".equals(codeString)) + return COMPARABLE; + if ("fully-specified".equals(codeString)) + return FULLYSPECIFIED; + if ("equivalent".equals(codeString)) + return EQUIVALENT; + if ("convertable".equals(codeString)) + return CONVERTABLE; + if ("scaleable".equals(codeString)) + return SCALEABLE; + if ("flexible".equals(codeString)) + return FLEXIBLE; + throw new Exception("Unknown DataelementSpecificity code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case COMPARABLE: return "comparable"; + case FULLYSPECIFIED: return "fully-specified"; + case EQUIVALENT: return "equivalent"; + case CONVERTABLE: return "convertable"; + case SCALEABLE: return "scaleable"; + case FLEXIBLE: return "flexible"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPARABLE: return ""; + case FULLYSPECIFIED: return ""; + case EQUIVALENT: return ""; + case CONVERTABLE: return ""; + case SCALEABLE: return ""; + case FLEXIBLE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPARABLE: return "The data element is sufficiently well-constrained that multiple pieces of data captured according to the constraints of the data element will be comparable (though in some cases, a degree of automated conversion/normalization may be required)."; + case FULLYSPECIFIED: return "The data element is fully specified down to a single value set, single unit of measure, single data type, etc. Multiple pieces of data associated with this data element are fully compareable."; + case EQUIVALENT: return "The data element allows multiple units of measure having equivalent meaning. E.g. 'cc' (cubic centimeter) and 'mL'."; + case CONVERTABLE: return "The data element allows multiple units of measure that are convertable between each other (e.g. Inches and centimeters) and/or allows data to be captured in multiple value sets for which a known mapping exists allowing conversion of meaning."; + case SCALEABLE: return "A convertable data element where unit conversions are different only by a power of 10. E.g. g, mg, kg."; + case FLEXIBLE: return "The data element is unconstrained in units, choice of data types and/or choice of vocabulary such that automated comparison of data captured using the data element is not possible."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPARABLE: return "Comparable"; + case FULLYSPECIFIED: return "Fully Specified"; + case EQUIVALENT: return "Equivalent"; + case CONVERTABLE: return "Convertable"; + case SCALEABLE: return "Scaleable"; + case FLEXIBLE: return "Flexible"; + default: return "?"; + } + } + } + + public static class DataelementSpecificityEnumFactory implements EnumFactory { + public DataelementSpecificity fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("comparable".equals(codeString)) + return DataelementSpecificity.COMPARABLE; + if ("fully-specified".equals(codeString)) + return DataelementSpecificity.FULLYSPECIFIED; + if ("equivalent".equals(codeString)) + return DataelementSpecificity.EQUIVALENT; + if ("convertable".equals(codeString)) + return DataelementSpecificity.CONVERTABLE; + if ("scaleable".equals(codeString)) + return DataelementSpecificity.SCALEABLE; + if ("flexible".equals(codeString)) + return DataelementSpecificity.FLEXIBLE; + throw new IllegalArgumentException("Unknown DataelementSpecificity code '"+codeString+"'"); + } + public String toCode(DataelementSpecificity code) { + if (code == DataelementSpecificity.COMPARABLE) + return "comparable"; + if (code == DataelementSpecificity.FULLYSPECIFIED) + return "fully-specified"; + if (code == DataelementSpecificity.EQUIVALENT) + return "equivalent"; + if (code == DataelementSpecificity.CONVERTABLE) + return "convertable"; + if (code == DataelementSpecificity.SCALEABLE) + return "scaleable"; + if (code == DataelementSpecificity.FLEXIBLE) + return "flexible"; + return "?"; + } + } + + @Block() + public static class DataElementContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the data element. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Name of a individual to contact", formalDefinition="The name of an individual to contact regarding the data element." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /* + * Constructor + */ + public DataElementContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the data element.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElementContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The name of an individual to contact regarding the data element.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public DataElementContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the data element. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the data element. + */ + public DataElementContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public DataElementContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the data element.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + public DataElementContactComponent copy() { + DataElementContactComponent dst = new DataElementContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DataElementContactComponent)) + return false; + DataElementContactComponent o = (DataElementContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DataElementContactComponent)) + return false; + DataElementContactComponent o = (DataElementContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + } + + @Block() + public static class DataElementMappingComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An Internal id that is used to identify this mapping set when specific mappings are made on a per-element basis. + */ + @Child(name = "identity", type = {IdType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Internal id when this mapping is used", formalDefinition="An Internal id that is used to identify this mapping set when specific mappings are made on a per-element basis." ) + protected IdType identity; + + /** + * An absolute URI that identifies the specification that this mapping is expressed to. + */ + @Child(name = "uri", type = {UriType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Identifies what this mapping refers to", formalDefinition="An absolute URI that identifies the specification that this mapping is expressed to." ) + protected UriType uri; + + /** + * A name for the specification that is being mapped to. + */ + @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Names what this mapping refers to", formalDefinition="A name for the specification that is being mapped to." ) + protected StringType name; + + /** + * Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. + */ + @Child(name = "comments", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Versions, Issues, Scope limitations etc", formalDefinition="Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage." ) + protected StringType comments; + + private static final long serialVersionUID = 299630820L; + + /* + * Constructor + */ + public DataElementMappingComponent() { + super(); + } + + /* + * Constructor + */ + public DataElementMappingComponent(IdType identity) { + super(); + this.identity = identity; + } + + /** + * @return {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made on a per-element basis.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value + */ + public IdType getIdentityElement() { + if (this.identity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElementMappingComponent.identity"); + else if (Configuration.doAutoCreate()) + this.identity = new IdType(); // bb + return this.identity; + } + + public boolean hasIdentityElement() { + return this.identity != null && !this.identity.isEmpty(); + } + + public boolean hasIdentity() { + return this.identity != null && !this.identity.isEmpty(); + } + + /** + * @param value {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made on a per-element basis.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value + */ + public DataElementMappingComponent setIdentityElement(IdType value) { + this.identity = value; + return this; + } + + /** + * @return An Internal id that is used to identify this mapping set when specific mappings are made on a per-element basis. + */ + public String getIdentity() { + return this.identity == null ? null : this.identity.getValue(); + } + + /** + * @param value An Internal id that is used to identify this mapping set when specific mappings are made on a per-element basis. + */ + public DataElementMappingComponent setIdentity(String value) { + if (this.identity == null) + this.identity = new IdType(); + this.identity.setValue(value); + return this; + } + + /** + * @return {@link #uri} (An absolute URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value + */ + public UriType getUriElement() { + if (this.uri == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElementMappingComponent.uri"); + else if (Configuration.doAutoCreate()) + this.uri = new UriType(); // bb + return this.uri; + } + + public boolean hasUriElement() { + return this.uri != null && !this.uri.isEmpty(); + } + + public boolean hasUri() { + return this.uri != null && !this.uri.isEmpty(); + } + + /** + * @param value {@link #uri} (An absolute URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value + */ + public DataElementMappingComponent setUriElement(UriType value) { + this.uri = value; + return this; + } + + /** + * @return An absolute URI that identifies the specification that this mapping is expressed to. + */ + public String getUri() { + return this.uri == null ? null : this.uri.getValue(); + } + + /** + * @param value An absolute URI that identifies the specification that this mapping is expressed to. + */ + public DataElementMappingComponent setUri(String value) { + if (Utilities.noString(value)) + this.uri = null; + else { + if (this.uri == null) + this.uri = new UriType(); + this.uri.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A name for the specification that is being mapped to.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElementMappingComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A name for the specification that is being mapped to.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public DataElementMappingComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A name for the specification that is being mapped to. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A name for the specification that is being mapped to. + */ + public DataElementMappingComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public StringType getCommentsElement() { + if (this.comments == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElementMappingComponent.comments"); + else if (Configuration.doAutoCreate()) + this.comments = new StringType(); // bb + return this.comments; + } + + public boolean hasCommentsElement() { + return this.comments != null && !this.comments.isEmpty(); + } + + public boolean hasComments() { + return this.comments != null && !this.comments.isEmpty(); + } + + /** + * @param value {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public DataElementMappingComponent setCommentsElement(StringType value) { + this.comments = value; + return this; + } + + /** + * @return Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. + */ + public String getComments() { + return this.comments == null ? null : this.comments.getValue(); + } + + /** + * @param value Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. + */ + public DataElementMappingComponent setComments(String value) { + if (Utilities.noString(value)) + this.comments = null; + else { + if (this.comments == null) + this.comments = new StringType(); + this.comments.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identity", "id", "An Internal id that is used to identify this mapping set when specific mappings are made on a per-element basis.", 0, java.lang.Integer.MAX_VALUE, identity)); + childrenList.add(new Property("uri", "uri", "An absolute URI that identifies the specification that this mapping is expressed to.", 0, java.lang.Integer.MAX_VALUE, uri)); + childrenList.add(new Property("name", "string", "A name for the specification that is being mapped to.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("comments", "string", "Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.", 0, java.lang.Integer.MAX_VALUE, comments)); + } + + public DataElementMappingComponent copy() { + DataElementMappingComponent dst = new DataElementMappingComponent(); + copyValues(dst); + dst.identity = identity == null ? null : identity.copy(); + dst.uri = uri == null ? null : uri.copy(); + dst.name = name == null ? null : name.copy(); + dst.comments = comments == null ? null : comments.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DataElementMappingComponent)) + return false; + DataElementMappingComponent o = (DataElementMappingComponent) other; + return compareDeep(identity, o.identity, true) && compareDeep(uri, o.uri, true) && compareDeep(name, o.name, true) + && compareDeep(comments, o.comments, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DataElementMappingComponent)) + return false; + DataElementMappingComponent o = (DataElementMappingComponent) other; + return compareValues(identity, o.identity, true) && compareValues(uri, o.uri, true) && compareValues(name, o.name, true) + && compareValues(comments, o.comments, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identity == null || identity.isEmpty()) && (uri == null || uri.isEmpty()) + && (name == null || name.isEmpty()) && (comments == null || comments.isEmpty()); + } + + } + + /** + * An absolute uri that is used to identify this element when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). + */ + @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Globally unique logical id for data element", formalDefinition="An absolute uri that is used to identify this element when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:)." ) + protected UriType url; + + /** + * Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) + @Description(shortDefinition="Logical id to reference this data element", formalDefinition="Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance." ) + protected Identifier identifier; + + /** + * The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Logical id for this version of the data element", formalDefinition="The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually." ) + protected StringType version; + + /** + * The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used. + */ + @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Descriptive label for this element definition", formalDefinition="The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used." ) + protected StringType name; + + /** + * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions. + */ + @Child(name = "useContext", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions." ) + protected List useContext; + + /** + * A flag to indicate that this search data elemnt definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name = "experimental", type = {BooleanType.class}, order=5, min=0, max=1) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="A flag to indicate that this search data elemnt definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The status of the data element. + */ + @Child(name = "status", type = {CodeType.class}, order=6, min=1, max=1) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the data element." ) + protected Enumeration status; + + /** + * The date that the status for this business version of the data element became effective. (I.e. Date the draft was created, date element became active or date element became retired). + */ + @Child(name = "date", type = {DateTimeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Date for this version of the data element", formalDefinition="The date that the status for this business version of the data element became effective. (I.e. Date the draft was created, date element became active or date element became retired)." ) + protected DateTimeType date; + + /** + * A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element. + */ + @Child(name = "copyright", type = {StringType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Use and/or Publishing restrictions", formalDefinition="A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element." ) + protected StringType copyright; + + /** + * The name of the individual or organization that published the data element. + */ + @Child(name = "publisher", type = {StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the data element." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * Identifies how precise the data element is in its definition. + */ + @Child(name = "specificity", type = {CodeType.class}, order=11, min=0, max=1) + @Description(shortDefinition="comparable | fully-specified | equivalent | convertable | scaleable | flexible", formalDefinition="Identifies how precise the data element is in its definition." ) + protected Enumeration specificity; + + /** + * Identifies a specification (other than a terminology) that the elements that make up the DataElement hav some correspondance with. + */ + @Child(name = "mapping", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External specification mapped to", formalDefinition="Identifies a specification (other than a terminology) that the elements that make up the DataElement hav some correspondance with." ) + protected List mapping; + + /** + * Defines the structure, type, allowed values and other constraining characteristics of the data element. + */ + @Child(name = "element", type = {ElementDefinition.class}, order=13, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Definition of element", formalDefinition="Defines the structure, type, allowed values and other constraining characteristics of the data element." ) + protected List element; + + private static final long serialVersionUID = -1444116299L; + + /* + * Constructor + */ + public DataElement() { + super(); + } + + /* + * Constructor + */ + public DataElement(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #url} (An absolute uri that is used to identify this element when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute uri that is used to identify this element when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public DataElement setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute uri that is used to identify this element when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute uri that is used to identify this element when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). + */ + public DataElement setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #identifier} (Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance.) + */ + public DataElement setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #version} (The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public DataElement setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually. + */ + public DataElement setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public DataElement setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used. + */ + public DataElement setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions.) + */ + public List getUseContext() { + if (this.useContext == null) + this.useContext = new ArrayList(); + return this.useContext; + } + + public boolean hasUseContext() { + if (this.useContext == null) + return false; + for (CodeableConcept item : this.useContext) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions.) + */ + // syntactic sugar + public CodeableConcept addUseContext() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return t; + } + + // syntactic sugar + public DataElement addUseContext(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return this; + } + + /** + * @return {@link #experimental} (A flag to indicate that this search data elemnt definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (A flag to indicate that this search data elemnt definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public DataElement setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return A flag to indicate that this search data elemnt definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value A flag to indicate that this search data elemnt definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public DataElement setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #status} (The status of the data element.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status of the data element.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DataElement setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the data element. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the data element. + */ + public DataElement setStatus(ConformanceResourceStatus value) { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #date} (The date that the status for this business version of the data element became effective. (I.e. Date the draft was created, date element became active or date element became retired).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date that the status for this business version of the data element became effective. (I.e. Date the draft was created, date element became active or date element became retired).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DataElement setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date that the status for this business version of the data element became effective. (I.e. Date the draft was created, date element became active or date element became retired). + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date that the status for this business version of the data element became effective. (I.e. Date the draft was created, date element became active or date element became retired). + */ + public DataElement setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #copyright} (A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public StringType getCopyrightElement() { + if (this.copyright == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.copyright"); + else if (Configuration.doAutoCreate()) + this.copyright = new StringType(); // bb + return this.copyright; + } + + public boolean hasCopyrightElement() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + public boolean hasCopyright() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + /** + * @param value {@link #copyright} (A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public DataElement setCopyrightElement(StringType value) { + this.copyright = value; + return this; + } + + /** + * @return A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element. + */ + public String getCopyright() { + return this.copyright == null ? null : this.copyright.getValue(); + } + + /** + * @param value A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element. + */ + public DataElement setCopyright(String value) { + if (Utilities.noString(value)) + this.copyright = null; + else { + if (this.copyright == null) + this.copyright = new StringType(); + this.copyright.setValue(value); + } + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the data element.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the data element.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public DataElement setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the data element. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the data element. + */ + public DataElement setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (DataElementContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public DataElementContactComponent addContact() { //3 + DataElementContactComponent t = new DataElementContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public DataElement addContact(DataElementContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #specificity} (Identifies how precise the data element is in its definition.). This is the underlying object with id, value and extensions. The accessor "getSpecificity" gives direct access to the value + */ + public Enumeration getSpecificityElement() { + if (this.specificity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.specificity"); + else if (Configuration.doAutoCreate()) + this.specificity = new Enumeration(new DataelementSpecificityEnumFactory()); // bb + return this.specificity; + } + + public boolean hasSpecificityElement() { + return this.specificity != null && !this.specificity.isEmpty(); + } + + public boolean hasSpecificity() { + return this.specificity != null && !this.specificity.isEmpty(); + } + + /** + * @param value {@link #specificity} (Identifies how precise the data element is in its definition.). This is the underlying object with id, value and extensions. The accessor "getSpecificity" gives direct access to the value + */ + public DataElement setSpecificityElement(Enumeration value) { + this.specificity = value; + return this; + } + + /** + * @return Identifies how precise the data element is in its definition. + */ + public DataelementSpecificity getSpecificity() { + return this.specificity == null ? null : this.specificity.getValue(); + } + + /** + * @param value Identifies how precise the data element is in its definition. + */ + public DataElement setSpecificity(DataelementSpecificity value) { + if (value == null) + this.specificity = null; + else { + if (this.specificity == null) + this.specificity = new Enumeration(new DataelementSpecificityEnumFactory()); + this.specificity.setValue(value); + } + return this; + } + + /** + * @return {@link #mapping} (Identifies a specification (other than a terminology) that the elements that make up the DataElement hav some correspondance with.) + */ + public List getMapping() { + if (this.mapping == null) + this.mapping = new ArrayList(); + return this.mapping; + } + + public boolean hasMapping() { + if (this.mapping == null) + return false; + for (DataElementMappingComponent item : this.mapping) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #mapping} (Identifies a specification (other than a terminology) that the elements that make up the DataElement hav some correspondance with.) + */ + // syntactic sugar + public DataElementMappingComponent addMapping() { //3 + DataElementMappingComponent t = new DataElementMappingComponent(); + if (this.mapping == null) + this.mapping = new ArrayList(); + this.mapping.add(t); + return t; + } + + // syntactic sugar + public DataElement addMapping(DataElementMappingComponent t) { //3 + if (t == null) + return this; + if (this.mapping == null) + this.mapping = new ArrayList(); + this.mapping.add(t); + return this; + } + + /** + * @return {@link #element} (Defines the structure, type, allowed values and other constraining characteristics of the data element.) + */ + public List getElement() { + if (this.element == null) + this.element = new ArrayList(); + return this.element; + } + + public boolean hasElement() { + if (this.element == null) + return false; + for (ElementDefinition item : this.element) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #element} (Defines the structure, type, allowed values and other constraining characteristics of the data element.) + */ + // syntactic sugar + public ElementDefinition addElement() { //3 + ElementDefinition t = new ElementDefinition(); + if (this.element == null) + this.element = new ArrayList(); + this.element.add(t); + return t; + } + + // syntactic sugar + public DataElement addElement(ElementDefinition t) { //3 + if (t == null) + return this; + if (this.element == null) + this.element = new ArrayList(); + this.element.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute uri that is used to identify this element when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions.", 0, java.lang.Integer.MAX_VALUE, useContext)); + childrenList.add(new Property("experimental", "boolean", "A flag to indicate that this search data elemnt definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("status", "code", "The status of the data element.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("date", "dateTime", "The date that the status for this business version of the data element became effective. (I.e. Date the draft was created, date element became active or date element became retired).", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("copyright", "string", "A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element.", 0, java.lang.Integer.MAX_VALUE, copyright)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the data element.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("specificity", "code", "Identifies how precise the data element is in its definition.", 0, java.lang.Integer.MAX_VALUE, specificity)); + childrenList.add(new Property("mapping", "", "Identifies a specification (other than a terminology) that the elements that make up the DataElement hav some correspondance with.", 0, java.lang.Integer.MAX_VALUE, mapping)); + childrenList.add(new Property("element", "ElementDefinition", "Defines the structure, type, allowed values and other constraining characteristics of the data element.", 0, java.lang.Integer.MAX_VALUE, element)); + } + + public DataElement copy() { + DataElement dst = new DataElement(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + if (useContext != null) { + dst.useContext = new ArrayList(); + for (CodeableConcept i : useContext) + dst.useContext.add(i.copy()); + }; + dst.experimental = experimental == null ? null : experimental.copy(); + dst.status = status == null ? null : status.copy(); + dst.date = date == null ? null : date.copy(); + dst.copyright = copyright == null ? null : copyright.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (DataElementContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.specificity = specificity == null ? null : specificity.copy(); + if (mapping != null) { + dst.mapping = new ArrayList(); + for (DataElementMappingComponent i : mapping) + dst.mapping.add(i.copy()); + }; + if (element != null) { + dst.element = new ArrayList(); + for (ElementDefinition i : element) + dst.element.add(i.copy()); + }; + return dst; + } + + protected DataElement typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DataElement)) + return false; + DataElement o = (DataElement) other; + return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) + && compareDeep(name, o.name, true) && compareDeep(useContext, o.useContext, true) && compareDeep(experimental, o.experimental, true) + && compareDeep(status, o.status, true) && compareDeep(date, o.date, true) && compareDeep(copyright, o.copyright, true) + && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(specificity, o.specificity, true) + && compareDeep(mapping, o.mapping, true) && compareDeep(element, o.element, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DataElement)) + return false; + DataElement o = (DataElement) other; + return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) + && compareValues(experimental, o.experimental, true) && compareValues(status, o.status, true) && compareValues(date, o.date, true) + && compareValues(copyright, o.copyright, true) && compareValues(publisher, o.publisher, true) && compareValues(specificity, o.specificity, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (useContext == null || useContext.isEmpty()) + && (experimental == null || experimental.isEmpty()) && (status == null || status.isEmpty()) + && (date == null || date.isEmpty()) && (copyright == null || copyright.isEmpty()) && (publisher == null || publisher.isEmpty()) + && (contact == null || contact.isEmpty()) && (specificity == null || specificity.isEmpty()) + && (mapping == null || mapping.isEmpty()) && (element == null || element.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DataElement; + } + + @SearchParamDefinition(name="date", path="DataElement.date", description="The data element publication date", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="DataElement.identifier", description="The identifier of the data element", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="code", path="DataElement.element.code", description="A code for the data element (server may choose to do subsumption)", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="name", path="DataElement.name", description="Name of the data element", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="context", path="DataElement.useContext", description="A use context assigned to the data element", type="token" ) + public static final String SP_CONTEXT = "context"; + @SearchParamDefinition(name="publisher", path="DataElement.publisher", description="Name of the publisher of the data element", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + @SearchParamDefinition(name="description", path="DataElement.element.definition", description="Text search in the description of the data element. This corresponds to the definition of the first DataElement.element.", type="string" ) + public static final String SP_DESCRIPTION = "description"; + @SearchParamDefinition(name="version", path="DataElement.version", description="The version identifier of the data element", type="string" ) + public static final String SP_VERSION = "version"; + @SearchParamDefinition(name="url", path="DataElement.url", description="The official URL for the data element", type="uri" ) + public static final String SP_URL = "url"; + @SearchParamDefinition(name="status", path="DataElement.status", description="The current status of the data element", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DateAndTime.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DateAndTime.java new file mode 100644 index 00000000000..ba17c393fe6 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DateAndTime.java @@ -0,0 +1,611 @@ +package org.hl7.fhir.instance.model; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 - 2015 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + + +import java.text.ParseException; +import java.util.Calendar; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +import org.hl7.fhir.utilities.Utilities; + +// java 1.7 can parse xml date/times, but going java 1.7 is too hard for implementers +// javax.xml.bind.DatatypeConverter can parse xml date/times, but is not available on android. (and it's error message sucks) +// anyway, the underlying date/time concept has variable precision, and timezone, and neither Date nor Calendar real with +// that nicely. So we parse the date directly + +public class DateAndTime { + + private int year; + private int month; + private int day; + private boolean time; + private int hour; + private int minute; + private boolean seconds; + private int second; + private int fractions; + private int fraction; + private java.lang.Boolean timezone; + private boolean positiveOffset; //needed to represent negative offset of less than an hour (for example -00:00 or -00:30) + private int tzHour; + private int tzMin; + + public DateAndTime(String xDate) throws ParseException { + + String s; + String t = null; + if (xDate.endsWith("Z")) { + s = xDate.substring(0, xDate.length()-1); + timezone = false; + } else if (xDate.lastIndexOf("-") > 8) { + s = xDate.substring(0, xDate.lastIndexOf("-")); + t = xDate.substring(xDate.lastIndexOf("-")); + setTzSign(false); + } else if (xDate.lastIndexOf("+") > 8) { + s = xDate.substring(0, xDate.lastIndexOf("+")); + t = xDate.substring(xDate.lastIndexOf("+")); + setTzSign(true); + } else { // no timezone + s = xDate; + t = null; + timezone = null; + } + + int offset = 0; + try { + int yearlength = s.startsWith("-") ? s.substring(1).indexOf("-") + 1 : s.indexOf("-"); + if (yearlength == -1) { + yearlength = 4; + } + setYear(readField(s, 0, yearlength)); + offset = yearlength; + if (s.length() >= yearlength + 3) + setMonth(readField(s, yearlength + 1, 2)); + offset = yearlength + 4; + if (s.length() >= yearlength + 6) + setDay(readField(s, yearlength + 4, 2)); + offset = yearlength + 7; + if (s.length() >= yearlength + 9) + setHour(readField(s, yearlength + 7, 2)); + offset = yearlength + 10; + if (s.length() >= yearlength + 12) + setMinute(readField(s, yearlength + 10, 2)); + offset = yearlength + 13; + if (s.length() >= yearlength + 15) + setSecond(readField(s, yearlength + 13, 2)); + offset = yearlength + 16; + if (s.length() >= yearlength + 17) { + setFractions(s.length() - (yearlength + 16)); + setFraction(readField(s, yearlength + 16, fractions)); + } + if (t != null) { + setTzHour(readField(t, 1, 2)); + setTzMin(readField(t, 4, 2)); + } + } catch (Exception e) { + throw new ParseException("The date '"+xDate+"' is not a valid Date Time Format at character "+java.lang.Integer.toString(offset), offset); + } + } + + private static int readField(String date, int i, int j) { + String s = date.substring(i, i+j); + if (s.startsWith("+")) + s = s.substring(1); + return java.lang.Integer.parseInt(s); + } + + + public DateAndTime(Calendar date) { + setCalendar(date); + } + + private void setCalendar(Calendar date) { + setYear(date.get(Calendar.YEAR)); + setMonth(date.get(Calendar.MONTH)+1); + setDay(date.get(Calendar.DAY_OF_MONTH)); + setHour(date.get(Calendar.HOUR_OF_DAY)); + setMinute(date.get(Calendar.MINUTE)); + setSecond(date.get(Calendar.SECOND)); + if (date.get(Calendar.MILLISECOND) > 0) { + setFractions(3); + try { + setFraction(date.get(Calendar.MILLISECOND)); + } catch (Exception e) { + // can't happen + } + } + if (date.getTimeZone() != null) { + int offset = date.getTimeZone().getOffset(date.getTime().getTime()); + setOffsetMinutes(offset / 1000 / 60); + } + } + + public DateAndTime(java.util.Date date) { + Calendar cal = new GregorianCalendar(); + cal.setTime(date); + setCalendar(cal); + } + + private DateAndTime() { + } + + @Override + public String toString() { + StringBuilder b = new StringBuilder(); + b.append(Utilities.padLeft(java.lang.Integer.toString(year), '0', 4)); + if (month != 0) { + b.append("-"); + b.append(Utilities.padLeft(java.lang.Integer.toString(month), '0', 2)); + if (day != 0) { + b.append("-"); + b.append(Utilities.padLeft(java.lang.Integer.toString(day), '0', 2)); + if (time) { + b.append("T"); + b.append(Utilities.padLeft(java.lang.Integer.toString(hour), '0', 2)); + b.append(":"); + b.append(Utilities.padLeft(java.lang.Integer.toString(minute), '0', 2)); + if (seconds) { + b.append(":"); + b.append(Utilities.padLeft(java.lang.Integer.toString(second), '0', 2)); + if (fractions > 0) { + b.append("."); + b.append(Utilities.padLeft(java.lang.Integer.toString(fraction), '0', fractions)); + } + } + } + if (timezone != null) { + if (!timezone) { + b.append("Z"); + } else { + if (positiveOffset) { + b.append("+"); + } else { + b.append("-"); + } + b.append(Utilities.padLeft(java.lang.Integer.toString(tzHour), '0', 2)); + b.append(":"); + b.append(Utilities.padLeft(java.lang.Integer.toString(tzMin), '0', 2)); + } + } + } + } + return b.toString(); + } + + public Calendar toCalendar() { + Calendar cal = null; + if (timezone == null) { + cal = Calendar.getInstance(); + } else { + TimeZone tz; + if (!timezone) { + tz = TimeZone.getTimeZone("GMT+00:00"); + } else { + tz = TimeZone.getTimeZone("GMT"+(positiveOffset ? "+" : "-")+Utilities.padLeft(java.lang.Integer.toString(tzHour), '0', 2)+":"+Utilities.padLeft(java.lang.Integer.toString(tzMin), '0', 2)); + } + cal = Calendar.getInstance(tz); + } + + //default to 0 if unset + cal.set(Calendar.MONTH, 0); + cal.set(Calendar.DAY_OF_MONTH, 1); + cal.set(Calendar.HOUR_OF_DAY, 0); + cal.set(Calendar.MINUTE, 0); + cal.set(Calendar.SECOND, 0); + cal.set(Calendar.MILLISECOND, 0); + + cal.set(Calendar.YEAR, year); + if (month > 0) { + cal.set(Calendar.MONTH, month - 1); + if (day > 0) { + cal.set(Calendar.DAY_OF_MONTH, day); + if (time) { + cal.set(Calendar.HOUR_OF_DAY, hour); + cal.set(Calendar.MINUTE, minute); + if (seconds) { + cal.set(Calendar.SECOND, second); + if (fractions > 0) { + cal.set(Calendar.MILLISECOND, (int)((double) fraction / Math.pow(10, fractions) * 1000.0)); + } + } + } + } + } + return cal; + } + + public DateType toDate() { + return null; + } + + public int getYear() { + return year; + } + + public void setYear(int year) { + this.year = year; + } + + public int getMonth() { + return month; + } + + public void setMonth(int month) { + this.month = month; + } + + public int getDay() { + return day; + } + + public void setDay(int day) { + this.day = day; + } + + public boolean isTime() { + return time; + } + + public void setTime(boolean time) { + this.time = time; + if (!time) + setSeconds(false); + } + + public int getHour() { + return hour; + } + + public void setHour(int hour) { + this.time = true; + this.hour = hour; + } + + public int getMinute() { + return minute; + } + + public void setMinute(int minute) { + this.time = true; + this.minute = minute; + } + + public boolean isSeconds() { + return seconds; + } + + public void setSeconds(boolean seconds) { + this.seconds = seconds; + if (!seconds) + setFractions(0); + } + + public int getSecond() { + return second; + } + + public void setSecond(int second) { + this.time = true; + this.seconds = true; + this.second = second; + } + + public int getFractions() { + return fractions; + } + + public void setFractions(int fractions) { + this.fractions = fractions; + } + + public int getFraction() { + return fraction; + } + + public void setFraction(int fraction) throws Exception { + if (this.fractions == 0) + throw new Exception("set 'fractions' before setting 'fraction'"); + + this.fraction = fraction; + } + + public java.lang.Boolean getTimezone() { + return timezone; + } + + public void setTimezone(java.lang.Boolean timezone) { + this.timezone = timezone; + } + + public int getTzHour() { + return tzHour; + } + + public void setTzHour(int tzHour) { + this.tzHour = Math.abs(tzHour); + this.timezone = true; + } + + /** + * @param isPositiveOffset - true if the tz offset is positive (i.e. +06:00), false if the tz offset is negative (-06:00) + */ + public void setTzSign(boolean isPositiveOffset) { + positiveOffset = isPositiveOffset; + this.timezone = true; + } + + /** + * @return true if the tz offset is positive (i.e. +06:00), false if the tz offset is negative (-06:00) + */ + public boolean getTzSign() { + return positiveOffset; + } + + /** + * @param offset in minutes + */ + public void setOffsetMinutes(int offset) { + boolean positive = (offset >= 0); + offset = Math.abs(offset); + setTzHour(offset / 60); + setTzMin(offset % 60); + setTzSign(positive); + } + + /** + * @return offset in minutes + */ + public int getOffsetMinutes() { + if(timezone == null || !timezone) { + return 0; + } else { + return (positiveOffset ? 1 : -1) * (tzHour * 60 + tzMin); + } + } + + public int getTzMin() { + return tzMin; + } + + public void setTzMin(int tzMin) { + this.tzMin = Math.abs(tzMin); + this.timezone = true; + } + + public static DateAndTime now() { + return new DateAndTime(Calendar.getInstance()); + } + + public static DateAndTime today() { + DateAndTime dt = new DateAndTime(Calendar.getInstance()); + dt.setTime(false); + return dt; + } + + public static DateAndTime parseV3(String xDate) throws ParseException { + + DateAndTime res = new DateAndTime(); + String s; + String t = null; + if (xDate.endsWith("Z")) { + s = xDate.substring(0, xDate.length()-1); + res.timezone = false; + } else if (xDate.lastIndexOf("-") > 0) { + s = xDate.substring(0, xDate.lastIndexOf("-")); + t = xDate.substring(xDate.lastIndexOf("-")); + res.setTzSign(false); + } else if (xDate.lastIndexOf("+") > 0) { + s = xDate.substring(0, xDate.lastIndexOf("+")); + t = xDate.substring(xDate.lastIndexOf("+")); + res.setTzSign(true); + } else { // no timezone + s = xDate; + t = null; + res.timezone = null; + } + + int offset = 0; + try { + res.setYear(readField(s, 0, 4)); + offset = 4; + if (s.length() >= 6) + res.setMonth(readField(s, 4, 2)); + offset = 6; + if (s.length() >= 8) + res.setDay(readField(s, 6, 2)); + offset = 8; + if (s.length() >= 10) + res.setHour(readField(s, 8, 2)); + offset = 10; + if (s.length() >= 12) + res.setMinute(readField(s, 10, 2)); + offset = 12; + if (s.length() >= 14) + res.setSecond(readField(s, 12, 2)); + offset = 15; + if (s.length() >= 16) { + res.setFractions(s.length() - (15)); + res.setFraction(readField(s, 15, res.fractions)); + } + if (t != null) { + res.setTzHour(readField(t, 1, 2)); + res.setTzMin(readField(t, 3, 2)); + } + } catch (Exception e) { + throw new ParseException("The date '"+xDate+"' is not a valid Date Time Format at character "+java.lang.Integer.toString(offset), offset); + } + return res; + } + + public DateAndTime expandTime() { + time = true; + seconds = true; + timezone = true; + TimeZone tz = TimeZone.getDefault(); + + int offset = tz.getOffset(new java.util.Date().getTime()); + setOffsetMinutes(offset / (60 * 1000)); + return this; + } + + public String toHumanDisplay() { + if (isTime()) + return java.lang.Integer.toString(this.day)+"-"+this.getMonthCode()+" "+java.lang.Integer.toString(this.getYear()) +" "+java.lang.Integer.toString(this.hour)+":"+java.lang.Integer.toString(this.minute); + else + return java.lang.Integer.toString(this.day)+"-"+this.getMonthCode()+" "+java.lang.Integer.toString(this.getYear()); + } + + private String getMonthCode() { + switch (month) { + case 1: return "Jan"; + case 2: return "Feb"; + case 3: return "Mar"; + case 4: return "Apr"; + case 5: return "May"; + case 6: return "Jun"; + case 7: return "Jul"; + case 8: return "Aug"; + case 9: return "Sep"; + case 10: return "Oct"; + case 11: return "Nov"; + case 12: return "Dec"; + + } + return null; + } + + /** + * Add a duration to the DateAndTime. See documentation for Calendar.add + * + * @param field - Calendar constants for field + * @param value - value to add - can be positive or negative + * @throws Exception + */ + public void add(int field, int value) throws Exception { + switch (field) { + case Calendar.YEAR: + year = year + value; + break; + case Calendar.MONTH: + month = month + (value == 0 ? 1 : value); + while (month <= 0) { + add(Calendar.YEAR, -1); + month = month + 12; + } + while (month > 12) { + add(Calendar.YEAR, 1); + month = month - 12; + } + break; + case Calendar.DAY_OF_YEAR: + day = day + (value == 0 ? 1 : value); + while (day <= 0) { + add(Calendar.MONTH, -1); + day = day + daysInMonth(year, month); + } + int days = daysInMonth(year, month); + while (day > days) { + add(Calendar.MONTH, 1); + day = day - days; + days = daysInMonth(year, month); + } + break; + case Calendar.HOUR: + hour = hour + value; + time = true; + while (hour < 0) { + add(Calendar.DAY_OF_YEAR, -1); + hour = hour + 24; + } + while (hour >= 24) { + add(Calendar.DAY_OF_YEAR, 1); + hour = hour - 24; + } + break; + case Calendar.MINUTE: + minute = minute + value; + time = true; + while (minute < 0) { + add(Calendar.HOUR, -1); + minute = minute + 60; + } + while (minute >= 60) { + add(Calendar.HOUR, 1); + minute = minute - 60; + } + break; + case Calendar.SECOND: + second = second + value; + seconds = true; + while (second < 0) { + add(Calendar.MINUTE, -1); + second = second + 60; + } + while (second >= 60) { + add(Calendar.MINUTE, 1); + second = second - 60; + } + break; + default: + throw new Exception("Unknown field"); + } + } + + private int daysInMonth(int aYear, int aMonth) { + switch (aMonth) { + case 1: return 31; + case 2: return isleapYear(aYear) ? 29 : 28; + case 3: return 31; + case 4: return 30; + case 5: return 31; + case 6: return 30; + case 7: return 31; + case 8: return 31; + case 9: return 30; + case 10: return 31; + case 11: return 30; + case 12: return 31; + default: + throw new Error("illegal month "+java.lang.Integer.toString(aMonth)); + } + } + + private boolean isleapYear(int aYear) { + return (aYear % 4 == 0) && !((aYear % 100 == 0) && (aYear % 400 != 0)); + } + + public boolean before(DateAndTime other) { + + if(this.time && other.time) { + return toCalendar().getTimeInMillis() < other.toCalendar().getTimeInMillis(); + } else if (this.year != other.year) { + return this.year < other.year; + } else if (this.month != other.month) { + return this.month < other.month; + } else if (this.day != other.day) { + return this.day < other.day; + } else + return false; + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DateTimeType.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DateTimeType.java index c04c4f30d06..9c50d3f6026 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DateTimeType.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DateTimeType.java @@ -1,213 +1,192 @@ -/* -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; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import java.util.Calendar; -import java.util.Date; -import java.util.TimeZone; -import java.util.zip.DataFormatException; - -import org.apache.commons.lang3.time.DateUtils; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; - -/** - * Represents a FHIR dateTime datatype. Valid precisions values for this type are: - *
    - *
  • {@link TemporalPrecisionEnum#YEAR} - *
  • {@link TemporalPrecisionEnum#MONTH} - *
  • {@link TemporalPrecisionEnum#DAY} - *
  • {@link TemporalPrecisionEnum#SECOND} - *
  • {@link TemporalPrecisionEnum#MILLI} - *
- */ -@DatatypeDef(name = "dateTime") -public class DateTimeType extends BaseDateTimeType { - - private static final long serialVersionUID = 3L; - - /** - * The default precision for this type - */ - public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.SECOND; - - /** - * Constructor - */ - public DateTimeType() { - super(); - } - - /** - * Create a new DateTimeDt with seconds precision and the local time zone - */ - public DateTimeType(Date theDate) { - super(theDate, DEFAULT_PRECISION, TimeZone.getDefault()); - } - - /** - * Constructor which accepts a date value and a precision value. Valid precisions values for this type are: - *
    - *
  • {@link TemporalPrecisionEnum#YEAR} - *
  • {@link TemporalPrecisionEnum#MONTH} - *
  • {@link TemporalPrecisionEnum#DAY} - *
  • {@link TemporalPrecisionEnum#SECOND} - *
  • {@link TemporalPrecisionEnum#MILLI} - *
- * - * @throws DataFormatException - * If the specified precision is not allowed for this type - */ - public DateTimeType(Date theDate, TemporalPrecisionEnum thePrecision) { - super(theDate, thePrecision, TimeZone.getDefault()); - } - - /** - * Create a new instance using a string date/time - * - * @throws DataFormatException - * If the specified precision is not allowed for this type - */ - public DateTimeType(String theValue) { - super(theValue); - } - - /** - * Constructor which accepts a date value, precision value, and time zone. Valid precisions values for this type - * are: - *
    - *
  • {@link TemporalPrecisionEnum#YEAR} - *
  • {@link TemporalPrecisionEnum#MONTH} - *
  • {@link TemporalPrecisionEnum#DAY} - *
  • {@link TemporalPrecisionEnum#SECOND} - *
  • {@link TemporalPrecisionEnum#MILLI} - *
- */ - public DateTimeType(Date theDate, TemporalPrecisionEnum thePrecision, TimeZone theTimezone) { - super(theDate, thePrecision, theTimezone); - } - - /** - * Constructor - */ - public DateTimeType(Calendar theCalendar) { - if (theCalendar != null) { - setValue(theCalendar.getTime()); - setPrecision(DEFAULT_PRECISION); - setTimeZone(theCalendar.getTimeZone()); - } - } - - @Override - boolean isPrecisionAllowed(TemporalPrecisionEnum thePrecision) { - switch (thePrecision) { - case YEAR: - case MONTH: - case DAY: - case SECOND: - case MILLI: - return true; - default: - return false; - } - } - - /** - * Returns a new instance of DateTimeType with the current system time and SECOND precision and the system local time - * zone - */ - public static DateTimeType now() { - return new DateTimeType(new Date(), TemporalPrecisionEnum.SECOND, TimeZone.getDefault()); - } - - /** - * Returns the default precision for this datatype - * - * @see #DEFAULT_PRECISION - */ - @Override - protected TemporalPrecisionEnum getDefaultPrecisionForDatatype() { - return DEFAULT_PRECISION; - } - - @Override - public DateTimeType copy() { - return new DateTimeType(getValueAsString()); - } - - /** - * Creates a new instance by parsing an HL7 v3 format date time string - */ - public static DateTimeType parseV3(String theV3String) { - DateTimeType retVal = new DateTimeType(); - retVal.setValueAsV3String(theV3String); - return retVal; - } - - public static DateTimeType today() { - DateTimeType retVal = now(); - retVal.setPrecision(TemporalPrecisionEnum.DAY); - return retVal; - } - - public boolean getTzSign() { - return getTimeZone().getRawOffset() >= 0; - } - - public int getTzHour() { - return (int) (getTimeZone().getRawOffset() / DateUtils.MILLIS_PER_MINUTE) / 60; - } - - public int getTzMin() { - return (int) (getTimeZone().getRawOffset() / DateUtils.MILLIS_PER_MINUTE) % 60; - } - - -} +/* +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; + +import java.util.Calendar; +import java.util.Date; +import java.util.TimeZone; +import java.util.zip.DataFormatException; + +import org.apache.commons.lang3.time.DateUtils; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; + +/** + * Represents a FHIR dateTime datatype. Valid precisions values for this type are: + *
    + *
  • {@link TemporalPrecisionEnum#YEAR} + *
  • {@link TemporalPrecisionEnum#MONTH} + *
  • {@link TemporalPrecisionEnum#DAY} + *
  • {@link TemporalPrecisionEnum#SECOND} + *
  • {@link TemporalPrecisionEnum#MILLI} + *
+ */ +@DatatypeDef(name = "dateTime") +public class DateTimeType extends BaseDateTimeType { + + private static final long serialVersionUID = 3L; + + /** + * The default precision for this type + */ + public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.SECOND; + + /** + * Constructor + */ + public DateTimeType() { + super(); + } + + /** + * Create a new DateTimeDt with seconds precision and the local time zone + */ + public DateTimeType(Date theDate) { + super(theDate, DEFAULT_PRECISION, TimeZone.getDefault()); + } + + /** + * Constructor which accepts a date value and a precision value. Valid precisions values for this type are: + *
    + *
  • {@link TemporalPrecisionEnum#YEAR} + *
  • {@link TemporalPrecisionEnum#MONTH} + *
  • {@link TemporalPrecisionEnum#DAY} + *
  • {@link TemporalPrecisionEnum#SECOND} + *
  • {@link TemporalPrecisionEnum#MILLI} + *
+ * + * @throws DataFormatException + * If the specified precision is not allowed for this type + */ + public DateTimeType(Date theDate, TemporalPrecisionEnum thePrecision) { + super(theDate, thePrecision, TimeZone.getDefault()); + } + + /** + * Create a new instance using a string date/time + * + * @throws DataFormatException + * If the specified precision is not allowed for this type + */ + public DateTimeType(String theValue) { + super(theValue); + } + + /** + * Constructor which accepts a date value, precision value, and time zone. Valid precisions values for this type + * are: + *
    + *
  • {@link TemporalPrecisionEnum#YEAR} + *
  • {@link TemporalPrecisionEnum#MONTH} + *
  • {@link TemporalPrecisionEnum#DAY} + *
  • {@link TemporalPrecisionEnum#SECOND} + *
  • {@link TemporalPrecisionEnum#MILLI} + *
+ */ + public DateTimeType(Date theDate, TemporalPrecisionEnum thePrecision, TimeZone theTimezone) { + super(theDate, thePrecision, theTimezone); + } + + /** + * Constructor + */ + public DateTimeType(Calendar theCalendar) { + if (theCalendar != null) { + setValue(theCalendar.getTime()); + setPrecision(DEFAULT_PRECISION); + setTimeZone(theCalendar.getTimeZone()); + } + } + + @Override + boolean isPrecisionAllowed(TemporalPrecisionEnum thePrecision) { + switch (thePrecision) { + case YEAR: + case MONTH: + case DAY: + case SECOND: + case MILLI: + return true; + default: + return false; + } + } + + /** + * Returns a new instance of DateTimeType with the current system time and SECOND precision and the system local time + * zone + */ + public static DateTimeType now() { + return new DateTimeType(new Date(), TemporalPrecisionEnum.SECOND, TimeZone.getDefault()); + } + + /** + * Returns the default precision for this datatype + * + * @see #DEFAULT_PRECISION + */ + @Override + protected TemporalPrecisionEnum getDefaultPrecisionForDatatype() { + return DEFAULT_PRECISION; + } + + @Override + public DateTimeType copy() { + return new DateTimeType(getValueAsString()); + } + + /** + * Creates a new instance by parsing an HL7 v3 format date time string + */ + public static DateTimeType parseV3(String theV3String) { + DateTimeType retVal = new DateTimeType(); + retVal.setValueAsV3String(theV3String); + return retVal; + } + + public static DateTimeType today() { + DateTimeType retVal = now(); + retVal.setPrecision(TemporalPrecisionEnum.DAY); + return retVal; + } + + public boolean getTzSign() { + return getTimeZone().getRawOffset() >= 0; + } + + public int getTzHour() { + return (int) (getTimeZone().getRawOffset() / DateUtils.MILLIS_PER_MINUTE) / 60; + } + + public int getTzMin() { + return (int) (getTimeZone().getRawOffset() / DateUtils.MILLIS_PER_MINUTE) % 60; + } + + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DateType.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DateType.java index cbf102d5dd8..3eb28a0a63a 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DateType.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DateType.java @@ -1,159 +1,138 @@ -/* -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; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/** - * Primitive type "date" in FHIR: any day in a gregorian calendar - */ - -import java.util.Date; -import java.util.TimeZone; - -import org.hl7.fhir.instance.model.annotations.DatatypeDef; - -/** - * Represents a FHIR date datatype. Valid precisions values for this type are: - *
    - *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#YEAR} - *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#MONTH} - *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#DAY} - *
- */ -@DatatypeDef(name = "date") -public class DateType extends BaseDateTimeType { - - private static final long serialVersionUID = 3L; - - /** - * The default precision for this type - */ - public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.DAY; - - /** - * Constructor - */ - public DateType() { - super(); - } - - /** - * Constructor which accepts a date value and uses the {@link #DEFAULT_PRECISION} for this type - */ - public DateType(Date theDate) { - super(theDate, DEFAULT_PRECISION); - } - - /** - * Constructor which accepts a date value and a precision value. Valid precisions values for this type are: - *
    - *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#YEAR} - *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#MONTH} - *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#DAY} - *
- * - * @throws ca.uhn.fhir.parser.DataFormatException - * If the specified precision is not allowed for this type - */ - public DateType(Date theDate, TemporalPrecisionEnum thePrecision) { - super(theDate, thePrecision); - } - - /** - * Constructor which accepts a date as a string in FHIR format - * - * @throws ca.uhn.fhir.parser.DataFormatException - * If the precision in the date string is not allowed for this type - */ - public DateType(String theDate) { - super(theDate); - } - - @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()); - } - - public static InstantType today() { - return new InstantType(new Date(), TemporalPrecisionEnum.DAY, TimeZone.getDefault()); - } - - /** - * Creates a new instance by parsing an HL7 v3 format date time string - */ - public static DateType parseV3(String theV3String) { - DateType retVal = new DateType(); - retVal.setValueAsV3String(theV3String); - return retVal; - } - -} +/* +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; + +/** + * Primitive type "date" in FHIR: any day in a gregorian calendar + */ + +import java.util.Date; +import java.util.TimeZone; + +import org.hl7.fhir.instance.model.annotations.DatatypeDef; + +/** + * Represents a FHIR date datatype. Valid precisions values for this type are: + *
    + *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#YEAR} + *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#MONTH} + *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#DAY} + *
+ */ +@DatatypeDef(name = "date") +public class DateType extends BaseDateTimeType { + + private static final long serialVersionUID = 3L; + + /** + * The default precision for this type + */ + public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.DAY; + + /** + * Constructor + */ + public DateType() { + super(); + } + + /** + * Constructor which accepts a date value and uses the {@link #DEFAULT_PRECISION} for this type + */ + public DateType(Date theDate) { + super(theDate, DEFAULT_PRECISION); + } + + /** + * Constructor which accepts a date value and a precision value. Valid precisions values for this type are: + *
    + *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#YEAR} + *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#MONTH} + *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#DAY} + *
+ * + * @throws ca.uhn.fhir.parser.DataFormatException + * If the specified precision is not allowed for this type + */ + public DateType(Date theDate, TemporalPrecisionEnum thePrecision) { + super(theDate, thePrecision); + } + + /** + * Constructor which accepts a date as a string in FHIR format + * + * @throws ca.uhn.fhir.parser.DataFormatException + * If the precision in the date string is not allowed for this type + */ + public DateType(String theDate) { + super(theDate); + } + + @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()); + } + + public static InstantType today() { + return new InstantType(new Date(), TemporalPrecisionEnum.DAY, TimeZone.getDefault()); + } + + /** + * Creates a new instance by parsing an HL7 v3 format date time string + */ + public static DateType parseV3(String theV3String) { + DateType retVal = new DateType(); + retVal.setValueAsV3String(theV3String); + return retVal; + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DecimalType.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DecimalType.java index dcc0c9dd044..4ef05f17614 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DecimalType.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DecimalType.java @@ -1,179 +1,158 @@ -/* -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; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import java.math.BigDecimal; -import java.math.MathContext; -import java.math.RoundingMode; - -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -import org.hl7.fhir.instance.model.api.IBaseDecimalDatatype; - -/** - * Primitive type "decimal" in FHIR: A rational number - */ -@DatatypeDef(name = "decimal") -public class DecimalType extends PrimitiveType implements Comparable, IBaseDecimalDatatype { - - private static final long serialVersionUID = 3L; - - /** - * Constructor - */ - public DecimalType() { - super(); - } - - /** - * Constructor - */ - public DecimalType(BigDecimal theValue) { - setValue(theValue); - } - - /** - * Constructor - */ - public DecimalType(double theValue) { - // Use the valueOf here because the constructor gives wacky precision - // changes due to the floating point conversion - setValue(BigDecimal.valueOf(theValue)); - } - - /** - * Constructor - */ - public DecimalType(long theValue) { - setValue(new BigDecimal(theValue)); - } - - /** - * Constructor - */ - public DecimalType(String theValue) { - setValue(new BigDecimal(theValue)); - } - - @Override - public int compareTo(DecimalType theObj) { - if (getValue() == null && theObj.getValue() == null) { - return 0; - } - if (getValue() != null && theObj.getValue() == null) { - return 1; - } - if (getValue() == null && theObj.getValue() != null) { - return -1; - } - return getValue().compareTo(theObj.getValue()); - } - - @Override - protected String encode(BigDecimal theValue) { - return getValue().toPlainString(); - } - - /** - * Gets the value as an integer, using {@link BigDecimal#intValue()} - */ - public int getValueAsInteger() { - return getValue().intValue(); - } - - public Number getValueAsNumber() { - return getValue(); - } - - @Override - protected BigDecimal parse(String theValue) { - return new BigDecimal(theValue); - } - - /** - * Rounds the value to the given prevision - * - * @see MathContext#getPrecision() - */ - public void round(int thePrecision) { - if (getValue() != null) { - BigDecimal newValue = getValue().round(new MathContext(thePrecision)); - setValue(newValue); - } - } - - /** - * Rounds the value to the given prevision - * - * @see MathContext#getPrecision() - * @see MathContext#getRoundingMode() - */ - public void round(int thePrecision, RoundingMode theRoundingMode) { - if (getValue() != null) { - BigDecimal newValue = getValue().round(new MathContext(thePrecision, theRoundingMode)); - setValue(newValue); - } - } - - /** - * Sets a new value using an integer - */ - public void setValueAsInteger(int theValue) { - setValue(new BigDecimal(theValue)); - } - - @Override - public DecimalType copy() { - return new DecimalType(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. + + */ +/** + * + */ +package org.hl7.fhir.instance.model; + +import java.math.BigDecimal; +import java.math.MathContext; +import java.math.RoundingMode; + +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +import org.hl7.fhir.instance.model.api.IBaseDecimalDatatype; + +/** + * Primitive type "decimal" in FHIR: A rational number + */ +@DatatypeDef(name = "decimal") +public class DecimalType extends PrimitiveType implements Comparable, IBaseDecimalDatatype { + + private static final long serialVersionUID = 3L; + + /** + * Constructor + */ + public DecimalType() { + super(); + } + + /** + * Constructor + */ + public DecimalType(BigDecimal theValue) { + setValue(theValue); + } + + /** + * Constructor + */ + public DecimalType(double theValue) { + // Use the valueOf here because the constructor gives wacky precision + // changes due to the floating point conversion + setValue(BigDecimal.valueOf(theValue)); + } + + /** + * Constructor + */ + public DecimalType(long theValue) { + setValue(new BigDecimal(theValue)); + } + + /** + * Constructor + */ + public DecimalType(String theValue) { + setValue(new BigDecimal(theValue)); + } + + @Override + public int compareTo(DecimalType theObj) { + if (getValue() == null && theObj.getValue() == null) { + return 0; + } + if (getValue() != null && theObj.getValue() == null) { + return 1; + } + if (getValue() == null && theObj.getValue() != null) { + return -1; + } + return getValue().compareTo(theObj.getValue()); + } + + @Override + protected String encode(BigDecimal theValue) { + return getValue().toPlainString(); + } + + /** + * Gets the value as an integer, using {@link BigDecimal#intValue()} + */ + public int getValueAsInteger() { + return getValue().intValue(); + } + + public Number getValueAsNumber() { + return getValue(); + } + + @Override + protected BigDecimal parse(String theValue) { + return new BigDecimal(theValue); + } + + /** + * Rounds the value to the given prevision + * + * @see MathContext#getPrecision() + */ + public void round(int thePrecision) { + if (getValue() != null) { + BigDecimal newValue = getValue().round(new MathContext(thePrecision)); + setValue(newValue); + } + } + + /** + * Rounds the value to the given prevision + * + * @see MathContext#getPrecision() + * @see MathContext#getRoundingMode() + */ + public void round(int thePrecision, RoundingMode theRoundingMode) { + if (getValue() != null) { + BigDecimal newValue = getValue().round(new MathContext(thePrecision, theRoundingMode)); + setValue(newValue); + } + } + + /** + * Sets a new value using an integer + */ + public void setValueAsInteger(int theValue) { + setValue(new BigDecimal(theValue)); + } + + @Override + public DecimalType copy() { + return new DecimalType(getValue()); + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Device.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Device.java index a6473845c6b..37b8c98a205 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Device.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Device.java @@ -1,1082 +1,1061 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * This resource identifies an instance of a manufactured thing that is used in the provision of healthcare without being substantially changed through that activity. The device may be a machine, an insert, a computer, an application, etc. This includes durable (reusable) medical equipment as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. - */ -@ResourceDef(name="Device", profile="http://hl7.org/fhir/Profile/Device") -public class Device extends DomainResource { - - public enum Devicestatus { - /** - * The Device is available for use. - */ - AVAILABLE, - /** - * The Device is no longer available for use ( e.g lost, expired, damaged). - */ - NOTAVAILABLE, - /** - * The Device was entered in error and voided. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static Devicestatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("available".equals(codeString)) - return AVAILABLE; - if ("not-available".equals(codeString)) - return NOTAVAILABLE; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new Exception("Unknown Devicestatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case AVAILABLE: return "available"; - case NOTAVAILABLE: return "not-available"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case AVAILABLE: return ""; - case NOTAVAILABLE: return ""; - case ENTEREDINERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case AVAILABLE: return "The Device is available for use."; - case NOTAVAILABLE: return "The Device is no longer available for use ( e.g lost, expired, damaged)."; - case ENTEREDINERROR: return "The Device was entered in error and voided."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case AVAILABLE: return "Available"; - case NOTAVAILABLE: return "Not Available"; - case ENTEREDINERROR: return "Entered in Error"; - default: return "?"; - } - } - } - - public static class DevicestatusEnumFactory implements EnumFactory { - public Devicestatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("available".equals(codeString)) - return Devicestatus.AVAILABLE; - if ("not-available".equals(codeString)) - return Devicestatus.NOTAVAILABLE; - if ("entered-in-error".equals(codeString)) - return Devicestatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown Devicestatus code '"+codeString+"'"); - } - public String toCode(Devicestatus code) { - if (code == Devicestatus.AVAILABLE) - return "available"; - if (code == Devicestatus.NOTAVAILABLE) - return "not-available"; - if (code == Devicestatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - } - - /** - * Unique instance identifiers assigned to a device by organizations like manufacturers or owners . If the identifier identifies the type of device, Device.type should be used. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Instance id from manufacturer, owner, and others", formalDefinition="Unique instance identifiers assigned to a device by organizations like manufacturers or owners . If the identifier identifies the type of device, Device.type should be used." ) - protected List identifier; - - /** - * Code or identifier to identify a kind of device. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="What kind of device this is", formalDefinition="Code or identifier to identify a kind of device." ) - protected CodeableConcept type; - - /** - * Status of the Device availability. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="available | not-available | entered-in-error", formalDefinition="Status of the Device availability." ) - protected Enumeration status; - - /** - * A name of the manufacturer. - */ - @Child(name = "manufacturer", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Name of device manufacturer", formalDefinition="A name of the manufacturer." ) - protected StringType manufacturer; - - /** - * The "model" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type. - */ - @Child(name = "model", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Model id assigned by the manufacturer", formalDefinition="The 'model' - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type." ) - protected StringType model; - - /** - * The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware. - */ - @Child(name = "version", type = {StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Version number (i.e. software)", formalDefinition="The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware." ) - protected StringType version; - - /** - * The Date and time when the device was manufactured. - */ - @Child(name = "manufactureDate", type = {DateTimeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Manufacture date", formalDefinition="The Date and time when the device was manufactured." ) - protected DateTimeType manufactureDate; - - /** - * The date and time beyond which this device is no longer valid or should not be used (if applicable). - */ - @Child(name = "expiry", type = {DateTimeType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Date and time of expiry of this device (if applicable)", formalDefinition="The date and time beyond which this device is no longer valid or should not be used (if applicable)." ) - protected DateTimeType expiry; - - /** - * United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm. - */ - @Child(name = "udi", type = {StringType.class}, order=8, min=0, max=1) - @Description(shortDefinition="FDA Mandated Unique Device Identifier", formalDefinition="United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm." ) - protected StringType udi; - - /** - * Lot number assigned by the manufacturer. - */ - @Child(name = "lotNumber", type = {StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Lot number of manufacture", formalDefinition="Lot number assigned by the manufacturer." ) - protected StringType lotNumber; - - /** - * An organization that is responsible for the provision and ongoing maintenance of the device. - */ - @Child(name = "owner", type = {Organization.class}, order=10, min=0, max=1) - @Description(shortDefinition="Organization responsible for device", formalDefinition="An organization that is responsible for the provision and ongoing maintenance of the device." ) - protected Reference owner; - - /** - * The actual object that is the target of the reference (An organization that is responsible for the provision and ongoing maintenance of the device.) - */ - protected Organization ownerTarget; - - /** - * The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location. - */ - @Child(name = "location", type = {Location.class}, order=11, min=0, max=1) - @Description(shortDefinition="Where the resource is found", formalDefinition="The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. 'in/with the patient'), or a coded location." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location.) - */ - protected Location locationTarget; - - /** - * Patient information, if the resource is affixed to a person. - */ - @Child(name = "patient", type = {Patient.class}, order=12, min=0, max=1) - @Description(shortDefinition="If the resource is affixed to a person", formalDefinition="Patient information, if the resource is affixed to a person." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (Patient information, if the resource is affixed to a person.) - */ - protected Patient patientTarget; - - /** - * Contact details for an organization or a particular human that is responsible for the device. - */ - @Child(name = "contact", type = {ContactPoint.class}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Details for human/organization for support", formalDefinition="Contact details for an organization or a particular human that is responsible for the device." ) - protected List contact; - - /** - * A network address on which the device may be contacted directly. - */ - @Child(name = "url", type = {UriType.class}, order=14, min=0, max=1) - @Description(shortDefinition="Network address to contact device", formalDefinition="A network address on which the device may be contacted directly." ) - protected UriType url; - - private static final long serialVersionUID = -699591241L; - - /* - * Constructor - */ - public Device() { - super(); - } - - /* - * Constructor - */ - public Device(CodeableConcept type) { - super(); - this.type = type; - } - - /** - * @return {@link #identifier} (Unique instance identifiers assigned to a device by organizations like manufacturers or owners . If the identifier identifies the type of device, Device.type should be used.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Unique instance identifiers assigned to a device by organizations like manufacturers or owners . If the identifier identifies the type of device, Device.type should be used.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Device addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #type} (Code or identifier to identify a kind of device.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Code or identifier to identify a kind of device.) - */ - public Device setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #status} (Status of the Device availability.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new DevicestatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Status of the Device availability.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Device setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Status of the Device availability. - */ - public Devicestatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Status of the Device availability. - */ - public Device setStatus(Devicestatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new DevicestatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #manufacturer} (A name of the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getManufacturer" gives direct access to the value - */ - public StringType getManufacturerElement() { - if (this.manufacturer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.manufacturer"); - else if (Configuration.doAutoCreate()) - this.manufacturer = new StringType(); // bb - return this.manufacturer; - } - - public boolean hasManufacturerElement() { - return this.manufacturer != null && !this.manufacturer.isEmpty(); - } - - public boolean hasManufacturer() { - return this.manufacturer != null && !this.manufacturer.isEmpty(); - } - - /** - * @param value {@link #manufacturer} (A name of the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getManufacturer" gives direct access to the value - */ - public Device setManufacturerElement(StringType value) { - this.manufacturer = value; - return this; - } - - /** - * @return A name of the manufacturer. - */ - public String getManufacturer() { - return this.manufacturer == null ? null : this.manufacturer.getValue(); - } - - /** - * @param value A name of the manufacturer. - */ - public Device setManufacturer(String value) { - if (Utilities.noString(value)) - this.manufacturer = null; - else { - if (this.manufacturer == null) - this.manufacturer = new StringType(); - this.manufacturer.setValue(value); - } - return this; - } - - /** - * @return {@link #model} (The "model" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.). This is the underlying object with id, value and extensions. The accessor "getModel" gives direct access to the value - */ - public StringType getModelElement() { - if (this.model == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.model"); - else if (Configuration.doAutoCreate()) - this.model = new StringType(); // bb - return this.model; - } - - public boolean hasModelElement() { - return this.model != null && !this.model.isEmpty(); - } - - public boolean hasModel() { - return this.model != null && !this.model.isEmpty(); - } - - /** - * @param value {@link #model} (The "model" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.). This is the underlying object with id, value and extensions. The accessor "getModel" gives direct access to the value - */ - public Device setModelElement(StringType value) { - this.model = value; - return this; - } - - /** - * @return The "model" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type. - */ - public String getModel() { - return this.model == null ? null : this.model.getValue(); - } - - /** - * @param value The "model" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type. - */ - public Device setModel(String value) { - if (Utilities.noString(value)) - this.model = null; - else { - if (this.model == null) - this.model = new StringType(); - this.model.setValue(value); - } - return this; - } - - /** - * @return {@link #version} (The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public Device setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware. - */ - public Device setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #manufactureDate} (The Date and time when the device was manufactured.). This is the underlying object with id, value and extensions. The accessor "getManufactureDate" gives direct access to the value - */ - public DateTimeType getManufactureDateElement() { - if (this.manufactureDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.manufactureDate"); - else if (Configuration.doAutoCreate()) - this.manufactureDate = new DateTimeType(); // bb - return this.manufactureDate; - } - - public boolean hasManufactureDateElement() { - return this.manufactureDate != null && !this.manufactureDate.isEmpty(); - } - - public boolean hasManufactureDate() { - return this.manufactureDate != null && !this.manufactureDate.isEmpty(); - } - - /** - * @param value {@link #manufactureDate} (The Date and time when the device was manufactured.). This is the underlying object with id, value and extensions. The accessor "getManufactureDate" gives direct access to the value - */ - public Device setManufactureDateElement(DateTimeType value) { - this.manufactureDate = value; - return this; - } - - /** - * @return The Date and time when the device was manufactured. - */ - public Date getManufactureDate() { - return this.manufactureDate == null ? null : this.manufactureDate.getValue(); - } - - /** - * @param value The Date and time when the device was manufactured. - */ - public Device setManufactureDate(Date value) { - if (value == null) - this.manufactureDate = null; - else { - if (this.manufactureDate == null) - this.manufactureDate = new DateTimeType(); - this.manufactureDate.setValue(value); - } - return this; - } - - /** - * @return {@link #expiry} (The date and time beyond which this device is no longer valid or should not be used (if applicable).). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value - */ - public DateTimeType getExpiryElement() { - if (this.expiry == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.expiry"); - else if (Configuration.doAutoCreate()) - this.expiry = new DateTimeType(); // bb - return this.expiry; - } - - public boolean hasExpiryElement() { - return this.expiry != null && !this.expiry.isEmpty(); - } - - public boolean hasExpiry() { - return this.expiry != null && !this.expiry.isEmpty(); - } - - /** - * @param value {@link #expiry} (The date and time beyond which this device is no longer valid or should not be used (if applicable).). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value - */ - public Device setExpiryElement(DateTimeType value) { - this.expiry = value; - return this; - } - - /** - * @return The date and time beyond which this device is no longer valid or should not be used (if applicable). - */ - public Date getExpiry() { - return this.expiry == null ? null : this.expiry.getValue(); - } - - /** - * @param value The date and time beyond which this device is no longer valid or should not be used (if applicable). - */ - public Device setExpiry(Date value) { - if (value == null) - this.expiry = null; - else { - if (this.expiry == null) - this.expiry = new DateTimeType(); - this.expiry.setValue(value); - } - return this; - } - - /** - * @return {@link #udi} (United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm.). This is the underlying object with id, value and extensions. The accessor "getUdi" gives direct access to the value - */ - public StringType getUdiElement() { - if (this.udi == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.udi"); - else if (Configuration.doAutoCreate()) - this.udi = new StringType(); // bb - return this.udi; - } - - public boolean hasUdiElement() { - return this.udi != null && !this.udi.isEmpty(); - } - - public boolean hasUdi() { - return this.udi != null && !this.udi.isEmpty(); - } - - /** - * @param value {@link #udi} (United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm.). This is the underlying object with id, value and extensions. The accessor "getUdi" gives direct access to the value - */ - public Device setUdiElement(StringType value) { - this.udi = value; - return this; - } - - /** - * @return United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm. - */ - public String getUdi() { - return this.udi == null ? null : this.udi.getValue(); - } - - /** - * @param value United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm. - */ - public Device setUdi(String value) { - if (Utilities.noString(value)) - this.udi = null; - else { - if (this.udi == null) - this.udi = new StringType(); - this.udi.setValue(value); - } - return this; - } - - /** - * @return {@link #lotNumber} (Lot number assigned by the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value - */ - public StringType getLotNumberElement() { - if (this.lotNumber == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.lotNumber"); - else if (Configuration.doAutoCreate()) - this.lotNumber = new StringType(); // bb - return this.lotNumber; - } - - public boolean hasLotNumberElement() { - return this.lotNumber != null && !this.lotNumber.isEmpty(); - } - - public boolean hasLotNumber() { - return this.lotNumber != null && !this.lotNumber.isEmpty(); - } - - /** - * @param value {@link #lotNumber} (Lot number assigned by the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value - */ - public Device setLotNumberElement(StringType value) { - this.lotNumber = value; - return this; - } - - /** - * @return Lot number assigned by the manufacturer. - */ - public String getLotNumber() { - return this.lotNumber == null ? null : this.lotNumber.getValue(); - } - - /** - * @param value Lot number assigned by the manufacturer. - */ - public Device setLotNumber(String value) { - if (Utilities.noString(value)) - this.lotNumber = null; - else { - if (this.lotNumber == null) - this.lotNumber = new StringType(); - this.lotNumber.setValue(value); - } - return this; - } - - /** - * @return {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.) - */ - public Reference getOwner() { - if (this.owner == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.owner"); - else if (Configuration.doAutoCreate()) - this.owner = new Reference(); // cc - return this.owner; - } - - public boolean hasOwner() { - return this.owner != null && !this.owner.isEmpty(); - } - - /** - * @param value {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.) - */ - public Device setOwner(Reference value) { - this.owner = value; - return this; - } - - /** - * @return {@link #owner} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An organization that is responsible for the provision and ongoing maintenance of the device.) - */ - public Organization getOwnerTarget() { - if (this.ownerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.owner"); - else if (Configuration.doAutoCreate()) - this.ownerTarget = new Organization(); // aa - return this.ownerTarget; - } - - /** - * @param value {@link #owner} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An organization that is responsible for the provision and ongoing maintenance of the device.) - */ - public Device setOwnerTarget(Organization value) { - this.ownerTarget = value; - return this; - } - - /** - * @return {@link #location} (The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); // cc - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location.) - */ - public Device setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); // aa - return this.locationTarget; - } - - /** - * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location.) - */ - public Device setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #patient} (Patient information, if the resource is affixed to a person.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (Patient information, if the resource is affixed to a person.) - */ - public Device setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Patient information, if the resource is affixed to a person.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Patient information, if the resource is affixed to a person.) - */ - public Device setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #contact} (Contact details for an organization or a particular human that is responsible for the device.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (ContactPoint item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contact details for an organization or a particular human that is responsible for the device.) - */ - // syntactic sugar - public ContactPoint addContact() { //3 - ContactPoint t = new ContactPoint(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public Device addContact(ContactPoint t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #url} (A network address on which the device may be contacted directly.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (A network address on which the device may be contacted directly.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public Device setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return A network address on which the device may be contacted directly. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value A network address on which the device may be contacted directly. - */ - public Device setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Unique instance identifiers assigned to a device by organizations like manufacturers or owners . If the identifier identifies the type of device, Device.type should be used.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("type", "CodeableConcept", "Code or identifier to identify a kind of device.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("status", "code", "Status of the Device availability.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("manufacturer", "string", "A name of the manufacturer.", 0, java.lang.Integer.MAX_VALUE, manufacturer)); - childrenList.add(new Property("model", "string", "The 'model' - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.", 0, java.lang.Integer.MAX_VALUE, model)); - childrenList.add(new Property("version", "string", "The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("manufactureDate", "dateTime", "The Date and time when the device was manufactured.", 0, java.lang.Integer.MAX_VALUE, manufactureDate)); - childrenList.add(new Property("expiry", "dateTime", "The date and time beyond which this device is no longer valid or should not be used (if applicable).", 0, java.lang.Integer.MAX_VALUE, expiry)); - childrenList.add(new Property("udi", "string", "United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm.", 0, java.lang.Integer.MAX_VALUE, udi)); - childrenList.add(new Property("lotNumber", "string", "Lot number assigned by the manufacturer.", 0, java.lang.Integer.MAX_VALUE, lotNumber)); - childrenList.add(new Property("owner", "Reference(Organization)", "An organization that is responsible for the provision and ongoing maintenance of the device.", 0, java.lang.Integer.MAX_VALUE, owner)); - childrenList.add(new Property("location", "Reference(Location)", "The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. 'in/with the patient'), or a coded location.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("patient", "Reference(Patient)", "Patient information, if the resource is affixed to a person.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("contact", "ContactPoint", "Contact details for an organization or a particular human that is responsible for the device.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("url", "uri", "A network address on which the device may be contacted directly.", 0, java.lang.Integer.MAX_VALUE, url)); - } - - public Device copy() { - Device dst = new Device(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - dst.status = status == null ? null : status.copy(); - dst.manufacturer = manufacturer == null ? null : manufacturer.copy(); - dst.model = model == null ? null : model.copy(); - dst.version = version == null ? null : version.copy(); - dst.manufactureDate = manufactureDate == null ? null : manufactureDate.copy(); - dst.expiry = expiry == null ? null : expiry.copy(); - dst.udi = udi == null ? null : udi.copy(); - dst.lotNumber = lotNumber == null ? null : lotNumber.copy(); - dst.owner = owner == null ? null : owner.copy(); - dst.location = location == null ? null : location.copy(); - dst.patient = patient == null ? null : patient.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (ContactPoint i : contact) - dst.contact.add(i.copy()); - }; - dst.url = url == null ? null : url.copy(); - return dst; - } - - protected Device typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Device)) - return false; - Device o = (Device) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(status, o.status, true) - && compareDeep(manufacturer, o.manufacturer, true) && compareDeep(model, o.model, true) && compareDeep(version, o.version, true) - && compareDeep(manufactureDate, o.manufactureDate, true) && compareDeep(expiry, o.expiry, true) - && compareDeep(udi, o.udi, true) && compareDeep(lotNumber, o.lotNumber, true) && compareDeep(owner, o.owner, true) - && compareDeep(location, o.location, true) && compareDeep(patient, o.patient, true) && compareDeep(contact, o.contact, true) - && compareDeep(url, o.url, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Device)) - return false; - Device o = (Device) other; - return compareValues(status, o.status, true) && compareValues(manufacturer, o.manufacturer, true) && compareValues(model, o.model, true) - && compareValues(version, o.version, true) && compareValues(manufactureDate, o.manufactureDate, true) - && compareValues(expiry, o.expiry, true) && compareValues(udi, o.udi, true) && compareValues(lotNumber, o.lotNumber, true) - && compareValues(url, o.url, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) - && (status == null || status.isEmpty()) && (manufacturer == null || manufacturer.isEmpty()) - && (model == null || model.isEmpty()) && (version == null || version.isEmpty()) && (manufactureDate == null || manufactureDate.isEmpty()) - && (expiry == null || expiry.isEmpty()) && (udi == null || udi.isEmpty()) && (lotNumber == null || lotNumber.isEmpty()) - && (owner == null || owner.isEmpty()) && (location == null || location.isEmpty()) && (patient == null || patient.isEmpty()) - && (contact == null || contact.isEmpty()) && (url == null || url.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Device; - } - - @SearchParamDefinition(name="organization", path="Device.owner", description="The organization responsible for the device", type="reference" ) - public static final String SP_ORGANIZATION = "organization"; - @SearchParamDefinition(name="model", path="Device.model", description="The model of the device", type="string" ) - public static final String SP_MODEL = "model"; - @SearchParamDefinition(name="patient", path="Device.patient", description="Patient information, if the resource is affixed to a person", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="location", path="Device.location", description="A location, where the resource is found", type="reference" ) - public static final String SP_LOCATION = "location"; - @SearchParamDefinition(name="manufacturer", path="Device.manufacturer", description="The manufacturer of the device", type="string" ) - public static final String SP_MANUFACTURER = "manufacturer"; - @SearchParamDefinition(name="udi", path="Device.udi", description="FDA Mandated Unique Device Identifier", type="string" ) - public static final String SP_UDI = "udi"; - @SearchParamDefinition(name="type", path="Device.type", description="The type of the device", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="identifier", path="Device.identifier", description="Instance id from manufacturer, owner, and others", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * This resource identifies an instance of a manufactured thing that is used in the provision of healthcare without being substantially changed through that activity. The device may be a machine, an insert, a computer, an application, etc. This includes durable (reusable) medical equipment as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. + */ +@ResourceDef(name="Device", profile="http://hl7.org/fhir/Profile/Device") +public class Device extends DomainResource { + + public enum Devicestatus { + /** + * The Device is available for use. + */ + AVAILABLE, + /** + * The Device is no longer available for use ( e.g lost, expired, damaged). + */ + NOTAVAILABLE, + /** + * The Device was entered in error and voided. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static Devicestatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("available".equals(codeString)) + return AVAILABLE; + if ("not-available".equals(codeString)) + return NOTAVAILABLE; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new Exception("Unknown Devicestatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case AVAILABLE: return "available"; + case NOTAVAILABLE: return "not-available"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case AVAILABLE: return ""; + case NOTAVAILABLE: return ""; + case ENTEREDINERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case AVAILABLE: return "The Device is available for use."; + case NOTAVAILABLE: return "The Device is no longer available for use ( e.g lost, expired, damaged)."; + case ENTEREDINERROR: return "The Device was entered in error and voided."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case AVAILABLE: return "Available"; + case NOTAVAILABLE: return "Not Available"; + case ENTEREDINERROR: return "Entered in Error"; + default: return "?"; + } + } + } + + public static class DevicestatusEnumFactory implements EnumFactory { + public Devicestatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("available".equals(codeString)) + return Devicestatus.AVAILABLE; + if ("not-available".equals(codeString)) + return Devicestatus.NOTAVAILABLE; + if ("entered-in-error".equals(codeString)) + return Devicestatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown Devicestatus code '"+codeString+"'"); + } + public String toCode(Devicestatus code) { + if (code == Devicestatus.AVAILABLE) + return "available"; + if (code == Devicestatus.NOTAVAILABLE) + return "not-available"; + if (code == Devicestatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + } + + /** + * Unique instance identifiers assigned to a device by organizations like manufacturers or owners . If the identifier identifies the type of device, Device.type should be used. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Instance id from manufacturer, owner, and others", formalDefinition="Unique instance identifiers assigned to a device by organizations like manufacturers or owners . If the identifier identifies the type of device, Device.type should be used." ) + protected List identifier; + + /** + * Code or identifier to identify a kind of device. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="What kind of device this is", formalDefinition="Code or identifier to identify a kind of device." ) + protected CodeableConcept type; + + /** + * Status of the Device availability. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="available | not-available | entered-in-error", formalDefinition="Status of the Device availability." ) + protected Enumeration status; + + /** + * A name of the manufacturer. + */ + @Child(name = "manufacturer", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Name of device manufacturer", formalDefinition="A name of the manufacturer." ) + protected StringType manufacturer; + + /** + * The "model" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type. + */ + @Child(name = "model", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Model id assigned by the manufacturer", formalDefinition="The 'model' - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type." ) + protected StringType model; + + /** + * The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware. + */ + @Child(name = "version", type = {StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Version number (i.e. software)", formalDefinition="The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware." ) + protected StringType version; + + /** + * The Date and time when the device was manufactured. + */ + @Child(name = "manufactureDate", type = {DateTimeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Manufacture date", formalDefinition="The Date and time when the device was manufactured." ) + protected DateTimeType manufactureDate; + + /** + * The date and time beyond which this device is no longer valid or should not be used (if applicable). + */ + @Child(name = "expiry", type = {DateTimeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Date and time of expiry of this device (if applicable)", formalDefinition="The date and time beyond which this device is no longer valid or should not be used (if applicable)." ) + protected DateTimeType expiry; + + /** + * United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm. + */ + @Child(name = "udi", type = {StringType.class}, order=8, min=0, max=1) + @Description(shortDefinition="FDA Mandated Unique Device Identifier", formalDefinition="United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm." ) + protected StringType udi; + + /** + * Lot number assigned by the manufacturer. + */ + @Child(name = "lotNumber", type = {StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Lot number of manufacture", formalDefinition="Lot number assigned by the manufacturer." ) + protected StringType lotNumber; + + /** + * An organization that is responsible for the provision and ongoing maintenance of the device. + */ + @Child(name = "owner", type = {Organization.class}, order=10, min=0, max=1) + @Description(shortDefinition="Organization responsible for device", formalDefinition="An organization that is responsible for the provision and ongoing maintenance of the device." ) + protected Reference owner; + + /** + * The actual object that is the target of the reference (An organization that is responsible for the provision and ongoing maintenance of the device.) + */ + protected Organization ownerTarget; + + /** + * The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location. + */ + @Child(name = "location", type = {Location.class}, order=11, min=0, max=1) + @Description(shortDefinition="Where the resource is found", formalDefinition="The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. 'in/with the patient'), or a coded location." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location.) + */ + protected Location locationTarget; + + /** + * Patient information, if the resource is affixed to a person. + */ + @Child(name = "patient", type = {Patient.class}, order=12, min=0, max=1) + @Description(shortDefinition="If the resource is affixed to a person", formalDefinition="Patient information, if the resource is affixed to a person." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Patient information, if the resource is affixed to a person.) + */ + protected Patient patientTarget; + + /** + * Contact details for an organization or a particular human that is responsible for the device. + */ + @Child(name = "contact", type = {ContactPoint.class}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Details for human/organization for support", formalDefinition="Contact details for an organization or a particular human that is responsible for the device." ) + protected List contact; + + /** + * A network address on which the device may be contacted directly. + */ + @Child(name = "url", type = {UriType.class}, order=14, min=0, max=1) + @Description(shortDefinition="Network address to contact device", formalDefinition="A network address on which the device may be contacted directly." ) + protected UriType url; + + private static final long serialVersionUID = -699591241L; + + /* + * Constructor + */ + public Device() { + super(); + } + + /* + * Constructor + */ + public Device(CodeableConcept type) { + super(); + this.type = type; + } + + /** + * @return {@link #identifier} (Unique instance identifiers assigned to a device by organizations like manufacturers or owners . If the identifier identifies the type of device, Device.type should be used.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Unique instance identifiers assigned to a device by organizations like manufacturers or owners . If the identifier identifies the type of device, Device.type should be used.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Device addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #type} (Code or identifier to identify a kind of device.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Code or identifier to identify a kind of device.) + */ + public Device setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #status} (Status of the Device availability.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new DevicestatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (Status of the Device availability.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Device setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Status of the Device availability. + */ + public Devicestatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Status of the Device availability. + */ + public Device setStatus(Devicestatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new DevicestatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #manufacturer} (A name of the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getManufacturer" gives direct access to the value + */ + public StringType getManufacturerElement() { + if (this.manufacturer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.manufacturer"); + else if (Configuration.doAutoCreate()) + this.manufacturer = new StringType(); // bb + return this.manufacturer; + } + + public boolean hasManufacturerElement() { + return this.manufacturer != null && !this.manufacturer.isEmpty(); + } + + public boolean hasManufacturer() { + return this.manufacturer != null && !this.manufacturer.isEmpty(); + } + + /** + * @param value {@link #manufacturer} (A name of the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getManufacturer" gives direct access to the value + */ + public Device setManufacturerElement(StringType value) { + this.manufacturer = value; + return this; + } + + /** + * @return A name of the manufacturer. + */ + public String getManufacturer() { + return this.manufacturer == null ? null : this.manufacturer.getValue(); + } + + /** + * @param value A name of the manufacturer. + */ + public Device setManufacturer(String value) { + if (Utilities.noString(value)) + this.manufacturer = null; + else { + if (this.manufacturer == null) + this.manufacturer = new StringType(); + this.manufacturer.setValue(value); + } + return this; + } + + /** + * @return {@link #model} (The "model" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.). This is the underlying object with id, value and extensions. The accessor "getModel" gives direct access to the value + */ + public StringType getModelElement() { + if (this.model == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.model"); + else if (Configuration.doAutoCreate()) + this.model = new StringType(); // bb + return this.model; + } + + public boolean hasModelElement() { + return this.model != null && !this.model.isEmpty(); + } + + public boolean hasModel() { + return this.model != null && !this.model.isEmpty(); + } + + /** + * @param value {@link #model} (The "model" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.). This is the underlying object with id, value and extensions. The accessor "getModel" gives direct access to the value + */ + public Device setModelElement(StringType value) { + this.model = value; + return this; + } + + /** + * @return The "model" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type. + */ + public String getModel() { + return this.model == null ? null : this.model.getValue(); + } + + /** + * @param value The "model" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type. + */ + public Device setModel(String value) { + if (Utilities.noString(value)) + this.model = null; + else { + if (this.model == null) + this.model = new StringType(); + this.model.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public Device setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware. + */ + public Device setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #manufactureDate} (The Date and time when the device was manufactured.). This is the underlying object with id, value and extensions. The accessor "getManufactureDate" gives direct access to the value + */ + public DateTimeType getManufactureDateElement() { + if (this.manufactureDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.manufactureDate"); + else if (Configuration.doAutoCreate()) + this.manufactureDate = new DateTimeType(); // bb + return this.manufactureDate; + } + + public boolean hasManufactureDateElement() { + return this.manufactureDate != null && !this.manufactureDate.isEmpty(); + } + + public boolean hasManufactureDate() { + return this.manufactureDate != null && !this.manufactureDate.isEmpty(); + } + + /** + * @param value {@link #manufactureDate} (The Date and time when the device was manufactured.). This is the underlying object with id, value and extensions. The accessor "getManufactureDate" gives direct access to the value + */ + public Device setManufactureDateElement(DateTimeType value) { + this.manufactureDate = value; + return this; + } + + /** + * @return The Date and time when the device was manufactured. + */ + public Date getManufactureDate() { + return this.manufactureDate == null ? null : this.manufactureDate.getValue(); + } + + /** + * @param value The Date and time when the device was manufactured. + */ + public Device setManufactureDate(Date value) { + if (value == null) + this.manufactureDate = null; + else { + if (this.manufactureDate == null) + this.manufactureDate = new DateTimeType(); + this.manufactureDate.setValue(value); + } + return this; + } + + /** + * @return {@link #expiry} (The date and time beyond which this device is no longer valid or should not be used (if applicable).). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value + */ + public DateTimeType getExpiryElement() { + if (this.expiry == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.expiry"); + else if (Configuration.doAutoCreate()) + this.expiry = new DateTimeType(); // bb + return this.expiry; + } + + public boolean hasExpiryElement() { + return this.expiry != null && !this.expiry.isEmpty(); + } + + public boolean hasExpiry() { + return this.expiry != null && !this.expiry.isEmpty(); + } + + /** + * @param value {@link #expiry} (The date and time beyond which this device is no longer valid or should not be used (if applicable).). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value + */ + public Device setExpiryElement(DateTimeType value) { + this.expiry = value; + return this; + } + + /** + * @return The date and time beyond which this device is no longer valid or should not be used (if applicable). + */ + public Date getExpiry() { + return this.expiry == null ? null : this.expiry.getValue(); + } + + /** + * @param value The date and time beyond which this device is no longer valid or should not be used (if applicable). + */ + public Device setExpiry(Date value) { + if (value == null) + this.expiry = null; + else { + if (this.expiry == null) + this.expiry = new DateTimeType(); + this.expiry.setValue(value); + } + return this; + } + + /** + * @return {@link #udi} (United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm.). This is the underlying object with id, value and extensions. The accessor "getUdi" gives direct access to the value + */ + public StringType getUdiElement() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new StringType(); // bb + return this.udi; + } + + public boolean hasUdiElement() { + return this.udi != null && !this.udi.isEmpty(); + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm.). This is the underlying object with id, value and extensions. The accessor "getUdi" gives direct access to the value + */ + public Device setUdiElement(StringType value) { + this.udi = value; + return this; + } + + /** + * @return United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm. + */ + public String getUdi() { + return this.udi == null ? null : this.udi.getValue(); + } + + /** + * @param value United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm. + */ + public Device setUdi(String value) { + if (Utilities.noString(value)) + this.udi = null; + else { + if (this.udi == null) + this.udi = new StringType(); + this.udi.setValue(value); + } + return this; + } + + /** + * @return {@link #lotNumber} (Lot number assigned by the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value + */ + public StringType getLotNumberElement() { + if (this.lotNumber == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.lotNumber"); + else if (Configuration.doAutoCreate()) + this.lotNumber = new StringType(); // bb + return this.lotNumber; + } + + public boolean hasLotNumberElement() { + return this.lotNumber != null && !this.lotNumber.isEmpty(); + } + + public boolean hasLotNumber() { + return this.lotNumber != null && !this.lotNumber.isEmpty(); + } + + /** + * @param value {@link #lotNumber} (Lot number assigned by the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value + */ + public Device setLotNumberElement(StringType value) { + this.lotNumber = value; + return this; + } + + /** + * @return Lot number assigned by the manufacturer. + */ + public String getLotNumber() { + return this.lotNumber == null ? null : this.lotNumber.getValue(); + } + + /** + * @param value Lot number assigned by the manufacturer. + */ + public Device setLotNumber(String value) { + if (Utilities.noString(value)) + this.lotNumber = null; + else { + if (this.lotNumber == null) + this.lotNumber = new StringType(); + this.lotNumber.setValue(value); + } + return this; + } + + /** + * @return {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.) + */ + public Reference getOwner() { + if (this.owner == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.owner"); + else if (Configuration.doAutoCreate()) + this.owner = new Reference(); // cc + return this.owner; + } + + public boolean hasOwner() { + return this.owner != null && !this.owner.isEmpty(); + } + + /** + * @param value {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.) + */ + public Device setOwner(Reference value) { + this.owner = value; + return this; + } + + /** + * @return {@link #owner} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An organization that is responsible for the provision and ongoing maintenance of the device.) + */ + public Organization getOwnerTarget() { + if (this.ownerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.owner"); + else if (Configuration.doAutoCreate()) + this.ownerTarget = new Organization(); // aa + return this.ownerTarget; + } + + /** + * @param value {@link #owner} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An organization that is responsible for the provision and ongoing maintenance of the device.) + */ + public Device setOwnerTarget(Organization value) { + this.ownerTarget = value; + return this; + } + + /** + * @return {@link #location} (The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); // cc + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location.) + */ + public Device setLocation(Reference value) { + this.location = value; + return this; + } + + /** + * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); // aa + return this.locationTarget; + } + + /** + * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location.) + */ + public Device setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #patient} (Patient information, if the resource is affixed to a person.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Patient information, if the resource is affixed to a person.) + */ + public Device setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Patient information, if the resource is affixed to a person.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Patient information, if the resource is affixed to a person.) + */ + public Device setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #contact} (Contact details for an organization or a particular human that is responsible for the device.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (ContactPoint item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contact details for an organization or a particular human that is responsible for the device.) + */ + // syntactic sugar + public ContactPoint addContact() { //3 + ContactPoint t = new ContactPoint(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public Device addContact(ContactPoint t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #url} (A network address on which the device may be contacted directly.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (A network address on which the device may be contacted directly.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public Device setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return A network address on which the device may be contacted directly. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value A network address on which the device may be contacted directly. + */ + public Device setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Unique instance identifiers assigned to a device by organizations like manufacturers or owners . If the identifier identifies the type of device, Device.type should be used.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("type", "CodeableConcept", "Code or identifier to identify a kind of device.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("status", "code", "Status of the Device availability.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("manufacturer", "string", "A name of the manufacturer.", 0, java.lang.Integer.MAX_VALUE, manufacturer)); + childrenList.add(new Property("model", "string", "The 'model' - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.", 0, java.lang.Integer.MAX_VALUE, model)); + childrenList.add(new Property("version", "string", "The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("manufactureDate", "dateTime", "The Date and time when the device was manufactured.", 0, java.lang.Integer.MAX_VALUE, manufactureDate)); + childrenList.add(new Property("expiry", "dateTime", "The date and time beyond which this device is no longer valid or should not be used (if applicable).", 0, java.lang.Integer.MAX_VALUE, expiry)); + childrenList.add(new Property("udi", "string", "United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("lotNumber", "string", "Lot number assigned by the manufacturer.", 0, java.lang.Integer.MAX_VALUE, lotNumber)); + childrenList.add(new Property("owner", "Reference(Organization)", "An organization that is responsible for the provision and ongoing maintenance of the device.", 0, java.lang.Integer.MAX_VALUE, owner)); + childrenList.add(new Property("location", "Reference(Location)", "The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. 'in/with the patient'), or a coded location.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("patient", "Reference(Patient)", "Patient information, if the resource is affixed to a person.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("contact", "ContactPoint", "Contact details for an organization or a particular human that is responsible for the device.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("url", "uri", "A network address on which the device may be contacted directly.", 0, java.lang.Integer.MAX_VALUE, url)); + } + + public Device copy() { + Device dst = new Device(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + dst.status = status == null ? null : status.copy(); + dst.manufacturer = manufacturer == null ? null : manufacturer.copy(); + dst.model = model == null ? null : model.copy(); + dst.version = version == null ? null : version.copy(); + dst.manufactureDate = manufactureDate == null ? null : manufactureDate.copy(); + dst.expiry = expiry == null ? null : expiry.copy(); + dst.udi = udi == null ? null : udi.copy(); + dst.lotNumber = lotNumber == null ? null : lotNumber.copy(); + dst.owner = owner == null ? null : owner.copy(); + dst.location = location == null ? null : location.copy(); + dst.patient = patient == null ? null : patient.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (ContactPoint i : contact) + dst.contact.add(i.copy()); + }; + dst.url = url == null ? null : url.copy(); + return dst; + } + + protected Device typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Device)) + return false; + Device o = (Device) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(status, o.status, true) + && compareDeep(manufacturer, o.manufacturer, true) && compareDeep(model, o.model, true) && compareDeep(version, o.version, true) + && compareDeep(manufactureDate, o.manufactureDate, true) && compareDeep(expiry, o.expiry, true) + && compareDeep(udi, o.udi, true) && compareDeep(lotNumber, o.lotNumber, true) && compareDeep(owner, o.owner, true) + && compareDeep(location, o.location, true) && compareDeep(patient, o.patient, true) && compareDeep(contact, o.contact, true) + && compareDeep(url, o.url, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Device)) + return false; + Device o = (Device) other; + return compareValues(status, o.status, true) && compareValues(manufacturer, o.manufacturer, true) && compareValues(model, o.model, true) + && compareValues(version, o.version, true) && compareValues(manufactureDate, o.manufactureDate, true) + && compareValues(expiry, o.expiry, true) && compareValues(udi, o.udi, true) && compareValues(lotNumber, o.lotNumber, true) + && compareValues(url, o.url, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) + && (status == null || status.isEmpty()) && (manufacturer == null || manufacturer.isEmpty()) + && (model == null || model.isEmpty()) && (version == null || version.isEmpty()) && (manufactureDate == null || manufactureDate.isEmpty()) + && (expiry == null || expiry.isEmpty()) && (udi == null || udi.isEmpty()) && (lotNumber == null || lotNumber.isEmpty()) + && (owner == null || owner.isEmpty()) && (location == null || location.isEmpty()) && (patient == null || patient.isEmpty()) + && (contact == null || contact.isEmpty()) && (url == null || url.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Device; + } + + @SearchParamDefinition(name="identifier", path="Device.identifier", description="Instance id from manufacturer, owner, and others", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="patient", path="Device.patient", description="Patient information, if the resource is affixed to a person", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="organization", path="Device.owner", description="The organization responsible for the device", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + @SearchParamDefinition(name="model", path="Device.model", description="The model of the device", type="string" ) + public static final String SP_MODEL = "model"; + @SearchParamDefinition(name="location", path="Device.location", description="A location, where the resource is found", type="reference" ) + public static final String SP_LOCATION = "location"; + @SearchParamDefinition(name="udi", path="Device.udi", description="FDA Mandated Unique Device Identifier", type="string" ) + public static final String SP_UDI = "udi"; + @SearchParamDefinition(name="type", path="Device.type", description="The type of the device", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="manufacturer", path="Device.manufacturer", description="The manufacturer of the device", type="string" ) + public static final String SP_MANUFACTURER = "manufacturer"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DeviceComponent.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DeviceComponent.java index 574dfdf47be..79b8529547a 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DeviceComponent.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DeviceComponent.java @@ -1,987 +1,966 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Describes the characteristics, operational status and capabilities of a medical-related component of a medical device. - */ -@ResourceDef(name="DeviceComponent", profile="http://hl7.org/fhir/Profile/DeviceComponent") -public class DeviceComponent extends DomainResource { - - public enum MeasurementPrinciple { - /** - * Measurement principle isn't in the list. - */ - OTHER, - /** - * Measurement is done using chemical. - */ - CHEMICAL, - /** - * Measurement is done using electrical. - */ - ELECTRICAL, - /** - * Measurement is done using impedance. - */ - IMPEDANCE, - /** - * Measurement is done using nuclear. - */ - NUCLEAR, - /** - * Measurement is done using optical. - */ - OPTICAL, - /** - * Measurement is done using thermal. - */ - THERMAL, - /** - * Measurement is done using biological. - */ - BIOLOGICAL, - /** - * Measurement is done using mechanical. - */ - MECHANICAL, - /** - * Measurement is done using acoustical. - */ - ACOUSTICAL, - /** - * Measurement is done using manual. - */ - MANUAL, - /** - * added to help the parsers - */ - NULL; - public static MeasurementPrinciple fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("other".equals(codeString)) - return OTHER; - if ("chemical".equals(codeString)) - return CHEMICAL; - if ("electrical".equals(codeString)) - return ELECTRICAL; - if ("impedance".equals(codeString)) - return IMPEDANCE; - if ("nuclear".equals(codeString)) - return NUCLEAR; - if ("optical".equals(codeString)) - return OPTICAL; - if ("thermal".equals(codeString)) - return THERMAL; - if ("biological".equals(codeString)) - return BIOLOGICAL; - if ("mechanical".equals(codeString)) - return MECHANICAL; - if ("acoustical".equals(codeString)) - return ACOUSTICAL; - if ("manual".equals(codeString)) - return MANUAL; - throw new Exception("Unknown MeasurementPrinciple code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case OTHER: return "other"; - case CHEMICAL: return "chemical"; - case ELECTRICAL: return "electrical"; - case IMPEDANCE: return "impedance"; - case NUCLEAR: return "nuclear"; - case OPTICAL: return "optical"; - case THERMAL: return "thermal"; - case BIOLOGICAL: return "biological"; - case MECHANICAL: return "mechanical"; - case ACOUSTICAL: return "acoustical"; - case MANUAL: return "manual"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case OTHER: return ""; - case CHEMICAL: return ""; - case ELECTRICAL: return ""; - case IMPEDANCE: return ""; - case NUCLEAR: return ""; - case OPTICAL: return ""; - case THERMAL: return ""; - case BIOLOGICAL: return ""; - case MECHANICAL: return ""; - case ACOUSTICAL: return ""; - case MANUAL: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case OTHER: return "Measurement principle isn't in the list."; - case CHEMICAL: return "Measurement is done using chemical."; - case ELECTRICAL: return "Measurement is done using electrical."; - case IMPEDANCE: return "Measurement is done using impedance."; - case NUCLEAR: return "Measurement is done using nuclear."; - case OPTICAL: return "Measurement is done using optical."; - case THERMAL: return "Measurement is done using thermal."; - case BIOLOGICAL: return "Measurement is done using biological."; - case MECHANICAL: return "Measurement is done using mechanical."; - case ACOUSTICAL: return "Measurement is done using acoustical."; - case MANUAL: return "Measurement is done using manual."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case OTHER: return "msp-other"; - case CHEMICAL: return "msp-chemical"; - case ELECTRICAL: return "msp-electrical"; - case IMPEDANCE: return "msp-impedance"; - case NUCLEAR: return "msp-nuclear"; - case OPTICAL: return "msp-optical"; - case THERMAL: return "msp-thermal"; - case BIOLOGICAL: return "msp-biological"; - case MECHANICAL: return "msp-mechanical"; - case ACOUSTICAL: return "msp-acoustical"; - case MANUAL: return "msp-manual"; - default: return "?"; - } - } - } - - public static class MeasurementPrincipleEnumFactory implements EnumFactory { - public MeasurementPrinciple fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("other".equals(codeString)) - return MeasurementPrinciple.OTHER; - if ("chemical".equals(codeString)) - return MeasurementPrinciple.CHEMICAL; - if ("electrical".equals(codeString)) - return MeasurementPrinciple.ELECTRICAL; - if ("impedance".equals(codeString)) - return MeasurementPrinciple.IMPEDANCE; - if ("nuclear".equals(codeString)) - return MeasurementPrinciple.NUCLEAR; - if ("optical".equals(codeString)) - return MeasurementPrinciple.OPTICAL; - if ("thermal".equals(codeString)) - return MeasurementPrinciple.THERMAL; - if ("biological".equals(codeString)) - return MeasurementPrinciple.BIOLOGICAL; - if ("mechanical".equals(codeString)) - return MeasurementPrinciple.MECHANICAL; - if ("acoustical".equals(codeString)) - return MeasurementPrinciple.ACOUSTICAL; - if ("manual".equals(codeString)) - return MeasurementPrinciple.MANUAL; - throw new IllegalArgumentException("Unknown MeasurementPrinciple code '"+codeString+"'"); - } - public String toCode(MeasurementPrinciple code) { - if (code == MeasurementPrinciple.OTHER) - return "other"; - if (code == MeasurementPrinciple.CHEMICAL) - return "chemical"; - if (code == MeasurementPrinciple.ELECTRICAL) - return "electrical"; - if (code == MeasurementPrinciple.IMPEDANCE) - return "impedance"; - if (code == MeasurementPrinciple.NUCLEAR) - return "nuclear"; - if (code == MeasurementPrinciple.OPTICAL) - return "optical"; - if (code == MeasurementPrinciple.THERMAL) - return "thermal"; - if (code == MeasurementPrinciple.BIOLOGICAL) - return "biological"; - if (code == MeasurementPrinciple.MECHANICAL) - return "mechanical"; - if (code == MeasurementPrinciple.ACOUSTICAL) - return "acoustical"; - if (code == MeasurementPrinciple.MANUAL) - return "manual"; - return "?"; - } - } - - @Block() - public static class DeviceComponentProductionSpecificationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc. - */ - @Child(name = "specType", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Specification type", formalDefinition="Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc." ) - protected CodeableConcept specType; - - /** - * Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of. - */ - @Child(name = "componentId", type = {Identifier.class}, order=2, min=0, max=1) - @Description(shortDefinition="Internal component unique identification", formalDefinition="Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of." ) - protected Identifier componentId; - - /** - * Describes the printable string defining the component. - */ - @Child(name = "productionSpec", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="A printable string defining the component", formalDefinition="Describes the printable string defining the component." ) - protected StringType productionSpec; - - private static final long serialVersionUID = -1476597516L; - - /* - * Constructor - */ - public DeviceComponentProductionSpecificationComponent() { - super(); - } - - /** - * @return {@link #specType} (Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.) - */ - public CodeableConcept getSpecType() { - if (this.specType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.specType"); - else if (Configuration.doAutoCreate()) - this.specType = new CodeableConcept(); // cc - return this.specType; - } - - public boolean hasSpecType() { - return this.specType != null && !this.specType.isEmpty(); - } - - /** - * @param value {@link #specType} (Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.) - */ - public DeviceComponentProductionSpecificationComponent setSpecType(CodeableConcept value) { - this.specType = value; - return this; - } - - /** - * @return {@link #componentId} (Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of.) - */ - public Identifier getComponentId() { - if (this.componentId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.componentId"); - else if (Configuration.doAutoCreate()) - this.componentId = new Identifier(); // cc - return this.componentId; - } - - public boolean hasComponentId() { - return this.componentId != null && !this.componentId.isEmpty(); - } - - /** - * @param value {@link #componentId} (Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of.) - */ - public DeviceComponentProductionSpecificationComponent setComponentId(Identifier value) { - this.componentId = value; - return this; - } - - /** - * @return {@link #productionSpec} (Describes the printable string defining the component.). This is the underlying object with id, value and extensions. The accessor "getProductionSpec" gives direct access to the value - */ - public StringType getProductionSpecElement() { - if (this.productionSpec == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.productionSpec"); - else if (Configuration.doAutoCreate()) - this.productionSpec = new StringType(); // bb - return this.productionSpec; - } - - public boolean hasProductionSpecElement() { - return this.productionSpec != null && !this.productionSpec.isEmpty(); - } - - public boolean hasProductionSpec() { - return this.productionSpec != null && !this.productionSpec.isEmpty(); - } - - /** - * @param value {@link #productionSpec} (Describes the printable string defining the component.). This is the underlying object with id, value and extensions. The accessor "getProductionSpec" gives direct access to the value - */ - public DeviceComponentProductionSpecificationComponent setProductionSpecElement(StringType value) { - this.productionSpec = value; - return this; - } - - /** - * @return Describes the printable string defining the component. - */ - public String getProductionSpec() { - return this.productionSpec == null ? null : this.productionSpec.getValue(); - } - - /** - * @param value Describes the printable string defining the component. - */ - public DeviceComponentProductionSpecificationComponent setProductionSpec(String value) { - if (Utilities.noString(value)) - this.productionSpec = null; - else { - if (this.productionSpec == null) - this.productionSpec = new StringType(); - this.productionSpec.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("specType", "CodeableConcept", "Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.", 0, java.lang.Integer.MAX_VALUE, specType)); - childrenList.add(new Property("componentId", "Identifier", "Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of.", 0, java.lang.Integer.MAX_VALUE, componentId)); - childrenList.add(new Property("productionSpec", "string", "Describes the printable string defining the component.", 0, java.lang.Integer.MAX_VALUE, productionSpec)); - } - - public DeviceComponentProductionSpecificationComponent copy() { - DeviceComponentProductionSpecificationComponent dst = new DeviceComponentProductionSpecificationComponent(); - copyValues(dst); - dst.specType = specType == null ? null : specType.copy(); - dst.componentId = componentId == null ? null : componentId.copy(); - dst.productionSpec = productionSpec == null ? null : productionSpec.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DeviceComponentProductionSpecificationComponent)) - return false; - DeviceComponentProductionSpecificationComponent o = (DeviceComponentProductionSpecificationComponent) other; - return compareDeep(specType, o.specType, true) && compareDeep(componentId, o.componentId, true) - && compareDeep(productionSpec, o.productionSpec, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DeviceComponentProductionSpecificationComponent)) - return false; - DeviceComponentProductionSpecificationComponent o = (DeviceComponentProductionSpecificationComponent) other; - return compareValues(productionSpec, o.productionSpec, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (specType == null || specType.isEmpty()) && (componentId == null || componentId.isEmpty()) - && (productionSpec == null || productionSpec.isEmpty()); - } - - } - - /** - * Describes the specific component type as defined in the object-oriented or metric nomenclature partition. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=0, min=1, max=1) - @Description(shortDefinition="What kind of component it is", formalDefinition="Describes the specific component type as defined in the object-oriented or metric nomenclature partition." ) - protected CodeableConcept type; - - /** - * Describes the local assigned unique identification by the software. For example: handle ID. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1) - @Description(shortDefinition="Instance id assigned by the software stack", formalDefinition="Describes the local assigned unique identification by the software. For example: handle ID." ) - protected Identifier identifier; - - /** - * Describes the timestamp for the most recent system change which includes device configuration or setting change. - */ - @Child(name = "lastSystemChange", type = {InstantType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Recent system change timestamp", formalDefinition="Describes the timestamp for the most recent system change which includes device configuration or setting change." ) - protected InstantType lastSystemChange; - - /** - * Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc. - */ - @Child(name = "source", type = {Device.class}, order=3, min=0, max=1) - @Description(shortDefinition="A source device of this component", formalDefinition="Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc." ) - protected Reference source; - - /** - * The actual object that is the target of the reference (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) - */ - protected Device sourceTarget; - - /** - * Describes the link to the parent resource. For example: Channel is linked to its VMD parent. - */ - @Child(name = "parent", type = {DeviceComponent.class}, order=4, min=0, max=1) - @Description(shortDefinition="Parent resource link", formalDefinition="Describes the link to the parent resource. For example: Channel is linked to its VMD parent." ) - protected Reference parent; - - /** - * The actual object that is the target of the reference (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) - */ - protected DeviceComponent parentTarget; - - /** - * Indicates current operational status of the device. For example: On, Off, Standby, etc. - */ - @Child(name = "operationalStatus", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Component operational status", formalDefinition="Indicates current operational status of the device. For example: On, Off, Standby, etc." ) - protected List operationalStatus; - - /** - * Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular. - */ - @Child(name = "parameterGroup", type = {CodeableConcept.class}, order=6, min=0, max=1) - @Description(shortDefinition="Current supported parameter group", formalDefinition="Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular." ) - protected CodeableConcept parameterGroup; - - /** - * Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. - */ - @Child(name = "measurementPrinciple", type = {CodeType.class}, order=7, min=0, max=1) - @Description(shortDefinition="other | chemical | electrical | impedance | nuclear | optical | thermal | biological | mechanical | acoustical | manual+", formalDefinition="Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc." ) - protected Enumeration measurementPrinciple; - - /** - * Describes the production specification such as component revision, serial number, etc. - */ - @Child(name = "productionSpecification", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Production specification of the component", formalDefinition="Describes the production specification such as component revision, serial number, etc." ) - protected List productionSpecification; - - /** - * Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US. - */ - @Child(name = "languageCode", type = {CodeableConcept.class}, order=9, min=0, max=1) - @Description(shortDefinition="Language code for the human-readable text strings produced by the device", formalDefinition="Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US." ) - protected CodeableConcept languageCode; - - private static final long serialVersionUID = 1179239259L; - - /* - * Constructor - */ - public DeviceComponent() { - super(); - } - - /* - * Constructor - */ - public DeviceComponent(CodeableConcept type, Identifier identifier, InstantType lastSystemChange) { - super(); - this.type = type; - this.identifier = identifier; - this.lastSystemChange = lastSystemChange; - } - - /** - * @return {@link #type} (Describes the specific component type as defined in the object-oriented or metric nomenclature partition.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Describes the specific component type as defined in the object-oriented or metric nomenclature partition.) - */ - public DeviceComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #identifier} (Describes the local assigned unique identification by the software. For example: handle ID.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Describes the local assigned unique identification by the software. For example: handle ID.) - */ - public DeviceComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #lastSystemChange} (Describes the timestamp for the most recent system change which includes device configuration or setting change.). This is the underlying object with id, value and extensions. The accessor "getLastSystemChange" gives direct access to the value - */ - public InstantType getLastSystemChangeElement() { - if (this.lastSystemChange == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.lastSystemChange"); - else if (Configuration.doAutoCreate()) - this.lastSystemChange = new InstantType(); // bb - return this.lastSystemChange; - } - - public boolean hasLastSystemChangeElement() { - return this.lastSystemChange != null && !this.lastSystemChange.isEmpty(); - } - - public boolean hasLastSystemChange() { - return this.lastSystemChange != null && !this.lastSystemChange.isEmpty(); - } - - /** - * @param value {@link #lastSystemChange} (Describes the timestamp for the most recent system change which includes device configuration or setting change.). This is the underlying object with id, value and extensions. The accessor "getLastSystemChange" gives direct access to the value - */ - public DeviceComponent setLastSystemChangeElement(InstantType value) { - this.lastSystemChange = value; - return this; - } - - /** - * @return Describes the timestamp for the most recent system change which includes device configuration or setting change. - */ - public Date getLastSystemChange() { - return this.lastSystemChange == null ? null : this.lastSystemChange.getValue(); - } - - /** - * @param value Describes the timestamp for the most recent system change which includes device configuration or setting change. - */ - public DeviceComponent setLastSystemChange(Date value) { - if (this.lastSystemChange == null) - this.lastSystemChange = new InstantType(); - this.lastSystemChange.setValue(value); - return this; - } - - /** - * @return {@link #source} (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) - */ - public Reference getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.source"); - else if (Configuration.doAutoCreate()) - this.source = new Reference(); // cc - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) - */ - public DeviceComponent setSource(Reference value) { - this.source = value; - return this; - } - - /** - * @return {@link #source} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) - */ - public Device getSourceTarget() { - if (this.sourceTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.source"); - else if (Configuration.doAutoCreate()) - this.sourceTarget = new Device(); // aa - return this.sourceTarget; - } - - /** - * @param value {@link #source} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) - */ - public DeviceComponent setSourceTarget(Device value) { - this.sourceTarget = value; - return this; - } - - /** - * @return {@link #parent} (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) - */ - public Reference getParent() { - if (this.parent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.parent"); - else if (Configuration.doAutoCreate()) - this.parent = new Reference(); // cc - return this.parent; - } - - public boolean hasParent() { - return this.parent != null && !this.parent.isEmpty(); - } - - /** - * @param value {@link #parent} (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) - */ - public DeviceComponent setParent(Reference value) { - this.parent = value; - return this; - } - - /** - * @return {@link #parent} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) - */ - public DeviceComponent getParentTarget() { - if (this.parentTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.parent"); - else if (Configuration.doAutoCreate()) - this.parentTarget = new DeviceComponent(); // aa - return this.parentTarget; - } - - /** - * @param value {@link #parent} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) - */ - public DeviceComponent setParentTarget(DeviceComponent value) { - this.parentTarget = value; - return this; - } - - /** - * @return {@link #operationalStatus} (Indicates current operational status of the device. For example: On, Off, Standby, etc.) - */ - public List getOperationalStatus() { - if (this.operationalStatus == null) - this.operationalStatus = new ArrayList(); - return this.operationalStatus; - } - - public boolean hasOperationalStatus() { - if (this.operationalStatus == null) - return false; - for (CodeableConcept item : this.operationalStatus) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #operationalStatus} (Indicates current operational status of the device. For example: On, Off, Standby, etc.) - */ - // syntactic sugar - public CodeableConcept addOperationalStatus() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.operationalStatus == null) - this.operationalStatus = new ArrayList(); - this.operationalStatus.add(t); - return t; - } - - // syntactic sugar - public DeviceComponent addOperationalStatus(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.operationalStatus == null) - this.operationalStatus = new ArrayList(); - this.operationalStatus.add(t); - return this; - } - - /** - * @return {@link #parameterGroup} (Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular.) - */ - public CodeableConcept getParameterGroup() { - if (this.parameterGroup == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.parameterGroup"); - else if (Configuration.doAutoCreate()) - this.parameterGroup = new CodeableConcept(); // cc - return this.parameterGroup; - } - - public boolean hasParameterGroup() { - return this.parameterGroup != null && !this.parameterGroup.isEmpty(); - } - - /** - * @param value {@link #parameterGroup} (Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular.) - */ - public DeviceComponent setParameterGroup(CodeableConcept value) { - this.parameterGroup = value; - return this; - } - - /** - * @return {@link #measurementPrinciple} (Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.). This is the underlying object with id, value and extensions. The accessor "getMeasurementPrinciple" gives direct access to the value - */ - public Enumeration getMeasurementPrincipleElement() { - if (this.measurementPrinciple == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.measurementPrinciple"); - else if (Configuration.doAutoCreate()) - this.measurementPrinciple = new Enumeration(new MeasurementPrincipleEnumFactory()); // bb - return this.measurementPrinciple; - } - - public boolean hasMeasurementPrincipleElement() { - return this.measurementPrinciple != null && !this.measurementPrinciple.isEmpty(); - } - - public boolean hasMeasurementPrinciple() { - return this.measurementPrinciple != null && !this.measurementPrinciple.isEmpty(); - } - - /** - * @param value {@link #measurementPrinciple} (Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.). This is the underlying object with id, value and extensions. The accessor "getMeasurementPrinciple" gives direct access to the value - */ - public DeviceComponent setMeasurementPrincipleElement(Enumeration value) { - this.measurementPrinciple = value; - return this; - } - - /** - * @return Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. - */ - public MeasurementPrinciple getMeasurementPrinciple() { - return this.measurementPrinciple == null ? null : this.measurementPrinciple.getValue(); - } - - /** - * @param value Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. - */ - public DeviceComponent setMeasurementPrinciple(MeasurementPrinciple value) { - if (value == null) - this.measurementPrinciple = null; - else { - if (this.measurementPrinciple == null) - this.measurementPrinciple = new Enumeration(new MeasurementPrincipleEnumFactory()); - this.measurementPrinciple.setValue(value); - } - return this; - } - - /** - * @return {@link #productionSpecification} (Describes the production specification such as component revision, serial number, etc.) - */ - public List getProductionSpecification() { - if (this.productionSpecification == null) - this.productionSpecification = new ArrayList(); - return this.productionSpecification; - } - - public boolean hasProductionSpecification() { - if (this.productionSpecification == null) - return false; - for (DeviceComponentProductionSpecificationComponent item : this.productionSpecification) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #productionSpecification} (Describes the production specification such as component revision, serial number, etc.) - */ - // syntactic sugar - public DeviceComponentProductionSpecificationComponent addProductionSpecification() { //3 - DeviceComponentProductionSpecificationComponent t = new DeviceComponentProductionSpecificationComponent(); - if (this.productionSpecification == null) - this.productionSpecification = new ArrayList(); - this.productionSpecification.add(t); - return t; - } - - // syntactic sugar - public DeviceComponent addProductionSpecification(DeviceComponentProductionSpecificationComponent t) { //3 - if (t == null) - return this; - if (this.productionSpecification == null) - this.productionSpecification = new ArrayList(); - this.productionSpecification.add(t); - return this; - } - - /** - * @return {@link #languageCode} (Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.) - */ - public CodeableConcept getLanguageCode() { - if (this.languageCode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.languageCode"); - else if (Configuration.doAutoCreate()) - this.languageCode = new CodeableConcept(); // cc - return this.languageCode; - } - - public boolean hasLanguageCode() { - return this.languageCode != null && !this.languageCode.isEmpty(); - } - - /** - * @param value {@link #languageCode} (Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.) - */ - public DeviceComponent setLanguageCode(CodeableConcept value) { - this.languageCode = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "Describes the specific component type as defined in the object-oriented or metric nomenclature partition.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("identifier", "Identifier", "Describes the local assigned unique identification by the software. For example: handle ID.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("lastSystemChange", "instant", "Describes the timestamp for the most recent system change which includes device configuration or setting change.", 0, java.lang.Integer.MAX_VALUE, lastSystemChange)); - childrenList.add(new Property("source", "Reference(Device)", "Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("parent", "Reference(DeviceComponent)", "Describes the link to the parent resource. For example: Channel is linked to its VMD parent.", 0, java.lang.Integer.MAX_VALUE, parent)); - childrenList.add(new Property("operationalStatus", "CodeableConcept", "Indicates current operational status of the device. For example: On, Off, Standby, etc.", 0, java.lang.Integer.MAX_VALUE, operationalStatus)); - childrenList.add(new Property("parameterGroup", "CodeableConcept", "Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular.", 0, java.lang.Integer.MAX_VALUE, parameterGroup)); - childrenList.add(new Property("measurementPrinciple", "code", "Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.", 0, java.lang.Integer.MAX_VALUE, measurementPrinciple)); - childrenList.add(new Property("productionSpecification", "", "Describes the production specification such as component revision, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, productionSpecification)); - childrenList.add(new Property("languageCode", "CodeableConcept", "Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.", 0, java.lang.Integer.MAX_VALUE, languageCode)); - } - - public DeviceComponent copy() { - DeviceComponent dst = new DeviceComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.lastSystemChange = lastSystemChange == null ? null : lastSystemChange.copy(); - dst.source = source == null ? null : source.copy(); - dst.parent = parent == null ? null : parent.copy(); - if (operationalStatus != null) { - dst.operationalStatus = new ArrayList(); - for (CodeableConcept i : operationalStatus) - dst.operationalStatus.add(i.copy()); - }; - dst.parameterGroup = parameterGroup == null ? null : parameterGroup.copy(); - dst.measurementPrinciple = measurementPrinciple == null ? null : measurementPrinciple.copy(); - if (productionSpecification != null) { - dst.productionSpecification = new ArrayList(); - for (DeviceComponentProductionSpecificationComponent i : productionSpecification) - dst.productionSpecification.add(i.copy()); - }; - dst.languageCode = languageCode == null ? null : languageCode.copy(); - return dst; - } - - protected DeviceComponent typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DeviceComponent)) - return false; - DeviceComponent o = (DeviceComponent) other; - return compareDeep(type, o.type, true) && compareDeep(identifier, o.identifier, true) && compareDeep(lastSystemChange, o.lastSystemChange, true) - && compareDeep(source, o.source, true) && compareDeep(parent, o.parent, true) && compareDeep(operationalStatus, o.operationalStatus, true) - && compareDeep(parameterGroup, o.parameterGroup, true) && compareDeep(measurementPrinciple, o.measurementPrinciple, true) - && compareDeep(productionSpecification, o.productionSpecification, true) && compareDeep(languageCode, o.languageCode, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DeviceComponent)) - return false; - DeviceComponent o = (DeviceComponent) other; - return compareValues(lastSystemChange, o.lastSystemChange, true) && compareValues(measurementPrinciple, o.measurementPrinciple, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (lastSystemChange == null || lastSystemChange.isEmpty()) && (source == null || source.isEmpty()) - && (parent == null || parent.isEmpty()) && (operationalStatus == null || operationalStatus.isEmpty()) - && (parameterGroup == null || parameterGroup.isEmpty()) && (measurementPrinciple == null || measurementPrinciple.isEmpty()) - && (productionSpecification == null || productionSpecification.isEmpty()) && (languageCode == null || languageCode.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DeviceComponent; - } - - @SearchParamDefinition(name="source", path="DeviceComponent.source", description="The device source", type="reference" ) - public static final String SP_SOURCE = "source"; - @SearchParamDefinition(name="parent", path="DeviceComponent.parent", description="The parent DeviceComponent resource", type="reference" ) - public static final String SP_PARENT = "parent"; - @SearchParamDefinition(name="type", path="DeviceComponent.type", description="The device component type", type="token" ) - public static final String SP_TYPE = "type"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Describes the characteristics, operational status and capabilities of a medical-related component of a medical device. + */ +@ResourceDef(name="DeviceComponent", profile="http://hl7.org/fhir/Profile/DeviceComponent") +public class DeviceComponent extends DomainResource { + + public enum MeasurementPrinciple { + /** + * Measurement principle isn't in the list. + */ + OTHER, + /** + * Measurement is done using chemical. + */ + CHEMICAL, + /** + * Measurement is done using electrical. + */ + ELECTRICAL, + /** + * Measurement is done using impedance. + */ + IMPEDANCE, + /** + * Measurement is done using nuclear. + */ + NUCLEAR, + /** + * Measurement is done using optical. + */ + OPTICAL, + /** + * Measurement is done using thermal. + */ + THERMAL, + /** + * Measurement is done using biological. + */ + BIOLOGICAL, + /** + * Measurement is done using mechanical. + */ + MECHANICAL, + /** + * Measurement is done using acoustical. + */ + ACOUSTICAL, + /** + * Measurement is done using manual. + */ + MANUAL, + /** + * added to help the parsers + */ + NULL; + public static MeasurementPrinciple fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("other".equals(codeString)) + return OTHER; + if ("chemical".equals(codeString)) + return CHEMICAL; + if ("electrical".equals(codeString)) + return ELECTRICAL; + if ("impedance".equals(codeString)) + return IMPEDANCE; + if ("nuclear".equals(codeString)) + return NUCLEAR; + if ("optical".equals(codeString)) + return OPTICAL; + if ("thermal".equals(codeString)) + return THERMAL; + if ("biological".equals(codeString)) + return BIOLOGICAL; + if ("mechanical".equals(codeString)) + return MECHANICAL; + if ("acoustical".equals(codeString)) + return ACOUSTICAL; + if ("manual".equals(codeString)) + return MANUAL; + throw new Exception("Unknown MeasurementPrinciple code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case OTHER: return "other"; + case CHEMICAL: return "chemical"; + case ELECTRICAL: return "electrical"; + case IMPEDANCE: return "impedance"; + case NUCLEAR: return "nuclear"; + case OPTICAL: return "optical"; + case THERMAL: return "thermal"; + case BIOLOGICAL: return "biological"; + case MECHANICAL: return "mechanical"; + case ACOUSTICAL: return "acoustical"; + case MANUAL: return "manual"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case OTHER: return ""; + case CHEMICAL: return ""; + case ELECTRICAL: return ""; + case IMPEDANCE: return ""; + case NUCLEAR: return ""; + case OPTICAL: return ""; + case THERMAL: return ""; + case BIOLOGICAL: return ""; + case MECHANICAL: return ""; + case ACOUSTICAL: return ""; + case MANUAL: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case OTHER: return "Measurement principle isn't in the list."; + case CHEMICAL: return "Measurement is done using chemical."; + case ELECTRICAL: return "Measurement is done using electrical."; + case IMPEDANCE: return "Measurement is done using impedance."; + case NUCLEAR: return "Measurement is done using nuclear."; + case OPTICAL: return "Measurement is done using optical."; + case THERMAL: return "Measurement is done using thermal."; + case BIOLOGICAL: return "Measurement is done using biological."; + case MECHANICAL: return "Measurement is done using mechanical."; + case ACOUSTICAL: return "Measurement is done using acoustical."; + case MANUAL: return "Measurement is done using manual."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case OTHER: return "msp-other"; + case CHEMICAL: return "msp-chemical"; + case ELECTRICAL: return "msp-electrical"; + case IMPEDANCE: return "msp-impedance"; + case NUCLEAR: return "msp-nuclear"; + case OPTICAL: return "msp-optical"; + case THERMAL: return "msp-thermal"; + case BIOLOGICAL: return "msp-biological"; + case MECHANICAL: return "msp-mechanical"; + case ACOUSTICAL: return "msp-acoustical"; + case MANUAL: return "msp-manual"; + default: return "?"; + } + } + } + + public static class MeasurementPrincipleEnumFactory implements EnumFactory { + public MeasurementPrinciple fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("other".equals(codeString)) + return MeasurementPrinciple.OTHER; + if ("chemical".equals(codeString)) + return MeasurementPrinciple.CHEMICAL; + if ("electrical".equals(codeString)) + return MeasurementPrinciple.ELECTRICAL; + if ("impedance".equals(codeString)) + return MeasurementPrinciple.IMPEDANCE; + if ("nuclear".equals(codeString)) + return MeasurementPrinciple.NUCLEAR; + if ("optical".equals(codeString)) + return MeasurementPrinciple.OPTICAL; + if ("thermal".equals(codeString)) + return MeasurementPrinciple.THERMAL; + if ("biological".equals(codeString)) + return MeasurementPrinciple.BIOLOGICAL; + if ("mechanical".equals(codeString)) + return MeasurementPrinciple.MECHANICAL; + if ("acoustical".equals(codeString)) + return MeasurementPrinciple.ACOUSTICAL; + if ("manual".equals(codeString)) + return MeasurementPrinciple.MANUAL; + throw new IllegalArgumentException("Unknown MeasurementPrinciple code '"+codeString+"'"); + } + public String toCode(MeasurementPrinciple code) { + if (code == MeasurementPrinciple.OTHER) + return "other"; + if (code == MeasurementPrinciple.CHEMICAL) + return "chemical"; + if (code == MeasurementPrinciple.ELECTRICAL) + return "electrical"; + if (code == MeasurementPrinciple.IMPEDANCE) + return "impedance"; + if (code == MeasurementPrinciple.NUCLEAR) + return "nuclear"; + if (code == MeasurementPrinciple.OPTICAL) + return "optical"; + if (code == MeasurementPrinciple.THERMAL) + return "thermal"; + if (code == MeasurementPrinciple.BIOLOGICAL) + return "biological"; + if (code == MeasurementPrinciple.MECHANICAL) + return "mechanical"; + if (code == MeasurementPrinciple.ACOUSTICAL) + return "acoustical"; + if (code == MeasurementPrinciple.MANUAL) + return "manual"; + return "?"; + } + } + + @Block() + public static class DeviceComponentProductionSpecificationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc. + */ + @Child(name = "specType", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Specification type", formalDefinition="Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc." ) + protected CodeableConcept specType; + + /** + * Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of. + */ + @Child(name = "componentId", type = {Identifier.class}, order=2, min=0, max=1) + @Description(shortDefinition="Internal component unique identification", formalDefinition="Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of." ) + protected Identifier componentId; + + /** + * Describes the printable string defining the component. + */ + @Child(name = "productionSpec", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="A printable string defining the component", formalDefinition="Describes the printable string defining the component." ) + protected StringType productionSpec; + + private static final long serialVersionUID = -1476597516L; + + /* + * Constructor + */ + public DeviceComponentProductionSpecificationComponent() { + super(); + } + + /** + * @return {@link #specType} (Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.) + */ + public CodeableConcept getSpecType() { + if (this.specType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.specType"); + else if (Configuration.doAutoCreate()) + this.specType = new CodeableConcept(); // cc + return this.specType; + } + + public boolean hasSpecType() { + return this.specType != null && !this.specType.isEmpty(); + } + + /** + * @param value {@link #specType} (Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.) + */ + public DeviceComponentProductionSpecificationComponent setSpecType(CodeableConcept value) { + this.specType = value; + return this; + } + + /** + * @return {@link #componentId} (Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of.) + */ + public Identifier getComponentId() { + if (this.componentId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.componentId"); + else if (Configuration.doAutoCreate()) + this.componentId = new Identifier(); // cc + return this.componentId; + } + + public boolean hasComponentId() { + return this.componentId != null && !this.componentId.isEmpty(); + } + + /** + * @param value {@link #componentId} (Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of.) + */ + public DeviceComponentProductionSpecificationComponent setComponentId(Identifier value) { + this.componentId = value; + return this; + } + + /** + * @return {@link #productionSpec} (Describes the printable string defining the component.). This is the underlying object with id, value and extensions. The accessor "getProductionSpec" gives direct access to the value + */ + public StringType getProductionSpecElement() { + if (this.productionSpec == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.productionSpec"); + else if (Configuration.doAutoCreate()) + this.productionSpec = new StringType(); // bb + return this.productionSpec; + } + + public boolean hasProductionSpecElement() { + return this.productionSpec != null && !this.productionSpec.isEmpty(); + } + + public boolean hasProductionSpec() { + return this.productionSpec != null && !this.productionSpec.isEmpty(); + } + + /** + * @param value {@link #productionSpec} (Describes the printable string defining the component.). This is the underlying object with id, value and extensions. The accessor "getProductionSpec" gives direct access to the value + */ + public DeviceComponentProductionSpecificationComponent setProductionSpecElement(StringType value) { + this.productionSpec = value; + return this; + } + + /** + * @return Describes the printable string defining the component. + */ + public String getProductionSpec() { + return this.productionSpec == null ? null : this.productionSpec.getValue(); + } + + /** + * @param value Describes the printable string defining the component. + */ + public DeviceComponentProductionSpecificationComponent setProductionSpec(String value) { + if (Utilities.noString(value)) + this.productionSpec = null; + else { + if (this.productionSpec == null) + this.productionSpec = new StringType(); + this.productionSpec.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("specType", "CodeableConcept", "Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.", 0, java.lang.Integer.MAX_VALUE, specType)); + childrenList.add(new Property("componentId", "Identifier", "Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of.", 0, java.lang.Integer.MAX_VALUE, componentId)); + childrenList.add(new Property("productionSpec", "string", "Describes the printable string defining the component.", 0, java.lang.Integer.MAX_VALUE, productionSpec)); + } + + public DeviceComponentProductionSpecificationComponent copy() { + DeviceComponentProductionSpecificationComponent dst = new DeviceComponentProductionSpecificationComponent(); + copyValues(dst); + dst.specType = specType == null ? null : specType.copy(); + dst.componentId = componentId == null ? null : componentId.copy(); + dst.productionSpec = productionSpec == null ? null : productionSpec.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DeviceComponentProductionSpecificationComponent)) + return false; + DeviceComponentProductionSpecificationComponent o = (DeviceComponentProductionSpecificationComponent) other; + return compareDeep(specType, o.specType, true) && compareDeep(componentId, o.componentId, true) + && compareDeep(productionSpec, o.productionSpec, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DeviceComponentProductionSpecificationComponent)) + return false; + DeviceComponentProductionSpecificationComponent o = (DeviceComponentProductionSpecificationComponent) other; + return compareValues(productionSpec, o.productionSpec, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (specType == null || specType.isEmpty()) && (componentId == null || componentId.isEmpty()) + && (productionSpec == null || productionSpec.isEmpty()); + } + + } + + /** + * Describes the specific component type as defined in the object-oriented or metric nomenclature partition. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=0, min=1, max=1) + @Description(shortDefinition="What kind of component it is", formalDefinition="Describes the specific component type as defined in the object-oriented or metric nomenclature partition." ) + protected CodeableConcept type; + + /** + * Describes the local assigned unique identification by the software. For example: handle ID. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1) + @Description(shortDefinition="Instance id assigned by the software stack", formalDefinition="Describes the local assigned unique identification by the software. For example: handle ID." ) + protected Identifier identifier; + + /** + * Describes the timestamp for the most recent system change which includes device configuration or setting change. + */ + @Child(name = "lastSystemChange", type = {InstantType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Recent system change timestamp", formalDefinition="Describes the timestamp for the most recent system change which includes device configuration or setting change." ) + protected InstantType lastSystemChange; + + /** + * Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc. + */ + @Child(name = "source", type = {Device.class}, order=3, min=0, max=1) + @Description(shortDefinition="A source device of this component", formalDefinition="Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc." ) + protected Reference source; + + /** + * The actual object that is the target of the reference (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) + */ + protected Device sourceTarget; + + /** + * Describes the link to the parent resource. For example: Channel is linked to its VMD parent. + */ + @Child(name = "parent", type = {DeviceComponent.class}, order=4, min=0, max=1) + @Description(shortDefinition="Parent resource link", formalDefinition="Describes the link to the parent resource. For example: Channel is linked to its VMD parent." ) + protected Reference parent; + + /** + * The actual object that is the target of the reference (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) + */ + protected DeviceComponent parentTarget; + + /** + * Indicates current operational status of the device. For example: On, Off, Standby, etc. + */ + @Child(name = "operationalStatus", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Component operational status", formalDefinition="Indicates current operational status of the device. For example: On, Off, Standby, etc." ) + protected List operationalStatus; + + /** + * Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular. + */ + @Child(name = "parameterGroup", type = {CodeableConcept.class}, order=6, min=0, max=1) + @Description(shortDefinition="Current supported parameter group", formalDefinition="Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular." ) + protected CodeableConcept parameterGroup; + + /** + * Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. + */ + @Child(name = "measurementPrinciple", type = {CodeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="other | chemical | electrical | impedance | nuclear | optical | thermal | biological | mechanical | acoustical | manual+", formalDefinition="Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc." ) + protected Enumeration measurementPrinciple; + + /** + * Describes the production specification such as component revision, serial number, etc. + */ + @Child(name = "productionSpecification", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Production specification of the component", formalDefinition="Describes the production specification such as component revision, serial number, etc." ) + protected List productionSpecification; + + /** + * Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US. + */ + @Child(name = "languageCode", type = {CodeableConcept.class}, order=9, min=0, max=1) + @Description(shortDefinition="Language code for the human-readable text strings produced by the device", formalDefinition="Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US." ) + protected CodeableConcept languageCode; + + private static final long serialVersionUID = 1179239259L; + + /* + * Constructor + */ + public DeviceComponent() { + super(); + } + + /* + * Constructor + */ + public DeviceComponent(CodeableConcept type, Identifier identifier, InstantType lastSystemChange) { + super(); + this.type = type; + this.identifier = identifier; + this.lastSystemChange = lastSystemChange; + } + + /** + * @return {@link #type} (Describes the specific component type as defined in the object-oriented or metric nomenclature partition.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Describes the specific component type as defined in the object-oriented or metric nomenclature partition.) + */ + public DeviceComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #identifier} (Describes the local assigned unique identification by the software. For example: handle ID.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Describes the local assigned unique identification by the software. For example: handle ID.) + */ + public DeviceComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #lastSystemChange} (Describes the timestamp for the most recent system change which includes device configuration or setting change.). This is the underlying object with id, value and extensions. The accessor "getLastSystemChange" gives direct access to the value + */ + public InstantType getLastSystemChangeElement() { + if (this.lastSystemChange == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.lastSystemChange"); + else if (Configuration.doAutoCreate()) + this.lastSystemChange = new InstantType(); // bb + return this.lastSystemChange; + } + + public boolean hasLastSystemChangeElement() { + return this.lastSystemChange != null && !this.lastSystemChange.isEmpty(); + } + + public boolean hasLastSystemChange() { + return this.lastSystemChange != null && !this.lastSystemChange.isEmpty(); + } + + /** + * @param value {@link #lastSystemChange} (Describes the timestamp for the most recent system change which includes device configuration or setting change.). This is the underlying object with id, value and extensions. The accessor "getLastSystemChange" gives direct access to the value + */ + public DeviceComponent setLastSystemChangeElement(InstantType value) { + this.lastSystemChange = value; + return this; + } + + /** + * @return Describes the timestamp for the most recent system change which includes device configuration or setting change. + */ + public Date getLastSystemChange() { + return this.lastSystemChange == null ? null : this.lastSystemChange.getValue(); + } + + /** + * @param value Describes the timestamp for the most recent system change which includes device configuration or setting change. + */ + public DeviceComponent setLastSystemChange(Date value) { + if (this.lastSystemChange == null) + this.lastSystemChange = new InstantType(); + this.lastSystemChange.setValue(value); + return this; + } + + /** + * @return {@link #source} (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) + */ + public Reference getSource() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.source"); + else if (Configuration.doAutoCreate()) + this.source = new Reference(); // cc + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) + */ + public DeviceComponent setSource(Reference value) { + this.source = value; + return this; + } + + /** + * @return {@link #source} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) + */ + public Device getSourceTarget() { + if (this.sourceTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.source"); + else if (Configuration.doAutoCreate()) + this.sourceTarget = new Device(); // aa + return this.sourceTarget; + } + + /** + * @param value {@link #source} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) + */ + public DeviceComponent setSourceTarget(Device value) { + this.sourceTarget = value; + return this; + } + + /** + * @return {@link #parent} (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) + */ + public Reference getParent() { + if (this.parent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.parent"); + else if (Configuration.doAutoCreate()) + this.parent = new Reference(); // cc + return this.parent; + } + + public boolean hasParent() { + return this.parent != null && !this.parent.isEmpty(); + } + + /** + * @param value {@link #parent} (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) + */ + public DeviceComponent setParent(Reference value) { + this.parent = value; + return this; + } + + /** + * @return {@link #parent} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) + */ + public DeviceComponent getParentTarget() { + if (this.parentTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.parent"); + else if (Configuration.doAutoCreate()) + this.parentTarget = new DeviceComponent(); // aa + return this.parentTarget; + } + + /** + * @param value {@link #parent} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) + */ + public DeviceComponent setParentTarget(DeviceComponent value) { + this.parentTarget = value; + return this; + } + + /** + * @return {@link #operationalStatus} (Indicates current operational status of the device. For example: On, Off, Standby, etc.) + */ + public List getOperationalStatus() { + if (this.operationalStatus == null) + this.operationalStatus = new ArrayList(); + return this.operationalStatus; + } + + public boolean hasOperationalStatus() { + if (this.operationalStatus == null) + return false; + for (CodeableConcept item : this.operationalStatus) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #operationalStatus} (Indicates current operational status of the device. For example: On, Off, Standby, etc.) + */ + // syntactic sugar + public CodeableConcept addOperationalStatus() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.operationalStatus == null) + this.operationalStatus = new ArrayList(); + this.operationalStatus.add(t); + return t; + } + + // syntactic sugar + public DeviceComponent addOperationalStatus(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.operationalStatus == null) + this.operationalStatus = new ArrayList(); + this.operationalStatus.add(t); + return this; + } + + /** + * @return {@link #parameterGroup} (Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular.) + */ + public CodeableConcept getParameterGroup() { + if (this.parameterGroup == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.parameterGroup"); + else if (Configuration.doAutoCreate()) + this.parameterGroup = new CodeableConcept(); // cc + return this.parameterGroup; + } + + public boolean hasParameterGroup() { + return this.parameterGroup != null && !this.parameterGroup.isEmpty(); + } + + /** + * @param value {@link #parameterGroup} (Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular.) + */ + public DeviceComponent setParameterGroup(CodeableConcept value) { + this.parameterGroup = value; + return this; + } + + /** + * @return {@link #measurementPrinciple} (Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.). This is the underlying object with id, value and extensions. The accessor "getMeasurementPrinciple" gives direct access to the value + */ + public Enumeration getMeasurementPrincipleElement() { + if (this.measurementPrinciple == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.measurementPrinciple"); + else if (Configuration.doAutoCreate()) + this.measurementPrinciple = new Enumeration(new MeasurementPrincipleEnumFactory()); // bb + return this.measurementPrinciple; + } + + public boolean hasMeasurementPrincipleElement() { + return this.measurementPrinciple != null && !this.measurementPrinciple.isEmpty(); + } + + public boolean hasMeasurementPrinciple() { + return this.measurementPrinciple != null && !this.measurementPrinciple.isEmpty(); + } + + /** + * @param value {@link #measurementPrinciple} (Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.). This is the underlying object with id, value and extensions. The accessor "getMeasurementPrinciple" gives direct access to the value + */ + public DeviceComponent setMeasurementPrincipleElement(Enumeration value) { + this.measurementPrinciple = value; + return this; + } + + /** + * @return Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. + */ + public MeasurementPrinciple getMeasurementPrinciple() { + return this.measurementPrinciple == null ? null : this.measurementPrinciple.getValue(); + } + + /** + * @param value Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. + */ + public DeviceComponent setMeasurementPrinciple(MeasurementPrinciple value) { + if (value == null) + this.measurementPrinciple = null; + else { + if (this.measurementPrinciple == null) + this.measurementPrinciple = new Enumeration(new MeasurementPrincipleEnumFactory()); + this.measurementPrinciple.setValue(value); + } + return this; + } + + /** + * @return {@link #productionSpecification} (Describes the production specification such as component revision, serial number, etc.) + */ + public List getProductionSpecification() { + if (this.productionSpecification == null) + this.productionSpecification = new ArrayList(); + return this.productionSpecification; + } + + public boolean hasProductionSpecification() { + if (this.productionSpecification == null) + return false; + for (DeviceComponentProductionSpecificationComponent item : this.productionSpecification) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #productionSpecification} (Describes the production specification such as component revision, serial number, etc.) + */ + // syntactic sugar + public DeviceComponentProductionSpecificationComponent addProductionSpecification() { //3 + DeviceComponentProductionSpecificationComponent t = new DeviceComponentProductionSpecificationComponent(); + if (this.productionSpecification == null) + this.productionSpecification = new ArrayList(); + this.productionSpecification.add(t); + return t; + } + + // syntactic sugar + public DeviceComponent addProductionSpecification(DeviceComponentProductionSpecificationComponent t) { //3 + if (t == null) + return this; + if (this.productionSpecification == null) + this.productionSpecification = new ArrayList(); + this.productionSpecification.add(t); + return this; + } + + /** + * @return {@link #languageCode} (Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.) + */ + public CodeableConcept getLanguageCode() { + if (this.languageCode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.languageCode"); + else if (Configuration.doAutoCreate()) + this.languageCode = new CodeableConcept(); // cc + return this.languageCode; + } + + public boolean hasLanguageCode() { + return this.languageCode != null && !this.languageCode.isEmpty(); + } + + /** + * @param value {@link #languageCode} (Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.) + */ + public DeviceComponent setLanguageCode(CodeableConcept value) { + this.languageCode = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "Describes the specific component type as defined in the object-oriented or metric nomenclature partition.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("identifier", "Identifier", "Describes the local assigned unique identification by the software. For example: handle ID.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("lastSystemChange", "instant", "Describes the timestamp for the most recent system change which includes device configuration or setting change.", 0, java.lang.Integer.MAX_VALUE, lastSystemChange)); + childrenList.add(new Property("source", "Reference(Device)", "Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("parent", "Reference(DeviceComponent)", "Describes the link to the parent resource. For example: Channel is linked to its VMD parent.", 0, java.lang.Integer.MAX_VALUE, parent)); + childrenList.add(new Property("operationalStatus", "CodeableConcept", "Indicates current operational status of the device. For example: On, Off, Standby, etc.", 0, java.lang.Integer.MAX_VALUE, operationalStatus)); + childrenList.add(new Property("parameterGroup", "CodeableConcept", "Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular.", 0, java.lang.Integer.MAX_VALUE, parameterGroup)); + childrenList.add(new Property("measurementPrinciple", "code", "Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.", 0, java.lang.Integer.MAX_VALUE, measurementPrinciple)); + childrenList.add(new Property("productionSpecification", "", "Describes the production specification such as component revision, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, productionSpecification)); + childrenList.add(new Property("languageCode", "CodeableConcept", "Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.", 0, java.lang.Integer.MAX_VALUE, languageCode)); + } + + public DeviceComponent copy() { + DeviceComponent dst = new DeviceComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.lastSystemChange = lastSystemChange == null ? null : lastSystemChange.copy(); + dst.source = source == null ? null : source.copy(); + dst.parent = parent == null ? null : parent.copy(); + if (operationalStatus != null) { + dst.operationalStatus = new ArrayList(); + for (CodeableConcept i : operationalStatus) + dst.operationalStatus.add(i.copy()); + }; + dst.parameterGroup = parameterGroup == null ? null : parameterGroup.copy(); + dst.measurementPrinciple = measurementPrinciple == null ? null : measurementPrinciple.copy(); + if (productionSpecification != null) { + dst.productionSpecification = new ArrayList(); + for (DeviceComponentProductionSpecificationComponent i : productionSpecification) + dst.productionSpecification.add(i.copy()); + }; + dst.languageCode = languageCode == null ? null : languageCode.copy(); + return dst; + } + + protected DeviceComponent typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DeviceComponent)) + return false; + DeviceComponent o = (DeviceComponent) other; + return compareDeep(type, o.type, true) && compareDeep(identifier, o.identifier, true) && compareDeep(lastSystemChange, o.lastSystemChange, true) + && compareDeep(source, o.source, true) && compareDeep(parent, o.parent, true) && compareDeep(operationalStatus, o.operationalStatus, true) + && compareDeep(parameterGroup, o.parameterGroup, true) && compareDeep(measurementPrinciple, o.measurementPrinciple, true) + && compareDeep(productionSpecification, o.productionSpecification, true) && compareDeep(languageCode, o.languageCode, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DeviceComponent)) + return false; + DeviceComponent o = (DeviceComponent) other; + return compareValues(lastSystemChange, o.lastSystemChange, true) && compareValues(measurementPrinciple, o.measurementPrinciple, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (lastSystemChange == null || lastSystemChange.isEmpty()) && (source == null || source.isEmpty()) + && (parent == null || parent.isEmpty()) && (operationalStatus == null || operationalStatus.isEmpty()) + && (parameterGroup == null || parameterGroup.isEmpty()) && (measurementPrinciple == null || measurementPrinciple.isEmpty()) + && (productionSpecification == null || productionSpecification.isEmpty()) && (languageCode == null || languageCode.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DeviceComponent; + } + + @SearchParamDefinition(name="parent", path="DeviceComponent.parent", description="The parent DeviceComponent resource", type="reference" ) + public static final String SP_PARENT = "parent"; + @SearchParamDefinition(name="source", path="DeviceComponent.source", description="The device source", type="reference" ) + public static final String SP_SOURCE = "source"; + @SearchParamDefinition(name="type", path="DeviceComponent.type", description="The device component type", type="token" ) + public static final String SP_TYPE = "type"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DeviceMetric.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DeviceMetric.java index ec5242bd510..9347348e5e0 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DeviceMetric.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DeviceMetric.java @@ -1,1404 +1,1383 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Describes a measurement, calculation or setting capability of a medical device. - */ -@ResourceDef(name="DeviceMetric", profile="http://hl7.org/fhir/Profile/DeviceMetric") -public class DeviceMetric extends DomainResource { - - public enum MetricOperationalStatus { - /** - * The DeviceMetric is operating and will generate DeviceObservations. - */ - ON, - /** - * The DeviceMetric is not operating. - */ - OFF, - /** - * The DeviceMetric is operating, but will not generate any DeviceObservations. - */ - STANDBY, - /** - * added to help the parsers - */ - NULL; - public static MetricOperationalStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("on".equals(codeString)) - return ON; - if ("off".equals(codeString)) - return OFF; - if ("standby".equals(codeString)) - return STANDBY; - throw new Exception("Unknown MetricOperationalStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ON: return "on"; - case OFF: return "off"; - case STANDBY: return "standby"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ON: return ""; - case OFF: return ""; - case STANDBY: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ON: return "The DeviceMetric is operating and will generate DeviceObservations."; - case OFF: return "The DeviceMetric is not operating."; - case STANDBY: return "The DeviceMetric is operating, but will not generate any DeviceObservations."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ON: return "On"; - case OFF: return "Off"; - case STANDBY: return "Standby"; - default: return "?"; - } - } - } - - public static class MetricOperationalStatusEnumFactory implements EnumFactory { - public MetricOperationalStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("on".equals(codeString)) - return MetricOperationalStatus.ON; - if ("off".equals(codeString)) - return MetricOperationalStatus.OFF; - if ("standby".equals(codeString)) - return MetricOperationalStatus.STANDBY; - throw new IllegalArgumentException("Unknown MetricOperationalStatus code '"+codeString+"'"); - } - public String toCode(MetricOperationalStatus code) { - if (code == MetricOperationalStatus.ON) - return "on"; - if (code == MetricOperationalStatus.OFF) - return "off"; - if (code == MetricOperationalStatus.STANDBY) - return "standby"; - return "?"; - } - } - - public enum MetricColor { - /** - * Color for representation - black. - */ - BLACK, - /** - * Color for representation - red. - */ - RED, - /** - * Color for representation - green. - */ - GREEN, - /** - * Color for representation - yellow. - */ - YELLOW, - /** - * Color for representation - blue. - */ - BLUE, - /** - * Color for representation - magenta. - */ - MAGENTA, - /** - * Color for representation - cyan. - */ - CYAN, - /** - * Color for representation - white. - */ - WHITE, - /** - * added to help the parsers - */ - NULL; - public static MetricColor fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("black".equals(codeString)) - return BLACK; - if ("red".equals(codeString)) - return RED; - if ("green".equals(codeString)) - return GREEN; - if ("yellow".equals(codeString)) - return YELLOW; - if ("blue".equals(codeString)) - return BLUE; - if ("magenta".equals(codeString)) - return MAGENTA; - if ("cyan".equals(codeString)) - return CYAN; - if ("white".equals(codeString)) - return WHITE; - throw new Exception("Unknown MetricColor code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case BLACK: return "black"; - case RED: return "red"; - case GREEN: return "green"; - case YELLOW: return "yellow"; - case BLUE: return "blue"; - case MAGENTA: return "magenta"; - case CYAN: return "cyan"; - case WHITE: return "white"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case BLACK: return ""; - case RED: return ""; - case GREEN: return ""; - case YELLOW: return ""; - case BLUE: return ""; - case MAGENTA: return ""; - case CYAN: return ""; - case WHITE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case BLACK: return "Color for representation - black."; - case RED: return "Color for representation - red."; - case GREEN: return "Color for representation - green."; - case YELLOW: return "Color for representation - yellow."; - case BLUE: return "Color for representation - blue."; - case MAGENTA: return "Color for representation - magenta."; - case CYAN: return "Color for representation - cyan."; - case WHITE: return "Color for representation - white."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case BLACK: return "col-black"; - case RED: return "col-red"; - case GREEN: return "col-green"; - case YELLOW: return "col-yellow"; - case BLUE: return "col-blue"; - case MAGENTA: return "col-magenta"; - case CYAN: return "col-cyan"; - case WHITE: return "col-white"; - default: return "?"; - } - } - } - - public static class MetricColorEnumFactory implements EnumFactory { - public MetricColor fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("black".equals(codeString)) - return MetricColor.BLACK; - if ("red".equals(codeString)) - return MetricColor.RED; - if ("green".equals(codeString)) - return MetricColor.GREEN; - if ("yellow".equals(codeString)) - return MetricColor.YELLOW; - if ("blue".equals(codeString)) - return MetricColor.BLUE; - if ("magenta".equals(codeString)) - return MetricColor.MAGENTA; - if ("cyan".equals(codeString)) - return MetricColor.CYAN; - if ("white".equals(codeString)) - return MetricColor.WHITE; - throw new IllegalArgumentException("Unknown MetricColor code '"+codeString+"'"); - } - public String toCode(MetricColor code) { - if (code == MetricColor.BLACK) - return "black"; - if (code == MetricColor.RED) - return "red"; - if (code == MetricColor.GREEN) - return "green"; - if (code == MetricColor.YELLOW) - return "yellow"; - if (code == MetricColor.BLUE) - return "blue"; - if (code == MetricColor.MAGENTA) - return "magenta"; - if (code == MetricColor.CYAN) - return "cyan"; - if (code == MetricColor.WHITE) - return "white"; - return "?"; - } - } - - public enum MetricCategory { - /** - * DeviceObservations generated for this DeviceMetric are measured. - */ - MEASUREMENT, - /** - * DeviceObservations generated for this DeviceMetric is a setting that will influence the behavior of the Device. - */ - SETTING, - /** - * DeviceObservations generated for this DeviceMetric are calculated. - */ - CALCULATION, - /** - * The category of this DeviceMetric is unspecified. - */ - UNSPECIFIED, - /** - * added to help the parsers - */ - NULL; - public static MetricCategory fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("measurement".equals(codeString)) - return MEASUREMENT; - if ("setting".equals(codeString)) - return SETTING; - if ("calculation".equals(codeString)) - return CALCULATION; - if ("unspecified".equals(codeString)) - return UNSPECIFIED; - throw new Exception("Unknown MetricCategory code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case MEASUREMENT: return "measurement"; - case SETTING: return "setting"; - case CALCULATION: return "calculation"; - case UNSPECIFIED: return "unspecified"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MEASUREMENT: return ""; - case SETTING: return ""; - case CALCULATION: return ""; - case UNSPECIFIED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MEASUREMENT: return "DeviceObservations generated for this DeviceMetric are measured."; - case SETTING: return "DeviceObservations generated for this DeviceMetric is a setting that will influence the behavior of the Device."; - case CALCULATION: return "DeviceObservations generated for this DeviceMetric are calculated."; - case UNSPECIFIED: return "The category of this DeviceMetric is unspecified."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MEASUREMENT: return "Measurement"; - case SETTING: return "Setting"; - case CALCULATION: return "Calculation"; - case UNSPECIFIED: return "Unspecified"; - default: return "?"; - } - } - } - - public static class MetricCategoryEnumFactory implements EnumFactory { - public MetricCategory fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("measurement".equals(codeString)) - return MetricCategory.MEASUREMENT; - if ("setting".equals(codeString)) - return MetricCategory.SETTING; - if ("calculation".equals(codeString)) - return MetricCategory.CALCULATION; - if ("unspecified".equals(codeString)) - return MetricCategory.UNSPECIFIED; - throw new IllegalArgumentException("Unknown MetricCategory code '"+codeString+"'"); - } - public String toCode(MetricCategory code) { - if (code == MetricCategory.MEASUREMENT) - return "measurement"; - if (code == MetricCategory.SETTING) - return "setting"; - if (code == MetricCategory.CALCULATION) - return "calculation"; - if (code == MetricCategory.UNSPECIFIED) - return "unspecified"; - return "?"; - } - } - - public enum MetricCalibrationType { - /** - * TODO. - */ - UNSPECIFIED, - /** - * TODO. - */ - OFFSET, - /** - * TODO. - */ - GAIN, - /** - * TODO. - */ - TWOPOINT, - /** - * added to help the parsers - */ - NULL; - public static MetricCalibrationType fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("unspecified".equals(codeString)) - return UNSPECIFIED; - if ("offset".equals(codeString)) - return OFFSET; - if ("gain".equals(codeString)) - return GAIN; - if ("two-point".equals(codeString)) - return TWOPOINT; - throw new Exception("Unknown MetricCalibrationType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case UNSPECIFIED: return "unspecified"; - case OFFSET: return "offset"; - case GAIN: return "gain"; - case TWOPOINT: return "two-point"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case UNSPECIFIED: return ""; - case OFFSET: return ""; - case GAIN: return ""; - case TWOPOINT: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case UNSPECIFIED: return "TODO."; - case OFFSET: return "TODO."; - case GAIN: return "TODO."; - case TWOPOINT: return "TODO."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case UNSPECIFIED: return "Unspecified"; - case OFFSET: return "Offset"; - case GAIN: return "Gain"; - case TWOPOINT: return "Two Point"; - default: return "?"; - } - } - } - - public static class MetricCalibrationTypeEnumFactory implements EnumFactory { - public MetricCalibrationType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("unspecified".equals(codeString)) - return MetricCalibrationType.UNSPECIFIED; - if ("offset".equals(codeString)) - return MetricCalibrationType.OFFSET; - if ("gain".equals(codeString)) - return MetricCalibrationType.GAIN; - if ("two-point".equals(codeString)) - return MetricCalibrationType.TWOPOINT; - throw new IllegalArgumentException("Unknown MetricCalibrationType code '"+codeString+"'"); - } - public String toCode(MetricCalibrationType code) { - if (code == MetricCalibrationType.UNSPECIFIED) - return "unspecified"; - if (code == MetricCalibrationType.OFFSET) - return "offset"; - if (code == MetricCalibrationType.GAIN) - return "gain"; - if (code == MetricCalibrationType.TWOPOINT) - return "two-point"; - return "?"; - } - } - - public enum MetricCalibrationState { - /** - * The metric has not been calibrated. - */ - NOTCALIBRATED, - /** - * The metric needs to be calibrated. - */ - CALIBRATIONREQUIRED, - /** - * The metric has been calibrated. - */ - CALIBRATED, - /** - * The state of calibration of this metric is unspecified. - */ - UNSPECIFIED, - /** - * added to help the parsers - */ - NULL; - public static MetricCalibrationState fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("not-calibrated".equals(codeString)) - return NOTCALIBRATED; - if ("calibration-required".equals(codeString)) - return CALIBRATIONREQUIRED; - if ("calibrated".equals(codeString)) - return CALIBRATED; - if ("unspecified".equals(codeString)) - return UNSPECIFIED; - throw new Exception("Unknown MetricCalibrationState code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case NOTCALIBRATED: return "not-calibrated"; - case CALIBRATIONREQUIRED: return "calibration-required"; - case CALIBRATED: return "calibrated"; - case UNSPECIFIED: return "unspecified"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case NOTCALIBRATED: return ""; - case CALIBRATIONREQUIRED: return ""; - case CALIBRATED: return ""; - case UNSPECIFIED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case NOTCALIBRATED: return "The metric has not been calibrated."; - case CALIBRATIONREQUIRED: return "The metric needs to be calibrated."; - case CALIBRATED: return "The metric has been calibrated."; - case UNSPECIFIED: return "The state of calibration of this metric is unspecified."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case NOTCALIBRATED: return "Not Calibrated"; - case CALIBRATIONREQUIRED: return "Calibration Required"; - case CALIBRATED: return "Calibrated"; - case UNSPECIFIED: return "Unspecified"; - default: return "?"; - } - } - } - - public static class MetricCalibrationStateEnumFactory implements EnumFactory { - public MetricCalibrationState fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("not-calibrated".equals(codeString)) - return MetricCalibrationState.NOTCALIBRATED; - if ("calibration-required".equals(codeString)) - return MetricCalibrationState.CALIBRATIONREQUIRED; - if ("calibrated".equals(codeString)) - return MetricCalibrationState.CALIBRATED; - if ("unspecified".equals(codeString)) - return MetricCalibrationState.UNSPECIFIED; - throw new IllegalArgumentException("Unknown MetricCalibrationState code '"+codeString+"'"); - } - public String toCode(MetricCalibrationState code) { - if (code == MetricCalibrationState.NOTCALIBRATED) - return "not-calibrated"; - if (code == MetricCalibrationState.CALIBRATIONREQUIRED) - return "calibration-required"; - if (code == MetricCalibrationState.CALIBRATED) - return "calibrated"; - if (code == MetricCalibrationState.UNSPECIFIED) - return "unspecified"; - return "?"; - } - } - - @Block() - public static class DeviceMetricCalibrationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Describes the type of the calibration method. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="unspecified | offset | gain | two-point", formalDefinition="Describes the type of the calibration method." ) - protected Enumeration type; - - /** - * Describes the state of the calibration. - */ - @Child(name = "state", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="not-calibrated | calibration-required | calibrated | unspecified", formalDefinition="Describes the state of the calibration." ) - protected Enumeration state; - - /** - * Describes the time last calibration has been performed. - */ - @Child(name = "time", type = {InstantType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Describes the time last calibration has been performed", formalDefinition="Describes the time last calibration has been performed." ) - protected InstantType time; - - private static final long serialVersionUID = 407720126L; - - /* - * Constructor - */ - public DeviceMetricCalibrationComponent() { - super(); - } - - /** - * @return {@link #type} (Describes the type of the calibration method.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetricCalibrationComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new MetricCalibrationTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Describes the type of the calibration method.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public DeviceMetricCalibrationComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Describes the type of the calibration method. - */ - public MetricCalibrationType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Describes the type of the calibration method. - */ - public DeviceMetricCalibrationComponent setType(MetricCalibrationType value) { - if (value == null) - this.type = null; - else { - if (this.type == null) - this.type = new Enumeration(new MetricCalibrationTypeEnumFactory()); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #state} (Describes the state of the calibration.). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value - */ - public Enumeration getStateElement() { - if (this.state == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetricCalibrationComponent.state"); - else if (Configuration.doAutoCreate()) - this.state = new Enumeration(new MetricCalibrationStateEnumFactory()); // bb - return this.state; - } - - public boolean hasStateElement() { - return this.state != null && !this.state.isEmpty(); - } - - public boolean hasState() { - return this.state != null && !this.state.isEmpty(); - } - - /** - * @param value {@link #state} (Describes the state of the calibration.). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value - */ - public DeviceMetricCalibrationComponent setStateElement(Enumeration value) { - this.state = value; - return this; - } - - /** - * @return Describes the state of the calibration. - */ - public MetricCalibrationState getState() { - return this.state == null ? null : this.state.getValue(); - } - - /** - * @param value Describes the state of the calibration. - */ - public DeviceMetricCalibrationComponent setState(MetricCalibrationState value) { - if (value == null) - this.state = null; - else { - if (this.state == null) - this.state = new Enumeration(new MetricCalibrationStateEnumFactory()); - this.state.setValue(value); - } - return this; - } - - /** - * @return {@link #time} (Describes the time last calibration has been performed.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value - */ - public InstantType getTimeElement() { - if (this.time == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetricCalibrationComponent.time"); - else if (Configuration.doAutoCreate()) - this.time = new InstantType(); // bb - return this.time; - } - - public boolean hasTimeElement() { - return this.time != null && !this.time.isEmpty(); - } - - public boolean hasTime() { - return this.time != null && !this.time.isEmpty(); - } - - /** - * @param value {@link #time} (Describes the time last calibration has been performed.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value - */ - public DeviceMetricCalibrationComponent setTimeElement(InstantType value) { - this.time = value; - return this; - } - - /** - * @return Describes the time last calibration has been performed. - */ - public Date getTime() { - return this.time == null ? null : this.time.getValue(); - } - - /** - * @param value Describes the time last calibration has been performed. - */ - public DeviceMetricCalibrationComponent setTime(Date value) { - if (value == null) - this.time = null; - else { - if (this.time == null) - this.time = new InstantType(); - this.time.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Describes the type of the calibration method.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("state", "code", "Describes the state of the calibration.", 0, java.lang.Integer.MAX_VALUE, state)); - childrenList.add(new Property("time", "instant", "Describes the time last calibration has been performed.", 0, java.lang.Integer.MAX_VALUE, time)); - } - - public DeviceMetricCalibrationComponent copy() { - DeviceMetricCalibrationComponent dst = new DeviceMetricCalibrationComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.state = state == null ? null : state.copy(); - dst.time = time == null ? null : time.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DeviceMetricCalibrationComponent)) - return false; - DeviceMetricCalibrationComponent o = (DeviceMetricCalibrationComponent) other; - return compareDeep(type, o.type, true) && compareDeep(state, o.state, true) && compareDeep(time, o.time, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DeviceMetricCalibrationComponent)) - return false; - DeviceMetricCalibrationComponent o = (DeviceMetricCalibrationComponent) other; - return compareValues(type, o.type, true) && compareValues(state, o.state, true) && compareValues(time, o.time, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (state == null || state.isEmpty()) - && (time == null || time.isEmpty()); - } - - } - - /** - * Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=0, min=1, max=1) - @Description(shortDefinition="Type of metric", formalDefinition="Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc." ) - protected CodeableConcept type; - - /** +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Describes a measurement, calculation or setting capability of a medical device. + */ +@ResourceDef(name="DeviceMetric", profile="http://hl7.org/fhir/Profile/DeviceMetric") +public class DeviceMetric extends DomainResource { + + public enum MetricOperationalStatus { + /** + * The DeviceMetric is operating and will generate DeviceObservations. + */ + ON, + /** + * The DeviceMetric is not operating. + */ + OFF, + /** + * The DeviceMetric is operating, but will not generate any DeviceObservations. + */ + STANDBY, + /** + * added to help the parsers + */ + NULL; + public static MetricOperationalStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("on".equals(codeString)) + return ON; + if ("off".equals(codeString)) + return OFF; + if ("standby".equals(codeString)) + return STANDBY; + throw new Exception("Unknown MetricOperationalStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ON: return "on"; + case OFF: return "off"; + case STANDBY: return "standby"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ON: return ""; + case OFF: return ""; + case STANDBY: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ON: return "The DeviceMetric is operating and will generate DeviceObservations."; + case OFF: return "The DeviceMetric is not operating."; + case STANDBY: return "The DeviceMetric is operating, but will not generate any DeviceObservations."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ON: return "On"; + case OFF: return "Off"; + case STANDBY: return "Standby"; + default: return "?"; + } + } + } + + public static class MetricOperationalStatusEnumFactory implements EnumFactory { + public MetricOperationalStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("on".equals(codeString)) + return MetricOperationalStatus.ON; + if ("off".equals(codeString)) + return MetricOperationalStatus.OFF; + if ("standby".equals(codeString)) + return MetricOperationalStatus.STANDBY; + throw new IllegalArgumentException("Unknown MetricOperationalStatus code '"+codeString+"'"); + } + public String toCode(MetricOperationalStatus code) { + if (code == MetricOperationalStatus.ON) + return "on"; + if (code == MetricOperationalStatus.OFF) + return "off"; + if (code == MetricOperationalStatus.STANDBY) + return "standby"; + return "?"; + } + } + + public enum MetricColor { + /** + * Color for representation - black. + */ + BLACK, + /** + * Color for representation - red. + */ + RED, + /** + * Color for representation - green. + */ + GREEN, + /** + * Color for representation - yellow. + */ + YELLOW, + /** + * Color for representation - blue. + */ + BLUE, + /** + * Color for representation - magenta. + */ + MAGENTA, + /** + * Color for representation - cyan. + */ + CYAN, + /** + * Color for representation - white. + */ + WHITE, + /** + * added to help the parsers + */ + NULL; + public static MetricColor fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("black".equals(codeString)) + return BLACK; + if ("red".equals(codeString)) + return RED; + if ("green".equals(codeString)) + return GREEN; + if ("yellow".equals(codeString)) + return YELLOW; + if ("blue".equals(codeString)) + return BLUE; + if ("magenta".equals(codeString)) + return MAGENTA; + if ("cyan".equals(codeString)) + return CYAN; + if ("white".equals(codeString)) + return WHITE; + throw new Exception("Unknown MetricColor code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case BLACK: return "black"; + case RED: return "red"; + case GREEN: return "green"; + case YELLOW: return "yellow"; + case BLUE: return "blue"; + case MAGENTA: return "magenta"; + case CYAN: return "cyan"; + case WHITE: return "white"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case BLACK: return ""; + case RED: return ""; + case GREEN: return ""; + case YELLOW: return ""; + case BLUE: return ""; + case MAGENTA: return ""; + case CYAN: return ""; + case WHITE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case BLACK: return "Color for representation - black."; + case RED: return "Color for representation - red."; + case GREEN: return "Color for representation - green."; + case YELLOW: return "Color for representation - yellow."; + case BLUE: return "Color for representation - blue."; + case MAGENTA: return "Color for representation - magenta."; + case CYAN: return "Color for representation - cyan."; + case WHITE: return "Color for representation - white."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case BLACK: return "col-black"; + case RED: return "col-red"; + case GREEN: return "col-green"; + case YELLOW: return "col-yellow"; + case BLUE: return "col-blue"; + case MAGENTA: return "col-magenta"; + case CYAN: return "col-cyan"; + case WHITE: return "col-white"; + default: return "?"; + } + } + } + + public static class MetricColorEnumFactory implements EnumFactory { + public MetricColor fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("black".equals(codeString)) + return MetricColor.BLACK; + if ("red".equals(codeString)) + return MetricColor.RED; + if ("green".equals(codeString)) + return MetricColor.GREEN; + if ("yellow".equals(codeString)) + return MetricColor.YELLOW; + if ("blue".equals(codeString)) + return MetricColor.BLUE; + if ("magenta".equals(codeString)) + return MetricColor.MAGENTA; + if ("cyan".equals(codeString)) + return MetricColor.CYAN; + if ("white".equals(codeString)) + return MetricColor.WHITE; + throw new IllegalArgumentException("Unknown MetricColor code '"+codeString+"'"); + } + public String toCode(MetricColor code) { + if (code == MetricColor.BLACK) + return "black"; + if (code == MetricColor.RED) + return "red"; + if (code == MetricColor.GREEN) + return "green"; + if (code == MetricColor.YELLOW) + return "yellow"; + if (code == MetricColor.BLUE) + return "blue"; + if (code == MetricColor.MAGENTA) + return "magenta"; + if (code == MetricColor.CYAN) + return "cyan"; + if (code == MetricColor.WHITE) + return "white"; + return "?"; + } + } + + public enum MetricCategory { + /** + * DeviceObservations generated for this DeviceMetric are measured. + */ + MEASUREMENT, + /** + * DeviceObservations generated for this DeviceMetric is a setting that will influence the behavior of the Device. + */ + SETTING, + /** + * DeviceObservations generated for this DeviceMetric are calculated. + */ + CALCULATION, + /** + * The category of this DeviceMetric is unspecified. + */ + UNSPECIFIED, + /** + * added to help the parsers + */ + NULL; + public static MetricCategory fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("measurement".equals(codeString)) + return MEASUREMENT; + if ("setting".equals(codeString)) + return SETTING; + if ("calculation".equals(codeString)) + return CALCULATION; + if ("unspecified".equals(codeString)) + return UNSPECIFIED; + throw new Exception("Unknown MetricCategory code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case MEASUREMENT: return "measurement"; + case SETTING: return "setting"; + case CALCULATION: return "calculation"; + case UNSPECIFIED: return "unspecified"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MEASUREMENT: return ""; + case SETTING: return ""; + case CALCULATION: return ""; + case UNSPECIFIED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MEASUREMENT: return "DeviceObservations generated for this DeviceMetric are measured."; + case SETTING: return "DeviceObservations generated for this DeviceMetric is a setting that will influence the behavior of the Device."; + case CALCULATION: return "DeviceObservations generated for this DeviceMetric are calculated."; + case UNSPECIFIED: return "The category of this DeviceMetric is unspecified."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MEASUREMENT: return "Measurement"; + case SETTING: return "Setting"; + case CALCULATION: return "Calculation"; + case UNSPECIFIED: return "Unspecified"; + default: return "?"; + } + } + } + + public static class MetricCategoryEnumFactory implements EnumFactory { + public MetricCategory fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("measurement".equals(codeString)) + return MetricCategory.MEASUREMENT; + if ("setting".equals(codeString)) + return MetricCategory.SETTING; + if ("calculation".equals(codeString)) + return MetricCategory.CALCULATION; + if ("unspecified".equals(codeString)) + return MetricCategory.UNSPECIFIED; + throw new IllegalArgumentException("Unknown MetricCategory code '"+codeString+"'"); + } + public String toCode(MetricCategory code) { + if (code == MetricCategory.MEASUREMENT) + return "measurement"; + if (code == MetricCategory.SETTING) + return "setting"; + if (code == MetricCategory.CALCULATION) + return "calculation"; + if (code == MetricCategory.UNSPECIFIED) + return "unspecified"; + return "?"; + } + } + + public enum MetricCalibrationType { + /** + * TODO. + */ + UNSPECIFIED, + /** + * TODO. + */ + OFFSET, + /** + * TODO. + */ + GAIN, + /** + * TODO. + */ + TWOPOINT, + /** + * added to help the parsers + */ + NULL; + public static MetricCalibrationType fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("unspecified".equals(codeString)) + return UNSPECIFIED; + if ("offset".equals(codeString)) + return OFFSET; + if ("gain".equals(codeString)) + return GAIN; + if ("two-point".equals(codeString)) + return TWOPOINT; + throw new Exception("Unknown MetricCalibrationType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case UNSPECIFIED: return "unspecified"; + case OFFSET: return "offset"; + case GAIN: return "gain"; + case TWOPOINT: return "two-point"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case UNSPECIFIED: return ""; + case OFFSET: return ""; + case GAIN: return ""; + case TWOPOINT: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case UNSPECIFIED: return "TODO."; + case OFFSET: return "TODO."; + case GAIN: return "TODO."; + case TWOPOINT: return "TODO."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case UNSPECIFIED: return "Unspecified"; + case OFFSET: return "Offset"; + case GAIN: return "Gain"; + case TWOPOINT: return "Two Point"; + default: return "?"; + } + } + } + + public static class MetricCalibrationTypeEnumFactory implements EnumFactory { + public MetricCalibrationType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("unspecified".equals(codeString)) + return MetricCalibrationType.UNSPECIFIED; + if ("offset".equals(codeString)) + return MetricCalibrationType.OFFSET; + if ("gain".equals(codeString)) + return MetricCalibrationType.GAIN; + if ("two-point".equals(codeString)) + return MetricCalibrationType.TWOPOINT; + throw new IllegalArgumentException("Unknown MetricCalibrationType code '"+codeString+"'"); + } + public String toCode(MetricCalibrationType code) { + if (code == MetricCalibrationType.UNSPECIFIED) + return "unspecified"; + if (code == MetricCalibrationType.OFFSET) + return "offset"; + if (code == MetricCalibrationType.GAIN) + return "gain"; + if (code == MetricCalibrationType.TWOPOINT) + return "two-point"; + return "?"; + } + } + + public enum MetricCalibrationState { + /** + * The metric has not been calibrated. + */ + NOTCALIBRATED, + /** + * The metric needs to be calibrated. + */ + CALIBRATIONREQUIRED, + /** + * The metric has been calibrated. + */ + CALIBRATED, + /** + * The state of calibration of this metric is unspecified. + */ + UNSPECIFIED, + /** + * added to help the parsers + */ + NULL; + public static MetricCalibrationState fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("not-calibrated".equals(codeString)) + return NOTCALIBRATED; + if ("calibration-required".equals(codeString)) + return CALIBRATIONREQUIRED; + if ("calibrated".equals(codeString)) + return CALIBRATED; + if ("unspecified".equals(codeString)) + return UNSPECIFIED; + throw new Exception("Unknown MetricCalibrationState code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case NOTCALIBRATED: return "not-calibrated"; + case CALIBRATIONREQUIRED: return "calibration-required"; + case CALIBRATED: return "calibrated"; + case UNSPECIFIED: return "unspecified"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case NOTCALIBRATED: return ""; + case CALIBRATIONREQUIRED: return ""; + case CALIBRATED: return ""; + case UNSPECIFIED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case NOTCALIBRATED: return "The metric has not been calibrated."; + case CALIBRATIONREQUIRED: return "The metric needs to be calibrated."; + case CALIBRATED: return "The metric has been calibrated."; + case UNSPECIFIED: return "The state of calibration of this metric is unspecified."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NOTCALIBRATED: return "Not Calibrated"; + case CALIBRATIONREQUIRED: return "Calibration Required"; + case CALIBRATED: return "Calibrated"; + case UNSPECIFIED: return "Unspecified"; + default: return "?"; + } + } + } + + public static class MetricCalibrationStateEnumFactory implements EnumFactory { + public MetricCalibrationState fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("not-calibrated".equals(codeString)) + return MetricCalibrationState.NOTCALIBRATED; + if ("calibration-required".equals(codeString)) + return MetricCalibrationState.CALIBRATIONREQUIRED; + if ("calibrated".equals(codeString)) + return MetricCalibrationState.CALIBRATED; + if ("unspecified".equals(codeString)) + return MetricCalibrationState.UNSPECIFIED; + throw new IllegalArgumentException("Unknown MetricCalibrationState code '"+codeString+"'"); + } + public String toCode(MetricCalibrationState code) { + if (code == MetricCalibrationState.NOTCALIBRATED) + return "not-calibrated"; + if (code == MetricCalibrationState.CALIBRATIONREQUIRED) + return "calibration-required"; + if (code == MetricCalibrationState.CALIBRATED) + return "calibrated"; + if (code == MetricCalibrationState.UNSPECIFIED) + return "unspecified"; + return "?"; + } + } + + @Block() + public static class DeviceMetricCalibrationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Describes the type of the calibration method. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="unspecified | offset | gain | two-point", formalDefinition="Describes the type of the calibration method." ) + protected Enumeration type; + + /** + * Describes the state of the calibration. + */ + @Child(name = "state", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="not-calibrated | calibration-required | calibrated | unspecified", formalDefinition="Describes the state of the calibration." ) + protected Enumeration state; + + /** + * Describes the time last calibration has been performed. + */ + @Child(name = "time", type = {InstantType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Describes the time last calibration has been performed", formalDefinition="Describes the time last calibration has been performed." ) + protected InstantType time; + + private static final long serialVersionUID = 407720126L; + + /* + * Constructor + */ + public DeviceMetricCalibrationComponent() { + super(); + } + + /** + * @return {@link #type} (Describes the type of the calibration method.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetricCalibrationComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new MetricCalibrationTypeEnumFactory()); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Describes the type of the calibration method.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public DeviceMetricCalibrationComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Describes the type of the calibration method. + */ + public MetricCalibrationType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Describes the type of the calibration method. + */ + public DeviceMetricCalibrationComponent setType(MetricCalibrationType value) { + if (value == null) + this.type = null; + else { + if (this.type == null) + this.type = new Enumeration(new MetricCalibrationTypeEnumFactory()); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #state} (Describes the state of the calibration.). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value + */ + public Enumeration getStateElement() { + if (this.state == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetricCalibrationComponent.state"); + else if (Configuration.doAutoCreate()) + this.state = new Enumeration(new MetricCalibrationStateEnumFactory()); // bb + return this.state; + } + + public boolean hasStateElement() { + return this.state != null && !this.state.isEmpty(); + } + + public boolean hasState() { + return this.state != null && !this.state.isEmpty(); + } + + /** + * @param value {@link #state} (Describes the state of the calibration.). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value + */ + public DeviceMetricCalibrationComponent setStateElement(Enumeration value) { + this.state = value; + return this; + } + + /** + * @return Describes the state of the calibration. + */ + public MetricCalibrationState getState() { + return this.state == null ? null : this.state.getValue(); + } + + /** + * @param value Describes the state of the calibration. + */ + public DeviceMetricCalibrationComponent setState(MetricCalibrationState value) { + if (value == null) + this.state = null; + else { + if (this.state == null) + this.state = new Enumeration(new MetricCalibrationStateEnumFactory()); + this.state.setValue(value); + } + return this; + } + + /** + * @return {@link #time} (Describes the time last calibration has been performed.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value + */ + public InstantType getTimeElement() { + if (this.time == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetricCalibrationComponent.time"); + else if (Configuration.doAutoCreate()) + this.time = new InstantType(); // bb + return this.time; + } + + public boolean hasTimeElement() { + return this.time != null && !this.time.isEmpty(); + } + + public boolean hasTime() { + return this.time != null && !this.time.isEmpty(); + } + + /** + * @param value {@link #time} (Describes the time last calibration has been performed.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value + */ + public DeviceMetricCalibrationComponent setTimeElement(InstantType value) { + this.time = value; + return this; + } + + /** + * @return Describes the time last calibration has been performed. + */ + public Date getTime() { + return this.time == null ? null : this.time.getValue(); + } + + /** + * @param value Describes the time last calibration has been performed. + */ + public DeviceMetricCalibrationComponent setTime(Date value) { + if (value == null) + this.time = null; + else { + if (this.time == null) + this.time = new InstantType(); + this.time.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Describes the type of the calibration method.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("state", "code", "Describes the state of the calibration.", 0, java.lang.Integer.MAX_VALUE, state)); + childrenList.add(new Property("time", "instant", "Describes the time last calibration has been performed.", 0, java.lang.Integer.MAX_VALUE, time)); + } + + public DeviceMetricCalibrationComponent copy() { + DeviceMetricCalibrationComponent dst = new DeviceMetricCalibrationComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.state = state == null ? null : state.copy(); + dst.time = time == null ? null : time.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DeviceMetricCalibrationComponent)) + return false; + DeviceMetricCalibrationComponent o = (DeviceMetricCalibrationComponent) other; + return compareDeep(type, o.type, true) && compareDeep(state, o.state, true) && compareDeep(time, o.time, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DeviceMetricCalibrationComponent)) + return false; + DeviceMetricCalibrationComponent o = (DeviceMetricCalibrationComponent) other; + return compareValues(type, o.type, true) && compareValues(state, o.state, true) && compareValues(time, o.time, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (state == null || state.isEmpty()) + && (time == null || time.isEmpty()); + } + + } + + /** + * Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=0, min=1, max=1) + @Description(shortDefinition="Type of metric", formalDefinition="Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc." ) + protected CodeableConcept type; + + /** * Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. -It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1) - @Description(shortDefinition="Unique identifier of this DeviceMetric", formalDefinition="Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. \nIt should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device." ) - protected Identifier identifier; - - /** - * Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc. - */ - @Child(name = "unit", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Unit of metric", formalDefinition="Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc." ) - protected CodeableConcept unit; - - /** - * Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc. - */ - @Child(name = "source", type = {Device.class}, order=3, min=0, max=1) - @Description(shortDefinition="Describes the link to the source Device", formalDefinition="Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc." ) - protected Reference source; - - /** - * The actual object that is the target of the reference (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) - */ - protected Device sourceTarget; - - /** +It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1) + @Description(shortDefinition="Unique identifier of this DeviceMetric", formalDefinition="Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. \nIt should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device." ) + protected Identifier identifier; + + /** + * Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc. + */ + @Child(name = "unit", type = {CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Unit of metric", formalDefinition="Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc." ) + protected CodeableConcept unit; + + /** + * Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc. + */ + @Child(name = "source", type = {Device.class}, order=3, min=0, max=1) + @Description(shortDefinition="Describes the link to the source Device", formalDefinition="Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc." ) + protected Reference source; + + /** + * The actual object that is the target of the reference (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) + */ + protected Device sourceTarget; + + /** * Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. -An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location. - */ - @Child(name = "parent", type = {DeviceComponent.class}, order=4, min=0, max=1) - @Description(shortDefinition="Describes the link to the parent DeviceComponent", formalDefinition="Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device.\nAn example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location." ) - protected Reference parent; - - /** +An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location. + */ + @Child(name = "parent", type = {DeviceComponent.class}, order=4, min=0, max=1) + @Description(shortDefinition="Describes the link to the parent DeviceComponent", formalDefinition="Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device.\nAn example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location." ) + protected Reference parent; + + /** * The actual object that is the target of the reference (Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. -An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) - */ - protected DeviceComponent parentTarget; - - /** - * Indicates current operational state of the device. For example: On, Off, Standby, etc. - */ - @Child(name = "operationalStatus", type = {CodeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="on | off | standby", formalDefinition="Indicates current operational state of the device. For example: On, Off, Standby, etc." ) - protected Enumeration operationalStatus; - - /** - * Describes the typical color of the representation of observations that have been generated for this DeviceMetric. - */ - @Child(name = "color", type = {CodeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="black | red | green | yellow | blue | magenta | cyan | white", formalDefinition="Describes the typical color of the representation of observations that have been generated for this DeviceMetric." ) - protected Enumeration color; - - /** - * Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation. - */ - @Child(name = "category", type = {CodeType.class}, order=7, min=1, max=1) - @Description(shortDefinition="measurement | setting | calculation | unspecified", formalDefinition="Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation." ) - protected Enumeration category; - - /** +An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) + */ + protected DeviceComponent parentTarget; + + /** + * Indicates current operational state of the device. For example: On, Off, Standby, etc. + */ + @Child(name = "operationalStatus", type = {CodeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="on | off | standby", formalDefinition="Indicates current operational state of the device. For example: On, Off, Standby, etc." ) + protected Enumeration operationalStatus; + + /** + * Describes the typical color of the representation of observations that have been generated for this DeviceMetric. + */ + @Child(name = "color", type = {CodeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="black | red | green | yellow | blue | magenta | cyan | white", formalDefinition="Describes the typical color of the representation of observations that have been generated for this DeviceMetric." ) + protected Enumeration color; + + /** + * Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation. + */ + @Child(name = "category", type = {CodeType.class}, order=7, min=1, max=1) + @Description(shortDefinition="measurement | setting | calculation | unspecified", formalDefinition="Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation." ) + protected Enumeration category; + + /** * Describes the measurement repetition time. This is not necessarily the same as the update -period. - */ - @Child(name = "measurementPeriod", type = {Timing.class}, order=8, min=0, max=1) - @Description(shortDefinition="Describes the measurement repetition time", formalDefinition="Describes the measurement repetition time. This is not\nnecessarily the same as the update\nperiod." ) - protected Timing measurementPeriod; - - /** - * Describes the calibrations that have been performed or that are required to be performed. - */ - @Child(name = "calibration", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Describes the calibrations that have been performed or that are required to be performed", formalDefinition="Describes the calibrations that have been performed or that are required to be performed." ) - protected List calibration; - - private static final long serialVersionUID = -480554704L; - - /* - * Constructor - */ - public DeviceMetric() { - super(); - } - - /* - * Constructor - */ - public DeviceMetric(CodeableConcept type, Identifier identifier, Enumeration category) { - super(); - this.type = type; - this.identifier = identifier; - this.category = category; - } - - /** - * @return {@link #type} (Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.) - */ - public DeviceMetric setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** +period. + */ + @Child(name = "measurementPeriod", type = {Timing.class}, order=8, min=0, max=1) + @Description(shortDefinition="Describes the measurement repetition time", formalDefinition="Describes the measurement repetition time. This is not\nnecessarily the same as the update\nperiod." ) + protected Timing measurementPeriod; + + /** + * Describes the calibrations that have been performed or that are required to be performed. + */ + @Child(name = "calibration", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Describes the calibrations that have been performed or that are required to be performed", formalDefinition="Describes the calibrations that have been performed or that are required to be performed." ) + protected List calibration; + + private static final long serialVersionUID = -480554704L; + + /* + * Constructor + */ + public DeviceMetric() { + super(); + } + + /* + * Constructor + */ + public DeviceMetric(CodeableConcept type, Identifier identifier, Enumeration category) { + super(); + this.type = type; + this.identifier = identifier; + this.category = category; + } + + /** + * @return {@link #type} (Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.) + */ + public DeviceMetric setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** * @return {@link #identifier} (Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. -It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** +It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** * @param value {@link #identifier} (Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. -It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device.) - */ - public DeviceMetric setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #unit} (Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.) - */ - public CodeableConcept getUnit() { - if (this.unit == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.unit"); - else if (Configuration.doAutoCreate()) - this.unit = new CodeableConcept(); // cc - return this.unit; - } - - public boolean hasUnit() { - return this.unit != null && !this.unit.isEmpty(); - } - - /** - * @param value {@link #unit} (Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.) - */ - public DeviceMetric setUnit(CodeableConcept value) { - this.unit = value; - return this; - } - - /** - * @return {@link #source} (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) - */ - public Reference getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.source"); - else if (Configuration.doAutoCreate()) - this.source = new Reference(); // cc - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) - */ - public DeviceMetric setSource(Reference value) { - this.source = value; - return this; - } - - /** - * @return {@link #source} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) - */ - public Device getSourceTarget() { - if (this.sourceTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.source"); - else if (Configuration.doAutoCreate()) - this.sourceTarget = new Device(); // aa - return this.sourceTarget; - } - - /** - * @param value {@link #source} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) - */ - public DeviceMetric setSourceTarget(Device value) { - this.sourceTarget = value; - return this; - } - - /** +It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device.) + */ + public DeviceMetric setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #unit} (Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.) + */ + public CodeableConcept getUnit() { + if (this.unit == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.unit"); + else if (Configuration.doAutoCreate()) + this.unit = new CodeableConcept(); // cc + return this.unit; + } + + public boolean hasUnit() { + return this.unit != null && !this.unit.isEmpty(); + } + + /** + * @param value {@link #unit} (Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.) + */ + public DeviceMetric setUnit(CodeableConcept value) { + this.unit = value; + return this; + } + + /** + * @return {@link #source} (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) + */ + public Reference getSource() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.source"); + else if (Configuration.doAutoCreate()) + this.source = new Reference(); // cc + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) + */ + public DeviceMetric setSource(Reference value) { + this.source = value; + return this; + } + + /** + * @return {@link #source} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) + */ + public Device getSourceTarget() { + if (this.sourceTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.source"); + else if (Configuration.doAutoCreate()) + this.sourceTarget = new Device(); // aa + return this.sourceTarget; + } + + /** + * @param value {@link #source} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) + */ + public DeviceMetric setSourceTarget(Device value) { + this.sourceTarget = value; + return this; + } + + /** * @return {@link #parent} (Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. -An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) - */ - public Reference getParent() { - if (this.parent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.parent"); - else if (Configuration.doAutoCreate()) - this.parent = new Reference(); // cc - return this.parent; - } - - public boolean hasParent() { - return this.parent != null && !this.parent.isEmpty(); - } - - /** +An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) + */ + public Reference getParent() { + if (this.parent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.parent"); + else if (Configuration.doAutoCreate()) + this.parent = new Reference(); // cc + return this.parent; + } + + public boolean hasParent() { + return this.parent != null && !this.parent.isEmpty(); + } + + /** * @param value {@link #parent} (Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. -An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) - */ - public DeviceMetric setParent(Reference value) { - this.parent = value; - return this; - } - - /** +An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) + */ + public DeviceMetric setParent(Reference value) { + this.parent = value; + return this; + } + + /** * @return {@link #parent} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. -An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) - */ - public DeviceComponent getParentTarget() { - if (this.parentTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.parent"); - else if (Configuration.doAutoCreate()) - this.parentTarget = new DeviceComponent(); // aa - return this.parentTarget; - } - - /** +An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) + */ + public DeviceComponent getParentTarget() { + if (this.parentTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.parent"); + else if (Configuration.doAutoCreate()) + this.parentTarget = new DeviceComponent(); // aa + return this.parentTarget; + } + + /** * @param value {@link #parent} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. -An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) - */ - public DeviceMetric setParentTarget(DeviceComponent value) { - this.parentTarget = value; - return this; - } - - /** - * @return {@link #operationalStatus} (Indicates current operational state of the device. For example: On, Off, Standby, etc.). This is the underlying object with id, value and extensions. The accessor "getOperationalStatus" gives direct access to the value - */ - public Enumeration getOperationalStatusElement() { - if (this.operationalStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.operationalStatus"); - else if (Configuration.doAutoCreate()) - this.operationalStatus = new Enumeration(new MetricOperationalStatusEnumFactory()); // bb - return this.operationalStatus; - } - - public boolean hasOperationalStatusElement() { - return this.operationalStatus != null && !this.operationalStatus.isEmpty(); - } - - public boolean hasOperationalStatus() { - return this.operationalStatus != null && !this.operationalStatus.isEmpty(); - } - - /** - * @param value {@link #operationalStatus} (Indicates current operational state of the device. For example: On, Off, Standby, etc.). This is the underlying object with id, value and extensions. The accessor "getOperationalStatus" gives direct access to the value - */ - public DeviceMetric setOperationalStatusElement(Enumeration value) { - this.operationalStatus = value; - return this; - } - - /** - * @return Indicates current operational state of the device. For example: On, Off, Standby, etc. - */ - public MetricOperationalStatus getOperationalStatus() { - return this.operationalStatus == null ? null : this.operationalStatus.getValue(); - } - - /** - * @param value Indicates current operational state of the device. For example: On, Off, Standby, etc. - */ - public DeviceMetric setOperationalStatus(MetricOperationalStatus value) { - if (value == null) - this.operationalStatus = null; - else { - if (this.operationalStatus == null) - this.operationalStatus = new Enumeration(new MetricOperationalStatusEnumFactory()); - this.operationalStatus.setValue(value); - } - return this; - } - - /** - * @return {@link #color} (Describes the typical color of the representation of observations that have been generated for this DeviceMetric.). This is the underlying object with id, value and extensions. The accessor "getColor" gives direct access to the value - */ - public Enumeration getColorElement() { - if (this.color == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.color"); - else if (Configuration.doAutoCreate()) - this.color = new Enumeration(new MetricColorEnumFactory()); // bb - return this.color; - } - - public boolean hasColorElement() { - return this.color != null && !this.color.isEmpty(); - } - - public boolean hasColor() { - return this.color != null && !this.color.isEmpty(); - } - - /** - * @param value {@link #color} (Describes the typical color of the representation of observations that have been generated for this DeviceMetric.). This is the underlying object with id, value and extensions. The accessor "getColor" gives direct access to the value - */ - public DeviceMetric setColorElement(Enumeration value) { - this.color = value; - return this; - } - - /** - * @return Describes the typical color of the representation of observations that have been generated for this DeviceMetric. - */ - public MetricColor getColor() { - return this.color == null ? null : this.color.getValue(); - } - - /** - * @param value Describes the typical color of the representation of observations that have been generated for this DeviceMetric. - */ - public DeviceMetric setColor(MetricColor value) { - if (value == null) - this.color = null; - else { - if (this.color == null) - this.color = new Enumeration(new MetricColorEnumFactory()); - this.color.setValue(value); - } - return this; - } - - /** - * @return {@link #category} (Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public Enumeration getCategoryElement() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.category"); - else if (Configuration.doAutoCreate()) - this.category = new Enumeration(new MetricCategoryEnumFactory()); // bb - return this.category; - } - - public boolean hasCategoryElement() { - return this.category != null && !this.category.isEmpty(); - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public DeviceMetric setCategoryElement(Enumeration value) { - this.category = value; - return this; - } - - /** - * @return Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation. - */ - public MetricCategory getCategory() { - return this.category == null ? null : this.category.getValue(); - } - - /** - * @param value Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation. - */ - public DeviceMetric setCategory(MetricCategory value) { - if (this.category == null) - this.category = new Enumeration(new MetricCategoryEnumFactory()); - this.category.setValue(value); - return this; - } - - /** +An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) + */ + public DeviceMetric setParentTarget(DeviceComponent value) { + this.parentTarget = value; + return this; + } + + /** + * @return {@link #operationalStatus} (Indicates current operational state of the device. For example: On, Off, Standby, etc.). This is the underlying object with id, value and extensions. The accessor "getOperationalStatus" gives direct access to the value + */ + public Enumeration getOperationalStatusElement() { + if (this.operationalStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.operationalStatus"); + else if (Configuration.doAutoCreate()) + this.operationalStatus = new Enumeration(new MetricOperationalStatusEnumFactory()); // bb + return this.operationalStatus; + } + + public boolean hasOperationalStatusElement() { + return this.operationalStatus != null && !this.operationalStatus.isEmpty(); + } + + public boolean hasOperationalStatus() { + return this.operationalStatus != null && !this.operationalStatus.isEmpty(); + } + + /** + * @param value {@link #operationalStatus} (Indicates current operational state of the device. For example: On, Off, Standby, etc.). This is the underlying object with id, value and extensions. The accessor "getOperationalStatus" gives direct access to the value + */ + public DeviceMetric setOperationalStatusElement(Enumeration value) { + this.operationalStatus = value; + return this; + } + + /** + * @return Indicates current operational state of the device. For example: On, Off, Standby, etc. + */ + public MetricOperationalStatus getOperationalStatus() { + return this.operationalStatus == null ? null : this.operationalStatus.getValue(); + } + + /** + * @param value Indicates current operational state of the device. For example: On, Off, Standby, etc. + */ + public DeviceMetric setOperationalStatus(MetricOperationalStatus value) { + if (value == null) + this.operationalStatus = null; + else { + if (this.operationalStatus == null) + this.operationalStatus = new Enumeration(new MetricOperationalStatusEnumFactory()); + this.operationalStatus.setValue(value); + } + return this; + } + + /** + * @return {@link #color} (Describes the typical color of the representation of observations that have been generated for this DeviceMetric.). This is the underlying object with id, value and extensions. The accessor "getColor" gives direct access to the value + */ + public Enumeration getColorElement() { + if (this.color == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.color"); + else if (Configuration.doAutoCreate()) + this.color = new Enumeration(new MetricColorEnumFactory()); // bb + return this.color; + } + + public boolean hasColorElement() { + return this.color != null && !this.color.isEmpty(); + } + + public boolean hasColor() { + return this.color != null && !this.color.isEmpty(); + } + + /** + * @param value {@link #color} (Describes the typical color of the representation of observations that have been generated for this DeviceMetric.). This is the underlying object with id, value and extensions. The accessor "getColor" gives direct access to the value + */ + public DeviceMetric setColorElement(Enumeration value) { + this.color = value; + return this; + } + + /** + * @return Describes the typical color of the representation of observations that have been generated for this DeviceMetric. + */ + public MetricColor getColor() { + return this.color == null ? null : this.color.getValue(); + } + + /** + * @param value Describes the typical color of the representation of observations that have been generated for this DeviceMetric. + */ + public DeviceMetric setColor(MetricColor value) { + if (value == null) + this.color = null; + else { + if (this.color == null) + this.color = new Enumeration(new MetricColorEnumFactory()); + this.color.setValue(value); + } + return this; + } + + /** + * @return {@link #category} (Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public Enumeration getCategoryElement() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.category"); + else if (Configuration.doAutoCreate()) + this.category = new Enumeration(new MetricCategoryEnumFactory()); // bb + return this.category; + } + + public boolean hasCategoryElement() { + return this.category != null && !this.category.isEmpty(); + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public DeviceMetric setCategoryElement(Enumeration value) { + this.category = value; + return this; + } + + /** + * @return Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation. + */ + public MetricCategory getCategory() { + return this.category == null ? null : this.category.getValue(); + } + + /** + * @param value Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation. + */ + public DeviceMetric setCategory(MetricCategory value) { + if (this.category == null) + this.category = new Enumeration(new MetricCategoryEnumFactory()); + this.category.setValue(value); + return this; + } + + /** * @return {@link #measurementPeriod} (Describes the measurement repetition time. This is not necessarily the same as the update -period.) - */ - public Timing getMeasurementPeriod() { - if (this.measurementPeriod == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.measurementPeriod"); - else if (Configuration.doAutoCreate()) - this.measurementPeriod = new Timing(); // cc - return this.measurementPeriod; - } - - public boolean hasMeasurementPeriod() { - return this.measurementPeriod != null && !this.measurementPeriod.isEmpty(); - } - - /** +period.) + */ + public Timing getMeasurementPeriod() { + if (this.measurementPeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.measurementPeriod"); + else if (Configuration.doAutoCreate()) + this.measurementPeriod = new Timing(); // cc + return this.measurementPeriod; + } + + public boolean hasMeasurementPeriod() { + return this.measurementPeriod != null && !this.measurementPeriod.isEmpty(); + } + + /** * @param value {@link #measurementPeriod} (Describes the measurement repetition time. This is not necessarily the same as the update -period.) - */ - public DeviceMetric setMeasurementPeriod(Timing value) { - this.measurementPeriod = value; - return this; - } - - /** - * @return {@link #calibration} (Describes the calibrations that have been performed or that are required to be performed.) - */ - public List getCalibration() { - if (this.calibration == null) - this.calibration = new ArrayList(); - return this.calibration; - } - - public boolean hasCalibration() { - if (this.calibration == null) - return false; - for (DeviceMetricCalibrationComponent item : this.calibration) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #calibration} (Describes the calibrations that have been performed or that are required to be performed.) - */ - // syntactic sugar - public DeviceMetricCalibrationComponent addCalibration() { //3 - DeviceMetricCalibrationComponent t = new DeviceMetricCalibrationComponent(); - if (this.calibration == null) - this.calibration = new ArrayList(); - this.calibration.add(t); - return t; - } - - // syntactic sugar - public DeviceMetric addCalibration(DeviceMetricCalibrationComponent t) { //3 - if (t == null) - return this; - if (this.calibration == null) - this.calibration = new ArrayList(); - this.calibration.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("identifier", "Identifier", "Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. \nIt should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("unit", "CodeableConcept", "Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.", 0, java.lang.Integer.MAX_VALUE, unit)); - childrenList.add(new Property("source", "Reference(Device)", "Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("parent", "Reference(DeviceComponent)", "Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device.\nAn example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.", 0, java.lang.Integer.MAX_VALUE, parent)); - childrenList.add(new Property("operationalStatus", "code", "Indicates current operational state of the device. For example: On, Off, Standby, etc.", 0, java.lang.Integer.MAX_VALUE, operationalStatus)); - childrenList.add(new Property("color", "code", "Describes the typical color of the representation of observations that have been generated for this DeviceMetric.", 0, java.lang.Integer.MAX_VALUE, color)); - childrenList.add(new Property("category", "code", "Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("measurementPeriod", "Timing", "Describes the measurement repetition time. This is not\nnecessarily the same as the update\nperiod.", 0, java.lang.Integer.MAX_VALUE, measurementPeriod)); - childrenList.add(new Property("calibration", "", "Describes the calibrations that have been performed or that are required to be performed.", 0, java.lang.Integer.MAX_VALUE, calibration)); - } - - public DeviceMetric copy() { - DeviceMetric dst = new DeviceMetric(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.unit = unit == null ? null : unit.copy(); - dst.source = source == null ? null : source.copy(); - dst.parent = parent == null ? null : parent.copy(); - dst.operationalStatus = operationalStatus == null ? null : operationalStatus.copy(); - dst.color = color == null ? null : color.copy(); - dst.category = category == null ? null : category.copy(); - dst.measurementPeriod = measurementPeriod == null ? null : measurementPeriod.copy(); - if (calibration != null) { - dst.calibration = new ArrayList(); - for (DeviceMetricCalibrationComponent i : calibration) - dst.calibration.add(i.copy()); - }; - return dst; - } - - protected DeviceMetric typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DeviceMetric)) - return false; - DeviceMetric o = (DeviceMetric) other; - return compareDeep(type, o.type, true) && compareDeep(identifier, o.identifier, true) && compareDeep(unit, o.unit, true) - && compareDeep(source, o.source, true) && compareDeep(parent, o.parent, true) && compareDeep(operationalStatus, o.operationalStatus, true) - && compareDeep(color, o.color, true) && compareDeep(category, o.category, true) && compareDeep(measurementPeriod, o.measurementPeriod, true) - && compareDeep(calibration, o.calibration, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DeviceMetric)) - return false; - DeviceMetric o = (DeviceMetric) other; - return compareValues(operationalStatus, o.operationalStatus, true) && compareValues(color, o.color, true) - && compareValues(category, o.category, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (unit == null || unit.isEmpty()) && (source == null || source.isEmpty()) && (parent == null || parent.isEmpty()) - && (operationalStatus == null || operationalStatus.isEmpty()) && (color == null || color.isEmpty()) - && (category == null || category.isEmpty()) && (measurementPeriod == null || measurementPeriod.isEmpty()) - && (calibration == null || calibration.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DeviceMetric; - } - - @SearchParamDefinition(name="category", path="DeviceMetric.category", description="The category of the metric", type="token" ) - public static final String SP_CATEGORY = "category"; - @SearchParamDefinition(name="source", path="DeviceMetric.source", description="The device resource", type="reference" ) - public static final String SP_SOURCE = "source"; - @SearchParamDefinition(name="parent", path="DeviceMetric.parent", description="The parent DeviceMetric resource", type="reference" ) - public static final String SP_PARENT = "parent"; - @SearchParamDefinition(name="type", path="DeviceMetric.type", description="The component type", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="identifier", path="DeviceMetric.identifier", description="The identifier of the metric", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +period.) + */ + public DeviceMetric setMeasurementPeriod(Timing value) { + this.measurementPeriod = value; + return this; + } + + /** + * @return {@link #calibration} (Describes the calibrations that have been performed or that are required to be performed.) + */ + public List getCalibration() { + if (this.calibration == null) + this.calibration = new ArrayList(); + return this.calibration; + } + + public boolean hasCalibration() { + if (this.calibration == null) + return false; + for (DeviceMetricCalibrationComponent item : this.calibration) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #calibration} (Describes the calibrations that have been performed or that are required to be performed.) + */ + // syntactic sugar + public DeviceMetricCalibrationComponent addCalibration() { //3 + DeviceMetricCalibrationComponent t = new DeviceMetricCalibrationComponent(); + if (this.calibration == null) + this.calibration = new ArrayList(); + this.calibration.add(t); + return t; + } + + // syntactic sugar + public DeviceMetric addCalibration(DeviceMetricCalibrationComponent t) { //3 + if (t == null) + return this; + if (this.calibration == null) + this.calibration = new ArrayList(); + this.calibration.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("identifier", "Identifier", "Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. \nIt should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("unit", "CodeableConcept", "Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.", 0, java.lang.Integer.MAX_VALUE, unit)); + childrenList.add(new Property("source", "Reference(Device)", "Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("parent", "Reference(DeviceComponent)", "Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device.\nAn example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.", 0, java.lang.Integer.MAX_VALUE, parent)); + childrenList.add(new Property("operationalStatus", "code", "Indicates current operational state of the device. For example: On, Off, Standby, etc.", 0, java.lang.Integer.MAX_VALUE, operationalStatus)); + childrenList.add(new Property("color", "code", "Describes the typical color of the representation of observations that have been generated for this DeviceMetric.", 0, java.lang.Integer.MAX_VALUE, color)); + childrenList.add(new Property("category", "code", "Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("measurementPeriod", "Timing", "Describes the measurement repetition time. This is not\nnecessarily the same as the update\nperiod.", 0, java.lang.Integer.MAX_VALUE, measurementPeriod)); + childrenList.add(new Property("calibration", "", "Describes the calibrations that have been performed or that are required to be performed.", 0, java.lang.Integer.MAX_VALUE, calibration)); + } + + public DeviceMetric copy() { + DeviceMetric dst = new DeviceMetric(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.unit = unit == null ? null : unit.copy(); + dst.source = source == null ? null : source.copy(); + dst.parent = parent == null ? null : parent.copy(); + dst.operationalStatus = operationalStatus == null ? null : operationalStatus.copy(); + dst.color = color == null ? null : color.copy(); + dst.category = category == null ? null : category.copy(); + dst.measurementPeriod = measurementPeriod == null ? null : measurementPeriod.copy(); + if (calibration != null) { + dst.calibration = new ArrayList(); + for (DeviceMetricCalibrationComponent i : calibration) + dst.calibration.add(i.copy()); + }; + return dst; + } + + protected DeviceMetric typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DeviceMetric)) + return false; + DeviceMetric o = (DeviceMetric) other; + return compareDeep(type, o.type, true) && compareDeep(identifier, o.identifier, true) && compareDeep(unit, o.unit, true) + && compareDeep(source, o.source, true) && compareDeep(parent, o.parent, true) && compareDeep(operationalStatus, o.operationalStatus, true) + && compareDeep(color, o.color, true) && compareDeep(category, o.category, true) && compareDeep(measurementPeriod, o.measurementPeriod, true) + && compareDeep(calibration, o.calibration, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DeviceMetric)) + return false; + DeviceMetric o = (DeviceMetric) other; + return compareValues(operationalStatus, o.operationalStatus, true) && compareValues(color, o.color, true) + && compareValues(category, o.category, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (unit == null || unit.isEmpty()) && (source == null || source.isEmpty()) && (parent == null || parent.isEmpty()) + && (operationalStatus == null || operationalStatus.isEmpty()) && (color == null || color.isEmpty()) + && (category == null || category.isEmpty()) && (measurementPeriod == null || measurementPeriod.isEmpty()) + && (calibration == null || calibration.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DeviceMetric; + } + + @SearchParamDefinition(name="parent", path="DeviceMetric.parent", description="The parent DeviceMetric resource", type="reference" ) + public static final String SP_PARENT = "parent"; + @SearchParamDefinition(name="identifier", path="DeviceMetric.identifier", description="The identifier of the metric", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="source", path="DeviceMetric.source", description="The device resource", type="reference" ) + public static final String SP_SOURCE = "source"; + @SearchParamDefinition(name="type", path="DeviceMetric.type", description="The component type", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="category", path="DeviceMetric.category", description="The category of the metric", type="token" ) + public static final String SP_CATEGORY = "category"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DeviceUseRequest.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DeviceUseRequest.java index 853cd653c10..8432004b650 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DeviceUseRequest.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DeviceUseRequest.java @@ -1,1166 +1,1145 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker. - */ -@ResourceDef(name="DeviceUseRequest", profile="http://hl7.org/fhir/Profile/DeviceUseRequest") -public class DeviceUseRequest extends DomainResource { - - public enum DeviceUseRequestStatus { - /** - * The request has been proposed. - */ - PROPOSED, - /** - * The request has been planned. - */ - PLANNED, - /** - * The request has been placed. - */ - REQUESTED, - /** - * The receiving system has received the request but not yet decided whether it will be performed. - */ - RECEIVED, - /** - * The receiving system has accepted the request but work has not yet commenced. - */ - ACCEPTED, - /** - * The work to fulfill the order is happening. - */ - INPROGRESS, - /** - * The work has been complete, the report(s) released, and no further work is planned. - */ - COMPLETED, - /** - * The request has been held by originating system/user request. - */ - SUSPENDED, - /** - * The receiving system has declined to fulfill the request. - */ - REJECTED, - /** - * The request was attempted, but due to some procedural error, it could not be completed. - */ - ABORTED, - /** - * added to help the parsers - */ - NULL; - public static DeviceUseRequestStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("planned".equals(codeString)) - return PLANNED; - if ("requested".equals(codeString)) - return REQUESTED; - if ("received".equals(codeString)) - return RECEIVED; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("completed".equals(codeString)) - return COMPLETED; - if ("suspended".equals(codeString)) - return SUSPENDED; - if ("rejected".equals(codeString)) - return REJECTED; - if ("aborted".equals(codeString)) - return ABORTED; - throw new Exception("Unknown DeviceUseRequestStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PROPOSED: return "proposed"; - case PLANNED: return "planned"; - case REQUESTED: return "requested"; - case RECEIVED: return "received"; - case ACCEPTED: return "accepted"; - case INPROGRESS: return "in-progress"; - case COMPLETED: return "completed"; - case SUSPENDED: return "suspended"; - case REJECTED: return "rejected"; - case ABORTED: return "aborted"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PROPOSED: return ""; - case PLANNED: return ""; - case REQUESTED: return ""; - case RECEIVED: return ""; - case ACCEPTED: return ""; - case INPROGRESS: return ""; - case COMPLETED: return ""; - case SUSPENDED: return ""; - case REJECTED: return ""; - case ABORTED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PROPOSED: return "The request has been proposed."; - case PLANNED: return "The request has been planned."; - case REQUESTED: return "The request has been placed."; - case RECEIVED: return "The receiving system has received the request but not yet decided whether it will be performed."; - case ACCEPTED: return "The receiving system has accepted the request but work has not yet commenced."; - case INPROGRESS: return "The work to fulfill the order is happening."; - case COMPLETED: return "The work has been complete, the report(s) released, and no further work is planned."; - case SUSPENDED: return "The request has been held by originating system/user request."; - case REJECTED: return "The receiving system has declined to fulfill the request."; - case ABORTED: return "The request was attempted, but due to some procedural error, it could not be completed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PROPOSED: return "Proposed"; - case PLANNED: return "Planned"; - case REQUESTED: return "Requested"; - case RECEIVED: return "Received"; - case ACCEPTED: return "Accepted"; - case INPROGRESS: return "In Progress"; - case COMPLETED: return "Completed"; - case SUSPENDED: return "Suspended"; - case REJECTED: return "Rejected"; - case ABORTED: return "Aborted"; - default: return "?"; - } - } - } - - public static class DeviceUseRequestStatusEnumFactory implements EnumFactory { - public DeviceUseRequestStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return DeviceUseRequestStatus.PROPOSED; - if ("planned".equals(codeString)) - return DeviceUseRequestStatus.PLANNED; - if ("requested".equals(codeString)) - return DeviceUseRequestStatus.REQUESTED; - if ("received".equals(codeString)) - return DeviceUseRequestStatus.RECEIVED; - if ("accepted".equals(codeString)) - return DeviceUseRequestStatus.ACCEPTED; - if ("in-progress".equals(codeString)) - return DeviceUseRequestStatus.INPROGRESS; - if ("completed".equals(codeString)) - return DeviceUseRequestStatus.COMPLETED; - if ("suspended".equals(codeString)) - return DeviceUseRequestStatus.SUSPENDED; - if ("rejected".equals(codeString)) - return DeviceUseRequestStatus.REJECTED; - if ("aborted".equals(codeString)) - return DeviceUseRequestStatus.ABORTED; - throw new IllegalArgumentException("Unknown DeviceUseRequestStatus code '"+codeString+"'"); - } - public String toCode(DeviceUseRequestStatus code) { - if (code == DeviceUseRequestStatus.PROPOSED) - return "proposed"; - if (code == DeviceUseRequestStatus.PLANNED) - return "planned"; - if (code == DeviceUseRequestStatus.REQUESTED) - return "requested"; - if (code == DeviceUseRequestStatus.RECEIVED) - return "received"; - if (code == DeviceUseRequestStatus.ACCEPTED) - return "accepted"; - if (code == DeviceUseRequestStatus.INPROGRESS) - return "in-progress"; - if (code == DeviceUseRequestStatus.COMPLETED) - return "completed"; - if (code == DeviceUseRequestStatus.SUSPENDED) - return "suspended"; - if (code == DeviceUseRequestStatus.REJECTED) - return "rejected"; - if (code == DeviceUseRequestStatus.ABORTED) - return "aborted"; - return "?"; - } - } - - public enum DeviceUseRequestPriority { - /** - * The request has a normal priority. - */ - ROUTINE, - /** - * The request should be done urgently. - */ - URGENT, - /** - * The request is time-critical. - */ - STAT, - /** - * The request should be acted on as soon as possible. - */ - ASAP, - /** - * added to help the parsers - */ - NULL; - public static DeviceUseRequestPriority fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("routine".equals(codeString)) - return ROUTINE; - if ("urgent".equals(codeString)) - return URGENT; - if ("stat".equals(codeString)) - return STAT; - if ("asap".equals(codeString)) - return ASAP; - throw new Exception("Unknown DeviceUseRequestPriority code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ROUTINE: return "routine"; - case URGENT: return "urgent"; - case STAT: return "stat"; - case ASAP: return "asap"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ROUTINE: return ""; - case URGENT: return ""; - case STAT: return ""; - case ASAP: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ROUTINE: return "The request has a normal priority."; - case URGENT: return "The request should be done urgently."; - case STAT: return "The request is time-critical."; - case ASAP: return "The request should be acted on as soon as possible."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ROUTINE: return "Routine"; - case URGENT: return "Urgent"; - case STAT: return "Stat"; - case ASAP: return "Asap"; - default: return "?"; - } - } - } - - public static class DeviceUseRequestPriorityEnumFactory implements EnumFactory { - public DeviceUseRequestPriority fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("routine".equals(codeString)) - return DeviceUseRequestPriority.ROUTINE; - if ("urgent".equals(codeString)) - return DeviceUseRequestPriority.URGENT; - if ("stat".equals(codeString)) - return DeviceUseRequestPriority.STAT; - if ("asap".equals(codeString)) - return DeviceUseRequestPriority.ASAP; - throw new IllegalArgumentException("Unknown DeviceUseRequestPriority code '"+codeString+"'"); - } - public String toCode(DeviceUseRequestPriority code) { - if (code == DeviceUseRequestPriority.ROUTINE) - return "routine"; - if (code == DeviceUseRequestPriority.URGENT) - return "urgent"; - if (code == DeviceUseRequestPriority.STAT) - return "stat"; - if (code == DeviceUseRequestPriority.ASAP) - return "asap"; - return "?"; - } - } - - /** - * Indicates the site on the subject's body where the device should be used ( i.e. the target site). - */ - @Child(name = "bodySite", type = {CodeableConcept.class, BodySite.class}, order=0, min=0, max=1) - @Description(shortDefinition="Target body site", formalDefinition="Indicates the site on the subject's body where the device should be used ( i.e. the target site)." ) - protected Type bodySite; - - /** - * The status of the request. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="proposed | planned | requested | received | accepted | in-progress | completed | suspended | rejected | aborted", formalDefinition="The status of the request." ) - protected Enumeration status; - - /** - * The details of the device to be used. - */ - @Child(name = "device", type = {Device.class}, order=2, min=1, max=1) - @Description(shortDefinition="Device requested", formalDefinition="The details of the device to be used." ) - protected Reference device; - - /** - * The actual object that is the target of the reference (The details of the device to be used.) - */ - protected Device deviceTarget; - - /** - * An encounter that provides additional context in which this request is made. - */ - @Child(name = "encounter", type = {Encounter.class}, order=3, min=0, max=1) - @Description(shortDefinition="Encounter motivating request", formalDefinition="An encounter that provides additional context in which this request is made." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (An encounter that provides additional context in which this request is made.) - */ - protected Encounter encounterTarget; - - /** - * Identifiers assigned to this order by the orderer or by the receiver. - */ - @Child(name = "identifier", type = {Identifier.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Request identifier", formalDefinition="Identifiers assigned to this order by the orderer or by the receiver." ) - protected List identifier; - - /** - * Reason or justification for the use of this device. - */ - @Child(name = "indication", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Reason for request", formalDefinition="Reason or justification for the use of this device." ) - protected List indication; - - /** - * Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement. - */ - @Child(name = "notes", type = {StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Notes or comments", formalDefinition="Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement." ) - protected List notes; - - /** - * The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%. - */ - @Child(name = "prnReason", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="PRN", formalDefinition="The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%." ) - protected List prnReason; - - /** - * The time when the request was made. - */ - @Child(name = "orderedOn", type = {DateTimeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="When ordered", formalDefinition="The time when the request was made." ) - protected DateTimeType orderedOn; - - /** - * The time at which the request was made/recorded. - */ - @Child(name = "recordedOn", type = {DateTimeType.class}, order=9, min=0, max=1) - @Description(shortDefinition="When recorded", formalDefinition="The time at which the request was made/recorded." ) - protected DateTimeType recordedOn; - - /** - * The patient who will use the device. - */ - @Child(name = "subject", type = {Patient.class}, order=10, min=1, max=1) - @Description(shortDefinition="Focus of request", formalDefinition="The patient who will use the device." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient who will use the device.) - */ - protected Patient subjectTarget; - - /** - * The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". - */ - @Child(name = "timing", type = {Timing.class, Period.class, DateTimeType.class}, order=11, min=0, max=1) - @Description(shortDefinition="Schedule for use", formalDefinition="The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'." ) - protected Type timing; - - /** - * Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine. - */ - @Child(name = "priority", type = {CodeType.class}, order=12, min=0, max=1) - @Description(shortDefinition="routine | urgent | stat | asap", formalDefinition="Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine." ) - protected Enumeration priority; - - private static final long serialVersionUID = 1208477058L; - - /* - * Constructor - */ - public DeviceUseRequest() { - super(); - } - - /* - * Constructor - */ - public DeviceUseRequest(Reference device, Reference subject) { - super(); - this.device = device; - this.subject = subject; - } - - /** - * @return {@link #bodySite} (Indicates the site on the subject's body where the device should be used ( i.e. the target site).) - */ - public Type getBodySite() { - return this.bodySite; - } - - /** - * @return {@link #bodySite} (Indicates the site on the subject's body where the device should be used ( i.e. the target site).) - */ - public CodeableConcept getBodySiteCodeableConcept() throws Exception { - if (!(this.bodySite instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.bodySite.getClass().getName()+" was encountered"); - return (CodeableConcept) this.bodySite; - } - - /** - * @return {@link #bodySite} (Indicates the site on the subject's body where the device should be used ( i.e. the target site).) - */ - public Reference getBodySiteReference() throws Exception { - if (!(this.bodySite instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.bodySite.getClass().getName()+" was encountered"); - return (Reference) this.bodySite; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Indicates the site on the subject's body where the device should be used ( i.e. the target site).) - */ - public DeviceUseRequest setBodySite(Type value) { - this.bodySite = value; - return this; - } - - /** - * @return {@link #status} (The status of the request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new DeviceUseRequestStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DeviceUseRequest setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the request. - */ - public DeviceUseRequestStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the request. - */ - public DeviceUseRequest setStatus(DeviceUseRequestStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new DeviceUseRequestStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #device} (The details of the device to be used.) - */ - public Reference getDevice() { - if (this.device == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.device"); - else if (Configuration.doAutoCreate()) - this.device = new Reference(); // cc - return this.device; - } - - public boolean hasDevice() { - return this.device != null && !this.device.isEmpty(); - } - - /** - * @param value {@link #device} (The details of the device to be used.) - */ - public DeviceUseRequest setDevice(Reference value) { - this.device = value; - return this; - } - - /** - * @return {@link #device} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The details of the device to be used.) - */ - public Device getDeviceTarget() { - if (this.deviceTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.device"); - else if (Configuration.doAutoCreate()) - this.deviceTarget = new Device(); // aa - return this.deviceTarget; - } - - /** - * @param value {@link #device} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The details of the device to be used.) - */ - public DeviceUseRequest setDeviceTarget(Device value) { - this.deviceTarget = value; - return this; - } - - /** - * @return {@link #encounter} (An encounter that provides additional context in which this request is made.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (An encounter that provides additional context in which this request is made.) - */ - public DeviceUseRequest setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An encounter that provides additional context in which this request is made.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An encounter that provides additional context in which this request is made.) - */ - public DeviceUseRequest setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the orderer or by the receiver.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the orderer or by the receiver.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public DeviceUseRequest addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #indication} (Reason or justification for the use of this device.) - */ - public List getIndication() { - if (this.indication == null) - this.indication = new ArrayList(); - return this.indication; - } - - public boolean hasIndication() { - if (this.indication == null) - return false; - for (CodeableConcept item : this.indication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #indication} (Reason or justification for the use of this device.) - */ - // syntactic sugar - public CodeableConcept addIndication() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.indication == null) - this.indication = new ArrayList(); - this.indication.add(t); - return t; - } - - // syntactic sugar - public DeviceUseRequest addIndication(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.indication == null) - this.indication = new ArrayList(); - this.indication.add(t); - return this; - } - - /** - * @return {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - public List getNotes() { - if (this.notes == null) - this.notes = new ArrayList(); - return this.notes; - } - - public boolean hasNotes() { - if (this.notes == null) - return false; - for (StringType item : this.notes) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - // syntactic sugar - public StringType addNotesElement() {//2 - StringType t = new StringType(); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return t; - } - - /** - * @param value {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - public DeviceUseRequest addNotes(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return this; - } - - /** - * @param value {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - public boolean hasNotes(String value) { - if (this.notes == null) - return false; - for (StringType v : this.notes) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #prnReason} (The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%.) - */ - public List getPrnReason() { - if (this.prnReason == null) - this.prnReason = new ArrayList(); - return this.prnReason; - } - - public boolean hasPrnReason() { - if (this.prnReason == null) - return false; - for (CodeableConcept item : this.prnReason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #prnReason} (The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%.) - */ - // syntactic sugar - public CodeableConcept addPrnReason() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.prnReason == null) - this.prnReason = new ArrayList(); - this.prnReason.add(t); - return t; - } - - // syntactic sugar - public DeviceUseRequest addPrnReason(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.prnReason == null) - this.prnReason = new ArrayList(); - this.prnReason.add(t); - return this; - } - - /** - * @return {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value - */ - public DateTimeType getOrderedOnElement() { - if (this.orderedOn == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.orderedOn"); - else if (Configuration.doAutoCreate()) - this.orderedOn = new DateTimeType(); // bb - return this.orderedOn; - } - - public boolean hasOrderedOnElement() { - return this.orderedOn != null && !this.orderedOn.isEmpty(); - } - - public boolean hasOrderedOn() { - return this.orderedOn != null && !this.orderedOn.isEmpty(); - } - - /** - * @param value {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value - */ - public DeviceUseRequest setOrderedOnElement(DateTimeType value) { - this.orderedOn = value; - return this; - } - - /** - * @return The time when the request was made. - */ - public Date getOrderedOn() { - return this.orderedOn == null ? null : this.orderedOn.getValue(); - } - - /** - * @param value The time when the request was made. - */ - public DeviceUseRequest setOrderedOn(Date value) { - if (value == null) - this.orderedOn = null; - else { - if (this.orderedOn == null) - this.orderedOn = new DateTimeType(); - this.orderedOn.setValue(value); - } - return this; - } - - /** - * @return {@link #recordedOn} (The time at which the request was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value - */ - public DateTimeType getRecordedOnElement() { - if (this.recordedOn == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.recordedOn"); - else if (Configuration.doAutoCreate()) - this.recordedOn = new DateTimeType(); // bb - return this.recordedOn; - } - - public boolean hasRecordedOnElement() { - return this.recordedOn != null && !this.recordedOn.isEmpty(); - } - - public boolean hasRecordedOn() { - return this.recordedOn != null && !this.recordedOn.isEmpty(); - } - - /** - * @param value {@link #recordedOn} (The time at which the request was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value - */ - public DeviceUseRequest setRecordedOnElement(DateTimeType value) { - this.recordedOn = value; - return this; - } - - /** - * @return The time at which the request was made/recorded. - */ - public Date getRecordedOn() { - return this.recordedOn == null ? null : this.recordedOn.getValue(); - } - - /** - * @param value The time at which the request was made/recorded. - */ - public DeviceUseRequest setRecordedOn(Date value) { - if (value == null) - this.recordedOn = null; - else { - if (this.recordedOn == null) - this.recordedOn = new DateTimeType(); - this.recordedOn.setValue(value); - } - return this; - } - - /** - * @return {@link #subject} (The patient who will use the device.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (The patient who will use the device.) - */ - public DeviceUseRequest setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who will use the device.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.subject"); - else if (Configuration.doAutoCreate()) - this.subjectTarget = new Patient(); // aa - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who will use the device.) - */ - public DeviceUseRequest setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Type getTiming() { - return this.timing; - } - - /** - * @return {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Timing getTimingTiming() throws Exception { - if (!(this.timing instanceof Timing)) - throw new Exception("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (Timing) this.timing; - } - - /** - * @return {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Period getTimingPeriod() throws Exception { - if (!(this.timing instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (Period) this.timing; - } - - /** - * @return {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public DateTimeType getTimingDateTimeType() throws Exception { - if (!(this.timing instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (DateTimeType) this.timing; - } - - public boolean hasTiming() { - return this.timing != null && !this.timing.isEmpty(); - } - - /** - * @param value {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public DeviceUseRequest setTiming(Type value) { - this.timing = value; - return this; - } - - /** - * @return {@link #priority} (Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public Enumeration getPriorityElement() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new Enumeration(new DeviceUseRequestPriorityEnumFactory()); // bb - return this.priority; - } - - public boolean hasPriorityElement() { - return this.priority != null && !this.priority.isEmpty(); - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public DeviceUseRequest setPriorityElement(Enumeration value) { - this.priority = value; - return this; - } - - /** - * @return Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine. - */ - public DeviceUseRequestPriority getPriority() { - return this.priority == null ? null : this.priority.getValue(); - } - - /** - * @param value Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine. - */ - public DeviceUseRequest setPriority(DeviceUseRequestPriority value) { - if (value == null) - this.priority = null; - else { - if (this.priority == null) - this.priority = new Enumeration(new DeviceUseRequestPriorityEnumFactory()); - this.priority.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("bodySite[x]", "CodeableConcept|Reference(BodySite)", "Indicates the site on the subject's body where the device should be used ( i.e. the target site).", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("status", "code", "The status of the request.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("device", "Reference(Device)", "The details of the device to be used.", 0, java.lang.Integer.MAX_VALUE, device)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional context in which this request is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the orderer or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("indication", "CodeableConcept", "Reason or justification for the use of this device.", 0, java.lang.Integer.MAX_VALUE, indication)); - childrenList.add(new Property("notes", "string", "Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.", 0, java.lang.Integer.MAX_VALUE, notes)); - childrenList.add(new Property("prnReason", "CodeableConcept", "The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%.", 0, java.lang.Integer.MAX_VALUE, prnReason)); - childrenList.add(new Property("orderedOn", "dateTime", "The time when the request was made.", 0, java.lang.Integer.MAX_VALUE, orderedOn)); - childrenList.add(new Property("recordedOn", "dateTime", "The time at which the request was made/recorded.", 0, java.lang.Integer.MAX_VALUE, recordedOn)); - childrenList.add(new Property("subject", "Reference(Patient)", "The patient who will use the device.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("timing[x]", "Timing|Period|dateTime", "The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'.", 0, java.lang.Integer.MAX_VALUE, timing)); - childrenList.add(new Property("priority", "code", "Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine.", 0, java.lang.Integer.MAX_VALUE, priority)); - } - - public DeviceUseRequest copy() { - DeviceUseRequest dst = new DeviceUseRequest(); - copyValues(dst); - dst.bodySite = bodySite == null ? null : bodySite.copy(); - dst.status = status == null ? null : status.copy(); - dst.device = device == null ? null : device.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - if (indication != null) { - dst.indication = new ArrayList(); - for (CodeableConcept i : indication) - dst.indication.add(i.copy()); - }; - if (notes != null) { - dst.notes = new ArrayList(); - for (StringType i : notes) - dst.notes.add(i.copy()); - }; - if (prnReason != null) { - dst.prnReason = new ArrayList(); - for (CodeableConcept i : prnReason) - dst.prnReason.add(i.copy()); - }; - dst.orderedOn = orderedOn == null ? null : orderedOn.copy(); - dst.recordedOn = recordedOn == null ? null : recordedOn.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.timing = timing == null ? null : timing.copy(); - dst.priority = priority == null ? null : priority.copy(); - return dst; - } - - protected DeviceUseRequest typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DeviceUseRequest)) - return false; - DeviceUseRequest o = (DeviceUseRequest) other; - return compareDeep(bodySite, o.bodySite, true) && compareDeep(status, o.status, true) && compareDeep(device, o.device, true) - && compareDeep(encounter, o.encounter, true) && compareDeep(identifier, o.identifier, true) && compareDeep(indication, o.indication, true) - && compareDeep(notes, o.notes, true) && compareDeep(prnReason, o.prnReason, true) && compareDeep(orderedOn, o.orderedOn, true) - && compareDeep(recordedOn, o.recordedOn, true) && compareDeep(subject, o.subject, true) && compareDeep(timing, o.timing, true) - && compareDeep(priority, o.priority, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DeviceUseRequest)) - return false; - DeviceUseRequest o = (DeviceUseRequest) other; - return compareValues(status, o.status, true) && compareValues(notes, o.notes, true) && compareValues(orderedOn, o.orderedOn, true) - && compareValues(recordedOn, o.recordedOn, true) && compareValues(priority, o.priority, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (bodySite == null || bodySite.isEmpty()) && (status == null || status.isEmpty()) - && (device == null || device.isEmpty()) && (encounter == null || encounter.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (indication == null || indication.isEmpty()) && (notes == null || notes.isEmpty()) && (prnReason == null || prnReason.isEmpty()) - && (orderedOn == null || orderedOn.isEmpty()) && (recordedOn == null || recordedOn.isEmpty()) - && (subject == null || subject.isEmpty()) && (timing == null || timing.isEmpty()) && (priority == null || priority.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DeviceUseRequest; - } - - @SearchParamDefinition(name="patient", path="DeviceUseRequest.subject", description="Search by subject - a patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="subject", path="DeviceUseRequest.subject", description="Search by subject", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="device", path="DeviceUseRequest.device", description="Device requested", type="reference" ) - public static final String SP_DEVICE = "device"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker. + */ +@ResourceDef(name="DeviceUseRequest", profile="http://hl7.org/fhir/Profile/DeviceUseRequest") +public class DeviceUseRequest extends DomainResource { + + public enum DeviceUseRequestStatus { + /** + * The request has been proposed. + */ + PROPOSED, + /** + * The request has been planned. + */ + PLANNED, + /** + * The request has been placed. + */ + REQUESTED, + /** + * The receiving system has received the request but not yet decided whether it will be performed. + */ + RECEIVED, + /** + * The receiving system has accepted the request but work has not yet commenced. + */ + ACCEPTED, + /** + * The work to fulfill the order is happening. + */ + INPROGRESS, + /** + * The work has been complete, the report(s) released, and no further work is planned. + */ + COMPLETED, + /** + * The request has been held by originating system/user request. + */ + SUSPENDED, + /** + * The receiving system has declined to fulfill the request. + */ + REJECTED, + /** + * The request was attempted, but due to some procedural error, it could not be completed. + */ + ABORTED, + /** + * added to help the parsers + */ + NULL; + public static DeviceUseRequestStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("planned".equals(codeString)) + return PLANNED; + if ("requested".equals(codeString)) + return REQUESTED; + if ("received".equals(codeString)) + return RECEIVED; + if ("accepted".equals(codeString)) + return ACCEPTED; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("completed".equals(codeString)) + return COMPLETED; + if ("suspended".equals(codeString)) + return SUSPENDED; + if ("rejected".equals(codeString)) + return REJECTED; + if ("aborted".equals(codeString)) + return ABORTED; + throw new Exception("Unknown DeviceUseRequestStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROPOSED: return "proposed"; + case PLANNED: return "planned"; + case REQUESTED: return "requested"; + case RECEIVED: return "received"; + case ACCEPTED: return "accepted"; + case INPROGRESS: return "in-progress"; + case COMPLETED: return "completed"; + case SUSPENDED: return "suspended"; + case REJECTED: return "rejected"; + case ABORTED: return "aborted"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROPOSED: return ""; + case PLANNED: return ""; + case REQUESTED: return ""; + case RECEIVED: return ""; + case ACCEPTED: return ""; + case INPROGRESS: return ""; + case COMPLETED: return ""; + case SUSPENDED: return ""; + case REJECTED: return ""; + case ABORTED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROPOSED: return "The request has been proposed."; + case PLANNED: return "The request has been planned."; + case REQUESTED: return "The request has been placed."; + case RECEIVED: return "The receiving system has received the request but not yet decided whether it will be performed."; + case ACCEPTED: return "The receiving system has accepted the request but work has not yet commenced."; + case INPROGRESS: return "The work to fulfill the order is happening."; + case COMPLETED: return "The work has been complete, the report(s) released, and no further work is planned."; + case SUSPENDED: return "The request has been held by originating system/user request."; + case REJECTED: return "The receiving system has declined to fulfill the request."; + case ABORTED: return "The request was attempted, but due to some procedural error, it could not be completed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROPOSED: return "Proposed"; + case PLANNED: return "Planned"; + case REQUESTED: return "Requested"; + case RECEIVED: return "Received"; + case ACCEPTED: return "Accepted"; + case INPROGRESS: return "In Progress"; + case COMPLETED: return "Completed"; + case SUSPENDED: return "Suspended"; + case REJECTED: return "Rejected"; + case ABORTED: return "Aborted"; + default: return "?"; + } + } + } + + public static class DeviceUseRequestStatusEnumFactory implements EnumFactory { + public DeviceUseRequestStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return DeviceUseRequestStatus.PROPOSED; + if ("planned".equals(codeString)) + return DeviceUseRequestStatus.PLANNED; + if ("requested".equals(codeString)) + return DeviceUseRequestStatus.REQUESTED; + if ("received".equals(codeString)) + return DeviceUseRequestStatus.RECEIVED; + if ("accepted".equals(codeString)) + return DeviceUseRequestStatus.ACCEPTED; + if ("in-progress".equals(codeString)) + return DeviceUseRequestStatus.INPROGRESS; + if ("completed".equals(codeString)) + return DeviceUseRequestStatus.COMPLETED; + if ("suspended".equals(codeString)) + return DeviceUseRequestStatus.SUSPENDED; + if ("rejected".equals(codeString)) + return DeviceUseRequestStatus.REJECTED; + if ("aborted".equals(codeString)) + return DeviceUseRequestStatus.ABORTED; + throw new IllegalArgumentException("Unknown DeviceUseRequestStatus code '"+codeString+"'"); + } + public String toCode(DeviceUseRequestStatus code) { + if (code == DeviceUseRequestStatus.PROPOSED) + return "proposed"; + if (code == DeviceUseRequestStatus.PLANNED) + return "planned"; + if (code == DeviceUseRequestStatus.REQUESTED) + return "requested"; + if (code == DeviceUseRequestStatus.RECEIVED) + return "received"; + if (code == DeviceUseRequestStatus.ACCEPTED) + return "accepted"; + if (code == DeviceUseRequestStatus.INPROGRESS) + return "in-progress"; + if (code == DeviceUseRequestStatus.COMPLETED) + return "completed"; + if (code == DeviceUseRequestStatus.SUSPENDED) + return "suspended"; + if (code == DeviceUseRequestStatus.REJECTED) + return "rejected"; + if (code == DeviceUseRequestStatus.ABORTED) + return "aborted"; + return "?"; + } + } + + public enum DeviceUseRequestPriority { + /** + * The request has a normal priority. + */ + ROUTINE, + /** + * The request should be done urgently. + */ + URGENT, + /** + * The request is time-critical. + */ + STAT, + /** + * The request should be acted on as soon as possible. + */ + ASAP, + /** + * added to help the parsers + */ + NULL; + public static DeviceUseRequestPriority fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("routine".equals(codeString)) + return ROUTINE; + if ("urgent".equals(codeString)) + return URGENT; + if ("stat".equals(codeString)) + return STAT; + if ("asap".equals(codeString)) + return ASAP; + throw new Exception("Unknown DeviceUseRequestPriority code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ROUTINE: return "routine"; + case URGENT: return "urgent"; + case STAT: return "stat"; + case ASAP: return "asap"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ROUTINE: return ""; + case URGENT: return ""; + case STAT: return ""; + case ASAP: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ROUTINE: return "The request has a normal priority."; + case URGENT: return "The request should be done urgently."; + case STAT: return "The request is time-critical."; + case ASAP: return "The request should be acted on as soon as possible."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ROUTINE: return "Routine"; + case URGENT: return "Urgent"; + case STAT: return "Stat"; + case ASAP: return "Asap"; + default: return "?"; + } + } + } + + public static class DeviceUseRequestPriorityEnumFactory implements EnumFactory { + public DeviceUseRequestPriority fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("routine".equals(codeString)) + return DeviceUseRequestPriority.ROUTINE; + if ("urgent".equals(codeString)) + return DeviceUseRequestPriority.URGENT; + if ("stat".equals(codeString)) + return DeviceUseRequestPriority.STAT; + if ("asap".equals(codeString)) + return DeviceUseRequestPriority.ASAP; + throw new IllegalArgumentException("Unknown DeviceUseRequestPriority code '"+codeString+"'"); + } + public String toCode(DeviceUseRequestPriority code) { + if (code == DeviceUseRequestPriority.ROUTINE) + return "routine"; + if (code == DeviceUseRequestPriority.URGENT) + return "urgent"; + if (code == DeviceUseRequestPriority.STAT) + return "stat"; + if (code == DeviceUseRequestPriority.ASAP) + return "asap"; + return "?"; + } + } + + /** + * Indicates the site on the subject's body where the device should be used ( i.e. the target site). + */ + @Child(name = "bodySite", type = {CodeableConcept.class, BodySite.class}, order=0, min=0, max=1) + @Description(shortDefinition="Target body site", formalDefinition="Indicates the site on the subject's body where the device should be used ( i.e. the target site)." ) + protected Type bodySite; + + /** + * The status of the request. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="proposed | planned | requested | received | accepted | in-progress | completed | suspended | rejected | aborted", formalDefinition="The status of the request." ) + protected Enumeration status; + + /** + * The details of the device to be used. + */ + @Child(name = "device", type = {Device.class}, order=2, min=1, max=1) + @Description(shortDefinition="Device requested", formalDefinition="The details of the device to be used." ) + protected Reference device; + + /** + * The actual object that is the target of the reference (The details of the device to be used.) + */ + protected Device deviceTarget; + + /** + * An encounter that provides additional context in which this request is made. + */ + @Child(name = "encounter", type = {Encounter.class}, order=3, min=0, max=1) + @Description(shortDefinition="Encounter motivating request", formalDefinition="An encounter that provides additional context in which this request is made." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (An encounter that provides additional context in which this request is made.) + */ + protected Encounter encounterTarget; + + /** + * Identifiers assigned to this order by the orderer or by the receiver. + */ + @Child(name = "identifier", type = {Identifier.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Request identifier", formalDefinition="Identifiers assigned to this order by the orderer or by the receiver." ) + protected List identifier; + + /** + * Reason or justification for the use of this device. + */ + @Child(name = "indication", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Reason for request", formalDefinition="Reason or justification for the use of this device." ) + protected List indication; + + /** + * Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement. + */ + @Child(name = "notes", type = {StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Notes or comments", formalDefinition="Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement." ) + protected List notes; + + /** + * The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%. + */ + @Child(name = "prnReason", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="PRN", formalDefinition="The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%." ) + protected List prnReason; + + /** + * The time when the request was made. + */ + @Child(name = "orderedOn", type = {DateTimeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="When ordered", formalDefinition="The time when the request was made." ) + protected DateTimeType orderedOn; + + /** + * The time at which the request was made/recorded. + */ + @Child(name = "recordedOn", type = {DateTimeType.class}, order=9, min=0, max=1) + @Description(shortDefinition="When recorded", formalDefinition="The time at which the request was made/recorded." ) + protected DateTimeType recordedOn; + + /** + * The patient who will use the device. + */ + @Child(name = "subject", type = {Patient.class}, order=10, min=1, max=1) + @Description(shortDefinition="Focus of request", formalDefinition="The patient who will use the device." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient who will use the device.) + */ + protected Patient subjectTarget; + + /** + * The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". + */ + @Child(name = "timing", type = {Timing.class, Period.class, DateTimeType.class}, order=11, min=0, max=1) + @Description(shortDefinition="Schedule for use", formalDefinition="The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'." ) + protected Type timing; + + /** + * Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine. + */ + @Child(name = "priority", type = {CodeType.class}, order=12, min=0, max=1) + @Description(shortDefinition="routine | urgent | stat | asap", formalDefinition="Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine." ) + protected Enumeration priority; + + private static final long serialVersionUID = 1208477058L; + + /* + * Constructor + */ + public DeviceUseRequest() { + super(); + } + + /* + * Constructor + */ + public DeviceUseRequest(Reference device, Reference subject) { + super(); + this.device = device; + this.subject = subject; + } + + /** + * @return {@link #bodySite} (Indicates the site on the subject's body where the device should be used ( i.e. the target site).) + */ + public Type getBodySite() { + return this.bodySite; + } + + /** + * @return {@link #bodySite} (Indicates the site on the subject's body where the device should be used ( i.e. the target site).) + */ + public CodeableConcept getBodySiteCodeableConcept() throws Exception { + if (!(this.bodySite instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.bodySite.getClass().getName()+" was encountered"); + return (CodeableConcept) this.bodySite; + } + + /** + * @return {@link #bodySite} (Indicates the site on the subject's body where the device should be used ( i.e. the target site).) + */ + public Reference getBodySiteReference() throws Exception { + if (!(this.bodySite instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.bodySite.getClass().getName()+" was encountered"); + return (Reference) this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Indicates the site on the subject's body where the device should be used ( i.e. the target site).) + */ + public DeviceUseRequest setBodySite(Type value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #status} (The status of the request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new DeviceUseRequestStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status of the request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DeviceUseRequest setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the request. + */ + public DeviceUseRequestStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the request. + */ + public DeviceUseRequest setStatus(DeviceUseRequestStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new DeviceUseRequestStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #device} (The details of the device to be used.) + */ + public Reference getDevice() { + if (this.device == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.device"); + else if (Configuration.doAutoCreate()) + this.device = new Reference(); // cc + return this.device; + } + + public boolean hasDevice() { + return this.device != null && !this.device.isEmpty(); + } + + /** + * @param value {@link #device} (The details of the device to be used.) + */ + public DeviceUseRequest setDevice(Reference value) { + this.device = value; + return this; + } + + /** + * @return {@link #device} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The details of the device to be used.) + */ + public Device getDeviceTarget() { + if (this.deviceTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.device"); + else if (Configuration.doAutoCreate()) + this.deviceTarget = new Device(); // aa + return this.deviceTarget; + } + + /** + * @param value {@link #device} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The details of the device to be used.) + */ + public DeviceUseRequest setDeviceTarget(Device value) { + this.deviceTarget = value; + return this; + } + + /** + * @return {@link #encounter} (An encounter that provides additional context in which this request is made.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (An encounter that provides additional context in which this request is made.) + */ + public DeviceUseRequest setEncounter(Reference value) { + this.encounter = value; + return this; + } + + /** + * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An encounter that provides additional context in which this request is made.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + return this.encounterTarget; + } + + /** + * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An encounter that provides additional context in which this request is made.) + */ + public DeviceUseRequest setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order by the orderer or by the receiver.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order by the orderer or by the receiver.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public DeviceUseRequest addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #indication} (Reason or justification for the use of this device.) + */ + public List getIndication() { + if (this.indication == null) + this.indication = new ArrayList(); + return this.indication; + } + + public boolean hasIndication() { + if (this.indication == null) + return false; + for (CodeableConcept item : this.indication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #indication} (Reason or justification for the use of this device.) + */ + // syntactic sugar + public CodeableConcept addIndication() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return t; + } + + // syntactic sugar + public DeviceUseRequest addIndication(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return this; + } + + /** + * @return {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + public List getNotes() { + if (this.notes == null) + this.notes = new ArrayList(); + return this.notes; + } + + public boolean hasNotes() { + if (this.notes == null) + return false; + for (StringType item : this.notes) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + // syntactic sugar + public StringType addNotesElement() {//2 + StringType t = new StringType(); + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return t; + } + + /** + * @param value {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + public DeviceUseRequest addNotes(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return this; + } + + /** + * @param value {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + public boolean hasNotes(String value) { + if (this.notes == null) + return false; + for (StringType v : this.notes) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #prnReason} (The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%.) + */ + public List getPrnReason() { + if (this.prnReason == null) + this.prnReason = new ArrayList(); + return this.prnReason; + } + + public boolean hasPrnReason() { + if (this.prnReason == null) + return false; + for (CodeableConcept item : this.prnReason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #prnReason} (The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%.) + */ + // syntactic sugar + public CodeableConcept addPrnReason() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.prnReason == null) + this.prnReason = new ArrayList(); + this.prnReason.add(t); + return t; + } + + // syntactic sugar + public DeviceUseRequest addPrnReason(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.prnReason == null) + this.prnReason = new ArrayList(); + this.prnReason.add(t); + return this; + } + + /** + * @return {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value + */ + public DateTimeType getOrderedOnElement() { + if (this.orderedOn == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.orderedOn"); + else if (Configuration.doAutoCreate()) + this.orderedOn = new DateTimeType(); // bb + return this.orderedOn; + } + + public boolean hasOrderedOnElement() { + return this.orderedOn != null && !this.orderedOn.isEmpty(); + } + + public boolean hasOrderedOn() { + return this.orderedOn != null && !this.orderedOn.isEmpty(); + } + + /** + * @param value {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value + */ + public DeviceUseRequest setOrderedOnElement(DateTimeType value) { + this.orderedOn = value; + return this; + } + + /** + * @return The time when the request was made. + */ + public Date getOrderedOn() { + return this.orderedOn == null ? null : this.orderedOn.getValue(); + } + + /** + * @param value The time when the request was made. + */ + public DeviceUseRequest setOrderedOn(Date value) { + if (value == null) + this.orderedOn = null; + else { + if (this.orderedOn == null) + this.orderedOn = new DateTimeType(); + this.orderedOn.setValue(value); + } + return this; + } + + /** + * @return {@link #recordedOn} (The time at which the request was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value + */ + public DateTimeType getRecordedOnElement() { + if (this.recordedOn == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.recordedOn"); + else if (Configuration.doAutoCreate()) + this.recordedOn = new DateTimeType(); // bb + return this.recordedOn; + } + + public boolean hasRecordedOnElement() { + return this.recordedOn != null && !this.recordedOn.isEmpty(); + } + + public boolean hasRecordedOn() { + return this.recordedOn != null && !this.recordedOn.isEmpty(); + } + + /** + * @param value {@link #recordedOn} (The time at which the request was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value + */ + public DeviceUseRequest setRecordedOnElement(DateTimeType value) { + this.recordedOn = value; + return this; + } + + /** + * @return The time at which the request was made/recorded. + */ + public Date getRecordedOn() { + return this.recordedOn == null ? null : this.recordedOn.getValue(); + } + + /** + * @param value The time at which the request was made/recorded. + */ + public DeviceUseRequest setRecordedOn(Date value) { + if (value == null) + this.recordedOn = null; + else { + if (this.recordedOn == null) + this.recordedOn = new DateTimeType(); + this.recordedOn.setValue(value); + } + return this; + } + + /** + * @return {@link #subject} (The patient who will use the device.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The patient who will use the device.) + */ + public DeviceUseRequest setSubject(Reference value) { + this.subject = value; + return this; + } + + /** + * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who will use the device.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.subject"); + else if (Configuration.doAutoCreate()) + this.subjectTarget = new Patient(); // aa + return this.subjectTarget; + } + + /** + * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who will use the device.) + */ + public DeviceUseRequest setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Type getTiming() { + return this.timing; + } + + /** + * @return {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Timing getTimingTiming() throws Exception { + if (!(this.timing instanceof Timing)) + throw new Exception("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (Timing) this.timing; + } + + /** + * @return {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Period getTimingPeriod() throws Exception { + if (!(this.timing instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (Period) this.timing; + } + + /** + * @return {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public DateTimeType getTimingDateTimeType() throws Exception { + if (!(this.timing instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (DateTimeType) this.timing; + } + + public boolean hasTiming() { + return this.timing != null && !this.timing.isEmpty(); + } + + /** + * @param value {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public DeviceUseRequest setTiming(Type value) { + this.timing = value; + return this; + } + + /** + * @return {@link #priority} (Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public Enumeration getPriorityElement() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Enumeration(new DeviceUseRequestPriorityEnumFactory()); // bb + return this.priority; + } + + public boolean hasPriorityElement() { + return this.priority != null && !this.priority.isEmpty(); + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public DeviceUseRequest setPriorityElement(Enumeration value) { + this.priority = value; + return this; + } + + /** + * @return Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine. + */ + public DeviceUseRequestPriority getPriority() { + return this.priority == null ? null : this.priority.getValue(); + } + + /** + * @param value Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine. + */ + public DeviceUseRequest setPriority(DeviceUseRequestPriority value) { + if (value == null) + this.priority = null; + else { + if (this.priority == null) + this.priority = new Enumeration(new DeviceUseRequestPriorityEnumFactory()); + this.priority.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("bodySite[x]", "CodeableConcept|Reference(BodySite)", "Indicates the site on the subject's body where the device should be used ( i.e. the target site).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("status", "code", "The status of the request.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("device", "Reference(Device)", "The details of the device to be used.", 0, java.lang.Integer.MAX_VALUE, device)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional context in which this request is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the orderer or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("indication", "CodeableConcept", "Reason or justification for the use of this device.", 0, java.lang.Integer.MAX_VALUE, indication)); + childrenList.add(new Property("notes", "string", "Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("prnReason", "CodeableConcept", "The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%.", 0, java.lang.Integer.MAX_VALUE, prnReason)); + childrenList.add(new Property("orderedOn", "dateTime", "The time when the request was made.", 0, java.lang.Integer.MAX_VALUE, orderedOn)); + childrenList.add(new Property("recordedOn", "dateTime", "The time at which the request was made/recorded.", 0, java.lang.Integer.MAX_VALUE, recordedOn)); + childrenList.add(new Property("subject", "Reference(Patient)", "The patient who will use the device.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("timing[x]", "Timing|Period|dateTime", "The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'.", 0, java.lang.Integer.MAX_VALUE, timing)); + childrenList.add(new Property("priority", "code", "Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine.", 0, java.lang.Integer.MAX_VALUE, priority)); + } + + public DeviceUseRequest copy() { + DeviceUseRequest dst = new DeviceUseRequest(); + copyValues(dst); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + dst.status = status == null ? null : status.copy(); + dst.device = device == null ? null : device.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + if (indication != null) { + dst.indication = new ArrayList(); + for (CodeableConcept i : indication) + dst.indication.add(i.copy()); + }; + if (notes != null) { + dst.notes = new ArrayList(); + for (StringType i : notes) + dst.notes.add(i.copy()); + }; + if (prnReason != null) { + dst.prnReason = new ArrayList(); + for (CodeableConcept i : prnReason) + dst.prnReason.add(i.copy()); + }; + dst.orderedOn = orderedOn == null ? null : orderedOn.copy(); + dst.recordedOn = recordedOn == null ? null : recordedOn.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.timing = timing == null ? null : timing.copy(); + dst.priority = priority == null ? null : priority.copy(); + return dst; + } + + protected DeviceUseRequest typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DeviceUseRequest)) + return false; + DeviceUseRequest o = (DeviceUseRequest) other; + return compareDeep(bodySite, o.bodySite, true) && compareDeep(status, o.status, true) && compareDeep(device, o.device, true) + && compareDeep(encounter, o.encounter, true) && compareDeep(identifier, o.identifier, true) && compareDeep(indication, o.indication, true) + && compareDeep(notes, o.notes, true) && compareDeep(prnReason, o.prnReason, true) && compareDeep(orderedOn, o.orderedOn, true) + && compareDeep(recordedOn, o.recordedOn, true) && compareDeep(subject, o.subject, true) && compareDeep(timing, o.timing, true) + && compareDeep(priority, o.priority, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DeviceUseRequest)) + return false; + DeviceUseRequest o = (DeviceUseRequest) other; + return compareValues(status, o.status, true) && compareValues(notes, o.notes, true) && compareValues(orderedOn, o.orderedOn, true) + && compareValues(recordedOn, o.recordedOn, true) && compareValues(priority, o.priority, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (bodySite == null || bodySite.isEmpty()) && (status == null || status.isEmpty()) + && (device == null || device.isEmpty()) && (encounter == null || encounter.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (indication == null || indication.isEmpty()) && (notes == null || notes.isEmpty()) && (prnReason == null || prnReason.isEmpty()) + && (orderedOn == null || orderedOn.isEmpty()) && (recordedOn == null || recordedOn.isEmpty()) + && (subject == null || subject.isEmpty()) && (timing == null || timing.isEmpty()) && (priority == null || priority.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DeviceUseRequest; + } + + @SearchParamDefinition(name="subject", path="DeviceUseRequest.subject", description="Search by subject", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="patient", path="DeviceUseRequest.subject", description="Search by subject - a patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="device", path="DeviceUseRequest.device", description="Device requested", type="reference" ) + public static final String SP_DEVICE = "device"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DeviceUseStatement.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DeviceUseStatement.java index d77b23e5ab6..a8bc672238e 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DeviceUseStatement.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DeviceUseStatement.java @@ -1,626 +1,605 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A record of a device being used by a patient where the record is the result of a report from the patient or another clinician. - */ -@ResourceDef(name="DeviceUseStatement", profile="http://hl7.org/fhir/Profile/DeviceUseStatement") -public class DeviceUseStatement extends DomainResource { - - /** - * Indicates the site on the subject's body where the device was used ( i.e. the target site). - */ - @Child(name = "bodySite", type = {CodeableConcept.class, BodySite.class}, order=0, min=0, max=1) - @Description(shortDefinition="Target body site", formalDefinition="Indicates the site on the subject's body where the device was used ( i.e. the target site)." ) - protected Type bodySite; - - /** - * The time period over which the device was used. - */ - @Child(name = "whenUsed", type = {Period.class}, order=1, min=0, max=1) - @Description(shortDefinition="", formalDefinition="The time period over which the device was used." ) - protected Period whenUsed; - - /** - * The details of the device used. - */ - @Child(name = "device", type = {Device.class}, order=2, min=1, max=1) - @Description(shortDefinition="", formalDefinition="The details of the device used." ) - protected Reference device; - - /** - * The actual object that is the target of the reference (The details of the device used.) - */ - protected Device deviceTarget; - - /** - * An external identifier for this statement such as an IRI. - */ - @Child(name = "identifier", type = {Identifier.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="", formalDefinition="An external identifier for this statement such as an IRI." ) - protected List identifier; - - /** - * Reason or justification for the use of the device. - */ - @Child(name = "indication", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="", formalDefinition="Reason or justification for the use of the device." ) - protected List indication; - - /** - * Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement. - */ - @Child(name = "notes", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="", formalDefinition="Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement." ) - protected List notes; - - /** - * The time at which the statement was made/recorded. - */ - @Child(name = "recordedOn", type = {DateTimeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="", formalDefinition="The time at which the statement was made/recorded." ) - protected DateTimeType recordedOn; - - /** - * The patient who used the device. - */ - @Child(name = "subject", type = {Patient.class}, order=7, min=1, max=1) - @Description(shortDefinition="", formalDefinition="The patient who used the device." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient who used the device.) - */ - protected Patient subjectTarget; - - /** - * How often the device was used. - */ - @Child(name = "timing", type = {Timing.class, Period.class, DateTimeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="", formalDefinition="How often the device was used." ) - protected Type timing; - - private static final long serialVersionUID = -1668571635L; - - /* - * Constructor - */ - public DeviceUseStatement() { - super(); - } - - /* - * Constructor - */ - public DeviceUseStatement(Reference device, Reference subject) { - super(); - this.device = device; - this.subject = subject; - } - - /** - * @return {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).) - */ - public Type getBodySite() { - return this.bodySite; - } - - /** - * @return {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).) - */ - public CodeableConcept getBodySiteCodeableConcept() throws Exception { - if (!(this.bodySite instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.bodySite.getClass().getName()+" was encountered"); - return (CodeableConcept) this.bodySite; - } - - /** - * @return {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).) - */ - public Reference getBodySiteReference() throws Exception { - if (!(this.bodySite instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.bodySite.getClass().getName()+" was encountered"); - return (Reference) this.bodySite; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).) - */ - public DeviceUseStatement setBodySite(Type value) { - this.bodySite = value; - return this; - } - - /** - * @return {@link #whenUsed} (The time period over which the device was used.) - */ - public Period getWhenUsed() { - if (this.whenUsed == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseStatement.whenUsed"); - else if (Configuration.doAutoCreate()) - this.whenUsed = new Period(); // cc - return this.whenUsed; - } - - public boolean hasWhenUsed() { - return this.whenUsed != null && !this.whenUsed.isEmpty(); - } - - /** - * @param value {@link #whenUsed} (The time period over which the device was used.) - */ - public DeviceUseStatement setWhenUsed(Period value) { - this.whenUsed = value; - return this; - } - - /** - * @return {@link #device} (The details of the device used.) - */ - public Reference getDevice() { - if (this.device == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseStatement.device"); - else if (Configuration.doAutoCreate()) - this.device = new Reference(); // cc - return this.device; - } - - public boolean hasDevice() { - return this.device != null && !this.device.isEmpty(); - } - - /** - * @param value {@link #device} (The details of the device used.) - */ - public DeviceUseStatement setDevice(Reference value) { - this.device = value; - return this; - } - - /** - * @return {@link #device} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The details of the device used.) - */ - public Device getDeviceTarget() { - if (this.deviceTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseStatement.device"); - else if (Configuration.doAutoCreate()) - this.deviceTarget = new Device(); // aa - return this.deviceTarget; - } - - /** - * @param value {@link #device} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The details of the device used.) - */ - public DeviceUseStatement setDeviceTarget(Device value) { - this.deviceTarget = value; - return this; - } - - /** - * @return {@link #identifier} (An external identifier for this statement such as an IRI.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (An external identifier for this statement such as an IRI.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public DeviceUseStatement addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #indication} (Reason or justification for the use of the device.) - */ - public List getIndication() { - if (this.indication == null) - this.indication = new ArrayList(); - return this.indication; - } - - public boolean hasIndication() { - if (this.indication == null) - return false; - for (CodeableConcept item : this.indication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #indication} (Reason or justification for the use of the device.) - */ - // syntactic sugar - public CodeableConcept addIndication() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.indication == null) - this.indication = new ArrayList(); - this.indication.add(t); - return t; - } - - // syntactic sugar - public DeviceUseStatement addIndication(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.indication == null) - this.indication = new ArrayList(); - this.indication.add(t); - return this; - } - - /** - * @return {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - public List getNotes() { - if (this.notes == null) - this.notes = new ArrayList(); - return this.notes; - } - - public boolean hasNotes() { - if (this.notes == null) - return false; - for (StringType item : this.notes) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - // syntactic sugar - public StringType addNotesElement() {//2 - StringType t = new StringType(); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return t; - } - - /** - * @param value {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - public DeviceUseStatement addNotes(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return this; - } - - /** - * @param value {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - public boolean hasNotes(String value) { - if (this.notes == null) - return false; - for (StringType v : this.notes) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #recordedOn} (The time at which the statement was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value - */ - public DateTimeType getRecordedOnElement() { - if (this.recordedOn == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseStatement.recordedOn"); - else if (Configuration.doAutoCreate()) - this.recordedOn = new DateTimeType(); // bb - return this.recordedOn; - } - - public boolean hasRecordedOnElement() { - return this.recordedOn != null && !this.recordedOn.isEmpty(); - } - - public boolean hasRecordedOn() { - return this.recordedOn != null && !this.recordedOn.isEmpty(); - } - - /** - * @param value {@link #recordedOn} (The time at which the statement was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value - */ - public DeviceUseStatement setRecordedOnElement(DateTimeType value) { - this.recordedOn = value; - return this; - } - - /** - * @return The time at which the statement was made/recorded. - */ - public Date getRecordedOn() { - return this.recordedOn == null ? null : this.recordedOn.getValue(); - } - - /** - * @param value The time at which the statement was made/recorded. - */ - public DeviceUseStatement setRecordedOn(Date value) { - if (value == null) - this.recordedOn = null; - else { - if (this.recordedOn == null) - this.recordedOn = new DateTimeType(); - this.recordedOn.setValue(value); - } - return this; - } - - /** - * @return {@link #subject} (The patient who used the device.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseStatement.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (The patient who used the device.) - */ - public DeviceUseStatement setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who used the device.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseStatement.subject"); - else if (Configuration.doAutoCreate()) - this.subjectTarget = new Patient(); // aa - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who used the device.) - */ - public DeviceUseStatement setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #timing} (How often the device was used.) - */ - public Type getTiming() { - return this.timing; - } - - /** - * @return {@link #timing} (How often the device was used.) - */ - public Timing getTimingTiming() throws Exception { - if (!(this.timing instanceof Timing)) - throw new Exception("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (Timing) this.timing; - } - - /** - * @return {@link #timing} (How often the device was used.) - */ - public Period getTimingPeriod() throws Exception { - if (!(this.timing instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (Period) this.timing; - } - - /** - * @return {@link #timing} (How often the device was used.) - */ - public DateTimeType getTimingDateTimeType() throws Exception { - if (!(this.timing instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (DateTimeType) this.timing; - } - - public boolean hasTiming() { - return this.timing != null && !this.timing.isEmpty(); - } - - /** - * @param value {@link #timing} (How often the device was used.) - */ - public DeviceUseStatement setTiming(Type value) { - this.timing = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("bodySite[x]", "CodeableConcept|Reference(BodySite)", "Indicates the site on the subject's body where the device was used ( i.e. the target site).", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("whenUsed", "Period", "The time period over which the device was used.", 0, java.lang.Integer.MAX_VALUE, whenUsed)); - childrenList.add(new Property("device", "Reference(Device)", "The details of the device used.", 0, java.lang.Integer.MAX_VALUE, device)); - childrenList.add(new Property("identifier", "Identifier", "An external identifier for this statement such as an IRI.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("indication", "CodeableConcept", "Reason or justification for the use of the device.", 0, java.lang.Integer.MAX_VALUE, indication)); - childrenList.add(new Property("notes", "string", "Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.", 0, java.lang.Integer.MAX_VALUE, notes)); - childrenList.add(new Property("recordedOn", "dateTime", "The time at which the statement was made/recorded.", 0, java.lang.Integer.MAX_VALUE, recordedOn)); - childrenList.add(new Property("subject", "Reference(Patient)", "The patient who used the device.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("timing[x]", "Timing|Period|dateTime", "How often the device was used.", 0, java.lang.Integer.MAX_VALUE, timing)); - } - - public DeviceUseStatement copy() { - DeviceUseStatement dst = new DeviceUseStatement(); - copyValues(dst); - dst.bodySite = bodySite == null ? null : bodySite.copy(); - dst.whenUsed = whenUsed == null ? null : whenUsed.copy(); - dst.device = device == null ? null : device.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - if (indication != null) { - dst.indication = new ArrayList(); - for (CodeableConcept i : indication) - dst.indication.add(i.copy()); - }; - if (notes != null) { - dst.notes = new ArrayList(); - for (StringType i : notes) - dst.notes.add(i.copy()); - }; - dst.recordedOn = recordedOn == null ? null : recordedOn.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.timing = timing == null ? null : timing.copy(); - return dst; - } - - protected DeviceUseStatement typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DeviceUseStatement)) - return false; - DeviceUseStatement o = (DeviceUseStatement) other; - return compareDeep(bodySite, o.bodySite, true) && compareDeep(whenUsed, o.whenUsed, true) && compareDeep(device, o.device, true) - && compareDeep(identifier, o.identifier, true) && compareDeep(indication, o.indication, true) && compareDeep(notes, o.notes, true) - && compareDeep(recordedOn, o.recordedOn, true) && compareDeep(subject, o.subject, true) && compareDeep(timing, o.timing, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DeviceUseStatement)) - return false; - DeviceUseStatement o = (DeviceUseStatement) other; - return compareValues(notes, o.notes, true) && compareValues(recordedOn, o.recordedOn, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (bodySite == null || bodySite.isEmpty()) && (whenUsed == null || whenUsed.isEmpty()) - && (device == null || device.isEmpty()) && (identifier == null || identifier.isEmpty()) && (indication == null || indication.isEmpty()) - && (notes == null || notes.isEmpty()) && (recordedOn == null || recordedOn.isEmpty()) && (subject == null || subject.isEmpty()) - && (timing == null || timing.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DeviceUseStatement; - } - - @SearchParamDefinition(name="patient", path="DeviceUseStatement.subject", description="Search by subject - a patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="subject", path="DeviceUseStatement.subject", description="Search by subject", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="device", path="DeviceUseStatement.device", description="Search by device", type="reference" ) - public static final String SP_DEVICE = "device"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A record of a device being used by a patient where the record is the result of a report from the patient or another clinician. + */ +@ResourceDef(name="DeviceUseStatement", profile="http://hl7.org/fhir/Profile/DeviceUseStatement") +public class DeviceUseStatement extends DomainResource { + + /** + * Indicates the site on the subject's body where the device was used ( i.e. the target site). + */ + @Child(name = "bodySite", type = {CodeableConcept.class, BodySite.class}, order=0, min=0, max=1) + @Description(shortDefinition="Target body site", formalDefinition="Indicates the site on the subject's body where the device was used ( i.e. the target site)." ) + protected Type bodySite; + + /** + * The time period over which the device was used. + */ + @Child(name = "whenUsed", type = {Period.class}, order=1, min=0, max=1) + @Description(shortDefinition="", formalDefinition="The time period over which the device was used." ) + protected Period whenUsed; + + /** + * The details of the device used. + */ + @Child(name = "device", type = {Device.class}, order=2, min=1, max=1) + @Description(shortDefinition="", formalDefinition="The details of the device used." ) + protected Reference device; + + /** + * The actual object that is the target of the reference (The details of the device used.) + */ + protected Device deviceTarget; + + /** + * An external identifier for this statement such as an IRI. + */ + @Child(name = "identifier", type = {Identifier.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="", formalDefinition="An external identifier for this statement such as an IRI." ) + protected List identifier; + + /** + * Reason or justification for the use of the device. + */ + @Child(name = "indication", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="", formalDefinition="Reason or justification for the use of the device." ) + protected List indication; + + /** + * Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement. + */ + @Child(name = "notes", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="", formalDefinition="Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement." ) + protected List notes; + + /** + * The time at which the statement was made/recorded. + */ + @Child(name = "recordedOn", type = {DateTimeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="", formalDefinition="The time at which the statement was made/recorded." ) + protected DateTimeType recordedOn; + + /** + * The patient who used the device. + */ + @Child(name = "subject", type = {Patient.class}, order=7, min=1, max=1) + @Description(shortDefinition="", formalDefinition="The patient who used the device." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient who used the device.) + */ + protected Patient subjectTarget; + + /** + * How often the device was used. + */ + @Child(name = "timing", type = {Timing.class, Period.class, DateTimeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="", formalDefinition="How often the device was used." ) + protected Type timing; + + private static final long serialVersionUID = -1668571635L; + + /* + * Constructor + */ + public DeviceUseStatement() { + super(); + } + + /* + * Constructor + */ + public DeviceUseStatement(Reference device, Reference subject) { + super(); + this.device = device; + this.subject = subject; + } + + /** + * @return {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).) + */ + public Type getBodySite() { + return this.bodySite; + } + + /** + * @return {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).) + */ + public CodeableConcept getBodySiteCodeableConcept() throws Exception { + if (!(this.bodySite instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.bodySite.getClass().getName()+" was encountered"); + return (CodeableConcept) this.bodySite; + } + + /** + * @return {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).) + */ + public Reference getBodySiteReference() throws Exception { + if (!(this.bodySite instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.bodySite.getClass().getName()+" was encountered"); + return (Reference) this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).) + */ + public DeviceUseStatement setBodySite(Type value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #whenUsed} (The time period over which the device was used.) + */ + public Period getWhenUsed() { + if (this.whenUsed == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseStatement.whenUsed"); + else if (Configuration.doAutoCreate()) + this.whenUsed = new Period(); // cc + return this.whenUsed; + } + + public boolean hasWhenUsed() { + return this.whenUsed != null && !this.whenUsed.isEmpty(); + } + + /** + * @param value {@link #whenUsed} (The time period over which the device was used.) + */ + public DeviceUseStatement setWhenUsed(Period value) { + this.whenUsed = value; + return this; + } + + /** + * @return {@link #device} (The details of the device used.) + */ + public Reference getDevice() { + if (this.device == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseStatement.device"); + else if (Configuration.doAutoCreate()) + this.device = new Reference(); // cc + return this.device; + } + + public boolean hasDevice() { + return this.device != null && !this.device.isEmpty(); + } + + /** + * @param value {@link #device} (The details of the device used.) + */ + public DeviceUseStatement setDevice(Reference value) { + this.device = value; + return this; + } + + /** + * @return {@link #device} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The details of the device used.) + */ + public Device getDeviceTarget() { + if (this.deviceTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseStatement.device"); + else if (Configuration.doAutoCreate()) + this.deviceTarget = new Device(); // aa + return this.deviceTarget; + } + + /** + * @param value {@link #device} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The details of the device used.) + */ + public DeviceUseStatement setDeviceTarget(Device value) { + this.deviceTarget = value; + return this; + } + + /** + * @return {@link #identifier} (An external identifier for this statement such as an IRI.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (An external identifier for this statement such as an IRI.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public DeviceUseStatement addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #indication} (Reason or justification for the use of the device.) + */ + public List getIndication() { + if (this.indication == null) + this.indication = new ArrayList(); + return this.indication; + } + + public boolean hasIndication() { + if (this.indication == null) + return false; + for (CodeableConcept item : this.indication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #indication} (Reason or justification for the use of the device.) + */ + // syntactic sugar + public CodeableConcept addIndication() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return t; + } + + // syntactic sugar + public DeviceUseStatement addIndication(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return this; + } + + /** + * @return {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + public List getNotes() { + if (this.notes == null) + this.notes = new ArrayList(); + return this.notes; + } + + public boolean hasNotes() { + if (this.notes == null) + return false; + for (StringType item : this.notes) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + // syntactic sugar + public StringType addNotesElement() {//2 + StringType t = new StringType(); + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return t; + } + + /** + * @param value {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + public DeviceUseStatement addNotes(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return this; + } + + /** + * @param value {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + public boolean hasNotes(String value) { + if (this.notes == null) + return false; + for (StringType v : this.notes) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #recordedOn} (The time at which the statement was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value + */ + public DateTimeType getRecordedOnElement() { + if (this.recordedOn == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseStatement.recordedOn"); + else if (Configuration.doAutoCreate()) + this.recordedOn = new DateTimeType(); // bb + return this.recordedOn; + } + + public boolean hasRecordedOnElement() { + return this.recordedOn != null && !this.recordedOn.isEmpty(); + } + + public boolean hasRecordedOn() { + return this.recordedOn != null && !this.recordedOn.isEmpty(); + } + + /** + * @param value {@link #recordedOn} (The time at which the statement was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value + */ + public DeviceUseStatement setRecordedOnElement(DateTimeType value) { + this.recordedOn = value; + return this; + } + + /** + * @return The time at which the statement was made/recorded. + */ + public Date getRecordedOn() { + return this.recordedOn == null ? null : this.recordedOn.getValue(); + } + + /** + * @param value The time at which the statement was made/recorded. + */ + public DeviceUseStatement setRecordedOn(Date value) { + if (value == null) + this.recordedOn = null; + else { + if (this.recordedOn == null) + this.recordedOn = new DateTimeType(); + this.recordedOn.setValue(value); + } + return this; + } + + /** + * @return {@link #subject} (The patient who used the device.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseStatement.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The patient who used the device.) + */ + public DeviceUseStatement setSubject(Reference value) { + this.subject = value; + return this; + } + + /** + * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who used the device.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseStatement.subject"); + else if (Configuration.doAutoCreate()) + this.subjectTarget = new Patient(); // aa + return this.subjectTarget; + } + + /** + * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who used the device.) + */ + public DeviceUseStatement setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #timing} (How often the device was used.) + */ + public Type getTiming() { + return this.timing; + } + + /** + * @return {@link #timing} (How often the device was used.) + */ + public Timing getTimingTiming() throws Exception { + if (!(this.timing instanceof Timing)) + throw new Exception("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (Timing) this.timing; + } + + /** + * @return {@link #timing} (How often the device was used.) + */ + public Period getTimingPeriod() throws Exception { + if (!(this.timing instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (Period) this.timing; + } + + /** + * @return {@link #timing} (How often the device was used.) + */ + public DateTimeType getTimingDateTimeType() throws Exception { + if (!(this.timing instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (DateTimeType) this.timing; + } + + public boolean hasTiming() { + return this.timing != null && !this.timing.isEmpty(); + } + + /** + * @param value {@link #timing} (How often the device was used.) + */ + public DeviceUseStatement setTiming(Type value) { + this.timing = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("bodySite[x]", "CodeableConcept|Reference(BodySite)", "Indicates the site on the subject's body where the device was used ( i.e. the target site).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("whenUsed", "Period", "The time period over which the device was used.", 0, java.lang.Integer.MAX_VALUE, whenUsed)); + childrenList.add(new Property("device", "Reference(Device)", "The details of the device used.", 0, java.lang.Integer.MAX_VALUE, device)); + childrenList.add(new Property("identifier", "Identifier", "An external identifier for this statement such as an IRI.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("indication", "CodeableConcept", "Reason or justification for the use of the device.", 0, java.lang.Integer.MAX_VALUE, indication)); + childrenList.add(new Property("notes", "string", "Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("recordedOn", "dateTime", "The time at which the statement was made/recorded.", 0, java.lang.Integer.MAX_VALUE, recordedOn)); + childrenList.add(new Property("subject", "Reference(Patient)", "The patient who used the device.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("timing[x]", "Timing|Period|dateTime", "How often the device was used.", 0, java.lang.Integer.MAX_VALUE, timing)); + } + + public DeviceUseStatement copy() { + DeviceUseStatement dst = new DeviceUseStatement(); + copyValues(dst); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + dst.whenUsed = whenUsed == null ? null : whenUsed.copy(); + dst.device = device == null ? null : device.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + if (indication != null) { + dst.indication = new ArrayList(); + for (CodeableConcept i : indication) + dst.indication.add(i.copy()); + }; + if (notes != null) { + dst.notes = new ArrayList(); + for (StringType i : notes) + dst.notes.add(i.copy()); + }; + dst.recordedOn = recordedOn == null ? null : recordedOn.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.timing = timing == null ? null : timing.copy(); + return dst; + } + + protected DeviceUseStatement typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DeviceUseStatement)) + return false; + DeviceUseStatement o = (DeviceUseStatement) other; + return compareDeep(bodySite, o.bodySite, true) && compareDeep(whenUsed, o.whenUsed, true) && compareDeep(device, o.device, true) + && compareDeep(identifier, o.identifier, true) && compareDeep(indication, o.indication, true) && compareDeep(notes, o.notes, true) + && compareDeep(recordedOn, o.recordedOn, true) && compareDeep(subject, o.subject, true) && compareDeep(timing, o.timing, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DeviceUseStatement)) + return false; + DeviceUseStatement o = (DeviceUseStatement) other; + return compareValues(notes, o.notes, true) && compareValues(recordedOn, o.recordedOn, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (bodySite == null || bodySite.isEmpty()) && (whenUsed == null || whenUsed.isEmpty()) + && (device == null || device.isEmpty()) && (identifier == null || identifier.isEmpty()) && (indication == null || indication.isEmpty()) + && (notes == null || notes.isEmpty()) && (recordedOn == null || recordedOn.isEmpty()) && (subject == null || subject.isEmpty()) + && (timing == null || timing.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DeviceUseStatement; + } + + @SearchParamDefinition(name="subject", path="DeviceUseStatement.subject", description="Search by subject", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="patient", path="DeviceUseStatement.subject", description="Search by subject - a patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="device", path="DeviceUseStatement.device", description="Search by device", type="reference" ) + public static final String SP_DEVICE = "device"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DiagnosticOrder.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DiagnosticOrder.java index 7cf2b50390d..e956e7abe4e 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DiagnosticOrder.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DiagnosticOrder.java @@ -1,1728 +1,1707 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A record of a request for a diagnostic investigation service to be performed. - */ -@ResourceDef(name="DiagnosticOrder", profile="http://hl7.org/fhir/Profile/DiagnosticOrder") -public class DiagnosticOrder extends DomainResource { - - public enum DiagnosticOrderStatus { - /** - * The request has been proposed. - */ - PROPOSED, - /** - * the request is in preliminary form prior to being sent. - */ - DRAFT, - /** - * The request has been planned. - */ - PLANNED, - /** - * The request has been placed. - */ - REQUESTED, - /** - * The receiving system has received the order, but not yet decided whether it will be performed. - */ - RECEIVED, - /** - * The receiving system has accepted the order, but work has not yet commenced. - */ - ACCEPTED, - /** - * The work to fulfill the order is happening. - */ - INPROGRESS, - /** - * The work is complete, and the outcomes are being reviewed for approval. - */ - REVIEW, - /** - * The work has been complete, the report(s) released, and no further work is planned. - */ - COMPLETED, - /** - * the request has been withdrawn. - */ - CANCELLED, - /** - * The request has been held by originating system/user request. - */ - SUSPENDED, - /** - * The receiving system has declined to fulfill the request. - */ - REJECTED, - /** - * The diagnostic investigation was attempted, but due to some procedural error, it could not be completed. - */ - FAILED, - /** - * added to help the parsers - */ - NULL; - public static DiagnosticOrderStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("draft".equals(codeString)) - return DRAFT; - if ("planned".equals(codeString)) - return PLANNED; - if ("requested".equals(codeString)) - return REQUESTED; - if ("received".equals(codeString)) - return RECEIVED; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("review".equals(codeString)) - return REVIEW; - if ("completed".equals(codeString)) - return COMPLETED; - if ("cancelled".equals(codeString)) - return CANCELLED; - if ("suspended".equals(codeString)) - return SUSPENDED; - if ("rejected".equals(codeString)) - return REJECTED; - if ("failed".equals(codeString)) - return FAILED; - throw new Exception("Unknown DiagnosticOrderStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PROPOSED: return "proposed"; - case DRAFT: return "draft"; - case PLANNED: return "planned"; - case REQUESTED: return "requested"; - case RECEIVED: return "received"; - case ACCEPTED: return "accepted"; - case INPROGRESS: return "in-progress"; - case REVIEW: return "review"; - case COMPLETED: return "completed"; - case CANCELLED: return "cancelled"; - case SUSPENDED: return "suspended"; - case REJECTED: return "rejected"; - case FAILED: return "failed"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PROPOSED: return ""; - case DRAFT: return ""; - case PLANNED: return ""; - case REQUESTED: return ""; - case RECEIVED: return ""; - case ACCEPTED: return ""; - case INPROGRESS: return ""; - case REVIEW: return ""; - case COMPLETED: return ""; - case CANCELLED: return ""; - case SUSPENDED: return ""; - case REJECTED: return ""; - case FAILED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PROPOSED: return "The request has been proposed."; - case DRAFT: return "the request is in preliminary form prior to being sent."; - case PLANNED: return "The request has been planned."; - case REQUESTED: return "The request has been placed."; - case RECEIVED: return "The receiving system has received the order, but not yet decided whether it will be performed."; - case ACCEPTED: return "The receiving system has accepted the order, but work has not yet commenced."; - case INPROGRESS: return "The work to fulfill the order is happening."; - case REVIEW: return "The work is complete, and the outcomes are being reviewed for approval."; - case COMPLETED: return "The work has been complete, the report(s) released, and no further work is planned."; - case CANCELLED: return "the request has been withdrawn."; - case SUSPENDED: return "The request has been held by originating system/user request."; - case REJECTED: return "The receiving system has declined to fulfill the request."; - case FAILED: return "The diagnostic investigation was attempted, but due to some procedural error, it could not be completed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PROPOSED: return "Proposed"; - case DRAFT: return "Draft"; - case PLANNED: return "Planned"; - case REQUESTED: return "Requested"; - case RECEIVED: return "Received"; - case ACCEPTED: return "Accepted"; - case INPROGRESS: return "In-Progress"; - case REVIEW: return "Review"; - case COMPLETED: return "Completed"; - case CANCELLED: return "Cancelled"; - case SUSPENDED: return "Suspended"; - case REJECTED: return "Rejected"; - case FAILED: return "Failed"; - default: return "?"; - } - } - } - - public static class DiagnosticOrderStatusEnumFactory implements EnumFactory { - public DiagnosticOrderStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return DiagnosticOrderStatus.PROPOSED; - if ("draft".equals(codeString)) - return DiagnosticOrderStatus.DRAFT; - if ("planned".equals(codeString)) - return DiagnosticOrderStatus.PLANNED; - if ("requested".equals(codeString)) - return DiagnosticOrderStatus.REQUESTED; - if ("received".equals(codeString)) - return DiagnosticOrderStatus.RECEIVED; - if ("accepted".equals(codeString)) - return DiagnosticOrderStatus.ACCEPTED; - if ("in-progress".equals(codeString)) - return DiagnosticOrderStatus.INPROGRESS; - if ("review".equals(codeString)) - return DiagnosticOrderStatus.REVIEW; - if ("completed".equals(codeString)) - return DiagnosticOrderStatus.COMPLETED; - if ("cancelled".equals(codeString)) - return DiagnosticOrderStatus.CANCELLED; - if ("suspended".equals(codeString)) - return DiagnosticOrderStatus.SUSPENDED; - if ("rejected".equals(codeString)) - return DiagnosticOrderStatus.REJECTED; - if ("failed".equals(codeString)) - return DiagnosticOrderStatus.FAILED; - throw new IllegalArgumentException("Unknown DiagnosticOrderStatus code '"+codeString+"'"); - } - public String toCode(DiagnosticOrderStatus code) { - if (code == DiagnosticOrderStatus.PROPOSED) - return "proposed"; - if (code == DiagnosticOrderStatus.DRAFT) - return "draft"; - if (code == DiagnosticOrderStatus.PLANNED) - return "planned"; - if (code == DiagnosticOrderStatus.REQUESTED) - return "requested"; - if (code == DiagnosticOrderStatus.RECEIVED) - return "received"; - if (code == DiagnosticOrderStatus.ACCEPTED) - return "accepted"; - if (code == DiagnosticOrderStatus.INPROGRESS) - return "in-progress"; - if (code == DiagnosticOrderStatus.REVIEW) - return "review"; - if (code == DiagnosticOrderStatus.COMPLETED) - return "completed"; - if (code == DiagnosticOrderStatus.CANCELLED) - return "cancelled"; - if (code == DiagnosticOrderStatus.SUSPENDED) - return "suspended"; - if (code == DiagnosticOrderStatus.REJECTED) - return "rejected"; - if (code == DiagnosticOrderStatus.FAILED) - return "failed"; - return "?"; - } - } - - public enum DiagnosticOrderPriority { - /** - * The order has a normal priority. - */ - ROUTINE, - /** - * The order should be urgently. - */ - URGENT, - /** - * The order is time-critical. - */ - STAT, - /** - * The order should be acted on as soon as possible. - */ - ASAP, - /** - * added to help the parsers - */ - NULL; - public static DiagnosticOrderPriority fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("routine".equals(codeString)) - return ROUTINE; - if ("urgent".equals(codeString)) - return URGENT; - if ("stat".equals(codeString)) - return STAT; - if ("asap".equals(codeString)) - return ASAP; - throw new Exception("Unknown DiagnosticOrderPriority code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ROUTINE: return "routine"; - case URGENT: return "urgent"; - case STAT: return "stat"; - case ASAP: return "asap"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ROUTINE: return ""; - case URGENT: return ""; - case STAT: return ""; - case ASAP: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ROUTINE: return "The order has a normal priority."; - case URGENT: return "The order should be urgently."; - case STAT: return "The order is time-critical."; - case ASAP: return "The order should be acted on as soon as possible."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ROUTINE: return "Routine"; - case URGENT: return "Urgent"; - case STAT: return "Stat"; - case ASAP: return "ASAP"; - default: return "?"; - } - } - } - - public static class DiagnosticOrderPriorityEnumFactory implements EnumFactory { - public DiagnosticOrderPriority fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("routine".equals(codeString)) - return DiagnosticOrderPriority.ROUTINE; - if ("urgent".equals(codeString)) - return DiagnosticOrderPriority.URGENT; - if ("stat".equals(codeString)) - return DiagnosticOrderPriority.STAT; - if ("asap".equals(codeString)) - return DiagnosticOrderPriority.ASAP; - throw new IllegalArgumentException("Unknown DiagnosticOrderPriority code '"+codeString+"'"); - } - public String toCode(DiagnosticOrderPriority code) { - if (code == DiagnosticOrderPriority.ROUTINE) - return "routine"; - if (code == DiagnosticOrderPriority.URGENT) - return "urgent"; - if (code == DiagnosticOrderPriority.STAT) - return "stat"; - if (code == DiagnosticOrderPriority.ASAP) - return "asap"; - return "?"; - } - } - - @Block() - public static class DiagnosticOrderEventComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The status for the event. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed", formalDefinition="The status for the event." ) - protected Enumeration status; - - /** - * Additional information about the event that occurred - e.g. if the status remained unchanged. - */ - @Child(name = "description", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="More information about the event and its context", formalDefinition="Additional information about the event that occurred - e.g. if the status remained unchanged." ) - protected CodeableConcept description; - - /** - * The date/time at which the event occurred. - */ - @Child(name = "dateTime", type = {DateTimeType.class}, order=3, min=1, max=1) - @Description(shortDefinition="The date at which the event happened", formalDefinition="The date/time at which the event occurred." ) - protected DateTimeType dateTime; - - /** - * The person who was responsible for performing or recording the action. - */ - @Child(name = "actor", type = {Practitioner.class, Device.class}, order=4, min=0, max=1) - @Description(shortDefinition="Who recorded or did this", formalDefinition="The person who was responsible for performing or recording the action." ) - protected Reference actor; - - /** - * The actual object that is the target of the reference (The person who was responsible for performing or recording the action.) - */ - protected Resource actorTarget; - - private static final long serialVersionUID = -370793723L; - - /* - * Constructor - */ - public DiagnosticOrderEventComponent() { - super(); - } - - /* - * Constructor - */ - public DiagnosticOrderEventComponent(Enumeration status, DateTimeType dateTime) { - super(); - this.status = status; - this.dateTime = dateTime; - } - - /** - * @return {@link #status} (The status for the event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status for the event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DiagnosticOrderEventComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status for the event. - */ - public DiagnosticOrderStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status for the event. - */ - public DiagnosticOrderEventComponent setStatus(DiagnosticOrderStatus value) { - if (this.status == null) - this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #description} (Additional information about the event that occurred - e.g. if the status remained unchanged.) - */ - public CodeableConcept getDescription() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new CodeableConcept(); // cc - return this.description; - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Additional information about the event that occurred - e.g. if the status remained unchanged.) - */ - public DiagnosticOrderEventComponent setDescription(CodeableConcept value) { - this.description = value; - return this; - } - - /** - * @return {@link #dateTime} (The date/time at which the event occurred.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public DateTimeType getDateTimeElement() { - if (this.dateTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.dateTime"); - else if (Configuration.doAutoCreate()) - this.dateTime = new DateTimeType(); // bb - return this.dateTime; - } - - public boolean hasDateTimeElement() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - public boolean hasDateTime() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - /** - * @param value {@link #dateTime} (The date/time at which the event occurred.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public DiagnosticOrderEventComponent setDateTimeElement(DateTimeType value) { - this.dateTime = value; - return this; - } - - /** - * @return The date/time at which the event occurred. - */ - public Date getDateTime() { - return this.dateTime == null ? null : this.dateTime.getValue(); - } - - /** - * @param value The date/time at which the event occurred. - */ - public DiagnosticOrderEventComponent setDateTime(Date value) { - if (this.dateTime == null) - this.dateTime = new DateTimeType(); - this.dateTime.setValue(value); - return this; - } - - /** - * @return {@link #actor} (The person who was responsible for performing or recording the action.) - */ - public Reference getActor() { - if (this.actor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.actor"); - else if (Configuration.doAutoCreate()) - this.actor = new Reference(); // cc - return this.actor; - } - - public boolean hasActor() { - return this.actor != null && !this.actor.isEmpty(); - } - - /** - * @param value {@link #actor} (The person who was responsible for performing or recording the action.) - */ - public DiagnosticOrderEventComponent setActor(Reference value) { - this.actor = value; - return this; - } - - /** - * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person who was responsible for performing or recording the action.) - */ - public Resource getActorTarget() { - return this.actorTarget; - } - - /** - * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person who was responsible for performing or recording the action.) - */ - public DiagnosticOrderEventComponent setActorTarget(Resource value) { - this.actorTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("status", "code", "The status for the event.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("description", "CodeableConcept", "Additional information about the event that occurred - e.g. if the status remained unchanged.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("dateTime", "dateTime", "The date/time at which the event occurred.", 0, java.lang.Integer.MAX_VALUE, dateTime)); - childrenList.add(new Property("actor", "Reference(Practitioner|Device)", "The person who was responsible for performing or recording the action.", 0, java.lang.Integer.MAX_VALUE, actor)); - } - - public DiagnosticOrderEventComponent copy() { - DiagnosticOrderEventComponent dst = new DiagnosticOrderEventComponent(); - copyValues(dst); - dst.status = status == null ? null : status.copy(); - dst.description = description == null ? null : description.copy(); - dst.dateTime = dateTime == null ? null : dateTime.copy(); - dst.actor = actor == null ? null : actor.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DiagnosticOrderEventComponent)) - return false; - DiagnosticOrderEventComponent o = (DiagnosticOrderEventComponent) other; - return compareDeep(status, o.status, true) && compareDeep(description, o.description, true) && compareDeep(dateTime, o.dateTime, true) - && compareDeep(actor, o.actor, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DiagnosticOrderEventComponent)) - return false; - DiagnosticOrderEventComponent o = (DiagnosticOrderEventComponent) other; - return compareValues(status, o.status, true) && compareValues(dateTime, o.dateTime, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (status == null || status.isEmpty()) && (description == null || description.isEmpty()) - && (dateTime == null || dateTime.isEmpty()) && (actor == null || actor.isEmpty()); - } - - } - - @Block() - public static class DiagnosticOrderItemComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Code to indicate the item (test or panel) being ordered", formalDefinition="A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested." ) - protected CodeableConcept code; - - /** - * If the item is related to a specific specimen. - */ - @Child(name = "specimen", type = {Specimen.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="If this item relates to specific specimens", formalDefinition="If the item is related to a specific specimen." ) - protected List specimen; - /** - * The actual objects that are the target of the reference (If the item is related to a specific specimen.) - */ - protected List specimenTarget; - - - /** - * Anatomical location where the request test should be performed. This is the target site. - */ - @Child(name = "bodySite", type = {CodeableConcept.class, BodySite.class}, order=3, min=0, max=1) - @Description(shortDefinition="Location of requested test (if applicable)", formalDefinition="Anatomical location where the request test should be performed. This is the target site." ) - protected Type bodySite; - - /** - * The status of this individual item within the order. - */ - @Child(name = "status", type = {CodeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed", formalDefinition="The status of this individual item within the order." ) - protected Enumeration status; - - /** - * A summary of the events of interest that have occurred as this item of the request is processed. - */ - @Child(name = "event", type = {DiagnosticOrderEventComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Events specific to this item", formalDefinition="A summary of the events of interest that have occurred as this item of the request is processed." ) - protected List event; - - private static final long serialVersionUID = 1960490281L; - - /* - * Constructor - */ - public DiagnosticOrderItemComponent() { - super(); - } - - /* - * Constructor - */ - public DiagnosticOrderItemComponent(CodeableConcept code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrderItemComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested.) - */ - public DiagnosticOrderItemComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #specimen} (If the item is related to a specific specimen.) - */ - public List getSpecimen() { - if (this.specimen == null) - this.specimen = new ArrayList(); - return this.specimen; - } - - public boolean hasSpecimen() { - if (this.specimen == null) - return false; - for (Reference item : this.specimen) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specimen} (If the item is related to a specific specimen.) - */ - // syntactic sugar - public Reference addSpecimen() { //3 - Reference t = new Reference(); - if (this.specimen == null) - this.specimen = new ArrayList(); - this.specimen.add(t); - return t; - } - - // syntactic sugar - public DiagnosticOrderItemComponent addSpecimen(Reference t) { //3 - if (t == null) - return this; - if (this.specimen == null) - this.specimen = new ArrayList(); - this.specimen.add(t); - return this; - } - - /** - * @return {@link #specimen} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. If the item is related to a specific specimen.) - */ - public List getSpecimenTarget() { - if (this.specimenTarget == null) - this.specimenTarget = new ArrayList(); - return this.specimenTarget; - } - - // syntactic sugar - /** - * @return {@link #specimen} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. If the item is related to a specific specimen.) - */ - public Specimen addSpecimenTarget() { - Specimen r = new Specimen(); - if (this.specimenTarget == null) - this.specimenTarget = new ArrayList(); - this.specimenTarget.add(r); - return r; - } - - /** - * @return {@link #bodySite} (Anatomical location where the request test should be performed. This is the target site.) - */ - public Type getBodySite() { - return this.bodySite; - } - - /** - * @return {@link #bodySite} (Anatomical location where the request test should be performed. This is the target site.) - */ - public CodeableConcept getBodySiteCodeableConcept() throws Exception { - if (!(this.bodySite instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.bodySite.getClass().getName()+" was encountered"); - return (CodeableConcept) this.bodySite; - } - - /** - * @return {@link #bodySite} (Anatomical location where the request test should be performed. This is the target site.) - */ - public Reference getBodySiteReference() throws Exception { - if (!(this.bodySite instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.bodySite.getClass().getName()+" was encountered"); - return (Reference) this.bodySite; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Anatomical location where the request test should be performed. This is the target site.) - */ - public DiagnosticOrderItemComponent setBodySite(Type value) { - this.bodySite = value; - return this; - } - - /** - * @return {@link #status} (The status of this individual item within the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrderItemComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of this individual item within the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DiagnosticOrderItemComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of this individual item within the order. - */ - public DiagnosticOrderStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of this individual item within the order. - */ - public DiagnosticOrderItemComponent setStatus(DiagnosticOrderStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #event} (A summary of the events of interest that have occurred as this item of the request is processed.) - */ - public List getEvent() { - if (this.event == null) - this.event = new ArrayList(); - return this.event; - } - - public boolean hasEvent() { - if (this.event == null) - return false; - for (DiagnosticOrderEventComponent item : this.event) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #event} (A summary of the events of interest that have occurred as this item of the request is processed.) - */ - // syntactic sugar - public DiagnosticOrderEventComponent addEvent() { //3 - DiagnosticOrderEventComponent t = new DiagnosticOrderEventComponent(); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return t; - } - - // syntactic sugar - public DiagnosticOrderItemComponent addEvent(DiagnosticOrderEventComponent t) { //3 - if (t == null) - return this; - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("specimen", "Reference(Specimen)", "If the item is related to a specific specimen.", 0, java.lang.Integer.MAX_VALUE, specimen)); - childrenList.add(new Property("bodySite[x]", "CodeableConcept|Reference(BodySite)", "Anatomical location where the request test should be performed. This is the target site.", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("status", "code", "The status of this individual item within the order.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("event", "@DiagnosticOrder.event", "A summary of the events of interest that have occurred as this item of the request is processed.", 0, java.lang.Integer.MAX_VALUE, event)); - } - - public DiagnosticOrderItemComponent copy() { - DiagnosticOrderItemComponent dst = new DiagnosticOrderItemComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - if (specimen != null) { - dst.specimen = new ArrayList(); - for (Reference i : specimen) - dst.specimen.add(i.copy()); - }; - dst.bodySite = bodySite == null ? null : bodySite.copy(); - dst.status = status == null ? null : status.copy(); - if (event != null) { - dst.event = new ArrayList(); - for (DiagnosticOrderEventComponent i : event) - dst.event.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DiagnosticOrderItemComponent)) - return false; - DiagnosticOrderItemComponent o = (DiagnosticOrderItemComponent) other; - return compareDeep(code, o.code, true) && compareDeep(specimen, o.specimen, true) && compareDeep(bodySite, o.bodySite, true) - && compareDeep(status, o.status, true) && compareDeep(event, o.event, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DiagnosticOrderItemComponent)) - return false; - DiagnosticOrderItemComponent o = (DiagnosticOrderItemComponent) other; - return compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (specimen == null || specimen.isEmpty()) - && (bodySite == null || bodySite.isEmpty()) && (status == null || status.isEmpty()) && (event == null || event.isEmpty()) - ; - } - - } - - /** - * Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans). - */ - @Child(name = "subject", type = {Patient.class, Group.class, Location.class, Device.class}, order=0, min=1, max=1) - @Description(shortDefinition="Who and/or what test is about", formalDefinition="Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans)." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) - */ - protected Resource subjectTarget; - - /** - * The practitioner that holds legal responsibility for ordering the investigation. - */ - @Child(name = "orderer", type = {Practitioner.class}, order=1, min=0, max=1) - @Description(shortDefinition="Who ordered the test", formalDefinition="The practitioner that holds legal responsibility for ordering the investigation." ) - protected Reference orderer; - - /** - * The actual object that is the target of the reference (The practitioner that holds legal responsibility for ordering the investigation.) - */ - protected Practitioner ordererTarget; - - /** - * Identifiers assigned to this order by the order or by the receiver. - */ - @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Identifiers assigned to this order", formalDefinition="Identifiers assigned to this order by the order or by the receiver." ) - protected List identifier; - - /** - * An encounter that provides additional information about the healthcare context in which this request is made. - */ - @Child(name = "encounter", type = {Encounter.class}, order=3, min=0, max=1) - @Description(shortDefinition="The encounter that this diagnostic order is associated with", formalDefinition="An encounter that provides additional information about the healthcare context in which this request is made." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - protected Encounter encounterTarget; - - /** - * An explanation or justification for why this diagnostic investigation is being requested. - */ - @Child(name = "clinicalNotes", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Explanation/Justification for test", formalDefinition="An explanation or justification for why this diagnostic investigation is being requested." ) - protected StringType clinicalNotes; - - /** - * Additional clinical information about the patient or specimen that may influence test interpretations. - */ - @Child(name = "supportingInformation", type = {Observation.class, Condition.class, DocumentReference.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Additional clinical information", formalDefinition="Additional clinical information about the patient or specimen that may influence test interpretations." ) - protected List supportingInformation; - /** - * The actual objects that are the target of the reference (Additional clinical information about the patient or specimen that may influence test interpretations.) - */ - protected List supportingInformationTarget; - - - /** - * One or more specimens that the diagnostic investigation is about. - */ - @Child(name = "specimen", type = {Specimen.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="If the whole order relates to specific specimens", formalDefinition="One or more specimens that the diagnostic investigation is about." ) - protected List specimen; - /** - * The actual objects that are the target of the reference (One or more specimens that the diagnostic investigation is about.) - */ - protected List specimenTarget; - - - /** - * The status of the order. - */ - @Child(name = "status", type = {CodeType.class}, order=7, min=0, max=1) - @Description(shortDefinition="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed", formalDefinition="The status of the order." ) - protected Enumeration status; - - /** - * The clinical priority associated with this order. - */ - @Child(name = "priority", type = {CodeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="routine | urgent | stat | asap", formalDefinition="The clinical priority associated with this order." ) - protected Enumeration priority; - - /** - * A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed. - */ - @Child(name = "event", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A list of events of interest in the lifecycle", formalDefinition="A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed." ) - protected List event; - - /** - * The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested. - */ - @Child(name = "item", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The items the orderer requested", formalDefinition="The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested." ) - protected List item; - - private static final long serialVersionUID = 1028294242L; - - /* - * Constructor - */ - public DiagnosticOrder() { - super(); - } - - /* - * Constructor - */ - public DiagnosticOrder(Reference subject) { - super(); - this.subject = subject; - } - - /** - * @return {@link #subject} (Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) - */ - public DiagnosticOrder setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) - */ - public DiagnosticOrder setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #orderer} (The practitioner that holds legal responsibility for ordering the investigation.) - */ - public Reference getOrderer() { - if (this.orderer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.orderer"); - else if (Configuration.doAutoCreate()) - this.orderer = new Reference(); // cc - return this.orderer; - } - - public boolean hasOrderer() { - return this.orderer != null && !this.orderer.isEmpty(); - } - - /** - * @param value {@link #orderer} (The practitioner that holds legal responsibility for ordering the investigation.) - */ - public DiagnosticOrder setOrderer(Reference value) { - this.orderer = value; - return this; - } - - /** - * @return {@link #orderer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner that holds legal responsibility for ordering the investigation.) - */ - public Practitioner getOrdererTarget() { - if (this.ordererTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.orderer"); - else if (Configuration.doAutoCreate()) - this.ordererTarget = new Practitioner(); // aa - return this.ordererTarget; - } - - /** - * @param value {@link #orderer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner that holds legal responsibility for ordering the investigation.) - */ - public DiagnosticOrder setOrdererTarget(Practitioner value) { - this.ordererTarget = value; - return this; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the order or by the receiver.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the order or by the receiver.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public DiagnosticOrder addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - public DiagnosticOrder setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - public DiagnosticOrder setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #clinicalNotes} (An explanation or justification for why this diagnostic investigation is being requested.). This is the underlying object with id, value and extensions. The accessor "getClinicalNotes" gives direct access to the value - */ - public StringType getClinicalNotesElement() { - if (this.clinicalNotes == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.clinicalNotes"); - else if (Configuration.doAutoCreate()) - this.clinicalNotes = new StringType(); // bb - return this.clinicalNotes; - } - - public boolean hasClinicalNotesElement() { - return this.clinicalNotes != null && !this.clinicalNotes.isEmpty(); - } - - public boolean hasClinicalNotes() { - return this.clinicalNotes != null && !this.clinicalNotes.isEmpty(); - } - - /** - * @param value {@link #clinicalNotes} (An explanation or justification for why this diagnostic investigation is being requested.). This is the underlying object with id, value and extensions. The accessor "getClinicalNotes" gives direct access to the value - */ - public DiagnosticOrder setClinicalNotesElement(StringType value) { - this.clinicalNotes = value; - return this; - } - - /** - * @return An explanation or justification for why this diagnostic investigation is being requested. - */ - public String getClinicalNotes() { - return this.clinicalNotes == null ? null : this.clinicalNotes.getValue(); - } - - /** - * @param value An explanation or justification for why this diagnostic investigation is being requested. - */ - public DiagnosticOrder setClinicalNotes(String value) { - if (Utilities.noString(value)) - this.clinicalNotes = null; - else { - if (this.clinicalNotes == null) - this.clinicalNotes = new StringType(); - this.clinicalNotes.setValue(value); - } - return this; - } - - /** - * @return {@link #supportingInformation} (Additional clinical information about the patient or specimen that may influence test interpretations.) - */ - public List getSupportingInformation() { - if (this.supportingInformation == null) - this.supportingInformation = new ArrayList(); - return this.supportingInformation; - } - - public boolean hasSupportingInformation() { - if (this.supportingInformation == null) - return false; - for (Reference item : this.supportingInformation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #supportingInformation} (Additional clinical information about the patient or specimen that may influence test interpretations.) - */ - // syntactic sugar - public Reference addSupportingInformation() { //3 - Reference t = new Reference(); - if (this.supportingInformation == null) - this.supportingInformation = new ArrayList(); - this.supportingInformation.add(t); - return t; - } - - // syntactic sugar - public DiagnosticOrder addSupportingInformation(Reference t) { //3 - if (t == null) - return this; - if (this.supportingInformation == null) - this.supportingInformation = new ArrayList(); - this.supportingInformation.add(t); - return this; - } - - /** - * @return {@link #supportingInformation} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Additional clinical information about the patient or specimen that may influence test interpretations.) - */ - public List getSupportingInformationTarget() { - if (this.supportingInformationTarget == null) - this.supportingInformationTarget = new ArrayList(); - return this.supportingInformationTarget; - } - - /** - * @return {@link #specimen} (One or more specimens that the diagnostic investigation is about.) - */ - public List getSpecimen() { - if (this.specimen == null) - this.specimen = new ArrayList(); - return this.specimen; - } - - public boolean hasSpecimen() { - if (this.specimen == null) - return false; - for (Reference item : this.specimen) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specimen} (One or more specimens that the diagnostic investigation is about.) - */ - // syntactic sugar - public Reference addSpecimen() { //3 - Reference t = new Reference(); - if (this.specimen == null) - this.specimen = new ArrayList(); - this.specimen.add(t); - return t; - } - - // syntactic sugar - public DiagnosticOrder addSpecimen(Reference t) { //3 - if (t == null) - return this; - if (this.specimen == null) - this.specimen = new ArrayList(); - this.specimen.add(t); - return this; - } - - /** - * @return {@link #specimen} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. One or more specimens that the diagnostic investigation is about.) - */ - public List getSpecimenTarget() { - if (this.specimenTarget == null) - this.specimenTarget = new ArrayList(); - return this.specimenTarget; - } - - // syntactic sugar - /** - * @return {@link #specimen} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. One or more specimens that the diagnostic investigation is about.) - */ - public Specimen addSpecimenTarget() { - Specimen r = new Specimen(); - if (this.specimenTarget == null) - this.specimenTarget = new ArrayList(); - this.specimenTarget.add(r); - return r; - } - - /** - * @return {@link #status} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DiagnosticOrder setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the order. - */ - public DiagnosticOrderStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the order. - */ - public DiagnosticOrder setStatus(DiagnosticOrderStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public Enumeration getPriorityElement() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new Enumeration(new DiagnosticOrderPriorityEnumFactory()); // bb - return this.priority; - } - - public boolean hasPriorityElement() { - return this.priority != null && !this.priority.isEmpty(); - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public DiagnosticOrder setPriorityElement(Enumeration value) { - this.priority = value; - return this; - } - - /** - * @return The clinical priority associated with this order. - */ - public DiagnosticOrderPriority getPriority() { - return this.priority == null ? null : this.priority.getValue(); - } - - /** - * @param value The clinical priority associated with this order. - */ - public DiagnosticOrder setPriority(DiagnosticOrderPriority value) { - if (value == null) - this.priority = null; - else { - if (this.priority == null) - this.priority = new Enumeration(new DiagnosticOrderPriorityEnumFactory()); - this.priority.setValue(value); - } - return this; - } - - /** - * @return {@link #event} (A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed.) - */ - public List getEvent() { - if (this.event == null) - this.event = new ArrayList(); - return this.event; - } - - public boolean hasEvent() { - if (this.event == null) - return false; - for (DiagnosticOrderEventComponent item : this.event) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #event} (A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed.) - */ - // syntactic sugar - public DiagnosticOrderEventComponent addEvent() { //3 - DiagnosticOrderEventComponent t = new DiagnosticOrderEventComponent(); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return t; - } - - // syntactic sugar - public DiagnosticOrder addEvent(DiagnosticOrderEventComponent t) { //3 - if (t == null) - return this; - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return this; - } - - /** - * @return {@link #item} (The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (DiagnosticOrderItemComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested.) - */ - // syntactic sugar - public DiagnosticOrderItemComponent addItem() { //3 - DiagnosticOrderItemComponent t = new DiagnosticOrderItemComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - // syntactic sugar - public DiagnosticOrder addItem(DiagnosticOrderItemComponent t) { //3 - if (t == null) - return this; - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("subject", "Reference(Patient|Group|Location|Device)", "Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("orderer", "Reference(Practitioner)", "The practitioner that holds legal responsibility for ordering the investigation.", 0, java.lang.Integer.MAX_VALUE, orderer)); - childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the order or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional information about the healthcare context in which this request is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("clinicalNotes", "string", "An explanation or justification for why this diagnostic investigation is being requested.", 0, java.lang.Integer.MAX_VALUE, clinicalNotes)); - childrenList.add(new Property("supportingInformation", "Reference(Observation|Condition|DocumentReference)", "Additional clinical information about the patient or specimen that may influence test interpretations.", 0, java.lang.Integer.MAX_VALUE, supportingInformation)); - childrenList.add(new Property("specimen", "Reference(Specimen)", "One or more specimens that the diagnostic investigation is about.", 0, java.lang.Integer.MAX_VALUE, specimen)); - childrenList.add(new Property("status", "code", "The status of the order.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("priority", "code", "The clinical priority associated with this order.", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("event", "", "A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed.", 0, java.lang.Integer.MAX_VALUE, event)); - childrenList.add(new Property("item", "", "The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested.", 0, java.lang.Integer.MAX_VALUE, item)); - } - - public DiagnosticOrder copy() { - DiagnosticOrder dst = new DiagnosticOrder(); - copyValues(dst); - dst.subject = subject == null ? null : subject.copy(); - dst.orderer = orderer == null ? null : orderer.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.encounter = encounter == null ? null : encounter.copy(); - dst.clinicalNotes = clinicalNotes == null ? null : clinicalNotes.copy(); - if (supportingInformation != null) { - dst.supportingInformation = new ArrayList(); - for (Reference i : supportingInformation) - dst.supportingInformation.add(i.copy()); - }; - if (specimen != null) { - dst.specimen = new ArrayList(); - for (Reference i : specimen) - dst.specimen.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.priority = priority == null ? null : priority.copy(); - if (event != null) { - dst.event = new ArrayList(); - for (DiagnosticOrderEventComponent i : event) - dst.event.add(i.copy()); - }; - if (item != null) { - dst.item = new ArrayList(); - for (DiagnosticOrderItemComponent i : item) - dst.item.add(i.copy()); - }; - return dst; - } - - protected DiagnosticOrder typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DiagnosticOrder)) - return false; - DiagnosticOrder o = (DiagnosticOrder) other; - return compareDeep(subject, o.subject, true) && compareDeep(orderer, o.orderer, true) && compareDeep(identifier, o.identifier, true) - && compareDeep(encounter, o.encounter, true) && compareDeep(clinicalNotes, o.clinicalNotes, true) - && compareDeep(supportingInformation, o.supportingInformation, true) && compareDeep(specimen, o.specimen, true) - && compareDeep(status, o.status, true) && compareDeep(priority, o.priority, true) && compareDeep(event, o.event, true) - && compareDeep(item, o.item, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DiagnosticOrder)) - return false; - DiagnosticOrder o = (DiagnosticOrder) other; - return compareValues(clinicalNotes, o.clinicalNotes, true) && compareValues(status, o.status, true) - && compareValues(priority, o.priority, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (subject == null || subject.isEmpty()) && (orderer == null || orderer.isEmpty()) - && (identifier == null || identifier.isEmpty()) && (encounter == null || encounter.isEmpty()) - && (clinicalNotes == null || clinicalNotes.isEmpty()) && (supportingInformation == null || supportingInformation.isEmpty()) - && (specimen == null || specimen.isEmpty()) && (status == null || status.isEmpty()) && (priority == null || priority.isEmpty()) - && (event == null || event.isEmpty()) && (item == null || item.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DiagnosticOrder; - } - - @SearchParamDefinition(name="orderer", path="DiagnosticOrder.orderer", description="Who ordered the test", type="reference" ) - public static final String SP_ORDERER = "orderer"; - @SearchParamDefinition(name="status", path="DiagnosticOrder.status", description="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="subject", path="DiagnosticOrder.subject", description="Who and/or what test is about", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="item-status", path="DiagnosticOrder.item.status", description="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed", type="token" ) - public static final String SP_ITEMSTATUS = "item-status"; - @SearchParamDefinition(name="event-status", path="DiagnosticOrder.event.status", description="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed", type="token" ) - public static final String SP_EVENTSTATUS = "event-status"; - @SearchParamDefinition(name="actor", path="DiagnosticOrder.event.actor|DiagnosticOrder.item.event.actor", description="Who recorded or did this", type="reference" ) - public static final String SP_ACTOR = "actor"; - @SearchParamDefinition(name="code", path="DiagnosticOrder.item.code", description="Code to indicate the item (test or panel) being ordered", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="encounter", path="DiagnosticOrder.encounter", description="The encounter that this diagnostic order is associated with", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - @SearchParamDefinition(name="item-past-status", path="DiagnosticOrder.item.event.status", description="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed", type="token" ) - public static final String SP_ITEMPASTSTATUS = "item-past-status"; - @SearchParamDefinition(name="patient", path="DiagnosticOrder.subject", description="Who and/or what test is about", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="bodysite", path="DiagnosticOrder.item.bodySite[x]", description="Location of requested test (if applicable)", type="token" ) - public static final String SP_BODYSITE = "bodysite"; - @SearchParamDefinition(name="item-date", path="DiagnosticOrder.item.event.dateTime", description="The date at which the event happened", type="date" ) - public static final String SP_ITEMDATE = "item-date"; - @SearchParamDefinition(name="specimen", path="DiagnosticOrder.specimen|DiagnosticOrder.item.specimen", description="If the whole order relates to specific specimens", type="reference" ) - public static final String SP_SPECIMEN = "specimen"; - @SearchParamDefinition(name="event-status-date", path="", description="A combination of past-status and date", type="composite" ) - public static final String SP_EVENTSTATUSDATE = "event-status-date"; - @SearchParamDefinition(name="event-date", path="DiagnosticOrder.event.dateTime", description="The date at which the event happened", type="date" ) - public static final String SP_EVENTDATE = "event-date"; - @SearchParamDefinition(name="identifier", path="DiagnosticOrder.identifier", description="Identifiers assigned to this order", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="item-status-date", path="", description="A combination of item-past-status and item-date", type="composite" ) - public static final String SP_ITEMSTATUSDATE = "item-status-date"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A record of a request for a diagnostic investigation service to be performed. + */ +@ResourceDef(name="DiagnosticOrder", profile="http://hl7.org/fhir/Profile/DiagnosticOrder") +public class DiagnosticOrder extends DomainResource { + + public enum DiagnosticOrderStatus { + /** + * The request has been proposed. + */ + PROPOSED, + /** + * the request is in preliminary form prior to being sent. + */ + DRAFT, + /** + * The request has been planned. + */ + PLANNED, + /** + * The request has been placed. + */ + REQUESTED, + /** + * The receiving system has received the order, but not yet decided whether it will be performed. + */ + RECEIVED, + /** + * The receiving system has accepted the order, but work has not yet commenced. + */ + ACCEPTED, + /** + * The work to fulfill the order is happening. + */ + INPROGRESS, + /** + * The work is complete, and the outcomes are being reviewed for approval. + */ + REVIEW, + /** + * The work has been complete, the report(s) released, and no further work is planned. + */ + COMPLETED, + /** + * the request has been withdrawn. + */ + CANCELLED, + /** + * The request has been held by originating system/user request. + */ + SUSPENDED, + /** + * The receiving system has declined to fulfill the request. + */ + REJECTED, + /** + * The diagnostic investigation was attempted, but due to some procedural error, it could not be completed. + */ + FAILED, + /** + * added to help the parsers + */ + NULL; + public static DiagnosticOrderStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("draft".equals(codeString)) + return DRAFT; + if ("planned".equals(codeString)) + return PLANNED; + if ("requested".equals(codeString)) + return REQUESTED; + if ("received".equals(codeString)) + return RECEIVED; + if ("accepted".equals(codeString)) + return ACCEPTED; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("review".equals(codeString)) + return REVIEW; + if ("completed".equals(codeString)) + return COMPLETED; + if ("cancelled".equals(codeString)) + return CANCELLED; + if ("suspended".equals(codeString)) + return SUSPENDED; + if ("rejected".equals(codeString)) + return REJECTED; + if ("failed".equals(codeString)) + return FAILED; + throw new Exception("Unknown DiagnosticOrderStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROPOSED: return "proposed"; + case DRAFT: return "draft"; + case PLANNED: return "planned"; + case REQUESTED: return "requested"; + case RECEIVED: return "received"; + case ACCEPTED: return "accepted"; + case INPROGRESS: return "in-progress"; + case REVIEW: return "review"; + case COMPLETED: return "completed"; + case CANCELLED: return "cancelled"; + case SUSPENDED: return "suspended"; + case REJECTED: return "rejected"; + case FAILED: return "failed"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROPOSED: return ""; + case DRAFT: return ""; + case PLANNED: return ""; + case REQUESTED: return ""; + case RECEIVED: return ""; + case ACCEPTED: return ""; + case INPROGRESS: return ""; + case REVIEW: return ""; + case COMPLETED: return ""; + case CANCELLED: return ""; + case SUSPENDED: return ""; + case REJECTED: return ""; + case FAILED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROPOSED: return "The request has been proposed."; + case DRAFT: return "the request is in preliminary form prior to being sent."; + case PLANNED: return "The request has been planned."; + case REQUESTED: return "The request has been placed."; + case RECEIVED: return "The receiving system has received the order, but not yet decided whether it will be performed."; + case ACCEPTED: return "The receiving system has accepted the order, but work has not yet commenced."; + case INPROGRESS: return "The work to fulfill the order is happening."; + case REVIEW: return "The work is complete, and the outcomes are being reviewed for approval."; + case COMPLETED: return "The work has been complete, the report(s) released, and no further work is planned."; + case CANCELLED: return "the request has been withdrawn."; + case SUSPENDED: return "The request has been held by originating system/user request."; + case REJECTED: return "The receiving system has declined to fulfill the request."; + case FAILED: return "The diagnostic investigation was attempted, but due to some procedural error, it could not be completed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROPOSED: return "Proposed"; + case DRAFT: return "Draft"; + case PLANNED: return "Planned"; + case REQUESTED: return "Requested"; + case RECEIVED: return "Received"; + case ACCEPTED: return "Accepted"; + case INPROGRESS: return "In-Progress"; + case REVIEW: return "Review"; + case COMPLETED: return "Completed"; + case CANCELLED: return "Cancelled"; + case SUSPENDED: return "Suspended"; + case REJECTED: return "Rejected"; + case FAILED: return "Failed"; + default: return "?"; + } + } + } + + public static class DiagnosticOrderStatusEnumFactory implements EnumFactory { + public DiagnosticOrderStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return DiagnosticOrderStatus.PROPOSED; + if ("draft".equals(codeString)) + return DiagnosticOrderStatus.DRAFT; + if ("planned".equals(codeString)) + return DiagnosticOrderStatus.PLANNED; + if ("requested".equals(codeString)) + return DiagnosticOrderStatus.REQUESTED; + if ("received".equals(codeString)) + return DiagnosticOrderStatus.RECEIVED; + if ("accepted".equals(codeString)) + return DiagnosticOrderStatus.ACCEPTED; + if ("in-progress".equals(codeString)) + return DiagnosticOrderStatus.INPROGRESS; + if ("review".equals(codeString)) + return DiagnosticOrderStatus.REVIEW; + if ("completed".equals(codeString)) + return DiagnosticOrderStatus.COMPLETED; + if ("cancelled".equals(codeString)) + return DiagnosticOrderStatus.CANCELLED; + if ("suspended".equals(codeString)) + return DiagnosticOrderStatus.SUSPENDED; + if ("rejected".equals(codeString)) + return DiagnosticOrderStatus.REJECTED; + if ("failed".equals(codeString)) + return DiagnosticOrderStatus.FAILED; + throw new IllegalArgumentException("Unknown DiagnosticOrderStatus code '"+codeString+"'"); + } + public String toCode(DiagnosticOrderStatus code) { + if (code == DiagnosticOrderStatus.PROPOSED) + return "proposed"; + if (code == DiagnosticOrderStatus.DRAFT) + return "draft"; + if (code == DiagnosticOrderStatus.PLANNED) + return "planned"; + if (code == DiagnosticOrderStatus.REQUESTED) + return "requested"; + if (code == DiagnosticOrderStatus.RECEIVED) + return "received"; + if (code == DiagnosticOrderStatus.ACCEPTED) + return "accepted"; + if (code == DiagnosticOrderStatus.INPROGRESS) + return "in-progress"; + if (code == DiagnosticOrderStatus.REVIEW) + return "review"; + if (code == DiagnosticOrderStatus.COMPLETED) + return "completed"; + if (code == DiagnosticOrderStatus.CANCELLED) + return "cancelled"; + if (code == DiagnosticOrderStatus.SUSPENDED) + return "suspended"; + if (code == DiagnosticOrderStatus.REJECTED) + return "rejected"; + if (code == DiagnosticOrderStatus.FAILED) + return "failed"; + return "?"; + } + } + + public enum DiagnosticOrderPriority { + /** + * The order has a normal priority. + */ + ROUTINE, + /** + * The order should be urgently. + */ + URGENT, + /** + * The order is time-critical. + */ + STAT, + /** + * The order should be acted on as soon as possible. + */ + ASAP, + /** + * added to help the parsers + */ + NULL; + public static DiagnosticOrderPriority fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("routine".equals(codeString)) + return ROUTINE; + if ("urgent".equals(codeString)) + return URGENT; + if ("stat".equals(codeString)) + return STAT; + if ("asap".equals(codeString)) + return ASAP; + throw new Exception("Unknown DiagnosticOrderPriority code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ROUTINE: return "routine"; + case URGENT: return "urgent"; + case STAT: return "stat"; + case ASAP: return "asap"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ROUTINE: return ""; + case URGENT: return ""; + case STAT: return ""; + case ASAP: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ROUTINE: return "The order has a normal priority."; + case URGENT: return "The order should be urgently."; + case STAT: return "The order is time-critical."; + case ASAP: return "The order should be acted on as soon as possible."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ROUTINE: return "Routine"; + case URGENT: return "Urgent"; + case STAT: return "Stat"; + case ASAP: return "ASAP"; + default: return "?"; + } + } + } + + public static class DiagnosticOrderPriorityEnumFactory implements EnumFactory { + public DiagnosticOrderPriority fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("routine".equals(codeString)) + return DiagnosticOrderPriority.ROUTINE; + if ("urgent".equals(codeString)) + return DiagnosticOrderPriority.URGENT; + if ("stat".equals(codeString)) + return DiagnosticOrderPriority.STAT; + if ("asap".equals(codeString)) + return DiagnosticOrderPriority.ASAP; + throw new IllegalArgumentException("Unknown DiagnosticOrderPriority code '"+codeString+"'"); + } + public String toCode(DiagnosticOrderPriority code) { + if (code == DiagnosticOrderPriority.ROUTINE) + return "routine"; + if (code == DiagnosticOrderPriority.URGENT) + return "urgent"; + if (code == DiagnosticOrderPriority.STAT) + return "stat"; + if (code == DiagnosticOrderPriority.ASAP) + return "asap"; + return "?"; + } + } + + @Block() + public static class DiagnosticOrderEventComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The status for the event. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed", formalDefinition="The status for the event." ) + protected Enumeration status; + + /** + * Additional information about the event that occurred - e.g. if the status remained unchanged. + */ + @Child(name = "description", type = {CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="More information about the event and its context", formalDefinition="Additional information about the event that occurred - e.g. if the status remained unchanged." ) + protected CodeableConcept description; + + /** + * The date/time at which the event occurred. + */ + @Child(name = "dateTime", type = {DateTimeType.class}, order=3, min=1, max=1) + @Description(shortDefinition="The date at which the event happened", formalDefinition="The date/time at which the event occurred." ) + protected DateTimeType dateTime; + + /** + * The person who was responsible for performing or recording the action. + */ + @Child(name = "actor", type = {Practitioner.class, Device.class}, order=4, min=0, max=1) + @Description(shortDefinition="Who recorded or did this", formalDefinition="The person who was responsible for performing or recording the action." ) + protected Reference actor; + + /** + * The actual object that is the target of the reference (The person who was responsible for performing or recording the action.) + */ + protected Resource actorTarget; + + private static final long serialVersionUID = -370793723L; + + /* + * Constructor + */ + public DiagnosticOrderEventComponent() { + super(); + } + + /* + * Constructor + */ + public DiagnosticOrderEventComponent(Enumeration status, DateTimeType dateTime) { + super(); + this.status = status; + this.dateTime = dateTime; + } + + /** + * @return {@link #status} (The status for the event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status for the event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DiagnosticOrderEventComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status for the event. + */ + public DiagnosticOrderStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status for the event. + */ + public DiagnosticOrderEventComponent setStatus(DiagnosticOrderStatus value) { + if (this.status == null) + this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #description} (Additional information about the event that occurred - e.g. if the status remained unchanged.) + */ + public CodeableConcept getDescription() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new CodeableConcept(); // cc + return this.description; + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Additional information about the event that occurred - e.g. if the status remained unchanged.) + */ + public DiagnosticOrderEventComponent setDescription(CodeableConcept value) { + this.description = value; + return this; + } + + /** + * @return {@link #dateTime} (The date/time at which the event occurred.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public DateTimeType getDateTimeElement() { + if (this.dateTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.dateTime"); + else if (Configuration.doAutoCreate()) + this.dateTime = new DateTimeType(); // bb + return this.dateTime; + } + + public boolean hasDateTimeElement() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + public boolean hasDateTime() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + /** + * @param value {@link #dateTime} (The date/time at which the event occurred.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public DiagnosticOrderEventComponent setDateTimeElement(DateTimeType value) { + this.dateTime = value; + return this; + } + + /** + * @return The date/time at which the event occurred. + */ + public Date getDateTime() { + return this.dateTime == null ? null : this.dateTime.getValue(); + } + + /** + * @param value The date/time at which the event occurred. + */ + public DiagnosticOrderEventComponent setDateTime(Date value) { + if (this.dateTime == null) + this.dateTime = new DateTimeType(); + this.dateTime.setValue(value); + return this; + } + + /** + * @return {@link #actor} (The person who was responsible for performing or recording the action.) + */ + public Reference getActor() { + if (this.actor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.actor"); + else if (Configuration.doAutoCreate()) + this.actor = new Reference(); // cc + return this.actor; + } + + public boolean hasActor() { + return this.actor != null && !this.actor.isEmpty(); + } + + /** + * @param value {@link #actor} (The person who was responsible for performing or recording the action.) + */ + public DiagnosticOrderEventComponent setActor(Reference value) { + this.actor = value; + return this; + } + + /** + * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person who was responsible for performing or recording the action.) + */ + public Resource getActorTarget() { + return this.actorTarget; + } + + /** + * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person who was responsible for performing or recording the action.) + */ + public DiagnosticOrderEventComponent setActorTarget(Resource value) { + this.actorTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("status", "code", "The status for the event.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("description", "CodeableConcept", "Additional information about the event that occurred - e.g. if the status remained unchanged.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("dateTime", "dateTime", "The date/time at which the event occurred.", 0, java.lang.Integer.MAX_VALUE, dateTime)); + childrenList.add(new Property("actor", "Reference(Practitioner|Device)", "The person who was responsible for performing or recording the action.", 0, java.lang.Integer.MAX_VALUE, actor)); + } + + public DiagnosticOrderEventComponent copy() { + DiagnosticOrderEventComponent dst = new DiagnosticOrderEventComponent(); + copyValues(dst); + dst.status = status == null ? null : status.copy(); + dst.description = description == null ? null : description.copy(); + dst.dateTime = dateTime == null ? null : dateTime.copy(); + dst.actor = actor == null ? null : actor.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DiagnosticOrderEventComponent)) + return false; + DiagnosticOrderEventComponent o = (DiagnosticOrderEventComponent) other; + return compareDeep(status, o.status, true) && compareDeep(description, o.description, true) && compareDeep(dateTime, o.dateTime, true) + && compareDeep(actor, o.actor, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DiagnosticOrderEventComponent)) + return false; + DiagnosticOrderEventComponent o = (DiagnosticOrderEventComponent) other; + return compareValues(status, o.status, true) && compareValues(dateTime, o.dateTime, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (status == null || status.isEmpty()) && (description == null || description.isEmpty()) + && (dateTime == null || dateTime.isEmpty()) && (actor == null || actor.isEmpty()); + } + + } + + @Block() + public static class DiagnosticOrderItemComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Code to indicate the item (test or panel) being ordered", formalDefinition="A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested." ) + protected CodeableConcept code; + + /** + * If the item is related to a specific specimen. + */ + @Child(name = "specimen", type = {Specimen.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="If this item relates to specific specimens", formalDefinition="If the item is related to a specific specimen." ) + protected List specimen; + /** + * The actual objects that are the target of the reference (If the item is related to a specific specimen.) + */ + protected List specimenTarget; + + + /** + * Anatomical location where the request test should be performed. This is the target site. + */ + @Child(name = "bodySite", type = {CodeableConcept.class, BodySite.class}, order=3, min=0, max=1) + @Description(shortDefinition="Location of requested test (if applicable)", formalDefinition="Anatomical location where the request test should be performed. This is the target site." ) + protected Type bodySite; + + /** + * The status of this individual item within the order. + */ + @Child(name = "status", type = {CodeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed", formalDefinition="The status of this individual item within the order." ) + protected Enumeration status; + + /** + * A summary of the events of interest that have occurred as this item of the request is processed. + */ + @Child(name = "event", type = {DiagnosticOrderEventComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Events specific to this item", formalDefinition="A summary of the events of interest that have occurred as this item of the request is processed." ) + protected List event; + + private static final long serialVersionUID = 1960490281L; + + /* + * Constructor + */ + public DiagnosticOrderItemComponent() { + super(); + } + + /* + * Constructor + */ + public DiagnosticOrderItemComponent(CodeableConcept code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrderItemComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested.) + */ + public DiagnosticOrderItemComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #specimen} (If the item is related to a specific specimen.) + */ + public List getSpecimen() { + if (this.specimen == null) + this.specimen = new ArrayList(); + return this.specimen; + } + + public boolean hasSpecimen() { + if (this.specimen == null) + return false; + for (Reference item : this.specimen) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specimen} (If the item is related to a specific specimen.) + */ + // syntactic sugar + public Reference addSpecimen() { //3 + Reference t = new Reference(); + if (this.specimen == null) + this.specimen = new ArrayList(); + this.specimen.add(t); + return t; + } + + // syntactic sugar + public DiagnosticOrderItemComponent addSpecimen(Reference t) { //3 + if (t == null) + return this; + if (this.specimen == null) + this.specimen = new ArrayList(); + this.specimen.add(t); + return this; + } + + /** + * @return {@link #specimen} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. If the item is related to a specific specimen.) + */ + public List getSpecimenTarget() { + if (this.specimenTarget == null) + this.specimenTarget = new ArrayList(); + return this.specimenTarget; + } + + // syntactic sugar + /** + * @return {@link #specimen} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. If the item is related to a specific specimen.) + */ + public Specimen addSpecimenTarget() { + Specimen r = new Specimen(); + if (this.specimenTarget == null) + this.specimenTarget = new ArrayList(); + this.specimenTarget.add(r); + return r; + } + + /** + * @return {@link #bodySite} (Anatomical location where the request test should be performed. This is the target site.) + */ + public Type getBodySite() { + return this.bodySite; + } + + /** + * @return {@link #bodySite} (Anatomical location where the request test should be performed. This is the target site.) + */ + public CodeableConcept getBodySiteCodeableConcept() throws Exception { + if (!(this.bodySite instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.bodySite.getClass().getName()+" was encountered"); + return (CodeableConcept) this.bodySite; + } + + /** + * @return {@link #bodySite} (Anatomical location where the request test should be performed. This is the target site.) + */ + public Reference getBodySiteReference() throws Exception { + if (!(this.bodySite instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.bodySite.getClass().getName()+" was encountered"); + return (Reference) this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Anatomical location where the request test should be performed. This is the target site.) + */ + public DiagnosticOrderItemComponent setBodySite(Type value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #status} (The status of this individual item within the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrderItemComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status of this individual item within the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DiagnosticOrderItemComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of this individual item within the order. + */ + public DiagnosticOrderStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of this individual item within the order. + */ + public DiagnosticOrderItemComponent setStatus(DiagnosticOrderStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #event} (A summary of the events of interest that have occurred as this item of the request is processed.) + */ + public List getEvent() { + if (this.event == null) + this.event = new ArrayList(); + return this.event; + } + + public boolean hasEvent() { + if (this.event == null) + return false; + for (DiagnosticOrderEventComponent item : this.event) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #event} (A summary of the events of interest that have occurred as this item of the request is processed.) + */ + // syntactic sugar + public DiagnosticOrderEventComponent addEvent() { //3 + DiagnosticOrderEventComponent t = new DiagnosticOrderEventComponent(); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return t; + } + + // syntactic sugar + public DiagnosticOrderItemComponent addEvent(DiagnosticOrderEventComponent t) { //3 + if (t == null) + return this; + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("specimen", "Reference(Specimen)", "If the item is related to a specific specimen.", 0, java.lang.Integer.MAX_VALUE, specimen)); + childrenList.add(new Property("bodySite[x]", "CodeableConcept|Reference(BodySite)", "Anatomical location where the request test should be performed. This is the target site.", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("status", "code", "The status of this individual item within the order.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("event", "@DiagnosticOrder.event", "A summary of the events of interest that have occurred as this item of the request is processed.", 0, java.lang.Integer.MAX_VALUE, event)); + } + + public DiagnosticOrderItemComponent copy() { + DiagnosticOrderItemComponent dst = new DiagnosticOrderItemComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + if (specimen != null) { + dst.specimen = new ArrayList(); + for (Reference i : specimen) + dst.specimen.add(i.copy()); + }; + dst.bodySite = bodySite == null ? null : bodySite.copy(); + dst.status = status == null ? null : status.copy(); + if (event != null) { + dst.event = new ArrayList(); + for (DiagnosticOrderEventComponent i : event) + dst.event.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DiagnosticOrderItemComponent)) + return false; + DiagnosticOrderItemComponent o = (DiagnosticOrderItemComponent) other; + return compareDeep(code, o.code, true) && compareDeep(specimen, o.specimen, true) && compareDeep(bodySite, o.bodySite, true) + && compareDeep(status, o.status, true) && compareDeep(event, o.event, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DiagnosticOrderItemComponent)) + return false; + DiagnosticOrderItemComponent o = (DiagnosticOrderItemComponent) other; + return compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (specimen == null || specimen.isEmpty()) + && (bodySite == null || bodySite.isEmpty()) && (status == null || status.isEmpty()) && (event == null || event.isEmpty()) + ; + } + + } + + /** + * Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans). + */ + @Child(name = "subject", type = {Patient.class, Group.class, Location.class, Device.class}, order=0, min=1, max=1) + @Description(shortDefinition="Who and/or what test is about", formalDefinition="Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans)." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) + */ + protected Resource subjectTarget; + + /** + * The practitioner that holds legal responsibility for ordering the investigation. + */ + @Child(name = "orderer", type = {Practitioner.class}, order=1, min=0, max=1) + @Description(shortDefinition="Who ordered the test", formalDefinition="The practitioner that holds legal responsibility for ordering the investigation." ) + protected Reference orderer; + + /** + * The actual object that is the target of the reference (The practitioner that holds legal responsibility for ordering the investigation.) + */ + protected Practitioner ordererTarget; + + /** + * Identifiers assigned to this order by the order or by the receiver. + */ + @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Identifiers assigned to this order", formalDefinition="Identifiers assigned to this order by the order or by the receiver." ) + protected List identifier; + + /** + * An encounter that provides additional information about the healthcare context in which this request is made. + */ + @Child(name = "encounter", type = {Encounter.class}, order=3, min=0, max=1) + @Description(shortDefinition="The encounter that this diagnostic order is associated with", formalDefinition="An encounter that provides additional information about the healthcare context in which this request is made." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + protected Encounter encounterTarget; + + /** + * An explanation or justification for why this diagnostic investigation is being requested. + */ + @Child(name = "clinicalNotes", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Explanation/Justification for test", formalDefinition="An explanation or justification for why this diagnostic investigation is being requested." ) + protected StringType clinicalNotes; + + /** + * Additional clinical information about the patient or specimen that may influence test interpretations. + */ + @Child(name = "supportingInformation", type = {Observation.class, Condition.class, DocumentReference.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional clinical information", formalDefinition="Additional clinical information about the patient or specimen that may influence test interpretations." ) + protected List supportingInformation; + /** + * The actual objects that are the target of the reference (Additional clinical information about the patient or specimen that may influence test interpretations.) + */ + protected List supportingInformationTarget; + + + /** + * One or more specimens that the diagnostic investigation is about. + */ + @Child(name = "specimen", type = {Specimen.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="If the whole order relates to specific specimens", formalDefinition="One or more specimens that the diagnostic investigation is about." ) + protected List specimen; + /** + * The actual objects that are the target of the reference (One or more specimens that the diagnostic investigation is about.) + */ + protected List specimenTarget; + + + /** + * The status of the order. + */ + @Child(name = "status", type = {CodeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed", formalDefinition="The status of the order." ) + protected Enumeration status; + + /** + * The clinical priority associated with this order. + */ + @Child(name = "priority", type = {CodeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="routine | urgent | stat | asap", formalDefinition="The clinical priority associated with this order." ) + protected Enumeration priority; + + /** + * A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed. + */ + @Child(name = "event", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A list of events of interest in the lifecycle", formalDefinition="A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed." ) + protected List event; + + /** + * The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested. + */ + @Child(name = "item", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The items the orderer requested", formalDefinition="The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested." ) + protected List item; + + private static final long serialVersionUID = 1028294242L; + + /* + * Constructor + */ + public DiagnosticOrder() { + super(); + } + + /* + * Constructor + */ + public DiagnosticOrder(Reference subject) { + super(); + this.subject = subject; + } + + /** + * @return {@link #subject} (Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) + */ + public DiagnosticOrder setSubject(Reference value) { + this.subject = value; + return this; + } + + /** + * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) + */ + public Resource getSubjectTarget() { + return this.subjectTarget; + } + + /** + * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) + */ + public DiagnosticOrder setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #orderer} (The practitioner that holds legal responsibility for ordering the investigation.) + */ + public Reference getOrderer() { + if (this.orderer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.orderer"); + else if (Configuration.doAutoCreate()) + this.orderer = new Reference(); // cc + return this.orderer; + } + + public boolean hasOrderer() { + return this.orderer != null && !this.orderer.isEmpty(); + } + + /** + * @param value {@link #orderer} (The practitioner that holds legal responsibility for ordering the investigation.) + */ + public DiagnosticOrder setOrderer(Reference value) { + this.orderer = value; + return this; + } + + /** + * @return {@link #orderer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner that holds legal responsibility for ordering the investigation.) + */ + public Practitioner getOrdererTarget() { + if (this.ordererTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.orderer"); + else if (Configuration.doAutoCreate()) + this.ordererTarget = new Practitioner(); // aa + return this.ordererTarget; + } + + /** + * @param value {@link #orderer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner that holds legal responsibility for ordering the investigation.) + */ + public DiagnosticOrder setOrdererTarget(Practitioner value) { + this.ordererTarget = value; + return this; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order by the order or by the receiver.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order by the order or by the receiver.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public DiagnosticOrder addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + public DiagnosticOrder setEncounter(Reference value) { + this.encounter = value; + return this; + } + + /** + * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + return this.encounterTarget; + } + + /** + * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + public DiagnosticOrder setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #clinicalNotes} (An explanation or justification for why this diagnostic investigation is being requested.). This is the underlying object with id, value and extensions. The accessor "getClinicalNotes" gives direct access to the value + */ + public StringType getClinicalNotesElement() { + if (this.clinicalNotes == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.clinicalNotes"); + else if (Configuration.doAutoCreate()) + this.clinicalNotes = new StringType(); // bb + return this.clinicalNotes; + } + + public boolean hasClinicalNotesElement() { + return this.clinicalNotes != null && !this.clinicalNotes.isEmpty(); + } + + public boolean hasClinicalNotes() { + return this.clinicalNotes != null && !this.clinicalNotes.isEmpty(); + } + + /** + * @param value {@link #clinicalNotes} (An explanation or justification for why this diagnostic investigation is being requested.). This is the underlying object with id, value and extensions. The accessor "getClinicalNotes" gives direct access to the value + */ + public DiagnosticOrder setClinicalNotesElement(StringType value) { + this.clinicalNotes = value; + return this; + } + + /** + * @return An explanation or justification for why this diagnostic investigation is being requested. + */ + public String getClinicalNotes() { + return this.clinicalNotes == null ? null : this.clinicalNotes.getValue(); + } + + /** + * @param value An explanation or justification for why this diagnostic investigation is being requested. + */ + public DiagnosticOrder setClinicalNotes(String value) { + if (Utilities.noString(value)) + this.clinicalNotes = null; + else { + if (this.clinicalNotes == null) + this.clinicalNotes = new StringType(); + this.clinicalNotes.setValue(value); + } + return this; + } + + /** + * @return {@link #supportingInformation} (Additional clinical information about the patient or specimen that may influence test interpretations.) + */ + public List getSupportingInformation() { + if (this.supportingInformation == null) + this.supportingInformation = new ArrayList(); + return this.supportingInformation; + } + + public boolean hasSupportingInformation() { + if (this.supportingInformation == null) + return false; + for (Reference item : this.supportingInformation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #supportingInformation} (Additional clinical information about the patient or specimen that may influence test interpretations.) + */ + // syntactic sugar + public Reference addSupportingInformation() { //3 + Reference t = new Reference(); + if (this.supportingInformation == null) + this.supportingInformation = new ArrayList(); + this.supportingInformation.add(t); + return t; + } + + // syntactic sugar + public DiagnosticOrder addSupportingInformation(Reference t) { //3 + if (t == null) + return this; + if (this.supportingInformation == null) + this.supportingInformation = new ArrayList(); + this.supportingInformation.add(t); + return this; + } + + /** + * @return {@link #supportingInformation} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Additional clinical information about the patient or specimen that may influence test interpretations.) + */ + public List getSupportingInformationTarget() { + if (this.supportingInformationTarget == null) + this.supportingInformationTarget = new ArrayList(); + return this.supportingInformationTarget; + } + + /** + * @return {@link #specimen} (One or more specimens that the diagnostic investigation is about.) + */ + public List getSpecimen() { + if (this.specimen == null) + this.specimen = new ArrayList(); + return this.specimen; + } + + public boolean hasSpecimen() { + if (this.specimen == null) + return false; + for (Reference item : this.specimen) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specimen} (One or more specimens that the diagnostic investigation is about.) + */ + // syntactic sugar + public Reference addSpecimen() { //3 + Reference t = new Reference(); + if (this.specimen == null) + this.specimen = new ArrayList(); + this.specimen.add(t); + return t; + } + + // syntactic sugar + public DiagnosticOrder addSpecimen(Reference t) { //3 + if (t == null) + return this; + if (this.specimen == null) + this.specimen = new ArrayList(); + this.specimen.add(t); + return this; + } + + /** + * @return {@link #specimen} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. One or more specimens that the diagnostic investigation is about.) + */ + public List getSpecimenTarget() { + if (this.specimenTarget == null) + this.specimenTarget = new ArrayList(); + return this.specimenTarget; + } + + // syntactic sugar + /** + * @return {@link #specimen} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. One or more specimens that the diagnostic investigation is about.) + */ + public Specimen addSpecimenTarget() { + Specimen r = new Specimen(); + if (this.specimenTarget == null) + this.specimenTarget = new ArrayList(); + this.specimenTarget.add(r); + return r; + } + + /** + * @return {@link #status} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DiagnosticOrder setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the order. + */ + public DiagnosticOrderStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the order. + */ + public DiagnosticOrder setStatus(DiagnosticOrderStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public Enumeration getPriorityElement() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Enumeration(new DiagnosticOrderPriorityEnumFactory()); // bb + return this.priority; + } + + public boolean hasPriorityElement() { + return this.priority != null && !this.priority.isEmpty(); + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public DiagnosticOrder setPriorityElement(Enumeration value) { + this.priority = value; + return this; + } + + /** + * @return The clinical priority associated with this order. + */ + public DiagnosticOrderPriority getPriority() { + return this.priority == null ? null : this.priority.getValue(); + } + + /** + * @param value The clinical priority associated with this order. + */ + public DiagnosticOrder setPriority(DiagnosticOrderPriority value) { + if (value == null) + this.priority = null; + else { + if (this.priority == null) + this.priority = new Enumeration(new DiagnosticOrderPriorityEnumFactory()); + this.priority.setValue(value); + } + return this; + } + + /** + * @return {@link #event} (A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed.) + */ + public List getEvent() { + if (this.event == null) + this.event = new ArrayList(); + return this.event; + } + + public boolean hasEvent() { + if (this.event == null) + return false; + for (DiagnosticOrderEventComponent item : this.event) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #event} (A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed.) + */ + // syntactic sugar + public DiagnosticOrderEventComponent addEvent() { //3 + DiagnosticOrderEventComponent t = new DiagnosticOrderEventComponent(); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return t; + } + + // syntactic sugar + public DiagnosticOrder addEvent(DiagnosticOrderEventComponent t) { //3 + if (t == null) + return this; + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return this; + } + + /** + * @return {@link #item} (The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (DiagnosticOrderItemComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested.) + */ + // syntactic sugar + public DiagnosticOrderItemComponent addItem() { //3 + DiagnosticOrderItemComponent t = new DiagnosticOrderItemComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + // syntactic sugar + public DiagnosticOrder addItem(DiagnosticOrderItemComponent t) { //3 + if (t == null) + return this; + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("subject", "Reference(Patient|Group|Location|Device)", "Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("orderer", "Reference(Practitioner)", "The practitioner that holds legal responsibility for ordering the investigation.", 0, java.lang.Integer.MAX_VALUE, orderer)); + childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the order or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional information about the healthcare context in which this request is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("clinicalNotes", "string", "An explanation or justification for why this diagnostic investigation is being requested.", 0, java.lang.Integer.MAX_VALUE, clinicalNotes)); + childrenList.add(new Property("supportingInformation", "Reference(Observation|Condition|DocumentReference)", "Additional clinical information about the patient or specimen that may influence test interpretations.", 0, java.lang.Integer.MAX_VALUE, supportingInformation)); + childrenList.add(new Property("specimen", "Reference(Specimen)", "One or more specimens that the diagnostic investigation is about.", 0, java.lang.Integer.MAX_VALUE, specimen)); + childrenList.add(new Property("status", "code", "The status of the order.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("priority", "code", "The clinical priority associated with this order.", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("event", "", "A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed.", 0, java.lang.Integer.MAX_VALUE, event)); + childrenList.add(new Property("item", "", "The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested.", 0, java.lang.Integer.MAX_VALUE, item)); + } + + public DiagnosticOrder copy() { + DiagnosticOrder dst = new DiagnosticOrder(); + copyValues(dst); + dst.subject = subject == null ? null : subject.copy(); + dst.orderer = orderer == null ? null : orderer.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.encounter = encounter == null ? null : encounter.copy(); + dst.clinicalNotes = clinicalNotes == null ? null : clinicalNotes.copy(); + if (supportingInformation != null) { + dst.supportingInformation = new ArrayList(); + for (Reference i : supportingInformation) + dst.supportingInformation.add(i.copy()); + }; + if (specimen != null) { + dst.specimen = new ArrayList(); + for (Reference i : specimen) + dst.specimen.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.priority = priority == null ? null : priority.copy(); + if (event != null) { + dst.event = new ArrayList(); + for (DiagnosticOrderEventComponent i : event) + dst.event.add(i.copy()); + }; + if (item != null) { + dst.item = new ArrayList(); + for (DiagnosticOrderItemComponent i : item) + dst.item.add(i.copy()); + }; + return dst; + } + + protected DiagnosticOrder typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DiagnosticOrder)) + return false; + DiagnosticOrder o = (DiagnosticOrder) other; + return compareDeep(subject, o.subject, true) && compareDeep(orderer, o.orderer, true) && compareDeep(identifier, o.identifier, true) + && compareDeep(encounter, o.encounter, true) && compareDeep(clinicalNotes, o.clinicalNotes, true) + && compareDeep(supportingInformation, o.supportingInformation, true) && compareDeep(specimen, o.specimen, true) + && compareDeep(status, o.status, true) && compareDeep(priority, o.priority, true) && compareDeep(event, o.event, true) + && compareDeep(item, o.item, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DiagnosticOrder)) + return false; + DiagnosticOrder o = (DiagnosticOrder) other; + return compareValues(clinicalNotes, o.clinicalNotes, true) && compareValues(status, o.status, true) + && compareValues(priority, o.priority, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (subject == null || subject.isEmpty()) && (orderer == null || orderer.isEmpty()) + && (identifier == null || identifier.isEmpty()) && (encounter == null || encounter.isEmpty()) + && (clinicalNotes == null || clinicalNotes.isEmpty()) && (supportingInformation == null || supportingInformation.isEmpty()) + && (specimen == null || specimen.isEmpty()) && (status == null || status.isEmpty()) && (priority == null || priority.isEmpty()) + && (event == null || event.isEmpty()) && (item == null || item.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DiagnosticOrder; + } + + @SearchParamDefinition(name="item-past-status", path="DiagnosticOrder.item.event.status", description="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed", type="token" ) + public static final String SP_ITEMPASTSTATUS = "item-past-status"; + @SearchParamDefinition(name="identifier", path="DiagnosticOrder.identifier", description="Identifiers assigned to this order", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="bodysite", path="DiagnosticOrder.item.bodySite[x]", description="Location of requested test (if applicable)", type="token" ) + public static final String SP_BODYSITE = "bodysite"; + @SearchParamDefinition(name="code", path="DiagnosticOrder.item.code", description="Code to indicate the item (test or panel) being ordered", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="event-date", path="DiagnosticOrder.event.dateTime", description="The date at which the event happened", type="date" ) + public static final String SP_EVENTDATE = "event-date"; + @SearchParamDefinition(name="event-status-date", path="", description="A combination of past-status and date", type="composite" ) + public static final String SP_EVENTSTATUSDATE = "event-status-date"; + @SearchParamDefinition(name="subject", path="DiagnosticOrder.subject", description="Who and/or what test is about", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="encounter", path="DiagnosticOrder.encounter", description="The encounter that this diagnostic order is associated with", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + @SearchParamDefinition(name="actor", path="DiagnosticOrder.event.actor|DiagnosticOrder.item.event.actor", description="Who recorded or did this", type="reference" ) + public static final String SP_ACTOR = "actor"; + @SearchParamDefinition(name="item-date", path="DiagnosticOrder.item.event.dateTime", description="The date at which the event happened", type="date" ) + public static final String SP_ITEMDATE = "item-date"; + @SearchParamDefinition(name="item-status-date", path="", description="A combination of item-past-status and item-date", type="composite" ) + public static final String SP_ITEMSTATUSDATE = "item-status-date"; + @SearchParamDefinition(name="event-status", path="DiagnosticOrder.event.status", description="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed", type="token" ) + public static final String SP_EVENTSTATUS = "event-status"; + @SearchParamDefinition(name="item-status", path="DiagnosticOrder.item.status", description="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed", type="token" ) + public static final String SP_ITEMSTATUS = "item-status"; + @SearchParamDefinition(name="patient", path="DiagnosticOrder.subject", description="Who and/or what test is about", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="orderer", path="DiagnosticOrder.orderer", description="Who ordered the test", type="reference" ) + public static final String SP_ORDERER = "orderer"; + @SearchParamDefinition(name="specimen", path="DiagnosticOrder.specimen|DiagnosticOrder.item.specimen", description="If the whole order relates to specific specimens", type="reference" ) + public static final String SP_SPECIMEN = "specimen"; + @SearchParamDefinition(name="status", path="DiagnosticOrder.status", description="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DiagnosticReport.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DiagnosticReport.java index c3f39679d4e..6a1a9c06af4 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DiagnosticReport.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DiagnosticReport.java @@ -1,1465 +1,1444 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretation, and formatted representation of diagnostic reports. - */ -@ResourceDef(name="DiagnosticReport", profile="http://hl7.org/fhir/Profile/DiagnosticReport") -public class DiagnosticReport extends DomainResource { - - public enum DiagnosticReportStatus { - /** - * The existence of the report is registered, but there is nothing yet available. - */ - REGISTERED, - /** - * This is a partial (e.g. initial, interim or preliminary) report: data in the report may be incomplete or unverified. - */ - PARTIAL, - /** - * The report is complete and verified by an authorized person. - */ - FINAL, - /** - * The report has been modified subsequent to being Final, and is complete and verified by an authorized person. - */ - CORRECTED, - /** - * The report has been modified subsequent to being Final, and is complete and verified by an authorized person. New content has been added, but existing content hasn't changed. - */ - APPENDED, - /** - * The report is unavailable because the measurement was not started or not completed (also sometimes called "aborted"). - */ - CANCELLED, - /** - * The report has been withdrawn following previous Final release. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static DiagnosticReportStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("registered".equals(codeString)) - return REGISTERED; - if ("partial".equals(codeString)) - return PARTIAL; - if ("final".equals(codeString)) - return FINAL; - if ("corrected".equals(codeString)) - return CORRECTED; - if ("appended".equals(codeString)) - return APPENDED; - if ("cancelled".equals(codeString)) - return CANCELLED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new Exception("Unknown DiagnosticReportStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case REGISTERED: return "registered"; - case PARTIAL: return "partial"; - case FINAL: return "final"; - case CORRECTED: return "corrected"; - case APPENDED: return "appended"; - case CANCELLED: return "cancelled"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REGISTERED: return ""; - case PARTIAL: return ""; - case FINAL: return ""; - case CORRECTED: return ""; - case APPENDED: return ""; - case CANCELLED: return ""; - case ENTEREDINERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REGISTERED: return "The existence of the report is registered, but there is nothing yet available."; - case PARTIAL: return "This is a partial (e.g. initial, interim or preliminary) report: data in the report may be incomplete or unverified."; - case FINAL: return "The report is complete and verified by an authorized person."; - case CORRECTED: return "The report has been modified subsequent to being Final, and is complete and verified by an authorized person."; - case APPENDED: return "The report has been modified subsequent to being Final, and is complete and verified by an authorized person. New content has been added, but existing content hasn't changed."; - case CANCELLED: return "The report is unavailable because the measurement was not started or not completed (also sometimes called 'aborted')."; - case ENTEREDINERROR: return "The report has been withdrawn following previous Final release."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REGISTERED: return "Registered"; - case PARTIAL: return "Partial"; - case FINAL: return "Final"; - case CORRECTED: return "Corrected"; - case APPENDED: return "Appended"; - case CANCELLED: return "Cancelled"; - case ENTEREDINERROR: return "Entered In Error"; - default: return "?"; - } - } - } - - public static class DiagnosticReportStatusEnumFactory implements EnumFactory { - public DiagnosticReportStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("registered".equals(codeString)) - return DiagnosticReportStatus.REGISTERED; - if ("partial".equals(codeString)) - return DiagnosticReportStatus.PARTIAL; - if ("final".equals(codeString)) - return DiagnosticReportStatus.FINAL; - if ("corrected".equals(codeString)) - return DiagnosticReportStatus.CORRECTED; - if ("appended".equals(codeString)) - return DiagnosticReportStatus.APPENDED; - if ("cancelled".equals(codeString)) - return DiagnosticReportStatus.CANCELLED; - if ("entered-in-error".equals(codeString)) - return DiagnosticReportStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown DiagnosticReportStatus code '"+codeString+"'"); - } - public String toCode(DiagnosticReportStatus code) { - if (code == DiagnosticReportStatus.REGISTERED) - return "registered"; - if (code == DiagnosticReportStatus.PARTIAL) - return "partial"; - if (code == DiagnosticReportStatus.FINAL) - return "final"; - if (code == DiagnosticReportStatus.CORRECTED) - return "corrected"; - if (code == DiagnosticReportStatus.APPENDED) - return "appended"; - if (code == DiagnosticReportStatus.CANCELLED) - return "cancelled"; - if (code == DiagnosticReportStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - } - - @Block() - public static class DiagnosticReportImageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features. - */ - @Child(name = "comment", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Comment about the image (e.g. explanation)", formalDefinition="A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features." ) - protected StringType comment; - - /** - * Reference to the image source. - */ - @Child(name = "link", type = {Media.class}, order=2, min=1, max=1) - @Description(shortDefinition="Reference to the image source", formalDefinition="Reference to the image source." ) - protected Reference link; - - /** - * The actual object that is the target of the reference (Reference to the image source.) - */ - protected Media linkTarget; - - private static final long serialVersionUID = 935791940L; - - /* - * Constructor - */ - public DiagnosticReportImageComponent() { - super(); - } - - /* - * Constructor - */ - public DiagnosticReportImageComponent(Reference link) { - super(); - this.link = link; - } - - /** - * @return {@link #comment} (A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReportImageComponent.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); // bb - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public DiagnosticReportImageComponent setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features. - */ - public DiagnosticReportImageComponent setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - /** - * @return {@link #link} (Reference to the image source.) - */ - public Reference getLink() { - if (this.link == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReportImageComponent.link"); - else if (Configuration.doAutoCreate()) - this.link = new Reference(); // cc - return this.link; - } - - public boolean hasLink() { - return this.link != null && !this.link.isEmpty(); - } - - /** - * @param value {@link #link} (Reference to the image source.) - */ - public DiagnosticReportImageComponent setLink(Reference value) { - this.link = value; - return this; - } - - /** - * @return {@link #link} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the image source.) - */ - public Media getLinkTarget() { - if (this.linkTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReportImageComponent.link"); - else if (Configuration.doAutoCreate()) - this.linkTarget = new Media(); // aa - return this.linkTarget; - } - - /** - * @param value {@link #link} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the image source.) - */ - public DiagnosticReportImageComponent setLinkTarget(Media value) { - this.linkTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("comment", "string", "A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.", 0, java.lang.Integer.MAX_VALUE, comment)); - childrenList.add(new Property("link", "Reference(Media)", "Reference to the image source.", 0, java.lang.Integer.MAX_VALUE, link)); - } - - public DiagnosticReportImageComponent copy() { - DiagnosticReportImageComponent dst = new DiagnosticReportImageComponent(); - copyValues(dst); - dst.comment = comment == null ? null : comment.copy(); - dst.link = link == null ? null : link.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DiagnosticReportImageComponent)) - return false; - DiagnosticReportImageComponent o = (DiagnosticReportImageComponent) other; - return compareDeep(comment, o.comment, true) && compareDeep(link, o.link, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DiagnosticReportImageComponent)) - return false; - DiagnosticReportImageComponent o = (DiagnosticReportImageComponent) other; - return compareValues(comment, o.comment, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (comment == null || comment.isEmpty()) && (link == null || link.isEmpty()) - ; - } - - } - - /** - * A code or name that describes this diagnostic report. - */ - @Child(name = "name", type = {CodeableConcept.class}, order=0, min=1, max=1) - @Description(shortDefinition="Name/Code for this diagnostic report", formalDefinition="A code or name that describes this diagnostic report." ) - protected CodeableConcept name; - - /** - * The status of the diagnostic report as a whole. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="registered | partial | final | corrected | appended | cancelled | entered-in-error", formalDefinition="The status of the diagnostic report as a whole." ) - protected Enumeration status; - - /** - * The date and/or time that this version of the report was released from the source diagnostic service. - */ - @Child(name = "issued", type = {DateTimeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Date this version was released", formalDefinition="The date and/or time that this version of the report was released from the source diagnostic service." ) - protected DateTimeType issued; - - /** - * The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources. - */ - @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Location.class}, order=3, min=1, max=1) - @Description(shortDefinition="The subject of the report, usually, but not always, the patient", formalDefinition="The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) - */ - protected Resource subjectTarget; - - /** - * The diagnostic service that is responsible for issuing the report. - */ - @Child(name = "performer", type = {Practitioner.class, Organization.class}, order=4, min=1, max=1) - @Description(shortDefinition="Responsible Diagnostic Service", formalDefinition="The diagnostic service that is responsible for issuing the report." ) - protected Reference performer; - - /** - * The actual object that is the target of the reference (The diagnostic service that is responsible for issuing the report.) - */ - protected Resource performerTarget; - - /** - * The link to the health care event (encounter) when the order was made. - */ - @Child(name = "encounter", type = {Encounter.class}, order=5, min=0, max=1) - @Description(shortDefinition="Health care event when test ordered", formalDefinition="The link to the health care event (encounter) when the order was made." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The link to the health care event (encounter) when the order was made.) - */ - protected Encounter encounterTarget; - - /** - * The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider. - */ - @Child(name = "identifier", type = {Identifier.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Id for external references to this report", formalDefinition="The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider." ) - protected List identifier; - - /** - * Details concerning a test requested. - */ - @Child(name = "requestDetail", type = {DiagnosticOrder.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="What was requested", formalDefinition="Details concerning a test requested." ) - protected List requestDetail; - /** - * The actual objects that are the target of the reference (Details concerning a test requested.) - */ - protected List requestDetailTarget; - - - /** - * The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI. - */ - @Child(name = "serviceCategory", type = {CodeableConcept.class}, order=8, min=0, max=1) - @Description(shortDefinition="Biochemistry, Hematology etc.", formalDefinition="The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI." ) - protected CodeableConcept serviceCategory; - - /** - * The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself. - */ - @Child(name = "diagnostic", type = {DateTimeType.class, Period.class}, order=9, min=1, max=1) - @Description(shortDefinition="Physiologically Relevant time/time-period for report", formalDefinition="The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself." ) - protected Type diagnostic; - - /** - * Details about the specimens on which this diagnostic report is based. - */ - @Child(name = "specimen", type = {Specimen.class}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Specimens this report is based on", formalDefinition="Details about the specimens on which this diagnostic report is based." ) - protected List specimen; - /** - * The actual objects that are the target of the reference (Details about the specimens on which this diagnostic report is based.) - */ - protected List specimenTarget; - - - /** - * Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels"). - */ - @Child(name = "result", type = {Observation.class}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Observations - simple, or complex nested groups", formalDefinition="Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. 'atomic' results), or they can be grouping observations that include references to other members of the group (e.g. 'panels')." ) - protected List result; - /** - * The actual objects that are the target of the reference (Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) - */ - protected List resultTarget; - - - /** - * One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images. - */ - @Child(name = "imagingStudy", type = {ImagingStudy.class}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Reference to full details of imaging associated with the diagnostic report", formalDefinition="One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images." ) - protected List imagingStudy; - /** - * The actual objects that are the target of the reference (One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) - */ - protected List imagingStudyTarget; - - - /** - * A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest). - */ - @Child(name = "image", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Key images associated with this report", formalDefinition="A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest)." ) - protected List image; - - /** - * Concise and clinically contextualized narrative interpretation of the diagnostic report. - */ - @Child(name = "conclusion", type = {StringType.class}, order=14, min=0, max=1) - @Description(shortDefinition="Clinical Interpretation of test results", formalDefinition="Concise and clinically contextualized narrative interpretation of the diagnostic report." ) - protected StringType conclusion; - - /** - * Codes for the conclusion. - */ - @Child(name = "codedDiagnosis", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Codes for the conclusion", formalDefinition="Codes for the conclusion." ) - protected List codedDiagnosis; - - /** - * Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent. - */ - @Child(name = "presentedForm", type = {Attachment.class}, order=16, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Entire Report as issued", formalDefinition="Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent." ) - protected List presentedForm; - - private static final long serialVersionUID = 140402748L; - - /* - * Constructor - */ - public DiagnosticReport() { - super(); - } - - /* - * Constructor - */ - public DiagnosticReport(CodeableConcept name, Enumeration status, DateTimeType issued, Reference subject, Reference performer, Type diagnostic) { - super(); - this.name = name; - this.status = status; - this.issued = issued; - this.subject = subject; - this.performer = performer; - this.diagnostic = diagnostic; - } - - /** - * @return {@link #name} (A code or name that describes this diagnostic report.) - */ - public CodeableConcept getName() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.name"); - else if (Configuration.doAutoCreate()) - this.name = new CodeableConcept(); // cc - return this.name; - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A code or name that describes this diagnostic report.) - */ - public DiagnosticReport setName(CodeableConcept value) { - this.name = value; - return this; - } - - /** - * @return {@link #status} (The status of the diagnostic report as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new DiagnosticReportStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the diagnostic report as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DiagnosticReport setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the diagnostic report as a whole. - */ - public DiagnosticReportStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the diagnostic report as a whole. - */ - public DiagnosticReport setStatus(DiagnosticReportStatus value) { - if (this.status == null) - this.status = new Enumeration(new DiagnosticReportStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #issued} (The date and/or time that this version of the report was released from the source diagnostic service.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public DateTimeType getIssuedElement() { - if (this.issued == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.issued"); - else if (Configuration.doAutoCreate()) - this.issued = new DateTimeType(); // bb - return this.issued; - } - - public boolean hasIssuedElement() { - return this.issued != null && !this.issued.isEmpty(); - } - - public boolean hasIssued() { - return this.issued != null && !this.issued.isEmpty(); - } - - /** - * @param value {@link #issued} (The date and/or time that this version of the report was released from the source diagnostic service.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public DiagnosticReport setIssuedElement(DateTimeType value) { - this.issued = value; - return this; - } - - /** - * @return The date and/or time that this version of the report was released from the source diagnostic service. - */ - public Date getIssued() { - return this.issued == null ? null : this.issued.getValue(); - } - - /** - * @param value The date and/or time that this version of the report was released from the source diagnostic service. - */ - public DiagnosticReport setIssued(Date value) { - if (this.issued == null) - this.issued = new DateTimeType(); - this.issued.setValue(value); - return this; - } - - /** - * @return {@link #subject} (The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) - */ - public DiagnosticReport setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) - */ - public DiagnosticReport setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #performer} (The diagnostic service that is responsible for issuing the report.) - */ - public Reference getPerformer() { - if (this.performer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.performer"); - else if (Configuration.doAutoCreate()) - this.performer = new Reference(); // cc - return this.performer; - } - - public boolean hasPerformer() { - return this.performer != null && !this.performer.isEmpty(); - } - - /** - * @param value {@link #performer} (The diagnostic service that is responsible for issuing the report.) - */ - public DiagnosticReport setPerformer(Reference value) { - this.performer = value; - return this; - } - - /** - * @return {@link #performer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The diagnostic service that is responsible for issuing the report.) - */ - public Resource getPerformerTarget() { - return this.performerTarget; - } - - /** - * @param value {@link #performer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The diagnostic service that is responsible for issuing the report.) - */ - public DiagnosticReport setPerformerTarget(Resource value) { - this.performerTarget = value; - return this; - } - - /** - * @return {@link #encounter} (The link to the health care event (encounter) when the order was made.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (The link to the health care event (encounter) when the order was made.) - */ - public DiagnosticReport setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The link to the health care event (encounter) when the order was made.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The link to the health care event (encounter) when the order was made.) - */ - public DiagnosticReport setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #identifier} (The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public DiagnosticReport addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #requestDetail} (Details concerning a test requested.) - */ - public List getRequestDetail() { - if (this.requestDetail == null) - this.requestDetail = new ArrayList(); - return this.requestDetail; - } - - public boolean hasRequestDetail() { - if (this.requestDetail == null) - return false; - for (Reference item : this.requestDetail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #requestDetail} (Details concerning a test requested.) - */ - // syntactic sugar - public Reference addRequestDetail() { //3 - Reference t = new Reference(); - if (this.requestDetail == null) - this.requestDetail = new ArrayList(); - this.requestDetail.add(t); - return t; - } - - // syntactic sugar - public DiagnosticReport addRequestDetail(Reference t) { //3 - if (t == null) - return this; - if (this.requestDetail == null) - this.requestDetail = new ArrayList(); - this.requestDetail.add(t); - return this; - } - - /** - * @return {@link #requestDetail} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Details concerning a test requested.) - */ - public List getRequestDetailTarget() { - if (this.requestDetailTarget == null) - this.requestDetailTarget = new ArrayList(); - return this.requestDetailTarget; - } - - // syntactic sugar - /** - * @return {@link #requestDetail} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Details concerning a test requested.) - */ - public DiagnosticOrder addRequestDetailTarget() { - DiagnosticOrder r = new DiagnosticOrder(); - if (this.requestDetailTarget == null) - this.requestDetailTarget = new ArrayList(); - this.requestDetailTarget.add(r); - return r; - } - - /** - * @return {@link #serviceCategory} (The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI.) - */ - public CodeableConcept getServiceCategory() { - if (this.serviceCategory == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.serviceCategory"); - else if (Configuration.doAutoCreate()) - this.serviceCategory = new CodeableConcept(); // cc - return this.serviceCategory; - } - - public boolean hasServiceCategory() { - return this.serviceCategory != null && !this.serviceCategory.isEmpty(); - } - - /** - * @param value {@link #serviceCategory} (The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI.) - */ - public DiagnosticReport setServiceCategory(CodeableConcept value) { - this.serviceCategory = value; - return this; - } - - /** - * @return {@link #diagnostic} (The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.) - */ - public Type getDiagnostic() { - return this.diagnostic; - } - - /** - * @return {@link #diagnostic} (The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.) - */ - public DateTimeType getDiagnosticDateTimeType() throws Exception { - if (!(this.diagnostic instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.diagnostic.getClass().getName()+" was encountered"); - return (DateTimeType) this.diagnostic; - } - - /** - * @return {@link #diagnostic} (The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.) - */ - public Period getDiagnosticPeriod() throws Exception { - if (!(this.diagnostic instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.diagnostic.getClass().getName()+" was encountered"); - return (Period) this.diagnostic; - } - - public boolean hasDiagnostic() { - return this.diagnostic != null && !this.diagnostic.isEmpty(); - } - - /** - * @param value {@link #diagnostic} (The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.) - */ - public DiagnosticReport setDiagnostic(Type value) { - this.diagnostic = value; - return this; - } - - /** - * @return {@link #specimen} (Details about the specimens on which this diagnostic report is based.) - */ - public List getSpecimen() { - if (this.specimen == null) - this.specimen = new ArrayList(); - return this.specimen; - } - - public boolean hasSpecimen() { - if (this.specimen == null) - return false; - for (Reference item : this.specimen) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specimen} (Details about the specimens on which this diagnostic report is based.) - */ - // syntactic sugar - public Reference addSpecimen() { //3 - Reference t = new Reference(); - if (this.specimen == null) - this.specimen = new ArrayList(); - this.specimen.add(t); - return t; - } - - // syntactic sugar - public DiagnosticReport addSpecimen(Reference t) { //3 - if (t == null) - return this; - if (this.specimen == null) - this.specimen = new ArrayList(); - this.specimen.add(t); - return this; - } - - /** - * @return {@link #specimen} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Details about the specimens on which this diagnostic report is based.) - */ - public List getSpecimenTarget() { - if (this.specimenTarget == null) - this.specimenTarget = new ArrayList(); - return this.specimenTarget; - } - - // syntactic sugar - /** - * @return {@link #specimen} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Details about the specimens on which this diagnostic report is based.) - */ - public Specimen addSpecimenTarget() { - Specimen r = new Specimen(); - if (this.specimenTarget == null) - this.specimenTarget = new ArrayList(); - this.specimenTarget.add(r); - return r; - } - - /** - * @return {@link #result} (Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) - */ - public List getResult() { - if (this.result == null) - this.result = new ArrayList(); - return this.result; - } - - public boolean hasResult() { - if (this.result == null) - return false; - for (Reference item : this.result) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #result} (Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) - */ - // syntactic sugar - public Reference addResult() { //3 - Reference t = new Reference(); - if (this.result == null) - this.result = new ArrayList(); - this.result.add(t); - return t; - } - - // syntactic sugar - public DiagnosticReport addResult(Reference t) { //3 - if (t == null) - return this; - if (this.result == null) - this.result = new ArrayList(); - this.result.add(t); - return this; - } - - /** - * @return {@link #result} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) - */ - public List getResultTarget() { - if (this.resultTarget == null) - this.resultTarget = new ArrayList(); - return this.resultTarget; - } - - // syntactic sugar - /** - * @return {@link #result} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) - */ - public Observation addResultTarget() { - Observation r = new Observation(); - if (this.resultTarget == null) - this.resultTarget = new ArrayList(); - this.resultTarget.add(r); - return r; - } - - /** - * @return {@link #imagingStudy} (One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) - */ - public List getImagingStudy() { - if (this.imagingStudy == null) - this.imagingStudy = new ArrayList(); - return this.imagingStudy; - } - - public boolean hasImagingStudy() { - if (this.imagingStudy == null) - return false; - for (Reference item : this.imagingStudy) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #imagingStudy} (One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) - */ - // syntactic sugar - public Reference addImagingStudy() { //3 - Reference t = new Reference(); - if (this.imagingStudy == null) - this.imagingStudy = new ArrayList(); - this.imagingStudy.add(t); - return t; - } - - // syntactic sugar - public DiagnosticReport addImagingStudy(Reference t) { //3 - if (t == null) - return this; - if (this.imagingStudy == null) - this.imagingStudy = new ArrayList(); - this.imagingStudy.add(t); - return this; - } - - /** - * @return {@link #imagingStudy} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) - */ - public List getImagingStudyTarget() { - if (this.imagingStudyTarget == null) - this.imagingStudyTarget = new ArrayList(); - return this.imagingStudyTarget; - } - - // syntactic sugar - /** - * @return {@link #imagingStudy} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) - */ - public ImagingStudy addImagingStudyTarget() { - ImagingStudy r = new ImagingStudy(); - if (this.imagingStudyTarget == null) - this.imagingStudyTarget = new ArrayList(); - this.imagingStudyTarget.add(r); - return r; - } - - /** - * @return {@link #image} (A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).) - */ - public List getImage() { - if (this.image == null) - this.image = new ArrayList(); - return this.image; - } - - public boolean hasImage() { - if (this.image == null) - return false; - for (DiagnosticReportImageComponent item : this.image) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #image} (A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).) - */ - // syntactic sugar - public DiagnosticReportImageComponent addImage() { //3 - DiagnosticReportImageComponent t = new DiagnosticReportImageComponent(); - if (this.image == null) - this.image = new ArrayList(); - this.image.add(t); - return t; - } - - // syntactic sugar - public DiagnosticReport addImage(DiagnosticReportImageComponent t) { //3 - if (t == null) - return this; - if (this.image == null) - this.image = new ArrayList(); - this.image.add(t); - return this; - } - - /** - * @return {@link #conclusion} (Concise and clinically contextualized narrative interpretation of the diagnostic report.). This is the underlying object with id, value and extensions. The accessor "getConclusion" gives direct access to the value - */ - public StringType getConclusionElement() { - if (this.conclusion == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.conclusion"); - else if (Configuration.doAutoCreate()) - this.conclusion = new StringType(); // bb - return this.conclusion; - } - - public boolean hasConclusionElement() { - return this.conclusion != null && !this.conclusion.isEmpty(); - } - - public boolean hasConclusion() { - return this.conclusion != null && !this.conclusion.isEmpty(); - } - - /** - * @param value {@link #conclusion} (Concise and clinically contextualized narrative interpretation of the diagnostic report.). This is the underlying object with id, value and extensions. The accessor "getConclusion" gives direct access to the value - */ - public DiagnosticReport setConclusionElement(StringType value) { - this.conclusion = value; - return this; - } - - /** - * @return Concise and clinically contextualized narrative interpretation of the diagnostic report. - */ - public String getConclusion() { - return this.conclusion == null ? null : this.conclusion.getValue(); - } - - /** - * @param value Concise and clinically contextualized narrative interpretation of the diagnostic report. - */ - public DiagnosticReport setConclusion(String value) { - if (Utilities.noString(value)) - this.conclusion = null; - else { - if (this.conclusion == null) - this.conclusion = new StringType(); - this.conclusion.setValue(value); - } - return this; - } - - /** - * @return {@link #codedDiagnosis} (Codes for the conclusion.) - */ - public List getCodedDiagnosis() { - if (this.codedDiagnosis == null) - this.codedDiagnosis = new ArrayList(); - return this.codedDiagnosis; - } - - public boolean hasCodedDiagnosis() { - if (this.codedDiagnosis == null) - return false; - for (CodeableConcept item : this.codedDiagnosis) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #codedDiagnosis} (Codes for the conclusion.) - */ - // syntactic sugar - public CodeableConcept addCodedDiagnosis() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.codedDiagnosis == null) - this.codedDiagnosis = new ArrayList(); - this.codedDiagnosis.add(t); - return t; - } - - // syntactic sugar - public DiagnosticReport addCodedDiagnosis(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.codedDiagnosis == null) - this.codedDiagnosis = new ArrayList(); - this.codedDiagnosis.add(t); - return this; - } - - /** - * @return {@link #presentedForm} (Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.) - */ - public List getPresentedForm() { - if (this.presentedForm == null) - this.presentedForm = new ArrayList(); - return this.presentedForm; - } - - public boolean hasPresentedForm() { - if (this.presentedForm == null) - return false; - for (Attachment item : this.presentedForm) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #presentedForm} (Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.) - */ - // syntactic sugar - public Attachment addPresentedForm() { //3 - Attachment t = new Attachment(); - if (this.presentedForm == null) - this.presentedForm = new ArrayList(); - this.presentedForm.add(t); - return t; - } - - // syntactic sugar - public DiagnosticReport addPresentedForm(Attachment t) { //3 - if (t == null) - return this; - if (this.presentedForm == null) - this.presentedForm = new ArrayList(); - this.presentedForm.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "CodeableConcept", "A code or name that describes this diagnostic report.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("status", "code", "The status of the diagnostic report as a whole.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("issued", "dateTime", "The date and/or time that this version of the report was released from the source diagnostic service.", 0, java.lang.Integer.MAX_VALUE, issued)); - childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("performer", "Reference(Practitioner|Organization)", "The diagnostic service that is responsible for issuing the report.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The link to the health care event (encounter) when the order was made.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("identifier", "Identifier", "The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("requestDetail", "Reference(DiagnosticOrder)", "Details concerning a test requested.", 0, java.lang.Integer.MAX_VALUE, requestDetail)); - childrenList.add(new Property("serviceCategory", "CodeableConcept", "The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI.", 0, java.lang.Integer.MAX_VALUE, serviceCategory)); - childrenList.add(new Property("diagnostic[x]", "dateTime|Period", "The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.", 0, java.lang.Integer.MAX_VALUE, diagnostic)); - childrenList.add(new Property("specimen", "Reference(Specimen)", "Details about the specimens on which this diagnostic report is based.", 0, java.lang.Integer.MAX_VALUE, specimen)); - childrenList.add(new Property("result", "Reference(Observation)", "Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. 'atomic' results), or they can be grouping observations that include references to other members of the group (e.g. 'panels').", 0, java.lang.Integer.MAX_VALUE, result)); - childrenList.add(new Property("imagingStudy", "Reference(ImagingStudy)", "One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.", 0, java.lang.Integer.MAX_VALUE, imagingStudy)); - childrenList.add(new Property("image", "", "A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).", 0, java.lang.Integer.MAX_VALUE, image)); - childrenList.add(new Property("conclusion", "string", "Concise and clinically contextualized narrative interpretation of the diagnostic report.", 0, java.lang.Integer.MAX_VALUE, conclusion)); - childrenList.add(new Property("codedDiagnosis", "CodeableConcept", "Codes for the conclusion.", 0, java.lang.Integer.MAX_VALUE, codedDiagnosis)); - childrenList.add(new Property("presentedForm", "Attachment", "Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.", 0, java.lang.Integer.MAX_VALUE, presentedForm)); - } - - public DiagnosticReport copy() { - DiagnosticReport dst = new DiagnosticReport(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.status = status == null ? null : status.copy(); - dst.issued = issued == null ? null : issued.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.performer = performer == null ? null : performer.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - if (requestDetail != null) { - dst.requestDetail = new ArrayList(); - for (Reference i : requestDetail) - dst.requestDetail.add(i.copy()); - }; - dst.serviceCategory = serviceCategory == null ? null : serviceCategory.copy(); - dst.diagnostic = diagnostic == null ? null : diagnostic.copy(); - if (specimen != null) { - dst.specimen = new ArrayList(); - for (Reference i : specimen) - dst.specimen.add(i.copy()); - }; - if (result != null) { - dst.result = new ArrayList(); - for (Reference i : result) - dst.result.add(i.copy()); - }; - if (imagingStudy != null) { - dst.imagingStudy = new ArrayList(); - for (Reference i : imagingStudy) - dst.imagingStudy.add(i.copy()); - }; - if (image != null) { - dst.image = new ArrayList(); - for (DiagnosticReportImageComponent i : image) - dst.image.add(i.copy()); - }; - dst.conclusion = conclusion == null ? null : conclusion.copy(); - if (codedDiagnosis != null) { - dst.codedDiagnosis = new ArrayList(); - for (CodeableConcept i : codedDiagnosis) - dst.codedDiagnosis.add(i.copy()); - }; - if (presentedForm != null) { - dst.presentedForm = new ArrayList(); - for (Attachment i : presentedForm) - dst.presentedForm.add(i.copy()); - }; - return dst; - } - - protected DiagnosticReport typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DiagnosticReport)) - return false; - DiagnosticReport o = (DiagnosticReport) other; - return compareDeep(name, o.name, true) && compareDeep(status, o.status, true) && compareDeep(issued, o.issued, true) - && compareDeep(subject, o.subject, true) && compareDeep(performer, o.performer, true) && compareDeep(encounter, o.encounter, true) - && compareDeep(identifier, o.identifier, true) && compareDeep(requestDetail, o.requestDetail, true) - && compareDeep(serviceCategory, o.serviceCategory, true) && compareDeep(diagnostic, o.diagnostic, true) - && compareDeep(specimen, o.specimen, true) && compareDeep(result, o.result, true) && compareDeep(imagingStudy, o.imagingStudy, true) - && compareDeep(image, o.image, true) && compareDeep(conclusion, o.conclusion, true) && compareDeep(codedDiagnosis, o.codedDiagnosis, true) - && compareDeep(presentedForm, o.presentedForm, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DiagnosticReport)) - return false; - DiagnosticReport o = (DiagnosticReport) other; - return compareValues(status, o.status, true) && compareValues(issued, o.issued, true) && compareValues(conclusion, o.conclusion, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) - && (issued == null || issued.isEmpty()) && (subject == null || subject.isEmpty()) && (performer == null || performer.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (requestDetail == null || requestDetail.isEmpty()) && (serviceCategory == null || serviceCategory.isEmpty()) - && (diagnostic == null || diagnostic.isEmpty()) && (specimen == null || specimen.isEmpty()) - && (result == null || result.isEmpty()) && (imagingStudy == null || imagingStudy.isEmpty()) - && (image == null || image.isEmpty()) && (conclusion == null || conclusion.isEmpty()) && (codedDiagnosis == null || codedDiagnosis.isEmpty()) - && (presentedForm == null || presentedForm.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DiagnosticReport; - } - - @SearchParamDefinition(name="result", path="DiagnosticReport.result", description="Link to an atomic result (observation resource)", type="reference" ) - public static final String SP_RESULT = "result"; - @SearchParamDefinition(name="status", path="DiagnosticReport.status", description="The status of the report", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="subject", path="DiagnosticReport.subject", description="The subject of the report", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="issued", path="DiagnosticReport.issued", description="When the report was issued", type="date" ) - public static final String SP_ISSUED = "issued"; - @SearchParamDefinition(name="diagnosis", path="DiagnosticReport.codedDiagnosis", description="A coded diagnosis on the report", type="token" ) - public static final String SP_DIAGNOSIS = "diagnosis"; - @SearchParamDefinition(name="image", path="DiagnosticReport.image.link", description="Reference to the image source", type="reference" ) - public static final String SP_IMAGE = "image"; - @SearchParamDefinition(name="encounter", path="DiagnosticReport.encounter", description="The Encounter when the order was made", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - @SearchParamDefinition(name="date", path="DiagnosticReport.diagnostic[x]", description="The clinically relevant time of the report", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="patient", path="DiagnosticReport.subject", description="The subject of the report if a patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="request", path="DiagnosticReport.requestDetail", description="What was requested", type="reference" ) - public static final String SP_REQUEST = "request"; - @SearchParamDefinition(name="specimen", path="DiagnosticReport.specimen", description="The specimen details", type="reference" ) - public static final String SP_SPECIMEN = "specimen"; - @SearchParamDefinition(name="name", path="DiagnosticReport.name", description="The name of the report (e.g. the code for the report as a whole, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result)", type="token" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="service", path="DiagnosticReport.serviceCategory", description="Which diagnostic discipline/department created the report", type="token" ) - public static final String SP_SERVICE = "service"; - @SearchParamDefinition(name="performer", path="DiagnosticReport.performer", description="Who was the source of the report (organization)", type="reference" ) - public static final String SP_PERFORMER = "performer"; - @SearchParamDefinition(name="identifier", path="DiagnosticReport.identifier", description="An identifier for the report", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretation, and formatted representation of diagnostic reports. + */ +@ResourceDef(name="DiagnosticReport", profile="http://hl7.org/fhir/Profile/DiagnosticReport") +public class DiagnosticReport extends DomainResource { + + public enum DiagnosticReportStatus { + /** + * The existence of the report is registered, but there is nothing yet available. + */ + REGISTERED, + /** + * This is a partial (e.g. initial, interim or preliminary) report: data in the report may be incomplete or unverified. + */ + PARTIAL, + /** + * The report is complete and verified by an authorized person. + */ + FINAL, + /** + * The report has been modified subsequent to being Final, and is complete and verified by an authorized person. + */ + CORRECTED, + /** + * The report has been modified subsequent to being Final, and is complete and verified by an authorized person. New content has been added, but existing content hasn't changed. + */ + APPENDED, + /** + * The report is unavailable because the measurement was not started or not completed (also sometimes called "aborted"). + */ + CANCELLED, + /** + * The report has been withdrawn following previous Final release. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static DiagnosticReportStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("registered".equals(codeString)) + return REGISTERED; + if ("partial".equals(codeString)) + return PARTIAL; + if ("final".equals(codeString)) + return FINAL; + if ("corrected".equals(codeString)) + return CORRECTED; + if ("appended".equals(codeString)) + return APPENDED; + if ("cancelled".equals(codeString)) + return CANCELLED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new Exception("Unknown DiagnosticReportStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case REGISTERED: return "registered"; + case PARTIAL: return "partial"; + case FINAL: return "final"; + case CORRECTED: return "corrected"; + case APPENDED: return "appended"; + case CANCELLED: return "cancelled"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REGISTERED: return ""; + case PARTIAL: return ""; + case FINAL: return ""; + case CORRECTED: return ""; + case APPENDED: return ""; + case CANCELLED: return ""; + case ENTEREDINERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REGISTERED: return "The existence of the report is registered, but there is nothing yet available."; + case PARTIAL: return "This is a partial (e.g. initial, interim or preliminary) report: data in the report may be incomplete or unverified."; + case FINAL: return "The report is complete and verified by an authorized person."; + case CORRECTED: return "The report has been modified subsequent to being Final, and is complete and verified by an authorized person."; + case APPENDED: return "The report has been modified subsequent to being Final, and is complete and verified by an authorized person. New content has been added, but existing content hasn't changed."; + case CANCELLED: return "The report is unavailable because the measurement was not started or not completed (also sometimes called 'aborted')."; + case ENTEREDINERROR: return "The report has been withdrawn following previous Final release."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REGISTERED: return "Registered"; + case PARTIAL: return "Partial"; + case FINAL: return "Final"; + case CORRECTED: return "Corrected"; + case APPENDED: return "Appended"; + case CANCELLED: return "Cancelled"; + case ENTEREDINERROR: return "Entered In Error"; + default: return "?"; + } + } + } + + public static class DiagnosticReportStatusEnumFactory implements EnumFactory { + public DiagnosticReportStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("registered".equals(codeString)) + return DiagnosticReportStatus.REGISTERED; + if ("partial".equals(codeString)) + return DiagnosticReportStatus.PARTIAL; + if ("final".equals(codeString)) + return DiagnosticReportStatus.FINAL; + if ("corrected".equals(codeString)) + return DiagnosticReportStatus.CORRECTED; + if ("appended".equals(codeString)) + return DiagnosticReportStatus.APPENDED; + if ("cancelled".equals(codeString)) + return DiagnosticReportStatus.CANCELLED; + if ("entered-in-error".equals(codeString)) + return DiagnosticReportStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown DiagnosticReportStatus code '"+codeString+"'"); + } + public String toCode(DiagnosticReportStatus code) { + if (code == DiagnosticReportStatus.REGISTERED) + return "registered"; + if (code == DiagnosticReportStatus.PARTIAL) + return "partial"; + if (code == DiagnosticReportStatus.FINAL) + return "final"; + if (code == DiagnosticReportStatus.CORRECTED) + return "corrected"; + if (code == DiagnosticReportStatus.APPENDED) + return "appended"; + if (code == DiagnosticReportStatus.CANCELLED) + return "cancelled"; + if (code == DiagnosticReportStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + } + + @Block() + public static class DiagnosticReportImageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features. + */ + @Child(name = "comment", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Comment about the image (e.g. explanation)", formalDefinition="A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features." ) + protected StringType comment; + + /** + * Reference to the image source. + */ + @Child(name = "link", type = {Media.class}, order=2, min=1, max=1) + @Description(shortDefinition="Reference to the image source", formalDefinition="Reference to the image source." ) + protected Reference link; + + /** + * The actual object that is the target of the reference (Reference to the image source.) + */ + protected Media linkTarget; + + private static final long serialVersionUID = 935791940L; + + /* + * Constructor + */ + public DiagnosticReportImageComponent() { + super(); + } + + /* + * Constructor + */ + public DiagnosticReportImageComponent(Reference link) { + super(); + this.link = link; + } + + /** + * @return {@link #comment} (A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReportImageComponent.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); // bb + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public DiagnosticReportImageComponent setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features. + */ + public DiagnosticReportImageComponent setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + /** + * @return {@link #link} (Reference to the image source.) + */ + public Reference getLink() { + if (this.link == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReportImageComponent.link"); + else if (Configuration.doAutoCreate()) + this.link = new Reference(); // cc + return this.link; + } + + public boolean hasLink() { + return this.link != null && !this.link.isEmpty(); + } + + /** + * @param value {@link #link} (Reference to the image source.) + */ + public DiagnosticReportImageComponent setLink(Reference value) { + this.link = value; + return this; + } + + /** + * @return {@link #link} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the image source.) + */ + public Media getLinkTarget() { + if (this.linkTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReportImageComponent.link"); + else if (Configuration.doAutoCreate()) + this.linkTarget = new Media(); // aa + return this.linkTarget; + } + + /** + * @param value {@link #link} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the image source.) + */ + public DiagnosticReportImageComponent setLinkTarget(Media value) { + this.linkTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("comment", "string", "A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.", 0, java.lang.Integer.MAX_VALUE, comment)); + childrenList.add(new Property("link", "Reference(Media)", "Reference to the image source.", 0, java.lang.Integer.MAX_VALUE, link)); + } + + public DiagnosticReportImageComponent copy() { + DiagnosticReportImageComponent dst = new DiagnosticReportImageComponent(); + copyValues(dst); + dst.comment = comment == null ? null : comment.copy(); + dst.link = link == null ? null : link.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DiagnosticReportImageComponent)) + return false; + DiagnosticReportImageComponent o = (DiagnosticReportImageComponent) other; + return compareDeep(comment, o.comment, true) && compareDeep(link, o.link, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DiagnosticReportImageComponent)) + return false; + DiagnosticReportImageComponent o = (DiagnosticReportImageComponent) other; + return compareValues(comment, o.comment, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (comment == null || comment.isEmpty()) && (link == null || link.isEmpty()) + ; + } + + } + + /** + * A code or name that describes this diagnostic report. + */ + @Child(name = "name", type = {CodeableConcept.class}, order=0, min=1, max=1) + @Description(shortDefinition="Name/Code for this diagnostic report", formalDefinition="A code or name that describes this diagnostic report." ) + protected CodeableConcept name; + + /** + * The status of the diagnostic report as a whole. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="registered | partial | final | corrected | appended | cancelled | entered-in-error", formalDefinition="The status of the diagnostic report as a whole." ) + protected Enumeration status; + + /** + * The date and/or time that this version of the report was released from the source diagnostic service. + */ + @Child(name = "issued", type = {DateTimeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Date this version was released", formalDefinition="The date and/or time that this version of the report was released from the source diagnostic service." ) + protected DateTimeType issued; + + /** + * The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources. + */ + @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Location.class}, order=3, min=1, max=1) + @Description(shortDefinition="The subject of the report, usually, but not always, the patient", formalDefinition="The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) + */ + protected Resource subjectTarget; + + /** + * The diagnostic service that is responsible for issuing the report. + */ + @Child(name = "performer", type = {Practitioner.class, Organization.class}, order=4, min=1, max=1) + @Description(shortDefinition="Responsible Diagnostic Service", formalDefinition="The diagnostic service that is responsible for issuing the report." ) + protected Reference performer; + + /** + * The actual object that is the target of the reference (The diagnostic service that is responsible for issuing the report.) + */ + protected Resource performerTarget; + + /** + * The link to the health care event (encounter) when the order was made. + */ + @Child(name = "encounter", type = {Encounter.class}, order=5, min=0, max=1) + @Description(shortDefinition="Health care event when test ordered", formalDefinition="The link to the health care event (encounter) when the order was made." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The link to the health care event (encounter) when the order was made.) + */ + protected Encounter encounterTarget; + + /** + * The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider. + */ + @Child(name = "identifier", type = {Identifier.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Id for external references to this report", formalDefinition="The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider." ) + protected List identifier; + + /** + * Details concerning a test requested. + */ + @Child(name = "requestDetail", type = {DiagnosticOrder.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="What was requested", formalDefinition="Details concerning a test requested." ) + protected List requestDetail; + /** + * The actual objects that are the target of the reference (Details concerning a test requested.) + */ + protected List requestDetailTarget; + + + /** + * The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI. + */ + @Child(name = "serviceCategory", type = {CodeableConcept.class}, order=8, min=0, max=1) + @Description(shortDefinition="Biochemistry, Hematology etc.", formalDefinition="The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI." ) + protected CodeableConcept serviceCategory; + + /** + * The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself. + */ + @Child(name = "diagnostic", type = {DateTimeType.class, Period.class}, order=9, min=1, max=1) + @Description(shortDefinition="Physiologically Relevant time/time-period for report", formalDefinition="The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself." ) + protected Type diagnostic; + + /** + * Details about the specimens on which this diagnostic report is based. + */ + @Child(name = "specimen", type = {Specimen.class}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Specimens this report is based on", formalDefinition="Details about the specimens on which this diagnostic report is based." ) + protected List specimen; + /** + * The actual objects that are the target of the reference (Details about the specimens on which this diagnostic report is based.) + */ + protected List specimenTarget; + + + /** + * Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels"). + */ + @Child(name = "result", type = {Observation.class}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Observations - simple, or complex nested groups", formalDefinition="Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. 'atomic' results), or they can be grouping observations that include references to other members of the group (e.g. 'panels')." ) + protected List result; + /** + * The actual objects that are the target of the reference (Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) + */ + protected List resultTarget; + + + /** + * One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images. + */ + @Child(name = "imagingStudy", type = {ImagingStudy.class}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Reference to full details of imaging associated with the diagnostic report", formalDefinition="One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images." ) + protected List imagingStudy; + /** + * The actual objects that are the target of the reference (One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) + */ + protected List imagingStudyTarget; + + + /** + * A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest). + */ + @Child(name = "image", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Key images associated with this report", formalDefinition="A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest)." ) + protected List image; + + /** + * Concise and clinically contextualized narrative interpretation of the diagnostic report. + */ + @Child(name = "conclusion", type = {StringType.class}, order=14, min=0, max=1) + @Description(shortDefinition="Clinical Interpretation of test results", formalDefinition="Concise and clinically contextualized narrative interpretation of the diagnostic report." ) + protected StringType conclusion; + + /** + * Codes for the conclusion. + */ + @Child(name = "codedDiagnosis", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Codes for the conclusion", formalDefinition="Codes for the conclusion." ) + protected List codedDiagnosis; + + /** + * Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent. + */ + @Child(name = "presentedForm", type = {Attachment.class}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Entire Report as issued", formalDefinition="Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent." ) + protected List presentedForm; + + private static final long serialVersionUID = 140402748L; + + /* + * Constructor + */ + public DiagnosticReport() { + super(); + } + + /* + * Constructor + */ + public DiagnosticReport(CodeableConcept name, Enumeration status, DateTimeType issued, Reference subject, Reference performer, Type diagnostic) { + super(); + this.name = name; + this.status = status; + this.issued = issued; + this.subject = subject; + this.performer = performer; + this.diagnostic = diagnostic; + } + + /** + * @return {@link #name} (A code or name that describes this diagnostic report.) + */ + public CodeableConcept getName() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.name"); + else if (Configuration.doAutoCreate()) + this.name = new CodeableConcept(); // cc + return this.name; + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A code or name that describes this diagnostic report.) + */ + public DiagnosticReport setName(CodeableConcept value) { + this.name = value; + return this; + } + + /** + * @return {@link #status} (The status of the diagnostic report as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new DiagnosticReportStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status of the diagnostic report as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DiagnosticReport setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the diagnostic report as a whole. + */ + public DiagnosticReportStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the diagnostic report as a whole. + */ + public DiagnosticReport setStatus(DiagnosticReportStatus value) { + if (this.status == null) + this.status = new Enumeration(new DiagnosticReportStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #issued} (The date and/or time that this version of the report was released from the source diagnostic service.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public DateTimeType getIssuedElement() { + if (this.issued == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.issued"); + else if (Configuration.doAutoCreate()) + this.issued = new DateTimeType(); // bb + return this.issued; + } + + public boolean hasIssuedElement() { + return this.issued != null && !this.issued.isEmpty(); + } + + public boolean hasIssued() { + return this.issued != null && !this.issued.isEmpty(); + } + + /** + * @param value {@link #issued} (The date and/or time that this version of the report was released from the source diagnostic service.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public DiagnosticReport setIssuedElement(DateTimeType value) { + this.issued = value; + return this; + } + + /** + * @return The date and/or time that this version of the report was released from the source diagnostic service. + */ + public Date getIssued() { + return this.issued == null ? null : this.issued.getValue(); + } + + /** + * @param value The date and/or time that this version of the report was released from the source diagnostic service. + */ + public DiagnosticReport setIssued(Date value) { + if (this.issued == null) + this.issued = new DateTimeType(); + this.issued.setValue(value); + return this; + } + + /** + * @return {@link #subject} (The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) + */ + public DiagnosticReport setSubject(Reference value) { + this.subject = value; + return this; + } + + /** + * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) + */ + public Resource getSubjectTarget() { + return this.subjectTarget; + } + + /** + * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) + */ + public DiagnosticReport setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #performer} (The diagnostic service that is responsible for issuing the report.) + */ + public Reference getPerformer() { + if (this.performer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.performer"); + else if (Configuration.doAutoCreate()) + this.performer = new Reference(); // cc + return this.performer; + } + + public boolean hasPerformer() { + return this.performer != null && !this.performer.isEmpty(); + } + + /** + * @param value {@link #performer} (The diagnostic service that is responsible for issuing the report.) + */ + public DiagnosticReport setPerformer(Reference value) { + this.performer = value; + return this; + } + + /** + * @return {@link #performer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The diagnostic service that is responsible for issuing the report.) + */ + public Resource getPerformerTarget() { + return this.performerTarget; + } + + /** + * @param value {@link #performer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The diagnostic service that is responsible for issuing the report.) + */ + public DiagnosticReport setPerformerTarget(Resource value) { + this.performerTarget = value; + return this; + } + + /** + * @return {@link #encounter} (The link to the health care event (encounter) when the order was made.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (The link to the health care event (encounter) when the order was made.) + */ + public DiagnosticReport setEncounter(Reference value) { + this.encounter = value; + return this; + } + + /** + * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The link to the health care event (encounter) when the order was made.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + return this.encounterTarget; + } + + /** + * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The link to the health care event (encounter) when the order was made.) + */ + public DiagnosticReport setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #identifier} (The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public DiagnosticReport addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #requestDetail} (Details concerning a test requested.) + */ + public List getRequestDetail() { + if (this.requestDetail == null) + this.requestDetail = new ArrayList(); + return this.requestDetail; + } + + public boolean hasRequestDetail() { + if (this.requestDetail == null) + return false; + for (Reference item : this.requestDetail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #requestDetail} (Details concerning a test requested.) + */ + // syntactic sugar + public Reference addRequestDetail() { //3 + Reference t = new Reference(); + if (this.requestDetail == null) + this.requestDetail = new ArrayList(); + this.requestDetail.add(t); + return t; + } + + // syntactic sugar + public DiagnosticReport addRequestDetail(Reference t) { //3 + if (t == null) + return this; + if (this.requestDetail == null) + this.requestDetail = new ArrayList(); + this.requestDetail.add(t); + return this; + } + + /** + * @return {@link #requestDetail} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Details concerning a test requested.) + */ + public List getRequestDetailTarget() { + if (this.requestDetailTarget == null) + this.requestDetailTarget = new ArrayList(); + return this.requestDetailTarget; + } + + // syntactic sugar + /** + * @return {@link #requestDetail} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Details concerning a test requested.) + */ + public DiagnosticOrder addRequestDetailTarget() { + DiagnosticOrder r = new DiagnosticOrder(); + if (this.requestDetailTarget == null) + this.requestDetailTarget = new ArrayList(); + this.requestDetailTarget.add(r); + return r; + } + + /** + * @return {@link #serviceCategory} (The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI.) + */ + public CodeableConcept getServiceCategory() { + if (this.serviceCategory == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.serviceCategory"); + else if (Configuration.doAutoCreate()) + this.serviceCategory = new CodeableConcept(); // cc + return this.serviceCategory; + } + + public boolean hasServiceCategory() { + return this.serviceCategory != null && !this.serviceCategory.isEmpty(); + } + + /** + * @param value {@link #serviceCategory} (The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI.) + */ + public DiagnosticReport setServiceCategory(CodeableConcept value) { + this.serviceCategory = value; + return this; + } + + /** + * @return {@link #diagnostic} (The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.) + */ + public Type getDiagnostic() { + return this.diagnostic; + } + + /** + * @return {@link #diagnostic} (The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.) + */ + public DateTimeType getDiagnosticDateTimeType() throws Exception { + if (!(this.diagnostic instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.diagnostic.getClass().getName()+" was encountered"); + return (DateTimeType) this.diagnostic; + } + + /** + * @return {@link #diagnostic} (The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.) + */ + public Period getDiagnosticPeriod() throws Exception { + if (!(this.diagnostic instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.diagnostic.getClass().getName()+" was encountered"); + return (Period) this.diagnostic; + } + + public boolean hasDiagnostic() { + return this.diagnostic != null && !this.diagnostic.isEmpty(); + } + + /** + * @param value {@link #diagnostic} (The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.) + */ + public DiagnosticReport setDiagnostic(Type value) { + this.diagnostic = value; + return this; + } + + /** + * @return {@link #specimen} (Details about the specimens on which this diagnostic report is based.) + */ + public List getSpecimen() { + if (this.specimen == null) + this.specimen = new ArrayList(); + return this.specimen; + } + + public boolean hasSpecimen() { + if (this.specimen == null) + return false; + for (Reference item : this.specimen) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specimen} (Details about the specimens on which this diagnostic report is based.) + */ + // syntactic sugar + public Reference addSpecimen() { //3 + Reference t = new Reference(); + if (this.specimen == null) + this.specimen = new ArrayList(); + this.specimen.add(t); + return t; + } + + // syntactic sugar + public DiagnosticReport addSpecimen(Reference t) { //3 + if (t == null) + return this; + if (this.specimen == null) + this.specimen = new ArrayList(); + this.specimen.add(t); + return this; + } + + /** + * @return {@link #specimen} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Details about the specimens on which this diagnostic report is based.) + */ + public List getSpecimenTarget() { + if (this.specimenTarget == null) + this.specimenTarget = new ArrayList(); + return this.specimenTarget; + } + + // syntactic sugar + /** + * @return {@link #specimen} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Details about the specimens on which this diagnostic report is based.) + */ + public Specimen addSpecimenTarget() { + Specimen r = new Specimen(); + if (this.specimenTarget == null) + this.specimenTarget = new ArrayList(); + this.specimenTarget.add(r); + return r; + } + + /** + * @return {@link #result} (Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) + */ + public List getResult() { + if (this.result == null) + this.result = new ArrayList(); + return this.result; + } + + public boolean hasResult() { + if (this.result == null) + return false; + for (Reference item : this.result) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #result} (Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) + */ + // syntactic sugar + public Reference addResult() { //3 + Reference t = new Reference(); + if (this.result == null) + this.result = new ArrayList(); + this.result.add(t); + return t; + } + + // syntactic sugar + public DiagnosticReport addResult(Reference t) { //3 + if (t == null) + return this; + if (this.result == null) + this.result = new ArrayList(); + this.result.add(t); + return this; + } + + /** + * @return {@link #result} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) + */ + public List getResultTarget() { + if (this.resultTarget == null) + this.resultTarget = new ArrayList(); + return this.resultTarget; + } + + // syntactic sugar + /** + * @return {@link #result} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) + */ + public Observation addResultTarget() { + Observation r = new Observation(); + if (this.resultTarget == null) + this.resultTarget = new ArrayList(); + this.resultTarget.add(r); + return r; + } + + /** + * @return {@link #imagingStudy} (One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) + */ + public List getImagingStudy() { + if (this.imagingStudy == null) + this.imagingStudy = new ArrayList(); + return this.imagingStudy; + } + + public boolean hasImagingStudy() { + if (this.imagingStudy == null) + return false; + for (Reference item : this.imagingStudy) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #imagingStudy} (One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) + */ + // syntactic sugar + public Reference addImagingStudy() { //3 + Reference t = new Reference(); + if (this.imagingStudy == null) + this.imagingStudy = new ArrayList(); + this.imagingStudy.add(t); + return t; + } + + // syntactic sugar + public DiagnosticReport addImagingStudy(Reference t) { //3 + if (t == null) + return this; + if (this.imagingStudy == null) + this.imagingStudy = new ArrayList(); + this.imagingStudy.add(t); + return this; + } + + /** + * @return {@link #imagingStudy} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) + */ + public List getImagingStudyTarget() { + if (this.imagingStudyTarget == null) + this.imagingStudyTarget = new ArrayList(); + return this.imagingStudyTarget; + } + + // syntactic sugar + /** + * @return {@link #imagingStudy} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) + */ + public ImagingStudy addImagingStudyTarget() { + ImagingStudy r = new ImagingStudy(); + if (this.imagingStudyTarget == null) + this.imagingStudyTarget = new ArrayList(); + this.imagingStudyTarget.add(r); + return r; + } + + /** + * @return {@link #image} (A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).) + */ + public List getImage() { + if (this.image == null) + this.image = new ArrayList(); + return this.image; + } + + public boolean hasImage() { + if (this.image == null) + return false; + for (DiagnosticReportImageComponent item : this.image) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #image} (A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).) + */ + // syntactic sugar + public DiagnosticReportImageComponent addImage() { //3 + DiagnosticReportImageComponent t = new DiagnosticReportImageComponent(); + if (this.image == null) + this.image = new ArrayList(); + this.image.add(t); + return t; + } + + // syntactic sugar + public DiagnosticReport addImage(DiagnosticReportImageComponent t) { //3 + if (t == null) + return this; + if (this.image == null) + this.image = new ArrayList(); + this.image.add(t); + return this; + } + + /** + * @return {@link #conclusion} (Concise and clinically contextualized narrative interpretation of the diagnostic report.). This is the underlying object with id, value and extensions. The accessor "getConclusion" gives direct access to the value + */ + public StringType getConclusionElement() { + if (this.conclusion == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.conclusion"); + else if (Configuration.doAutoCreate()) + this.conclusion = new StringType(); // bb + return this.conclusion; + } + + public boolean hasConclusionElement() { + return this.conclusion != null && !this.conclusion.isEmpty(); + } + + public boolean hasConclusion() { + return this.conclusion != null && !this.conclusion.isEmpty(); + } + + /** + * @param value {@link #conclusion} (Concise and clinically contextualized narrative interpretation of the diagnostic report.). This is the underlying object with id, value and extensions. The accessor "getConclusion" gives direct access to the value + */ + public DiagnosticReport setConclusionElement(StringType value) { + this.conclusion = value; + return this; + } + + /** + * @return Concise and clinically contextualized narrative interpretation of the diagnostic report. + */ + public String getConclusion() { + return this.conclusion == null ? null : this.conclusion.getValue(); + } + + /** + * @param value Concise and clinically contextualized narrative interpretation of the diagnostic report. + */ + public DiagnosticReport setConclusion(String value) { + if (Utilities.noString(value)) + this.conclusion = null; + else { + if (this.conclusion == null) + this.conclusion = new StringType(); + this.conclusion.setValue(value); + } + return this; + } + + /** + * @return {@link #codedDiagnosis} (Codes for the conclusion.) + */ + public List getCodedDiagnosis() { + if (this.codedDiagnosis == null) + this.codedDiagnosis = new ArrayList(); + return this.codedDiagnosis; + } + + public boolean hasCodedDiagnosis() { + if (this.codedDiagnosis == null) + return false; + for (CodeableConcept item : this.codedDiagnosis) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #codedDiagnosis} (Codes for the conclusion.) + */ + // syntactic sugar + public CodeableConcept addCodedDiagnosis() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.codedDiagnosis == null) + this.codedDiagnosis = new ArrayList(); + this.codedDiagnosis.add(t); + return t; + } + + // syntactic sugar + public DiagnosticReport addCodedDiagnosis(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.codedDiagnosis == null) + this.codedDiagnosis = new ArrayList(); + this.codedDiagnosis.add(t); + return this; + } + + /** + * @return {@link #presentedForm} (Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.) + */ + public List getPresentedForm() { + if (this.presentedForm == null) + this.presentedForm = new ArrayList(); + return this.presentedForm; + } + + public boolean hasPresentedForm() { + if (this.presentedForm == null) + return false; + for (Attachment item : this.presentedForm) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #presentedForm} (Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.) + */ + // syntactic sugar + public Attachment addPresentedForm() { //3 + Attachment t = new Attachment(); + if (this.presentedForm == null) + this.presentedForm = new ArrayList(); + this.presentedForm.add(t); + return t; + } + + // syntactic sugar + public DiagnosticReport addPresentedForm(Attachment t) { //3 + if (t == null) + return this; + if (this.presentedForm == null) + this.presentedForm = new ArrayList(); + this.presentedForm.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "CodeableConcept", "A code or name that describes this diagnostic report.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("status", "code", "The status of the diagnostic report as a whole.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("issued", "dateTime", "The date and/or time that this version of the report was released from the source diagnostic service.", 0, java.lang.Integer.MAX_VALUE, issued)); + childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("performer", "Reference(Practitioner|Organization)", "The diagnostic service that is responsible for issuing the report.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The link to the health care event (encounter) when the order was made.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("identifier", "Identifier", "The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("requestDetail", "Reference(DiagnosticOrder)", "Details concerning a test requested.", 0, java.lang.Integer.MAX_VALUE, requestDetail)); + childrenList.add(new Property("serviceCategory", "CodeableConcept", "The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI.", 0, java.lang.Integer.MAX_VALUE, serviceCategory)); + childrenList.add(new Property("diagnostic[x]", "dateTime|Period", "The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.", 0, java.lang.Integer.MAX_VALUE, diagnostic)); + childrenList.add(new Property("specimen", "Reference(Specimen)", "Details about the specimens on which this diagnostic report is based.", 0, java.lang.Integer.MAX_VALUE, specimen)); + childrenList.add(new Property("result", "Reference(Observation)", "Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. 'atomic' results), or they can be grouping observations that include references to other members of the group (e.g. 'panels').", 0, java.lang.Integer.MAX_VALUE, result)); + childrenList.add(new Property("imagingStudy", "Reference(ImagingStudy)", "One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.", 0, java.lang.Integer.MAX_VALUE, imagingStudy)); + childrenList.add(new Property("image", "", "A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).", 0, java.lang.Integer.MAX_VALUE, image)); + childrenList.add(new Property("conclusion", "string", "Concise and clinically contextualized narrative interpretation of the diagnostic report.", 0, java.lang.Integer.MAX_VALUE, conclusion)); + childrenList.add(new Property("codedDiagnosis", "CodeableConcept", "Codes for the conclusion.", 0, java.lang.Integer.MAX_VALUE, codedDiagnosis)); + childrenList.add(new Property("presentedForm", "Attachment", "Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.", 0, java.lang.Integer.MAX_VALUE, presentedForm)); + } + + public DiagnosticReport copy() { + DiagnosticReport dst = new DiagnosticReport(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.status = status == null ? null : status.copy(); + dst.issued = issued == null ? null : issued.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.performer = performer == null ? null : performer.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + if (requestDetail != null) { + dst.requestDetail = new ArrayList(); + for (Reference i : requestDetail) + dst.requestDetail.add(i.copy()); + }; + dst.serviceCategory = serviceCategory == null ? null : serviceCategory.copy(); + dst.diagnostic = diagnostic == null ? null : diagnostic.copy(); + if (specimen != null) { + dst.specimen = new ArrayList(); + for (Reference i : specimen) + dst.specimen.add(i.copy()); + }; + if (result != null) { + dst.result = new ArrayList(); + for (Reference i : result) + dst.result.add(i.copy()); + }; + if (imagingStudy != null) { + dst.imagingStudy = new ArrayList(); + for (Reference i : imagingStudy) + dst.imagingStudy.add(i.copy()); + }; + if (image != null) { + dst.image = new ArrayList(); + for (DiagnosticReportImageComponent i : image) + dst.image.add(i.copy()); + }; + dst.conclusion = conclusion == null ? null : conclusion.copy(); + if (codedDiagnosis != null) { + dst.codedDiagnosis = new ArrayList(); + for (CodeableConcept i : codedDiagnosis) + dst.codedDiagnosis.add(i.copy()); + }; + if (presentedForm != null) { + dst.presentedForm = new ArrayList(); + for (Attachment i : presentedForm) + dst.presentedForm.add(i.copy()); + }; + return dst; + } + + protected DiagnosticReport typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DiagnosticReport)) + return false; + DiagnosticReport o = (DiagnosticReport) other; + return compareDeep(name, o.name, true) && compareDeep(status, o.status, true) && compareDeep(issued, o.issued, true) + && compareDeep(subject, o.subject, true) && compareDeep(performer, o.performer, true) && compareDeep(encounter, o.encounter, true) + && compareDeep(identifier, o.identifier, true) && compareDeep(requestDetail, o.requestDetail, true) + && compareDeep(serviceCategory, o.serviceCategory, true) && compareDeep(diagnostic, o.diagnostic, true) + && compareDeep(specimen, o.specimen, true) && compareDeep(result, o.result, true) && compareDeep(imagingStudy, o.imagingStudy, true) + && compareDeep(image, o.image, true) && compareDeep(conclusion, o.conclusion, true) && compareDeep(codedDiagnosis, o.codedDiagnosis, true) + && compareDeep(presentedForm, o.presentedForm, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DiagnosticReport)) + return false; + DiagnosticReport o = (DiagnosticReport) other; + return compareValues(status, o.status, true) && compareValues(issued, o.issued, true) && compareValues(conclusion, o.conclusion, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) + && (issued == null || issued.isEmpty()) && (subject == null || subject.isEmpty()) && (performer == null || performer.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (requestDetail == null || requestDetail.isEmpty()) && (serviceCategory == null || serviceCategory.isEmpty()) + && (diagnostic == null || diagnostic.isEmpty()) && (specimen == null || specimen.isEmpty()) + && (result == null || result.isEmpty()) && (imagingStudy == null || imagingStudy.isEmpty()) + && (image == null || image.isEmpty()) && (conclusion == null || conclusion.isEmpty()) && (codedDiagnosis == null || codedDiagnosis.isEmpty()) + && (presentedForm == null || presentedForm.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DiagnosticReport; + } + + @SearchParamDefinition(name="date", path="DiagnosticReport.diagnostic[x]", description="The clinically relevant time of the report", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="DiagnosticReport.identifier", description="An identifier for the report", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="image", path="DiagnosticReport.image.link", description="Reference to the image source", type="reference" ) + public static final String SP_IMAGE = "image"; + @SearchParamDefinition(name="request", path="DiagnosticReport.requestDetail", description="What was requested", type="reference" ) + public static final String SP_REQUEST = "request"; + @SearchParamDefinition(name="performer", path="DiagnosticReport.performer", description="Who was the source of the report (organization)", type="reference" ) + public static final String SP_PERFORMER = "performer"; + @SearchParamDefinition(name="subject", path="DiagnosticReport.subject", description="The subject of the report", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="diagnosis", path="DiagnosticReport.codedDiagnosis", description="A coded diagnosis on the report", type="token" ) + public static final String SP_DIAGNOSIS = "diagnosis"; + @SearchParamDefinition(name="encounter", path="DiagnosticReport.encounter", description="The Encounter when the order was made", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + @SearchParamDefinition(name="result", path="DiagnosticReport.result", description="Link to an atomic result (observation resource)", type="reference" ) + public static final String SP_RESULT = "result"; + @SearchParamDefinition(name="service", path="DiagnosticReport.serviceCategory", description="Which diagnostic discipline/department created the report", type="token" ) + public static final String SP_SERVICE = "service"; + @SearchParamDefinition(name="patient", path="DiagnosticReport.subject", description="The subject of the report if a patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="specimen", path="DiagnosticReport.specimen", description="The specimen details", type="reference" ) + public static final String SP_SPECIMEN = "specimen"; + @SearchParamDefinition(name="name", path="DiagnosticReport.name", description="The name of the report (e.g. the code for the report as a whole, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result)", type="token" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="issued", path="DiagnosticReport.issued", description="When the report was issued", type="date" ) + public static final String SP_ISSUED = "issued"; + @SearchParamDefinition(name="status", path="DiagnosticReport.status", description="The status of the report", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Distance.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Distance.java index 623de5b994d..a7c647c8d69 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Distance.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Distance.java @@ -1,111 +1,90 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * 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(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Distance)) - return false; - Distance o = (Distance) other; - return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(units, o.units, true) - && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Distance)) - return false; - Distance o = (Distance) other; - return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(units, o.units, true) - && compareValues(system, o.system, true) && compareValues(code, o.code, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) - && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * 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(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Distance)) + return false; + Distance o = (Distance) other; + return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(units, o.units, true) + && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Distance)) + return false; + Distance o = (Distance) other; + return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(units, o.units, true) + && compareValues(system, o.system, true) && compareValues(code, o.code, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) + && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DocumentManifest.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DocumentManifest.java index 59394e84526..3cc2f5b0e3d 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DocumentManifest.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DocumentManifest.java @@ -1,1128 +1,1107 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A manifest that defines a set of documents. - */ -@ResourceDef(name="DocumentManifest", profile="http://hl7.org/fhir/Profile/DocumentManifest") -public class DocumentManifest extends DomainResource { - - public enum DocumentReferenceStatus { - /** - * This is the current reference for this document. - */ - CURRENT, - /** - * This reference has been superceded by another reference. - */ - SUPERCEDED, - /** - * This reference was created in error. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static DocumentReferenceStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("current".equals(codeString)) - return CURRENT; - if ("superceded".equals(codeString)) - return SUPERCEDED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new Exception("Unknown DocumentReferenceStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CURRENT: return "current"; - case SUPERCEDED: return "superceded"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CURRENT: return ""; - case SUPERCEDED: return ""; - case ENTEREDINERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CURRENT: return "This is the current reference for this document."; - case SUPERCEDED: return "This reference has been superceded by another reference."; - case ENTEREDINERROR: return "This reference was created in error."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CURRENT: return "Current"; - case SUPERCEDED: return "Superceded"; - case ENTEREDINERROR: return "Entered In Error"; - default: return "?"; - } - } - } - - public static class DocumentReferenceStatusEnumFactory implements EnumFactory { - public DocumentReferenceStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("current".equals(codeString)) - return DocumentReferenceStatus.CURRENT; - if ("superceded".equals(codeString)) - return DocumentReferenceStatus.SUPERCEDED; - if ("entered-in-error".equals(codeString)) - return DocumentReferenceStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'"); - } - public String toCode(DocumentReferenceStatus code) { - if (code == DocumentReferenceStatus.CURRENT) - return "current"; - if (code == DocumentReferenceStatus.SUPERCEDED) - return "superceded"; - if (code == DocumentReferenceStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - } - - @Block() - public static class DocumentManifestContentComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The list of DocumentReference or Media Resources, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed. - */ - @Child(name = "p", type = {Attachment.class, DocumentReference.class, Media.class}, order=1, min=1, max=1) - @Description(shortDefinition="Contents of this set of documents", formalDefinition="The list of DocumentReference or Media Resources, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed." ) - protected Type p; - - private static final long serialVersionUID = -347538500L; - - /* - * Constructor - */ - public DocumentManifestContentComponent() { - super(); - } - - /* - * Constructor - */ - public DocumentManifestContentComponent(Type p) { - super(); - this.p = p; - } - - /** - * @return {@link #p} (The list of DocumentReference or Media Resources, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed.) - */ - public Type getP() { - return this.p; - } - - /** - * @return {@link #p} (The list of DocumentReference or Media Resources, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed.) - */ - public Attachment getPAttachment() throws Exception { - if (!(this.p instanceof Attachment)) - throw new Exception("Type mismatch: the type Attachment was expected, but "+this.p.getClass().getName()+" was encountered"); - return (Attachment) this.p; - } - - /** - * @return {@link #p} (The list of DocumentReference or Media Resources, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed.) - */ - public Reference getPReference() throws Exception { - if (!(this.p instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.p.getClass().getName()+" was encountered"); - return (Reference) this.p; - } - - public boolean hasP() { - return this.p != null && !this.p.isEmpty(); - } - - /** - * @param value {@link #p} (The list of DocumentReference or Media Resources, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed.) - */ - public DocumentManifestContentComponent setP(Type value) { - this.p = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("p[x]", "Attachment|Reference(DocumentReference|Media)", "The list of DocumentReference or Media Resources, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed.", 0, java.lang.Integer.MAX_VALUE, p)); - } - - public DocumentManifestContentComponent copy() { - DocumentManifestContentComponent dst = new DocumentManifestContentComponent(); - copyValues(dst); - dst.p = p == null ? null : p.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DocumentManifestContentComponent)) - return false; - DocumentManifestContentComponent o = (DocumentManifestContentComponent) other; - return compareDeep(p, o.p, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DocumentManifestContentComponent)) - return false; - DocumentManifestContentComponent o = (DocumentManifestContentComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (p == null || p.isEmpty()); - } - - } - - @Block() - public static class DocumentManifestRelatedComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Related identifier to this DocumentManifest. If both id and ref are present they shall refer to the same thing. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) - @Description(shortDefinition="Related Identifier", formalDefinition="Related identifier to this DocumentManifest. If both id and ref are present they shall refer to the same thing." ) - protected Identifier identifier; - - /** - * Related Resource to this DocumentManifest. If both id and ref are present they shall refer to the same thing. - */ - @Child(name = "ref", type = {}, order=2, min=0, max=1) - @Description(shortDefinition="Related Resource", formalDefinition="Related Resource to this DocumentManifest. If both id and ref are present they shall refer to the same thing." ) - protected Reference ref; - - /** - * The actual object that is the target of the reference (Related Resource to this DocumentManifest. If both id and ref are present they shall refer to the same thing.) - */ - protected Resource refTarget; - - private static final long serialVersionUID = -1670123330L; - - /* - * Constructor - */ - public DocumentManifestRelatedComponent() { - super(); - } - - /** - * @return {@link #identifier} (Related identifier to this DocumentManifest. If both id and ref are present they shall refer to the same thing.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifestRelatedComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Related identifier to this DocumentManifest. If both id and ref are present they shall refer to the same thing.) - */ - public DocumentManifestRelatedComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #ref} (Related Resource to this DocumentManifest. If both id and ref are present they shall refer to the same thing.) - */ - public Reference getRef() { - if (this.ref == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifestRelatedComponent.ref"); - else if (Configuration.doAutoCreate()) - this.ref = new Reference(); // cc - return this.ref; - } - - public boolean hasRef() { - return this.ref != null && !this.ref.isEmpty(); - } - - /** - * @param value {@link #ref} (Related Resource to this DocumentManifest. If both id and ref are present they shall refer to the same thing.) - */ - public DocumentManifestRelatedComponent setRef(Reference value) { - this.ref = value; - return this; - } - - /** - * @return {@link #ref} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Related Resource to this DocumentManifest. If both id and ref are present they shall refer to the same thing.) - */ - public Resource getRefTarget() { - return this.refTarget; - } - - /** - * @param value {@link #ref} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Related Resource to this DocumentManifest. If both id and ref are present they shall refer to the same thing.) - */ - public DocumentManifestRelatedComponent setRefTarget(Resource value) { - this.refTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Related identifier to this DocumentManifest. If both id and ref are present they shall refer to the same thing.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("ref", "Reference(Any)", "Related Resource to this DocumentManifest. If both id and ref are present they shall refer to the same thing.", 0, java.lang.Integer.MAX_VALUE, ref)); - } - - public DocumentManifestRelatedComponent copy() { - DocumentManifestRelatedComponent dst = new DocumentManifestRelatedComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.ref = ref == null ? null : ref.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DocumentManifestRelatedComponent)) - return false; - DocumentManifestRelatedComponent o = (DocumentManifestRelatedComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(ref, o.ref, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DocumentManifestRelatedComponent)) - return false; - DocumentManifestRelatedComponent o = (DocumentManifestRelatedComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ref == null || ref.isEmpty()) - ; - } - - } - - /** - * A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts. - */ - @Child(name = "masterIdentifier", type = {Identifier.class}, order=0, min=0, max=1) - @Description(shortDefinition="Unique Identifier for the set of documents", formalDefinition="A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts." ) - protected Identifier masterIdentifier; - - /** - * Other identifiers associated with the document manifest, including version independent identifiers. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Other identifiers for the manifest", formalDefinition="Other identifiers associated with the document manifest, including version independent identifiers." ) - protected List identifier; - - /** - * Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case). - */ - @Child(name = "subject", type = {Patient.class, Practitioner.class, Group.class, Device.class}, order=2, min=0, max=1) - @Description(shortDefinition="The subject of the set of documents", formalDefinition="Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case)." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) - */ - protected Resource subjectTarget; - - /** - * A patient, practitioner, or organization for which this set of documents is intended. - */ - @Child(name = "recipient", type = {Patient.class, Practitioner.class, Organization.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Intended to get notified about this set of documents", formalDefinition="A patient, practitioner, or organization for which this set of documents is intended." ) - protected List recipient; - /** - * The actual objects that are the target of the reference (A patient, practitioner, or organization for which this set of documents is intended.) - */ - protected List recipientTarget; - - - /** - * Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=1) - @Description(shortDefinition="What kind of document set this is", formalDefinition="Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider." ) - protected CodeableConcept type; - - /** - * Identifies who is responsible for adding the information to the document. - */ - @Child(name = "author", type = {Practitioner.class, Organization.class, Device.class, Patient.class, RelatedPerson.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who and/or what authored the document", formalDefinition="Identifies who is responsible for adding the information to the document." ) - protected List author; - /** - * The actual objects that are the target of the reference (Identifies who is responsible for adding the information to the document.) - */ - protected List authorTarget; - - - /** - * When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc). - */ - @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="When this document manifest created", formalDefinition="When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc)." ) - protected DateTimeType created; - - /** - * Identifies the source system, application, or software that produced the document manifest. - */ - @Child(name = "source", type = {UriType.class}, order=7, min=0, max=1) - @Description(shortDefinition="The source system/application/software", formalDefinition="Identifies the source system, application, or software that produced the document manifest." ) - protected UriType source; - - /** - * The status of this document manifest. - */ - @Child(name = "status", type = {CodeType.class}, order=8, min=1, max=1) - @Description(shortDefinition="current | superceded | entered-in-error", formalDefinition="The status of this document manifest." ) - protected Enumeration status; - - /** - * Human-readable description of the source document. This is sometimes known as the "title". - */ - @Child(name = "description", type = {StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Human-readable description (title)", formalDefinition="Human-readable description of the source document. This is sometimes known as the 'title'." ) - protected StringType description; - - /** - * The manifest list. - */ - @Child(name = "content", type = {}, order=10, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contents of the manifest", formalDefinition="The manifest list." ) - protected List content; - - /** - * Related identifiers or resources associated with the DocumentManifest. - */ - @Child(name = "related", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Related things", formalDefinition="Related identifiers or resources associated with the DocumentManifest." ) - protected List related; - - private static final long serialVersionUID = -2056683927L; - - /* - * Constructor - */ - public DocumentManifest() { - super(); - } - - /* - * Constructor - */ - public DocumentManifest(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #masterIdentifier} (A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.) - */ - public Identifier getMasterIdentifier() { - if (this.masterIdentifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.masterIdentifier"); - else if (Configuration.doAutoCreate()) - this.masterIdentifier = new Identifier(); // cc - return this.masterIdentifier; - } - - public boolean hasMasterIdentifier() { - return this.masterIdentifier != null && !this.masterIdentifier.isEmpty(); - } - - /** - * @param value {@link #masterIdentifier} (A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.) - */ - public DocumentManifest setMasterIdentifier(Identifier value) { - this.masterIdentifier = value; - return this; - } - - /** - * @return {@link #identifier} (Other identifiers associated with the document manifest, including version independent identifiers.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Other identifiers associated with the document manifest, including version independent identifiers.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public DocumentManifest addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #subject} (Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) - */ - public DocumentManifest setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) - */ - public DocumentManifest setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #recipient} (A patient, practitioner, or organization for which this set of documents is intended.) - */ - public List getRecipient() { - if (this.recipient == null) - this.recipient = new ArrayList(); - return this.recipient; - } - - public boolean hasRecipient() { - if (this.recipient == null) - return false; - for (Reference item : this.recipient) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #recipient} (A patient, practitioner, or organization for which this set of documents is intended.) - */ - // syntactic sugar - public Reference addRecipient() { //3 - Reference t = new Reference(); - if (this.recipient == null) - this.recipient = new ArrayList(); - this.recipient.add(t); - return t; - } - - // syntactic sugar - public DocumentManifest addRecipient(Reference t) { //3 - if (t == null) - return this; - if (this.recipient == null) - this.recipient = new ArrayList(); - this.recipient.add(t); - return this; - } - - /** - * @return {@link #recipient} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A patient, practitioner, or organization for which this set of documents is intended.) - */ - public List getRecipientTarget() { - if (this.recipientTarget == null) - this.recipientTarget = new ArrayList(); - return this.recipientTarget; - } - - /** - * @return {@link #type} (Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider.) - */ - public DocumentManifest setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #author} (Identifies who is responsible for adding the information to the document.) - */ - public List getAuthor() { - if (this.author == null) - this.author = new ArrayList(); - return this.author; - } - - public boolean hasAuthor() { - if (this.author == null) - return false; - for (Reference item : this.author) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #author} (Identifies who is responsible for adding the information to the document.) - */ - // syntactic sugar - public Reference addAuthor() { //3 - Reference t = new Reference(); - if (this.author == null) - this.author = new ArrayList(); - this.author.add(t); - return t; - } - - // syntactic sugar - public DocumentManifest addAuthor(Reference t) { //3 - if (t == null) - return this; - if (this.author == null) - this.author = new ArrayList(); - this.author.add(t); - return this; - } - - /** - * @return {@link #author} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies who is responsible for adding the information to the document.) - */ - public List getAuthorTarget() { - if (this.authorTarget == null) - this.authorTarget = new ArrayList(); - return this.authorTarget; - } - - /** - * @return {@link #created} (When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc).). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc).). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DocumentManifest setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc). - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc). - */ - public DocumentManifest setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #source} (Identifies the source system, application, or software that produced the document manifest.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value - */ - public UriType getSourceElement() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.source"); - else if (Configuration.doAutoCreate()) - this.source = new UriType(); // bb - return this.source; - } - - public boolean hasSourceElement() { - return this.source != null && !this.source.isEmpty(); - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (Identifies the source system, application, or software that produced the document manifest.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value - */ - public DocumentManifest setSourceElement(UriType value) { - this.source = value; - return this; - } - - /** - * @return Identifies the source system, application, or software that produced the document manifest. - */ - public String getSource() { - return this.source == null ? null : this.source.getValue(); - } - - /** - * @param value Identifies the source system, application, or software that produced the document manifest. - */ - public DocumentManifest setSource(String value) { - if (Utilities.noString(value)) - this.source = null; - else { - if (this.source == null) - this.source = new UriType(); - this.source.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of this document manifest.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new DocumentReferenceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of this document manifest.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DocumentManifest setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of this document manifest. - */ - public DocumentReferenceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of this document manifest. - */ - public DocumentManifest setStatus(DocumentReferenceStatus value) { - if (this.status == null) - this.status = new Enumeration(new DocumentReferenceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #description} (Human-readable description of the source document. This is sometimes known as the "title".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Human-readable description of the source document. This is sometimes known as the "title".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public DocumentManifest setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Human-readable description of the source document. This is sometimes known as the "title". - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Human-readable description of the source document. This is sometimes known as the "title". - */ - public DocumentManifest setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #content} (The manifest list.) - */ - public List getContent() { - if (this.content == null) - this.content = new ArrayList(); - return this.content; - } - - public boolean hasContent() { - if (this.content == null) - return false; - for (DocumentManifestContentComponent item : this.content) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #content} (The manifest list.) - */ - // syntactic sugar - public DocumentManifestContentComponent addContent() { //3 - DocumentManifestContentComponent t = new DocumentManifestContentComponent(); - if (this.content == null) - this.content = new ArrayList(); - this.content.add(t); - return t; - } - - // syntactic sugar - public DocumentManifest addContent(DocumentManifestContentComponent t) { //3 - if (t == null) - return this; - if (this.content == null) - this.content = new ArrayList(); - this.content.add(t); - return this; - } - - /** - * @return {@link #related} (Related identifiers or resources associated with the DocumentManifest.) - */ - public List getRelated() { - if (this.related == null) - this.related = new ArrayList(); - return this.related; - } - - public boolean hasRelated() { - if (this.related == null) - return false; - for (DocumentManifestRelatedComponent item : this.related) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #related} (Related identifiers or resources associated with the DocumentManifest.) - */ - // syntactic sugar - public DocumentManifestRelatedComponent addRelated() { //3 - DocumentManifestRelatedComponent t = new DocumentManifestRelatedComponent(); - if (this.related == null) - this.related = new ArrayList(); - this.related.add(t); - return t; - } - - // syntactic sugar - public DocumentManifest addRelated(DocumentManifestRelatedComponent t) { //3 - if (t == null) - return this; - if (this.related == null) - this.related = new ArrayList(); - this.related.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("masterIdentifier", "Identifier", "A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.", 0, java.lang.Integer.MAX_VALUE, masterIdentifier)); - childrenList.add(new Property("identifier", "Identifier", "Other identifiers associated with the document manifest, including version independent identifiers.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("subject", "Reference(Patient|Practitioner|Group|Device)", "Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("recipient", "Reference(Patient|Practitioner|Organization)", "A patient, practitioner, or organization for which this set of documents is intended.", 0, java.lang.Integer.MAX_VALUE, recipient)); - childrenList.add(new Property("type", "CodeableConcept", "Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("author", "Reference(Practitioner|Organization|Device|Patient|RelatedPerson)", "Identifies who is responsible for adding the information to the document.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("created", "dateTime", "When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc).", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("source", "uri", "Identifies the source system, application, or software that produced the document manifest.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("status", "code", "The status of this document manifest.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("description", "string", "Human-readable description of the source document. This is sometimes known as the 'title'.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("content", "", "The manifest list.", 0, java.lang.Integer.MAX_VALUE, content)); - childrenList.add(new Property("related", "", "Related identifiers or resources associated with the DocumentManifest.", 0, java.lang.Integer.MAX_VALUE, related)); - } - - public DocumentManifest copy() { - DocumentManifest dst = new DocumentManifest(); - copyValues(dst); - dst.masterIdentifier = masterIdentifier == null ? null : masterIdentifier.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.subject = subject == null ? null : subject.copy(); - if (recipient != null) { - dst.recipient = new ArrayList(); - for (Reference i : recipient) - dst.recipient.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - if (author != null) { - dst.author = new ArrayList(); - for (Reference i : author) - dst.author.add(i.copy()); - }; - dst.created = created == null ? null : created.copy(); - dst.source = source == null ? null : source.copy(); - dst.status = status == null ? null : status.copy(); - dst.description = description == null ? null : description.copy(); - if (content != null) { - dst.content = new ArrayList(); - for (DocumentManifestContentComponent i : content) - dst.content.add(i.copy()); - }; - if (related != null) { - dst.related = new ArrayList(); - for (DocumentManifestRelatedComponent i : related) - dst.related.add(i.copy()); - }; - return dst; - } - - protected DocumentManifest typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DocumentManifest)) - return false; - DocumentManifest o = (DocumentManifest) other; - return compareDeep(masterIdentifier, o.masterIdentifier, true) && compareDeep(identifier, o.identifier, true) - && compareDeep(subject, o.subject, true) && compareDeep(recipient, o.recipient, true) && compareDeep(type, o.type, true) - && compareDeep(author, o.author, true) && compareDeep(created, o.created, true) && compareDeep(source, o.source, true) - && compareDeep(status, o.status, true) && compareDeep(description, o.description, true) && compareDeep(content, o.content, true) - && compareDeep(related, o.related, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DocumentManifest)) - return false; - DocumentManifest o = (DocumentManifest) other; - return compareValues(created, o.created, true) && compareValues(source, o.source, true) && compareValues(status, o.status, true) - && compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (masterIdentifier == null || masterIdentifier.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (subject == null || subject.isEmpty()) && (recipient == null || recipient.isEmpty()) && (type == null || type.isEmpty()) - && (author == null || author.isEmpty()) && (created == null || created.isEmpty()) && (source == null || source.isEmpty()) - && (status == null || status.isEmpty()) && (description == null || description.isEmpty()) - && (content == null || content.isEmpty()) && (related == null || related.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DocumentManifest; - } - - @SearchParamDefinition(name="author", path="DocumentManifest.author", description="Who and/or what authored the document", type="reference" ) - public static final String SP_AUTHOR = "author"; - @SearchParamDefinition(name="relatedref", path="DocumentManifest.related.ref", description="Related Resource", type="reference" ) - public static final String SP_RELATEDREF = "relatedref"; - @SearchParamDefinition(name="patient", path="DocumentManifest.subject", description="The subject of the set of documents", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="source", path="DocumentManifest.source", description="The source system/application/software", type="uri" ) - public static final String SP_SOURCE = "source"; - @SearchParamDefinition(name="status", path="DocumentManifest.status", description="current | superceded | entered-in-error", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="created", path="DocumentManifest.created", description="When this document manifest created", type="date" ) - public static final String SP_CREATED = "created"; - @SearchParamDefinition(name="description", path="DocumentManifest.description", description="Human-readable description (title)", type="string" ) - public static final String SP_DESCRIPTION = "description"; - @SearchParamDefinition(name="subject", path="DocumentManifest.subject", description="The subject of the set of documents", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="contentref", path="DocumentManifest.content.pReference", description="Contents of this set of documents", type="reference" ) - public static final String SP_CONTENTREF = "contentref"; - @SearchParamDefinition(name="type", path="DocumentManifest.type", description="What kind of document set this is", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="identifier", path="DocumentManifest.masterIdentifier|DocumentManifest.identifier", description="Unique Identifier for the set of documents", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="recipient", path="DocumentManifest.recipient", description="Intended to get notified about this set of documents", type="reference" ) - public static final String SP_RECIPIENT = "recipient"; - @SearchParamDefinition(name="relatedid", path="DocumentManifest.related.identifier", description="Related Identifier", type="token" ) - public static final String SP_RELATEDID = "relatedid"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A manifest that defines a set of documents. + */ +@ResourceDef(name="DocumentManifest", profile="http://hl7.org/fhir/Profile/DocumentManifest") +public class DocumentManifest extends DomainResource { + + public enum DocumentReferenceStatus { + /** + * This is the current reference for this document. + */ + CURRENT, + /** + * This reference has been superceded by another reference. + */ + SUPERCEDED, + /** + * This reference was created in error. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static DocumentReferenceStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("current".equals(codeString)) + return CURRENT; + if ("superceded".equals(codeString)) + return SUPERCEDED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new Exception("Unknown DocumentReferenceStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CURRENT: return "current"; + case SUPERCEDED: return "superceded"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CURRENT: return ""; + case SUPERCEDED: return ""; + case ENTEREDINERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CURRENT: return "This is the current reference for this document."; + case SUPERCEDED: return "This reference has been superceded by another reference."; + case ENTEREDINERROR: return "This reference was created in error."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CURRENT: return "Current"; + case SUPERCEDED: return "Superceded"; + case ENTEREDINERROR: return "Entered In Error"; + default: return "?"; + } + } + } + + public static class DocumentReferenceStatusEnumFactory implements EnumFactory { + public DocumentReferenceStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("current".equals(codeString)) + return DocumentReferenceStatus.CURRENT; + if ("superceded".equals(codeString)) + return DocumentReferenceStatus.SUPERCEDED; + if ("entered-in-error".equals(codeString)) + return DocumentReferenceStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'"); + } + public String toCode(DocumentReferenceStatus code) { + if (code == DocumentReferenceStatus.CURRENT) + return "current"; + if (code == DocumentReferenceStatus.SUPERCEDED) + return "superceded"; + if (code == DocumentReferenceStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + } + + @Block() + public static class DocumentManifestContentComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The list of DocumentReference or Media Resources, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed. + */ + @Child(name = "p", type = {Attachment.class, DocumentReference.class, Media.class}, order=1, min=1, max=1) + @Description(shortDefinition="Contents of this set of documents", formalDefinition="The list of DocumentReference or Media Resources, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed." ) + protected Type p; + + private static final long serialVersionUID = -347538500L; + + /* + * Constructor + */ + public DocumentManifestContentComponent() { + super(); + } + + /* + * Constructor + */ + public DocumentManifestContentComponent(Type p) { + super(); + this.p = p; + } + + /** + * @return {@link #p} (The list of DocumentReference or Media Resources, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed.) + */ + public Type getP() { + return this.p; + } + + /** + * @return {@link #p} (The list of DocumentReference or Media Resources, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed.) + */ + public Attachment getPAttachment() throws Exception { + if (!(this.p instanceof Attachment)) + throw new Exception("Type mismatch: the type Attachment was expected, but "+this.p.getClass().getName()+" was encountered"); + return (Attachment) this.p; + } + + /** + * @return {@link #p} (The list of DocumentReference or Media Resources, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed.) + */ + public Reference getPReference() throws Exception { + if (!(this.p instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.p.getClass().getName()+" was encountered"); + return (Reference) this.p; + } + + public boolean hasP() { + return this.p != null && !this.p.isEmpty(); + } + + /** + * @param value {@link #p} (The list of DocumentReference or Media Resources, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed.) + */ + public DocumentManifestContentComponent setP(Type value) { + this.p = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("p[x]", "Attachment|Reference(DocumentReference|Media)", "The list of DocumentReference or Media Resources, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed.", 0, java.lang.Integer.MAX_VALUE, p)); + } + + public DocumentManifestContentComponent copy() { + DocumentManifestContentComponent dst = new DocumentManifestContentComponent(); + copyValues(dst); + dst.p = p == null ? null : p.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DocumentManifestContentComponent)) + return false; + DocumentManifestContentComponent o = (DocumentManifestContentComponent) other; + return compareDeep(p, o.p, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DocumentManifestContentComponent)) + return false; + DocumentManifestContentComponent o = (DocumentManifestContentComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (p == null || p.isEmpty()); + } + + } + + @Block() + public static class DocumentManifestRelatedComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Related identifier to this DocumentManifest. If both id and ref are present they shall refer to the same thing. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) + @Description(shortDefinition="Related Identifier", formalDefinition="Related identifier to this DocumentManifest. If both id and ref are present they shall refer to the same thing." ) + protected Identifier identifier; + + /** + * Related Resource to this DocumentManifest. If both id and ref are present they shall refer to the same thing. + */ + @Child(name = "ref", type = {}, order=2, min=0, max=1) + @Description(shortDefinition="Related Resource", formalDefinition="Related Resource to this DocumentManifest. If both id and ref are present they shall refer to the same thing." ) + protected Reference ref; + + /** + * The actual object that is the target of the reference (Related Resource to this DocumentManifest. If both id and ref are present they shall refer to the same thing.) + */ + protected Resource refTarget; + + private static final long serialVersionUID = -1670123330L; + + /* + * Constructor + */ + public DocumentManifestRelatedComponent() { + super(); + } + + /** + * @return {@link #identifier} (Related identifier to this DocumentManifest. If both id and ref are present they shall refer to the same thing.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifestRelatedComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Related identifier to this DocumentManifest. If both id and ref are present they shall refer to the same thing.) + */ + public DocumentManifestRelatedComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #ref} (Related Resource to this DocumentManifest. If both id and ref are present they shall refer to the same thing.) + */ + public Reference getRef() { + if (this.ref == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifestRelatedComponent.ref"); + else if (Configuration.doAutoCreate()) + this.ref = new Reference(); // cc + return this.ref; + } + + public boolean hasRef() { + return this.ref != null && !this.ref.isEmpty(); + } + + /** + * @param value {@link #ref} (Related Resource to this DocumentManifest. If both id and ref are present they shall refer to the same thing.) + */ + public DocumentManifestRelatedComponent setRef(Reference value) { + this.ref = value; + return this; + } + + /** + * @return {@link #ref} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Related Resource to this DocumentManifest. If both id and ref are present they shall refer to the same thing.) + */ + public Resource getRefTarget() { + return this.refTarget; + } + + /** + * @param value {@link #ref} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Related Resource to this DocumentManifest. If both id and ref are present they shall refer to the same thing.) + */ + public DocumentManifestRelatedComponent setRefTarget(Resource value) { + this.refTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Related identifier to this DocumentManifest. If both id and ref are present they shall refer to the same thing.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("ref", "Reference(Any)", "Related Resource to this DocumentManifest. If both id and ref are present they shall refer to the same thing.", 0, java.lang.Integer.MAX_VALUE, ref)); + } + + public DocumentManifestRelatedComponent copy() { + DocumentManifestRelatedComponent dst = new DocumentManifestRelatedComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.ref = ref == null ? null : ref.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DocumentManifestRelatedComponent)) + return false; + DocumentManifestRelatedComponent o = (DocumentManifestRelatedComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(ref, o.ref, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DocumentManifestRelatedComponent)) + return false; + DocumentManifestRelatedComponent o = (DocumentManifestRelatedComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ref == null || ref.isEmpty()) + ; + } + + } + + /** + * A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts. + */ + @Child(name = "masterIdentifier", type = {Identifier.class}, order=0, min=0, max=1) + @Description(shortDefinition="Unique Identifier for the set of documents", formalDefinition="A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts." ) + protected Identifier masterIdentifier; + + /** + * Other identifiers associated with the document manifest, including version independent identifiers. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Other identifiers for the manifest", formalDefinition="Other identifiers associated with the document manifest, including version independent identifiers." ) + protected List identifier; + + /** + * Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case). + */ + @Child(name = "subject", type = {Patient.class, Practitioner.class, Group.class, Device.class}, order=2, min=0, max=1) + @Description(shortDefinition="The subject of the set of documents", formalDefinition="Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case)." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) + */ + protected Resource subjectTarget; + + /** + * A patient, practitioner, or organization for which this set of documents is intended. + */ + @Child(name = "recipient", type = {Patient.class, Practitioner.class, Organization.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Intended to get notified about this set of documents", formalDefinition="A patient, practitioner, or organization for which this set of documents is intended." ) + protected List recipient; + /** + * The actual objects that are the target of the reference (A patient, practitioner, or organization for which this set of documents is intended.) + */ + protected List recipientTarget; + + + /** + * Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=1) + @Description(shortDefinition="What kind of document set this is", formalDefinition="Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider." ) + protected CodeableConcept type; + + /** + * Identifies who is responsible for adding the information to the document. + */ + @Child(name = "author", type = {Practitioner.class, Organization.class, Device.class, Patient.class, RelatedPerson.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who and/or what authored the document", formalDefinition="Identifies who is responsible for adding the information to the document." ) + protected List author; + /** + * The actual objects that are the target of the reference (Identifies who is responsible for adding the information to the document.) + */ + protected List authorTarget; + + + /** + * When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc). + */ + @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="When this document manifest created", formalDefinition="When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc)." ) + protected DateTimeType created; + + /** + * Identifies the source system, application, or software that produced the document manifest. + */ + @Child(name = "source", type = {UriType.class}, order=7, min=0, max=1) + @Description(shortDefinition="The source system/application/software", formalDefinition="Identifies the source system, application, or software that produced the document manifest." ) + protected UriType source; + + /** + * The status of this document manifest. + */ + @Child(name = "status", type = {CodeType.class}, order=8, min=1, max=1) + @Description(shortDefinition="current | superceded | entered-in-error", formalDefinition="The status of this document manifest." ) + protected Enumeration status; + + /** + * Human-readable description of the source document. This is sometimes known as the "title". + */ + @Child(name = "description", type = {StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Human-readable description (title)", formalDefinition="Human-readable description of the source document. This is sometimes known as the 'title'." ) + protected StringType description; + + /** + * The manifest list. + */ + @Child(name = "content", type = {}, order=10, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contents of the manifest", formalDefinition="The manifest list." ) + protected List content; + + /** + * Related identifiers or resources associated with the DocumentManifest. + */ + @Child(name = "related", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Related things", formalDefinition="Related identifiers or resources associated with the DocumentManifest." ) + protected List related; + + private static final long serialVersionUID = -2056683927L; + + /* + * Constructor + */ + public DocumentManifest() { + super(); + } + + /* + * Constructor + */ + public DocumentManifest(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #masterIdentifier} (A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.) + */ + public Identifier getMasterIdentifier() { + if (this.masterIdentifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifest.masterIdentifier"); + else if (Configuration.doAutoCreate()) + this.masterIdentifier = new Identifier(); // cc + return this.masterIdentifier; + } + + public boolean hasMasterIdentifier() { + return this.masterIdentifier != null && !this.masterIdentifier.isEmpty(); + } + + /** + * @param value {@link #masterIdentifier} (A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.) + */ + public DocumentManifest setMasterIdentifier(Identifier value) { + this.masterIdentifier = value; + return this; + } + + /** + * @return {@link #identifier} (Other identifiers associated with the document manifest, including version independent identifiers.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Other identifiers associated with the document manifest, including version independent identifiers.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public DocumentManifest addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #subject} (Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifest.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) + */ + public DocumentManifest setSubject(Reference value) { + this.subject = value; + return this; + } + + /** + * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) + */ + public Resource getSubjectTarget() { + return this.subjectTarget; + } + + /** + * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) + */ + public DocumentManifest setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #recipient} (A patient, practitioner, or organization for which this set of documents is intended.) + */ + public List getRecipient() { + if (this.recipient == null) + this.recipient = new ArrayList(); + return this.recipient; + } + + public boolean hasRecipient() { + if (this.recipient == null) + return false; + for (Reference item : this.recipient) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #recipient} (A patient, practitioner, or organization for which this set of documents is intended.) + */ + // syntactic sugar + public Reference addRecipient() { //3 + Reference t = new Reference(); + if (this.recipient == null) + this.recipient = new ArrayList(); + this.recipient.add(t); + return t; + } + + // syntactic sugar + public DocumentManifest addRecipient(Reference t) { //3 + if (t == null) + return this; + if (this.recipient == null) + this.recipient = new ArrayList(); + this.recipient.add(t); + return this; + } + + /** + * @return {@link #recipient} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A patient, practitioner, or organization for which this set of documents is intended.) + */ + public List getRecipientTarget() { + if (this.recipientTarget == null) + this.recipientTarget = new ArrayList(); + return this.recipientTarget; + } + + /** + * @return {@link #type} (Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifest.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider.) + */ + public DocumentManifest setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #author} (Identifies who is responsible for adding the information to the document.) + */ + public List getAuthor() { + if (this.author == null) + this.author = new ArrayList(); + return this.author; + } + + public boolean hasAuthor() { + if (this.author == null) + return false; + for (Reference item : this.author) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #author} (Identifies who is responsible for adding the information to the document.) + */ + // syntactic sugar + public Reference addAuthor() { //3 + Reference t = new Reference(); + if (this.author == null) + this.author = new ArrayList(); + this.author.add(t); + return t; + } + + // syntactic sugar + public DocumentManifest addAuthor(Reference t) { //3 + if (t == null) + return this; + if (this.author == null) + this.author = new ArrayList(); + this.author.add(t); + return this; + } + + /** + * @return {@link #author} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies who is responsible for adding the information to the document.) + */ + public List getAuthorTarget() { + if (this.authorTarget == null) + this.authorTarget = new ArrayList(); + return this.authorTarget; + } + + /** + * @return {@link #created} (When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc).). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifest.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc).). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DocumentManifest setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc). + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc). + */ + public DocumentManifest setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #source} (Identifies the source system, application, or software that produced the document manifest.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value + */ + public UriType getSourceElement() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifest.source"); + else if (Configuration.doAutoCreate()) + this.source = new UriType(); // bb + return this.source; + } + + public boolean hasSourceElement() { + return this.source != null && !this.source.isEmpty(); + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (Identifies the source system, application, or software that produced the document manifest.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value + */ + public DocumentManifest setSourceElement(UriType value) { + this.source = value; + return this; + } + + /** + * @return Identifies the source system, application, or software that produced the document manifest. + */ + public String getSource() { + return this.source == null ? null : this.source.getValue(); + } + + /** + * @param value Identifies the source system, application, or software that produced the document manifest. + */ + public DocumentManifest setSource(String value) { + if (Utilities.noString(value)) + this.source = null; + else { + if (this.source == null) + this.source = new UriType(); + this.source.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of this document manifest.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifest.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new DocumentReferenceStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status of this document manifest.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DocumentManifest setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of this document manifest. + */ + public DocumentReferenceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of this document manifest. + */ + public DocumentManifest setStatus(DocumentReferenceStatus value) { + if (this.status == null) + this.status = new Enumeration(new DocumentReferenceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #description} (Human-readable description of the source document. This is sometimes known as the "title".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifest.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Human-readable description of the source document. This is sometimes known as the "title".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public DocumentManifest setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Human-readable description of the source document. This is sometimes known as the "title". + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Human-readable description of the source document. This is sometimes known as the "title". + */ + public DocumentManifest setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #content} (The manifest list.) + */ + public List getContent() { + if (this.content == null) + this.content = new ArrayList(); + return this.content; + } + + public boolean hasContent() { + if (this.content == null) + return false; + for (DocumentManifestContentComponent item : this.content) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #content} (The manifest list.) + */ + // syntactic sugar + public DocumentManifestContentComponent addContent() { //3 + DocumentManifestContentComponent t = new DocumentManifestContentComponent(); + if (this.content == null) + this.content = new ArrayList(); + this.content.add(t); + return t; + } + + // syntactic sugar + public DocumentManifest addContent(DocumentManifestContentComponent t) { //3 + if (t == null) + return this; + if (this.content == null) + this.content = new ArrayList(); + this.content.add(t); + return this; + } + + /** + * @return {@link #related} (Related identifiers or resources associated with the DocumentManifest.) + */ + public List getRelated() { + if (this.related == null) + this.related = new ArrayList(); + return this.related; + } + + public boolean hasRelated() { + if (this.related == null) + return false; + for (DocumentManifestRelatedComponent item : this.related) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #related} (Related identifiers or resources associated with the DocumentManifest.) + */ + // syntactic sugar + public DocumentManifestRelatedComponent addRelated() { //3 + DocumentManifestRelatedComponent t = new DocumentManifestRelatedComponent(); + if (this.related == null) + this.related = new ArrayList(); + this.related.add(t); + return t; + } + + // syntactic sugar + public DocumentManifest addRelated(DocumentManifestRelatedComponent t) { //3 + if (t == null) + return this; + if (this.related == null) + this.related = new ArrayList(); + this.related.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("masterIdentifier", "Identifier", "A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.", 0, java.lang.Integer.MAX_VALUE, masterIdentifier)); + childrenList.add(new Property("identifier", "Identifier", "Other identifiers associated with the document manifest, including version independent identifiers.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("subject", "Reference(Patient|Practitioner|Group|Device)", "Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("recipient", "Reference(Patient|Practitioner|Organization)", "A patient, practitioner, or organization for which this set of documents is intended.", 0, java.lang.Integer.MAX_VALUE, recipient)); + childrenList.add(new Property("type", "CodeableConcept", "Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("author", "Reference(Practitioner|Organization|Device|Patient|RelatedPerson)", "Identifies who is responsible for adding the information to the document.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("created", "dateTime", "When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc).", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("source", "uri", "Identifies the source system, application, or software that produced the document manifest.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("status", "code", "The status of this document manifest.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("description", "string", "Human-readable description of the source document. This is sometimes known as the 'title'.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("content", "", "The manifest list.", 0, java.lang.Integer.MAX_VALUE, content)); + childrenList.add(new Property("related", "", "Related identifiers or resources associated with the DocumentManifest.", 0, java.lang.Integer.MAX_VALUE, related)); + } + + public DocumentManifest copy() { + DocumentManifest dst = new DocumentManifest(); + copyValues(dst); + dst.masterIdentifier = masterIdentifier == null ? null : masterIdentifier.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.subject = subject == null ? null : subject.copy(); + if (recipient != null) { + dst.recipient = new ArrayList(); + for (Reference i : recipient) + dst.recipient.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + if (author != null) { + dst.author = new ArrayList(); + for (Reference i : author) + dst.author.add(i.copy()); + }; + dst.created = created == null ? null : created.copy(); + dst.source = source == null ? null : source.copy(); + dst.status = status == null ? null : status.copy(); + dst.description = description == null ? null : description.copy(); + if (content != null) { + dst.content = new ArrayList(); + for (DocumentManifestContentComponent i : content) + dst.content.add(i.copy()); + }; + if (related != null) { + dst.related = new ArrayList(); + for (DocumentManifestRelatedComponent i : related) + dst.related.add(i.copy()); + }; + return dst; + } + + protected DocumentManifest typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DocumentManifest)) + return false; + DocumentManifest o = (DocumentManifest) other; + return compareDeep(masterIdentifier, o.masterIdentifier, true) && compareDeep(identifier, o.identifier, true) + && compareDeep(subject, o.subject, true) && compareDeep(recipient, o.recipient, true) && compareDeep(type, o.type, true) + && compareDeep(author, o.author, true) && compareDeep(created, o.created, true) && compareDeep(source, o.source, true) + && compareDeep(status, o.status, true) && compareDeep(description, o.description, true) && compareDeep(content, o.content, true) + && compareDeep(related, o.related, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DocumentManifest)) + return false; + DocumentManifest o = (DocumentManifest) other; + return compareValues(created, o.created, true) && compareValues(source, o.source, true) && compareValues(status, o.status, true) + && compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (masterIdentifier == null || masterIdentifier.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (subject == null || subject.isEmpty()) && (recipient == null || recipient.isEmpty()) && (type == null || type.isEmpty()) + && (author == null || author.isEmpty()) && (created == null || created.isEmpty()) && (source == null || source.isEmpty()) + && (status == null || status.isEmpty()) && (description == null || description.isEmpty()) + && (content == null || content.isEmpty()) && (related == null || related.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DocumentManifest; + } + + @SearchParamDefinition(name="identifier", path="DocumentManifest.masterIdentifier|DocumentManifest.identifier", description="Unique Identifier for the set of documents", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="subject", path="DocumentManifest.subject", description="The subject of the set of documents", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="author", path="DocumentManifest.author", description="Who and/or what authored the document", type="reference" ) + public static final String SP_AUTHOR = "author"; + @SearchParamDefinition(name="created", path="DocumentManifest.created", description="When this document manifest created", type="date" ) + public static final String SP_CREATED = "created"; + @SearchParamDefinition(name="relatedref", path="DocumentManifest.related.ref", description="Related Resource", type="reference" ) + public static final String SP_RELATEDREF = "relatedref"; + @SearchParamDefinition(name="description", path="DocumentManifest.description", description="Human-readable description (title)", type="string" ) + public static final String SP_DESCRIPTION = "description"; + @SearchParamDefinition(name="source", path="DocumentManifest.source", description="The source system/application/software", type="uri" ) + public static final String SP_SOURCE = "source"; + @SearchParamDefinition(name="type", path="DocumentManifest.type", description="What kind of document set this is", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="relatedid", path="DocumentManifest.related.identifier", description="Related Identifier", type="token" ) + public static final String SP_RELATEDID = "relatedid"; + @SearchParamDefinition(name="patient", path="DocumentManifest.subject", description="The subject of the set of documents", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="recipient", path="DocumentManifest.recipient", description="Intended to get notified about this set of documents", type="reference" ) + public static final String SP_RECIPIENT = "recipient"; + @SearchParamDefinition(name="status", path="DocumentManifest.status", description="current | superceded | entered-in-error", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="contentref", path="DocumentManifest.content.pReference", description="Contents of this set of documents", type="reference" ) + public static final String SP_CONTENTREF = "contentref"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DocumentReference.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DocumentReference.java index 095c1457f6b..c8b5b911cb2 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DocumentReference.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DocumentReference.java @@ -1,1901 +1,1880 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A reference to a document. - */ -@ResourceDef(name="DocumentReference", profile="http://hl7.org/fhir/Profile/DocumentReference") -public class DocumentReference extends DomainResource { - - public enum DocumentReferenceStatus { - /** - * This is the current reference for this document. - */ - CURRENT, - /** - * This reference has been superceded by another reference. - */ - SUPERCEDED, - /** - * This reference was created in error. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static DocumentReferenceStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("current".equals(codeString)) - return CURRENT; - if ("superceded".equals(codeString)) - return SUPERCEDED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new Exception("Unknown DocumentReferenceStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CURRENT: return "current"; - case SUPERCEDED: return "superceded"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CURRENT: return ""; - case SUPERCEDED: return ""; - case ENTEREDINERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CURRENT: return "This is the current reference for this document."; - case SUPERCEDED: return "This reference has been superceded by another reference."; - case ENTEREDINERROR: return "This reference was created in error."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CURRENT: return "Current"; - case SUPERCEDED: return "Superceded"; - case ENTEREDINERROR: return "Entered In Error"; - default: return "?"; - } - } - } - - public static class DocumentReferenceStatusEnumFactory implements EnumFactory { - public DocumentReferenceStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("current".equals(codeString)) - return DocumentReferenceStatus.CURRENT; - if ("superceded".equals(codeString)) - return DocumentReferenceStatus.SUPERCEDED; - if ("entered-in-error".equals(codeString)) - return DocumentReferenceStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'"); - } - public String toCode(DocumentReferenceStatus code) { - if (code == DocumentReferenceStatus.CURRENT) - return "current"; - if (code == DocumentReferenceStatus.SUPERCEDED) - return "superceded"; - if (code == DocumentReferenceStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - } - - public enum DocumentRelationshipType { - /** - * This document logically replaces or supercedes the target document. - */ - REPLACES, - /** - * This document was generated by transforming the target document (e.g. format or language conversion). - */ - TRANSFORMS, - /** - * This document is a signature of the target document. - */ - SIGNS, - /** - * This document adds additional information to the target document. - */ - APPENDS, - /** - * added to help the parsers - */ - NULL; - public static DocumentRelationshipType fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("replaces".equals(codeString)) - return REPLACES; - if ("transforms".equals(codeString)) - return TRANSFORMS; - if ("signs".equals(codeString)) - return SIGNS; - if ("appends".equals(codeString)) - return APPENDS; - throw new Exception("Unknown DocumentRelationshipType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case REPLACES: return "replaces"; - case TRANSFORMS: return "transforms"; - case SIGNS: return "signs"; - case APPENDS: return "appends"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REPLACES: return ""; - case TRANSFORMS: return ""; - case SIGNS: return ""; - case APPENDS: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REPLACES: return "This document logically replaces or supercedes the target document."; - case TRANSFORMS: return "This document was generated by transforming the target document (e.g. format or language conversion)."; - case SIGNS: return "This document is a signature of the target document."; - case APPENDS: return "This document adds additional information to the target document."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REPLACES: return "Replaces"; - case TRANSFORMS: return "Transforms"; - case SIGNS: return "Signs"; - case APPENDS: return "Appends"; - default: return "?"; - } - } - } - - public static class DocumentRelationshipTypeEnumFactory implements EnumFactory { - public DocumentRelationshipType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("replaces".equals(codeString)) - return DocumentRelationshipType.REPLACES; - if ("transforms".equals(codeString)) - return DocumentRelationshipType.TRANSFORMS; - if ("signs".equals(codeString)) - return DocumentRelationshipType.SIGNS; - if ("appends".equals(codeString)) - return DocumentRelationshipType.APPENDS; - throw new IllegalArgumentException("Unknown DocumentRelationshipType code '"+codeString+"'"); - } - public String toCode(DocumentRelationshipType code) { - if (code == DocumentRelationshipType.REPLACES) - return "replaces"; - if (code == DocumentRelationshipType.TRANSFORMS) - return "transforms"; - if (code == DocumentRelationshipType.SIGNS) - return "signs"; - if (code == DocumentRelationshipType.APPENDS) - return "appends"; - return "?"; - } - } - - @Block() - public static class DocumentReferenceRelatesToComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The type of relationship that this document has with anther document. - */ - @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="replaces | transforms | signs | appends", formalDefinition="The type of relationship that this document has with anther document." ) - protected Enumeration code; - - /** - * The target document of this relationship. - */ - @Child(name = "target", type = {DocumentReference.class}, order=2, min=1, max=1) - @Description(shortDefinition="Target of the relationship", formalDefinition="The target document of this relationship." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (The target document of this relationship.) - */ - protected DocumentReference targetTarget; - - private static final long serialVersionUID = -347257495L; - - /* - * Constructor - */ - public DocumentReferenceRelatesToComponent() { - super(); - } - - /* - * Constructor - */ - public DocumentReferenceRelatesToComponent(Enumeration code, Reference target) { - super(); - this.code = code; - this.target = target; - } - - /** - * @return {@link #code} (The type of relationship that this document has with anther document.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Enumeration getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceRelatesToComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Enumeration(new DocumentRelationshipTypeEnumFactory()); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (The type of relationship that this document has with anther document.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public DocumentReferenceRelatesToComponent setCodeElement(Enumeration value) { - this.code = value; - return this; - } - - /** - * @return The type of relationship that this document has with anther document. - */ - public DocumentRelationshipType getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value The type of relationship that this document has with anther document. - */ - public DocumentReferenceRelatesToComponent setCode(DocumentRelationshipType value) { - if (this.code == null) - this.code = new Enumeration(new DocumentRelationshipTypeEnumFactory()); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #target} (The target document of this relationship.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceRelatesToComponent.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); // cc - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The target document of this relationship.) - */ - public DocumentReferenceRelatesToComponent setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The target document of this relationship.) - */ - public DocumentReference getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceRelatesToComponent.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new DocumentReference(); // aa - return this.targetTarget; - } - - /** - * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The target document of this relationship.) - */ - public DocumentReferenceRelatesToComponent setTargetTarget(DocumentReference value) { - this.targetTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "The type of relationship that this document has with anther document.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("target", "Reference(DocumentReference)", "The target document of this relationship.", 0, java.lang.Integer.MAX_VALUE, target)); - } - - public DocumentReferenceRelatesToComponent copy() { - DocumentReferenceRelatesToComponent dst = new DocumentReferenceRelatesToComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.target = target == null ? null : target.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DocumentReferenceRelatesToComponent)) - return false; - DocumentReferenceRelatesToComponent o = (DocumentReferenceRelatesToComponent) other; - return compareDeep(code, o.code, true) && compareDeep(target, o.target, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DocumentReferenceRelatesToComponent)) - return false; - DocumentReferenceRelatesToComponent o = (DocumentReferenceRelatesToComponent) other; - return compareValues(code, o.code, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (target == null || target.isEmpty()) - ; - } - - } - - @Block() - public static class DocumentReferenceContextComponent extends BackboneElement implements IBaseBackboneElement { - /** - * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act. - */ - @Child(name = "event", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Main Clinical Acts Documented", formalDefinition="This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a 'History and Physical Report' in which the procedure being documented is necessarily a 'History and Physical' act." ) - protected List event; - - /** - * The time period over which the service that is described by the document was provided. - */ - @Child(name = "period", type = {Period.class}, order=2, min=0, max=1) - @Description(shortDefinition="Time of service that is being documented", formalDefinition="The time period over which the service that is described by the document was provided." ) - protected Period period; - - /** - * The kind of facility where the patient was seen. - */ - @Child(name = "facilityType", type = {CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Kind of facility where patient was seen", formalDefinition="The kind of facility where the patient was seen." ) - protected CodeableConcept facilityType; - - /** - * This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty. - */ - @Child(name = "practiceSetting", type = {CodeableConcept.class}, order=4, min=0, max=1) - @Description(shortDefinition="Additional details about where the content was created (e.g. clinical specialty)", formalDefinition="This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty." ) - protected CodeableConcept practiceSetting; - - /** - * The Patient Information as known when the document was published. May be a reference to a version specific, or contained. - */ - @Child(name = "sourcePatientInfo", type = {Patient.class}, order=5, min=0, max=1) - @Description(shortDefinition="Source patient info", formalDefinition="The Patient Information as known when the document was published. May be a reference to a version specific, or contained." ) - protected Reference sourcePatientInfo; - - /** - * The actual object that is the target of the reference (The Patient Information as known when the document was published. May be a reference to a version specific, or contained.) - */ - protected Patient sourcePatientInfoTarget; - - /** - * Related identifiers or resources associated with the DocumentReference. - */ - @Child(name = "related", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Related things", formalDefinition="Related identifiers or resources associated with the DocumentReference." ) - protected List related; - - private static final long serialVersionUID = -225578230L; - - /* - * Constructor - */ - public DocumentReferenceContextComponent() { - super(); - } - - /** - * @return {@link #event} (This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.) - */ - public List getEvent() { - if (this.event == null) - this.event = new ArrayList(); - return this.event; - } - - public boolean hasEvent() { - if (this.event == null) - return false; - for (CodeableConcept item : this.event) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #event} (This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.) - */ - // syntactic sugar - public CodeableConcept addEvent() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return t; - } - - // syntactic sugar - public DocumentReferenceContextComponent addEvent(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return this; - } - - /** - * @return {@link #period} (The time period over which the service that is described by the document was provided.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceContextComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The time period over which the service that is described by the document was provided.) - */ - public DocumentReferenceContextComponent setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #facilityType} (The kind of facility where the patient was seen.) - */ - public CodeableConcept getFacilityType() { - if (this.facilityType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceContextComponent.facilityType"); - else if (Configuration.doAutoCreate()) - this.facilityType = new CodeableConcept(); // cc - return this.facilityType; - } - - public boolean hasFacilityType() { - return this.facilityType != null && !this.facilityType.isEmpty(); - } - - /** - * @param value {@link #facilityType} (The kind of facility where the patient was seen.) - */ - public DocumentReferenceContextComponent setFacilityType(CodeableConcept value) { - this.facilityType = value; - return this; - } - - /** - * @return {@link #practiceSetting} (This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.) - */ - public CodeableConcept getPracticeSetting() { - if (this.practiceSetting == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceContextComponent.practiceSetting"); - else if (Configuration.doAutoCreate()) - this.practiceSetting = new CodeableConcept(); // cc - return this.practiceSetting; - } - - public boolean hasPracticeSetting() { - return this.practiceSetting != null && !this.practiceSetting.isEmpty(); - } - - /** - * @param value {@link #practiceSetting} (This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.) - */ - public DocumentReferenceContextComponent setPracticeSetting(CodeableConcept value) { - this.practiceSetting = value; - return this; - } - - /** - * @return {@link #sourcePatientInfo} (The Patient Information as known when the document was published. May be a reference to a version specific, or contained.) - */ - public Reference getSourcePatientInfo() { - if (this.sourcePatientInfo == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceContextComponent.sourcePatientInfo"); - else if (Configuration.doAutoCreate()) - this.sourcePatientInfo = new Reference(); // cc - return this.sourcePatientInfo; - } - - public boolean hasSourcePatientInfo() { - return this.sourcePatientInfo != null && !this.sourcePatientInfo.isEmpty(); - } - - /** - * @param value {@link #sourcePatientInfo} (The Patient Information as known when the document was published. May be a reference to a version specific, or contained.) - */ - public DocumentReferenceContextComponent setSourcePatientInfo(Reference value) { - this.sourcePatientInfo = value; - return this; - } - - /** - * @return {@link #sourcePatientInfo} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Patient Information as known when the document was published. May be a reference to a version specific, or contained.) - */ - public Patient getSourcePatientInfoTarget() { - if (this.sourcePatientInfoTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceContextComponent.sourcePatientInfo"); - else if (Configuration.doAutoCreate()) - this.sourcePatientInfoTarget = new Patient(); // aa - return this.sourcePatientInfoTarget; - } - - /** - * @param value {@link #sourcePatientInfo} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Patient Information as known when the document was published. May be a reference to a version specific, or contained.) - */ - public DocumentReferenceContextComponent setSourcePatientInfoTarget(Patient value) { - this.sourcePatientInfoTarget = value; - return this; - } - - /** - * @return {@link #related} (Related identifiers or resources associated with the DocumentReference.) - */ - public List getRelated() { - if (this.related == null) - this.related = new ArrayList(); - return this.related; - } - - public boolean hasRelated() { - if (this.related == null) - return false; - for (DocumentReferenceContextRelatedComponent item : this.related) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #related} (Related identifiers or resources associated with the DocumentReference.) - */ - // syntactic sugar - public DocumentReferenceContextRelatedComponent addRelated() { //3 - DocumentReferenceContextRelatedComponent t = new DocumentReferenceContextRelatedComponent(); - if (this.related == null) - this.related = new ArrayList(); - this.related.add(t); - return t; - } - - // syntactic sugar - public DocumentReferenceContextComponent addRelated(DocumentReferenceContextRelatedComponent t) { //3 - if (t == null) - return this; - if (this.related == null) - this.related = new ArrayList(); - this.related.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("event", "CodeableConcept", "This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a 'History and Physical Report' in which the procedure being documented is necessarily a 'History and Physical' act.", 0, java.lang.Integer.MAX_VALUE, event)); - childrenList.add(new Property("period", "Period", "The time period over which the service that is described by the document was provided.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("facilityType", "CodeableConcept", "The kind of facility where the patient was seen.", 0, java.lang.Integer.MAX_VALUE, facilityType)); - childrenList.add(new Property("practiceSetting", "CodeableConcept", "This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.", 0, java.lang.Integer.MAX_VALUE, practiceSetting)); - childrenList.add(new Property("sourcePatientInfo", "Reference(Patient)", "The Patient Information as known when the document was published. May be a reference to a version specific, or contained.", 0, java.lang.Integer.MAX_VALUE, sourcePatientInfo)); - childrenList.add(new Property("related", "", "Related identifiers or resources associated with the DocumentReference.", 0, java.lang.Integer.MAX_VALUE, related)); - } - - public DocumentReferenceContextComponent copy() { - DocumentReferenceContextComponent dst = new DocumentReferenceContextComponent(); - copyValues(dst); - if (event != null) { - dst.event = new ArrayList(); - for (CodeableConcept i : event) - dst.event.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - dst.facilityType = facilityType == null ? null : facilityType.copy(); - dst.practiceSetting = practiceSetting == null ? null : practiceSetting.copy(); - dst.sourcePatientInfo = sourcePatientInfo == null ? null : sourcePatientInfo.copy(); - if (related != null) { - dst.related = new ArrayList(); - for (DocumentReferenceContextRelatedComponent i : related) - dst.related.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DocumentReferenceContextComponent)) - return false; - DocumentReferenceContextComponent o = (DocumentReferenceContextComponent) other; - return compareDeep(event, o.event, true) && compareDeep(period, o.period, true) && compareDeep(facilityType, o.facilityType, true) - && compareDeep(practiceSetting, o.practiceSetting, true) && compareDeep(sourcePatientInfo, o.sourcePatientInfo, true) - && compareDeep(related, o.related, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DocumentReferenceContextComponent)) - return false; - DocumentReferenceContextComponent o = (DocumentReferenceContextComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (event == null || event.isEmpty()) && (period == null || period.isEmpty()) - && (facilityType == null || facilityType.isEmpty()) && (practiceSetting == null || practiceSetting.isEmpty()) - && (sourcePatientInfo == null || sourcePatientInfo.isEmpty()) && (related == null || related.isEmpty()) - ; - } - - } - - @Block() - public static class DocumentReferenceContextRelatedComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) - @Description(shortDefinition="Related Identifier", formalDefinition="Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing." ) - protected Identifier identifier; - - /** - * Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing. - */ - @Child(name = "ref", type = {}, order=2, min=0, max=1) - @Description(shortDefinition="Related Resource", formalDefinition="Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing." ) - protected Reference ref; - - /** - * The actual object that is the target of the reference (Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.) - */ - protected Resource refTarget; - - private static final long serialVersionUID = -1670123330L; - - /* - * Constructor - */ - public DocumentReferenceContextRelatedComponent() { - super(); - } - - /** - * @return {@link #identifier} (Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceContextRelatedComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing.) - */ - public DocumentReferenceContextRelatedComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #ref} (Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.) - */ - public Reference getRef() { - if (this.ref == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceContextRelatedComponent.ref"); - else if (Configuration.doAutoCreate()) - this.ref = new Reference(); // cc - return this.ref; - } - - public boolean hasRef() { - return this.ref != null && !this.ref.isEmpty(); - } - - /** - * @param value {@link #ref} (Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.) - */ - public DocumentReferenceContextRelatedComponent setRef(Reference value) { - this.ref = value; - return this; - } - - /** - * @return {@link #ref} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.) - */ - public Resource getRefTarget() { - return this.refTarget; - } - - /** - * @param value {@link #ref} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.) - */ - public DocumentReferenceContextRelatedComponent setRefTarget(Resource value) { - this.refTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("ref", "Reference(Any)", "Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.", 0, java.lang.Integer.MAX_VALUE, ref)); - } - - public DocumentReferenceContextRelatedComponent copy() { - DocumentReferenceContextRelatedComponent dst = new DocumentReferenceContextRelatedComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.ref = ref == null ? null : ref.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DocumentReferenceContextRelatedComponent)) - return false; - DocumentReferenceContextRelatedComponent o = (DocumentReferenceContextRelatedComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(ref, o.ref, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DocumentReferenceContextRelatedComponent)) - return false; - DocumentReferenceContextRelatedComponent o = (DocumentReferenceContextRelatedComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ref == null || ref.isEmpty()) - ; - } - - } - - /** - * Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document. - */ - @Child(name = "masterIdentifier", type = {Identifier.class}, order=0, min=0, max=1) - @Description(shortDefinition="Master Version Specific Identifier", formalDefinition="Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document." ) - protected Identifier masterIdentifier; - - /** - * Other identifiers associated with the document, including version independent identifiers. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Other identifiers for the document", formalDefinition="Other identifiers associated with the document, including version independent identifiers." ) - protected List identifier; - - /** - * Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). - */ - @Child(name = "subject", type = {Patient.class, Practitioner.class, Group.class, Device.class}, order=2, min=0, max=1) - @Description(shortDefinition="Who|what is the subject of the document", formalDefinition="Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure)." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) - */ - protected Resource subjectTarget; - - /** - * Specifies the particular kind of document. This usually equates to the purpose of making the document. It is recommended that the value Set be drawn from a coding scheme providing a fine level of granularity such as LOINC. (e.g. Patient Summary, Discharge Summary, Prescription, etc.). - */ - @Child(name = "type", type = {CodeableConcept.class}, order=3, min=1, max=1) - @Description(shortDefinition="Kind of document", formalDefinition="Specifies the particular kind of document. This usually equates to the purpose of making the document. It is recommended that the value Set be drawn from a coding scheme providing a fine level of granularity such as LOINC. (e.g. Patient Summary, Discharge Summary, Prescription, etc.)." ) - protected CodeableConcept type; - - /** - * A categorization for the type of document. The class is an abstraction from the type specifying the high-level kind of document (e.g., Report, Summary, Images, Treatment Plan, Patient Preferences, Workflow) at a macro level. - */ - @Child(name = "class_", type = {CodeableConcept.class}, order=4, min=0, max=1) - @Description(shortDefinition="Categorization of document", formalDefinition="A categorization for the type of document. The class is an abstraction from the type specifying the high-level kind of document (e.g., Report, Summary, Images, Treatment Plan, Patient Preferences, Workflow) at a macro level." ) - protected CodeableConcept class_; - - /** - * An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType. - */ - @Child(name = "format", type = {UriType.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Format/content rules for the document", formalDefinition="An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType." ) - protected List format; - - /** - * Identifies who is responsible for adding the information to the document. - */ - @Child(name = "author", type = {Practitioner.class, Organization.class, Device.class, Patient.class, RelatedPerson.class}, order=6, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who and/or what authored the document", formalDefinition="Identifies who is responsible for adding the information to the document." ) - protected List author; - /** - * The actual objects that are the target of the reference (Identifies who is responsible for adding the information to the document.) - */ - protected List authorTarget; - - - /** - * Identifies the organization or group who is responsible for ongoing maintenance of and access to the document. - */ - @Child(name = "custodian", type = {Organization.class}, order=7, min=0, max=1) - @Description(shortDefinition="Org which maintains the document", formalDefinition="Identifies the organization or group who is responsible for ongoing maintenance of and access to the document." ) - protected Reference custodian; - - /** - * The actual object that is the target of the reference (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) - */ - protected Organization custodianTarget; - - /** - * Which person or organization authenticates that this document is valid. - */ - @Child(name = "authenticator", type = {Practitioner.class, Organization.class}, order=8, min=0, max=1) - @Description(shortDefinition="Who/What authenticated the document", formalDefinition="Which person or organization authenticates that this document is valid." ) - protected Reference authenticator; - - /** - * The actual object that is the target of the reference (Which person or organization authenticates that this document is valid.) - */ - protected Resource authenticatorTarget; - - /** - * When the document was created. - */ - @Child(name = "created", type = {DateTimeType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Document creation time", formalDefinition="When the document was created." ) - protected DateTimeType created; - - /** - * When the document reference was created. - */ - @Child(name = "indexed", type = {InstantType.class}, order=10, min=1, max=1) - @Description(shortDefinition="When this document reference created", formalDefinition="When the document reference was created." ) - protected InstantType indexed; - - /** - * The status of this document reference. - */ - @Child(name = "status", type = {CodeType.class}, order=11, min=1, max=1) - @Description(shortDefinition="current | superceded | entered-in-error", formalDefinition="The status of this document reference." ) - protected Enumeration status; - - /** - * The status of the underlying document. - */ - @Child(name = "docStatus", type = {CodeableConcept.class}, order=12, min=0, max=1) - @Description(shortDefinition="preliminary | final | appended | amended | entered-in-error", formalDefinition="The status of the underlying document." ) - protected CodeableConcept docStatus; - - /** - * Relationships that this document has with other document references that already exist. - */ - @Child(name = "relatesTo", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Relationships to other documents", formalDefinition="Relationships that this document has with other document references that already exist." ) - protected List relatesTo; - - /** - * Human-readable description of the source document. This is sometimes known as the "title". - */ - @Child(name = "description", type = {StringType.class}, order=14, min=0, max=1) - @Description(shortDefinition="Human-readable description (title)", formalDefinition="Human-readable description of the source document. This is sometimes known as the 'title'." ) - protected StringType description; - - /** - * A set of Security-Tag codes specifying the level of privacy/security of the Document. - */ - @Child(name = "confidentiality", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Document security-tags", formalDefinition="A set of Security-Tag codes specifying the level of privacy/security of the Document." ) - protected List confidentiality; - - /** - * The document or url to the document along with critical metadata to prove content has integrity. - */ - @Child(name = "content", type = {Attachment.class}, order=16, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Where to access the document", formalDefinition="The document or url to the document along with critical metadata to prove content has integrity." ) - protected List content; - - /** - * The clinical context in which the document was prepared. - */ - @Child(name = "context", type = {}, order=17, min=0, max=1) - @Description(shortDefinition="Clinical context of document", formalDefinition="The clinical context in which the document was prepared." ) - protected DocumentReferenceContextComponent context; - - private static final long serialVersionUID = 1440270142L; - - /* - * Constructor - */ - public DocumentReference() { - super(); - } - - /* - * Constructor - */ - public DocumentReference(CodeableConcept type, InstantType indexed, Enumeration status) { - super(); - this.type = type; - this.indexed = indexed; - this.status = status; - } - - /** - * @return {@link #masterIdentifier} (Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document.) - */ - public Identifier getMasterIdentifier() { - if (this.masterIdentifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.masterIdentifier"); - else if (Configuration.doAutoCreate()) - this.masterIdentifier = new Identifier(); // cc - return this.masterIdentifier; - } - - public boolean hasMasterIdentifier() { - return this.masterIdentifier != null && !this.masterIdentifier.isEmpty(); - } - - /** - * @param value {@link #masterIdentifier} (Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document.) - */ - public DocumentReference setMasterIdentifier(Identifier value) { - this.masterIdentifier = value; - return this; - } - - /** - * @return {@link #identifier} (Other identifiers associated with the document, including version independent identifiers.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Other identifiers associated with the document, including version independent identifiers.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public DocumentReference addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #subject} (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) - */ - public DocumentReference setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) - */ - public DocumentReference setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #type} (Specifies the particular kind of document. This usually equates to the purpose of making the document. It is recommended that the value Set be drawn from a coding scheme providing a fine level of granularity such as LOINC. (e.g. Patient Summary, Discharge Summary, Prescription, etc.).) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Specifies the particular kind of document. This usually equates to the purpose of making the document. It is recommended that the value Set be drawn from a coding scheme providing a fine level of granularity such as LOINC. (e.g. Patient Summary, Discharge Summary, Prescription, etc.).) - */ - public DocumentReference setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #class_} (A categorization for the type of document. The class is an abstraction from the type specifying the high-level kind of document (e.g., Report, Summary, Images, Treatment Plan, Patient Preferences, Workflow) at a macro level.) - */ - public CodeableConcept getClass_() { - if (this.class_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.class_"); - else if (Configuration.doAutoCreate()) - this.class_ = new CodeableConcept(); // cc - return this.class_; - } - - public boolean hasClass_() { - return this.class_ != null && !this.class_.isEmpty(); - } - - /** - * @param value {@link #class_} (A categorization for the type of document. The class is an abstraction from the type specifying the high-level kind of document (e.g., Report, Summary, Images, Treatment Plan, Patient Preferences, Workflow) at a macro level.) - */ - public DocumentReference setClass_(CodeableConcept value) { - this.class_ = value; - return this; - } - - /** - * @return {@link #format} (An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.) - */ - public List getFormat() { - if (this.format == null) - this.format = new ArrayList(); - return this.format; - } - - public boolean hasFormat() { - if (this.format == null) - return false; - for (UriType item : this.format) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #format} (An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.) - */ - // syntactic sugar - public UriType addFormatElement() {//2 - UriType t = new UriType(); - if (this.format == null) - this.format = new ArrayList(); - this.format.add(t); - return t; - } - - /** - * @param value {@link #format} (An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.) - */ - public DocumentReference addFormat(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.format == null) - this.format = new ArrayList(); - this.format.add(t); - return this; - } - - /** - * @param value {@link #format} (An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.) - */ - public boolean hasFormat(String value) { - if (this.format == null) - return false; - for (UriType v : this.format) - if (v.equals(value)) // uri - return true; - return false; - } - - /** - * @return {@link #author} (Identifies who is responsible for adding the information to the document.) - */ - public List getAuthor() { - if (this.author == null) - this.author = new ArrayList(); - return this.author; - } - - public boolean hasAuthor() { - if (this.author == null) - return false; - for (Reference item : this.author) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #author} (Identifies who is responsible for adding the information to the document.) - */ - // syntactic sugar - public Reference addAuthor() { //3 - Reference t = new Reference(); - if (this.author == null) - this.author = new ArrayList(); - this.author.add(t); - return t; - } - - // syntactic sugar - public DocumentReference addAuthor(Reference t) { //3 - if (t == null) - return this; - if (this.author == null) - this.author = new ArrayList(); - this.author.add(t); - return this; - } - - /** - * @return {@link #author} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies who is responsible for adding the information to the document.) - */ - public List getAuthorTarget() { - if (this.authorTarget == null) - this.authorTarget = new ArrayList(); - return this.authorTarget; - } - - /** - * @return {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) - */ - public Reference getCustodian() { - if (this.custodian == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.custodian"); - else if (Configuration.doAutoCreate()) - this.custodian = new Reference(); // cc - return this.custodian; - } - - public boolean hasCustodian() { - return this.custodian != null && !this.custodian.isEmpty(); - } - - /** - * @param value {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) - */ - public DocumentReference setCustodian(Reference value) { - this.custodian = value; - return this; - } - - /** - * @return {@link #custodian} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) - */ - public Organization getCustodianTarget() { - if (this.custodianTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.custodian"); - else if (Configuration.doAutoCreate()) - this.custodianTarget = new Organization(); // aa - return this.custodianTarget; - } - - /** - * @param value {@link #custodian} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) - */ - public DocumentReference setCustodianTarget(Organization value) { - this.custodianTarget = value; - return this; - } - - /** - * @return {@link #authenticator} (Which person or organization authenticates that this document is valid.) - */ - public Reference getAuthenticator() { - if (this.authenticator == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.authenticator"); - else if (Configuration.doAutoCreate()) - this.authenticator = new Reference(); // cc - return this.authenticator; - } - - public boolean hasAuthenticator() { - return this.authenticator != null && !this.authenticator.isEmpty(); - } - - /** - * @param value {@link #authenticator} (Which person or organization authenticates that this document is valid.) - */ - public DocumentReference setAuthenticator(Reference value) { - this.authenticator = value; - return this; - } - - /** - * @return {@link #authenticator} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Which person or organization authenticates that this document is valid.) - */ - public Resource getAuthenticatorTarget() { - return this.authenticatorTarget; - } - - /** - * @param value {@link #authenticator} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Which person or organization authenticates that this document is valid.) - */ - public DocumentReference setAuthenticatorTarget(Resource value) { - this.authenticatorTarget = value; - return this; - } - - /** - * @return {@link #created} (When the document was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (When the document was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DocumentReference setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return When the document was created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value When the document was created. - */ - public DocumentReference setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #indexed} (When the document reference was created.). This is the underlying object with id, value and extensions. The accessor "getIndexed" gives direct access to the value - */ - public InstantType getIndexedElement() { - if (this.indexed == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.indexed"); - else if (Configuration.doAutoCreate()) - this.indexed = new InstantType(); // bb - return this.indexed; - } - - public boolean hasIndexedElement() { - return this.indexed != null && !this.indexed.isEmpty(); - } - - public boolean hasIndexed() { - return this.indexed != null && !this.indexed.isEmpty(); - } - - /** - * @param value {@link #indexed} (When the document reference was created.). This is the underlying object with id, value and extensions. The accessor "getIndexed" gives direct access to the value - */ - public DocumentReference setIndexedElement(InstantType value) { - this.indexed = value; - return this; - } - - /** - * @return When the document reference was created. - */ - public Date getIndexed() { - return this.indexed == null ? null : this.indexed.getValue(); - } - - /** - * @param value When the document reference was created. - */ - public DocumentReference setIndexed(Date value) { - if (this.indexed == null) - this.indexed = new InstantType(); - this.indexed.setValue(value); - return this; - } - - /** - * @return {@link #status} (The status of this document reference.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new DocumentReferenceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of this document reference.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DocumentReference setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of this document reference. - */ - public DocumentReferenceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of this document reference. - */ - public DocumentReference setStatus(DocumentReferenceStatus value) { - if (this.status == null) - this.status = new Enumeration(new DocumentReferenceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #docStatus} (The status of the underlying document.) - */ - public CodeableConcept getDocStatus() { - if (this.docStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.docStatus"); - else if (Configuration.doAutoCreate()) - this.docStatus = new CodeableConcept(); // cc - return this.docStatus; - } - - public boolean hasDocStatus() { - return this.docStatus != null && !this.docStatus.isEmpty(); - } - - /** - * @param value {@link #docStatus} (The status of the underlying document.) - */ - public DocumentReference setDocStatus(CodeableConcept value) { - this.docStatus = value; - return this; - } - - /** - * @return {@link #relatesTo} (Relationships that this document has with other document references that already exist.) - */ - public List getRelatesTo() { - if (this.relatesTo == null) - this.relatesTo = new ArrayList(); - return this.relatesTo; - } - - public boolean hasRelatesTo() { - if (this.relatesTo == null) - return false; - for (DocumentReferenceRelatesToComponent item : this.relatesTo) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #relatesTo} (Relationships that this document has with other document references that already exist.) - */ - // syntactic sugar - public DocumentReferenceRelatesToComponent addRelatesTo() { //3 - DocumentReferenceRelatesToComponent t = new DocumentReferenceRelatesToComponent(); - if (this.relatesTo == null) - this.relatesTo = new ArrayList(); - this.relatesTo.add(t); - return t; - } - - // syntactic sugar - public DocumentReference addRelatesTo(DocumentReferenceRelatesToComponent t) { //3 - if (t == null) - return this; - if (this.relatesTo == null) - this.relatesTo = new ArrayList(); - this.relatesTo.add(t); - return this; - } - - /** - * @return {@link #description} (Human-readable description of the source document. This is sometimes known as the "title".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Human-readable description of the source document. This is sometimes known as the "title".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public DocumentReference setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Human-readable description of the source document. This is sometimes known as the "title". - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Human-readable description of the source document. This is sometimes known as the "title". - */ - public DocumentReference setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #confidentiality} (A set of Security-Tag codes specifying the level of privacy/security of the Document.) - */ - public List getConfidentiality() { - if (this.confidentiality == null) - this.confidentiality = new ArrayList(); - return this.confidentiality; - } - - public boolean hasConfidentiality() { - if (this.confidentiality == null) - return false; - for (CodeableConcept item : this.confidentiality) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #confidentiality} (A set of Security-Tag codes specifying the level of privacy/security of the Document.) - */ - // syntactic sugar - public CodeableConcept addConfidentiality() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.confidentiality == null) - this.confidentiality = new ArrayList(); - this.confidentiality.add(t); - return t; - } - - // syntactic sugar - public DocumentReference addConfidentiality(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.confidentiality == null) - this.confidentiality = new ArrayList(); - this.confidentiality.add(t); - return this; - } - - /** - * @return {@link #content} (The document or url to the document along with critical metadata to prove content has integrity.) - */ - public List getContent() { - if (this.content == null) - this.content = new ArrayList(); - return this.content; - } - - public boolean hasContent() { - if (this.content == null) - return false; - for (Attachment item : this.content) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #content} (The document or url to the document along with critical metadata to prove content has integrity.) - */ - // syntactic sugar - public Attachment addContent() { //3 - Attachment t = new Attachment(); - if (this.content == null) - this.content = new ArrayList(); - this.content.add(t); - return t; - } - - // syntactic sugar - public DocumentReference addContent(Attachment t) { //3 - if (t == null) - return this; - if (this.content == null) - this.content = new ArrayList(); - this.content.add(t); - return this; - } - - /** - * @return {@link #context} (The clinical context in which the document was prepared.) - */ - public DocumentReferenceContextComponent getContext() { - if (this.context == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.context"); - else if (Configuration.doAutoCreate()) - this.context = new DocumentReferenceContextComponent(); // cc - return this.context; - } - - public boolean hasContext() { - return this.context != null && !this.context.isEmpty(); - } - - /** - * @param value {@link #context} (The clinical context in which the document was prepared.) - */ - public DocumentReference setContext(DocumentReferenceContextComponent value) { - this.context = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("masterIdentifier", "Identifier", "Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document.", 0, java.lang.Integer.MAX_VALUE, masterIdentifier)); - childrenList.add(new Property("identifier", "Identifier", "Other identifiers associated with the document, including version independent identifiers.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("subject", "Reference(Patient|Practitioner|Group|Device)", "Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("type", "CodeableConcept", "Specifies the particular kind of document. This usually equates to the purpose of making the document. It is recommended that the value Set be drawn from a coding scheme providing a fine level of granularity such as LOINC. (e.g. Patient Summary, Discharge Summary, Prescription, etc.).", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("class", "CodeableConcept", "A categorization for the type of document. The class is an abstraction from the type specifying the high-level kind of document (e.g., Report, Summary, Images, Treatment Plan, Patient Preferences, Workflow) at a macro level.", 0, java.lang.Integer.MAX_VALUE, class_)); - childrenList.add(new Property("format", "uri", "An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.", 0, java.lang.Integer.MAX_VALUE, format)); - childrenList.add(new Property("author", "Reference(Practitioner|Organization|Device|Patient|RelatedPerson)", "Identifies who is responsible for adding the information to the document.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("custodian", "Reference(Organization)", "Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.", 0, java.lang.Integer.MAX_VALUE, custodian)); - childrenList.add(new Property("authenticator", "Reference(Practitioner|Organization)", "Which person or organization authenticates that this document is valid.", 0, java.lang.Integer.MAX_VALUE, authenticator)); - childrenList.add(new Property("created", "dateTime", "When the document was created.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("indexed", "instant", "When the document reference was created.", 0, java.lang.Integer.MAX_VALUE, indexed)); - childrenList.add(new Property("status", "code", "The status of this document reference.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("docStatus", "CodeableConcept", "The status of the underlying document.", 0, java.lang.Integer.MAX_VALUE, docStatus)); - childrenList.add(new Property("relatesTo", "", "Relationships that this document has with other document references that already exist.", 0, java.lang.Integer.MAX_VALUE, relatesTo)); - childrenList.add(new Property("description", "string", "Human-readable description of the source document. This is sometimes known as the 'title'.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("confidentiality", "CodeableConcept", "A set of Security-Tag codes specifying the level of privacy/security of the Document.", 0, java.lang.Integer.MAX_VALUE, confidentiality)); - childrenList.add(new Property("content", "Attachment", "The document or url to the document along with critical metadata to prove content has integrity.", 0, java.lang.Integer.MAX_VALUE, content)); - childrenList.add(new Property("context", "", "The clinical context in which the document was prepared.", 0, java.lang.Integer.MAX_VALUE, context)); - } - - public DocumentReference copy() { - DocumentReference dst = new DocumentReference(); - copyValues(dst); - dst.masterIdentifier = masterIdentifier == null ? null : masterIdentifier.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.subject = subject == null ? null : subject.copy(); - dst.type = type == null ? null : type.copy(); - dst.class_ = class_ == null ? null : class_.copy(); - if (format != null) { - dst.format = new ArrayList(); - for (UriType i : format) - dst.format.add(i.copy()); - }; - if (author != null) { - dst.author = new ArrayList(); - for (Reference i : author) - dst.author.add(i.copy()); - }; - dst.custodian = custodian == null ? null : custodian.copy(); - dst.authenticator = authenticator == null ? null : authenticator.copy(); - dst.created = created == null ? null : created.copy(); - dst.indexed = indexed == null ? null : indexed.copy(); - dst.status = status == null ? null : status.copy(); - dst.docStatus = docStatus == null ? null : docStatus.copy(); - if (relatesTo != null) { - dst.relatesTo = new ArrayList(); - for (DocumentReferenceRelatesToComponent i : relatesTo) - dst.relatesTo.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - if (confidentiality != null) { - dst.confidentiality = new ArrayList(); - for (CodeableConcept i : confidentiality) - dst.confidentiality.add(i.copy()); - }; - if (content != null) { - dst.content = new ArrayList(); - for (Attachment i : content) - dst.content.add(i.copy()); - }; - dst.context = context == null ? null : context.copy(); - return dst; - } - - protected DocumentReference typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DocumentReference)) - return false; - DocumentReference o = (DocumentReference) other; - return compareDeep(masterIdentifier, o.masterIdentifier, true) && compareDeep(identifier, o.identifier, true) - && compareDeep(subject, o.subject, true) && compareDeep(type, o.type, true) && compareDeep(class_, o.class_, true) - && compareDeep(format, o.format, true) && compareDeep(author, o.author, true) && compareDeep(custodian, o.custodian, true) - && compareDeep(authenticator, o.authenticator, true) && compareDeep(created, o.created, true) && compareDeep(indexed, o.indexed, true) - && compareDeep(status, o.status, true) && compareDeep(docStatus, o.docStatus, true) && compareDeep(relatesTo, o.relatesTo, true) - && compareDeep(description, o.description, true) && compareDeep(confidentiality, o.confidentiality, true) - && compareDeep(content, o.content, true) && compareDeep(context, o.context, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DocumentReference)) - return false; - DocumentReference o = (DocumentReference) other; - return compareValues(format, o.format, true) && compareValues(created, o.created, true) && compareValues(indexed, o.indexed, true) - && compareValues(status, o.status, true) && compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (masterIdentifier == null || masterIdentifier.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (subject == null || subject.isEmpty()) && (type == null || type.isEmpty()) && (class_ == null || class_.isEmpty()) - && (format == null || format.isEmpty()) && (author == null || author.isEmpty()) && (custodian == null || custodian.isEmpty()) - && (authenticator == null || authenticator.isEmpty()) && (created == null || created.isEmpty()) - && (indexed == null || indexed.isEmpty()) && (status == null || status.isEmpty()) && (docStatus == null || docStatus.isEmpty()) - && (relatesTo == null || relatesTo.isEmpty()) && (description == null || description.isEmpty()) - && (confidentiality == null || confidentiality.isEmpty()) && (content == null || content.isEmpty()) - && (context == null || context.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DocumentReference; - } - - @SearchParamDefinition(name="location", path="DocumentReference.content.url", description="Uri where the data can be found", type="uri" ) - public static final String SP_LOCATION = "location"; - @SearchParamDefinition(name="indexed", path="DocumentReference.indexed", description="When this document reference created", type="date" ) - public static final String SP_INDEXED = "indexed"; - @SearchParamDefinition(name="status", path="DocumentReference.status", description="current | superceded | entered-in-error", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="subject", path="DocumentReference.subject", description="Who|what is the subject of the document", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="relatesto", path="DocumentReference.relatesTo.target", description="Target of the relationship", type="reference" ) - public static final String SP_RELATESTO = "relatesto"; - @SearchParamDefinition(name="relation", path="DocumentReference.relatesTo.code", description="replaces | transforms | signs | appends", type="token" ) - public static final String SP_RELATION = "relation"; - @SearchParamDefinition(name="class", path="DocumentReference.class", description="Categorization of document", type="token" ) - public static final String SP_CLASS = "class"; - @SearchParamDefinition(name="format", path="DocumentReference.format", description="Format/content rules for the document", type="uri" ) - public static final String SP_FORMAT = "format"; - @SearchParamDefinition(name="period", path="DocumentReference.context.period", description="Time of service that is being documented", type="date" ) - public static final String SP_PERIOD = "period"; - @SearchParamDefinition(name="type", path="DocumentReference.type", description="Kind of document", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="authenticator", path="DocumentReference.authenticator", description="Who/What authenticated the document", type="reference" ) - public static final String SP_AUTHENTICATOR = "authenticator"; - @SearchParamDefinition(name="relatedid", path="DocumentReference.context.related.identifier", description="Related Identifier", type="token" ) - public static final String SP_RELATEDID = "relatedid"; - @SearchParamDefinition(name="setting", path="DocumentReference.context.practiceSetting", description="Additional details about where the content was created (e.g. clinical specialty)", type="token" ) - public static final String SP_SETTING = "setting"; - @SearchParamDefinition(name="relationship", path="", description="Combination of relation and relatesTo", type="composite" ) - public static final String SP_RELATIONSHIP = "relationship"; - @SearchParamDefinition(name="author", path="DocumentReference.author", description="Who and/or what authored the document", type="reference" ) - public static final String SP_AUTHOR = "author"; - @SearchParamDefinition(name="relatedref", path="DocumentReference.context.related.ref", description="Related Resource", type="reference" ) - public static final String SP_RELATEDREF = "relatedref"; - @SearchParamDefinition(name="patient", path="DocumentReference.subject", description="Who|what is the subject of the document", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="custodian", path="DocumentReference.custodian", description="Org which maintains the document", type="reference" ) - public static final String SP_CUSTODIAN = "custodian"; - @SearchParamDefinition(name="facility", path="DocumentReference.context.facilityType", description="Kind of facility where patient was seen", type="token" ) - public static final String SP_FACILITY = "facility"; - @SearchParamDefinition(name="created", path="DocumentReference.created", description="Document creation time", type="date" ) - public static final String SP_CREATED = "created"; - @SearchParamDefinition(name="event", path="DocumentReference.context.event", description="Main Clinical Acts Documented", type="token" ) - public static final String SP_EVENT = "event"; - @SearchParamDefinition(name="confidentiality", path="DocumentReference.confidentiality", description="Document security-tags", type="token" ) - public static final String SP_CONFIDENTIALITY = "confidentiality"; - @SearchParamDefinition(name="description", path="DocumentReference.description", description="Human-readable description (title)", type="string" ) - public static final String SP_DESCRIPTION = "description"; - @SearchParamDefinition(name="language", path="DocumentReference.content.language", description="Human language of the content (BCP-47)", type="token" ) - public static final String SP_LANGUAGE = "language"; - @SearchParamDefinition(name="identifier", path="DocumentReference.masterIdentifier|DocumentReference.identifier", description="Master Version Specific Identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A reference to a document. + */ +@ResourceDef(name="DocumentReference", profile="http://hl7.org/fhir/Profile/DocumentReference") +public class DocumentReference extends DomainResource { + + public enum DocumentReferenceStatus { + /** + * This is the current reference for this document. + */ + CURRENT, + /** + * This reference has been superceded by another reference. + */ + SUPERCEDED, + /** + * This reference was created in error. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static DocumentReferenceStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("current".equals(codeString)) + return CURRENT; + if ("superceded".equals(codeString)) + return SUPERCEDED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new Exception("Unknown DocumentReferenceStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CURRENT: return "current"; + case SUPERCEDED: return "superceded"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CURRENT: return ""; + case SUPERCEDED: return ""; + case ENTEREDINERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CURRENT: return "This is the current reference for this document."; + case SUPERCEDED: return "This reference has been superceded by another reference."; + case ENTEREDINERROR: return "This reference was created in error."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CURRENT: return "Current"; + case SUPERCEDED: return "Superceded"; + case ENTEREDINERROR: return "Entered In Error"; + default: return "?"; + } + } + } + + public static class DocumentReferenceStatusEnumFactory implements EnumFactory { + public DocumentReferenceStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("current".equals(codeString)) + return DocumentReferenceStatus.CURRENT; + if ("superceded".equals(codeString)) + return DocumentReferenceStatus.SUPERCEDED; + if ("entered-in-error".equals(codeString)) + return DocumentReferenceStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'"); + } + public String toCode(DocumentReferenceStatus code) { + if (code == DocumentReferenceStatus.CURRENT) + return "current"; + if (code == DocumentReferenceStatus.SUPERCEDED) + return "superceded"; + if (code == DocumentReferenceStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + } + + public enum DocumentRelationshipType { + /** + * This document logically replaces or supercedes the target document. + */ + REPLACES, + /** + * This document was generated by transforming the target document (e.g. format or language conversion). + */ + TRANSFORMS, + /** + * This document is a signature of the target document. + */ + SIGNS, + /** + * This document adds additional information to the target document. + */ + APPENDS, + /** + * added to help the parsers + */ + NULL; + public static DocumentRelationshipType fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("replaces".equals(codeString)) + return REPLACES; + if ("transforms".equals(codeString)) + return TRANSFORMS; + if ("signs".equals(codeString)) + return SIGNS; + if ("appends".equals(codeString)) + return APPENDS; + throw new Exception("Unknown DocumentRelationshipType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case REPLACES: return "replaces"; + case TRANSFORMS: return "transforms"; + case SIGNS: return "signs"; + case APPENDS: return "appends"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REPLACES: return ""; + case TRANSFORMS: return ""; + case SIGNS: return ""; + case APPENDS: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REPLACES: return "This document logically replaces or supercedes the target document."; + case TRANSFORMS: return "This document was generated by transforming the target document (e.g. format or language conversion)."; + case SIGNS: return "This document is a signature of the target document."; + case APPENDS: return "This document adds additional information to the target document."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REPLACES: return "Replaces"; + case TRANSFORMS: return "Transforms"; + case SIGNS: return "Signs"; + case APPENDS: return "Appends"; + default: return "?"; + } + } + } + + public static class DocumentRelationshipTypeEnumFactory implements EnumFactory { + public DocumentRelationshipType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("replaces".equals(codeString)) + return DocumentRelationshipType.REPLACES; + if ("transforms".equals(codeString)) + return DocumentRelationshipType.TRANSFORMS; + if ("signs".equals(codeString)) + return DocumentRelationshipType.SIGNS; + if ("appends".equals(codeString)) + return DocumentRelationshipType.APPENDS; + throw new IllegalArgumentException("Unknown DocumentRelationshipType code '"+codeString+"'"); + } + public String toCode(DocumentRelationshipType code) { + if (code == DocumentRelationshipType.REPLACES) + return "replaces"; + if (code == DocumentRelationshipType.TRANSFORMS) + return "transforms"; + if (code == DocumentRelationshipType.SIGNS) + return "signs"; + if (code == DocumentRelationshipType.APPENDS) + return "appends"; + return "?"; + } + } + + @Block() + public static class DocumentReferenceRelatesToComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The type of relationship that this document has with anther document. + */ + @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="replaces | transforms | signs | appends", formalDefinition="The type of relationship that this document has with anther document." ) + protected Enumeration code; + + /** + * The target document of this relationship. + */ + @Child(name = "target", type = {DocumentReference.class}, order=2, min=1, max=1) + @Description(shortDefinition="Target of the relationship", formalDefinition="The target document of this relationship." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (The target document of this relationship.) + */ + protected DocumentReference targetTarget; + + private static final long serialVersionUID = -347257495L; + + /* + * Constructor + */ + public DocumentReferenceRelatesToComponent() { + super(); + } + + /* + * Constructor + */ + public DocumentReferenceRelatesToComponent(Enumeration code, Reference target) { + super(); + this.code = code; + this.target = target; + } + + /** + * @return {@link #code} (The type of relationship that this document has with anther document.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Enumeration getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceRelatesToComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Enumeration(new DocumentRelationshipTypeEnumFactory()); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (The type of relationship that this document has with anther document.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public DocumentReferenceRelatesToComponent setCodeElement(Enumeration value) { + this.code = value; + return this; + } + + /** + * @return The type of relationship that this document has with anther document. + */ + public DocumentRelationshipType getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value The type of relationship that this document has with anther document. + */ + public DocumentReferenceRelatesToComponent setCode(DocumentRelationshipType value) { + if (this.code == null) + this.code = new Enumeration(new DocumentRelationshipTypeEnumFactory()); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #target} (The target document of this relationship.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceRelatesToComponent.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); // cc + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The target document of this relationship.) + */ + public DocumentReferenceRelatesToComponent setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The target document of this relationship.) + */ + public DocumentReference getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceRelatesToComponent.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new DocumentReference(); // aa + return this.targetTarget; + } + + /** + * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The target document of this relationship.) + */ + public DocumentReferenceRelatesToComponent setTargetTarget(DocumentReference value) { + this.targetTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "The type of relationship that this document has with anther document.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("target", "Reference(DocumentReference)", "The target document of this relationship.", 0, java.lang.Integer.MAX_VALUE, target)); + } + + public DocumentReferenceRelatesToComponent copy() { + DocumentReferenceRelatesToComponent dst = new DocumentReferenceRelatesToComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.target = target == null ? null : target.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DocumentReferenceRelatesToComponent)) + return false; + DocumentReferenceRelatesToComponent o = (DocumentReferenceRelatesToComponent) other; + return compareDeep(code, o.code, true) && compareDeep(target, o.target, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DocumentReferenceRelatesToComponent)) + return false; + DocumentReferenceRelatesToComponent o = (DocumentReferenceRelatesToComponent) other; + return compareValues(code, o.code, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (target == null || target.isEmpty()) + ; + } + + } + + @Block() + public static class DocumentReferenceContextComponent extends BackboneElement implements IBaseBackboneElement { + /** + * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act. + */ + @Child(name = "event", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Main Clinical Acts Documented", formalDefinition="This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a 'History and Physical Report' in which the procedure being documented is necessarily a 'History and Physical' act." ) + protected List event; + + /** + * The time period over which the service that is described by the document was provided. + */ + @Child(name = "period", type = {Period.class}, order=2, min=0, max=1) + @Description(shortDefinition="Time of service that is being documented", formalDefinition="The time period over which the service that is described by the document was provided." ) + protected Period period; + + /** + * The kind of facility where the patient was seen. + */ + @Child(name = "facilityType", type = {CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Kind of facility where patient was seen", formalDefinition="The kind of facility where the patient was seen." ) + protected CodeableConcept facilityType; + + /** + * This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty. + */ + @Child(name = "practiceSetting", type = {CodeableConcept.class}, order=4, min=0, max=1) + @Description(shortDefinition="Additional details about where the content was created (e.g. clinical specialty)", formalDefinition="This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty." ) + protected CodeableConcept practiceSetting; + + /** + * The Patient Information as known when the document was published. May be a reference to a version specific, or contained. + */ + @Child(name = "sourcePatientInfo", type = {Patient.class}, order=5, min=0, max=1) + @Description(shortDefinition="Source patient info", formalDefinition="The Patient Information as known when the document was published. May be a reference to a version specific, or contained." ) + protected Reference sourcePatientInfo; + + /** + * The actual object that is the target of the reference (The Patient Information as known when the document was published. May be a reference to a version specific, or contained.) + */ + protected Patient sourcePatientInfoTarget; + + /** + * Related identifiers or resources associated with the DocumentReference. + */ + @Child(name = "related", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Related things", formalDefinition="Related identifiers or resources associated with the DocumentReference." ) + protected List related; + + private static final long serialVersionUID = -225578230L; + + /* + * Constructor + */ + public DocumentReferenceContextComponent() { + super(); + } + + /** + * @return {@link #event} (This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.) + */ + public List getEvent() { + if (this.event == null) + this.event = new ArrayList(); + return this.event; + } + + public boolean hasEvent() { + if (this.event == null) + return false; + for (CodeableConcept item : this.event) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #event} (This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.) + */ + // syntactic sugar + public CodeableConcept addEvent() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return t; + } + + // syntactic sugar + public DocumentReferenceContextComponent addEvent(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return this; + } + + /** + * @return {@link #period} (The time period over which the service that is described by the document was provided.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceContextComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The time period over which the service that is described by the document was provided.) + */ + public DocumentReferenceContextComponent setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #facilityType} (The kind of facility where the patient was seen.) + */ + public CodeableConcept getFacilityType() { + if (this.facilityType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceContextComponent.facilityType"); + else if (Configuration.doAutoCreate()) + this.facilityType = new CodeableConcept(); // cc + return this.facilityType; + } + + public boolean hasFacilityType() { + return this.facilityType != null && !this.facilityType.isEmpty(); + } + + /** + * @param value {@link #facilityType} (The kind of facility where the patient was seen.) + */ + public DocumentReferenceContextComponent setFacilityType(CodeableConcept value) { + this.facilityType = value; + return this; + } + + /** + * @return {@link #practiceSetting} (This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.) + */ + public CodeableConcept getPracticeSetting() { + if (this.practiceSetting == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceContextComponent.practiceSetting"); + else if (Configuration.doAutoCreate()) + this.practiceSetting = new CodeableConcept(); // cc + return this.practiceSetting; + } + + public boolean hasPracticeSetting() { + return this.practiceSetting != null && !this.practiceSetting.isEmpty(); + } + + /** + * @param value {@link #practiceSetting} (This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.) + */ + public DocumentReferenceContextComponent setPracticeSetting(CodeableConcept value) { + this.practiceSetting = value; + return this; + } + + /** + * @return {@link #sourcePatientInfo} (The Patient Information as known when the document was published. May be a reference to a version specific, or contained.) + */ + public Reference getSourcePatientInfo() { + if (this.sourcePatientInfo == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceContextComponent.sourcePatientInfo"); + else if (Configuration.doAutoCreate()) + this.sourcePatientInfo = new Reference(); // cc + return this.sourcePatientInfo; + } + + public boolean hasSourcePatientInfo() { + return this.sourcePatientInfo != null && !this.sourcePatientInfo.isEmpty(); + } + + /** + * @param value {@link #sourcePatientInfo} (The Patient Information as known when the document was published. May be a reference to a version specific, or contained.) + */ + public DocumentReferenceContextComponent setSourcePatientInfo(Reference value) { + this.sourcePatientInfo = value; + return this; + } + + /** + * @return {@link #sourcePatientInfo} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Patient Information as known when the document was published. May be a reference to a version specific, or contained.) + */ + public Patient getSourcePatientInfoTarget() { + if (this.sourcePatientInfoTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceContextComponent.sourcePatientInfo"); + else if (Configuration.doAutoCreate()) + this.sourcePatientInfoTarget = new Patient(); // aa + return this.sourcePatientInfoTarget; + } + + /** + * @param value {@link #sourcePatientInfo} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Patient Information as known when the document was published. May be a reference to a version specific, or contained.) + */ + public DocumentReferenceContextComponent setSourcePatientInfoTarget(Patient value) { + this.sourcePatientInfoTarget = value; + return this; + } + + /** + * @return {@link #related} (Related identifiers or resources associated with the DocumentReference.) + */ + public List getRelated() { + if (this.related == null) + this.related = new ArrayList(); + return this.related; + } + + public boolean hasRelated() { + if (this.related == null) + return false; + for (DocumentReferenceContextRelatedComponent item : this.related) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #related} (Related identifiers or resources associated with the DocumentReference.) + */ + // syntactic sugar + public DocumentReferenceContextRelatedComponent addRelated() { //3 + DocumentReferenceContextRelatedComponent t = new DocumentReferenceContextRelatedComponent(); + if (this.related == null) + this.related = new ArrayList(); + this.related.add(t); + return t; + } + + // syntactic sugar + public DocumentReferenceContextComponent addRelated(DocumentReferenceContextRelatedComponent t) { //3 + if (t == null) + return this; + if (this.related == null) + this.related = new ArrayList(); + this.related.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("event", "CodeableConcept", "This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a 'History and Physical Report' in which the procedure being documented is necessarily a 'History and Physical' act.", 0, java.lang.Integer.MAX_VALUE, event)); + childrenList.add(new Property("period", "Period", "The time period over which the service that is described by the document was provided.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("facilityType", "CodeableConcept", "The kind of facility where the patient was seen.", 0, java.lang.Integer.MAX_VALUE, facilityType)); + childrenList.add(new Property("practiceSetting", "CodeableConcept", "This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.", 0, java.lang.Integer.MAX_VALUE, practiceSetting)); + childrenList.add(new Property("sourcePatientInfo", "Reference(Patient)", "The Patient Information as known when the document was published. May be a reference to a version specific, or contained.", 0, java.lang.Integer.MAX_VALUE, sourcePatientInfo)); + childrenList.add(new Property("related", "", "Related identifiers or resources associated with the DocumentReference.", 0, java.lang.Integer.MAX_VALUE, related)); + } + + public DocumentReferenceContextComponent copy() { + DocumentReferenceContextComponent dst = new DocumentReferenceContextComponent(); + copyValues(dst); + if (event != null) { + dst.event = new ArrayList(); + for (CodeableConcept i : event) + dst.event.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + dst.facilityType = facilityType == null ? null : facilityType.copy(); + dst.practiceSetting = practiceSetting == null ? null : practiceSetting.copy(); + dst.sourcePatientInfo = sourcePatientInfo == null ? null : sourcePatientInfo.copy(); + if (related != null) { + dst.related = new ArrayList(); + for (DocumentReferenceContextRelatedComponent i : related) + dst.related.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DocumentReferenceContextComponent)) + return false; + DocumentReferenceContextComponent o = (DocumentReferenceContextComponent) other; + return compareDeep(event, o.event, true) && compareDeep(period, o.period, true) && compareDeep(facilityType, o.facilityType, true) + && compareDeep(practiceSetting, o.practiceSetting, true) && compareDeep(sourcePatientInfo, o.sourcePatientInfo, true) + && compareDeep(related, o.related, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DocumentReferenceContextComponent)) + return false; + DocumentReferenceContextComponent o = (DocumentReferenceContextComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (event == null || event.isEmpty()) && (period == null || period.isEmpty()) + && (facilityType == null || facilityType.isEmpty()) && (practiceSetting == null || practiceSetting.isEmpty()) + && (sourcePatientInfo == null || sourcePatientInfo.isEmpty()) && (related == null || related.isEmpty()) + ; + } + + } + + @Block() + public static class DocumentReferenceContextRelatedComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) + @Description(shortDefinition="Related Identifier", formalDefinition="Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing." ) + protected Identifier identifier; + + /** + * Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing. + */ + @Child(name = "ref", type = {}, order=2, min=0, max=1) + @Description(shortDefinition="Related Resource", formalDefinition="Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing." ) + protected Reference ref; + + /** + * The actual object that is the target of the reference (Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.) + */ + protected Resource refTarget; + + private static final long serialVersionUID = -1670123330L; + + /* + * Constructor + */ + public DocumentReferenceContextRelatedComponent() { + super(); + } + + /** + * @return {@link #identifier} (Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceContextRelatedComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing.) + */ + public DocumentReferenceContextRelatedComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #ref} (Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.) + */ + public Reference getRef() { + if (this.ref == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceContextRelatedComponent.ref"); + else if (Configuration.doAutoCreate()) + this.ref = new Reference(); // cc + return this.ref; + } + + public boolean hasRef() { + return this.ref != null && !this.ref.isEmpty(); + } + + /** + * @param value {@link #ref} (Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.) + */ + public DocumentReferenceContextRelatedComponent setRef(Reference value) { + this.ref = value; + return this; + } + + /** + * @return {@link #ref} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.) + */ + public Resource getRefTarget() { + return this.refTarget; + } + + /** + * @param value {@link #ref} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.) + */ + public DocumentReferenceContextRelatedComponent setRefTarget(Resource value) { + this.refTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("ref", "Reference(Any)", "Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.", 0, java.lang.Integer.MAX_VALUE, ref)); + } + + public DocumentReferenceContextRelatedComponent copy() { + DocumentReferenceContextRelatedComponent dst = new DocumentReferenceContextRelatedComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.ref = ref == null ? null : ref.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DocumentReferenceContextRelatedComponent)) + return false; + DocumentReferenceContextRelatedComponent o = (DocumentReferenceContextRelatedComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(ref, o.ref, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DocumentReferenceContextRelatedComponent)) + return false; + DocumentReferenceContextRelatedComponent o = (DocumentReferenceContextRelatedComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ref == null || ref.isEmpty()) + ; + } + + } + + /** + * Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document. + */ + @Child(name = "masterIdentifier", type = {Identifier.class}, order=0, min=0, max=1) + @Description(shortDefinition="Master Version Specific Identifier", formalDefinition="Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document." ) + protected Identifier masterIdentifier; + + /** + * Other identifiers associated with the document, including version independent identifiers. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Other identifiers for the document", formalDefinition="Other identifiers associated with the document, including version independent identifiers." ) + protected List identifier; + + /** + * Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). + */ + @Child(name = "subject", type = {Patient.class, Practitioner.class, Group.class, Device.class}, order=2, min=0, max=1) + @Description(shortDefinition="Who|what is the subject of the document", formalDefinition="Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure)." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) + */ + protected Resource subjectTarget; + + /** + * Specifies the particular kind of document. This usually equates to the purpose of making the document. It is recommended that the value Set be drawn from a coding scheme providing a fine level of granularity such as LOINC. (e.g. Patient Summary, Discharge Summary, Prescription, etc.). + */ + @Child(name = "type", type = {CodeableConcept.class}, order=3, min=1, max=1) + @Description(shortDefinition="Kind of document", formalDefinition="Specifies the particular kind of document. This usually equates to the purpose of making the document. It is recommended that the value Set be drawn from a coding scheme providing a fine level of granularity such as LOINC. (e.g. Patient Summary, Discharge Summary, Prescription, etc.)." ) + protected CodeableConcept type; + + /** + * A categorization for the type of document. The class is an abstraction from the type specifying the high-level kind of document (e.g., Report, Summary, Images, Treatment Plan, Patient Preferences, Workflow) at a macro level. + */ + @Child(name = "class_", type = {CodeableConcept.class}, order=4, min=0, max=1) + @Description(shortDefinition="Categorization of document", formalDefinition="A categorization for the type of document. The class is an abstraction from the type specifying the high-level kind of document (e.g., Report, Summary, Images, Treatment Plan, Patient Preferences, Workflow) at a macro level." ) + protected CodeableConcept class_; + + /** + * An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType. + */ + @Child(name = "format", type = {UriType.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Format/content rules for the document", formalDefinition="An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType." ) + protected List format; + + /** + * Identifies who is responsible for adding the information to the document. + */ + @Child(name = "author", type = {Practitioner.class, Organization.class, Device.class, Patient.class, RelatedPerson.class}, order=6, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who and/or what authored the document", formalDefinition="Identifies who is responsible for adding the information to the document." ) + protected List author; + /** + * The actual objects that are the target of the reference (Identifies who is responsible for adding the information to the document.) + */ + protected List authorTarget; + + + /** + * Identifies the organization or group who is responsible for ongoing maintenance of and access to the document. + */ + @Child(name = "custodian", type = {Organization.class}, order=7, min=0, max=1) + @Description(shortDefinition="Org which maintains the document", formalDefinition="Identifies the organization or group who is responsible for ongoing maintenance of and access to the document." ) + protected Reference custodian; + + /** + * The actual object that is the target of the reference (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) + */ + protected Organization custodianTarget; + + /** + * Which person or organization authenticates that this document is valid. + */ + @Child(name = "authenticator", type = {Practitioner.class, Organization.class}, order=8, min=0, max=1) + @Description(shortDefinition="Who/What authenticated the document", formalDefinition="Which person or organization authenticates that this document is valid." ) + protected Reference authenticator; + + /** + * The actual object that is the target of the reference (Which person or organization authenticates that this document is valid.) + */ + protected Resource authenticatorTarget; + + /** + * When the document was created. + */ + @Child(name = "created", type = {DateTimeType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Document creation time", formalDefinition="When the document was created." ) + protected DateTimeType created; + + /** + * When the document reference was created. + */ + @Child(name = "indexed", type = {InstantType.class}, order=10, min=1, max=1) + @Description(shortDefinition="When this document reference created", formalDefinition="When the document reference was created." ) + protected InstantType indexed; + + /** + * The status of this document reference. + */ + @Child(name = "status", type = {CodeType.class}, order=11, min=1, max=1) + @Description(shortDefinition="current | superceded | entered-in-error", formalDefinition="The status of this document reference." ) + protected Enumeration status; + + /** + * The status of the underlying document. + */ + @Child(name = "docStatus", type = {CodeableConcept.class}, order=12, min=0, max=1) + @Description(shortDefinition="preliminary | final | appended | amended | entered-in-error", formalDefinition="The status of the underlying document." ) + protected CodeableConcept docStatus; + + /** + * Relationships that this document has with other document references that already exist. + */ + @Child(name = "relatesTo", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Relationships to other documents", formalDefinition="Relationships that this document has with other document references that already exist." ) + protected List relatesTo; + + /** + * Human-readable description of the source document. This is sometimes known as the "title". + */ + @Child(name = "description", type = {StringType.class}, order=14, min=0, max=1) + @Description(shortDefinition="Human-readable description (title)", formalDefinition="Human-readable description of the source document. This is sometimes known as the 'title'." ) + protected StringType description; + + /** + * A set of Security-Tag codes specifying the level of privacy/security of the Document. + */ + @Child(name = "confidentiality", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Document security-tags", formalDefinition="A set of Security-Tag codes specifying the level of privacy/security of the Document." ) + protected List confidentiality; + + /** + * The document or url to the document along with critical metadata to prove content has integrity. + */ + @Child(name = "content", type = {Attachment.class}, order=16, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Where to access the document", formalDefinition="The document or url to the document along with critical metadata to prove content has integrity." ) + protected List content; + + /** + * The clinical context in which the document was prepared. + */ + @Child(name = "context", type = {}, order=17, min=0, max=1) + @Description(shortDefinition="Clinical context of document", formalDefinition="The clinical context in which the document was prepared." ) + protected DocumentReferenceContextComponent context; + + private static final long serialVersionUID = 1440270142L; + + /* + * Constructor + */ + public DocumentReference() { + super(); + } + + /* + * Constructor + */ + public DocumentReference(CodeableConcept type, InstantType indexed, Enumeration status) { + super(); + this.type = type; + this.indexed = indexed; + this.status = status; + } + + /** + * @return {@link #masterIdentifier} (Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document.) + */ + public Identifier getMasterIdentifier() { + if (this.masterIdentifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.masterIdentifier"); + else if (Configuration.doAutoCreate()) + this.masterIdentifier = new Identifier(); // cc + return this.masterIdentifier; + } + + public boolean hasMasterIdentifier() { + return this.masterIdentifier != null && !this.masterIdentifier.isEmpty(); + } + + /** + * @param value {@link #masterIdentifier} (Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document.) + */ + public DocumentReference setMasterIdentifier(Identifier value) { + this.masterIdentifier = value; + return this; + } + + /** + * @return {@link #identifier} (Other identifiers associated with the document, including version independent identifiers.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Other identifiers associated with the document, including version independent identifiers.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public DocumentReference addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #subject} (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) + */ + public DocumentReference setSubject(Reference value) { + this.subject = value; + return this; + } + + /** + * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) + */ + public Resource getSubjectTarget() { + return this.subjectTarget; + } + + /** + * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) + */ + public DocumentReference setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #type} (Specifies the particular kind of document. This usually equates to the purpose of making the document. It is recommended that the value Set be drawn from a coding scheme providing a fine level of granularity such as LOINC. (e.g. Patient Summary, Discharge Summary, Prescription, etc.).) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Specifies the particular kind of document. This usually equates to the purpose of making the document. It is recommended that the value Set be drawn from a coding scheme providing a fine level of granularity such as LOINC. (e.g. Patient Summary, Discharge Summary, Prescription, etc.).) + */ + public DocumentReference setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #class_} (A categorization for the type of document. The class is an abstraction from the type specifying the high-level kind of document (e.g., Report, Summary, Images, Treatment Plan, Patient Preferences, Workflow) at a macro level.) + */ + public CodeableConcept getClass_() { + if (this.class_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.class_"); + else if (Configuration.doAutoCreate()) + this.class_ = new CodeableConcept(); // cc + return this.class_; + } + + public boolean hasClass_() { + return this.class_ != null && !this.class_.isEmpty(); + } + + /** + * @param value {@link #class_} (A categorization for the type of document. The class is an abstraction from the type specifying the high-level kind of document (e.g., Report, Summary, Images, Treatment Plan, Patient Preferences, Workflow) at a macro level.) + */ + public DocumentReference setClass_(CodeableConcept value) { + this.class_ = value; + return this; + } + + /** + * @return {@link #format} (An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.) + */ + public List getFormat() { + if (this.format == null) + this.format = new ArrayList(); + return this.format; + } + + public boolean hasFormat() { + if (this.format == null) + return false; + for (UriType item : this.format) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #format} (An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.) + */ + // syntactic sugar + public UriType addFormatElement() {//2 + UriType t = new UriType(); + if (this.format == null) + this.format = new ArrayList(); + this.format.add(t); + return t; + } + + /** + * @param value {@link #format} (An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.) + */ + public DocumentReference addFormat(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.format == null) + this.format = new ArrayList(); + this.format.add(t); + return this; + } + + /** + * @param value {@link #format} (An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.) + */ + public boolean hasFormat(String value) { + if (this.format == null) + return false; + for (UriType v : this.format) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #author} (Identifies who is responsible for adding the information to the document.) + */ + public List getAuthor() { + if (this.author == null) + this.author = new ArrayList(); + return this.author; + } + + public boolean hasAuthor() { + if (this.author == null) + return false; + for (Reference item : this.author) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #author} (Identifies who is responsible for adding the information to the document.) + */ + // syntactic sugar + public Reference addAuthor() { //3 + Reference t = new Reference(); + if (this.author == null) + this.author = new ArrayList(); + this.author.add(t); + return t; + } + + // syntactic sugar + public DocumentReference addAuthor(Reference t) { //3 + if (t == null) + return this; + if (this.author == null) + this.author = new ArrayList(); + this.author.add(t); + return this; + } + + /** + * @return {@link #author} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies who is responsible for adding the information to the document.) + */ + public List getAuthorTarget() { + if (this.authorTarget == null) + this.authorTarget = new ArrayList(); + return this.authorTarget; + } + + /** + * @return {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) + */ + public Reference getCustodian() { + if (this.custodian == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.custodian"); + else if (Configuration.doAutoCreate()) + this.custodian = new Reference(); // cc + return this.custodian; + } + + public boolean hasCustodian() { + return this.custodian != null && !this.custodian.isEmpty(); + } + + /** + * @param value {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) + */ + public DocumentReference setCustodian(Reference value) { + this.custodian = value; + return this; + } + + /** + * @return {@link #custodian} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) + */ + public Organization getCustodianTarget() { + if (this.custodianTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.custodian"); + else if (Configuration.doAutoCreate()) + this.custodianTarget = new Organization(); // aa + return this.custodianTarget; + } + + /** + * @param value {@link #custodian} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) + */ + public DocumentReference setCustodianTarget(Organization value) { + this.custodianTarget = value; + return this; + } + + /** + * @return {@link #authenticator} (Which person or organization authenticates that this document is valid.) + */ + public Reference getAuthenticator() { + if (this.authenticator == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.authenticator"); + else if (Configuration.doAutoCreate()) + this.authenticator = new Reference(); // cc + return this.authenticator; + } + + public boolean hasAuthenticator() { + return this.authenticator != null && !this.authenticator.isEmpty(); + } + + /** + * @param value {@link #authenticator} (Which person or organization authenticates that this document is valid.) + */ + public DocumentReference setAuthenticator(Reference value) { + this.authenticator = value; + return this; + } + + /** + * @return {@link #authenticator} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Which person or organization authenticates that this document is valid.) + */ + public Resource getAuthenticatorTarget() { + return this.authenticatorTarget; + } + + /** + * @param value {@link #authenticator} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Which person or organization authenticates that this document is valid.) + */ + public DocumentReference setAuthenticatorTarget(Resource value) { + this.authenticatorTarget = value; + return this; + } + + /** + * @return {@link #created} (When the document was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (When the document was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DocumentReference setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return When the document was created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value When the document was created. + */ + public DocumentReference setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #indexed} (When the document reference was created.). This is the underlying object with id, value and extensions. The accessor "getIndexed" gives direct access to the value + */ + public InstantType getIndexedElement() { + if (this.indexed == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.indexed"); + else if (Configuration.doAutoCreate()) + this.indexed = new InstantType(); // bb + return this.indexed; + } + + public boolean hasIndexedElement() { + return this.indexed != null && !this.indexed.isEmpty(); + } + + public boolean hasIndexed() { + return this.indexed != null && !this.indexed.isEmpty(); + } + + /** + * @param value {@link #indexed} (When the document reference was created.). This is the underlying object with id, value and extensions. The accessor "getIndexed" gives direct access to the value + */ + public DocumentReference setIndexedElement(InstantType value) { + this.indexed = value; + return this; + } + + /** + * @return When the document reference was created. + */ + public Date getIndexed() { + return this.indexed == null ? null : this.indexed.getValue(); + } + + /** + * @param value When the document reference was created. + */ + public DocumentReference setIndexed(Date value) { + if (this.indexed == null) + this.indexed = new InstantType(); + this.indexed.setValue(value); + return this; + } + + /** + * @return {@link #status} (The status of this document reference.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new DocumentReferenceStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status of this document reference.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DocumentReference setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of this document reference. + */ + public DocumentReferenceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of this document reference. + */ + public DocumentReference setStatus(DocumentReferenceStatus value) { + if (this.status == null) + this.status = new Enumeration(new DocumentReferenceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #docStatus} (The status of the underlying document.) + */ + public CodeableConcept getDocStatus() { + if (this.docStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.docStatus"); + else if (Configuration.doAutoCreate()) + this.docStatus = new CodeableConcept(); // cc + return this.docStatus; + } + + public boolean hasDocStatus() { + return this.docStatus != null && !this.docStatus.isEmpty(); + } + + /** + * @param value {@link #docStatus} (The status of the underlying document.) + */ + public DocumentReference setDocStatus(CodeableConcept value) { + this.docStatus = value; + return this; + } + + /** + * @return {@link #relatesTo} (Relationships that this document has with other document references that already exist.) + */ + public List getRelatesTo() { + if (this.relatesTo == null) + this.relatesTo = new ArrayList(); + return this.relatesTo; + } + + public boolean hasRelatesTo() { + if (this.relatesTo == null) + return false; + for (DocumentReferenceRelatesToComponent item : this.relatesTo) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #relatesTo} (Relationships that this document has with other document references that already exist.) + */ + // syntactic sugar + public DocumentReferenceRelatesToComponent addRelatesTo() { //3 + DocumentReferenceRelatesToComponent t = new DocumentReferenceRelatesToComponent(); + if (this.relatesTo == null) + this.relatesTo = new ArrayList(); + this.relatesTo.add(t); + return t; + } + + // syntactic sugar + public DocumentReference addRelatesTo(DocumentReferenceRelatesToComponent t) { //3 + if (t == null) + return this; + if (this.relatesTo == null) + this.relatesTo = new ArrayList(); + this.relatesTo.add(t); + return this; + } + + /** + * @return {@link #description} (Human-readable description of the source document. This is sometimes known as the "title".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Human-readable description of the source document. This is sometimes known as the "title".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public DocumentReference setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Human-readable description of the source document. This is sometimes known as the "title". + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Human-readable description of the source document. This is sometimes known as the "title". + */ + public DocumentReference setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #confidentiality} (A set of Security-Tag codes specifying the level of privacy/security of the Document.) + */ + public List getConfidentiality() { + if (this.confidentiality == null) + this.confidentiality = new ArrayList(); + return this.confidentiality; + } + + public boolean hasConfidentiality() { + if (this.confidentiality == null) + return false; + for (CodeableConcept item : this.confidentiality) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #confidentiality} (A set of Security-Tag codes specifying the level of privacy/security of the Document.) + */ + // syntactic sugar + public CodeableConcept addConfidentiality() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.confidentiality == null) + this.confidentiality = new ArrayList(); + this.confidentiality.add(t); + return t; + } + + // syntactic sugar + public DocumentReference addConfidentiality(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.confidentiality == null) + this.confidentiality = new ArrayList(); + this.confidentiality.add(t); + return this; + } + + /** + * @return {@link #content} (The document or url to the document along with critical metadata to prove content has integrity.) + */ + public List getContent() { + if (this.content == null) + this.content = new ArrayList(); + return this.content; + } + + public boolean hasContent() { + if (this.content == null) + return false; + for (Attachment item : this.content) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #content} (The document or url to the document along with critical metadata to prove content has integrity.) + */ + // syntactic sugar + public Attachment addContent() { //3 + Attachment t = new Attachment(); + if (this.content == null) + this.content = new ArrayList(); + this.content.add(t); + return t; + } + + // syntactic sugar + public DocumentReference addContent(Attachment t) { //3 + if (t == null) + return this; + if (this.content == null) + this.content = new ArrayList(); + this.content.add(t); + return this; + } + + /** + * @return {@link #context} (The clinical context in which the document was prepared.) + */ + public DocumentReferenceContextComponent getContext() { + if (this.context == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.context"); + else if (Configuration.doAutoCreate()) + this.context = new DocumentReferenceContextComponent(); // cc + return this.context; + } + + public boolean hasContext() { + return this.context != null && !this.context.isEmpty(); + } + + /** + * @param value {@link #context} (The clinical context in which the document was prepared.) + */ + public DocumentReference setContext(DocumentReferenceContextComponent value) { + this.context = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("masterIdentifier", "Identifier", "Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document.", 0, java.lang.Integer.MAX_VALUE, masterIdentifier)); + childrenList.add(new Property("identifier", "Identifier", "Other identifiers associated with the document, including version independent identifiers.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("subject", "Reference(Patient|Practitioner|Group|Device)", "Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("type", "CodeableConcept", "Specifies the particular kind of document. This usually equates to the purpose of making the document. It is recommended that the value Set be drawn from a coding scheme providing a fine level of granularity such as LOINC. (e.g. Patient Summary, Discharge Summary, Prescription, etc.).", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("class", "CodeableConcept", "A categorization for the type of document. The class is an abstraction from the type specifying the high-level kind of document (e.g., Report, Summary, Images, Treatment Plan, Patient Preferences, Workflow) at a macro level.", 0, java.lang.Integer.MAX_VALUE, class_)); + childrenList.add(new Property("format", "uri", "An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.", 0, java.lang.Integer.MAX_VALUE, format)); + childrenList.add(new Property("author", "Reference(Practitioner|Organization|Device|Patient|RelatedPerson)", "Identifies who is responsible for adding the information to the document.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("custodian", "Reference(Organization)", "Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.", 0, java.lang.Integer.MAX_VALUE, custodian)); + childrenList.add(new Property("authenticator", "Reference(Practitioner|Organization)", "Which person or organization authenticates that this document is valid.", 0, java.lang.Integer.MAX_VALUE, authenticator)); + childrenList.add(new Property("created", "dateTime", "When the document was created.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("indexed", "instant", "When the document reference was created.", 0, java.lang.Integer.MAX_VALUE, indexed)); + childrenList.add(new Property("status", "code", "The status of this document reference.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("docStatus", "CodeableConcept", "The status of the underlying document.", 0, java.lang.Integer.MAX_VALUE, docStatus)); + childrenList.add(new Property("relatesTo", "", "Relationships that this document has with other document references that already exist.", 0, java.lang.Integer.MAX_VALUE, relatesTo)); + childrenList.add(new Property("description", "string", "Human-readable description of the source document. This is sometimes known as the 'title'.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("confidentiality", "CodeableConcept", "A set of Security-Tag codes specifying the level of privacy/security of the Document.", 0, java.lang.Integer.MAX_VALUE, confidentiality)); + childrenList.add(new Property("content", "Attachment", "The document or url to the document along with critical metadata to prove content has integrity.", 0, java.lang.Integer.MAX_VALUE, content)); + childrenList.add(new Property("context", "", "The clinical context in which the document was prepared.", 0, java.lang.Integer.MAX_VALUE, context)); + } + + public DocumentReference copy() { + DocumentReference dst = new DocumentReference(); + copyValues(dst); + dst.masterIdentifier = masterIdentifier == null ? null : masterIdentifier.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.subject = subject == null ? null : subject.copy(); + dst.type = type == null ? null : type.copy(); + dst.class_ = class_ == null ? null : class_.copy(); + if (format != null) { + dst.format = new ArrayList(); + for (UriType i : format) + dst.format.add(i.copy()); + }; + if (author != null) { + dst.author = new ArrayList(); + for (Reference i : author) + dst.author.add(i.copy()); + }; + dst.custodian = custodian == null ? null : custodian.copy(); + dst.authenticator = authenticator == null ? null : authenticator.copy(); + dst.created = created == null ? null : created.copy(); + dst.indexed = indexed == null ? null : indexed.copy(); + dst.status = status == null ? null : status.copy(); + dst.docStatus = docStatus == null ? null : docStatus.copy(); + if (relatesTo != null) { + dst.relatesTo = new ArrayList(); + for (DocumentReferenceRelatesToComponent i : relatesTo) + dst.relatesTo.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + if (confidentiality != null) { + dst.confidentiality = new ArrayList(); + for (CodeableConcept i : confidentiality) + dst.confidentiality.add(i.copy()); + }; + if (content != null) { + dst.content = new ArrayList(); + for (Attachment i : content) + dst.content.add(i.copy()); + }; + dst.context = context == null ? null : context.copy(); + return dst; + } + + protected DocumentReference typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DocumentReference)) + return false; + DocumentReference o = (DocumentReference) other; + return compareDeep(masterIdentifier, o.masterIdentifier, true) && compareDeep(identifier, o.identifier, true) + && compareDeep(subject, o.subject, true) && compareDeep(type, o.type, true) && compareDeep(class_, o.class_, true) + && compareDeep(format, o.format, true) && compareDeep(author, o.author, true) && compareDeep(custodian, o.custodian, true) + && compareDeep(authenticator, o.authenticator, true) && compareDeep(created, o.created, true) && compareDeep(indexed, o.indexed, true) + && compareDeep(status, o.status, true) && compareDeep(docStatus, o.docStatus, true) && compareDeep(relatesTo, o.relatesTo, true) + && compareDeep(description, o.description, true) && compareDeep(confidentiality, o.confidentiality, true) + && compareDeep(content, o.content, true) && compareDeep(context, o.context, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DocumentReference)) + return false; + DocumentReference o = (DocumentReference) other; + return compareValues(format, o.format, true) && compareValues(created, o.created, true) && compareValues(indexed, o.indexed, true) + && compareValues(status, o.status, true) && compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (masterIdentifier == null || masterIdentifier.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (subject == null || subject.isEmpty()) && (type == null || type.isEmpty()) && (class_ == null || class_.isEmpty()) + && (format == null || format.isEmpty()) && (author == null || author.isEmpty()) && (custodian == null || custodian.isEmpty()) + && (authenticator == null || authenticator.isEmpty()) && (created == null || created.isEmpty()) + && (indexed == null || indexed.isEmpty()) && (status == null || status.isEmpty()) && (docStatus == null || docStatus.isEmpty()) + && (relatesTo == null || relatesTo.isEmpty()) && (description == null || description.isEmpty()) + && (confidentiality == null || confidentiality.isEmpty()) && (content == null || content.isEmpty()) + && (context == null || context.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DocumentReference; + } + + @SearchParamDefinition(name="subject", path="DocumentReference.subject", description="Who|what is the subject of the document", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="confidentiality", path="DocumentReference.confidentiality", description="Document security-tags", type="token" ) + public static final String SP_CONFIDENTIALITY = "confidentiality"; + @SearchParamDefinition(name="description", path="DocumentReference.description", description="Human-readable description (title)", type="string" ) + public static final String SP_DESCRIPTION = "description"; + @SearchParamDefinition(name="language", path="DocumentReference.content.language", description="Human language of the content (BCP-47)", type="token" ) + public static final String SP_LANGUAGE = "language"; + @SearchParamDefinition(name="type", path="DocumentReference.type", description="Kind of document", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="relation", path="DocumentReference.relatesTo.code", description="replaces | transforms | signs | appends", type="token" ) + public static final String SP_RELATION = "relation"; + @SearchParamDefinition(name="setting", path="DocumentReference.context.practiceSetting", description="Additional details about where the content was created (e.g. clinical specialty)", type="token" ) + public static final String SP_SETTING = "setting"; + @SearchParamDefinition(name="relatedid", path="DocumentReference.context.related.identifier", description="Related Identifier", type="token" ) + public static final String SP_RELATEDID = "relatedid"; + @SearchParamDefinition(name="patient", path="DocumentReference.subject", description="Who|what is the subject of the document", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="relationship", path="", description="Combination of relation and relatesTo", type="composite" ) + public static final String SP_RELATIONSHIP = "relationship"; + @SearchParamDefinition(name="event", path="DocumentReference.context.event", description="Main Clinical Acts Documented", type="token" ) + public static final String SP_EVENT = "event"; + @SearchParamDefinition(name="class", path="DocumentReference.class", description="Categorization of document", type="token" ) + public static final String SP_CLASS = "class"; + @SearchParamDefinition(name="authenticator", path="DocumentReference.authenticator", description="Who/What authenticated the document", type="reference" ) + public static final String SP_AUTHENTICATOR = "authenticator"; + @SearchParamDefinition(name="identifier", path="DocumentReference.masterIdentifier|DocumentReference.identifier", description="Master Version Specific Identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="period", path="DocumentReference.context.period", description="Time of service that is being documented", type="date" ) + public static final String SP_PERIOD = "period"; + @SearchParamDefinition(name="custodian", path="DocumentReference.custodian", description="Org which maintains the document", type="reference" ) + public static final String SP_CUSTODIAN = "custodian"; + @SearchParamDefinition(name="indexed", path="DocumentReference.indexed", description="When this document reference created", type="date" ) + public static final String SP_INDEXED = "indexed"; + @SearchParamDefinition(name="author", path="DocumentReference.author", description="Who and/or what authored the document", type="reference" ) + public static final String SP_AUTHOR = "author"; + @SearchParamDefinition(name="created", path="DocumentReference.created", description="Document creation time", type="date" ) + public static final String SP_CREATED = "created"; + @SearchParamDefinition(name="format", path="DocumentReference.format", description="Format/content rules for the document", type="uri" ) + public static final String SP_FORMAT = "format"; + @SearchParamDefinition(name="relatedref", path="DocumentReference.context.related.ref", description="Related Resource", type="reference" ) + public static final String SP_RELATEDREF = "relatedref"; + @SearchParamDefinition(name="location", path="DocumentReference.content.url", description="Uri where the data can be found", type="uri" ) + public static final String SP_LOCATION = "location"; + @SearchParamDefinition(name="relatesto", path="DocumentReference.relatesTo.target", description="Target of the relationship", type="reference" ) + public static final String SP_RELATESTO = "relatesto"; + @SearchParamDefinition(name="facility", path="DocumentReference.context.facilityType", description="Kind of facility where patient was seen", type="token" ) + public static final String SP_FACILITY = "facility"; + @SearchParamDefinition(name="status", path="DocumentReference.status", description="current | superceded | entered-in-error", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DomainResource.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DomainResource.java index 00459a42d21..3e4c2d94394 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DomainResource.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/DomainResource.java @@ -1,287 +1,266 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A resource that includes narrative, extensions, and contained resources. - */ -public abstract class DomainResource extends Resource implements IBaseHasExtensions, IBaseHasModifierExtensions, IDomainResource { - - /** - * A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety. - */ - @Child(name = "text", type = {Narrative.class}, order=0, min=0, max=1) - @Description(shortDefinition="Text summary of the resource, for human interpretation", formalDefinition="A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it 'clinically safe' for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety." ) - protected Narrative text; - - /** - * These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope. - */ - @Child(name = "contained", type = {Resource.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contained, inline Resources", formalDefinition="These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope." ) - protected List contained; - - /** - * May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. - */ - @Child(name = "extension", type = {Extension.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Additional Content defined by implementations", formalDefinition="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." ) - protected List extension; - - /** - * May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. - */ - @Child(name = "modifierExtension", type = {Extension.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Extensions that cannot be ignored", formalDefinition="May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions." ) - protected List modifierExtension; - - private static final long serialVersionUID = -970285559L; - - /* - * Constructor - */ - public DomainResource() { - super(); - } - - /** - * @return {@link #text} (A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.) - */ - public Narrative getText() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DomainResource.text"); - else if (Configuration.doAutoCreate()) - this.text = new Narrative(); // cc - return this.text; - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.) - */ - public DomainResource setText(Narrative value) { - this.text = value; - return this; - } - - /** - * @return {@link #contained} (These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.) - */ - public List getContained() { - if (this.contained == null) - this.contained = new ArrayList(); - return this.contained; - } - - public boolean hasContained() { - if (this.contained == null) - return false; - for (Resource item : this.contained) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contained} (These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.) - */ - /** - * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) - */ - public List getExtension() { - if (this.extension == null) - this.extension = new ArrayList(); - return this.extension; - } - - public boolean hasExtension() { - if (this.extension == null) - return false; - for (Extension item : this.extension) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) - */ - // syntactic sugar - public Extension addExtension() { //3 - Extension t = new Extension(); - if (this.extension == null) - this.extension = new ArrayList(); - this.extension.add(t); - return t; - } - - // syntactic sugar - public DomainResource addExtension(Extension t) { //3 - if (t == null) - return this; - if (this.extension == null) - this.extension = new ArrayList(); - this.extension.add(t); - return this; - } - - /** - * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) - */ - public List getModifierExtension() { - if (this.modifierExtension == null) - this.modifierExtension = new ArrayList(); - return this.modifierExtension; - } - - public boolean hasModifierExtension() { - if (this.modifierExtension == null) - return false; - for (Extension item : this.modifierExtension) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) - */ - // syntactic sugar - public Extension addModifierExtension() { //3 - Extension t = new Extension(); - if (this.modifierExtension == null) - this.modifierExtension = new ArrayList(); - this.modifierExtension.add(t); - return t; - } - - // syntactic sugar - public DomainResource addModifierExtension(Extension t) { //3 - if (t == null) - return this; - if (this.modifierExtension == null) - this.modifierExtension = new ArrayList(); - this.modifierExtension.add(t); - return this; - } - - protected void listChildren(List childrenList) { - childrenList.add(new Property("text", "Narrative", "A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it 'clinically safe' for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("contained", "Resource", "These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.", 0, java.lang.Integer.MAX_VALUE, contained)); - childrenList.add(new Property("extension", "Extension", "May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", 0, java.lang.Integer.MAX_VALUE, extension)); - childrenList.add(new Property("modifierExtension", "Extension", "May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.", 0, java.lang.Integer.MAX_VALUE, modifierExtension)); - } - - public abstract DomainResource copy(); - - public void copyValues(DomainResource dst) { - dst.text = text == null ? null : text.copy(); - if (contained != null) { - dst.contained = new ArrayList(); - for (Resource i : contained) - dst.contained.add(i.copy()); - }; - if (extension != null) { - dst.extension = new ArrayList(); - for (Extension i : extension) - dst.extension.add(i.copy()); - }; - if (modifierExtension != null) { - dst.modifierExtension = new ArrayList(); - for (Extension i : modifierExtension) - dst.modifierExtension.add(i.copy()); - }; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DomainResource)) - return false; - DomainResource o = (DomainResource) other; - return compareDeep(text, o.text, true) && compareDeep(contained, o.contained, true) && compareDeep(extension, o.extension, true) - && compareDeep(modifierExtension, o.modifierExtension, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DomainResource)) - return false; - DomainResource o = (DomainResource) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (text == null || text.isEmpty()) && (contained == null || contained.isEmpty()) - && (extension == null || extension.isEmpty()) && (modifierExtension == null || modifierExtension.isEmpty()) - ; - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A resource that includes narrative, extensions, and contained resources. + */ +public abstract class DomainResource extends Resource implements IBaseHasExtensions, IBaseHasModifierExtensions, IDomainResource { + + /** + * A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety. + */ + @Child(name = "text", type = {Narrative.class}, order=0, min=0, max=1) + @Description(shortDefinition="Text summary of the resource, for human interpretation", formalDefinition="A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it 'clinically safe' for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety." ) + protected Narrative text; + + /** + * These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope. + */ + @Child(name = "contained", type = {Resource.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contained, inline Resources", formalDefinition="These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope." ) + protected List contained; + + /** + * May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. + */ + @Child(name = "extension", type = {Extension.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional Content defined by implementations", formalDefinition="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." ) + protected List extension; + + /** + * May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. + */ + @Child(name = "modifierExtension", type = {Extension.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Extensions that cannot be ignored", formalDefinition="May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions." ) + protected List modifierExtension; + + private static final long serialVersionUID = -970285559L; + + /* + * Constructor + */ + public DomainResource() { + super(); + } + + /** + * @return {@link #text} (A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.) + */ + public Narrative getText() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DomainResource.text"); + else if (Configuration.doAutoCreate()) + this.text = new Narrative(); // cc + return this.text; + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.) + */ + public DomainResource setText(Narrative value) { + this.text = value; + return this; + } + + /** + * @return {@link #contained} (These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.) + */ + public List getContained() { + if (this.contained == null) + this.contained = new ArrayList(); + return this.contained; + } + + public boolean hasContained() { + if (this.contained == null) + return false; + for (Resource item : this.contained) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contained} (These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.) + */ + /** + * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) + */ + public List getExtension() { + if (this.extension == null) + this.extension = new ArrayList(); + return this.extension; + } + + public boolean hasExtension() { + if (this.extension == null) + return false; + for (Extension item : this.extension) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) + */ + // syntactic sugar + public Extension addExtension() { //3 + Extension t = new Extension(); + if (this.extension == null) + this.extension = new ArrayList(); + this.extension.add(t); + return t; + } + + // syntactic sugar + public DomainResource addExtension(Extension t) { //3 + if (t == null) + return this; + if (this.extension == null) + this.extension = new ArrayList(); + this.extension.add(t); + return this; + } + + /** + * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) + */ + public List getModifierExtension() { + if (this.modifierExtension == null) + this.modifierExtension = new ArrayList(); + return this.modifierExtension; + } + + public boolean hasModifierExtension() { + if (this.modifierExtension == null) + return false; + for (Extension item : this.modifierExtension) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) + */ + // syntactic sugar + public Extension addModifierExtension() { //3 + Extension t = new Extension(); + if (this.modifierExtension == null) + this.modifierExtension = new ArrayList(); + this.modifierExtension.add(t); + return t; + } + + // syntactic sugar + public DomainResource addModifierExtension(Extension t) { //3 + if (t == null) + return this; + if (this.modifierExtension == null) + this.modifierExtension = new ArrayList(); + this.modifierExtension.add(t); + return this; + } + + protected void listChildren(List childrenList) { + childrenList.add(new Property("text", "Narrative", "A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it 'clinically safe' for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("contained", "Resource", "These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.", 0, java.lang.Integer.MAX_VALUE, contained)); + childrenList.add(new Property("extension", "Extension", "May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", 0, java.lang.Integer.MAX_VALUE, extension)); + childrenList.add(new Property("modifierExtension", "Extension", "May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.", 0, java.lang.Integer.MAX_VALUE, modifierExtension)); + } + + public abstract DomainResource copy(); + + public void copyValues(DomainResource dst) { + dst.text = text == null ? null : text.copy(); + if (contained != null) { + dst.contained = new ArrayList(); + for (Resource i : contained) + dst.contained.add(i.copy()); + }; + if (extension != null) { + dst.extension = new ArrayList(); + for (Extension i : extension) + dst.extension.add(i.copy()); + }; + if (modifierExtension != null) { + dst.modifierExtension = new ArrayList(); + for (Extension i : modifierExtension) + dst.modifierExtension.add(i.copy()); + }; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DomainResource)) + return false; + DomainResource o = (DomainResource) other; + return compareDeep(text, o.text, true) && compareDeep(contained, o.contained, true) && compareDeep(extension, o.extension, true) + && compareDeep(modifierExtension, o.modifierExtension, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DomainResource)) + return false; + DomainResource o = (DomainResource) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (text == null || text.isEmpty()) && (contained == null || contained.isEmpty()) + && (extension == null || extension.isEmpty()) && (modifierExtension == null || modifierExtension.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Duration.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Duration.java index 1210b714f23..5d8eef35c72 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Duration.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Duration.java @@ -1,111 +1,90 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * 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(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Duration)) - return false; - Duration o = (Duration) other; - return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(units, o.units, true) - && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Duration)) - return false; - Duration o = (Duration) other; - return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(units, o.units, true) - && compareValues(system, o.system, true) && compareValues(code, o.code, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) - && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * 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(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Duration)) + return false; + Duration o = (Duration) other; + return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(units, o.units, true) + && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Duration)) + return false; + Duration o = (Duration) other; + return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(units, o.units, true) + && compareValues(system, o.system, true) && compareValues(code, o.code, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) + && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Element.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Element.java index d85c53c8d3f..4b993264fbf 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Element.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Element.java @@ -1,223 +1,202 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Base definition for all elements in a resource. - */ -public abstract class Element extends Base implements IBaseHasExtensions { - - /** - * unique id for the element within a resource (for internal references). - */ - @Child(name = "id", type = {IdType.class}, order=0, 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=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 element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." ) - protected List extension; - - private static final long serialVersionUID = -158027598L; - - /* - * Constructor - */ - public Element() { - super(); - } - - /** - * @return {@link #id} (unique id for the element within a resource (for internal references).). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value - */ - public IdType getIdElement() { - if (this.id == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Element.id"); - else if (Configuration.doAutoCreate()) - this.id = new IdType(); // bb - return this.id; - } - - public boolean hasIdElement() { - return this.id != null && !this.id.isEmpty(); - } - - public boolean hasId() { - return this.id != null && !this.id.isEmpty(); - } - - /** - * @param value {@link #id} (unique id for the element within a resource (for internal references).). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value - */ - public Element setIdElement(IdType value) { - this.id = value; - return this; - } - - /** - * @return unique id for the element within a resource (for internal references). - */ - public String getId() { - return this.id == null ? null : this.id.getValue(); - } - - /** - * @param value unique id for the element within a resource (for internal references). - */ - public Element setId(String value) { - if (Utilities.noString(value)) - this.id = null; - else { - if (this.id == null) - this.id = new IdType(); - this.id.setValue(value); - } - return this; - } - - /** - * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) - */ - public List getExtension() { - if (this.extension == null) - this.extension = new ArrayList(); - return this.extension; - } - - public boolean hasExtension() { - if (this.extension == null) - return false; - for (Extension item : this.extension) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) - */ - // syntactic sugar - public Extension addExtension() { //3 - Extension t = new Extension(); - if (this.extension == null) - this.extension = new ArrayList(); - this.extension.add(t); - return t; - } - - // syntactic sugar - public Element addExtension(Extension t) { //3 - if (t == null) - return this; - if (this.extension == null) - this.extension = new ArrayList(); - this.extension.add(t); - return this; - } - - protected void listChildren(List childrenList) { - childrenList.add(new Property("id", "id", "unique id for the element within a resource (for internal references).", 0, java.lang.Integer.MAX_VALUE, id)); - childrenList.add(new Property("extension", "Extension", "May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", 0, java.lang.Integer.MAX_VALUE, extension)); - } - - public abstract Element copy(); - - public void copyValues(Element dst) { - dst.id = id == null ? null : id.copy(); - if (extension != null) { - dst.extension = new ArrayList(); - for (Extension i : extension) - dst.extension.add(i.copy()); - }; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Element)) - return false; - Element o = (Element) other; - return compareDeep(id, o.id, true) && compareDeep(extension, o.extension, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Element)) - return false; - Element o = (Element) other; - return compareValues(id, o.id, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (id == null || id.isEmpty()) && (extension == null || extension.isEmpty()) - ; - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Base definition for all elements in a resource. + */ +public abstract class Element extends Base implements IBaseHasExtensions { + + /** + * unique id for the element within a resource (for internal references). + */ + @Child(name = "id", type = {IdType.class}, order=0, 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=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 element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." ) + protected List extension; + + private static final long serialVersionUID = -158027598L; + + /* + * Constructor + */ + public Element() { + super(); + } + + /** + * @return {@link #id} (unique id for the element within a resource (for internal references).). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value + */ + public IdType getIdElement() { + if (this.id == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Element.id"); + else if (Configuration.doAutoCreate()) + this.id = new IdType(); // bb + return this.id; + } + + public boolean hasIdElement() { + return this.id != null && !this.id.isEmpty(); + } + + public boolean hasId() { + return this.id != null && !this.id.isEmpty(); + } + + /** + * @param value {@link #id} (unique id for the element within a resource (for internal references).). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value + */ + public Element setIdElement(IdType value) { + this.id = value; + return this; + } + + /** + * @return unique id for the element within a resource (for internal references). + */ + public String getId() { + return this.id == null ? null : this.id.getValue(); + } + + /** + * @param value unique id for the element within a resource (for internal references). + */ + public Element setId(String value) { + if (Utilities.noString(value)) + this.id = null; + else { + if (this.id == null) + this.id = new IdType(); + this.id.setValue(value); + } + return this; + } + + /** + * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) + */ + public List getExtension() { + if (this.extension == null) + this.extension = new ArrayList(); + return this.extension; + } + + public boolean hasExtension() { + if (this.extension == null) + return false; + for (Extension item : this.extension) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) + */ + // syntactic sugar + public Extension addExtension() { //3 + Extension t = new Extension(); + if (this.extension == null) + this.extension = new ArrayList(); + this.extension.add(t); + return t; + } + + // syntactic sugar + public Element addExtension(Extension t) { //3 + if (t == null) + return this; + if (this.extension == null) + this.extension = new ArrayList(); + this.extension.add(t); + return this; + } + + protected void listChildren(List childrenList) { + childrenList.add(new Property("id", "id", "unique id for the element within a resource (for internal references).", 0, java.lang.Integer.MAX_VALUE, id)); + childrenList.add(new Property("extension", "Extension", "May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", 0, java.lang.Integer.MAX_VALUE, extension)); + } + + public abstract Element copy(); + + public void copyValues(Element dst) { + dst.id = id == null ? null : id.copy(); + if (extension != null) { + dst.extension = new ArrayList(); + for (Extension i : extension) + dst.extension.add(i.copy()); + }; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Element)) + return false; + Element o = (Element) other; + return compareDeep(id, o.id, true) && compareDeep(extension, o.extension, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Element)) + return false; + Element o = (Element) other; + return compareValues(id, o.id, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (id == null || id.isEmpty()) && (extension == null || extension.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ElementDefinition.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ElementDefinition.java index 48dbc6f775f..873a0d39f81 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ElementDefinition.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ElementDefinition.java @@ -1,3353 +1,3332 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Captures constraints on each element within the resource, profile, or extension. - */ -@DatatypeDef(name="ElementDefinition") -public class ElementDefinition extends Type implements ICompositeType { - - public enum PropertyRepresentation { - /** - * In XML, this property is represented as an attribute not an element. - */ - XMLATTR, - /** - * added to help the parsers - */ - NULL; - public static PropertyRepresentation fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("xmlAttr".equals(codeString)) - return XMLATTR; - throw new Exception("Unknown PropertyRepresentation code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case XMLATTR: return "xmlAttr"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case XMLATTR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case XMLATTR: return "In XML, this property is represented as an attribute not an element."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case XMLATTR: return "Xml Attr"; - default: return "?"; - } - } - } - - public static class PropertyRepresentationEnumFactory implements EnumFactory { - public PropertyRepresentation fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("xmlAttr".equals(codeString)) - return PropertyRepresentation.XMLATTR; - throw new IllegalArgumentException("Unknown PropertyRepresentation code '"+codeString+"'"); - } - public String toCode(PropertyRepresentation code) { - if (code == PropertyRepresentation.XMLATTR) - return "xmlAttr"; - return "?"; - } - } - - public enum ResourceSlicingRules { - /** - * No additional content is allowed other than that described by the slices in this profile. - */ - CLOSED, - /** - * Additional content is allowed anywhere in the list. - */ - OPEN, - /** - * Additional content is allowed, but only at the end of the list. Note that using this requires that the slices be ordered, which makes it hard to share uses. This should only be done where absolutely required. - */ - OPENATEND, - /** - * added to help the parsers - */ - NULL; - public static ResourceSlicingRules fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("closed".equals(codeString)) - return CLOSED; - if ("open".equals(codeString)) - return OPEN; - if ("openAtEnd".equals(codeString)) - return OPENATEND; - throw new Exception("Unknown ResourceSlicingRules code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CLOSED: return "closed"; - case OPEN: return "open"; - case OPENATEND: return "openAtEnd"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CLOSED: return ""; - case OPEN: return ""; - case OPENATEND: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CLOSED: return "No additional content is allowed other than that described by the slices in this profile."; - case OPEN: return "Additional content is allowed anywhere in the list."; - case OPENATEND: return "Additional content is allowed, but only at the end of the list. Note that using this requires that the slices be ordered, which makes it hard to share uses. This should only be done where absolutely required."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CLOSED: return "Closed"; - case OPEN: return "Open"; - case OPENATEND: return "Open At End"; - default: return "?"; - } - } - } - - public static class ResourceSlicingRulesEnumFactory implements EnumFactory { - public ResourceSlicingRules fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("closed".equals(codeString)) - return ResourceSlicingRules.CLOSED; - if ("open".equals(codeString)) - return ResourceSlicingRules.OPEN; - if ("openAtEnd".equals(codeString)) - return ResourceSlicingRules.OPENATEND; - throw new IllegalArgumentException("Unknown ResourceSlicingRules code '"+codeString+"'"); - } - public String toCode(ResourceSlicingRules code) { - if (code == ResourceSlicingRules.CLOSED) - return "closed"; - if (code == ResourceSlicingRules.OPEN) - return "open"; - if (code == ResourceSlicingRules.OPENATEND) - return "openAtEnd"; - return "?"; - } - } - - public enum ResourceAggregationMode { - /** - * The reference is a local reference to a contained resource. - */ - CONTAINED, - /** - * The reference to a resource that has to be resolved externally to the resource that includes the reference. - */ - REFERENCED, - /** - * The resource the reference points to will be found in the same bundle as the resource that includes the reference. - */ - BUNDLED, - /** - * added to help the parsers - */ - NULL; - public static ResourceAggregationMode fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("contained".equals(codeString)) - return CONTAINED; - if ("referenced".equals(codeString)) - return REFERENCED; - if ("bundled".equals(codeString)) - return BUNDLED; - throw new Exception("Unknown ResourceAggregationMode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CONTAINED: return "contained"; - case REFERENCED: return "referenced"; - case BUNDLED: return "bundled"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CONTAINED: return ""; - case REFERENCED: return ""; - case BUNDLED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CONTAINED: return "The reference is a local reference to a contained resource."; - case REFERENCED: return "The reference to a resource that has to be resolved externally to the resource that includes the reference."; - case BUNDLED: return "The resource the reference points to will be found in the same bundle as the resource that includes the reference."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CONTAINED: return "Contained"; - case REFERENCED: return "Referenced"; - case BUNDLED: return "Bundled"; - default: return "?"; - } - } - } - - public static class ResourceAggregationModeEnumFactory implements EnumFactory { - public ResourceAggregationMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("contained".equals(codeString)) - return ResourceAggregationMode.CONTAINED; - if ("referenced".equals(codeString)) - return ResourceAggregationMode.REFERENCED; - if ("bundled".equals(codeString)) - return ResourceAggregationMode.BUNDLED; - throw new IllegalArgumentException("Unknown ResourceAggregationMode code '"+codeString+"'"); - } - public String toCode(ResourceAggregationMode code) { - if (code == ResourceAggregationMode.CONTAINED) - return "contained"; - if (code == ResourceAggregationMode.REFERENCED) - return "referenced"; - if (code == ResourceAggregationMode.BUNDLED) - return "bundled"; - return "?"; - } - } - - public enum ConstraintSeverity { - /** - * If the constraint is violated, the resource is not conformant. - */ - ERROR, - /** - * If the constraint is violated, the resource is conformant, but it is not necessarily following best practice. - */ - WARNING, - /** - * added to help the parsers - */ - NULL; - public static ConstraintSeverity fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("error".equals(codeString)) - return ERROR; - if ("warning".equals(codeString)) - return WARNING; - throw new Exception("Unknown ConstraintSeverity code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ERROR: return "error"; - case WARNING: return "warning"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ERROR: return ""; - case WARNING: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ERROR: return "If the constraint is violated, the resource is not conformant."; - case WARNING: return "If the constraint is violated, the resource is conformant, but it is not necessarily following best practice."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ERROR: return "Error"; - case WARNING: return "Warning"; - default: return "?"; - } - } - } - - public static class ConstraintSeverityEnumFactory implements EnumFactory { - public ConstraintSeverity fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("error".equals(codeString)) - return ConstraintSeverity.ERROR; - if ("warning".equals(codeString)) - return ConstraintSeverity.WARNING; - throw new IllegalArgumentException("Unknown ConstraintSeverity code '"+codeString+"'"); - } - public String toCode(ConstraintSeverity code) { - if (code == ConstraintSeverity.ERROR) - return "error"; - if (code == ConstraintSeverity.WARNING) - return "warning"; - return "?"; - } - } - - public enum BindingStrength { - /** - * To be conformant, instances of this element SHALL include a code from the specified value set. - */ - REQUIRED, - /** - * To be conformant, instances of this element SHALL include a code from the specified value set if any of the codes within the value set can apply to the concept being communicated. If the valueset does not cover the concept (based on human review), alternate codings (or, data type allowing, text) may be included instead. - */ - EXTENSIBLE, - /** - * Instances are encouraged to draw from the specified codes for interoperability purposes but are not required to do so to be considered conformant. - */ - PREFERRED, - /** - * Instances are not expected or even encouraged to draw from the specified value set. The value set merely provides examples of the types of concepts intended to be included. - */ - EXAMPLE, - /** - * added to help the parsers - */ - NULL; - public static BindingStrength fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("required".equals(codeString)) - return REQUIRED; - if ("extensible".equals(codeString)) - return EXTENSIBLE; - if ("preferred".equals(codeString)) - return PREFERRED; - if ("example".equals(codeString)) - return EXAMPLE; - throw new Exception("Unknown BindingStrength code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case REQUIRED: return "required"; - case EXTENSIBLE: return "extensible"; - case PREFERRED: return "preferred"; - case EXAMPLE: return "example"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REQUIRED: return ""; - case EXTENSIBLE: return ""; - case PREFERRED: return ""; - case EXAMPLE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REQUIRED: return "To be conformant, instances of this element SHALL include a code from the specified value set."; - case EXTENSIBLE: return "To be conformant, instances of this element SHALL include a code from the specified value set if any of the codes within the value set can apply to the concept being communicated. If the valueset does not cover the concept (based on human review), alternate codings (or, data type allowing, text) may be included instead."; - case PREFERRED: return "Instances are encouraged to draw from the specified codes for interoperability purposes but are not required to do so to be considered conformant."; - case EXAMPLE: return "Instances are not expected or even encouraged to draw from the specified value set. The value set merely provides examples of the types of concepts intended to be included."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REQUIRED: return "Required"; - case EXTENSIBLE: return "Extensible"; - case PREFERRED: return "Preferred"; - case EXAMPLE: return "Example"; - default: return "?"; - } - } - } - - public static class BindingStrengthEnumFactory implements EnumFactory { - public BindingStrength fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("required".equals(codeString)) - return BindingStrength.REQUIRED; - if ("extensible".equals(codeString)) - return BindingStrength.EXTENSIBLE; - if ("preferred".equals(codeString)) - return BindingStrength.PREFERRED; - if ("example".equals(codeString)) - return BindingStrength.EXAMPLE; - throw new IllegalArgumentException("Unknown BindingStrength code '"+codeString+"'"); - } - public String toCode(BindingStrength code) { - if (code == BindingStrength.REQUIRED) - return "required"; - if (code == BindingStrength.EXTENSIBLE) - return "extensible"; - if (code == BindingStrength.PREFERRED) - return "preferred"; - if (code == BindingStrength.EXAMPLE) - return "example"; - return "?"; - } - } - - @Block() - public static class ElementDefinitionSlicingComponent extends Element implements IBaseDatatypeElement { - /** - * Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices. - */ - @Child(name = "discriminator", type = {StringType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Element values that used to distinguish the slices", formalDefinition="Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices." ) - protected List discriminator; - - /** - * A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated. - */ - @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Text description of how slicing works (or not)", formalDefinition="A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated." ) - protected StringType description; - - /** - * If the matching elements have to occur in the same order as defined in the profile. - */ - @Child(name = "ordered", type = {BooleanType.class}, order=3, min=0, max=1) - @Description(shortDefinition="If elements must be in same order as slices", formalDefinition="If the matching elements have to occur in the same order as defined in the profile." ) - protected BooleanType ordered; - - /** - * Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end. - */ - @Child(name = "rules", type = {CodeType.class}, order=4, min=1, max=1) - @Description(shortDefinition="closed | open | openAtEnd", formalDefinition="Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end." ) - protected Enumeration rules; - - private static final long serialVersionUID = -321298491L; - - /* - * Constructor - */ - public ElementDefinitionSlicingComponent() { - super(); - } - - /* - * Constructor - */ - public ElementDefinitionSlicingComponent(Enumeration rules) { - super(); - this.rules = rules; - } - - /** - * @return {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) - */ - public List getDiscriminator() { - if (this.discriminator == null) - this.discriminator = new ArrayList(); - return this.discriminator; - } - - public boolean hasDiscriminator() { - if (this.discriminator == null) - return false; - for (StringType item : this.discriminator) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) - */ - // syntactic sugar - public StringType addDiscriminatorElement() {//2 - StringType t = new StringType(); - if (this.discriminator == null) - this.discriminator = new ArrayList(); - this.discriminator.add(t); - return t; - } - - /** - * @param value {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) - */ - public ElementDefinitionSlicingComponent addDiscriminator(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.discriminator == null) - this.discriminator = new ArrayList(); - this.discriminator.add(t); - return this; - } - - /** - * @param value {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) - */ - public boolean hasDiscriminator(String value) { - if (this.discriminator == null) - return false; - for (StringType v : this.discriminator) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #description} (A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionSlicingComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ElementDefinitionSlicingComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated. - */ - public ElementDefinitionSlicingComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #ordered} (If the matching elements have to occur in the same order as defined in the profile.). This is the underlying object with id, value and extensions. The accessor "getOrdered" gives direct access to the value - */ - public BooleanType getOrderedElement() { - if (this.ordered == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionSlicingComponent.ordered"); - else if (Configuration.doAutoCreate()) - this.ordered = new BooleanType(); // bb - return this.ordered; - } - - public boolean hasOrderedElement() { - return this.ordered != null && !this.ordered.isEmpty(); - } - - public boolean hasOrdered() { - return this.ordered != null && !this.ordered.isEmpty(); - } - - /** - * @param value {@link #ordered} (If the matching elements have to occur in the same order as defined in the profile.). This is the underlying object with id, value and extensions. The accessor "getOrdered" gives direct access to the value - */ - public ElementDefinitionSlicingComponent setOrderedElement(BooleanType value) { - this.ordered = value; - return this; - } - - /** - * @return If the matching elements have to occur in the same order as defined in the profile. - */ - public boolean getOrdered() { - return this.ordered == null || this.ordered.isEmpty() ? false : this.ordered.getValue(); - } - - /** - * @param value If the matching elements have to occur in the same order as defined in the profile. - */ - public ElementDefinitionSlicingComponent setOrdered(boolean value) { - if (this.ordered == null) - this.ordered = new BooleanType(); - this.ordered.setValue(value); - return this; - } - - /** - * @return {@link #rules} (Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.). This is the underlying object with id, value and extensions. The accessor "getRules" gives direct access to the value - */ - public Enumeration getRulesElement() { - if (this.rules == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionSlicingComponent.rules"); - else if (Configuration.doAutoCreate()) - this.rules = new Enumeration(new ResourceSlicingRulesEnumFactory()); // bb - return this.rules; - } - - public boolean hasRulesElement() { - return this.rules != null && !this.rules.isEmpty(); - } - - public boolean hasRules() { - return this.rules != null && !this.rules.isEmpty(); - } - - /** - * @param value {@link #rules} (Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.). This is the underlying object with id, value and extensions. The accessor "getRules" gives direct access to the value - */ - public ElementDefinitionSlicingComponent setRulesElement(Enumeration value) { - this.rules = value; - return this; - } - - /** - * @return Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end. - */ - public ResourceSlicingRules getRules() { - return this.rules == null ? null : this.rules.getValue(); - } - - /** - * @param value Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end. - */ - public ElementDefinitionSlicingComponent setRules(ResourceSlicingRules value) { - if (this.rules == null) - this.rules = new Enumeration(new ResourceSlicingRulesEnumFactory()); - this.rules.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("discriminator", "string", "Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.", 0, java.lang.Integer.MAX_VALUE, discriminator)); - childrenList.add(new Property("description", "string", "A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("ordered", "boolean", "If the matching elements have to occur in the same order as defined in the profile.", 0, java.lang.Integer.MAX_VALUE, ordered)); - childrenList.add(new Property("rules", "code", "Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.", 0, java.lang.Integer.MAX_VALUE, rules)); - } - - public ElementDefinitionSlicingComponent copy() { - ElementDefinitionSlicingComponent dst = new ElementDefinitionSlicingComponent(); - copyValues(dst); - if (discriminator != null) { - dst.discriminator = new ArrayList(); - for (StringType i : discriminator) - dst.discriminator.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - dst.ordered = ordered == null ? null : ordered.copy(); - dst.rules = rules == null ? null : rules.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ElementDefinitionSlicingComponent)) - return false; - ElementDefinitionSlicingComponent o = (ElementDefinitionSlicingComponent) other; - return compareDeep(discriminator, o.discriminator, true) && compareDeep(description, o.description, true) - && compareDeep(ordered, o.ordered, true) && compareDeep(rules, o.rules, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ElementDefinitionSlicingComponent)) - return false; - ElementDefinitionSlicingComponent o = (ElementDefinitionSlicingComponent) other; - return compareValues(discriminator, o.discriminator, true) && compareValues(description, o.description, true) - && compareValues(ordered, o.ordered, true) && compareValues(rules, o.rules, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (discriminator == null || discriminator.isEmpty()) && (description == null || description.isEmpty()) - && (ordered == null || ordered.isEmpty()) && (rules == null || rules.isEmpty()); - } - - } - - @Block() - public static class TypeRefComponent extends Element implements IBaseDatatypeElement { - /** - * Name of Data type or Resource that is a(or the) type used for this element. - */ - @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Name of Data type or Resource", formalDefinition="Name of Data type or Resource that is a(or the) type used for this element." ) - protected CodeType code; - - /** - * Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. - */ - @Child(name = "profile", type = {UriType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Profile.structure to apply", formalDefinition="Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile." ) - protected UriType profile; - - /** - * If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle. - */ - @Child(name = "aggregation", type = {CodeType.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="contained | referenced | bundled - how aggregated", formalDefinition="If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle." ) - protected List> aggregation; - - private static final long serialVersionUID = -1527133887L; - - /* - * Constructor - */ - public TypeRefComponent() { - super(); - } - - /* - * Constructor - */ - public TypeRefComponent(CodeType code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Name of Data type or Resource that is a(or the) type used for this element.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TypeRefComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Name of Data type or Resource that is a(or the) type used for this element.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public TypeRefComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return Name of Data type or Resource that is a(or the) type used for this element. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Name of Data type or Resource that is a(or the) type used for this element. - */ - public TypeRefComponent setCode(String value) { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #profile} (Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile.). This is the underlying object with id, value and extensions. The accessor "getProfile" gives direct access to the value - */ - public UriType getProfileElement() { - if (this.profile == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TypeRefComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profile = new UriType(); // bb - return this.profile; - } - - public boolean hasProfileElement() { - return this.profile != null && !this.profile.isEmpty(); - } - - public boolean hasProfile() { - return this.profile != null && !this.profile.isEmpty(); - } - - /** - * @param value {@link #profile} (Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile.). This is the underlying object with id, value and extensions. The accessor "getProfile" gives direct access to the value - */ - public TypeRefComponent setProfileElement(UriType value) { - this.profile = value; - return this; - } - - /** - * @return Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. - */ - public String getProfile() { - return this.profile == null ? null : this.profile.getValue(); - } - - /** - * @param value Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. - */ - public TypeRefComponent setProfile(String value) { - if (Utilities.noString(value)) - this.profile = null; - else { - if (this.profile == null) - this.profile = new UriType(); - this.profile.setValue(value); - } - return this; - } - - /** - * @return {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) - */ - public List> getAggregation() { - if (this.aggregation == null) - this.aggregation = new ArrayList>(); - return this.aggregation; - } - - public boolean hasAggregation() { - if (this.aggregation == null) - return false; - for (Enumeration item : this.aggregation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) - */ - // syntactic sugar - public Enumeration addAggregationElement() {//2 - Enumeration t = new Enumeration(new ResourceAggregationModeEnumFactory()); - if (this.aggregation == null) - this.aggregation = new ArrayList>(); - this.aggregation.add(t); - return t; - } - - /** - * @param value {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) - */ - public TypeRefComponent addAggregation(ResourceAggregationMode value) { //1 - Enumeration t = new Enumeration(new ResourceAggregationModeEnumFactory()); - t.setValue(value); - if (this.aggregation == null) - this.aggregation = new ArrayList>(); - this.aggregation.add(t); - return this; - } - - /** - * @param value {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) - */ - public boolean hasAggregation(ResourceAggregationMode value) { - if (this.aggregation == null) - return false; - for (Enumeration v : this.aggregation) - if (v.equals(value)) // code - return true; - return false; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "Name of Data type or Resource that is a(or the) type used for this element.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("profile", "uri", "Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile.", 0, java.lang.Integer.MAX_VALUE, profile)); - childrenList.add(new Property("aggregation", "code", "If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.", 0, java.lang.Integer.MAX_VALUE, aggregation)); - } - - public TypeRefComponent copy() { - TypeRefComponent dst = new TypeRefComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.profile = profile == null ? null : profile.copy(); - if (aggregation != null) { - dst.aggregation = new ArrayList>(); - for (Enumeration i : aggregation) - dst.aggregation.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TypeRefComponent)) - return false; - TypeRefComponent o = (TypeRefComponent) other; - return compareDeep(code, o.code, true) && compareDeep(profile, o.profile, true) && compareDeep(aggregation, o.aggregation, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TypeRefComponent)) - return false; - TypeRefComponent o = (TypeRefComponent) other; - return compareValues(code, o.code, true) && compareValues(profile, o.profile, true) && compareValues(aggregation, o.aggregation, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (profile == null || profile.isEmpty()) - && (aggregation == null || aggregation.isEmpty()); - } - - } - - @Block() - public static class ElementDefinitionConstraintComponent extends Element implements IBaseDatatypeElement { - /** - * Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality. - */ - @Child(name = "key", type = {IdType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Target of 'condition' reference above", formalDefinition="Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality." ) - protected IdType key; - - /** - * Used to label the constraint in OCL or in short displays incapable of displaying the full human description. - */ - @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Short human label", formalDefinition="Used to label the constraint in OCL or in short displays incapable of displaying the full human description." ) - protected StringType name; - - /** - * Identifies the impact constraint violation has on the conformance of the instance. - */ - @Child(name = "severity", type = {CodeType.class}, order=3, min=1, max=1) - @Description(shortDefinition="error | warning", formalDefinition="Identifies the impact constraint violation has on the conformance of the instance." ) - protected Enumeration severity; - - /** - * Text that can be used to describe the constraint in messages identifying that the constraint has been violated. - */ - @Child(name = "human", type = {StringType.class}, order=4, min=1, max=1) - @Description(shortDefinition="Human description of constraint", formalDefinition="Text that can be used to describe the constraint in messages identifying that the constraint has been violated." ) - protected StringType human; - - /** - * An XPath expression of constraint that can be executed to see if this constraint is met. - */ - @Child(name = "xpath", type = {StringType.class}, order=5, min=1, max=1) - @Description(shortDefinition="XPath expression of constraint", formalDefinition="An XPath expression of constraint that can be executed to see if this constraint is met." ) - protected StringType xpath; - - private static final long serialVersionUID = -1195616532L; - - /* - * Constructor - */ - public ElementDefinitionConstraintComponent() { - super(); - } - - /* - * Constructor - */ - public ElementDefinitionConstraintComponent(IdType key, Enumeration severity, StringType human, StringType xpath) { - super(); - this.key = key; - this.severity = severity; - this.human = human; - this.xpath = xpath; - } - - /** - * @return {@link #key} (Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality.). This is the underlying object with id, value and extensions. The accessor "getKey" gives direct access to the value - */ - public IdType getKeyElement() { - if (this.key == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.key"); - else if (Configuration.doAutoCreate()) - this.key = new IdType(); // bb - return this.key; - } - - public boolean hasKeyElement() { - return this.key != null && !this.key.isEmpty(); - } - - public boolean hasKey() { - return this.key != null && !this.key.isEmpty(); - } - - /** - * @param value {@link #key} (Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality.). This is the underlying object with id, value and extensions. The accessor "getKey" gives direct access to the value - */ - public ElementDefinitionConstraintComponent setKeyElement(IdType value) { - this.key = value; - return this; - } - - /** - * @return Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality. - */ - public String getKey() { - return this.key == null ? null : this.key.getValue(); - } - - /** - * @param value Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality. - */ - public ElementDefinitionConstraintComponent setKey(String value) { - if (this.key == null) - this.key = new IdType(); - this.key.setValue(value); - return this; - } - - /** - * @return {@link #name} (Used to label the constraint in OCL or in short displays incapable of displaying the full human description.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Used to label the constraint in OCL or in short displays incapable of displaying the full human description.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ElementDefinitionConstraintComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Used to label the constraint in OCL or in short displays incapable of displaying the full human description. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Used to label the constraint in OCL or in short displays incapable of displaying the full human description. - */ - public ElementDefinitionConstraintComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #severity} (Identifies the impact constraint violation has on the conformance of the instance.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public Enumeration getSeverityElement() { - if (this.severity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.severity"); - else if (Configuration.doAutoCreate()) - this.severity = new Enumeration(new ConstraintSeverityEnumFactory()); // bb - return this.severity; - } - - public boolean hasSeverityElement() { - return this.severity != null && !this.severity.isEmpty(); - } - - public boolean hasSeverity() { - return this.severity != null && !this.severity.isEmpty(); - } - - /** - * @param value {@link #severity} (Identifies the impact constraint violation has on the conformance of the instance.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public ElementDefinitionConstraintComponent setSeverityElement(Enumeration value) { - this.severity = value; - return this; - } - - /** - * @return Identifies the impact constraint violation has on the conformance of the instance. - */ - public ConstraintSeverity getSeverity() { - return this.severity == null ? null : this.severity.getValue(); - } - - /** - * @param value Identifies the impact constraint violation has on the conformance of the instance. - */ - public ElementDefinitionConstraintComponent setSeverity(ConstraintSeverity value) { - if (this.severity == null) - this.severity = new Enumeration(new ConstraintSeverityEnumFactory()); - this.severity.setValue(value); - return this; - } - - /** - * @return {@link #human} (Text that can be used to describe the constraint in messages identifying that the constraint has been violated.). This is the underlying object with id, value and extensions. The accessor "getHuman" gives direct access to the value - */ - public StringType getHumanElement() { - if (this.human == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.human"); - else if (Configuration.doAutoCreate()) - this.human = new StringType(); // bb - return this.human; - } - - public boolean hasHumanElement() { - return this.human != null && !this.human.isEmpty(); - } - - public boolean hasHuman() { - return this.human != null && !this.human.isEmpty(); - } - - /** - * @param value {@link #human} (Text that can be used to describe the constraint in messages identifying that the constraint has been violated.). This is the underlying object with id, value and extensions. The accessor "getHuman" gives direct access to the value - */ - public ElementDefinitionConstraintComponent setHumanElement(StringType value) { - this.human = value; - return this; - } - - /** - * @return Text that can be used to describe the constraint in messages identifying that the constraint has been violated. - */ - public String getHuman() { - return this.human == null ? null : this.human.getValue(); - } - - /** - * @param value Text that can be used to describe the constraint in messages identifying that the constraint has been violated. - */ - public ElementDefinitionConstraintComponent setHuman(String value) { - if (this.human == null) - this.human = new StringType(); - this.human.setValue(value); - return this; - } - - /** - * @return {@link #xpath} (An XPath expression of constraint that can be executed to see if this constraint is met.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value - */ - public StringType getXpathElement() { - if (this.xpath == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.xpath"); - else if (Configuration.doAutoCreate()) - this.xpath = new StringType(); // bb - return this.xpath; - } - - public boolean hasXpathElement() { - return this.xpath != null && !this.xpath.isEmpty(); - } - - public boolean hasXpath() { - return this.xpath != null && !this.xpath.isEmpty(); - } - - /** - * @param value {@link #xpath} (An XPath expression of constraint that can be executed to see if this constraint is met.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value - */ - public ElementDefinitionConstraintComponent setXpathElement(StringType value) { - this.xpath = value; - return this; - } - - /** - * @return An XPath expression of constraint that can be executed to see if this constraint is met. - */ - public String getXpath() { - return this.xpath == null ? null : this.xpath.getValue(); - } - - /** - * @param value An XPath expression of constraint that can be executed to see if this constraint is met. - */ - public ElementDefinitionConstraintComponent setXpath(String value) { - if (this.xpath == null) - this.xpath = new StringType(); - this.xpath.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("key", "id", "Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality.", 0, java.lang.Integer.MAX_VALUE, key)); - childrenList.add(new Property("name", "string", "Used to label the constraint in OCL or in short displays incapable of displaying the full human description.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("severity", "code", "Identifies the impact constraint violation has on the conformance of the instance.", 0, java.lang.Integer.MAX_VALUE, severity)); - childrenList.add(new Property("human", "string", "Text that can be used to describe the constraint in messages identifying that the constraint has been violated.", 0, java.lang.Integer.MAX_VALUE, human)); - childrenList.add(new Property("xpath", "string", "An XPath expression of constraint that can be executed to see if this constraint is met.", 0, java.lang.Integer.MAX_VALUE, xpath)); - } - - public ElementDefinitionConstraintComponent copy() { - ElementDefinitionConstraintComponent dst = new ElementDefinitionConstraintComponent(); - copyValues(dst); - dst.key = key == null ? null : key.copy(); - dst.name = name == null ? null : name.copy(); - dst.severity = severity == null ? null : severity.copy(); - dst.human = human == null ? null : human.copy(); - dst.xpath = xpath == null ? null : xpath.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ElementDefinitionConstraintComponent)) - return false; - ElementDefinitionConstraintComponent o = (ElementDefinitionConstraintComponent) other; - return compareDeep(key, o.key, true) && compareDeep(name, o.name, true) && compareDeep(severity, o.severity, true) - && compareDeep(human, o.human, true) && compareDeep(xpath, o.xpath, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ElementDefinitionConstraintComponent)) - return false; - ElementDefinitionConstraintComponent o = (ElementDefinitionConstraintComponent) other; - return compareValues(key, o.key, true) && compareValues(name, o.name, true) && compareValues(severity, o.severity, true) - && compareValues(human, o.human, true) && compareValues(xpath, o.xpath, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (key == null || key.isEmpty()) && (name == null || name.isEmpty()) - && (severity == null || severity.isEmpty()) && (human == null || human.isEmpty()) && (xpath == null || xpath.isEmpty()) - ; - } - - } - - @Block() - public static class ElementDefinitionBindingComponent extends Element implements IBaseDatatypeElement { - /** - * A descriptive name for this - can be useful for generating implementation artifacts. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Descriptive Name", formalDefinition="A descriptive name for this - can be useful for generating implementation artifacts." ) - protected StringType name; - - /** - * Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. - */ - @Child(name = "strength", type = {CodeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="required | extensible | preferred | example", formalDefinition="Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances." ) - protected Enumeration strength; - - /** - * Describes the intended use of this particular set of codes. - */ - @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Human explanation of the value set", formalDefinition="Describes the intended use of this particular set of codes." ) - protected StringType description; - - /** - * Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used. - */ - @Child(name = "valueSet", type = {UriType.class, ValueSet.class}, order=4, min=0, max=1) - @Description(shortDefinition="Source of value set", formalDefinition="Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used." ) - protected Type valueSet; - - private static final long serialVersionUID = 325485202L; - - /* - * Constructor - */ - public ElementDefinitionBindingComponent() { - super(); - } - - /* - * Constructor - */ - public ElementDefinitionBindingComponent(StringType name, Enumeration strength) { - super(); - this.name = name; - this.strength = strength; - } - - /** - * @return {@link #name} (A descriptive name for this - can be useful for generating implementation artifacts.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A descriptive name for this - can be useful for generating implementation artifacts.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ElementDefinitionBindingComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A descriptive name for this - can be useful for generating implementation artifacts. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A descriptive name for this - can be useful for generating implementation artifacts. - */ - public ElementDefinitionBindingComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #strength} (Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.). This is the underlying object with id, value and extensions. The accessor "getStrength" gives direct access to the value - */ - public Enumeration getStrengthElement() { - if (this.strength == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.strength"); - else if (Configuration.doAutoCreate()) - this.strength = new Enumeration(new BindingStrengthEnumFactory()); // bb - return this.strength; - } - - public boolean hasStrengthElement() { - return this.strength != null && !this.strength.isEmpty(); - } - - public boolean hasStrength() { - return this.strength != null && !this.strength.isEmpty(); - } - - /** - * @param value {@link #strength} (Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.). This is the underlying object with id, value and extensions. The accessor "getStrength" gives direct access to the value - */ - public ElementDefinitionBindingComponent setStrengthElement(Enumeration value) { - this.strength = value; - return this; - } - - /** - * @return Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. - */ - public BindingStrength getStrength() { - return this.strength == null ? null : this.strength.getValue(); - } - - /** - * @param value Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. - */ - public ElementDefinitionBindingComponent setStrength(BindingStrength value) { - if (this.strength == null) - this.strength = new Enumeration(new BindingStrengthEnumFactory()); - this.strength.setValue(value); - return this; - } - - /** - * @return {@link #description} (Describes the intended use of this particular set of codes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Describes the intended use of this particular set of codes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ElementDefinitionBindingComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Describes the intended use of this particular set of codes. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Describes the intended use of this particular set of codes. - */ - public ElementDefinitionBindingComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) - */ - public Type getValueSet() { - return this.valueSet; - } - - /** - * @return {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) - */ - public UriType getValueSetUriType() throws Exception { - if (!(this.valueSet instanceof UriType)) - throw new Exception("Type mismatch: the type UriType was expected, but "+this.valueSet.getClass().getName()+" was encountered"); - return (UriType) this.valueSet; - } - - /** - * @return {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) - */ - public Reference getValueSetReference() throws Exception { - if (!(this.valueSet instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.valueSet.getClass().getName()+" was encountered"); - return (Reference) this.valueSet; - } - - public boolean hasValueSet() { - return this.valueSet != null && !this.valueSet.isEmpty(); - } - - /** - * @param value {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) - */ - public ElementDefinitionBindingComponent setValueSet(Type value) { - this.valueSet = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "A descriptive name for this - can be useful for generating implementation artifacts.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("strength", "code", "Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.", 0, java.lang.Integer.MAX_VALUE, strength)); - childrenList.add(new Property("description", "string", "Describes the intended use of this particular set of codes.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("valueSet[x]", "uri|Reference(ValueSet)", "Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.", 0, java.lang.Integer.MAX_VALUE, valueSet)); - } - - public ElementDefinitionBindingComponent copy() { - ElementDefinitionBindingComponent dst = new ElementDefinitionBindingComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.strength = strength == null ? null : strength.copy(); - dst.description = description == null ? null : description.copy(); - dst.valueSet = valueSet == null ? null : valueSet.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ElementDefinitionBindingComponent)) - return false; - ElementDefinitionBindingComponent o = (ElementDefinitionBindingComponent) other; - return compareDeep(name, o.name, true) && compareDeep(strength, o.strength, true) && compareDeep(description, o.description, true) - && compareDeep(valueSet, o.valueSet, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ElementDefinitionBindingComponent)) - return false; - ElementDefinitionBindingComponent o = (ElementDefinitionBindingComponent) other; - return compareValues(name, o.name, true) && compareValues(strength, o.strength, true) && compareValues(description, o.description, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (strength == null || strength.isEmpty()) - && (description == null || description.isEmpty()) && (valueSet == null || valueSet.isEmpty()) - ; - } - - } - - @Block() - public static class ElementDefinitionMappingComponent extends Element implements IBaseDatatypeElement { - /** - * An internal reference to the definition of a mapping. - */ - @Child(name = "identity", type = {IdType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Reference to mapping declaration", formalDefinition="An internal reference to the definition of a mapping." ) - protected IdType identity; - - /** - * Identifies the computable language in which mapping.map is expressed. - */ - @Child(name = "language", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Computable language of mapping", formalDefinition="Identifies the computable language in which mapping.map is expressed." ) - protected CodeType language; - - /** - * Expresses what part of the target specification corresponds to this element. - */ - @Child(name = "map", type = {StringType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Details of the mapping", formalDefinition="Expresses what part of the target specification corresponds to this element." ) - protected StringType map; - - private static final long serialVersionUID = -669205371L; - - /* - * Constructor - */ - public ElementDefinitionMappingComponent() { - super(); - } - - /* - * Constructor - */ - public ElementDefinitionMappingComponent(IdType identity, StringType map) { - super(); - this.identity = identity; - this.map = map; - } - - /** - * @return {@link #identity} (An internal reference to the definition of a mapping.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value - */ - public IdType getIdentityElement() { - if (this.identity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.identity"); - else if (Configuration.doAutoCreate()) - this.identity = new IdType(); // bb - return this.identity; - } - - public boolean hasIdentityElement() { - return this.identity != null && !this.identity.isEmpty(); - } - - public boolean hasIdentity() { - return this.identity != null && !this.identity.isEmpty(); - } - - /** - * @param value {@link #identity} (An internal reference to the definition of a mapping.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value - */ - public ElementDefinitionMappingComponent setIdentityElement(IdType value) { - this.identity = value; - return this; - } - - /** - * @return An internal reference to the definition of a mapping. - */ - public String getIdentity() { - return this.identity == null ? null : this.identity.getValue(); - } - - /** - * @param value An internal reference to the definition of a mapping. - */ - public ElementDefinitionMappingComponent setIdentity(String value) { - if (this.identity == null) - this.identity = new IdType(); - this.identity.setValue(value); - return this; - } - - /** - * @return {@link #language} (Identifies the computable language in which mapping.map is expressed.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public CodeType getLanguageElement() { - if (this.language == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.language"); - else if (Configuration.doAutoCreate()) - this.language = new CodeType(); // bb - return this.language; - } - - public boolean hasLanguageElement() { - return this.language != null && !this.language.isEmpty(); - } - - public boolean hasLanguage() { - return this.language != null && !this.language.isEmpty(); - } - - /** - * @param value {@link #language} (Identifies the computable language in which mapping.map is expressed.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public ElementDefinitionMappingComponent setLanguageElement(CodeType value) { - this.language = value; - return this; - } - - /** - * @return Identifies the computable language in which mapping.map is expressed. - */ - public String getLanguage() { - return this.language == null ? null : this.language.getValue(); - } - - /** - * @param value Identifies the computable language in which mapping.map is expressed. - */ - public ElementDefinitionMappingComponent setLanguage(String value) { - if (Utilities.noString(value)) - this.language = null; - else { - if (this.language == null) - this.language = new CodeType(); - this.language.setValue(value); - } - return this; - } - - /** - * @return {@link #map} (Expresses what part of the target specification corresponds to this element.). This is the underlying object with id, value and extensions. The accessor "getMap" gives direct access to the value - */ - public StringType getMapElement() { - if (this.map == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.map"); - else if (Configuration.doAutoCreate()) - this.map = new StringType(); // bb - return this.map; - } - - public boolean hasMapElement() { - return this.map != null && !this.map.isEmpty(); - } - - public boolean hasMap() { - return this.map != null && !this.map.isEmpty(); - } - - /** - * @param value {@link #map} (Expresses what part of the target specification corresponds to this element.). This is the underlying object with id, value and extensions. The accessor "getMap" gives direct access to the value - */ - public ElementDefinitionMappingComponent setMapElement(StringType value) { - this.map = value; - return this; - } - - /** - * @return Expresses what part of the target specification corresponds to this element. - */ - public String getMap() { - return this.map == null ? null : this.map.getValue(); - } - - /** - * @param value Expresses what part of the target specification corresponds to this element. - */ - public ElementDefinitionMappingComponent setMap(String value) { - if (this.map == null) - this.map = new StringType(); - this.map.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identity", "id", "An internal reference to the definition of a mapping.", 0, java.lang.Integer.MAX_VALUE, identity)); - childrenList.add(new Property("language", "code", "Identifies the computable language in which mapping.map is expressed.", 0, java.lang.Integer.MAX_VALUE, language)); - childrenList.add(new Property("map", "string", "Expresses what part of the target specification corresponds to this element.", 0, java.lang.Integer.MAX_VALUE, map)); - } - - public ElementDefinitionMappingComponent copy() { - ElementDefinitionMappingComponent dst = new ElementDefinitionMappingComponent(); - copyValues(dst); - dst.identity = identity == null ? null : identity.copy(); - dst.language = language == null ? null : language.copy(); - dst.map = map == null ? null : map.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ElementDefinitionMappingComponent)) - return false; - ElementDefinitionMappingComponent o = (ElementDefinitionMappingComponent) other; - return compareDeep(identity, o.identity, true) && compareDeep(language, o.language, true) && compareDeep(map, o.map, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ElementDefinitionMappingComponent)) - return false; - ElementDefinitionMappingComponent o = (ElementDefinitionMappingComponent) other; - return compareValues(identity, o.identity, true) && compareValues(language, o.language, true) && compareValues(map, o.map, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identity == null || identity.isEmpty()) && (language == null || language.isEmpty()) - && (map == null || map.isEmpty()); - } - - } - - /** - * The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. - */ - @Child(name = "path", type = {StringType.class}, order=0, min=1, max=1) - @Description(shortDefinition="The path of the element (see the Detailed Descriptions)", formalDefinition="The path identifies the element and is expressed as a '.'-separated list of ancestor elements, beginning with the name of the resource or extension." ) - protected StringType path; - - /** - * Codes that define how this element is represented in instances, when the deviation varies from the normal case. - */ - @Child(name = "representation", type = {CodeType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="How this element is represented in instances", formalDefinition="Codes that define how this element is represented in instances, when the deviation varies from the normal case." ) - protected List> representation; - - /** - * The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element. - */ - @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Name for this particular element definition (reference target)", formalDefinition="The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element." ) - protected StringType name; - - /** - * The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form. - */ - @Child(name = "label", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Name for element to display with or prompt for element", formalDefinition="The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form." ) - protected StringType label; - - /** - * A code that provides the meaning for the element according to a particular terminology. - */ - @Child(name = "code", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Defining code", formalDefinition="A code that provides the meaning for the element according to a particular terminology." ) - protected List code; - - /** - * Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set). - */ - @Child(name = "slicing", type = {}, order=5, min=0, max=1) - @Description(shortDefinition="This element is sliced - slices follow", formalDefinition="Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set)." ) - protected ElementDefinitionSlicingComponent slicing; - - /** - * A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification). - */ - @Child(name = "short_", type = {StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Concise definition for xml presentation", formalDefinition="A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification)." ) - protected StringType short_; - - /** - * Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. - */ - @Child(name = "definition", type = {StringType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Full formal definition as narrative text", formalDefinition="Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource." ) - protected StringType definition; - - /** - * Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc. - */ - @Child(name = "comments", type = {StringType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Comments about the use of this element", formalDefinition="Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc." ) - protected StringType comments; - - /** - * This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element. - */ - @Child(name = "requirements", type = {StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Why is this needed?", formalDefinition="This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element." ) - protected StringType requirements; - - /** - * Identifies additional names by which this element might also be known. - */ - @Child(name = "alias", type = {StringType.class}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Other names", formalDefinition="Identifies additional names by which this element might also be known." ) - protected List alias; - - /** - * The minimum number of times this element SHALL appear in the instance. - */ - @Child(name = "min", type = {IntegerType.class}, order=11, min=0, max=1) - @Description(shortDefinition="Minimum Cardinality", formalDefinition="The minimum number of times this element SHALL appear in the instance." ) - protected IntegerType min; - - /** - * The maximum number of times this element is permitted to appear in the instance. - */ - @Child(name = "max", type = {StringType.class}, order=12, min=0, max=1) - @Description(shortDefinition="Maximum Cardinality (a number or *)", formalDefinition="The maximum number of times this element is permitted to appear in the instance." ) - protected StringType max; - - /** - * The data type or resource that the value of this element is permitted to be. - */ - @Child(name = "type", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Data type and Profile for this element", formalDefinition="The data type or resource that the value of this element is permitted to be." ) - protected List type; - - /** - * Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element. - */ - @Child(name = "nameReference", type = {StringType.class}, order=14, min=0, max=1) - @Description(shortDefinition="To another element constraint (by element.name)", formalDefinition="Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element." ) - protected StringType nameReference; - - /** - * The value that should be used if there is no value stated in the instance. - */ - @Child(name = "defaultValue", type = {}, order=15, min=0, max=1) - @Description(shortDefinition="Specified value it missing from instance", formalDefinition="The value that should be used if there is no value stated in the instance." ) - protected org.hl7.fhir.instance.model.Type defaultValue; - - /** - * The Implicit meaning that is to be understood when this element is missing. - */ - @Child(name = "meaningWhenMissing", type = {StringType.class}, order=16, min=0, max=1) - @Description(shortDefinition="Implicit meaning when this element is missing", formalDefinition="The Implicit meaning that is to be understood when this element is missing." ) - protected StringType meaningWhenMissing; - - /** - * Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing. - */ - @Child(name = "fixed", type = {}, order=17, min=0, max=1) - @Description(shortDefinition="Value must be exactly this", formalDefinition="Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing." ) - protected org.hl7.fhir.instance.model.Type fixed; - - /** - * Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.). - */ - @Child(name = "pattern", type = {}, order=18, min=0, max=1) - @Description(shortDefinition="Value must have at least these property values", formalDefinition="Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.)." ) - protected org.hl7.fhir.instance.model.Type pattern; - - /** - * A sample value for this element demonstrating the type of information that would typically be captured. - */ - @Child(name = "example", type = {}, order=19, min=0, max=1) - @Description(shortDefinition="Example value: [as defined for type]", formalDefinition="A sample value for this element demonstrating the type of information that would typically be captured." ) - protected org.hl7.fhir.instance.model.Type example; - - /** - * Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. - */ - @Child(name = "maxLength", type = {IntegerType.class}, order=20, min=0, max=1) - @Description(shortDefinition="Max length for strings", formalDefinition="Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element." ) - protected IntegerType maxLength; - - /** - * A reference to an invariant that may make additional statements about the cardinality or value in the instance. - */ - @Child(name = "condition", type = {IdType.class}, order=21, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Reference to invariant about presence", formalDefinition="A reference to an invariant that may make additional statements about the cardinality or value in the instance." ) - protected List condition; - - /** - * Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance. - */ - @Child(name = "constraint", type = {}, order=22, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Condition that must evaluate to true", formalDefinition="Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance." ) - protected List constraint; - - /** - * If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported. - */ - @Child(name = "mustSupport", type = {BooleanType.class}, order=23, min=0, max=1) - @Description(shortDefinition="If the element must supported", formalDefinition="If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported." ) - protected BooleanType mustSupport; - - /** - * If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. - */ - @Child(name = "isModifier", type = {BooleanType.class}, order=24, min=0, max=1) - @Description(shortDefinition="If this modifies the meaning of other elements", formalDefinition="If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system." ) - protected BooleanType isModifier; - - /** - * Whether the element should be included if a client requests a search with the parameter _summary=true. - */ - @Child(name = "isSummary", type = {BooleanType.class}, order=25, min=0, max=1) - @Description(shortDefinition="Include when _summary = true?", formalDefinition="Whether the element should be included if a client requests a search with the parameter _summary=true." ) - protected BooleanType isSummary; - - /** - * Binds to a value set if this element is coded (code, Coding, CodeableConcept). - */ - @Child(name = "binding", type = {}, order=26, min=0, max=1) - @Description(shortDefinition="ValueSet details if this is coded", formalDefinition="Binds to a value set if this element is coded (code, Coding, CodeableConcept)." ) - protected ElementDefinitionBindingComponent binding; - - /** - * Identifies a concept from an external specification that roughly corresponds to this element. - */ - @Child(name = "mapping", type = {}, order=27, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Map element to another set of definitions", formalDefinition="Identifies a concept from an external specification that roughly corresponds to this element." ) - protected List mapping; - - private static final long serialVersionUID = 1149674414L; - - /* - * Constructor - */ - public ElementDefinition() { - super(); - } - - /* - * Constructor - */ - public ElementDefinition(StringType path) { - super(); - this.path = path; - } - - /** - * @return {@link #path} (The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public StringType getPathElement() { - if (this.path == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.path"); - else if (Configuration.doAutoCreate()) - this.path = new StringType(); // bb - return this.path; - } - - public boolean hasPathElement() { - return this.path != null && !this.path.isEmpty(); - } - - public boolean hasPath() { - return this.path != null && !this.path.isEmpty(); - } - - /** - * @param value {@link #path} (The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public ElementDefinition setPathElement(StringType value) { - this.path = value; - return this; - } - - /** - * @return The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. - */ - public String getPath() { - return this.path == null ? null : this.path.getValue(); - } - - /** - * @param value The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. - */ - public ElementDefinition setPath(String value) { - if (this.path == null) - this.path = new StringType(); - this.path.setValue(value); - return this; - } - - /** - * @return {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) - */ - public List> getRepresentation() { - if (this.representation == null) - this.representation = new ArrayList>(); - return this.representation; - } - - public boolean hasRepresentation() { - if (this.representation == null) - return false; - for (Enumeration item : this.representation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) - */ - // syntactic sugar - public Enumeration addRepresentationElement() {//2 - Enumeration t = new Enumeration(new PropertyRepresentationEnumFactory()); - if (this.representation == null) - this.representation = new ArrayList>(); - this.representation.add(t); - return t; - } - - /** - * @param value {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) - */ - public ElementDefinition addRepresentation(PropertyRepresentation value) { //1 - Enumeration t = new Enumeration(new PropertyRepresentationEnumFactory()); - t.setValue(value); - if (this.representation == null) - this.representation = new ArrayList>(); - this.representation.add(t); - return this; - } - - /** - * @param value {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) - */ - public boolean hasRepresentation(PropertyRepresentation value) { - if (this.representation == null) - return false; - for (Enumeration v : this.representation) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #name} (The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ElementDefinition setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element. - */ - public ElementDefinition setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #label} (The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value - */ - public StringType getLabelElement() { - if (this.label == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.label"); - else if (Configuration.doAutoCreate()) - this.label = new StringType(); // bb - return this.label; - } - - public boolean hasLabelElement() { - return this.label != null && !this.label.isEmpty(); - } - - public boolean hasLabel() { - return this.label != null && !this.label.isEmpty(); - } - - /** - * @param value {@link #label} (The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value - */ - public ElementDefinition setLabelElement(StringType value) { - this.label = value; - return this; - } - - /** - * @return The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form. - */ - public String getLabel() { - return this.label == null ? null : this.label.getValue(); - } - - /** - * @param value The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form. - */ - public ElementDefinition setLabel(String value) { - if (Utilities.noString(value)) - this.label = null; - else { - if (this.label == null) - this.label = new StringType(); - this.label.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (A code that provides the meaning for the element according to a particular terminology.) - */ - public List getCode() { - if (this.code == null) - this.code = new ArrayList(); - return this.code; - } - - public boolean hasCode() { - if (this.code == null) - return false; - for (Coding item : this.code) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #code} (A code that provides the meaning for the element according to a particular terminology.) - */ - // syntactic sugar - public Coding addCode() { //3 - Coding t = new Coding(); - if (this.code == null) - this.code = new ArrayList(); - this.code.add(t); - return t; - } - - // syntactic sugar - public ElementDefinition addCode(Coding t) { //3 - if (t == null) - return this; - if (this.code == null) - this.code = new ArrayList(); - this.code.add(t); - return this; - } - - /** - * @return {@link #slicing} (Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).) - */ - public ElementDefinitionSlicingComponent getSlicing() { - if (this.slicing == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.slicing"); - else if (Configuration.doAutoCreate()) - this.slicing = new ElementDefinitionSlicingComponent(); // cc - return this.slicing; - } - - public boolean hasSlicing() { - return this.slicing != null && !this.slicing.isEmpty(); - } - - /** - * @param value {@link #slicing} (Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).) - */ - public ElementDefinition setSlicing(ElementDefinitionSlicingComponent value) { - this.slicing = value; - return this; - } - - /** - * @return {@link #short_} (A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification).). This is the underlying object with id, value and extensions. The accessor "getShort" gives direct access to the value - */ - public StringType getShortElement() { - if (this.short_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.short_"); - else if (Configuration.doAutoCreate()) - this.short_ = new StringType(); // bb - return this.short_; - } - - public boolean hasShortElement() { - return this.short_ != null && !this.short_.isEmpty(); - } - - public boolean hasShort() { - return this.short_ != null && !this.short_.isEmpty(); - } - - /** - * @param value {@link #short_} (A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification).). This is the underlying object with id, value and extensions. The accessor "getShort" gives direct access to the value - */ - public ElementDefinition setShortElement(StringType value) { - this.short_ = value; - return this; - } - - /** - * @return A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification). - */ - public String getShort() { - return this.short_ == null ? null : this.short_.getValue(); - } - - /** - * @param value A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification). - */ - public ElementDefinition setShort(String value) { - if (Utilities.noString(value)) - this.short_ = null; - else { - if (this.short_ == null) - this.short_ = new StringType(); - this.short_.setValue(value); - } - return this; - } - - /** - * @return {@link #definition} (Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public StringType getDefinitionElement() { - if (this.definition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.definition"); - else if (Configuration.doAutoCreate()) - this.definition = new StringType(); // bb - return this.definition; - } - - public boolean hasDefinitionElement() { - return this.definition != null && !this.definition.isEmpty(); - } - - public boolean hasDefinition() { - return this.definition != null && !this.definition.isEmpty(); - } - - /** - * @param value {@link #definition} (Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public ElementDefinition setDefinitionElement(StringType value) { - this.definition = value; - return this; - } - - /** - * @return Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. - */ - public String getDefinition() { - return this.definition == null ? null : this.definition.getValue(); - } - - /** - * @param value Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. - */ - public ElementDefinition setDefinition(String value) { - if (Utilities.noString(value)) - this.definition = null; - else { - if (this.definition == null) - this.definition = new StringType(); - this.definition.setValue(value); - } - return this; - } - - /** - * @return {@link #comments} (Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public StringType getCommentsElement() { - if (this.comments == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.comments"); - else if (Configuration.doAutoCreate()) - this.comments = new StringType(); // bb - return this.comments; - } - - public boolean hasCommentsElement() { - return this.comments != null && !this.comments.isEmpty(); - } - - public boolean hasComments() { - return this.comments != null && !this.comments.isEmpty(); - } - - /** - * @param value {@link #comments} (Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public ElementDefinition setCommentsElement(StringType value) { - this.comments = value; - return this; - } - - /** - * @return Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc. - */ - public String getComments() { - return this.comments == null ? null : this.comments.getValue(); - } - - /** - * @param value Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc. - */ - public ElementDefinition setComments(String value) { - if (Utilities.noString(value)) - this.comments = null; - else { - if (this.comments == null) - this.comments = new StringType(); - this.comments.setValue(value); - } - return this; - } - - /** - * @return {@link #requirements} (This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); // bb - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public ElementDefinition setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element. - */ - public ElementDefinition setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #alias} (Identifies additional names by which this element might also be known.) - */ - public List getAlias() { - if (this.alias == null) - this.alias = new ArrayList(); - return this.alias; - } - - public boolean hasAlias() { - if (this.alias == null) - return false; - for (StringType item : this.alias) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #alias} (Identifies additional names by which this element might also be known.) - */ - // syntactic sugar - public StringType addAliasElement() {//2 - StringType t = new StringType(); - if (this.alias == null) - this.alias = new ArrayList(); - this.alias.add(t); - return t; - } - - /** - * @param value {@link #alias} (Identifies additional names by which this element might also be known.) - */ - public ElementDefinition addAlias(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.alias == null) - this.alias = new ArrayList(); - this.alias.add(t); - return this; - } - - /** - * @param value {@link #alias} (Identifies additional names by which this element might also be known.) - */ - public boolean hasAlias(String value) { - if (this.alias == null) - return false; - for (StringType v : this.alias) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #min} (The minimum number of times this element SHALL appear in the instance.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value - */ - public IntegerType getMinElement() { - if (this.min == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.min"); - else if (Configuration.doAutoCreate()) - this.min = new IntegerType(); // bb - return this.min; - } - - public boolean hasMinElement() { - return this.min != null && !this.min.isEmpty(); - } - - public boolean hasMin() { - return this.min != null && !this.min.isEmpty(); - } - - /** - * @param value {@link #min} (The minimum number of times this element SHALL appear in the instance.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value - */ - public ElementDefinition setMinElement(IntegerType value) { - this.min = value; - return this; - } - - /** - * @return The minimum number of times this element SHALL appear in the instance. - */ - public int getMin() { - return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue(); - } - - /** - * @param value The minimum number of times this element SHALL appear in the instance. - */ - public ElementDefinition setMin(int value) { - if (this.min == null) - this.min = new IntegerType(); - this.min.setValue(value); - return this; - } - - /** - * @return {@link #max} (The maximum number of times this element is permitted to appear in the instance.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value - */ - public StringType getMaxElement() { - if (this.max == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.max"); - else if (Configuration.doAutoCreate()) - this.max = new StringType(); // bb - return this.max; - } - - public boolean hasMaxElement() { - return this.max != null && !this.max.isEmpty(); - } - - public boolean hasMax() { - return this.max != null && !this.max.isEmpty(); - } - - /** - * @param value {@link #max} (The maximum number of times this element is permitted to appear in the instance.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value - */ - public ElementDefinition setMaxElement(StringType value) { - this.max = value; - return this; - } - - /** - * @return The maximum number of times this element is permitted to appear in the instance. - */ - public String getMax() { - return this.max == null ? null : this.max.getValue(); - } - - /** - * @param value The maximum number of times this element is permitted to appear in the instance. - */ - public ElementDefinition setMax(String value) { - if (Utilities.noString(value)) - this.max = null; - else { - if (this.max == null) - this.max = new StringType(); - this.max.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The data type or resource that the value of this element is permitted to be.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (TypeRefComponent item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (The data type or resource that the value of this element is permitted to be.) - */ - // syntactic sugar - public TypeRefComponent addType() { //3 - TypeRefComponent t = new TypeRefComponent(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - // syntactic sugar - public ElementDefinition addType(TypeRefComponent t) { //3 - if (t == null) - return this; - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - /** - * @return {@link #nameReference} (Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element.). This is the underlying object with id, value and extensions. The accessor "getNameReference" gives direct access to the value - */ - public StringType getNameReferenceElement() { - if (this.nameReference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.nameReference"); - else if (Configuration.doAutoCreate()) - this.nameReference = new StringType(); // bb - return this.nameReference; - } - - public boolean hasNameReferenceElement() { - return this.nameReference != null && !this.nameReference.isEmpty(); - } - - public boolean hasNameReference() { - return this.nameReference != null && !this.nameReference.isEmpty(); - } - - /** - * @param value {@link #nameReference} (Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element.). This is the underlying object with id, value and extensions. The accessor "getNameReference" gives direct access to the value - */ - public ElementDefinition setNameReferenceElement(StringType value) { - this.nameReference = value; - return this; - } - - /** - * @return Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element. - */ - public String getNameReference() { - return this.nameReference == null ? null : this.nameReference.getValue(); - } - - /** - * @param value Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element. - */ - public ElementDefinition setNameReference(String value) { - if (Utilities.noString(value)) - this.nameReference = null; - else { - if (this.nameReference == null) - this.nameReference = new StringType(); - this.nameReference.setValue(value); - } - return this; - } - - /** - * @return {@link #defaultValue} (The value that should be used if there is no value stated in the instance.) - */ - public org.hl7.fhir.instance.model.Type getDefaultValue() { - return this.defaultValue; - } - - public boolean hasDefaultValue() { - return this.defaultValue != null && !this.defaultValue.isEmpty(); - } - - /** - * @param value {@link #defaultValue} (The value that should be used if there is no value stated in the instance.) - */ - public ElementDefinition setDefaultValue(org.hl7.fhir.instance.model.Type value) { - this.defaultValue = value; - return this; - } - - /** - * @return {@link #meaningWhenMissing} (The Implicit meaning that is to be understood when this element is missing.). This is the underlying object with id, value and extensions. The accessor "getMeaningWhenMissing" gives direct access to the value - */ - public StringType getMeaningWhenMissingElement() { - if (this.meaningWhenMissing == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.meaningWhenMissing"); - else if (Configuration.doAutoCreate()) - this.meaningWhenMissing = new StringType(); // bb - return this.meaningWhenMissing; - } - - public boolean hasMeaningWhenMissingElement() { - return this.meaningWhenMissing != null && !this.meaningWhenMissing.isEmpty(); - } - - public boolean hasMeaningWhenMissing() { - return this.meaningWhenMissing != null && !this.meaningWhenMissing.isEmpty(); - } - - /** - * @param value {@link #meaningWhenMissing} (The Implicit meaning that is to be understood when this element is missing.). This is the underlying object with id, value and extensions. The accessor "getMeaningWhenMissing" gives direct access to the value - */ - public ElementDefinition setMeaningWhenMissingElement(StringType value) { - this.meaningWhenMissing = value; - return this; - } - - /** - * @return The Implicit meaning that is to be understood when this element is missing. - */ - public String getMeaningWhenMissing() { - return this.meaningWhenMissing == null ? null : this.meaningWhenMissing.getValue(); - } - - /** - * @param value The Implicit meaning that is to be understood when this element is missing. - */ - public ElementDefinition setMeaningWhenMissing(String value) { - if (Utilities.noString(value)) - this.meaningWhenMissing = null; - else { - if (this.meaningWhenMissing == null) - this.meaningWhenMissing = new StringType(); - this.meaningWhenMissing.setValue(value); - } - return this; - } - - /** - * @return {@link #fixed} (Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.) - */ - public org.hl7.fhir.instance.model.Type getFixed() { - return this.fixed; - } - - public boolean hasFixed() { - return this.fixed != null && !this.fixed.isEmpty(); - } - - /** - * @param value {@link #fixed} (Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.) - */ - public ElementDefinition setFixed(org.hl7.fhir.instance.model.Type value) { - this.fixed = value; - return this; - } - - /** - * @return {@link #pattern} (Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.).) - */ - public org.hl7.fhir.instance.model.Type getPattern() { - return this.pattern; - } - - public boolean hasPattern() { - return this.pattern != null && !this.pattern.isEmpty(); - } - - /** - * @param value {@link #pattern} (Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.).) - */ - public ElementDefinition setPattern(org.hl7.fhir.instance.model.Type value) { - this.pattern = value; - return this; - } - - /** - * @return {@link #example} (A sample value for this element demonstrating the type of information that would typically be captured.) - */ - public org.hl7.fhir.instance.model.Type getExample() { - return this.example; - } - - public boolean hasExample() { - return this.example != null && !this.example.isEmpty(); - } - - /** - * @param value {@link #example} (A sample value for this element demonstrating the type of information that would typically be captured.) - */ - public ElementDefinition setExample(org.hl7.fhir.instance.model.Type value) { - this.example = value; - return this; - } - - /** - * @return {@link #maxLength} (Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value - */ - public IntegerType getMaxLengthElement() { - if (this.maxLength == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.maxLength"); - else if (Configuration.doAutoCreate()) - this.maxLength = new IntegerType(); // bb - return this.maxLength; - } - - public boolean hasMaxLengthElement() { - return this.maxLength != null && !this.maxLength.isEmpty(); - } - - public boolean hasMaxLength() { - return this.maxLength != null && !this.maxLength.isEmpty(); - } - - /** - * @param value {@link #maxLength} (Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value - */ - public ElementDefinition setMaxLengthElement(IntegerType value) { - this.maxLength = value; - return this; - } - - /** - * @return Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. - */ - public int getMaxLength() { - return this.maxLength == null || this.maxLength.isEmpty() ? 0 : this.maxLength.getValue(); - } - - /** - * @param value Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. - */ - public ElementDefinition setMaxLength(int value) { - if (this.maxLength == null) - this.maxLength = new IntegerType(); - this.maxLength.setValue(value); - return this; - } - - /** - * @return {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) - */ - public List getCondition() { - if (this.condition == null) - this.condition = new ArrayList(); - return this.condition; - } - - public boolean hasCondition() { - if (this.condition == null) - return false; - for (IdType item : this.condition) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) - */ - // syntactic sugar - public IdType addConditionElement() {//2 - IdType t = new IdType(); - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return t; - } - - /** - * @param value {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) - */ - public ElementDefinition addCondition(String value) { //1 - IdType t = new IdType(); - t.setValue(value); - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return this; - } - - /** - * @param value {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) - */ - public boolean hasCondition(String value) { - if (this.condition == null) - return false; - for (IdType v : this.condition) - if (v.equals(value)) // id - return true; - return false; - } - - /** - * @return {@link #constraint} (Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.) - */ - public List getConstraint() { - if (this.constraint == null) - this.constraint = new ArrayList(); - return this.constraint; - } - - public boolean hasConstraint() { - if (this.constraint == null) - return false; - for (ElementDefinitionConstraintComponent item : this.constraint) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #constraint} (Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.) - */ - // syntactic sugar - public ElementDefinitionConstraintComponent addConstraint() { //3 - ElementDefinitionConstraintComponent t = new ElementDefinitionConstraintComponent(); - if (this.constraint == null) - this.constraint = new ArrayList(); - this.constraint.add(t); - return t; - } - - // syntactic sugar - public ElementDefinition addConstraint(ElementDefinitionConstraintComponent t) { //3 - if (t == null) - return this; - if (this.constraint == null) - this.constraint = new ArrayList(); - this.constraint.add(t); - return this; - } - - /** - * @return {@link #mustSupport} (If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported.). This is the underlying object with id, value and extensions. The accessor "getMustSupport" gives direct access to the value - */ - public BooleanType getMustSupportElement() { - if (this.mustSupport == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.mustSupport"); - else if (Configuration.doAutoCreate()) - this.mustSupport = new BooleanType(); // bb - return this.mustSupport; - } - - public boolean hasMustSupportElement() { - return this.mustSupport != null && !this.mustSupport.isEmpty(); - } - - public boolean hasMustSupport() { - return this.mustSupport != null && !this.mustSupport.isEmpty(); - } - - /** - * @param value {@link #mustSupport} (If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported.). This is the underlying object with id, value and extensions. The accessor "getMustSupport" gives direct access to the value - */ - public ElementDefinition setMustSupportElement(BooleanType value) { - this.mustSupport = value; - return this; - } - - /** - * @return If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported. - */ - public boolean getMustSupport() { - return this.mustSupport == null || this.mustSupport.isEmpty() ? false : this.mustSupport.getValue(); - } - - /** - * @param value If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported. - */ - public ElementDefinition setMustSupport(boolean value) { - if (this.mustSupport == null) - this.mustSupport = new BooleanType(); - this.mustSupport.setValue(value); - return this; - } - - /** - * @return {@link #isModifier} (If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.). This is the underlying object with id, value and extensions. The accessor "getIsModifier" gives direct access to the value - */ - public BooleanType getIsModifierElement() { - if (this.isModifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.isModifier"); - else if (Configuration.doAutoCreate()) - this.isModifier = new BooleanType(); // bb - return this.isModifier; - } - - public boolean hasIsModifierElement() { - return this.isModifier != null && !this.isModifier.isEmpty(); - } - - public boolean hasIsModifier() { - return this.isModifier != null && !this.isModifier.isEmpty(); - } - - /** - * @param value {@link #isModifier} (If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.). This is the underlying object with id, value and extensions. The accessor "getIsModifier" gives direct access to the value - */ - public ElementDefinition setIsModifierElement(BooleanType value) { - this.isModifier = value; - return this; - } - - /** - * @return If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. - */ - public boolean getIsModifier() { - return this.isModifier == null || this.isModifier.isEmpty() ? false : this.isModifier.getValue(); - } - - /** - * @param value If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. - */ - public ElementDefinition setIsModifier(boolean value) { - if (this.isModifier == null) - this.isModifier = new BooleanType(); - this.isModifier.setValue(value); - return this; - } - - /** - * @return {@link #isSummary} (Whether the element should be included if a client requests a search with the parameter _summary=true.). This is the underlying object with id, value and extensions. The accessor "getIsSummary" gives direct access to the value - */ - public BooleanType getIsSummaryElement() { - if (this.isSummary == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.isSummary"); - else if (Configuration.doAutoCreate()) - this.isSummary = new BooleanType(); // bb - return this.isSummary; - } - - public boolean hasIsSummaryElement() { - return this.isSummary != null && !this.isSummary.isEmpty(); - } - - public boolean hasIsSummary() { - return this.isSummary != null && !this.isSummary.isEmpty(); - } - - /** - * @param value {@link #isSummary} (Whether the element should be included if a client requests a search with the parameter _summary=true.). This is the underlying object with id, value and extensions. The accessor "getIsSummary" gives direct access to the value - */ - public ElementDefinition setIsSummaryElement(BooleanType value) { - this.isSummary = value; - return this; - } - - /** - * @return Whether the element should be included if a client requests a search with the parameter _summary=true. - */ - public boolean getIsSummary() { - return this.isSummary == null || this.isSummary.isEmpty() ? false : this.isSummary.getValue(); - } - - /** - * @param value Whether the element should be included if a client requests a search with the parameter _summary=true. - */ - public ElementDefinition setIsSummary(boolean value) { - if (this.isSummary == null) - this.isSummary = new BooleanType(); - this.isSummary.setValue(value); - return this; - } - - /** - * @return {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept).) - */ - public ElementDefinitionBindingComponent getBinding() { - if (this.binding == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.binding"); - else if (Configuration.doAutoCreate()) - this.binding = new ElementDefinitionBindingComponent(); // cc - return this.binding; - } - - public boolean hasBinding() { - return this.binding != null && !this.binding.isEmpty(); - } - - /** - * @param value {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept).) - */ - public ElementDefinition setBinding(ElementDefinitionBindingComponent value) { - this.binding = value; - return this; - } - - /** - * @return {@link #mapping} (Identifies a concept from an external specification that roughly corresponds to this element.) - */ - public List getMapping() { - if (this.mapping == null) - this.mapping = new ArrayList(); - return this.mapping; - } - - public boolean hasMapping() { - if (this.mapping == null) - return false; - for (ElementDefinitionMappingComponent item : this.mapping) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #mapping} (Identifies a concept from an external specification that roughly corresponds to this element.) - */ - // syntactic sugar - public ElementDefinitionMappingComponent addMapping() { //3 - ElementDefinitionMappingComponent t = new ElementDefinitionMappingComponent(); - if (this.mapping == null) - this.mapping = new ArrayList(); - this.mapping.add(t); - return t; - } - - // syntactic sugar - public ElementDefinition addMapping(ElementDefinitionMappingComponent t) { //3 - if (t == null) - return this; - if (this.mapping == null) - this.mapping = new ArrayList(); - this.mapping.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("path", "string", "The path identifies the element and is expressed as a '.'-separated list of ancestor elements, beginning with the name of the resource or extension.", 0, java.lang.Integer.MAX_VALUE, path)); - childrenList.add(new Property("representation", "code", "Codes that define how this element is represented in instances, when the deviation varies from the normal case.", 0, java.lang.Integer.MAX_VALUE, representation)); - childrenList.add(new Property("name", "string", "The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("label", "string", "The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.", 0, java.lang.Integer.MAX_VALUE, label)); - childrenList.add(new Property("code", "Coding", "A code that provides the meaning for the element according to a particular terminology.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("slicing", "", "Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).", 0, java.lang.Integer.MAX_VALUE, slicing)); - childrenList.add(new Property("short", "string", "A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification).", 0, java.lang.Integer.MAX_VALUE, short_)); - childrenList.add(new Property("definition", "string", "Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.", 0, java.lang.Integer.MAX_VALUE, definition)); - childrenList.add(new Property("comments", "string", "Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc.", 0, java.lang.Integer.MAX_VALUE, comments)); - childrenList.add(new Property("requirements", "string", "This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("alias", "string", "Identifies additional names by which this element might also be known.", 0, java.lang.Integer.MAX_VALUE, alias)); - childrenList.add(new Property("min", "integer", "The minimum number of times this element SHALL appear in the instance.", 0, java.lang.Integer.MAX_VALUE, min)); - childrenList.add(new Property("max", "string", "The maximum number of times this element is permitted to appear in the instance.", 0, java.lang.Integer.MAX_VALUE, max)); - childrenList.add(new Property("type", "", "The data type or resource that the value of this element is permitted to be.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("nameReference", "string", "Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element.", 0, java.lang.Integer.MAX_VALUE, nameReference)); - childrenList.add(new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance.", 0, java.lang.Integer.MAX_VALUE, defaultValue)); - childrenList.add(new Property("meaningWhenMissing", "string", "The Implicit meaning that is to be understood when this element is missing.", 0, java.lang.Integer.MAX_VALUE, meaningWhenMissing)); - childrenList.add(new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, java.lang.Integer.MAX_VALUE, fixed)); - childrenList.add(new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.).", 0, java.lang.Integer.MAX_VALUE, pattern)); - childrenList.add(new Property("example[x]", "*", "A sample value for this element demonstrating the type of information that would typically be captured.", 0, java.lang.Integer.MAX_VALUE, example)); - childrenList.add(new Property("maxLength", "integer", "Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.", 0, java.lang.Integer.MAX_VALUE, maxLength)); - childrenList.add(new Property("condition", "id", "A reference to an invariant that may make additional statements about the cardinality or value in the instance.", 0, java.lang.Integer.MAX_VALUE, condition)); - childrenList.add(new Property("constraint", "", "Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.", 0, java.lang.Integer.MAX_VALUE, constraint)); - childrenList.add(new Property("mustSupport", "boolean", "If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported.", 0, java.lang.Integer.MAX_VALUE, mustSupport)); - childrenList.add(new Property("isModifier", "boolean", "If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.", 0, java.lang.Integer.MAX_VALUE, isModifier)); - childrenList.add(new Property("isSummary", "boolean", "Whether the element should be included if a client requests a search with the parameter _summary=true.", 0, java.lang.Integer.MAX_VALUE, isSummary)); - childrenList.add(new Property("binding", "", "Binds to a value set if this element is coded (code, Coding, CodeableConcept).", 0, java.lang.Integer.MAX_VALUE, binding)); - childrenList.add(new Property("mapping", "", "Identifies a concept from an external specification that roughly corresponds to this element.", 0, java.lang.Integer.MAX_VALUE, mapping)); - } - - public ElementDefinition copy() { - ElementDefinition dst = new ElementDefinition(); - copyValues(dst); - dst.path = path == null ? null : path.copy(); - if (representation != null) { - dst.representation = new ArrayList>(); - for (Enumeration i : representation) - dst.representation.add(i.copy()); - }; - dst.name = name == null ? null : name.copy(); - dst.label = label == null ? null : label.copy(); - if (code != null) { - dst.code = new ArrayList(); - for (Coding i : code) - dst.code.add(i.copy()); - }; - dst.slicing = slicing == null ? null : slicing.copy(); - dst.short_ = short_ == null ? null : short_.copy(); - dst.definition = definition == null ? null : definition.copy(); - dst.comments = comments == null ? null : comments.copy(); - dst.requirements = requirements == null ? null : requirements.copy(); - if (alias != null) { - dst.alias = new ArrayList(); - for (StringType i : alias) - dst.alias.add(i.copy()); - }; - dst.min = min == null ? null : min.copy(); - dst.max = max == null ? null : max.copy(); - if (type != null) { - dst.type = new ArrayList(); - for (TypeRefComponent i : type) - dst.type.add(i.copy()); - }; - dst.nameReference = nameReference == null ? null : nameReference.copy(); - dst.defaultValue = defaultValue == null ? null : defaultValue.copy(); - dst.meaningWhenMissing = meaningWhenMissing == null ? null : meaningWhenMissing.copy(); - dst.fixed = fixed == null ? null : fixed.copy(); - dst.pattern = pattern == null ? null : pattern.copy(); - dst.example = example == null ? null : example.copy(); - dst.maxLength = maxLength == null ? null : maxLength.copy(); - if (condition != null) { - dst.condition = new ArrayList(); - for (IdType i : condition) - dst.condition.add(i.copy()); - }; - if (constraint != null) { - dst.constraint = new ArrayList(); - for (ElementDefinitionConstraintComponent i : constraint) - dst.constraint.add(i.copy()); - }; - dst.mustSupport = mustSupport == null ? null : mustSupport.copy(); - dst.isModifier = isModifier == null ? null : isModifier.copy(); - dst.isSummary = isSummary == null ? null : isSummary.copy(); - dst.binding = binding == null ? null : binding.copy(); - if (mapping != null) { - dst.mapping = new ArrayList(); - for (ElementDefinitionMappingComponent i : mapping) - dst.mapping.add(i.copy()); - }; - return dst; - } - - protected ElementDefinition typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ElementDefinition)) - return false; - ElementDefinition o = (ElementDefinition) other; - return compareDeep(path, o.path, true) && compareDeep(representation, o.representation, true) && compareDeep(name, o.name, true) - && compareDeep(label, o.label, true) && compareDeep(code, o.code, true) && compareDeep(slicing, o.slicing, true) - && compareDeep(short_, o.short_, true) && compareDeep(definition, o.definition, true) && compareDeep(comments, o.comments, true) - && compareDeep(requirements, o.requirements, true) && compareDeep(alias, o.alias, true) && compareDeep(min, o.min, true) - && compareDeep(max, o.max, true) && compareDeep(type, o.type, true) && compareDeep(nameReference, o.nameReference, true) - && compareDeep(defaultValue, o.defaultValue, true) && compareDeep(meaningWhenMissing, o.meaningWhenMissing, true) - && compareDeep(fixed, o.fixed, true) && compareDeep(pattern, o.pattern, true) && compareDeep(example, o.example, true) - && compareDeep(maxLength, o.maxLength, true) && compareDeep(condition, o.condition, true) && compareDeep(constraint, o.constraint, true) - && compareDeep(mustSupport, o.mustSupport, true) && compareDeep(isModifier, o.isModifier, true) - && compareDeep(isSummary, o.isSummary, true) && compareDeep(binding, o.binding, true) && compareDeep(mapping, o.mapping, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ElementDefinition)) - return false; - ElementDefinition o = (ElementDefinition) other; - return compareValues(path, o.path, true) && compareValues(representation, o.representation, true) && compareValues(name, o.name, true) - && compareValues(label, o.label, true) && compareValues(short_, o.short_, true) && compareValues(definition, o.definition, true) - && compareValues(comments, o.comments, true) && compareValues(requirements, o.requirements, true) && compareValues(alias, o.alias, true) - && compareValues(min, o.min, true) && compareValues(max, o.max, true) && compareValues(nameReference, o.nameReference, true) - && compareValues(meaningWhenMissing, o.meaningWhenMissing, true) && compareValues(maxLength, o.maxLength, true) - && compareValues(condition, o.condition, true) && compareValues(mustSupport, o.mustSupport, true) && compareValues(isModifier, o.isModifier, true) - && compareValues(isSummary, o.isSummary, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (path == null || path.isEmpty()) && (representation == null || representation.isEmpty()) - && (name == null || name.isEmpty()) && (label == null || label.isEmpty()) && (code == null || code.isEmpty()) - && (slicing == null || slicing.isEmpty()) && (short_ == null || short_.isEmpty()) && (definition == null || definition.isEmpty()) - && (comments == null || comments.isEmpty()) && (requirements == null || requirements.isEmpty()) - && (alias == null || alias.isEmpty()) && (min == null || min.isEmpty()) && (max == null || max.isEmpty()) - && (type == null || type.isEmpty()) && (nameReference == null || nameReference.isEmpty()) - && (defaultValue == null || defaultValue.isEmpty()) && (meaningWhenMissing == null || meaningWhenMissing.isEmpty()) - && (fixed == null || fixed.isEmpty()) && (pattern == null || pattern.isEmpty()) && (example == null || example.isEmpty()) - && (maxLength == null || maxLength.isEmpty()) && (condition == null || condition.isEmpty()) - && (constraint == null || constraint.isEmpty()) && (mustSupport == null || mustSupport.isEmpty()) - && (isModifier == null || isModifier.isEmpty()) && (isSummary == null || isSummary.isEmpty()) - && (binding == null || binding.isEmpty()) && (mapping == null || mapping.isEmpty()); - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Captures constraints on each element within the resource, profile, or extension. + */ +@DatatypeDef(name="ElementDefinition") +public class ElementDefinition extends Type implements ICompositeType { + + public enum PropertyRepresentation { + /** + * In XML, this property is represented as an attribute not an element. + */ + XMLATTR, + /** + * added to help the parsers + */ + NULL; + public static PropertyRepresentation fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("xmlAttr".equals(codeString)) + return XMLATTR; + throw new Exception("Unknown PropertyRepresentation code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case XMLATTR: return "xmlAttr"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case XMLATTR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case XMLATTR: return "In XML, this property is represented as an attribute not an element."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case XMLATTR: return "Xml Attr"; + default: return "?"; + } + } + } + + public static class PropertyRepresentationEnumFactory implements EnumFactory { + public PropertyRepresentation fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("xmlAttr".equals(codeString)) + return PropertyRepresentation.XMLATTR; + throw new IllegalArgumentException("Unknown PropertyRepresentation code '"+codeString+"'"); + } + public String toCode(PropertyRepresentation code) { + if (code == PropertyRepresentation.XMLATTR) + return "xmlAttr"; + return "?"; + } + } + + public enum ResourceSlicingRules { + /** + * No additional content is allowed other than that described by the slices in this profile. + */ + CLOSED, + /** + * Additional content is allowed anywhere in the list. + */ + OPEN, + /** + * Additional content is allowed, but only at the end of the list. Note that using this requires that the slices be ordered, which makes it hard to share uses. This should only be done where absolutely required. + */ + OPENATEND, + /** + * added to help the parsers + */ + NULL; + public static ResourceSlicingRules fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("closed".equals(codeString)) + return CLOSED; + if ("open".equals(codeString)) + return OPEN; + if ("openAtEnd".equals(codeString)) + return OPENATEND; + throw new Exception("Unknown ResourceSlicingRules code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CLOSED: return "closed"; + case OPEN: return "open"; + case OPENATEND: return "openAtEnd"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CLOSED: return ""; + case OPEN: return ""; + case OPENATEND: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CLOSED: return "No additional content is allowed other than that described by the slices in this profile."; + case OPEN: return "Additional content is allowed anywhere in the list."; + case OPENATEND: return "Additional content is allowed, but only at the end of the list. Note that using this requires that the slices be ordered, which makes it hard to share uses. This should only be done where absolutely required."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CLOSED: return "Closed"; + case OPEN: return "Open"; + case OPENATEND: return "Open At End"; + default: return "?"; + } + } + } + + public static class ResourceSlicingRulesEnumFactory implements EnumFactory { + public ResourceSlicingRules fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("closed".equals(codeString)) + return ResourceSlicingRules.CLOSED; + if ("open".equals(codeString)) + return ResourceSlicingRules.OPEN; + if ("openAtEnd".equals(codeString)) + return ResourceSlicingRules.OPENATEND; + throw new IllegalArgumentException("Unknown ResourceSlicingRules code '"+codeString+"'"); + } + public String toCode(ResourceSlicingRules code) { + if (code == ResourceSlicingRules.CLOSED) + return "closed"; + if (code == ResourceSlicingRules.OPEN) + return "open"; + if (code == ResourceSlicingRules.OPENATEND) + return "openAtEnd"; + return "?"; + } + } + + public enum ResourceAggregationMode { + /** + * The reference is a local reference to a contained resource. + */ + CONTAINED, + /** + * The reference to a resource that has to be resolved externally to the resource that includes the reference. + */ + REFERENCED, + /** + * The resource the reference points to will be found in the same bundle as the resource that includes the reference. + */ + BUNDLED, + /** + * added to help the parsers + */ + NULL; + public static ResourceAggregationMode fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("contained".equals(codeString)) + return CONTAINED; + if ("referenced".equals(codeString)) + return REFERENCED; + if ("bundled".equals(codeString)) + return BUNDLED; + throw new Exception("Unknown ResourceAggregationMode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CONTAINED: return "contained"; + case REFERENCED: return "referenced"; + case BUNDLED: return "bundled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CONTAINED: return ""; + case REFERENCED: return ""; + case BUNDLED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CONTAINED: return "The reference is a local reference to a contained resource."; + case REFERENCED: return "The reference to a resource that has to be resolved externally to the resource that includes the reference."; + case BUNDLED: return "The resource the reference points to will be found in the same bundle as the resource that includes the reference."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CONTAINED: return "Contained"; + case REFERENCED: return "Referenced"; + case BUNDLED: return "Bundled"; + default: return "?"; + } + } + } + + public static class ResourceAggregationModeEnumFactory implements EnumFactory { + public ResourceAggregationMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("contained".equals(codeString)) + return ResourceAggregationMode.CONTAINED; + if ("referenced".equals(codeString)) + return ResourceAggregationMode.REFERENCED; + if ("bundled".equals(codeString)) + return ResourceAggregationMode.BUNDLED; + throw new IllegalArgumentException("Unknown ResourceAggregationMode code '"+codeString+"'"); + } + public String toCode(ResourceAggregationMode code) { + if (code == ResourceAggregationMode.CONTAINED) + return "contained"; + if (code == ResourceAggregationMode.REFERENCED) + return "referenced"; + if (code == ResourceAggregationMode.BUNDLED) + return "bundled"; + return "?"; + } + } + + public enum ConstraintSeverity { + /** + * If the constraint is violated, the resource is not conformant. + */ + ERROR, + /** + * If the constraint is violated, the resource is conformant, but it is not necessarily following best practice. + */ + WARNING, + /** + * added to help the parsers + */ + NULL; + public static ConstraintSeverity fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("error".equals(codeString)) + return ERROR; + if ("warning".equals(codeString)) + return WARNING; + throw new Exception("Unknown ConstraintSeverity code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ERROR: return "error"; + case WARNING: return "warning"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ERROR: return ""; + case WARNING: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ERROR: return "If the constraint is violated, the resource is not conformant."; + case WARNING: return "If the constraint is violated, the resource is conformant, but it is not necessarily following best practice."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ERROR: return "Error"; + case WARNING: return "Warning"; + default: return "?"; + } + } + } + + public static class ConstraintSeverityEnumFactory implements EnumFactory { + public ConstraintSeverity fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("error".equals(codeString)) + return ConstraintSeverity.ERROR; + if ("warning".equals(codeString)) + return ConstraintSeverity.WARNING; + throw new IllegalArgumentException("Unknown ConstraintSeverity code '"+codeString+"'"); + } + public String toCode(ConstraintSeverity code) { + if (code == ConstraintSeverity.ERROR) + return "error"; + if (code == ConstraintSeverity.WARNING) + return "warning"; + return "?"; + } + } + + public enum BindingStrength { + /** + * To be conformant, instances of this element SHALL include a code from the specified value set. + */ + REQUIRED, + /** + * To be conformant, instances of this element SHALL include a code from the specified value set if any of the codes within the value set can apply to the concept being communicated. If the valueset does not cover the concept (based on human review), alternate codings (or, data type allowing, text) may be included instead. + */ + EXTENSIBLE, + /** + * Instances are encouraged to draw from the specified codes for interoperability purposes but are not required to do so to be considered conformant. + */ + PREFERRED, + /** + * Instances are not expected or even encouraged to draw from the specified value set. The value set merely provides examples of the types of concepts intended to be included. + */ + EXAMPLE, + /** + * added to help the parsers + */ + NULL; + public static BindingStrength fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("required".equals(codeString)) + return REQUIRED; + if ("extensible".equals(codeString)) + return EXTENSIBLE; + if ("preferred".equals(codeString)) + return PREFERRED; + if ("example".equals(codeString)) + return EXAMPLE; + throw new Exception("Unknown BindingStrength code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case REQUIRED: return "required"; + case EXTENSIBLE: return "extensible"; + case PREFERRED: return "preferred"; + case EXAMPLE: return "example"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REQUIRED: return ""; + case EXTENSIBLE: return ""; + case PREFERRED: return ""; + case EXAMPLE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REQUIRED: return "To be conformant, instances of this element SHALL include a code from the specified value set."; + case EXTENSIBLE: return "To be conformant, instances of this element SHALL include a code from the specified value set if any of the codes within the value set can apply to the concept being communicated. If the valueset does not cover the concept (based on human review), alternate codings (or, data type allowing, text) may be included instead."; + case PREFERRED: return "Instances are encouraged to draw from the specified codes for interoperability purposes but are not required to do so to be considered conformant."; + case EXAMPLE: return "Instances are not expected or even encouraged to draw from the specified value set. The value set merely provides examples of the types of concepts intended to be included."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REQUIRED: return "Required"; + case EXTENSIBLE: return "Extensible"; + case PREFERRED: return "Preferred"; + case EXAMPLE: return "Example"; + default: return "?"; + } + } + } + + public static class BindingStrengthEnumFactory implements EnumFactory { + public BindingStrength fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("required".equals(codeString)) + return BindingStrength.REQUIRED; + if ("extensible".equals(codeString)) + return BindingStrength.EXTENSIBLE; + if ("preferred".equals(codeString)) + return BindingStrength.PREFERRED; + if ("example".equals(codeString)) + return BindingStrength.EXAMPLE; + throw new IllegalArgumentException("Unknown BindingStrength code '"+codeString+"'"); + } + public String toCode(BindingStrength code) { + if (code == BindingStrength.REQUIRED) + return "required"; + if (code == BindingStrength.EXTENSIBLE) + return "extensible"; + if (code == BindingStrength.PREFERRED) + return "preferred"; + if (code == BindingStrength.EXAMPLE) + return "example"; + return "?"; + } + } + + @Block() + public static class ElementDefinitionSlicingComponent extends Element implements IBaseDatatypeElement { + /** + * Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices. + */ + @Child(name = "discriminator", type = {StringType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Element values that used to distinguish the slices", formalDefinition="Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices." ) + protected List discriminator; + + /** + * A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated. + */ + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Text description of how slicing works (or not)", formalDefinition="A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated." ) + protected StringType description; + + /** + * If the matching elements have to occur in the same order as defined in the profile. + */ + @Child(name = "ordered", type = {BooleanType.class}, order=3, min=0, max=1) + @Description(shortDefinition="If elements must be in same order as slices", formalDefinition="If the matching elements have to occur in the same order as defined in the profile." ) + protected BooleanType ordered; + + /** + * Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end. + */ + @Child(name = "rules", type = {CodeType.class}, order=4, min=1, max=1) + @Description(shortDefinition="closed | open | openAtEnd", formalDefinition="Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end." ) + protected Enumeration rules; + + private static final long serialVersionUID = -321298491L; + + /* + * Constructor + */ + public ElementDefinitionSlicingComponent() { + super(); + } + + /* + * Constructor + */ + public ElementDefinitionSlicingComponent(Enumeration rules) { + super(); + this.rules = rules; + } + + /** + * @return {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) + */ + public List getDiscriminator() { + if (this.discriminator == null) + this.discriminator = new ArrayList(); + return this.discriminator; + } + + public boolean hasDiscriminator() { + if (this.discriminator == null) + return false; + for (StringType item : this.discriminator) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) + */ + // syntactic sugar + public StringType addDiscriminatorElement() {//2 + StringType t = new StringType(); + if (this.discriminator == null) + this.discriminator = new ArrayList(); + this.discriminator.add(t); + return t; + } + + /** + * @param value {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) + */ + public ElementDefinitionSlicingComponent addDiscriminator(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.discriminator == null) + this.discriminator = new ArrayList(); + this.discriminator.add(t); + return this; + } + + /** + * @param value {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) + */ + public boolean hasDiscriminator(String value) { + if (this.discriminator == null) + return false; + for (StringType v : this.discriminator) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #description} (A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionSlicingComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ElementDefinitionSlicingComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated. + */ + public ElementDefinitionSlicingComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #ordered} (If the matching elements have to occur in the same order as defined in the profile.). This is the underlying object with id, value and extensions. The accessor "getOrdered" gives direct access to the value + */ + public BooleanType getOrderedElement() { + if (this.ordered == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionSlicingComponent.ordered"); + else if (Configuration.doAutoCreate()) + this.ordered = new BooleanType(); // bb + return this.ordered; + } + + public boolean hasOrderedElement() { + return this.ordered != null && !this.ordered.isEmpty(); + } + + public boolean hasOrdered() { + return this.ordered != null && !this.ordered.isEmpty(); + } + + /** + * @param value {@link #ordered} (If the matching elements have to occur in the same order as defined in the profile.). This is the underlying object with id, value and extensions. The accessor "getOrdered" gives direct access to the value + */ + public ElementDefinitionSlicingComponent setOrderedElement(BooleanType value) { + this.ordered = value; + return this; + } + + /** + * @return If the matching elements have to occur in the same order as defined in the profile. + */ + public boolean getOrdered() { + return this.ordered == null || this.ordered.isEmpty() ? false : this.ordered.getValue(); + } + + /** + * @param value If the matching elements have to occur in the same order as defined in the profile. + */ + public ElementDefinitionSlicingComponent setOrdered(boolean value) { + if (this.ordered == null) + this.ordered = new BooleanType(); + this.ordered.setValue(value); + return this; + } + + /** + * @return {@link #rules} (Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.). This is the underlying object with id, value and extensions. The accessor "getRules" gives direct access to the value + */ + public Enumeration getRulesElement() { + if (this.rules == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionSlicingComponent.rules"); + else if (Configuration.doAutoCreate()) + this.rules = new Enumeration(new ResourceSlicingRulesEnumFactory()); // bb + return this.rules; + } + + public boolean hasRulesElement() { + return this.rules != null && !this.rules.isEmpty(); + } + + public boolean hasRules() { + return this.rules != null && !this.rules.isEmpty(); + } + + /** + * @param value {@link #rules} (Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.). This is the underlying object with id, value and extensions. The accessor "getRules" gives direct access to the value + */ + public ElementDefinitionSlicingComponent setRulesElement(Enumeration value) { + this.rules = value; + return this; + } + + /** + * @return Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end. + */ + public ResourceSlicingRules getRules() { + return this.rules == null ? null : this.rules.getValue(); + } + + /** + * @param value Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end. + */ + public ElementDefinitionSlicingComponent setRules(ResourceSlicingRules value) { + if (this.rules == null) + this.rules = new Enumeration(new ResourceSlicingRulesEnumFactory()); + this.rules.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("discriminator", "string", "Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.", 0, java.lang.Integer.MAX_VALUE, discriminator)); + childrenList.add(new Property("description", "string", "A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("ordered", "boolean", "If the matching elements have to occur in the same order as defined in the profile.", 0, java.lang.Integer.MAX_VALUE, ordered)); + childrenList.add(new Property("rules", "code", "Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.", 0, java.lang.Integer.MAX_VALUE, rules)); + } + + public ElementDefinitionSlicingComponent copy() { + ElementDefinitionSlicingComponent dst = new ElementDefinitionSlicingComponent(); + copyValues(dst); + if (discriminator != null) { + dst.discriminator = new ArrayList(); + for (StringType i : discriminator) + dst.discriminator.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + dst.ordered = ordered == null ? null : ordered.copy(); + dst.rules = rules == null ? null : rules.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ElementDefinitionSlicingComponent)) + return false; + ElementDefinitionSlicingComponent o = (ElementDefinitionSlicingComponent) other; + return compareDeep(discriminator, o.discriminator, true) && compareDeep(description, o.description, true) + && compareDeep(ordered, o.ordered, true) && compareDeep(rules, o.rules, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ElementDefinitionSlicingComponent)) + return false; + ElementDefinitionSlicingComponent o = (ElementDefinitionSlicingComponent) other; + return compareValues(discriminator, o.discriminator, true) && compareValues(description, o.description, true) + && compareValues(ordered, o.ordered, true) && compareValues(rules, o.rules, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (discriminator == null || discriminator.isEmpty()) && (description == null || description.isEmpty()) + && (ordered == null || ordered.isEmpty()) && (rules == null || rules.isEmpty()); + } + + } + + @Block() + public static class TypeRefComponent extends Element implements IBaseDatatypeElement { + /** + * Name of Data type or Resource that is a(or the) type used for this element. + */ + @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Name of Data type or Resource", formalDefinition="Name of Data type or Resource that is a(or the) type used for this element." ) + protected CodeType code; + + /** + * Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. + */ + @Child(name = "profile", type = {UriType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Profile.structure to apply", formalDefinition="Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile." ) + protected UriType profile; + + /** + * If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle. + */ + @Child(name = "aggregation", type = {CodeType.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="contained | referenced | bundled - how aggregated", formalDefinition="If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle." ) + protected List> aggregation; + + private static final long serialVersionUID = -1527133887L; + + /* + * Constructor + */ + public TypeRefComponent() { + super(); + } + + /* + * Constructor + */ + public TypeRefComponent(CodeType code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Name of Data type or Resource that is a(or the) type used for this element.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TypeRefComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Name of Data type or Resource that is a(or the) type used for this element.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public TypeRefComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return Name of Data type or Resource that is a(or the) type used for this element. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Name of Data type or Resource that is a(or the) type used for this element. + */ + public TypeRefComponent setCode(String value) { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #profile} (Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile.). This is the underlying object with id, value and extensions. The accessor "getProfile" gives direct access to the value + */ + public UriType getProfileElement() { + if (this.profile == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TypeRefComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profile = new UriType(); // bb + return this.profile; + } + + public boolean hasProfileElement() { + return this.profile != null && !this.profile.isEmpty(); + } + + public boolean hasProfile() { + return this.profile != null && !this.profile.isEmpty(); + } + + /** + * @param value {@link #profile} (Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile.). This is the underlying object with id, value and extensions. The accessor "getProfile" gives direct access to the value + */ + public TypeRefComponent setProfileElement(UriType value) { + this.profile = value; + return this; + } + + /** + * @return Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. + */ + public String getProfile() { + return this.profile == null ? null : this.profile.getValue(); + } + + /** + * @param value Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. + */ + public TypeRefComponent setProfile(String value) { + if (Utilities.noString(value)) + this.profile = null; + else { + if (this.profile == null) + this.profile = new UriType(); + this.profile.setValue(value); + } + return this; + } + + /** + * @return {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) + */ + public List> getAggregation() { + if (this.aggregation == null) + this.aggregation = new ArrayList>(); + return this.aggregation; + } + + public boolean hasAggregation() { + if (this.aggregation == null) + return false; + for (Enumeration item : this.aggregation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) + */ + // syntactic sugar + public Enumeration addAggregationElement() {//2 + Enumeration t = new Enumeration(new ResourceAggregationModeEnumFactory()); + if (this.aggregation == null) + this.aggregation = new ArrayList>(); + this.aggregation.add(t); + return t; + } + + /** + * @param value {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) + */ + public TypeRefComponent addAggregation(ResourceAggregationMode value) { //1 + Enumeration t = new Enumeration(new ResourceAggregationModeEnumFactory()); + t.setValue(value); + if (this.aggregation == null) + this.aggregation = new ArrayList>(); + this.aggregation.add(t); + return this; + } + + /** + * @param value {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) + */ + public boolean hasAggregation(ResourceAggregationMode value) { + if (this.aggregation == null) + return false; + for (Enumeration v : this.aggregation) + if (v.equals(value)) // code + return true; + return false; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "Name of Data type or Resource that is a(or the) type used for this element.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("profile", "uri", "Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile.", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("aggregation", "code", "If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.", 0, java.lang.Integer.MAX_VALUE, aggregation)); + } + + public TypeRefComponent copy() { + TypeRefComponent dst = new TypeRefComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.profile = profile == null ? null : profile.copy(); + if (aggregation != null) { + dst.aggregation = new ArrayList>(); + for (Enumeration i : aggregation) + dst.aggregation.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TypeRefComponent)) + return false; + TypeRefComponent o = (TypeRefComponent) other; + return compareDeep(code, o.code, true) && compareDeep(profile, o.profile, true) && compareDeep(aggregation, o.aggregation, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TypeRefComponent)) + return false; + TypeRefComponent o = (TypeRefComponent) other; + return compareValues(code, o.code, true) && compareValues(profile, o.profile, true) && compareValues(aggregation, o.aggregation, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (profile == null || profile.isEmpty()) + && (aggregation == null || aggregation.isEmpty()); + } + + } + + @Block() + public static class ElementDefinitionConstraintComponent extends Element implements IBaseDatatypeElement { + /** + * Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality. + */ + @Child(name = "key", type = {IdType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Target of 'condition' reference above", formalDefinition="Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality." ) + protected IdType key; + + /** + * Used to label the constraint in OCL or in short displays incapable of displaying the full human description. + */ + @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Short human label", formalDefinition="Used to label the constraint in OCL or in short displays incapable of displaying the full human description." ) + protected StringType name; + + /** + * Identifies the impact constraint violation has on the conformance of the instance. + */ + @Child(name = "severity", type = {CodeType.class}, order=3, min=1, max=1) + @Description(shortDefinition="error | warning", formalDefinition="Identifies the impact constraint violation has on the conformance of the instance." ) + protected Enumeration severity; + + /** + * Text that can be used to describe the constraint in messages identifying that the constraint has been violated. + */ + @Child(name = "human", type = {StringType.class}, order=4, min=1, max=1) + @Description(shortDefinition="Human description of constraint", formalDefinition="Text that can be used to describe the constraint in messages identifying that the constraint has been violated." ) + protected StringType human; + + /** + * An XPath expression of constraint that can be executed to see if this constraint is met. + */ + @Child(name = "xpath", type = {StringType.class}, order=5, min=1, max=1) + @Description(shortDefinition="XPath expression of constraint", formalDefinition="An XPath expression of constraint that can be executed to see if this constraint is met." ) + protected StringType xpath; + + private static final long serialVersionUID = -1195616532L; + + /* + * Constructor + */ + public ElementDefinitionConstraintComponent() { + super(); + } + + /* + * Constructor + */ + public ElementDefinitionConstraintComponent(IdType key, Enumeration severity, StringType human, StringType xpath) { + super(); + this.key = key; + this.severity = severity; + this.human = human; + this.xpath = xpath; + } + + /** + * @return {@link #key} (Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality.). This is the underlying object with id, value and extensions. The accessor "getKey" gives direct access to the value + */ + public IdType getKeyElement() { + if (this.key == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.key"); + else if (Configuration.doAutoCreate()) + this.key = new IdType(); // bb + return this.key; + } + + public boolean hasKeyElement() { + return this.key != null && !this.key.isEmpty(); + } + + public boolean hasKey() { + return this.key != null && !this.key.isEmpty(); + } + + /** + * @param value {@link #key} (Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality.). This is the underlying object with id, value and extensions. The accessor "getKey" gives direct access to the value + */ + public ElementDefinitionConstraintComponent setKeyElement(IdType value) { + this.key = value; + return this; + } + + /** + * @return Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality. + */ + public String getKey() { + return this.key == null ? null : this.key.getValue(); + } + + /** + * @param value Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality. + */ + public ElementDefinitionConstraintComponent setKey(String value) { + if (this.key == null) + this.key = new IdType(); + this.key.setValue(value); + return this; + } + + /** + * @return {@link #name} (Used to label the constraint in OCL or in short displays incapable of displaying the full human description.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (Used to label the constraint in OCL or in short displays incapable of displaying the full human description.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ElementDefinitionConstraintComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Used to label the constraint in OCL or in short displays incapable of displaying the full human description. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Used to label the constraint in OCL or in short displays incapable of displaying the full human description. + */ + public ElementDefinitionConstraintComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #severity} (Identifies the impact constraint violation has on the conformance of the instance.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public Enumeration getSeverityElement() { + if (this.severity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.severity"); + else if (Configuration.doAutoCreate()) + this.severity = new Enumeration(new ConstraintSeverityEnumFactory()); // bb + return this.severity; + } + + public boolean hasSeverityElement() { + return this.severity != null && !this.severity.isEmpty(); + } + + public boolean hasSeverity() { + return this.severity != null && !this.severity.isEmpty(); + } + + /** + * @param value {@link #severity} (Identifies the impact constraint violation has on the conformance of the instance.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public ElementDefinitionConstraintComponent setSeverityElement(Enumeration value) { + this.severity = value; + return this; + } + + /** + * @return Identifies the impact constraint violation has on the conformance of the instance. + */ + public ConstraintSeverity getSeverity() { + return this.severity == null ? null : this.severity.getValue(); + } + + /** + * @param value Identifies the impact constraint violation has on the conformance of the instance. + */ + public ElementDefinitionConstraintComponent setSeverity(ConstraintSeverity value) { + if (this.severity == null) + this.severity = new Enumeration(new ConstraintSeverityEnumFactory()); + this.severity.setValue(value); + return this; + } + + /** + * @return {@link #human} (Text that can be used to describe the constraint in messages identifying that the constraint has been violated.). This is the underlying object with id, value and extensions. The accessor "getHuman" gives direct access to the value + */ + public StringType getHumanElement() { + if (this.human == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.human"); + else if (Configuration.doAutoCreate()) + this.human = new StringType(); // bb + return this.human; + } + + public boolean hasHumanElement() { + return this.human != null && !this.human.isEmpty(); + } + + public boolean hasHuman() { + return this.human != null && !this.human.isEmpty(); + } + + /** + * @param value {@link #human} (Text that can be used to describe the constraint in messages identifying that the constraint has been violated.). This is the underlying object with id, value and extensions. The accessor "getHuman" gives direct access to the value + */ + public ElementDefinitionConstraintComponent setHumanElement(StringType value) { + this.human = value; + return this; + } + + /** + * @return Text that can be used to describe the constraint in messages identifying that the constraint has been violated. + */ + public String getHuman() { + return this.human == null ? null : this.human.getValue(); + } + + /** + * @param value Text that can be used to describe the constraint in messages identifying that the constraint has been violated. + */ + public ElementDefinitionConstraintComponent setHuman(String value) { + if (this.human == null) + this.human = new StringType(); + this.human.setValue(value); + return this; + } + + /** + * @return {@link #xpath} (An XPath expression of constraint that can be executed to see if this constraint is met.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value + */ + public StringType getXpathElement() { + if (this.xpath == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.xpath"); + else if (Configuration.doAutoCreate()) + this.xpath = new StringType(); // bb + return this.xpath; + } + + public boolean hasXpathElement() { + return this.xpath != null && !this.xpath.isEmpty(); + } + + public boolean hasXpath() { + return this.xpath != null && !this.xpath.isEmpty(); + } + + /** + * @param value {@link #xpath} (An XPath expression of constraint that can be executed to see if this constraint is met.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value + */ + public ElementDefinitionConstraintComponent setXpathElement(StringType value) { + this.xpath = value; + return this; + } + + /** + * @return An XPath expression of constraint that can be executed to see if this constraint is met. + */ + public String getXpath() { + return this.xpath == null ? null : this.xpath.getValue(); + } + + /** + * @param value An XPath expression of constraint that can be executed to see if this constraint is met. + */ + public ElementDefinitionConstraintComponent setXpath(String value) { + if (this.xpath == null) + this.xpath = new StringType(); + this.xpath.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("key", "id", "Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality.", 0, java.lang.Integer.MAX_VALUE, key)); + childrenList.add(new Property("name", "string", "Used to label the constraint in OCL or in short displays incapable of displaying the full human description.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("severity", "code", "Identifies the impact constraint violation has on the conformance of the instance.", 0, java.lang.Integer.MAX_VALUE, severity)); + childrenList.add(new Property("human", "string", "Text that can be used to describe the constraint in messages identifying that the constraint has been violated.", 0, java.lang.Integer.MAX_VALUE, human)); + childrenList.add(new Property("xpath", "string", "An XPath expression of constraint that can be executed to see if this constraint is met.", 0, java.lang.Integer.MAX_VALUE, xpath)); + } + + public ElementDefinitionConstraintComponent copy() { + ElementDefinitionConstraintComponent dst = new ElementDefinitionConstraintComponent(); + copyValues(dst); + dst.key = key == null ? null : key.copy(); + dst.name = name == null ? null : name.copy(); + dst.severity = severity == null ? null : severity.copy(); + dst.human = human == null ? null : human.copy(); + dst.xpath = xpath == null ? null : xpath.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ElementDefinitionConstraintComponent)) + return false; + ElementDefinitionConstraintComponent o = (ElementDefinitionConstraintComponent) other; + return compareDeep(key, o.key, true) && compareDeep(name, o.name, true) && compareDeep(severity, o.severity, true) + && compareDeep(human, o.human, true) && compareDeep(xpath, o.xpath, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ElementDefinitionConstraintComponent)) + return false; + ElementDefinitionConstraintComponent o = (ElementDefinitionConstraintComponent) other; + return compareValues(key, o.key, true) && compareValues(name, o.name, true) && compareValues(severity, o.severity, true) + && compareValues(human, o.human, true) && compareValues(xpath, o.xpath, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (key == null || key.isEmpty()) && (name == null || name.isEmpty()) + && (severity == null || severity.isEmpty()) && (human == null || human.isEmpty()) && (xpath == null || xpath.isEmpty()) + ; + } + + } + + @Block() + public static class ElementDefinitionBindingComponent extends Element implements IBaseDatatypeElement { + /** + * A descriptive name for this - can be useful for generating implementation artifacts. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Descriptive Name", formalDefinition="A descriptive name for this - can be useful for generating implementation artifacts." ) + protected StringType name; + + /** + * Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. + */ + @Child(name = "strength", type = {CodeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="required | extensible | preferred | example", formalDefinition="Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances." ) + protected Enumeration strength; + + /** + * Describes the intended use of this particular set of codes. + */ + @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Human explanation of the value set", formalDefinition="Describes the intended use of this particular set of codes." ) + protected StringType description; + + /** + * Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used. + */ + @Child(name = "valueSet", type = {UriType.class, ValueSet.class}, order=4, min=0, max=1) + @Description(shortDefinition="Source of value set", formalDefinition="Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used." ) + protected Type valueSet; + + private static final long serialVersionUID = 325485202L; + + /* + * Constructor + */ + public ElementDefinitionBindingComponent() { + super(); + } + + /* + * Constructor + */ + public ElementDefinitionBindingComponent(StringType name, Enumeration strength) { + super(); + this.name = name; + this.strength = strength; + } + + /** + * @return {@link #name} (A descriptive name for this - can be useful for generating implementation artifacts.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A descriptive name for this - can be useful for generating implementation artifacts.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ElementDefinitionBindingComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A descriptive name for this - can be useful for generating implementation artifacts. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A descriptive name for this - can be useful for generating implementation artifacts. + */ + public ElementDefinitionBindingComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #strength} (Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.). This is the underlying object with id, value and extensions. The accessor "getStrength" gives direct access to the value + */ + public Enumeration getStrengthElement() { + if (this.strength == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.strength"); + else if (Configuration.doAutoCreate()) + this.strength = new Enumeration(new BindingStrengthEnumFactory()); // bb + return this.strength; + } + + public boolean hasStrengthElement() { + return this.strength != null && !this.strength.isEmpty(); + } + + public boolean hasStrength() { + return this.strength != null && !this.strength.isEmpty(); + } + + /** + * @param value {@link #strength} (Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.). This is the underlying object with id, value and extensions. The accessor "getStrength" gives direct access to the value + */ + public ElementDefinitionBindingComponent setStrengthElement(Enumeration value) { + this.strength = value; + return this; + } + + /** + * @return Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. + */ + public BindingStrength getStrength() { + return this.strength == null ? null : this.strength.getValue(); + } + + /** + * @param value Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. + */ + public ElementDefinitionBindingComponent setStrength(BindingStrength value) { + if (this.strength == null) + this.strength = new Enumeration(new BindingStrengthEnumFactory()); + this.strength.setValue(value); + return this; + } + + /** + * @return {@link #description} (Describes the intended use of this particular set of codes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Describes the intended use of this particular set of codes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ElementDefinitionBindingComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Describes the intended use of this particular set of codes. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Describes the intended use of this particular set of codes. + */ + public ElementDefinitionBindingComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) + */ + public Type getValueSet() { + return this.valueSet; + } + + /** + * @return {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) + */ + public UriType getValueSetUriType() throws Exception { + if (!(this.valueSet instanceof UriType)) + throw new Exception("Type mismatch: the type UriType was expected, but "+this.valueSet.getClass().getName()+" was encountered"); + return (UriType) this.valueSet; + } + + /** + * @return {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) + */ + public Reference getValueSetReference() throws Exception { + if (!(this.valueSet instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.valueSet.getClass().getName()+" was encountered"); + return (Reference) this.valueSet; + } + + public boolean hasValueSet() { + return this.valueSet != null && !this.valueSet.isEmpty(); + } + + /** + * @param value {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) + */ + public ElementDefinitionBindingComponent setValueSet(Type value) { + this.valueSet = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "A descriptive name for this - can be useful for generating implementation artifacts.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("strength", "code", "Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.", 0, java.lang.Integer.MAX_VALUE, strength)); + childrenList.add(new Property("description", "string", "Describes the intended use of this particular set of codes.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("valueSet[x]", "uri|Reference(ValueSet)", "Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.", 0, java.lang.Integer.MAX_VALUE, valueSet)); + } + + public ElementDefinitionBindingComponent copy() { + ElementDefinitionBindingComponent dst = new ElementDefinitionBindingComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.strength = strength == null ? null : strength.copy(); + dst.description = description == null ? null : description.copy(); + dst.valueSet = valueSet == null ? null : valueSet.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ElementDefinitionBindingComponent)) + return false; + ElementDefinitionBindingComponent o = (ElementDefinitionBindingComponent) other; + return compareDeep(name, o.name, true) && compareDeep(strength, o.strength, true) && compareDeep(description, o.description, true) + && compareDeep(valueSet, o.valueSet, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ElementDefinitionBindingComponent)) + return false; + ElementDefinitionBindingComponent o = (ElementDefinitionBindingComponent) other; + return compareValues(name, o.name, true) && compareValues(strength, o.strength, true) && compareValues(description, o.description, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (strength == null || strength.isEmpty()) + && (description == null || description.isEmpty()) && (valueSet == null || valueSet.isEmpty()) + ; + } + + } + + @Block() + public static class ElementDefinitionMappingComponent extends Element implements IBaseDatatypeElement { + /** + * An internal reference to the definition of a mapping. + */ + @Child(name = "identity", type = {IdType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Reference to mapping declaration", formalDefinition="An internal reference to the definition of a mapping." ) + protected IdType identity; + + /** + * Identifies the computable language in which mapping.map is expressed. + */ + @Child(name = "language", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Computable language of mapping", formalDefinition="Identifies the computable language in which mapping.map is expressed." ) + protected CodeType language; + + /** + * Expresses what part of the target specification corresponds to this element. + */ + @Child(name = "map", type = {StringType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Details of the mapping", formalDefinition="Expresses what part of the target specification corresponds to this element." ) + protected StringType map; + + private static final long serialVersionUID = -669205371L; + + /* + * Constructor + */ + public ElementDefinitionMappingComponent() { + super(); + } + + /* + * Constructor + */ + public ElementDefinitionMappingComponent(IdType identity, StringType map) { + super(); + this.identity = identity; + this.map = map; + } + + /** + * @return {@link #identity} (An internal reference to the definition of a mapping.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value + */ + public IdType getIdentityElement() { + if (this.identity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.identity"); + else if (Configuration.doAutoCreate()) + this.identity = new IdType(); // bb + return this.identity; + } + + public boolean hasIdentityElement() { + return this.identity != null && !this.identity.isEmpty(); + } + + public boolean hasIdentity() { + return this.identity != null && !this.identity.isEmpty(); + } + + /** + * @param value {@link #identity} (An internal reference to the definition of a mapping.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value + */ + public ElementDefinitionMappingComponent setIdentityElement(IdType value) { + this.identity = value; + return this; + } + + /** + * @return An internal reference to the definition of a mapping. + */ + public String getIdentity() { + return this.identity == null ? null : this.identity.getValue(); + } + + /** + * @param value An internal reference to the definition of a mapping. + */ + public ElementDefinitionMappingComponent setIdentity(String value) { + if (this.identity == null) + this.identity = new IdType(); + this.identity.setValue(value); + return this; + } + + /** + * @return {@link #language} (Identifies the computable language in which mapping.map is expressed.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public CodeType getLanguageElement() { + if (this.language == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.language"); + else if (Configuration.doAutoCreate()) + this.language = new CodeType(); // bb + return this.language; + } + + public boolean hasLanguageElement() { + return this.language != null && !this.language.isEmpty(); + } + + public boolean hasLanguage() { + return this.language != null && !this.language.isEmpty(); + } + + /** + * @param value {@link #language} (Identifies the computable language in which mapping.map is expressed.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public ElementDefinitionMappingComponent setLanguageElement(CodeType value) { + this.language = value; + return this; + } + + /** + * @return Identifies the computable language in which mapping.map is expressed. + */ + public String getLanguage() { + return this.language == null ? null : this.language.getValue(); + } + + /** + * @param value Identifies the computable language in which mapping.map is expressed. + */ + public ElementDefinitionMappingComponent setLanguage(String value) { + if (Utilities.noString(value)) + this.language = null; + else { + if (this.language == null) + this.language = new CodeType(); + this.language.setValue(value); + } + return this; + } + + /** + * @return {@link #map} (Expresses what part of the target specification corresponds to this element.). This is the underlying object with id, value and extensions. The accessor "getMap" gives direct access to the value + */ + public StringType getMapElement() { + if (this.map == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.map"); + else if (Configuration.doAutoCreate()) + this.map = new StringType(); // bb + return this.map; + } + + public boolean hasMapElement() { + return this.map != null && !this.map.isEmpty(); + } + + public boolean hasMap() { + return this.map != null && !this.map.isEmpty(); + } + + /** + * @param value {@link #map} (Expresses what part of the target specification corresponds to this element.). This is the underlying object with id, value and extensions. The accessor "getMap" gives direct access to the value + */ + public ElementDefinitionMappingComponent setMapElement(StringType value) { + this.map = value; + return this; + } + + /** + * @return Expresses what part of the target specification corresponds to this element. + */ + public String getMap() { + return this.map == null ? null : this.map.getValue(); + } + + /** + * @param value Expresses what part of the target specification corresponds to this element. + */ + public ElementDefinitionMappingComponent setMap(String value) { + if (this.map == null) + this.map = new StringType(); + this.map.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identity", "id", "An internal reference to the definition of a mapping.", 0, java.lang.Integer.MAX_VALUE, identity)); + childrenList.add(new Property("language", "code", "Identifies the computable language in which mapping.map is expressed.", 0, java.lang.Integer.MAX_VALUE, language)); + childrenList.add(new Property("map", "string", "Expresses what part of the target specification corresponds to this element.", 0, java.lang.Integer.MAX_VALUE, map)); + } + + public ElementDefinitionMappingComponent copy() { + ElementDefinitionMappingComponent dst = new ElementDefinitionMappingComponent(); + copyValues(dst); + dst.identity = identity == null ? null : identity.copy(); + dst.language = language == null ? null : language.copy(); + dst.map = map == null ? null : map.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ElementDefinitionMappingComponent)) + return false; + ElementDefinitionMappingComponent o = (ElementDefinitionMappingComponent) other; + return compareDeep(identity, o.identity, true) && compareDeep(language, o.language, true) && compareDeep(map, o.map, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ElementDefinitionMappingComponent)) + return false; + ElementDefinitionMappingComponent o = (ElementDefinitionMappingComponent) other; + return compareValues(identity, o.identity, true) && compareValues(language, o.language, true) && compareValues(map, o.map, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identity == null || identity.isEmpty()) && (language == null || language.isEmpty()) + && (map == null || map.isEmpty()); + } + + } + + /** + * The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. + */ + @Child(name = "path", type = {StringType.class}, order=0, min=1, max=1) + @Description(shortDefinition="The path of the element (see the Detailed Descriptions)", formalDefinition="The path identifies the element and is expressed as a '.'-separated list of ancestor elements, beginning with the name of the resource or extension." ) + protected StringType path; + + /** + * Codes that define how this element is represented in instances, when the deviation varies from the normal case. + */ + @Child(name = "representation", type = {CodeType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="How this element is represented in instances", formalDefinition="Codes that define how this element is represented in instances, when the deviation varies from the normal case." ) + protected List> representation; + + /** + * The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element. + */ + @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Name for this particular element definition (reference target)", formalDefinition="The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element." ) + protected StringType name; + + /** + * The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form. + */ + @Child(name = "label", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Name for element to display with or prompt for element", formalDefinition="The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form." ) + protected StringType label; + + /** + * A code that provides the meaning for the element according to a particular terminology. + */ + @Child(name = "code", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Defining code", formalDefinition="A code that provides the meaning for the element according to a particular terminology." ) + protected List code; + + /** + * Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set). + */ + @Child(name = "slicing", type = {}, order=5, min=0, max=1) + @Description(shortDefinition="This element is sliced - slices follow", formalDefinition="Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set)." ) + protected ElementDefinitionSlicingComponent slicing; + + /** + * A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification). + */ + @Child(name = "short_", type = {StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Concise definition for xml presentation", formalDefinition="A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification)." ) + protected StringType short_; + + /** + * Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. + */ + @Child(name = "definition", type = {StringType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Full formal definition as narrative text", formalDefinition="Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource." ) + protected StringType definition; + + /** + * Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc. + */ + @Child(name = "comments", type = {StringType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Comments about the use of this element", formalDefinition="Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc." ) + protected StringType comments; + + /** + * This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element. + */ + @Child(name = "requirements", type = {StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Why is this needed?", formalDefinition="This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element." ) + protected StringType requirements; + + /** + * Identifies additional names by which this element might also be known. + */ + @Child(name = "alias", type = {StringType.class}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Other names", formalDefinition="Identifies additional names by which this element might also be known." ) + protected List alias; + + /** + * The minimum number of times this element SHALL appear in the instance. + */ + @Child(name = "min", type = {IntegerType.class}, order=11, min=0, max=1) + @Description(shortDefinition="Minimum Cardinality", formalDefinition="The minimum number of times this element SHALL appear in the instance." ) + protected IntegerType min; + + /** + * The maximum number of times this element is permitted to appear in the instance. + */ + @Child(name = "max", type = {StringType.class}, order=12, min=0, max=1) + @Description(shortDefinition="Maximum Cardinality (a number or *)", formalDefinition="The maximum number of times this element is permitted to appear in the instance." ) + protected StringType max; + + /** + * The data type or resource that the value of this element is permitted to be. + */ + @Child(name = "type", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Data type and Profile for this element", formalDefinition="The data type or resource that the value of this element is permitted to be." ) + protected List type; + + /** + * Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element. + */ + @Child(name = "nameReference", type = {StringType.class}, order=14, min=0, max=1) + @Description(shortDefinition="To another element constraint (by element.name)", formalDefinition="Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element." ) + protected StringType nameReference; + + /** + * The value that should be used if there is no value stated in the instance. + */ + @Child(name = "defaultValue", type = {}, order=15, min=0, max=1) + @Description(shortDefinition="Specified value it missing from instance", formalDefinition="The value that should be used if there is no value stated in the instance." ) + protected org.hl7.fhir.instance.model.Type defaultValue; + + /** + * The Implicit meaning that is to be understood when this element is missing. + */ + @Child(name = "meaningWhenMissing", type = {StringType.class}, order=16, min=0, max=1) + @Description(shortDefinition="Implicit meaning when this element is missing", formalDefinition="The Implicit meaning that is to be understood when this element is missing." ) + protected StringType meaningWhenMissing; + + /** + * Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing. + */ + @Child(name = "fixed", type = {}, order=17, min=0, max=1) + @Description(shortDefinition="Value must be exactly this", formalDefinition="Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing." ) + protected org.hl7.fhir.instance.model.Type fixed; + + /** + * Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.). + */ + @Child(name = "pattern", type = {}, order=18, min=0, max=1) + @Description(shortDefinition="Value must have at least these property values", formalDefinition="Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.)." ) + protected org.hl7.fhir.instance.model.Type pattern; + + /** + * A sample value for this element demonstrating the type of information that would typically be captured. + */ + @Child(name = "example", type = {}, order=19, min=0, max=1) + @Description(shortDefinition="Example value: [as defined for type]", formalDefinition="A sample value for this element demonstrating the type of information that would typically be captured." ) + protected org.hl7.fhir.instance.model.Type example; + + /** + * Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. + */ + @Child(name = "maxLength", type = {IntegerType.class}, order=20, min=0, max=1) + @Description(shortDefinition="Max length for strings", formalDefinition="Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element." ) + protected IntegerType maxLength; + + /** + * A reference to an invariant that may make additional statements about the cardinality or value in the instance. + */ + @Child(name = "condition", type = {IdType.class}, order=21, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Reference to invariant about presence", formalDefinition="A reference to an invariant that may make additional statements about the cardinality or value in the instance." ) + protected List condition; + + /** + * Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance. + */ + @Child(name = "constraint", type = {}, order=22, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Condition that must evaluate to true", formalDefinition="Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance." ) + protected List constraint; + + /** + * If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported. + */ + @Child(name = "mustSupport", type = {BooleanType.class}, order=23, min=0, max=1) + @Description(shortDefinition="If the element must supported", formalDefinition="If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported." ) + protected BooleanType mustSupport; + + /** + * If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. + */ + @Child(name = "isModifier", type = {BooleanType.class}, order=24, min=0, max=1) + @Description(shortDefinition="If this modifies the meaning of other elements", formalDefinition="If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system." ) + protected BooleanType isModifier; + + /** + * Whether the element should be included if a client requests a search with the parameter _summary=true. + */ + @Child(name = "isSummary", type = {BooleanType.class}, order=25, min=0, max=1) + @Description(shortDefinition="Include when _summary = true?", formalDefinition="Whether the element should be included if a client requests a search with the parameter _summary=true." ) + protected BooleanType isSummary; + + /** + * Binds to a value set if this element is coded (code, Coding, CodeableConcept). + */ + @Child(name = "binding", type = {}, order=26, min=0, max=1) + @Description(shortDefinition="ValueSet details if this is coded", formalDefinition="Binds to a value set if this element is coded (code, Coding, CodeableConcept)." ) + protected ElementDefinitionBindingComponent binding; + + /** + * Identifies a concept from an external specification that roughly corresponds to this element. + */ + @Child(name = "mapping", type = {}, order=27, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Map element to another set of definitions", formalDefinition="Identifies a concept from an external specification that roughly corresponds to this element." ) + protected List mapping; + + private static final long serialVersionUID = 1149674414L; + + /* + * Constructor + */ + public ElementDefinition() { + super(); + } + + /* + * Constructor + */ + public ElementDefinition(StringType path) { + super(); + this.path = path; + } + + /** + * @return {@link #path} (The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public StringType getPathElement() { + if (this.path == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.path"); + else if (Configuration.doAutoCreate()) + this.path = new StringType(); // bb + return this.path; + } + + public boolean hasPathElement() { + return this.path != null && !this.path.isEmpty(); + } + + public boolean hasPath() { + return this.path != null && !this.path.isEmpty(); + } + + /** + * @param value {@link #path} (The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public ElementDefinition setPathElement(StringType value) { + this.path = value; + return this; + } + + /** + * @return The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. + */ + public String getPath() { + return this.path == null ? null : this.path.getValue(); + } + + /** + * @param value The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. + */ + public ElementDefinition setPath(String value) { + if (this.path == null) + this.path = new StringType(); + this.path.setValue(value); + return this; + } + + /** + * @return {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) + */ + public List> getRepresentation() { + if (this.representation == null) + this.representation = new ArrayList>(); + return this.representation; + } + + public boolean hasRepresentation() { + if (this.representation == null) + return false; + for (Enumeration item : this.representation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) + */ + // syntactic sugar + public Enumeration addRepresentationElement() {//2 + Enumeration t = new Enumeration(new PropertyRepresentationEnumFactory()); + if (this.representation == null) + this.representation = new ArrayList>(); + this.representation.add(t); + return t; + } + + /** + * @param value {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) + */ + public ElementDefinition addRepresentation(PropertyRepresentation value) { //1 + Enumeration t = new Enumeration(new PropertyRepresentationEnumFactory()); + t.setValue(value); + if (this.representation == null) + this.representation = new ArrayList>(); + this.representation.add(t); + return this; + } + + /** + * @param value {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) + */ + public boolean hasRepresentation(PropertyRepresentation value) { + if (this.representation == null) + return false; + for (Enumeration v : this.representation) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #name} (The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ElementDefinition setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element. + */ + public ElementDefinition setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #label} (The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value + */ + public StringType getLabelElement() { + if (this.label == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.label"); + else if (Configuration.doAutoCreate()) + this.label = new StringType(); // bb + return this.label; + } + + public boolean hasLabelElement() { + return this.label != null && !this.label.isEmpty(); + } + + public boolean hasLabel() { + return this.label != null && !this.label.isEmpty(); + } + + /** + * @param value {@link #label} (The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value + */ + public ElementDefinition setLabelElement(StringType value) { + this.label = value; + return this; + } + + /** + * @return The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form. + */ + public String getLabel() { + return this.label == null ? null : this.label.getValue(); + } + + /** + * @param value The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form. + */ + public ElementDefinition setLabel(String value) { + if (Utilities.noString(value)) + this.label = null; + else { + if (this.label == null) + this.label = new StringType(); + this.label.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (A code that provides the meaning for the element according to a particular terminology.) + */ + public List getCode() { + if (this.code == null) + this.code = new ArrayList(); + return this.code; + } + + public boolean hasCode() { + if (this.code == null) + return false; + for (Coding item : this.code) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #code} (A code that provides the meaning for the element according to a particular terminology.) + */ + // syntactic sugar + public Coding addCode() { //3 + Coding t = new Coding(); + if (this.code == null) + this.code = new ArrayList(); + this.code.add(t); + return t; + } + + // syntactic sugar + public ElementDefinition addCode(Coding t) { //3 + if (t == null) + return this; + if (this.code == null) + this.code = new ArrayList(); + this.code.add(t); + return this; + } + + /** + * @return {@link #slicing} (Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).) + */ + public ElementDefinitionSlicingComponent getSlicing() { + if (this.slicing == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.slicing"); + else if (Configuration.doAutoCreate()) + this.slicing = new ElementDefinitionSlicingComponent(); // cc + return this.slicing; + } + + public boolean hasSlicing() { + return this.slicing != null && !this.slicing.isEmpty(); + } + + /** + * @param value {@link #slicing} (Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).) + */ + public ElementDefinition setSlicing(ElementDefinitionSlicingComponent value) { + this.slicing = value; + return this; + } + + /** + * @return {@link #short_} (A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification).). This is the underlying object with id, value and extensions. The accessor "getShort" gives direct access to the value + */ + public StringType getShortElement() { + if (this.short_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.short_"); + else if (Configuration.doAutoCreate()) + this.short_ = new StringType(); // bb + return this.short_; + } + + public boolean hasShortElement() { + return this.short_ != null && !this.short_.isEmpty(); + } + + public boolean hasShort() { + return this.short_ != null && !this.short_.isEmpty(); + } + + /** + * @param value {@link #short_} (A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification).). This is the underlying object with id, value and extensions. The accessor "getShort" gives direct access to the value + */ + public ElementDefinition setShortElement(StringType value) { + this.short_ = value; + return this; + } + + /** + * @return A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification). + */ + public String getShort() { + return this.short_ == null ? null : this.short_.getValue(); + } + + /** + * @param value A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification). + */ + public ElementDefinition setShort(String value) { + if (Utilities.noString(value)) + this.short_ = null; + else { + if (this.short_ == null) + this.short_ = new StringType(); + this.short_.setValue(value); + } + return this; + } + + /** + * @return {@link #definition} (Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public StringType getDefinitionElement() { + if (this.definition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.definition"); + else if (Configuration.doAutoCreate()) + this.definition = new StringType(); // bb + return this.definition; + } + + public boolean hasDefinitionElement() { + return this.definition != null && !this.definition.isEmpty(); + } + + public boolean hasDefinition() { + return this.definition != null && !this.definition.isEmpty(); + } + + /** + * @param value {@link #definition} (Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public ElementDefinition setDefinitionElement(StringType value) { + this.definition = value; + return this; + } + + /** + * @return Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. + */ + public String getDefinition() { + return this.definition == null ? null : this.definition.getValue(); + } + + /** + * @param value Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. + */ + public ElementDefinition setDefinition(String value) { + if (Utilities.noString(value)) + this.definition = null; + else { + if (this.definition == null) + this.definition = new StringType(); + this.definition.setValue(value); + } + return this; + } + + /** + * @return {@link #comments} (Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public StringType getCommentsElement() { + if (this.comments == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.comments"); + else if (Configuration.doAutoCreate()) + this.comments = new StringType(); // bb + return this.comments; + } + + public boolean hasCommentsElement() { + return this.comments != null && !this.comments.isEmpty(); + } + + public boolean hasComments() { + return this.comments != null && !this.comments.isEmpty(); + } + + /** + * @param value {@link #comments} (Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public ElementDefinition setCommentsElement(StringType value) { + this.comments = value; + return this; + } + + /** + * @return Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc. + */ + public String getComments() { + return this.comments == null ? null : this.comments.getValue(); + } + + /** + * @param value Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc. + */ + public ElementDefinition setComments(String value) { + if (Utilities.noString(value)) + this.comments = null; + else { + if (this.comments == null) + this.comments = new StringType(); + this.comments.setValue(value); + } + return this; + } + + /** + * @return {@link #requirements} (This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); // bb + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public ElementDefinition setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element. + */ + public ElementDefinition setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #alias} (Identifies additional names by which this element might also be known.) + */ + public List getAlias() { + if (this.alias == null) + this.alias = new ArrayList(); + return this.alias; + } + + public boolean hasAlias() { + if (this.alias == null) + return false; + for (StringType item : this.alias) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #alias} (Identifies additional names by which this element might also be known.) + */ + // syntactic sugar + public StringType addAliasElement() {//2 + StringType t = new StringType(); + if (this.alias == null) + this.alias = new ArrayList(); + this.alias.add(t); + return t; + } + + /** + * @param value {@link #alias} (Identifies additional names by which this element might also be known.) + */ + public ElementDefinition addAlias(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.alias == null) + this.alias = new ArrayList(); + this.alias.add(t); + return this; + } + + /** + * @param value {@link #alias} (Identifies additional names by which this element might also be known.) + */ + public boolean hasAlias(String value) { + if (this.alias == null) + return false; + for (StringType v : this.alias) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #min} (The minimum number of times this element SHALL appear in the instance.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value + */ + public IntegerType getMinElement() { + if (this.min == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.min"); + else if (Configuration.doAutoCreate()) + this.min = new IntegerType(); // bb + return this.min; + } + + public boolean hasMinElement() { + return this.min != null && !this.min.isEmpty(); + } + + public boolean hasMin() { + return this.min != null && !this.min.isEmpty(); + } + + /** + * @param value {@link #min} (The minimum number of times this element SHALL appear in the instance.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value + */ + public ElementDefinition setMinElement(IntegerType value) { + this.min = value; + return this; + } + + /** + * @return The minimum number of times this element SHALL appear in the instance. + */ + public int getMin() { + return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue(); + } + + /** + * @param value The minimum number of times this element SHALL appear in the instance. + */ + public ElementDefinition setMin(int value) { + if (this.min == null) + this.min = new IntegerType(); + this.min.setValue(value); + return this; + } + + /** + * @return {@link #max} (The maximum number of times this element is permitted to appear in the instance.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value + */ + public StringType getMaxElement() { + if (this.max == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.max"); + else if (Configuration.doAutoCreate()) + this.max = new StringType(); // bb + return this.max; + } + + public boolean hasMaxElement() { + return this.max != null && !this.max.isEmpty(); + } + + public boolean hasMax() { + return this.max != null && !this.max.isEmpty(); + } + + /** + * @param value {@link #max} (The maximum number of times this element is permitted to appear in the instance.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value + */ + public ElementDefinition setMaxElement(StringType value) { + this.max = value; + return this; + } + + /** + * @return The maximum number of times this element is permitted to appear in the instance. + */ + public String getMax() { + return this.max == null ? null : this.max.getValue(); + } + + /** + * @param value The maximum number of times this element is permitted to appear in the instance. + */ + public ElementDefinition setMax(String value) { + if (Utilities.noString(value)) + this.max = null; + else { + if (this.max == null) + this.max = new StringType(); + this.max.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (The data type or resource that the value of this element is permitted to be.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (TypeRefComponent item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (The data type or resource that the value of this element is permitted to be.) + */ + // syntactic sugar + public TypeRefComponent addType() { //3 + TypeRefComponent t = new TypeRefComponent(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + // syntactic sugar + public ElementDefinition addType(TypeRefComponent t) { //3 + if (t == null) + return this; + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + /** + * @return {@link #nameReference} (Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element.). This is the underlying object with id, value and extensions. The accessor "getNameReference" gives direct access to the value + */ + public StringType getNameReferenceElement() { + if (this.nameReference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.nameReference"); + else if (Configuration.doAutoCreate()) + this.nameReference = new StringType(); // bb + return this.nameReference; + } + + public boolean hasNameReferenceElement() { + return this.nameReference != null && !this.nameReference.isEmpty(); + } + + public boolean hasNameReference() { + return this.nameReference != null && !this.nameReference.isEmpty(); + } + + /** + * @param value {@link #nameReference} (Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element.). This is the underlying object with id, value and extensions. The accessor "getNameReference" gives direct access to the value + */ + public ElementDefinition setNameReferenceElement(StringType value) { + this.nameReference = value; + return this; + } + + /** + * @return Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element. + */ + public String getNameReference() { + return this.nameReference == null ? null : this.nameReference.getValue(); + } + + /** + * @param value Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element. + */ + public ElementDefinition setNameReference(String value) { + if (Utilities.noString(value)) + this.nameReference = null; + else { + if (this.nameReference == null) + this.nameReference = new StringType(); + this.nameReference.setValue(value); + } + return this; + } + + /** + * @return {@link #defaultValue} (The value that should be used if there is no value stated in the instance.) + */ + public org.hl7.fhir.instance.model.Type getDefaultValue() { + return this.defaultValue; + } + + public boolean hasDefaultValue() { + return this.defaultValue != null && !this.defaultValue.isEmpty(); + } + + /** + * @param value {@link #defaultValue} (The value that should be used if there is no value stated in the instance.) + */ + public ElementDefinition setDefaultValue(org.hl7.fhir.instance.model.Type value) { + this.defaultValue = value; + return this; + } + + /** + * @return {@link #meaningWhenMissing} (The Implicit meaning that is to be understood when this element is missing.). This is the underlying object with id, value and extensions. The accessor "getMeaningWhenMissing" gives direct access to the value + */ + public StringType getMeaningWhenMissingElement() { + if (this.meaningWhenMissing == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.meaningWhenMissing"); + else if (Configuration.doAutoCreate()) + this.meaningWhenMissing = new StringType(); // bb + return this.meaningWhenMissing; + } + + public boolean hasMeaningWhenMissingElement() { + return this.meaningWhenMissing != null && !this.meaningWhenMissing.isEmpty(); + } + + public boolean hasMeaningWhenMissing() { + return this.meaningWhenMissing != null && !this.meaningWhenMissing.isEmpty(); + } + + /** + * @param value {@link #meaningWhenMissing} (The Implicit meaning that is to be understood when this element is missing.). This is the underlying object with id, value and extensions. The accessor "getMeaningWhenMissing" gives direct access to the value + */ + public ElementDefinition setMeaningWhenMissingElement(StringType value) { + this.meaningWhenMissing = value; + return this; + } + + /** + * @return The Implicit meaning that is to be understood when this element is missing. + */ + public String getMeaningWhenMissing() { + return this.meaningWhenMissing == null ? null : this.meaningWhenMissing.getValue(); + } + + /** + * @param value The Implicit meaning that is to be understood when this element is missing. + */ + public ElementDefinition setMeaningWhenMissing(String value) { + if (Utilities.noString(value)) + this.meaningWhenMissing = null; + else { + if (this.meaningWhenMissing == null) + this.meaningWhenMissing = new StringType(); + this.meaningWhenMissing.setValue(value); + } + return this; + } + + /** + * @return {@link #fixed} (Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.) + */ + public org.hl7.fhir.instance.model.Type getFixed() { + return this.fixed; + } + + public boolean hasFixed() { + return this.fixed != null && !this.fixed.isEmpty(); + } + + /** + * @param value {@link #fixed} (Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.) + */ + public ElementDefinition setFixed(org.hl7.fhir.instance.model.Type value) { + this.fixed = value; + return this; + } + + /** + * @return {@link #pattern} (Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.).) + */ + public org.hl7.fhir.instance.model.Type getPattern() { + return this.pattern; + } + + public boolean hasPattern() { + return this.pattern != null && !this.pattern.isEmpty(); + } + + /** + * @param value {@link #pattern} (Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.).) + */ + public ElementDefinition setPattern(org.hl7.fhir.instance.model.Type value) { + this.pattern = value; + return this; + } + + /** + * @return {@link #example} (A sample value for this element demonstrating the type of information that would typically be captured.) + */ + public org.hl7.fhir.instance.model.Type getExample() { + return this.example; + } + + public boolean hasExample() { + return this.example != null && !this.example.isEmpty(); + } + + /** + * @param value {@link #example} (A sample value for this element demonstrating the type of information that would typically be captured.) + */ + public ElementDefinition setExample(org.hl7.fhir.instance.model.Type value) { + this.example = value; + return this; + } + + /** + * @return {@link #maxLength} (Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value + */ + public IntegerType getMaxLengthElement() { + if (this.maxLength == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.maxLength"); + else if (Configuration.doAutoCreate()) + this.maxLength = new IntegerType(); // bb + return this.maxLength; + } + + public boolean hasMaxLengthElement() { + return this.maxLength != null && !this.maxLength.isEmpty(); + } + + public boolean hasMaxLength() { + return this.maxLength != null && !this.maxLength.isEmpty(); + } + + /** + * @param value {@link #maxLength} (Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value + */ + public ElementDefinition setMaxLengthElement(IntegerType value) { + this.maxLength = value; + return this; + } + + /** + * @return Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. + */ + public int getMaxLength() { + return this.maxLength == null || this.maxLength.isEmpty() ? 0 : this.maxLength.getValue(); + } + + /** + * @param value Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. + */ + public ElementDefinition setMaxLength(int value) { + if (this.maxLength == null) + this.maxLength = new IntegerType(); + this.maxLength.setValue(value); + return this; + } + + /** + * @return {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) + */ + public List getCondition() { + if (this.condition == null) + this.condition = new ArrayList(); + return this.condition; + } + + public boolean hasCondition() { + if (this.condition == null) + return false; + for (IdType item : this.condition) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) + */ + // syntactic sugar + public IdType addConditionElement() {//2 + IdType t = new IdType(); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return t; + } + + /** + * @param value {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) + */ + public ElementDefinition addCondition(String value) { //1 + IdType t = new IdType(); + t.setValue(value); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return this; + } + + /** + * @param value {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) + */ + public boolean hasCondition(String value) { + if (this.condition == null) + return false; + for (IdType v : this.condition) + if (v.equals(value)) // id + return true; + return false; + } + + /** + * @return {@link #constraint} (Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.) + */ + public List getConstraint() { + if (this.constraint == null) + this.constraint = new ArrayList(); + return this.constraint; + } + + public boolean hasConstraint() { + if (this.constraint == null) + return false; + for (ElementDefinitionConstraintComponent item : this.constraint) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #constraint} (Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.) + */ + // syntactic sugar + public ElementDefinitionConstraintComponent addConstraint() { //3 + ElementDefinitionConstraintComponent t = new ElementDefinitionConstraintComponent(); + if (this.constraint == null) + this.constraint = new ArrayList(); + this.constraint.add(t); + return t; + } + + // syntactic sugar + public ElementDefinition addConstraint(ElementDefinitionConstraintComponent t) { //3 + if (t == null) + return this; + if (this.constraint == null) + this.constraint = new ArrayList(); + this.constraint.add(t); + return this; + } + + /** + * @return {@link #mustSupport} (If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported.). This is the underlying object with id, value and extensions. The accessor "getMustSupport" gives direct access to the value + */ + public BooleanType getMustSupportElement() { + if (this.mustSupport == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.mustSupport"); + else if (Configuration.doAutoCreate()) + this.mustSupport = new BooleanType(); // bb + return this.mustSupport; + } + + public boolean hasMustSupportElement() { + return this.mustSupport != null && !this.mustSupport.isEmpty(); + } + + public boolean hasMustSupport() { + return this.mustSupport != null && !this.mustSupport.isEmpty(); + } + + /** + * @param value {@link #mustSupport} (If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported.). This is the underlying object with id, value and extensions. The accessor "getMustSupport" gives direct access to the value + */ + public ElementDefinition setMustSupportElement(BooleanType value) { + this.mustSupport = value; + return this; + } + + /** + * @return If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported. + */ + public boolean getMustSupport() { + return this.mustSupport == null || this.mustSupport.isEmpty() ? false : this.mustSupport.getValue(); + } + + /** + * @param value If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported. + */ + public ElementDefinition setMustSupport(boolean value) { + if (this.mustSupport == null) + this.mustSupport = new BooleanType(); + this.mustSupport.setValue(value); + return this; + } + + /** + * @return {@link #isModifier} (If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.). This is the underlying object with id, value and extensions. The accessor "getIsModifier" gives direct access to the value + */ + public BooleanType getIsModifierElement() { + if (this.isModifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.isModifier"); + else if (Configuration.doAutoCreate()) + this.isModifier = new BooleanType(); // bb + return this.isModifier; + } + + public boolean hasIsModifierElement() { + return this.isModifier != null && !this.isModifier.isEmpty(); + } + + public boolean hasIsModifier() { + return this.isModifier != null && !this.isModifier.isEmpty(); + } + + /** + * @param value {@link #isModifier} (If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.). This is the underlying object with id, value and extensions. The accessor "getIsModifier" gives direct access to the value + */ + public ElementDefinition setIsModifierElement(BooleanType value) { + this.isModifier = value; + return this; + } + + /** + * @return If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. + */ + public boolean getIsModifier() { + return this.isModifier == null || this.isModifier.isEmpty() ? false : this.isModifier.getValue(); + } + + /** + * @param value If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. + */ + public ElementDefinition setIsModifier(boolean value) { + if (this.isModifier == null) + this.isModifier = new BooleanType(); + this.isModifier.setValue(value); + return this; + } + + /** + * @return {@link #isSummary} (Whether the element should be included if a client requests a search with the parameter _summary=true.). This is the underlying object with id, value and extensions. The accessor "getIsSummary" gives direct access to the value + */ + public BooleanType getIsSummaryElement() { + if (this.isSummary == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.isSummary"); + else if (Configuration.doAutoCreate()) + this.isSummary = new BooleanType(); // bb + return this.isSummary; + } + + public boolean hasIsSummaryElement() { + return this.isSummary != null && !this.isSummary.isEmpty(); + } + + public boolean hasIsSummary() { + return this.isSummary != null && !this.isSummary.isEmpty(); + } + + /** + * @param value {@link #isSummary} (Whether the element should be included if a client requests a search with the parameter _summary=true.). This is the underlying object with id, value and extensions. The accessor "getIsSummary" gives direct access to the value + */ + public ElementDefinition setIsSummaryElement(BooleanType value) { + this.isSummary = value; + return this; + } + + /** + * @return Whether the element should be included if a client requests a search with the parameter _summary=true. + */ + public boolean getIsSummary() { + return this.isSummary == null || this.isSummary.isEmpty() ? false : this.isSummary.getValue(); + } + + /** + * @param value Whether the element should be included if a client requests a search with the parameter _summary=true. + */ + public ElementDefinition setIsSummary(boolean value) { + if (this.isSummary == null) + this.isSummary = new BooleanType(); + this.isSummary.setValue(value); + return this; + } + + /** + * @return {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept).) + */ + public ElementDefinitionBindingComponent getBinding() { + if (this.binding == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.binding"); + else if (Configuration.doAutoCreate()) + this.binding = new ElementDefinitionBindingComponent(); // cc + return this.binding; + } + + public boolean hasBinding() { + return this.binding != null && !this.binding.isEmpty(); + } + + /** + * @param value {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept).) + */ + public ElementDefinition setBinding(ElementDefinitionBindingComponent value) { + this.binding = value; + return this; + } + + /** + * @return {@link #mapping} (Identifies a concept from an external specification that roughly corresponds to this element.) + */ + public List getMapping() { + if (this.mapping == null) + this.mapping = new ArrayList(); + return this.mapping; + } + + public boolean hasMapping() { + if (this.mapping == null) + return false; + for (ElementDefinitionMappingComponent item : this.mapping) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #mapping} (Identifies a concept from an external specification that roughly corresponds to this element.) + */ + // syntactic sugar + public ElementDefinitionMappingComponent addMapping() { //3 + ElementDefinitionMappingComponent t = new ElementDefinitionMappingComponent(); + if (this.mapping == null) + this.mapping = new ArrayList(); + this.mapping.add(t); + return t; + } + + // syntactic sugar + public ElementDefinition addMapping(ElementDefinitionMappingComponent t) { //3 + if (t == null) + return this; + if (this.mapping == null) + this.mapping = new ArrayList(); + this.mapping.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("path", "string", "The path identifies the element and is expressed as a '.'-separated list of ancestor elements, beginning with the name of the resource or extension.", 0, java.lang.Integer.MAX_VALUE, path)); + childrenList.add(new Property("representation", "code", "Codes that define how this element is represented in instances, when the deviation varies from the normal case.", 0, java.lang.Integer.MAX_VALUE, representation)); + childrenList.add(new Property("name", "string", "The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("label", "string", "The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.", 0, java.lang.Integer.MAX_VALUE, label)); + childrenList.add(new Property("code", "Coding", "A code that provides the meaning for the element according to a particular terminology.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("slicing", "", "Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).", 0, java.lang.Integer.MAX_VALUE, slicing)); + childrenList.add(new Property("short", "string", "A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification).", 0, java.lang.Integer.MAX_VALUE, short_)); + childrenList.add(new Property("definition", "string", "Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.", 0, java.lang.Integer.MAX_VALUE, definition)); + childrenList.add(new Property("comments", "string", "Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc.", 0, java.lang.Integer.MAX_VALUE, comments)); + childrenList.add(new Property("requirements", "string", "This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("alias", "string", "Identifies additional names by which this element might also be known.", 0, java.lang.Integer.MAX_VALUE, alias)); + childrenList.add(new Property("min", "integer", "The minimum number of times this element SHALL appear in the instance.", 0, java.lang.Integer.MAX_VALUE, min)); + childrenList.add(new Property("max", "string", "The maximum number of times this element is permitted to appear in the instance.", 0, java.lang.Integer.MAX_VALUE, max)); + childrenList.add(new Property("type", "", "The data type or resource that the value of this element is permitted to be.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("nameReference", "string", "Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element.", 0, java.lang.Integer.MAX_VALUE, nameReference)); + childrenList.add(new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance.", 0, java.lang.Integer.MAX_VALUE, defaultValue)); + childrenList.add(new Property("meaningWhenMissing", "string", "The Implicit meaning that is to be understood when this element is missing.", 0, java.lang.Integer.MAX_VALUE, meaningWhenMissing)); + childrenList.add(new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, java.lang.Integer.MAX_VALUE, fixed)); + childrenList.add(new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.).", 0, java.lang.Integer.MAX_VALUE, pattern)); + childrenList.add(new Property("example[x]", "*", "A sample value for this element demonstrating the type of information that would typically be captured.", 0, java.lang.Integer.MAX_VALUE, example)); + childrenList.add(new Property("maxLength", "integer", "Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.", 0, java.lang.Integer.MAX_VALUE, maxLength)); + childrenList.add(new Property("condition", "id", "A reference to an invariant that may make additional statements about the cardinality or value in the instance.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("constraint", "", "Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.", 0, java.lang.Integer.MAX_VALUE, constraint)); + childrenList.add(new Property("mustSupport", "boolean", "If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported.", 0, java.lang.Integer.MAX_VALUE, mustSupport)); + childrenList.add(new Property("isModifier", "boolean", "If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.", 0, java.lang.Integer.MAX_VALUE, isModifier)); + childrenList.add(new Property("isSummary", "boolean", "Whether the element should be included if a client requests a search with the parameter _summary=true.", 0, java.lang.Integer.MAX_VALUE, isSummary)); + childrenList.add(new Property("binding", "", "Binds to a value set if this element is coded (code, Coding, CodeableConcept).", 0, java.lang.Integer.MAX_VALUE, binding)); + childrenList.add(new Property("mapping", "", "Identifies a concept from an external specification that roughly corresponds to this element.", 0, java.lang.Integer.MAX_VALUE, mapping)); + } + + public ElementDefinition copy() { + ElementDefinition dst = new ElementDefinition(); + copyValues(dst); + dst.path = path == null ? null : path.copy(); + if (representation != null) { + dst.representation = new ArrayList>(); + for (Enumeration i : representation) + dst.representation.add(i.copy()); + }; + dst.name = name == null ? null : name.copy(); + dst.label = label == null ? null : label.copy(); + if (code != null) { + dst.code = new ArrayList(); + for (Coding i : code) + dst.code.add(i.copy()); + }; + dst.slicing = slicing == null ? null : slicing.copy(); + dst.short_ = short_ == null ? null : short_.copy(); + dst.definition = definition == null ? null : definition.copy(); + dst.comments = comments == null ? null : comments.copy(); + dst.requirements = requirements == null ? null : requirements.copy(); + if (alias != null) { + dst.alias = new ArrayList(); + for (StringType i : alias) + dst.alias.add(i.copy()); + }; + dst.min = min == null ? null : min.copy(); + dst.max = max == null ? null : max.copy(); + if (type != null) { + dst.type = new ArrayList(); + for (TypeRefComponent i : type) + dst.type.add(i.copy()); + }; + dst.nameReference = nameReference == null ? null : nameReference.copy(); + dst.defaultValue = defaultValue == null ? null : defaultValue.copy(); + dst.meaningWhenMissing = meaningWhenMissing == null ? null : meaningWhenMissing.copy(); + dst.fixed = fixed == null ? null : fixed.copy(); + dst.pattern = pattern == null ? null : pattern.copy(); + dst.example = example == null ? null : example.copy(); + dst.maxLength = maxLength == null ? null : maxLength.copy(); + if (condition != null) { + dst.condition = new ArrayList(); + for (IdType i : condition) + dst.condition.add(i.copy()); + }; + if (constraint != null) { + dst.constraint = new ArrayList(); + for (ElementDefinitionConstraintComponent i : constraint) + dst.constraint.add(i.copy()); + }; + dst.mustSupport = mustSupport == null ? null : mustSupport.copy(); + dst.isModifier = isModifier == null ? null : isModifier.copy(); + dst.isSummary = isSummary == null ? null : isSummary.copy(); + dst.binding = binding == null ? null : binding.copy(); + if (mapping != null) { + dst.mapping = new ArrayList(); + for (ElementDefinitionMappingComponent i : mapping) + dst.mapping.add(i.copy()); + }; + return dst; + } + + protected ElementDefinition typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ElementDefinition)) + return false; + ElementDefinition o = (ElementDefinition) other; + return compareDeep(path, o.path, true) && compareDeep(representation, o.representation, true) && compareDeep(name, o.name, true) + && compareDeep(label, o.label, true) && compareDeep(code, o.code, true) && compareDeep(slicing, o.slicing, true) + && compareDeep(short_, o.short_, true) && compareDeep(definition, o.definition, true) && compareDeep(comments, o.comments, true) + && compareDeep(requirements, o.requirements, true) && compareDeep(alias, o.alias, true) && compareDeep(min, o.min, true) + && compareDeep(max, o.max, true) && compareDeep(type, o.type, true) && compareDeep(nameReference, o.nameReference, true) + && compareDeep(defaultValue, o.defaultValue, true) && compareDeep(meaningWhenMissing, o.meaningWhenMissing, true) + && compareDeep(fixed, o.fixed, true) && compareDeep(pattern, o.pattern, true) && compareDeep(example, o.example, true) + && compareDeep(maxLength, o.maxLength, true) && compareDeep(condition, o.condition, true) && compareDeep(constraint, o.constraint, true) + && compareDeep(mustSupport, o.mustSupport, true) && compareDeep(isModifier, o.isModifier, true) + && compareDeep(isSummary, o.isSummary, true) && compareDeep(binding, o.binding, true) && compareDeep(mapping, o.mapping, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ElementDefinition)) + return false; + ElementDefinition o = (ElementDefinition) other; + return compareValues(path, o.path, true) && compareValues(representation, o.representation, true) && compareValues(name, o.name, true) + && compareValues(label, o.label, true) && compareValues(short_, o.short_, true) && compareValues(definition, o.definition, true) + && compareValues(comments, o.comments, true) && compareValues(requirements, o.requirements, true) && compareValues(alias, o.alias, true) + && compareValues(min, o.min, true) && compareValues(max, o.max, true) && compareValues(nameReference, o.nameReference, true) + && compareValues(meaningWhenMissing, o.meaningWhenMissing, true) && compareValues(maxLength, o.maxLength, true) + && compareValues(condition, o.condition, true) && compareValues(mustSupport, o.mustSupport, true) && compareValues(isModifier, o.isModifier, true) + && compareValues(isSummary, o.isSummary, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (path == null || path.isEmpty()) && (representation == null || representation.isEmpty()) + && (name == null || name.isEmpty()) && (label == null || label.isEmpty()) && (code == null || code.isEmpty()) + && (slicing == null || slicing.isEmpty()) && (short_ == null || short_.isEmpty()) && (definition == null || definition.isEmpty()) + && (comments == null || comments.isEmpty()) && (requirements == null || requirements.isEmpty()) + && (alias == null || alias.isEmpty()) && (min == null || min.isEmpty()) && (max == null || max.isEmpty()) + && (type == null || type.isEmpty()) && (nameReference == null || nameReference.isEmpty()) + && (defaultValue == null || defaultValue.isEmpty()) && (meaningWhenMissing == null || meaningWhenMissing.isEmpty()) + && (fixed == null || fixed.isEmpty()) && (pattern == null || pattern.isEmpty()) && (example == null || example.isEmpty()) + && (maxLength == null || maxLength.isEmpty()) && (condition == null || condition.isEmpty()) + && (constraint == null || constraint.isEmpty()) && (mustSupport == null || mustSupport.isEmpty()) + && (isModifier == null || isModifier.isEmpty()) && (isSummary == null || isSummary.isEmpty()) + && (binding == null || binding.isEmpty()) && (mapping == null || mapping.isEmpty()); + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EligibilityRequest.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EligibilityRequest.java index 223a32881c2..8059d5f0a24 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EligibilityRequest.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EligibilityRequest.java @@ -1,481 +1,460 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. - */ -@ResourceDef(name="EligibilityRequest", profile="http://hl7.org/fhir/Profile/EligibilityRequest") -public class EligibilityRequest extends DomainResource { - - /** - * The Response Business Identifier. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=2, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when this resource was created. - */ - @Child(name = "created", type = {DateTimeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) - protected DateTimeType created; - - /** - * The Insurer who is target of the request. - */ - @Child(name = "target", type = {Organization.class}, order=4, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target of the request." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (The Insurer who is target of the request.) - */ - protected Organization targetTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name = "provider", type = {Practitioner.class}, order=5, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner providerTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name = "organization", type = {Organization.class}, order=6, min=0, max=1) - @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; - - /* - * Constructor - */ - public EligibilityRequest() { - super(); - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public EligibilityRequest addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public EligibilityRequest setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public EligibilityRequest setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public EligibilityRequest setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when this resource was created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when this resource was created. - */ - public EligibilityRequest setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (The Insurer who is target of the request.) - */ - public 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(); // cc - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The Insurer who is target of the request.) - */ - public 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(); // aa - return this.targetTarget; - } - - /** - * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who is target of the request.) - */ - public 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(); // cc - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public 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(); // aa - return this.providerTarget; - } - - /** - * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) - */ - public 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(); // cc - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public 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(); // aa - return this.organizationTarget; - } - - /** - * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) - */ - public EligibilityRequest setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("target", "Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, organization)); - } - - public EligibilityRequest copy() { - EligibilityRequest dst = new EligibilityRequest(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.target = target == null ? null : target.copy(); - dst.provider = provider == null ? null : provider.copy(); - dst.organization = organization == null ? null : organization.copy(); - return dst; - } - - protected EligibilityRequest typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof EligibilityRequest)) - return false; - EligibilityRequest o = (EligibilityRequest) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) - && compareDeep(created, o.created, true) && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) - && compareDeep(organization, o.organization, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof EligibilityRequest)) - return false; - EligibilityRequest o = (EligibilityRequest) other; - return compareValues(created, o.created, true); - } - - 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"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. + */ +@ResourceDef(name="EligibilityRequest", profile="http://hl7.org/fhir/Profile/EligibilityRequest") +public class EligibilityRequest extends DomainResource { + + /** + * The Response Business Identifier. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name = "ruleset", type = {Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=2, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when this resource was created. + */ + @Child(name = "created", type = {DateTimeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) + protected DateTimeType created; + + /** + * The Insurer who is target of the request. + */ + @Child(name = "target", type = {Organization.class}, order=4, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target of the request." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (The Insurer who is target of the request.) + */ + protected Organization targetTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name = "provider", type = {Practitioner.class}, order=5, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name = "organization", type = {Organization.class}, order=6, min=0, max=1) + @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; + + /* + * Constructor + */ + public EligibilityRequest() { + super(); + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public EligibilityRequest addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityRequest.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public EligibilityRequest setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityRequest.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public EligibilityRequest setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityRequest.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public EligibilityRequest setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when this resource was created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when this resource was created. + */ + public EligibilityRequest setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (The Insurer who is target of the request.) + */ + public 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(); // cc + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The Insurer who is target of the request.) + */ + public 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(); // aa + return this.targetTarget; + } + + /** + * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who is target of the request.) + */ + public 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(); // cc + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public 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(); // aa + return this.providerTarget; + } + + /** + * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public 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(); // cc + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public 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(); // aa + return this.organizationTarget; + } + + /** + * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) + */ + public EligibilityRequest setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); + childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); + childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("target", "Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, organization)); + } + + public EligibilityRequest copy() { + EligibilityRequest dst = new EligibilityRequest(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + dst.created = created == null ? null : created.copy(); + dst.target = target == null ? null : target.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.organization = organization == null ? null : organization.copy(); + return dst; + } + + protected EligibilityRequest typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof EligibilityRequest)) + return false; + EligibilityRequest o = (EligibilityRequest) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) + && compareDeep(created, o.created, true) && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) + && compareDeep(organization, o.organization, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof EligibilityRequest)) + return false; + EligibilityRequest o = (EligibilityRequest) other; + return compareValues(created, o.created, true); + } + + 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"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EligibilityResponse.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EligibilityResponse.java index d45ec8f1260..192ba90f033 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EligibilityResponse.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EligibilityResponse.java @@ -1,732 +1,711 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * This resource provides eligibility and plan details from the processing of an Eligibility resource. - */ -@ResourceDef(name="EligibilityResponse", profile="http://hl7.org/fhir/Profile/EligibilityResponse") -public class EligibilityResponse extends DomainResource { - - public enum RSLink { - /** - * The processing completed without errors. - */ - COMPLETE, - /** - * The processing identified with errors. - */ - ERROR, - /** - * added to help the parsers - */ - NULL; - public static RSLink fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return COMPLETE; - if ("error".equals(codeString)) - return ERROR; - throw new Exception("Unknown RSLink code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case COMPLETE: return "complete"; - case ERROR: return "error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case COMPLETE: return ""; - case ERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case COMPLETE: return "The processing completed without errors."; - case ERROR: return "The processing identified with errors."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case COMPLETE: return "Complete"; - case ERROR: return "Error"; - default: return "?"; - } - } - } - - public static class RSLinkEnumFactory implements EnumFactory { - public RSLink fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return RSLink.COMPLETE; - if ("error".equals(codeString)) - return RSLink.ERROR; - throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); - } - public String toCode(RSLink code) { - if (code == RSLink.COMPLETE) - return "complete"; - if (code == RSLink.ERROR) - return "error"; - return "?"; - } - } - - /** - * The Response Business Identifier. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * Original request resource reference. - */ - @Child(name = "request", type = {EligibilityRequest.class}, order=1, min=0, max=1) - @Description(shortDefinition="Claim reference", formalDefinition="Original request resource reference." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (Original request resource reference.) - */ - protected EligibilityRequest requestTarget; - - /** - * Transaction status: error, complete. - */ - @Child(name = "outcome", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) - protected Enumeration outcome; - - /** - * A description of the status of the adjudication. - */ - @Child(name = "disposition", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) - protected StringType disposition; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=5, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateTimeType created; - - /** - * The Insurer who produced this adjudicated response. - */ - @Child(name = "organization", type = {Organization.class}, order=7, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) - */ - protected Organization organizationTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name = "requestProvider", type = {Practitioner.class}, order=8, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference requestProvider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner requestProviderTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name = "requestOrganization", type = {Organization.class}, order=9, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference requestOrganization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization requestOrganizationTarget; - - private static final long serialVersionUID = 241710852L; - - /* - * Constructor - */ - public EligibilityResponse() { - super(); - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public EligibilityResponse addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #request} (Original request resource reference.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); // cc - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request resource reference.) - */ - public EligibilityResponse setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original request resource reference.) - */ - public EligibilityRequest getRequestTarget() { - if (this.requestTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.request"); - else if (Configuration.doAutoCreate()) - this.requestTarget = new EligibilityRequest(); // aa - return this.requestTarget; - } - - /** - * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original request resource reference.) - */ - public EligibilityResponse setRequestTarget(EligibilityRequest value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public Enumeration getOutcomeElement() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Enumeration(new RSLinkEnumFactory()); // bb - return this.outcome; - } - - public boolean hasOutcomeElement() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public EligibilityResponse setOutcomeElement(Enumeration value) { - this.outcome = value; - return this; - } - - /** - * @return Transaction status: error, complete. - */ - public RSLink getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value Transaction status: error, complete. - */ - public EligibilityResponse setOutcome(RSLink value) { - if (value == null) - this.outcome = null; - else { - if (this.outcome == null) - this.outcome = new Enumeration(new RSLinkEnumFactory()); - this.outcome.setValue(value); - } - return this; - } - - /** - * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public StringType getDispositionElement() { - if (this.disposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.disposition"); - else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); // bb - return this.disposition; - } - - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - /** - * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public EligibilityResponse setDispositionElement(StringType value) { - this.disposition = value; - return this; - } - - /** - * @return A description of the status of the adjudication. - */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); - } - - /** - * @param value A description of the status of the adjudication. - */ - public EligibilityResponse setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); - } - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public EligibilityResponse setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public EligibilityResponse setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public EligibilityResponse setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when the enclosed suite of services were performed or completed. - */ - public EligibilityResponse setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); // cc - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public EligibilityResponse setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); // aa - return this.organizationTarget; - } - - /** - * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) - */ - public EligibilityResponse setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getRequestProvider() { - if (this.requestProvider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProvider = new Reference(); // cc - return this.requestProvider; - } - - public boolean hasRequestProvider() { - return this.requestProvider != null && !this.requestProvider.isEmpty(); - } - - /** - * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public EligibilityResponse setRequestProvider(Reference value) { - this.requestProvider = value; - return this; - } - - /** - * @return {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getRequestProviderTarget() { - if (this.requestProviderTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProviderTarget = new Practitioner(); // aa - return this.requestProviderTarget; - } - - /** - * @param value {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) - */ - public EligibilityResponse setRequestProviderTarget(Practitioner value) { - this.requestProviderTarget = value; - return this; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getRequestOrganization() { - if (this.requestOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganization = new Reference(); // cc - return this.requestOrganization; - } - - public boolean hasRequestOrganization() { - return this.requestOrganization != null && !this.requestOrganization.isEmpty(); - } - - /** - * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public EligibilityResponse setRequestOrganization(Reference value) { - this.requestOrganization = value; - return this; - } - - /** - * @return {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) - */ - public Organization getRequestOrganizationTarget() { - if (this.requestOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganizationTarget = new Organization(); // aa - return this.requestOrganizationTarget; - } - - /** - * @param value {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) - */ - public EligibilityResponse setRequestOrganizationTarget(Organization value) { - this.requestOrganizationTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("request", "Reference(EligibilityRequest)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition)); - childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); - childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); - } - - public EligibilityResponse copy() { - EligibilityResponse dst = new EligibilityResponse(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.request = request == null ? null : request.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.disposition = disposition == null ? null : disposition.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); - dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); - return dst; - } - - protected EligibilityResponse typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof EligibilityResponse)) - return false; - EligibilityResponse o = (EligibilityResponse) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true) - && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) - && compareDeep(created, o.created, true) && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) - && compareDeep(requestOrganization, o.requestOrganization, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof EligibilityResponse)) - return false; - EligibilityResponse o = (EligibilityResponse) other; - return compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) - && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) - && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) - && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.EligibilityResponse; - } - - @SearchParamDefinition(name="identifier", path="EligibilityResponse.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * This resource provides eligibility and plan details from the processing of an Eligibility resource. + */ +@ResourceDef(name="EligibilityResponse", profile="http://hl7.org/fhir/Profile/EligibilityResponse") +public class EligibilityResponse extends DomainResource { + + public enum RSLink { + /** + * The processing completed without errors. + */ + COMPLETE, + /** + * The processing identified with errors. + */ + ERROR, + /** + * added to help the parsers + */ + NULL; + public static RSLink fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return COMPLETE; + if ("error".equals(codeString)) + return ERROR; + throw new Exception("Unknown RSLink code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case ERROR: return "error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return ""; + case ERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The processing completed without errors."; + case ERROR: return "The processing identified with errors."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "Complete"; + case ERROR: return "Error"; + default: return "?"; + } + } + } + + public static class RSLinkEnumFactory implements EnumFactory { + public RSLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return RSLink.COMPLETE; + if ("error".equals(codeString)) + return RSLink.ERROR; + throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); + } + public String toCode(RSLink code) { + if (code == RSLink.COMPLETE) + return "complete"; + if (code == RSLink.ERROR) + return "error"; + return "?"; + } + } + + /** + * The Response Business Identifier. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * Original request resource reference. + */ + @Child(name = "request", type = {EligibilityRequest.class}, order=1, min=0, max=1) + @Description(shortDefinition="Claim reference", formalDefinition="Original request resource reference." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (Original request resource reference.) + */ + protected EligibilityRequest requestTarget; + + /** + * Transaction status: error, complete. + */ + @Child(name = "outcome", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) + protected Enumeration outcome; + + /** + * A description of the status of the adjudication. + */ + @Child(name = "disposition", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) + protected StringType disposition; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=5, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateTimeType created; + + /** + * The Insurer who produced this adjudicated response. + */ + @Child(name = "organization", type = {Organization.class}, order=7, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) + */ + protected Organization organizationTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name = "requestProvider", type = {Practitioner.class}, order=8, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference requestProvider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner requestProviderTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name = "requestOrganization", type = {Organization.class}, order=9, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference requestOrganization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization requestOrganizationTarget; + + private static final long serialVersionUID = 241710852L; + + /* + * Constructor + */ + public EligibilityResponse() { + super(); + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public EligibilityResponse addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #request} (Original request resource reference.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); // cc + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request resource reference.) + */ + public EligibilityResponse setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original request resource reference.) + */ + public EligibilityRequest getRequestTarget() { + if (this.requestTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.request"); + else if (Configuration.doAutoCreate()) + this.requestTarget = new EligibilityRequest(); // aa + return this.requestTarget; + } + + /** + * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original request resource reference.) + */ + public EligibilityResponse setRequestTarget(EligibilityRequest value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public Enumeration getOutcomeElement() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new Enumeration(new RSLinkEnumFactory()); // bb + return this.outcome; + } + + public boolean hasOutcomeElement() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public EligibilityResponse setOutcomeElement(Enumeration value) { + this.outcome = value; + return this; + } + + /** + * @return Transaction status: error, complete. + */ + public RSLink getOutcome() { + return this.outcome == null ? null : this.outcome.getValue(); + } + + /** + * @param value Transaction status: error, complete. + */ + public EligibilityResponse setOutcome(RSLink value) { + if (value == null) + this.outcome = null; + else { + if (this.outcome == null) + this.outcome = new Enumeration(new RSLinkEnumFactory()); + this.outcome.setValue(value); + } + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); // bb + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public EligibilityResponse setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication. + */ + public EligibilityResponse setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public EligibilityResponse setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public EligibilityResponse setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public EligibilityResponse setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when the enclosed suite of services were performed or completed. + */ + public EligibilityResponse setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); // cc + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public EligibilityResponse setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); // aa + return this.organizationTarget; + } + + /** + * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) + */ + public EligibilityResponse setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getRequestProvider() { + if (this.requestProvider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProvider = new Reference(); // cc + return this.requestProvider; + } + + public boolean hasRequestProvider() { + return this.requestProvider != null && !this.requestProvider.isEmpty(); + } + + /** + * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public EligibilityResponse setRequestProvider(Reference value) { + this.requestProvider = value; + return this; + } + + /** + * @return {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getRequestProviderTarget() { + if (this.requestProviderTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProviderTarget = new Practitioner(); // aa + return this.requestProviderTarget; + } + + /** + * @param value {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public EligibilityResponse setRequestProviderTarget(Practitioner value) { + this.requestProviderTarget = value; + return this; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getRequestOrganization() { + if (this.requestOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganization = new Reference(); // cc + return this.requestOrganization; + } + + public boolean hasRequestOrganization() { + return this.requestOrganization != null && !this.requestOrganization.isEmpty(); + } + + /** + * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public EligibilityResponse setRequestOrganization(Reference value) { + this.requestOrganization = value; + return this; + } + + /** + * @return {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) + */ + public Organization getRequestOrganizationTarget() { + if (this.requestOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganizationTarget = new Organization(); // aa + return this.requestOrganizationTarget; + } + + /** + * @param value {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) + */ + public EligibilityResponse setRequestOrganizationTarget(Organization value) { + this.requestOrganizationTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("request", "Reference(EligibilityRequest)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome)); + childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition)); + childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); + childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); + childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); + childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); + } + + public EligibilityResponse copy() { + EligibilityResponse dst = new EligibilityResponse(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.request = request == null ? null : request.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.disposition = disposition == null ? null : disposition.copy(); + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + dst.created = created == null ? null : created.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); + dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); + return dst; + } + + protected EligibilityResponse typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof EligibilityResponse)) + return false; + EligibilityResponse o = (EligibilityResponse) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true) + && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) + && compareDeep(created, o.created, true) && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) + && compareDeep(requestOrganization, o.requestOrganization, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof EligibilityResponse)) + return false; + EligibilityResponse o = (EligibilityResponse) other; + return compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) + && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) + && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) + && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) + && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.EligibilityResponse; + } + + @SearchParamDefinition(name="identifier", path="EligibilityResponse.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Encounter.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Encounter.java index aa4a8ca5b75..6c899632e88 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Encounter.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Encounter.java @@ -1,2626 +1,2605 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. - */ -@ResourceDef(name="Encounter", profile="http://hl7.org/fhir/Profile/Encounter") -public class Encounter extends DomainResource { - - public enum EncounterState { - /** - * The Encounter has not yet started. - */ - PLANNED, - /** - * The Patient is present for the encounter, however is not currently meeting with a practitioner. - */ - ARRIVED, - /** - * The Encounter has begun and the patient is present / the practitioner and the patient are meeting. - */ - INPROGRESS, - /** - * The Encounter has begun, but the patient is temporarily on leave. - */ - ONLEAVE, - /** - * The Encounter has ended. - */ - FINISHED, - /** - * The Encounter has ended before it has begun. - */ - CANCELLED, - /** - * added to help the parsers - */ - NULL; - public static EncounterState fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return PLANNED; - if ("arrived".equals(codeString)) - return ARRIVED; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("onleave".equals(codeString)) - return ONLEAVE; - if ("finished".equals(codeString)) - return FINISHED; - if ("cancelled".equals(codeString)) - return CANCELLED; - throw new Exception("Unknown EncounterState code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PLANNED: return "planned"; - case ARRIVED: return "arrived"; - case INPROGRESS: return "in-progress"; - case ONLEAVE: return "onleave"; - case FINISHED: return "finished"; - case CANCELLED: return "cancelled"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PLANNED: return ""; - case ARRIVED: return ""; - case INPROGRESS: return ""; - case ONLEAVE: return ""; - case FINISHED: return ""; - case CANCELLED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PLANNED: return "The Encounter has not yet started."; - case ARRIVED: return "The Patient is present for the encounter, however is not currently meeting with a practitioner."; - case INPROGRESS: return "The Encounter has begun and the patient is present / the practitioner and the patient are meeting."; - case ONLEAVE: return "The Encounter has begun, but the patient is temporarily on leave."; - case FINISHED: return "The Encounter has ended."; - case CANCELLED: return "The Encounter has ended before it has begun."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PLANNED: return "Planned"; - case ARRIVED: return "Arrived"; - case INPROGRESS: return "in-progress"; - case ONLEAVE: return "On Leave"; - case FINISHED: return "Finished"; - case CANCELLED: return "Cancelled"; - default: return "?"; - } - } - } - - public static class EncounterStateEnumFactory implements EnumFactory { - public EncounterState fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return EncounterState.PLANNED; - if ("arrived".equals(codeString)) - return EncounterState.ARRIVED; - if ("in-progress".equals(codeString)) - return EncounterState.INPROGRESS; - if ("onleave".equals(codeString)) - return EncounterState.ONLEAVE; - if ("finished".equals(codeString)) - return EncounterState.FINISHED; - if ("cancelled".equals(codeString)) - return EncounterState.CANCELLED; - throw new IllegalArgumentException("Unknown EncounterState code '"+codeString+"'"); - } - public String toCode(EncounterState code) { - if (code == EncounterState.PLANNED) - return "planned"; - if (code == EncounterState.ARRIVED) - return "arrived"; - if (code == EncounterState.INPROGRESS) - return "in-progress"; - if (code == EncounterState.ONLEAVE) - return "onleave"; - if (code == EncounterState.FINISHED) - return "finished"; - if (code == EncounterState.CANCELLED) - return "cancelled"; - return "?"; - } - } - - public enum EncounterClass { - /** - * An encounter during which the patient is hospitalized and stays overnight. - */ - INPATIENT, - /** - * An encounter during which the patient is not hospitalized overnight. - */ - OUTPATIENT, - /** - * An encounter where the patient visits the practitioner in his/her office, e.g. a G.P. visit. - */ - AMBULATORY, - /** - * An encounter where the patient needs urgent care. - */ - EMERGENCY, - /** - * An encounter where the practitioner visits the patient at his/her home. - */ - HOME, - /** - * An encounter taking place outside the regular environment for giving care. - */ - FIELD, - /** - * An encounter where the patient needs more prolonged treatment or investigations than outpatients, but who do not need to stay in the hospital overnight. - */ - DAYTIME, - /** - * An encounter that takes place where the patient and practitioner do not physically meet but use electronic means for contact. - */ - VIRTUAL, - /** - * Any other encounter type that is not described by one of the other values. Where this is used it is expected that an implementer will include an extension value to define what the actual other type is. - */ - OTHER, - /** - * added to help the parsers - */ - NULL; - public static EncounterClass fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("inpatient".equals(codeString)) - return INPATIENT; - if ("outpatient".equals(codeString)) - return OUTPATIENT; - if ("ambulatory".equals(codeString)) - return AMBULATORY; - if ("emergency".equals(codeString)) - return EMERGENCY; - if ("home".equals(codeString)) - return HOME; - if ("field".equals(codeString)) - return FIELD; - if ("daytime".equals(codeString)) - return DAYTIME; - if ("virtual".equals(codeString)) - return VIRTUAL; - if ("other".equals(codeString)) - return OTHER; - throw new Exception("Unknown EncounterClass code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INPATIENT: return "inpatient"; - case OUTPATIENT: return "outpatient"; - case AMBULATORY: return "ambulatory"; - case EMERGENCY: return "emergency"; - case HOME: return "home"; - case FIELD: return "field"; - case DAYTIME: return "daytime"; - case VIRTUAL: return "virtual"; - case OTHER: return "other"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPATIENT: return ""; - case OUTPATIENT: return ""; - case AMBULATORY: return ""; - case EMERGENCY: return ""; - case HOME: return ""; - case FIELD: return ""; - case DAYTIME: return ""; - case VIRTUAL: return ""; - case OTHER: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPATIENT: return "An encounter during which the patient is hospitalized and stays overnight."; - case OUTPATIENT: return "An encounter during which the patient is not hospitalized overnight."; - case AMBULATORY: return "An encounter where the patient visits the practitioner in his/her office, e.g. a G.P. visit."; - case EMERGENCY: return "An encounter where the patient needs urgent care."; - case HOME: return "An encounter where the practitioner visits the patient at his/her home."; - case FIELD: return "An encounter taking place outside the regular environment for giving care."; - case DAYTIME: return "An encounter where the patient needs more prolonged treatment or investigations than outpatients, but who do not need to stay in the hospital overnight."; - case VIRTUAL: return "An encounter that takes place where the patient and practitioner do not physically meet but use electronic means for contact."; - case OTHER: return "Any other encounter type that is not described by one of the other values. Where this is used it is expected that an implementer will include an extension value to define what the actual other type is."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPATIENT: return "Inpatient"; - case OUTPATIENT: return "Outpatient"; - case AMBULATORY: return "Ambulatory"; - case EMERGENCY: return "Emergency"; - case HOME: return "Home"; - case FIELD: return "Field"; - case DAYTIME: return "Daytime"; - case VIRTUAL: return "Virtual"; - case OTHER: return "Other"; - default: return "?"; - } - } - } - - public static class EncounterClassEnumFactory implements EnumFactory { - public EncounterClass fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("inpatient".equals(codeString)) - return EncounterClass.INPATIENT; - if ("outpatient".equals(codeString)) - return EncounterClass.OUTPATIENT; - if ("ambulatory".equals(codeString)) - return EncounterClass.AMBULATORY; - if ("emergency".equals(codeString)) - return EncounterClass.EMERGENCY; - if ("home".equals(codeString)) - return EncounterClass.HOME; - if ("field".equals(codeString)) - return EncounterClass.FIELD; - if ("daytime".equals(codeString)) - return EncounterClass.DAYTIME; - if ("virtual".equals(codeString)) - return EncounterClass.VIRTUAL; - if ("other".equals(codeString)) - return EncounterClass.OTHER; - throw new IllegalArgumentException("Unknown EncounterClass code '"+codeString+"'"); - } - public String toCode(EncounterClass code) { - if (code == EncounterClass.INPATIENT) - return "inpatient"; - if (code == EncounterClass.OUTPATIENT) - return "outpatient"; - if (code == EncounterClass.AMBULATORY) - return "ambulatory"; - if (code == EncounterClass.EMERGENCY) - return "emergency"; - if (code == EncounterClass.HOME) - return "home"; - if (code == EncounterClass.FIELD) - return "field"; - if (code == EncounterClass.DAYTIME) - return "daytime"; - if (code == EncounterClass.VIRTUAL) - return "virtual"; - if (code == EncounterClass.OTHER) - return "other"; - return "?"; - } - } - - public enum EncounterLocationStatus { - /** - * The patient is planned to be moved to this location at some point in the future. - */ - PLANNED, - /** - * The patient is currently at this location, or was between the period specified. - */ - PRESENT, - /** - * This location is held empty for this patient. - */ - RESERVED, - /** - * added to help the parsers - */ - NULL; - public static EncounterLocationStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return PLANNED; - if ("present".equals(codeString)) - return PRESENT; - if ("reserved".equals(codeString)) - return RESERVED; - throw new Exception("Unknown EncounterLocationStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PLANNED: return "planned"; - case PRESENT: return "present"; - case RESERVED: return "reserved"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PLANNED: return ""; - case PRESENT: return ""; - case RESERVED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PLANNED: return "The patient is planned to be moved to this location at some point in the future."; - case PRESENT: return "The patient is currently at this location, or was between the period specified."; - case RESERVED: return "This location is held empty for this patient."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PLANNED: return "Planned"; - case PRESENT: return "Present"; - case RESERVED: return "Reserved"; - default: return "?"; - } - } - } - - public static class EncounterLocationStatusEnumFactory implements EnumFactory { - public EncounterLocationStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return EncounterLocationStatus.PLANNED; - if ("present".equals(codeString)) - return EncounterLocationStatus.PRESENT; - if ("reserved".equals(codeString)) - return EncounterLocationStatus.RESERVED; - throw new IllegalArgumentException("Unknown EncounterLocationStatus code '"+codeString+"'"); - } - public String toCode(EncounterLocationStatus code) { - if (code == EncounterLocationStatus.PLANNED) - return "planned"; - if (code == EncounterLocationStatus.PRESENT) - return "present"; - if (code == EncounterLocationStatus.RESERVED) - return "reserved"; - return "?"; - } - } - - @Block() - public static class EncounterStatusHistoryComponent extends BackboneElement implements IBaseBackboneElement { - /** - * planned | arrived | in-progress | onleave | finished | cancelled. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="planned | arrived | in-progress | onleave | finished | cancelled", formalDefinition="planned | arrived | in-progress | onleave | finished | cancelled." ) - protected Enumeration status; - - /** - * The time that the episode was in the specified status. - */ - @Child(name = "period", type = {Period.class}, order=2, min=1, max=1) - @Description(shortDefinition="The time that the episode was in the specified status", formalDefinition="The time that the episode was in the specified status." ) - protected Period period; - - private static final long serialVersionUID = 919229161L; - - /* - * Constructor - */ - public EncounterStatusHistoryComponent() { - super(); - } - - /* - * Constructor - */ - public EncounterStatusHistoryComponent(Enumeration status, Period period) { - super(); - this.status = status; - this.period = period; - } - - /** - * @return {@link #status} (planned | arrived | in-progress | onleave | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterStatusHistoryComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new EncounterStateEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (planned | arrived | in-progress | onleave | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public EncounterStatusHistoryComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return planned | arrived | in-progress | onleave | finished | cancelled. - */ - public EncounterState getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value planned | arrived | in-progress | onleave | finished | cancelled. - */ - public EncounterStatusHistoryComponent setStatus(EncounterState value) { - if (this.status == null) - this.status = new Enumeration(new EncounterStateEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #period} (The time that the episode was in the specified status.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterStatusHistoryComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The time that the episode was in the specified status.) - */ - public EncounterStatusHistoryComponent setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("status", "code", "planned | arrived | in-progress | onleave | finished | cancelled.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("period", "Period", "The time that the episode was in the specified status.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - public EncounterStatusHistoryComponent copy() { - EncounterStatusHistoryComponent dst = new EncounterStatusHistoryComponent(); - copyValues(dst); - dst.status = status == null ? null : status.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof EncounterStatusHistoryComponent)) - return false; - EncounterStatusHistoryComponent o = (EncounterStatusHistoryComponent) other; - return compareDeep(status, o.status, true) && compareDeep(period, o.period, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof EncounterStatusHistoryComponent)) - return false; - EncounterStatusHistoryComponent o = (EncounterStatusHistoryComponent) other; - return compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (status == null || status.isEmpty()) && (period == null || period.isEmpty()) - ; - } - - } - - @Block() - public static class EncounterParticipantComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Role of participant in encounter. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Role of participant in encounter", formalDefinition="Role of participant in encounter." ) - protected List type; - - /** - * The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period. - */ - @Child(name = "period", type = {Period.class}, order=2, min=0, max=1) - @Description(shortDefinition="Period of time during the encounter participant was present", formalDefinition="The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period." ) - protected Period period; - - /** - * Persons involved in the encounter other than the patient. - */ - @Child(name = "individual", type = {Practitioner.class, RelatedPerson.class}, order=3, min=0, max=1) - @Description(shortDefinition="Persons involved in the encounter other than the patient", formalDefinition="Persons involved in the encounter other than the patient." ) - protected Reference individual; - - /** - * The actual object that is the target of the reference (Persons involved in the encounter other than the patient.) - */ - protected Resource individualTarget; - - private static final long serialVersionUID = 317095765L; - - /* - * Constructor - */ - public EncounterParticipantComponent() { - super(); - } - - /** - * @return {@link #type} (Role of participant in encounter.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (CodeableConcept item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (Role of participant in encounter.) - */ - // syntactic sugar - public CodeableConcept addType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - // syntactic sugar - public EncounterParticipantComponent addType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - /** - * @return {@link #period} (The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterParticipantComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period.) - */ - public EncounterParticipantComponent setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #individual} (Persons involved in the encounter other than the patient.) - */ - public Reference getIndividual() { - if (this.individual == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterParticipantComponent.individual"); - else if (Configuration.doAutoCreate()) - this.individual = new Reference(); // cc - return this.individual; - } - - public boolean hasIndividual() { - return this.individual != null && !this.individual.isEmpty(); - } - - /** - * @param value {@link #individual} (Persons involved in the encounter other than the patient.) - */ - public EncounterParticipantComponent setIndividual(Reference value) { - this.individual = value; - return this; - } - - /** - * @return {@link #individual} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Persons involved in the encounter other than the patient.) - */ - public Resource getIndividualTarget() { - return this.individualTarget; - } - - /** - * @param value {@link #individual} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Persons involved in the encounter other than the patient.) - */ - public EncounterParticipantComponent setIndividualTarget(Resource value) { - this.individualTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "Role of participant in encounter.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("period", "Period", "The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("individual", "Reference(Practitioner|RelatedPerson)", "Persons involved in the encounter other than the patient.", 0, java.lang.Integer.MAX_VALUE, individual)); - } - - public EncounterParticipantComponent copy() { - EncounterParticipantComponent dst = new EncounterParticipantComponent(); - copyValues(dst); - if (type != null) { - dst.type = new ArrayList(); - for (CodeableConcept i : type) - dst.type.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - dst.individual = individual == null ? null : individual.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof EncounterParticipantComponent)) - return false; - EncounterParticipantComponent o = (EncounterParticipantComponent) other; - return compareDeep(type, o.type, true) && compareDeep(period, o.period, true) && compareDeep(individual, o.individual, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof EncounterParticipantComponent)) - return false; - EncounterParticipantComponent o = (EncounterParticipantComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (period == null || period.isEmpty()) - && (individual == null || individual.isEmpty()); - } - - } - - @Block() - public static class EncounterHospitalizationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Pre-admission identifier. - */ - @Child(name = "preAdmissionIdentifier", type = {Identifier.class}, order=1, min=0, max=1) - @Description(shortDefinition="Pre-admission identifier", formalDefinition="Pre-admission identifier." ) - protected Identifier preAdmissionIdentifier; - - /** - * The location from which the patient came before admission. - */ - @Child(name = "origin", type = {Location.class}, order=2, min=0, max=1) - @Description(shortDefinition="The location from which the patient came before admission", formalDefinition="The location from which the patient came before admission." ) - protected Reference origin; - - /** - * The actual object that is the target of the reference (The location from which the patient came before admission.) - */ - protected Location originTarget; - - /** - * From where patient was admitted (physician referral, transfer). - */ - @Child(name = "admitSource", type = {CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="From where patient was admitted (physician referral, transfer)", formalDefinition="From where patient was admitted (physician referral, transfer)." ) - protected CodeableConcept admitSource; - - /** - * Diet preferences reported by the patient. - */ - @Child(name = "dietPreference", type = {CodeableConcept.class}, order=4, min=0, max=1) - @Description(shortDefinition="Diet preferences reported by the patient", formalDefinition="Diet preferences reported by the patient." ) - protected CodeableConcept dietPreference; - - /** - * Special courtesies (VIP, board member). - */ - @Child(name = "specialCourtesy", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Special courtesies (VIP, board member)", formalDefinition="Special courtesies (VIP, board member)." ) - protected List specialCourtesy; - - /** - * Wheelchair, translator, stretcher, etc. - */ - @Child(name = "specialArrangement", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Wheelchair, translator, stretcher, etc", formalDefinition="Wheelchair, translator, stretcher, etc." ) - protected List specialArrangement; - - /** - * Location to which the patient is discharged. - */ - @Child(name = "destination", type = {Location.class}, order=7, min=0, max=1) - @Description(shortDefinition="Location to which the patient is discharged", formalDefinition="Location to which the patient is discharged." ) - protected Reference destination; - - /** - * The actual object that is the target of the reference (Location to which the patient is discharged.) - */ - protected Location destinationTarget; - - /** - * Category or kind of location after discharge. - */ - @Child(name = "dischargeDisposition", type = {CodeableConcept.class}, order=8, min=0, max=1) - @Description(shortDefinition="Category or kind of location after discharge", formalDefinition="Category or kind of location after discharge." ) - protected CodeableConcept dischargeDisposition; - - /** - * The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete. - */ - @Child(name = "dischargeDiagnosis", type = {}, order=9, min=0, max=1) - @Description(shortDefinition="The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete", formalDefinition="The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete." ) - protected Reference dischargeDiagnosis; - - /** - * The actual object that is the target of the reference (The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) - */ - protected Resource dischargeDiagnosisTarget; - - /** - * Whether this hospitalization is a readmission. - */ - @Child(name = "reAdmission", type = {BooleanType.class}, order=10, min=0, max=1) - @Description(shortDefinition="Is this hospitalization a readmission?", formalDefinition="Whether this hospitalization is a readmission." ) - protected BooleanType reAdmission; - - private static final long serialVersionUID = -990619663L; - - /* - * Constructor - */ - public EncounterHospitalizationComponent() { - super(); - } - - /** - * @return {@link #preAdmissionIdentifier} (Pre-admission identifier.) - */ - public Identifier getPreAdmissionIdentifier() { - if (this.preAdmissionIdentifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.preAdmissionIdentifier"); - else if (Configuration.doAutoCreate()) - this.preAdmissionIdentifier = new Identifier(); // cc - return this.preAdmissionIdentifier; - } - - public boolean hasPreAdmissionIdentifier() { - return this.preAdmissionIdentifier != null && !this.preAdmissionIdentifier.isEmpty(); - } - - /** - * @param value {@link #preAdmissionIdentifier} (Pre-admission identifier.) - */ - public EncounterHospitalizationComponent setPreAdmissionIdentifier(Identifier value) { - this.preAdmissionIdentifier = value; - return this; - } - - /** - * @return {@link #origin} (The location from which the patient came before admission.) - */ - public Reference getOrigin() { - if (this.origin == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.origin"); - else if (Configuration.doAutoCreate()) - this.origin = new Reference(); // cc - return this.origin; - } - - public boolean hasOrigin() { - return this.origin != null && !this.origin.isEmpty(); - } - - /** - * @param value {@link #origin} (The location from which the patient came before admission.) - */ - public EncounterHospitalizationComponent setOrigin(Reference value) { - this.origin = value; - return this; - } - - /** - * @return {@link #origin} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The location from which the patient came before admission.) - */ - public Location getOriginTarget() { - if (this.originTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.origin"); - else if (Configuration.doAutoCreate()) - this.originTarget = new Location(); // aa - return this.originTarget; - } - - /** - * @param value {@link #origin} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The location from which the patient came before admission.) - */ - public EncounterHospitalizationComponent setOriginTarget(Location value) { - this.originTarget = value; - return this; - } - - /** - * @return {@link #admitSource} (From where patient was admitted (physician referral, transfer).) - */ - public CodeableConcept getAdmitSource() { - if (this.admitSource == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.admitSource"); - else if (Configuration.doAutoCreate()) - this.admitSource = new CodeableConcept(); // cc - return this.admitSource; - } - - public boolean hasAdmitSource() { - return this.admitSource != null && !this.admitSource.isEmpty(); - } - - /** - * @param value {@link #admitSource} (From where patient was admitted (physician referral, transfer).) - */ - public EncounterHospitalizationComponent setAdmitSource(CodeableConcept value) { - this.admitSource = value; - return this; - } - - /** - * @return {@link #dietPreference} (Diet preferences reported by the patient.) - */ - public CodeableConcept getDietPreference() { - if (this.dietPreference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.dietPreference"); - else if (Configuration.doAutoCreate()) - this.dietPreference = new CodeableConcept(); // cc - return this.dietPreference; - } - - public boolean hasDietPreference() { - return this.dietPreference != null && !this.dietPreference.isEmpty(); - } - - /** - * @param value {@link #dietPreference} (Diet preferences reported by the patient.) - */ - public EncounterHospitalizationComponent setDietPreference(CodeableConcept value) { - this.dietPreference = value; - return this; - } - - /** - * @return {@link #specialCourtesy} (Special courtesies (VIP, board member).) - */ - public List getSpecialCourtesy() { - if (this.specialCourtesy == null) - this.specialCourtesy = new ArrayList(); - return this.specialCourtesy; - } - - public boolean hasSpecialCourtesy() { - if (this.specialCourtesy == null) - return false; - for (CodeableConcept item : this.specialCourtesy) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specialCourtesy} (Special courtesies (VIP, board member).) - */ - // syntactic sugar - public CodeableConcept addSpecialCourtesy() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.specialCourtesy == null) - this.specialCourtesy = new ArrayList(); - this.specialCourtesy.add(t); - return t; - } - - // syntactic sugar - public EncounterHospitalizationComponent addSpecialCourtesy(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.specialCourtesy == null) - this.specialCourtesy = new ArrayList(); - this.specialCourtesy.add(t); - return this; - } - - /** - * @return {@link #specialArrangement} (Wheelchair, translator, stretcher, etc.) - */ - public List getSpecialArrangement() { - if (this.specialArrangement == null) - this.specialArrangement = new ArrayList(); - return this.specialArrangement; - } - - public boolean hasSpecialArrangement() { - if (this.specialArrangement == null) - return false; - for (CodeableConcept item : this.specialArrangement) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specialArrangement} (Wheelchair, translator, stretcher, etc.) - */ - // syntactic sugar - public CodeableConcept addSpecialArrangement() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.specialArrangement == null) - this.specialArrangement = new ArrayList(); - this.specialArrangement.add(t); - return t; - } - - // syntactic sugar - public EncounterHospitalizationComponent addSpecialArrangement(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.specialArrangement == null) - this.specialArrangement = new ArrayList(); - this.specialArrangement.add(t); - return this; - } - - /** - * @return {@link #destination} (Location to which the patient is discharged.) - */ - public Reference getDestination() { - if (this.destination == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.destination"); - else if (Configuration.doAutoCreate()) - this.destination = new Reference(); // cc - return this.destination; - } - - public boolean hasDestination() { - return this.destination != null && !this.destination.isEmpty(); - } - - /** - * @param value {@link #destination} (Location to which the patient is discharged.) - */ - public EncounterHospitalizationComponent setDestination(Reference value) { - this.destination = value; - return this; - } - - /** - * @return {@link #destination} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Location to which the patient is discharged.) - */ - public Location getDestinationTarget() { - if (this.destinationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.destination"); - else if (Configuration.doAutoCreate()) - this.destinationTarget = new Location(); // aa - return this.destinationTarget; - } - - /** - * @param value {@link #destination} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Location to which the patient is discharged.) - */ - public EncounterHospitalizationComponent setDestinationTarget(Location value) { - this.destinationTarget = value; - return this; - } - - /** - * @return {@link #dischargeDisposition} (Category or kind of location after discharge.) - */ - public CodeableConcept getDischargeDisposition() { - if (this.dischargeDisposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.dischargeDisposition"); - else if (Configuration.doAutoCreate()) - this.dischargeDisposition = new CodeableConcept(); // cc - return this.dischargeDisposition; - } - - public boolean hasDischargeDisposition() { - return this.dischargeDisposition != null && !this.dischargeDisposition.isEmpty(); - } - - /** - * @param value {@link #dischargeDisposition} (Category or kind of location after discharge.) - */ - public EncounterHospitalizationComponent setDischargeDisposition(CodeableConcept value) { - this.dischargeDisposition = value; - return this; - } - - /** - * @return {@link #dischargeDiagnosis} (The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) - */ - public Reference getDischargeDiagnosis() { - if (this.dischargeDiagnosis == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.dischargeDiagnosis"); - else if (Configuration.doAutoCreate()) - this.dischargeDiagnosis = new Reference(); // cc - return this.dischargeDiagnosis; - } - - public boolean hasDischargeDiagnosis() { - return this.dischargeDiagnosis != null && !this.dischargeDiagnosis.isEmpty(); - } - - /** - * @param value {@link #dischargeDiagnosis} (The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) - */ - public EncounterHospitalizationComponent setDischargeDiagnosis(Reference value) { - this.dischargeDiagnosis = value; - return this; - } - - /** - * @return {@link #dischargeDiagnosis} The actual object that is the 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 final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) - */ - public Resource getDischargeDiagnosisTarget() { - return this.dischargeDiagnosisTarget; - } - - /** - * @param value {@link #dischargeDiagnosis} The actual object that is the 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 final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) - */ - public EncounterHospitalizationComponent setDischargeDiagnosisTarget(Resource value) { - this.dischargeDiagnosisTarget = value; - return this; - } - - /** - * @return {@link #reAdmission} (Whether this hospitalization is a readmission.). This is the underlying object with id, value and extensions. The accessor "getReAdmission" gives direct access to the value - */ - public BooleanType getReAdmissionElement() { - if (this.reAdmission == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.reAdmission"); - else if (Configuration.doAutoCreate()) - this.reAdmission = new BooleanType(); // bb - return this.reAdmission; - } - - public boolean hasReAdmissionElement() { - return this.reAdmission != null && !this.reAdmission.isEmpty(); - } - - public boolean hasReAdmission() { - return this.reAdmission != null && !this.reAdmission.isEmpty(); - } - - /** - * @param value {@link #reAdmission} (Whether this hospitalization is a readmission.). This is the underlying object with id, value and extensions. The accessor "getReAdmission" gives direct access to the value - */ - public EncounterHospitalizationComponent setReAdmissionElement(BooleanType value) { - this.reAdmission = value; - return this; - } - - /** - * @return Whether this hospitalization is a readmission. - */ - public boolean getReAdmission() { - return this.reAdmission == null || this.reAdmission.isEmpty() ? false : this.reAdmission.getValue(); - } - - /** - * @param value Whether this hospitalization is a readmission. - */ - public EncounterHospitalizationComponent setReAdmission(boolean value) { - if (this.reAdmission == null) - this.reAdmission = new BooleanType(); - this.reAdmission.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("preAdmissionIdentifier", "Identifier", "Pre-admission identifier.", 0, java.lang.Integer.MAX_VALUE, preAdmissionIdentifier)); - childrenList.add(new Property("origin", "Reference(Location)", "The location from which the patient came before admission.", 0, java.lang.Integer.MAX_VALUE, origin)); - childrenList.add(new Property("admitSource", "CodeableConcept", "From where patient was admitted (physician referral, transfer).", 0, java.lang.Integer.MAX_VALUE, admitSource)); - childrenList.add(new Property("dietPreference", "CodeableConcept", "Diet preferences reported by the patient.", 0, java.lang.Integer.MAX_VALUE, dietPreference)); - childrenList.add(new Property("specialCourtesy", "CodeableConcept", "Special courtesies (VIP, board member).", 0, java.lang.Integer.MAX_VALUE, specialCourtesy)); - childrenList.add(new Property("specialArrangement", "CodeableConcept", "Wheelchair, translator, stretcher, etc.", 0, java.lang.Integer.MAX_VALUE, specialArrangement)); - childrenList.add(new Property("destination", "Reference(Location)", "Location to which the patient is discharged.", 0, java.lang.Integer.MAX_VALUE, destination)); - childrenList.add(new Property("dischargeDisposition", "CodeableConcept", "Category or kind of location after discharge.", 0, java.lang.Integer.MAX_VALUE, dischargeDisposition)); - childrenList.add(new Property("dischargeDiagnosis", "Reference(Any)", "The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.", 0, java.lang.Integer.MAX_VALUE, dischargeDiagnosis)); - childrenList.add(new Property("reAdmission", "boolean", "Whether this hospitalization is a readmission.", 0, java.lang.Integer.MAX_VALUE, reAdmission)); - } - - public EncounterHospitalizationComponent copy() { - EncounterHospitalizationComponent dst = new EncounterHospitalizationComponent(); - copyValues(dst); - dst.preAdmissionIdentifier = preAdmissionIdentifier == null ? null : preAdmissionIdentifier.copy(); - dst.origin = origin == null ? null : origin.copy(); - dst.admitSource = admitSource == null ? null : admitSource.copy(); - dst.dietPreference = dietPreference == null ? null : dietPreference.copy(); - if (specialCourtesy != null) { - dst.specialCourtesy = new ArrayList(); - for (CodeableConcept i : specialCourtesy) - dst.specialCourtesy.add(i.copy()); - }; - if (specialArrangement != null) { - dst.specialArrangement = new ArrayList(); - for (CodeableConcept i : specialArrangement) - dst.specialArrangement.add(i.copy()); - }; - dst.destination = destination == null ? null : destination.copy(); - dst.dischargeDisposition = dischargeDisposition == null ? null : dischargeDisposition.copy(); - dst.dischargeDiagnosis = dischargeDiagnosis == null ? null : dischargeDiagnosis.copy(); - dst.reAdmission = reAdmission == null ? null : reAdmission.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof EncounterHospitalizationComponent)) - return false; - EncounterHospitalizationComponent o = (EncounterHospitalizationComponent) other; - return compareDeep(preAdmissionIdentifier, o.preAdmissionIdentifier, true) && compareDeep(origin, o.origin, true) - && compareDeep(admitSource, o.admitSource, true) && compareDeep(dietPreference, o.dietPreference, true) - && compareDeep(specialCourtesy, o.specialCourtesy, true) && compareDeep(specialArrangement, o.specialArrangement, true) - && compareDeep(destination, o.destination, true) && compareDeep(dischargeDisposition, o.dischargeDisposition, true) - && compareDeep(dischargeDiagnosis, o.dischargeDiagnosis, true) && compareDeep(reAdmission, o.reAdmission, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof EncounterHospitalizationComponent)) - return false; - EncounterHospitalizationComponent o = (EncounterHospitalizationComponent) other; - return compareValues(reAdmission, o.reAdmission, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (preAdmissionIdentifier == null || preAdmissionIdentifier.isEmpty()) - && (origin == null || origin.isEmpty()) && (admitSource == null || admitSource.isEmpty()) - && (dietPreference == null || dietPreference.isEmpty()) && (specialCourtesy == null || specialCourtesy.isEmpty()) - && (specialArrangement == null || specialArrangement.isEmpty()) && (destination == null || destination.isEmpty()) - && (dischargeDisposition == null || dischargeDisposition.isEmpty()) && (dischargeDiagnosis == null || dischargeDiagnosis.isEmpty()) - && (reAdmission == null || reAdmission.isEmpty()); - } - - } - - @Block() - public static class EncounterLocationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The location where the encounter takes place. - */ - @Child(name = "location", type = {Location.class}, order=1, min=1, max=1) - @Description(shortDefinition="Location the encounter takes place", formalDefinition="The location where the encounter takes place." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (The location where the encounter takes place.) - */ - protected Location locationTarget; - - /** - * The status of the participants presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="planned | present | reserved", formalDefinition="The status of the participants presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time." ) - protected Enumeration status; - - /** - * Time period during which the patient was present at the location. - */ - @Child(name = "period", type = {Period.class}, order=3, min=0, max=1) - @Description(shortDefinition="Time period during which the patient was present at the location", formalDefinition="Time period during which the patient was present at the location." ) - protected Period period; - - private static final long serialVersionUID = -322984880L; - - /* - * Constructor - */ - public EncounterLocationComponent() { - super(); - } - - /* - * Constructor - */ - public EncounterLocationComponent(Reference location) { - super(); - this.location = location; - } - - /** - * @return {@link #location} (The location where the encounter takes place.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterLocationComponent.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); // cc - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (The location where the encounter takes place.) - */ - public EncounterLocationComponent setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The location where the encounter takes place.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterLocationComponent.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); // aa - return this.locationTarget; - } - - /** - * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The location where the encounter takes place.) - */ - public EncounterLocationComponent setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #status} (The status of the participants presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterLocationComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new EncounterLocationStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the participants presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public EncounterLocationComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the participants presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time. - */ - public EncounterLocationStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the participants presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time. - */ - public EncounterLocationComponent setStatus(EncounterLocationStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new EncounterLocationStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #period} (Time period during which the patient was present at the location.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterLocationComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (Time period during which the patient was present at the location.) - */ - public EncounterLocationComponent setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("location", "Reference(Location)", "The location where the encounter takes place.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("status", "code", "The status of the participants presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("period", "Period", "Time period during which the patient was present at the location.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - public EncounterLocationComponent copy() { - EncounterLocationComponent dst = new EncounterLocationComponent(); - copyValues(dst); - dst.location = location == null ? null : location.copy(); - dst.status = status == null ? null : status.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof EncounterLocationComponent)) - return false; - EncounterLocationComponent o = (EncounterLocationComponent) other; - return compareDeep(location, o.location, true) && compareDeep(status, o.status, true) && compareDeep(period, o.period, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof EncounterLocationComponent)) - return false; - EncounterLocationComponent o = (EncounterLocationComponent) other; - return compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (location == null || location.isEmpty()) && (status == null || status.isEmpty()) - && (period == null || period.isEmpty()); - } - - } - - /** - * Identifier(s) by which this encounter is known. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Identifier(s) by which this encounter is known", formalDefinition="Identifier(s) by which this encounter is known." ) - protected List identifier; - - /** - * planned | arrived | in-progress | onleave | finished | cancelled. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="planned | arrived | in-progress | onleave | finished | cancelled", formalDefinition="planned | arrived | in-progress | onleave | finished | cancelled." ) - protected Enumeration status; - - /** - * The current status is always found in the current version of the resource. This status history permits the encounter resource to contain the status history without the needing to read through the historical versions of the resource, or even have the server store them. - */ - @Child(name = "statusHistory", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of Encounter statuses", formalDefinition="The current status is always found in the current version of the resource. This status history permits the encounter resource to contain the status history without the needing to read through the historical versions of the resource, or even have the server store them." ) - protected List statusHistory; - - /** - * inpatient | outpatient | ambulatory | emergency +. - */ - @Child(name = "class_", type = {CodeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="inpatient | outpatient | ambulatory | emergency +", formalDefinition="inpatient | outpatient | ambulatory | emergency +." ) - protected Enumeration class_; - - /** - * Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation). - */ - @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Specific type of encounter", formalDefinition="Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation)." ) - protected List type; - - /** - * The patient present at the encounter. - */ - @Child(name = "patient", type = {Patient.class}, order=5, min=0, max=1) - @Description(shortDefinition="The patient present at the encounter", formalDefinition="The patient present at the encounter." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient present at the encounter.) - */ - protected Patient patientTarget; - - /** - * Where a specific encounter should be classified as a part of a specific episode of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as govt reporting, or issue tracking. - */ - @Child(name = "episodeOfCare", type = {EpisodeOfCare.class}, order=6, min=0, max=1) - @Description(shortDefinition="An episode of care that this encounter should be recorded against", formalDefinition="Where a specific encounter should be classified as a part of a specific episode of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as govt reporting, or issue tracking." ) - protected Reference episodeOfCare; - - /** - * The actual object that is the target of the reference (Where a specific encounter should be classified as a part of a specific episode of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as govt reporting, or issue tracking.) - */ - protected EpisodeOfCare episodeOfCareTarget; - - /** - * The referral request that this encounter is satisfies (incoming referral). - */ - @Child(name = "incomingReferralRequest", type = {ReferralRequest.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Incoming Referral Request", formalDefinition="The referral request that this encounter is satisfies (incoming referral)." ) - protected List incomingReferralRequest; - /** - * The actual objects that are the target of the reference (The referral request that this encounter is satisfies (incoming referral).) - */ - protected List incomingReferralRequestTarget; - - - /** - * The main practitioner responsible for providing the service. - */ - @Child(name = "participant", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of participants involved in the encounter", formalDefinition="The main practitioner responsible for providing the service." ) - protected List participant; - - /** - * The appointment that scheduled this encounter. - */ - @Child(name = "fulfills", type = {Appointment.class}, order=9, min=0, max=1) - @Description(shortDefinition="The appointment that scheduled this encounter", formalDefinition="The appointment that scheduled this encounter." ) - protected Reference fulfills; - - /** - * The actual object that is the target of the reference (The appointment that scheduled this encounter.) - */ - protected Appointment fulfillsTarget; - - /** - * The start and end time of the encounter. - */ - @Child(name = "period", type = {Period.class}, order=10, min=0, max=1) - @Description(shortDefinition="The start and end time of the encounter", formalDefinition="The start and end time of the encounter." ) - protected Period period; - - /** - * Quantity of time the encounter lasted. This excludes the time during leaves of absence. - */ - @Child(name = "length", type = {Duration.class}, order=11, min=0, max=1) - @Description(shortDefinition="Quantity of time the encounter lasted (less time absent)", formalDefinition="Quantity of time the encounter lasted. This excludes the time during leaves of absence." ) - protected Duration length; - - /** - * Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Reason the encounter takes place (code)", formalDefinition="Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis." ) - protected List reason; - - /** +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. + */ +@ResourceDef(name="Encounter", profile="http://hl7.org/fhir/Profile/Encounter") +public class Encounter extends DomainResource { + + public enum EncounterState { + /** + * The Encounter has not yet started. + */ + PLANNED, + /** + * The Patient is present for the encounter, however is not currently meeting with a practitioner. + */ + ARRIVED, + /** + * The Encounter has begun and the patient is present / the practitioner and the patient are meeting. + */ + INPROGRESS, + /** + * The Encounter has begun, but the patient is temporarily on leave. + */ + ONLEAVE, + /** + * The Encounter has ended. + */ + FINISHED, + /** + * The Encounter has ended before it has begun. + */ + CANCELLED, + /** + * added to help the parsers + */ + NULL; + public static EncounterState fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return PLANNED; + if ("arrived".equals(codeString)) + return ARRIVED; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("onleave".equals(codeString)) + return ONLEAVE; + if ("finished".equals(codeString)) + return FINISHED; + if ("cancelled".equals(codeString)) + return CANCELLED; + throw new Exception("Unknown EncounterState code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PLANNED: return "planned"; + case ARRIVED: return "arrived"; + case INPROGRESS: return "in-progress"; + case ONLEAVE: return "onleave"; + case FINISHED: return "finished"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PLANNED: return ""; + case ARRIVED: return ""; + case INPROGRESS: return ""; + case ONLEAVE: return ""; + case FINISHED: return ""; + case CANCELLED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PLANNED: return "The Encounter has not yet started."; + case ARRIVED: return "The Patient is present for the encounter, however is not currently meeting with a practitioner."; + case INPROGRESS: return "The Encounter has begun and the patient is present / the practitioner and the patient are meeting."; + case ONLEAVE: return "The Encounter has begun, but the patient is temporarily on leave."; + case FINISHED: return "The Encounter has ended."; + case CANCELLED: return "The Encounter has ended before it has begun."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PLANNED: return "Planned"; + case ARRIVED: return "Arrived"; + case INPROGRESS: return "in-progress"; + case ONLEAVE: return "On Leave"; + case FINISHED: return "Finished"; + case CANCELLED: return "Cancelled"; + default: return "?"; + } + } + } + + public static class EncounterStateEnumFactory implements EnumFactory { + public EncounterState fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return EncounterState.PLANNED; + if ("arrived".equals(codeString)) + return EncounterState.ARRIVED; + if ("in-progress".equals(codeString)) + return EncounterState.INPROGRESS; + if ("onleave".equals(codeString)) + return EncounterState.ONLEAVE; + if ("finished".equals(codeString)) + return EncounterState.FINISHED; + if ("cancelled".equals(codeString)) + return EncounterState.CANCELLED; + throw new IllegalArgumentException("Unknown EncounterState code '"+codeString+"'"); + } + public String toCode(EncounterState code) { + if (code == EncounterState.PLANNED) + return "planned"; + if (code == EncounterState.ARRIVED) + return "arrived"; + if (code == EncounterState.INPROGRESS) + return "in-progress"; + if (code == EncounterState.ONLEAVE) + return "onleave"; + if (code == EncounterState.FINISHED) + return "finished"; + if (code == EncounterState.CANCELLED) + return "cancelled"; + return "?"; + } + } + + public enum EncounterClass { + /** + * An encounter during which the patient is hospitalized and stays overnight. + */ + INPATIENT, + /** + * An encounter during which the patient is not hospitalized overnight. + */ + OUTPATIENT, + /** + * An encounter where the patient visits the practitioner in his/her office, e.g. a G.P. visit. + */ + AMBULATORY, + /** + * An encounter where the patient needs urgent care. + */ + EMERGENCY, + /** + * An encounter where the practitioner visits the patient at his/her home. + */ + HOME, + /** + * An encounter taking place outside the regular environment for giving care. + */ + FIELD, + /** + * An encounter where the patient needs more prolonged treatment or investigations than outpatients, but who do not need to stay in the hospital overnight. + */ + DAYTIME, + /** + * An encounter that takes place where the patient and practitioner do not physically meet but use electronic means for contact. + */ + VIRTUAL, + /** + * Any other encounter type that is not described by one of the other values. Where this is used it is expected that an implementer will include an extension value to define what the actual other type is. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + public static EncounterClass fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("inpatient".equals(codeString)) + return INPATIENT; + if ("outpatient".equals(codeString)) + return OUTPATIENT; + if ("ambulatory".equals(codeString)) + return AMBULATORY; + if ("emergency".equals(codeString)) + return EMERGENCY; + if ("home".equals(codeString)) + return HOME; + if ("field".equals(codeString)) + return FIELD; + if ("daytime".equals(codeString)) + return DAYTIME; + if ("virtual".equals(codeString)) + return VIRTUAL; + if ("other".equals(codeString)) + return OTHER; + throw new Exception("Unknown EncounterClass code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INPATIENT: return "inpatient"; + case OUTPATIENT: return "outpatient"; + case AMBULATORY: return "ambulatory"; + case EMERGENCY: return "emergency"; + case HOME: return "home"; + case FIELD: return "field"; + case DAYTIME: return "daytime"; + case VIRTUAL: return "virtual"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPATIENT: return ""; + case OUTPATIENT: return ""; + case AMBULATORY: return ""; + case EMERGENCY: return ""; + case HOME: return ""; + case FIELD: return ""; + case DAYTIME: return ""; + case VIRTUAL: return ""; + case OTHER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPATIENT: return "An encounter during which the patient is hospitalized and stays overnight."; + case OUTPATIENT: return "An encounter during which the patient is not hospitalized overnight."; + case AMBULATORY: return "An encounter where the patient visits the practitioner in his/her office, e.g. a G.P. visit."; + case EMERGENCY: return "An encounter where the patient needs urgent care."; + case HOME: return "An encounter where the practitioner visits the patient at his/her home."; + case FIELD: return "An encounter taking place outside the regular environment for giving care."; + case DAYTIME: return "An encounter where the patient needs more prolonged treatment or investigations than outpatients, but who do not need to stay in the hospital overnight."; + case VIRTUAL: return "An encounter that takes place where the patient and practitioner do not physically meet but use electronic means for contact."; + case OTHER: return "Any other encounter type that is not described by one of the other values. Where this is used it is expected that an implementer will include an extension value to define what the actual other type is."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPATIENT: return "Inpatient"; + case OUTPATIENT: return "Outpatient"; + case AMBULATORY: return "Ambulatory"; + case EMERGENCY: return "Emergency"; + case HOME: return "Home"; + case FIELD: return "Field"; + case DAYTIME: return "Daytime"; + case VIRTUAL: return "Virtual"; + case OTHER: return "Other"; + default: return "?"; + } + } + } + + public static class EncounterClassEnumFactory implements EnumFactory { + public EncounterClass fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("inpatient".equals(codeString)) + return EncounterClass.INPATIENT; + if ("outpatient".equals(codeString)) + return EncounterClass.OUTPATIENT; + if ("ambulatory".equals(codeString)) + return EncounterClass.AMBULATORY; + if ("emergency".equals(codeString)) + return EncounterClass.EMERGENCY; + if ("home".equals(codeString)) + return EncounterClass.HOME; + if ("field".equals(codeString)) + return EncounterClass.FIELD; + if ("daytime".equals(codeString)) + return EncounterClass.DAYTIME; + if ("virtual".equals(codeString)) + return EncounterClass.VIRTUAL; + if ("other".equals(codeString)) + return EncounterClass.OTHER; + throw new IllegalArgumentException("Unknown EncounterClass code '"+codeString+"'"); + } + public String toCode(EncounterClass code) { + if (code == EncounterClass.INPATIENT) + return "inpatient"; + if (code == EncounterClass.OUTPATIENT) + return "outpatient"; + if (code == EncounterClass.AMBULATORY) + return "ambulatory"; + if (code == EncounterClass.EMERGENCY) + return "emergency"; + if (code == EncounterClass.HOME) + return "home"; + if (code == EncounterClass.FIELD) + return "field"; + if (code == EncounterClass.DAYTIME) + return "daytime"; + if (code == EncounterClass.VIRTUAL) + return "virtual"; + if (code == EncounterClass.OTHER) + return "other"; + return "?"; + } + } + + public enum EncounterLocationStatus { + /** + * The patient is planned to be moved to this location at some point in the future. + */ + PLANNED, + /** + * The patient is currently at this location, or was between the period specified. + */ + PRESENT, + /** + * This location is held empty for this patient. + */ + RESERVED, + /** + * added to help the parsers + */ + NULL; + public static EncounterLocationStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return PLANNED; + if ("present".equals(codeString)) + return PRESENT; + if ("reserved".equals(codeString)) + return RESERVED; + throw new Exception("Unknown EncounterLocationStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PLANNED: return "planned"; + case PRESENT: return "present"; + case RESERVED: return "reserved"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PLANNED: return ""; + case PRESENT: return ""; + case RESERVED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PLANNED: return "The patient is planned to be moved to this location at some point in the future."; + case PRESENT: return "The patient is currently at this location, or was between the period specified."; + case RESERVED: return "This location is held empty for this patient."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PLANNED: return "Planned"; + case PRESENT: return "Present"; + case RESERVED: return "Reserved"; + default: return "?"; + } + } + } + + public static class EncounterLocationStatusEnumFactory implements EnumFactory { + public EncounterLocationStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return EncounterLocationStatus.PLANNED; + if ("present".equals(codeString)) + return EncounterLocationStatus.PRESENT; + if ("reserved".equals(codeString)) + return EncounterLocationStatus.RESERVED; + throw new IllegalArgumentException("Unknown EncounterLocationStatus code '"+codeString+"'"); + } + public String toCode(EncounterLocationStatus code) { + if (code == EncounterLocationStatus.PLANNED) + return "planned"; + if (code == EncounterLocationStatus.PRESENT) + return "present"; + if (code == EncounterLocationStatus.RESERVED) + return "reserved"; + return "?"; + } + } + + @Block() + public static class EncounterStatusHistoryComponent extends BackboneElement implements IBaseBackboneElement { + /** + * planned | arrived | in-progress | onleave | finished | cancelled. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="planned | arrived | in-progress | onleave | finished | cancelled", formalDefinition="planned | arrived | in-progress | onleave | finished | cancelled." ) + protected Enumeration status; + + /** + * The time that the episode was in the specified status. + */ + @Child(name = "period", type = {Period.class}, order=2, min=1, max=1) + @Description(shortDefinition="The time that the episode was in the specified status", formalDefinition="The time that the episode was in the specified status." ) + protected Period period; + + private static final long serialVersionUID = 919229161L; + + /* + * Constructor + */ + public EncounterStatusHistoryComponent() { + super(); + } + + /* + * Constructor + */ + public EncounterStatusHistoryComponent(Enumeration status, Period period) { + super(); + this.status = status; + this.period = period; + } + + /** + * @return {@link #status} (planned | arrived | in-progress | onleave | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterStatusHistoryComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new EncounterStateEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (planned | arrived | in-progress | onleave | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public EncounterStatusHistoryComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return planned | arrived | in-progress | onleave | finished | cancelled. + */ + public EncounterState getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value planned | arrived | in-progress | onleave | finished | cancelled. + */ + public EncounterStatusHistoryComponent setStatus(EncounterState value) { + if (this.status == null) + this.status = new Enumeration(new EncounterStateEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #period} (The time that the episode was in the specified status.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterStatusHistoryComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The time that the episode was in the specified status.) + */ + public EncounterStatusHistoryComponent setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("status", "code", "planned | arrived | in-progress | onleave | finished | cancelled.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("period", "Period", "The time that the episode was in the specified status.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + public EncounterStatusHistoryComponent copy() { + EncounterStatusHistoryComponent dst = new EncounterStatusHistoryComponent(); + copyValues(dst); + dst.status = status == null ? null : status.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof EncounterStatusHistoryComponent)) + return false; + EncounterStatusHistoryComponent o = (EncounterStatusHistoryComponent) other; + return compareDeep(status, o.status, true) && compareDeep(period, o.period, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof EncounterStatusHistoryComponent)) + return false; + EncounterStatusHistoryComponent o = (EncounterStatusHistoryComponent) other; + return compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (status == null || status.isEmpty()) && (period == null || period.isEmpty()) + ; + } + + } + + @Block() + public static class EncounterParticipantComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Role of participant in encounter. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Role of participant in encounter", formalDefinition="Role of participant in encounter." ) + protected List type; + + /** + * The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period. + */ + @Child(name = "period", type = {Period.class}, order=2, min=0, max=1) + @Description(shortDefinition="Period of time during the encounter participant was present", formalDefinition="The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period." ) + protected Period period; + + /** + * Persons involved in the encounter other than the patient. + */ + @Child(name = "individual", type = {Practitioner.class, RelatedPerson.class}, order=3, min=0, max=1) + @Description(shortDefinition="Persons involved in the encounter other than the patient", formalDefinition="Persons involved in the encounter other than the patient." ) + protected Reference individual; + + /** + * The actual object that is the target of the reference (Persons involved in the encounter other than the patient.) + */ + protected Resource individualTarget; + + private static final long serialVersionUID = 317095765L; + + /* + * Constructor + */ + public EncounterParticipantComponent() { + super(); + } + + /** + * @return {@link #type} (Role of participant in encounter.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (CodeableConcept item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (Role of participant in encounter.) + */ + // syntactic sugar + public CodeableConcept addType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + // syntactic sugar + public EncounterParticipantComponent addType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + /** + * @return {@link #period} (The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterParticipantComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period.) + */ + public EncounterParticipantComponent setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #individual} (Persons involved in the encounter other than the patient.) + */ + public Reference getIndividual() { + if (this.individual == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterParticipantComponent.individual"); + else if (Configuration.doAutoCreate()) + this.individual = new Reference(); // cc + return this.individual; + } + + public boolean hasIndividual() { + return this.individual != null && !this.individual.isEmpty(); + } + + /** + * @param value {@link #individual} (Persons involved in the encounter other than the patient.) + */ + public EncounterParticipantComponent setIndividual(Reference value) { + this.individual = value; + return this; + } + + /** + * @return {@link #individual} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Persons involved in the encounter other than the patient.) + */ + public Resource getIndividualTarget() { + return this.individualTarget; + } + + /** + * @param value {@link #individual} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Persons involved in the encounter other than the patient.) + */ + public EncounterParticipantComponent setIndividualTarget(Resource value) { + this.individualTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "Role of participant in encounter.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("period", "Period", "The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("individual", "Reference(Practitioner|RelatedPerson)", "Persons involved in the encounter other than the patient.", 0, java.lang.Integer.MAX_VALUE, individual)); + } + + public EncounterParticipantComponent copy() { + EncounterParticipantComponent dst = new EncounterParticipantComponent(); + copyValues(dst); + if (type != null) { + dst.type = new ArrayList(); + for (CodeableConcept i : type) + dst.type.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + dst.individual = individual == null ? null : individual.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof EncounterParticipantComponent)) + return false; + EncounterParticipantComponent o = (EncounterParticipantComponent) other; + return compareDeep(type, o.type, true) && compareDeep(period, o.period, true) && compareDeep(individual, o.individual, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof EncounterParticipantComponent)) + return false; + EncounterParticipantComponent o = (EncounterParticipantComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (period == null || period.isEmpty()) + && (individual == null || individual.isEmpty()); + } + + } + + @Block() + public static class EncounterHospitalizationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Pre-admission identifier. + */ + @Child(name = "preAdmissionIdentifier", type = {Identifier.class}, order=1, min=0, max=1) + @Description(shortDefinition="Pre-admission identifier", formalDefinition="Pre-admission identifier." ) + protected Identifier preAdmissionIdentifier; + + /** + * The location from which the patient came before admission. + */ + @Child(name = "origin", type = {Location.class}, order=2, min=0, max=1) + @Description(shortDefinition="The location from which the patient came before admission", formalDefinition="The location from which the patient came before admission." ) + protected Reference origin; + + /** + * The actual object that is the target of the reference (The location from which the patient came before admission.) + */ + protected Location originTarget; + + /** + * From where patient was admitted (physician referral, transfer). + */ + @Child(name = "admitSource", type = {CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="From where patient was admitted (physician referral, transfer)", formalDefinition="From where patient was admitted (physician referral, transfer)." ) + protected CodeableConcept admitSource; + + /** + * Diet preferences reported by the patient. + */ + @Child(name = "dietPreference", type = {CodeableConcept.class}, order=4, min=0, max=1) + @Description(shortDefinition="Diet preferences reported by the patient", formalDefinition="Diet preferences reported by the patient." ) + protected CodeableConcept dietPreference; + + /** + * Special courtesies (VIP, board member). + */ + @Child(name = "specialCourtesy", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Special courtesies (VIP, board member)", formalDefinition="Special courtesies (VIP, board member)." ) + protected List specialCourtesy; + + /** + * Wheelchair, translator, stretcher, etc. + */ + @Child(name = "specialArrangement", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Wheelchair, translator, stretcher, etc", formalDefinition="Wheelchair, translator, stretcher, etc." ) + protected List specialArrangement; + + /** + * Location to which the patient is discharged. + */ + @Child(name = "destination", type = {Location.class}, order=7, min=0, max=1) + @Description(shortDefinition="Location to which the patient is discharged", formalDefinition="Location to which the patient is discharged." ) + protected Reference destination; + + /** + * The actual object that is the target of the reference (Location to which the patient is discharged.) + */ + protected Location destinationTarget; + + /** + * Category or kind of location after discharge. + */ + @Child(name = "dischargeDisposition", type = {CodeableConcept.class}, order=8, min=0, max=1) + @Description(shortDefinition="Category or kind of location after discharge", formalDefinition="Category or kind of location after discharge." ) + protected CodeableConcept dischargeDisposition; + + /** + * The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete. + */ + @Child(name = "dischargeDiagnosis", type = {}, order=9, min=0, max=1) + @Description(shortDefinition="The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete", formalDefinition="The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete." ) + protected Reference dischargeDiagnosis; + + /** + * The actual object that is the target of the reference (The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) + */ + protected Resource dischargeDiagnosisTarget; + + /** + * Whether this hospitalization is a readmission. + */ + @Child(name = "reAdmission", type = {BooleanType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Is this hospitalization a readmission?", formalDefinition="Whether this hospitalization is a readmission." ) + protected BooleanType reAdmission; + + private static final long serialVersionUID = -990619663L; + + /* + * Constructor + */ + public EncounterHospitalizationComponent() { + super(); + } + + /** + * @return {@link #preAdmissionIdentifier} (Pre-admission identifier.) + */ + public Identifier getPreAdmissionIdentifier() { + if (this.preAdmissionIdentifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.preAdmissionIdentifier"); + else if (Configuration.doAutoCreate()) + this.preAdmissionIdentifier = new Identifier(); // cc + return this.preAdmissionIdentifier; + } + + public boolean hasPreAdmissionIdentifier() { + return this.preAdmissionIdentifier != null && !this.preAdmissionIdentifier.isEmpty(); + } + + /** + * @param value {@link #preAdmissionIdentifier} (Pre-admission identifier.) + */ + public EncounterHospitalizationComponent setPreAdmissionIdentifier(Identifier value) { + this.preAdmissionIdentifier = value; + return this; + } + + /** + * @return {@link #origin} (The location from which the patient came before admission.) + */ + public Reference getOrigin() { + if (this.origin == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.origin"); + else if (Configuration.doAutoCreate()) + this.origin = new Reference(); // cc + return this.origin; + } + + public boolean hasOrigin() { + return this.origin != null && !this.origin.isEmpty(); + } + + /** + * @param value {@link #origin} (The location from which the patient came before admission.) + */ + public EncounterHospitalizationComponent setOrigin(Reference value) { + this.origin = value; + return this; + } + + /** + * @return {@link #origin} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The location from which the patient came before admission.) + */ + public Location getOriginTarget() { + if (this.originTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.origin"); + else if (Configuration.doAutoCreate()) + this.originTarget = new Location(); // aa + return this.originTarget; + } + + /** + * @param value {@link #origin} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The location from which the patient came before admission.) + */ + public EncounterHospitalizationComponent setOriginTarget(Location value) { + this.originTarget = value; + return this; + } + + /** + * @return {@link #admitSource} (From where patient was admitted (physician referral, transfer).) + */ + public CodeableConcept getAdmitSource() { + if (this.admitSource == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.admitSource"); + else if (Configuration.doAutoCreate()) + this.admitSource = new CodeableConcept(); // cc + return this.admitSource; + } + + public boolean hasAdmitSource() { + return this.admitSource != null && !this.admitSource.isEmpty(); + } + + /** + * @param value {@link #admitSource} (From where patient was admitted (physician referral, transfer).) + */ + public EncounterHospitalizationComponent setAdmitSource(CodeableConcept value) { + this.admitSource = value; + return this; + } + + /** + * @return {@link #dietPreference} (Diet preferences reported by the patient.) + */ + public CodeableConcept getDietPreference() { + if (this.dietPreference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.dietPreference"); + else if (Configuration.doAutoCreate()) + this.dietPreference = new CodeableConcept(); // cc + return this.dietPreference; + } + + public boolean hasDietPreference() { + return this.dietPreference != null && !this.dietPreference.isEmpty(); + } + + /** + * @param value {@link #dietPreference} (Diet preferences reported by the patient.) + */ + public EncounterHospitalizationComponent setDietPreference(CodeableConcept value) { + this.dietPreference = value; + return this; + } + + /** + * @return {@link #specialCourtesy} (Special courtesies (VIP, board member).) + */ + public List getSpecialCourtesy() { + if (this.specialCourtesy == null) + this.specialCourtesy = new ArrayList(); + return this.specialCourtesy; + } + + public boolean hasSpecialCourtesy() { + if (this.specialCourtesy == null) + return false; + for (CodeableConcept item : this.specialCourtesy) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specialCourtesy} (Special courtesies (VIP, board member).) + */ + // syntactic sugar + public CodeableConcept addSpecialCourtesy() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.specialCourtesy == null) + this.specialCourtesy = new ArrayList(); + this.specialCourtesy.add(t); + return t; + } + + // syntactic sugar + public EncounterHospitalizationComponent addSpecialCourtesy(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.specialCourtesy == null) + this.specialCourtesy = new ArrayList(); + this.specialCourtesy.add(t); + return this; + } + + /** + * @return {@link #specialArrangement} (Wheelchair, translator, stretcher, etc.) + */ + public List getSpecialArrangement() { + if (this.specialArrangement == null) + this.specialArrangement = new ArrayList(); + return this.specialArrangement; + } + + public boolean hasSpecialArrangement() { + if (this.specialArrangement == null) + return false; + for (CodeableConcept item : this.specialArrangement) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specialArrangement} (Wheelchair, translator, stretcher, etc.) + */ + // syntactic sugar + public CodeableConcept addSpecialArrangement() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.specialArrangement == null) + this.specialArrangement = new ArrayList(); + this.specialArrangement.add(t); + return t; + } + + // syntactic sugar + public EncounterHospitalizationComponent addSpecialArrangement(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.specialArrangement == null) + this.specialArrangement = new ArrayList(); + this.specialArrangement.add(t); + return this; + } + + /** + * @return {@link #destination} (Location to which the patient is discharged.) + */ + public Reference getDestination() { + if (this.destination == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.destination"); + else if (Configuration.doAutoCreate()) + this.destination = new Reference(); // cc + return this.destination; + } + + public boolean hasDestination() { + return this.destination != null && !this.destination.isEmpty(); + } + + /** + * @param value {@link #destination} (Location to which the patient is discharged.) + */ + public EncounterHospitalizationComponent setDestination(Reference value) { + this.destination = value; + return this; + } + + /** + * @return {@link #destination} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Location to which the patient is discharged.) + */ + public Location getDestinationTarget() { + if (this.destinationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.destination"); + else if (Configuration.doAutoCreate()) + this.destinationTarget = new Location(); // aa + return this.destinationTarget; + } + + /** + * @param value {@link #destination} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Location to which the patient is discharged.) + */ + public EncounterHospitalizationComponent setDestinationTarget(Location value) { + this.destinationTarget = value; + return this; + } + + /** + * @return {@link #dischargeDisposition} (Category or kind of location after discharge.) + */ + public CodeableConcept getDischargeDisposition() { + if (this.dischargeDisposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.dischargeDisposition"); + else if (Configuration.doAutoCreate()) + this.dischargeDisposition = new CodeableConcept(); // cc + return this.dischargeDisposition; + } + + public boolean hasDischargeDisposition() { + return this.dischargeDisposition != null && !this.dischargeDisposition.isEmpty(); + } + + /** + * @param value {@link #dischargeDisposition} (Category or kind of location after discharge.) + */ + public EncounterHospitalizationComponent setDischargeDisposition(CodeableConcept value) { + this.dischargeDisposition = value; + return this; + } + + /** + * @return {@link #dischargeDiagnosis} (The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) + */ + public Reference getDischargeDiagnosis() { + if (this.dischargeDiagnosis == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.dischargeDiagnosis"); + else if (Configuration.doAutoCreate()) + this.dischargeDiagnosis = new Reference(); // cc + return this.dischargeDiagnosis; + } + + public boolean hasDischargeDiagnosis() { + return this.dischargeDiagnosis != null && !this.dischargeDiagnosis.isEmpty(); + } + + /** + * @param value {@link #dischargeDiagnosis} (The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) + */ + public EncounterHospitalizationComponent setDischargeDiagnosis(Reference value) { + this.dischargeDiagnosis = value; + return this; + } + + /** + * @return {@link #dischargeDiagnosis} The actual object that is the 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 final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) + */ + public Resource getDischargeDiagnosisTarget() { + return this.dischargeDiagnosisTarget; + } + + /** + * @param value {@link #dischargeDiagnosis} The actual object that is the 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 final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) + */ + public EncounterHospitalizationComponent setDischargeDiagnosisTarget(Resource value) { + this.dischargeDiagnosisTarget = value; + return this; + } + + /** + * @return {@link #reAdmission} (Whether this hospitalization is a readmission.). This is the underlying object with id, value and extensions. The accessor "getReAdmission" gives direct access to the value + */ + public BooleanType getReAdmissionElement() { + if (this.reAdmission == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.reAdmission"); + else if (Configuration.doAutoCreate()) + this.reAdmission = new BooleanType(); // bb + return this.reAdmission; + } + + public boolean hasReAdmissionElement() { + return this.reAdmission != null && !this.reAdmission.isEmpty(); + } + + public boolean hasReAdmission() { + return this.reAdmission != null && !this.reAdmission.isEmpty(); + } + + /** + * @param value {@link #reAdmission} (Whether this hospitalization is a readmission.). This is the underlying object with id, value and extensions. The accessor "getReAdmission" gives direct access to the value + */ + public EncounterHospitalizationComponent setReAdmissionElement(BooleanType value) { + this.reAdmission = value; + return this; + } + + /** + * @return Whether this hospitalization is a readmission. + */ + public boolean getReAdmission() { + return this.reAdmission == null || this.reAdmission.isEmpty() ? false : this.reAdmission.getValue(); + } + + /** + * @param value Whether this hospitalization is a readmission. + */ + public EncounterHospitalizationComponent setReAdmission(boolean value) { + if (this.reAdmission == null) + this.reAdmission = new BooleanType(); + this.reAdmission.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("preAdmissionIdentifier", "Identifier", "Pre-admission identifier.", 0, java.lang.Integer.MAX_VALUE, preAdmissionIdentifier)); + childrenList.add(new Property("origin", "Reference(Location)", "The location from which the patient came before admission.", 0, java.lang.Integer.MAX_VALUE, origin)); + childrenList.add(new Property("admitSource", "CodeableConcept", "From where patient was admitted (physician referral, transfer).", 0, java.lang.Integer.MAX_VALUE, admitSource)); + childrenList.add(new Property("dietPreference", "CodeableConcept", "Diet preferences reported by the patient.", 0, java.lang.Integer.MAX_VALUE, dietPreference)); + childrenList.add(new Property("specialCourtesy", "CodeableConcept", "Special courtesies (VIP, board member).", 0, java.lang.Integer.MAX_VALUE, specialCourtesy)); + childrenList.add(new Property("specialArrangement", "CodeableConcept", "Wheelchair, translator, stretcher, etc.", 0, java.lang.Integer.MAX_VALUE, specialArrangement)); + childrenList.add(new Property("destination", "Reference(Location)", "Location to which the patient is discharged.", 0, java.lang.Integer.MAX_VALUE, destination)); + childrenList.add(new Property("dischargeDisposition", "CodeableConcept", "Category or kind of location after discharge.", 0, java.lang.Integer.MAX_VALUE, dischargeDisposition)); + childrenList.add(new Property("dischargeDiagnosis", "Reference(Any)", "The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.", 0, java.lang.Integer.MAX_VALUE, dischargeDiagnosis)); + childrenList.add(new Property("reAdmission", "boolean", "Whether this hospitalization is a readmission.", 0, java.lang.Integer.MAX_VALUE, reAdmission)); + } + + public EncounterHospitalizationComponent copy() { + EncounterHospitalizationComponent dst = new EncounterHospitalizationComponent(); + copyValues(dst); + dst.preAdmissionIdentifier = preAdmissionIdentifier == null ? null : preAdmissionIdentifier.copy(); + dst.origin = origin == null ? null : origin.copy(); + dst.admitSource = admitSource == null ? null : admitSource.copy(); + dst.dietPreference = dietPreference == null ? null : dietPreference.copy(); + if (specialCourtesy != null) { + dst.specialCourtesy = new ArrayList(); + for (CodeableConcept i : specialCourtesy) + dst.specialCourtesy.add(i.copy()); + }; + if (specialArrangement != null) { + dst.specialArrangement = new ArrayList(); + for (CodeableConcept i : specialArrangement) + dst.specialArrangement.add(i.copy()); + }; + dst.destination = destination == null ? null : destination.copy(); + dst.dischargeDisposition = dischargeDisposition == null ? null : dischargeDisposition.copy(); + dst.dischargeDiagnosis = dischargeDiagnosis == null ? null : dischargeDiagnosis.copy(); + dst.reAdmission = reAdmission == null ? null : reAdmission.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof EncounterHospitalizationComponent)) + return false; + EncounterHospitalizationComponent o = (EncounterHospitalizationComponent) other; + return compareDeep(preAdmissionIdentifier, o.preAdmissionIdentifier, true) && compareDeep(origin, o.origin, true) + && compareDeep(admitSource, o.admitSource, true) && compareDeep(dietPreference, o.dietPreference, true) + && compareDeep(specialCourtesy, o.specialCourtesy, true) && compareDeep(specialArrangement, o.specialArrangement, true) + && compareDeep(destination, o.destination, true) && compareDeep(dischargeDisposition, o.dischargeDisposition, true) + && compareDeep(dischargeDiagnosis, o.dischargeDiagnosis, true) && compareDeep(reAdmission, o.reAdmission, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof EncounterHospitalizationComponent)) + return false; + EncounterHospitalizationComponent o = (EncounterHospitalizationComponent) other; + return compareValues(reAdmission, o.reAdmission, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (preAdmissionIdentifier == null || preAdmissionIdentifier.isEmpty()) + && (origin == null || origin.isEmpty()) && (admitSource == null || admitSource.isEmpty()) + && (dietPreference == null || dietPreference.isEmpty()) && (specialCourtesy == null || specialCourtesy.isEmpty()) + && (specialArrangement == null || specialArrangement.isEmpty()) && (destination == null || destination.isEmpty()) + && (dischargeDisposition == null || dischargeDisposition.isEmpty()) && (dischargeDiagnosis == null || dischargeDiagnosis.isEmpty()) + && (reAdmission == null || reAdmission.isEmpty()); + } + + } + + @Block() + public static class EncounterLocationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The location where the encounter takes place. + */ + @Child(name = "location", type = {Location.class}, order=1, min=1, max=1) + @Description(shortDefinition="Location the encounter takes place", formalDefinition="The location where the encounter takes place." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (The location where the encounter takes place.) + */ + protected Location locationTarget; + + /** + * The status of the participants presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="planned | present | reserved", formalDefinition="The status of the participants presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time." ) + protected Enumeration status; + + /** + * Time period during which the patient was present at the location. + */ + @Child(name = "period", type = {Period.class}, order=3, min=0, max=1) + @Description(shortDefinition="Time period during which the patient was present at the location", formalDefinition="Time period during which the patient was present at the location." ) + protected Period period; + + private static final long serialVersionUID = -322984880L; + + /* + * Constructor + */ + public EncounterLocationComponent() { + super(); + } + + /* + * Constructor + */ + public EncounterLocationComponent(Reference location) { + super(); + this.location = location; + } + + /** + * @return {@link #location} (The location where the encounter takes place.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterLocationComponent.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); // cc + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (The location where the encounter takes place.) + */ + public EncounterLocationComponent setLocation(Reference value) { + this.location = value; + return this; + } + + /** + * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The location where the encounter takes place.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterLocationComponent.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); // aa + return this.locationTarget; + } + + /** + * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The location where the encounter takes place.) + */ + public EncounterLocationComponent setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #status} (The status of the participants presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterLocationComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new EncounterLocationStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status of the participants presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public EncounterLocationComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the participants presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time. + */ + public EncounterLocationStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the participants presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time. + */ + public EncounterLocationComponent setStatus(EncounterLocationStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new EncounterLocationStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #period} (Time period during which the patient was present at the location.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterLocationComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Time period during which the patient was present at the location.) + */ + public EncounterLocationComponent setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("location", "Reference(Location)", "The location where the encounter takes place.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("status", "code", "The status of the participants presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("period", "Period", "Time period during which the patient was present at the location.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + public EncounterLocationComponent copy() { + EncounterLocationComponent dst = new EncounterLocationComponent(); + copyValues(dst); + dst.location = location == null ? null : location.copy(); + dst.status = status == null ? null : status.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof EncounterLocationComponent)) + return false; + EncounterLocationComponent o = (EncounterLocationComponent) other; + return compareDeep(location, o.location, true) && compareDeep(status, o.status, true) && compareDeep(period, o.period, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof EncounterLocationComponent)) + return false; + EncounterLocationComponent o = (EncounterLocationComponent) other; + return compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (location == null || location.isEmpty()) && (status == null || status.isEmpty()) + && (period == null || period.isEmpty()); + } + + } + + /** + * Identifier(s) by which this encounter is known. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Identifier(s) by which this encounter is known", formalDefinition="Identifier(s) by which this encounter is known." ) + protected List identifier; + + /** + * planned | arrived | in-progress | onleave | finished | cancelled. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="planned | arrived | in-progress | onleave | finished | cancelled", formalDefinition="planned | arrived | in-progress | onleave | finished | cancelled." ) + protected Enumeration status; + + /** + * The current status is always found in the current version of the resource. This status history permits the encounter resource to contain the status history without the needing to read through the historical versions of the resource, or even have the server store them. + */ + @Child(name = "statusHistory", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of Encounter statuses", formalDefinition="The current status is always found in the current version of the resource. This status history permits the encounter resource to contain the status history without the needing to read through the historical versions of the resource, or even have the server store them." ) + protected List statusHistory; + + /** + * inpatient | outpatient | ambulatory | emergency +. + */ + @Child(name = "class_", type = {CodeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="inpatient | outpatient | ambulatory | emergency +", formalDefinition="inpatient | outpatient | ambulatory | emergency +." ) + protected Enumeration class_; + + /** + * Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation). + */ + @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Specific type of encounter", formalDefinition="Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation)." ) + protected List type; + + /** + * The patient present at the encounter. + */ + @Child(name = "patient", type = {Patient.class}, order=5, min=0, max=1) + @Description(shortDefinition="The patient present at the encounter", formalDefinition="The patient present at the encounter." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient present at the encounter.) + */ + protected Patient patientTarget; + + /** + * Where a specific encounter should be classified as a part of a specific episode of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as govt reporting, or issue tracking. + */ + @Child(name = "episodeOfCare", type = {EpisodeOfCare.class}, order=6, min=0, max=1) + @Description(shortDefinition="An episode of care that this encounter should be recorded against", formalDefinition="Where a specific encounter should be classified as a part of a specific episode of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as govt reporting, or issue tracking." ) + protected Reference episodeOfCare; + + /** + * The actual object that is the target of the reference (Where a specific encounter should be classified as a part of a specific episode of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as govt reporting, or issue tracking.) + */ + protected EpisodeOfCare episodeOfCareTarget; + + /** + * The referral request that this encounter is satisfies (incoming referral). + */ + @Child(name = "incomingReferralRequest", type = {ReferralRequest.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Incoming Referral Request", formalDefinition="The referral request that this encounter is satisfies (incoming referral)." ) + protected List incomingReferralRequest; + /** + * The actual objects that are the target of the reference (The referral request that this encounter is satisfies (incoming referral).) + */ + protected List incomingReferralRequestTarget; + + + /** + * The main practitioner responsible for providing the service. + */ + @Child(name = "participant", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of participants involved in the encounter", formalDefinition="The main practitioner responsible for providing the service." ) + protected List participant; + + /** + * The appointment that scheduled this encounter. + */ + @Child(name = "fulfills", type = {Appointment.class}, order=9, min=0, max=1) + @Description(shortDefinition="The appointment that scheduled this encounter", formalDefinition="The appointment that scheduled this encounter." ) + protected Reference fulfills; + + /** + * The actual object that is the target of the reference (The appointment that scheduled this encounter.) + */ + protected Appointment fulfillsTarget; + + /** + * The start and end time of the encounter. + */ + @Child(name = "period", type = {Period.class}, order=10, min=0, max=1) + @Description(shortDefinition="The start and end time of the encounter", formalDefinition="The start and end time of the encounter." ) + protected Period period; + + /** + * Quantity of time the encounter lasted. This excludes the time during leaves of absence. + */ + @Child(name = "length", type = {Duration.class}, order=11, min=0, max=1) + @Description(shortDefinition="Quantity of time the encounter lasted (less time absent)", formalDefinition="Quantity of time the encounter lasted. This excludes the time during leaves of absence." ) + protected Duration length; + + /** + * Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Reason the encounter takes place (code)", formalDefinition="Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis." ) + protected List reason; + + /** * Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. -The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure. - */ - @Child(name = "indication", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Reason the encounter takes place (resource)", formalDefinition="Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis.\nThe indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure." ) - protected List indication; - /** +The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure. + */ + @Child(name = "indication", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Reason the encounter takes place (resource)", formalDefinition="Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis.\nThe indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure." ) + protected List indication; + /** * The actual objects that are the target of the reference (Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. -The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.) - */ - protected List indicationTarget; - - - /** - * Indicates the urgency of the encounter. - */ - @Child(name = "priority", type = {CodeableConcept.class}, order=14, min=0, max=1) - @Description(shortDefinition="Indicates the urgency of the encounter", formalDefinition="Indicates the urgency of the encounter." ) - protected CodeableConcept priority; - - /** - * Details about an admission to a clinic. - */ - @Child(name = "hospitalization", type = {}, order=15, min=0, max=1) - @Description(shortDefinition="Details about an admission to a clinic", formalDefinition="Details about an admission to a clinic." ) - protected EncounterHospitalizationComponent hospitalization; - - /** - * List of locations at which the patient has been. - */ - @Child(name = "location", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of locations the patient has been at", formalDefinition="List of locations at which the patient has been." ) - protected List location; - - /** - * An organization that is in charge of maintaining the information of this Encounter (e.g., who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization. - */ - @Child(name = "serviceProvider", type = {Organization.class}, order=17, min=0, max=1) - @Description(shortDefinition="The custodian organization of this Encounter record", formalDefinition="An organization that is in charge of maintaining the information of this Encounter (e.g., who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization." ) - protected Reference serviceProvider; - - /** - * The actual object that is the target of the reference (An organization that is in charge of maintaining the information of this Encounter (e.g., who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.) - */ - protected Organization serviceProviderTarget; - - /** - * Another Encounter of which this encounter is a part of (administratively or in time). - */ - @Child(name = "partOf", type = {Encounter.class}, order=18, min=0, max=1) - @Description(shortDefinition="Another Encounter this encounter is part of", formalDefinition="Another Encounter of which this encounter is a part of (administratively or in time)." ) - protected Reference partOf; - - /** - * The actual object that is the target of the reference (Another Encounter of which this encounter is a part of (administratively or in time).) - */ - protected Encounter partOfTarget; - - private static final long serialVersionUID = 413573588L; - - /* - * Constructor - */ - public Encounter() { - super(); - } - - /* - * Constructor - */ - public Encounter(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #identifier} (Identifier(s) by which this encounter is known.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifier(s) by which this encounter is known.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Encounter addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #status} (planned | arrived | in-progress | onleave | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new EncounterStateEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (planned | arrived | in-progress | onleave | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Encounter setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return planned | arrived | in-progress | onleave | finished | cancelled. - */ - public EncounterState getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value planned | arrived | in-progress | onleave | finished | cancelled. - */ - public Encounter setStatus(EncounterState value) { - if (this.status == null) - this.status = new Enumeration(new EncounterStateEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #statusHistory} (The current status is always found in the current version of the resource. This status history permits the encounter resource to contain the status history without the needing to read through the historical versions of the resource, or even have the server store them.) - */ - public List getStatusHistory() { - if (this.statusHistory == null) - this.statusHistory = new ArrayList(); - return this.statusHistory; - } - - public boolean hasStatusHistory() { - if (this.statusHistory == null) - return false; - for (EncounterStatusHistoryComponent item : this.statusHistory) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #statusHistory} (The current status is always found in the current version of the resource. This status history permits the encounter resource to contain the status history without the needing to read through the historical versions of the resource, or even have the server store them.) - */ - // syntactic sugar - public EncounterStatusHistoryComponent addStatusHistory() { //3 - EncounterStatusHistoryComponent t = new EncounterStatusHistoryComponent(); - if (this.statusHistory == null) - this.statusHistory = new ArrayList(); - this.statusHistory.add(t); - return t; - } - - // syntactic sugar - public Encounter addStatusHistory(EncounterStatusHistoryComponent t) { //3 - if (t == null) - return this; - if (this.statusHistory == null) - this.statusHistory = new ArrayList(); - this.statusHistory.add(t); - return this; - } - - /** - * @return {@link #class_} (inpatient | outpatient | ambulatory | emergency +.). This is the underlying object with id, value and extensions. The accessor "getClass_" gives direct access to the value - */ - public Enumeration getClass_Element() { - if (this.class_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.class_"); - else if (Configuration.doAutoCreate()) - this.class_ = new Enumeration(new EncounterClassEnumFactory()); // bb - return this.class_; - } - - public boolean hasClass_Element() { - return this.class_ != null && !this.class_.isEmpty(); - } - - public boolean hasClass_() { - return this.class_ != null && !this.class_.isEmpty(); - } - - /** - * @param value {@link #class_} (inpatient | outpatient | ambulatory | emergency +.). This is the underlying object with id, value and extensions. The accessor "getClass_" gives direct access to the value - */ - public Encounter setClass_Element(Enumeration value) { - this.class_ = value; - return this; - } - - /** - * @return inpatient | outpatient | ambulatory | emergency +. - */ - public EncounterClass getClass_() { - return this.class_ == null ? null : this.class_.getValue(); - } - - /** - * @param value inpatient | outpatient | ambulatory | emergency +. - */ - public Encounter setClass_(EncounterClass value) { - if (value == null) - this.class_ = null; - else { - if (this.class_ == null) - this.class_ = new Enumeration(new EncounterClassEnumFactory()); - this.class_.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (CodeableConcept item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).) - */ - // syntactic sugar - public CodeableConcept addType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - // syntactic sugar - public Encounter addType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - /** - * @return {@link #patient} (The patient present at the encounter.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The patient present at the encounter.) - */ - public Encounter setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient present at the encounter.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient present at the encounter.) - */ - public Encounter setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #episodeOfCare} (Where a specific encounter should be classified as a part of a specific episode of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as govt reporting, or issue tracking.) - */ - public Reference getEpisodeOfCare() { - if (this.episodeOfCare == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.episodeOfCare"); - else if (Configuration.doAutoCreate()) - this.episodeOfCare = new Reference(); // cc - return this.episodeOfCare; - } - - public boolean hasEpisodeOfCare() { - return this.episodeOfCare != null && !this.episodeOfCare.isEmpty(); - } - - /** - * @param value {@link #episodeOfCare} (Where a specific encounter should be classified as a part of a specific episode of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as govt reporting, or issue tracking.) - */ - public Encounter setEpisodeOfCare(Reference value) { - this.episodeOfCare = value; - return this; - } - - /** - * @return {@link #episodeOfCare} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Where a specific encounter should be classified as a part of a specific episode of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as govt reporting, or issue tracking.) - */ - public EpisodeOfCare getEpisodeOfCareTarget() { - if (this.episodeOfCareTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.episodeOfCare"); - else if (Configuration.doAutoCreate()) - this.episodeOfCareTarget = new EpisodeOfCare(); // aa - return this.episodeOfCareTarget; - } - - /** - * @param value {@link #episodeOfCare} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Where a specific encounter should be classified as a part of a specific episode of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as govt reporting, or issue tracking.) - */ - public Encounter setEpisodeOfCareTarget(EpisodeOfCare value) { - this.episodeOfCareTarget = value; - return this; - } - - /** - * @return {@link #incomingReferralRequest} (The referral request that this encounter is satisfies (incoming referral).) - */ - public List getIncomingReferralRequest() { - if (this.incomingReferralRequest == null) - this.incomingReferralRequest = new ArrayList(); - return this.incomingReferralRequest; - } - - public boolean hasIncomingReferralRequest() { - if (this.incomingReferralRequest == null) - return false; - for (Reference item : this.incomingReferralRequest) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #incomingReferralRequest} (The referral request that this encounter is satisfies (incoming referral).) - */ - // syntactic sugar - public Reference addIncomingReferralRequest() { //3 - Reference t = new Reference(); - if (this.incomingReferralRequest == null) - this.incomingReferralRequest = new ArrayList(); - this.incomingReferralRequest.add(t); - return t; - } - - // syntactic sugar - public Encounter addIncomingReferralRequest(Reference t) { //3 - if (t == null) - return this; - if (this.incomingReferralRequest == null) - this.incomingReferralRequest = new ArrayList(); - this.incomingReferralRequest.add(t); - return this; - } - - /** - * @return {@link #incomingReferralRequest} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The referral request that this encounter is satisfies (incoming referral).) - */ - public List getIncomingReferralRequestTarget() { - if (this.incomingReferralRequestTarget == null) - this.incomingReferralRequestTarget = new ArrayList(); - return this.incomingReferralRequestTarget; - } - - // syntactic sugar - /** - * @return {@link #incomingReferralRequest} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The referral request that this encounter is satisfies (incoming referral).) - */ - public ReferralRequest addIncomingReferralRequestTarget() { - ReferralRequest r = new ReferralRequest(); - if (this.incomingReferralRequestTarget == null) - this.incomingReferralRequestTarget = new ArrayList(); - this.incomingReferralRequestTarget.add(r); - return r; - } - - /** - * @return {@link #participant} (The main practitioner responsible for providing the service.) - */ - public List getParticipant() { - if (this.participant == null) - this.participant = new ArrayList(); - return this.participant; - } - - public boolean hasParticipant() { - if (this.participant == null) - return false; - for (EncounterParticipantComponent item : this.participant) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #participant} (The main practitioner responsible for providing the service.) - */ - // syntactic sugar - public EncounterParticipantComponent addParticipant() { //3 - EncounterParticipantComponent t = new EncounterParticipantComponent(); - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return t; - } - - // syntactic sugar - public Encounter addParticipant(EncounterParticipantComponent t) { //3 - if (t == null) - return this; - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return this; - } - - /** - * @return {@link #fulfills} (The appointment that scheduled this encounter.) - */ - public Reference getFulfills() { - if (this.fulfills == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.fulfills"); - else if (Configuration.doAutoCreate()) - this.fulfills = new Reference(); // cc - return this.fulfills; - } - - public boolean hasFulfills() { - return this.fulfills != null && !this.fulfills.isEmpty(); - } - - /** - * @param value {@link #fulfills} (The appointment that scheduled this encounter.) - */ - public Encounter setFulfills(Reference value) { - this.fulfills = value; - return this; - } - - /** - * @return {@link #fulfills} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The appointment that scheduled this encounter.) - */ - public Appointment getFulfillsTarget() { - if (this.fulfillsTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.fulfills"); - else if (Configuration.doAutoCreate()) - this.fulfillsTarget = new Appointment(); // aa - return this.fulfillsTarget; - } - - /** - * @param value {@link #fulfills} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The appointment that scheduled this encounter.) - */ - public Encounter setFulfillsTarget(Appointment value) { - this.fulfillsTarget = value; - return this; - } - - /** - * @return {@link #period} (The start and end time of the encounter.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The start and end time of the encounter.) - */ - public Encounter setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #length} (Quantity of time the encounter lasted. This excludes the time during leaves of absence.) - */ - public Duration getLength() { - if (this.length == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.length"); - else if (Configuration.doAutoCreate()) - this.length = new Duration(); // cc - return this.length; - } - - public boolean hasLength() { - return this.length != null && !this.length.isEmpty(); - } - - /** - * @param value {@link #length} (Quantity of time the encounter lasted. This excludes the time during leaves of absence.) - */ - public Encounter setLength(Duration value) { - this.length = value; - return this; - } - - /** - * @return {@link #reason} (Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.) - */ - public List getReason() { - if (this.reason == null) - this.reason = new ArrayList(); - return this.reason; - } - - public boolean hasReason() { - if (this.reason == null) - return false; - for (CodeableConcept item : this.reason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reason} (Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.) - */ - // syntactic sugar - public CodeableConcept addReason() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return t; - } - - // syntactic sugar - public Encounter addReason(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return this; - } - - /** +The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.) + */ + protected List indicationTarget; + + + /** + * Indicates the urgency of the encounter. + */ + @Child(name = "priority", type = {CodeableConcept.class}, order=14, min=0, max=1) + @Description(shortDefinition="Indicates the urgency of the encounter", formalDefinition="Indicates the urgency of the encounter." ) + protected CodeableConcept priority; + + /** + * Details about an admission to a clinic. + */ + @Child(name = "hospitalization", type = {}, order=15, min=0, max=1) + @Description(shortDefinition="Details about an admission to a clinic", formalDefinition="Details about an admission to a clinic." ) + protected EncounterHospitalizationComponent hospitalization; + + /** + * List of locations at which the patient has been. + */ + @Child(name = "location", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of locations the patient has been at", formalDefinition="List of locations at which the patient has been." ) + protected List location; + + /** + * An organization that is in charge of maintaining the information of this Encounter (e.g., who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization. + */ + @Child(name = "serviceProvider", type = {Organization.class}, order=17, min=0, max=1) + @Description(shortDefinition="The custodian organization of this Encounter record", formalDefinition="An organization that is in charge of maintaining the information of this Encounter (e.g., who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization." ) + protected Reference serviceProvider; + + /** + * The actual object that is the target of the reference (An organization that is in charge of maintaining the information of this Encounter (e.g., who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.) + */ + protected Organization serviceProviderTarget; + + /** + * Another Encounter of which this encounter is a part of (administratively or in time). + */ + @Child(name = "partOf", type = {Encounter.class}, order=18, min=0, max=1) + @Description(shortDefinition="Another Encounter this encounter is part of", formalDefinition="Another Encounter of which this encounter is a part of (administratively or in time)." ) + protected Reference partOf; + + /** + * The actual object that is the target of the reference (Another Encounter of which this encounter is a part of (administratively or in time).) + */ + protected Encounter partOfTarget; + + private static final long serialVersionUID = 413573588L; + + /* + * Constructor + */ + public Encounter() { + super(); + } + + /* + * Constructor + */ + public Encounter(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #identifier} (Identifier(s) by which this encounter is known.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Identifier(s) by which this encounter is known.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Encounter addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #status} (planned | arrived | in-progress | onleave | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new EncounterStateEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (planned | arrived | in-progress | onleave | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Encounter setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return planned | arrived | in-progress | onleave | finished | cancelled. + */ + public EncounterState getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value planned | arrived | in-progress | onleave | finished | cancelled. + */ + public Encounter setStatus(EncounterState value) { + if (this.status == null) + this.status = new Enumeration(new EncounterStateEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #statusHistory} (The current status is always found in the current version of the resource. This status history permits the encounter resource to contain the status history without the needing to read through the historical versions of the resource, or even have the server store them.) + */ + public List getStatusHistory() { + if (this.statusHistory == null) + this.statusHistory = new ArrayList(); + return this.statusHistory; + } + + public boolean hasStatusHistory() { + if (this.statusHistory == null) + return false; + for (EncounterStatusHistoryComponent item : this.statusHistory) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #statusHistory} (The current status is always found in the current version of the resource. This status history permits the encounter resource to contain the status history without the needing to read through the historical versions of the resource, or even have the server store them.) + */ + // syntactic sugar + public EncounterStatusHistoryComponent addStatusHistory() { //3 + EncounterStatusHistoryComponent t = new EncounterStatusHistoryComponent(); + if (this.statusHistory == null) + this.statusHistory = new ArrayList(); + this.statusHistory.add(t); + return t; + } + + // syntactic sugar + public Encounter addStatusHistory(EncounterStatusHistoryComponent t) { //3 + if (t == null) + return this; + if (this.statusHistory == null) + this.statusHistory = new ArrayList(); + this.statusHistory.add(t); + return this; + } + + /** + * @return {@link #class_} (inpatient | outpatient | ambulatory | emergency +.). This is the underlying object with id, value and extensions. The accessor "getClass_" gives direct access to the value + */ + public Enumeration getClass_Element() { + if (this.class_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.class_"); + else if (Configuration.doAutoCreate()) + this.class_ = new Enumeration(new EncounterClassEnumFactory()); // bb + return this.class_; + } + + public boolean hasClass_Element() { + return this.class_ != null && !this.class_.isEmpty(); + } + + public boolean hasClass_() { + return this.class_ != null && !this.class_.isEmpty(); + } + + /** + * @param value {@link #class_} (inpatient | outpatient | ambulatory | emergency +.). This is the underlying object with id, value and extensions. The accessor "getClass_" gives direct access to the value + */ + public Encounter setClass_Element(Enumeration value) { + this.class_ = value; + return this; + } + + /** + * @return inpatient | outpatient | ambulatory | emergency +. + */ + public EncounterClass getClass_() { + return this.class_ == null ? null : this.class_.getValue(); + } + + /** + * @param value inpatient | outpatient | ambulatory | emergency +. + */ + public Encounter setClass_(EncounterClass value) { + if (value == null) + this.class_ = null; + else { + if (this.class_ == null) + this.class_ = new Enumeration(new EncounterClassEnumFactory()); + this.class_.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (CodeableConcept item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).) + */ + // syntactic sugar + public CodeableConcept addType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + // syntactic sugar + public Encounter addType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + /** + * @return {@link #patient} (The patient present at the encounter.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The patient present at the encounter.) + */ + public Encounter setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient present at the encounter.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient present at the encounter.) + */ + public Encounter setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #episodeOfCare} (Where a specific encounter should be classified as a part of a specific episode of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as govt reporting, or issue tracking.) + */ + public Reference getEpisodeOfCare() { + if (this.episodeOfCare == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.episodeOfCare"); + else if (Configuration.doAutoCreate()) + this.episodeOfCare = new Reference(); // cc + return this.episodeOfCare; + } + + public boolean hasEpisodeOfCare() { + return this.episodeOfCare != null && !this.episodeOfCare.isEmpty(); + } + + /** + * @param value {@link #episodeOfCare} (Where a specific encounter should be classified as a part of a specific episode of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as govt reporting, or issue tracking.) + */ + public Encounter setEpisodeOfCare(Reference value) { + this.episodeOfCare = value; + return this; + } + + /** + * @return {@link #episodeOfCare} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Where a specific encounter should be classified as a part of a specific episode of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as govt reporting, or issue tracking.) + */ + public EpisodeOfCare getEpisodeOfCareTarget() { + if (this.episodeOfCareTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.episodeOfCare"); + else if (Configuration.doAutoCreate()) + this.episodeOfCareTarget = new EpisodeOfCare(); // aa + return this.episodeOfCareTarget; + } + + /** + * @param value {@link #episodeOfCare} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Where a specific encounter should be classified as a part of a specific episode of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as govt reporting, or issue tracking.) + */ + public Encounter setEpisodeOfCareTarget(EpisodeOfCare value) { + this.episodeOfCareTarget = value; + return this; + } + + /** + * @return {@link #incomingReferralRequest} (The referral request that this encounter is satisfies (incoming referral).) + */ + public List getIncomingReferralRequest() { + if (this.incomingReferralRequest == null) + this.incomingReferralRequest = new ArrayList(); + return this.incomingReferralRequest; + } + + public boolean hasIncomingReferralRequest() { + if (this.incomingReferralRequest == null) + return false; + for (Reference item : this.incomingReferralRequest) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #incomingReferralRequest} (The referral request that this encounter is satisfies (incoming referral).) + */ + // syntactic sugar + public Reference addIncomingReferralRequest() { //3 + Reference t = new Reference(); + if (this.incomingReferralRequest == null) + this.incomingReferralRequest = new ArrayList(); + this.incomingReferralRequest.add(t); + return t; + } + + // syntactic sugar + public Encounter addIncomingReferralRequest(Reference t) { //3 + if (t == null) + return this; + if (this.incomingReferralRequest == null) + this.incomingReferralRequest = new ArrayList(); + this.incomingReferralRequest.add(t); + return this; + } + + /** + * @return {@link #incomingReferralRequest} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The referral request that this encounter is satisfies (incoming referral).) + */ + public List getIncomingReferralRequestTarget() { + if (this.incomingReferralRequestTarget == null) + this.incomingReferralRequestTarget = new ArrayList(); + return this.incomingReferralRequestTarget; + } + + // syntactic sugar + /** + * @return {@link #incomingReferralRequest} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The referral request that this encounter is satisfies (incoming referral).) + */ + public ReferralRequest addIncomingReferralRequestTarget() { + ReferralRequest r = new ReferralRequest(); + if (this.incomingReferralRequestTarget == null) + this.incomingReferralRequestTarget = new ArrayList(); + this.incomingReferralRequestTarget.add(r); + return r; + } + + /** + * @return {@link #participant} (The main practitioner responsible for providing the service.) + */ + public List getParticipant() { + if (this.participant == null) + this.participant = new ArrayList(); + return this.participant; + } + + public boolean hasParticipant() { + if (this.participant == null) + return false; + for (EncounterParticipantComponent item : this.participant) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #participant} (The main practitioner responsible for providing the service.) + */ + // syntactic sugar + public EncounterParticipantComponent addParticipant() { //3 + EncounterParticipantComponent t = new EncounterParticipantComponent(); + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return t; + } + + // syntactic sugar + public Encounter addParticipant(EncounterParticipantComponent t) { //3 + if (t == null) + return this; + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return this; + } + + /** + * @return {@link #fulfills} (The appointment that scheduled this encounter.) + */ + public Reference getFulfills() { + if (this.fulfills == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.fulfills"); + else if (Configuration.doAutoCreate()) + this.fulfills = new Reference(); // cc + return this.fulfills; + } + + public boolean hasFulfills() { + return this.fulfills != null && !this.fulfills.isEmpty(); + } + + /** + * @param value {@link #fulfills} (The appointment that scheduled this encounter.) + */ + public Encounter setFulfills(Reference value) { + this.fulfills = value; + return this; + } + + /** + * @return {@link #fulfills} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The appointment that scheduled this encounter.) + */ + public Appointment getFulfillsTarget() { + if (this.fulfillsTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.fulfills"); + else if (Configuration.doAutoCreate()) + this.fulfillsTarget = new Appointment(); // aa + return this.fulfillsTarget; + } + + /** + * @param value {@link #fulfills} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The appointment that scheduled this encounter.) + */ + public Encounter setFulfillsTarget(Appointment value) { + this.fulfillsTarget = value; + return this; + } + + /** + * @return {@link #period} (The start and end time of the encounter.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The start and end time of the encounter.) + */ + public Encounter setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #length} (Quantity of time the encounter lasted. This excludes the time during leaves of absence.) + */ + public Duration getLength() { + if (this.length == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.length"); + else if (Configuration.doAutoCreate()) + this.length = new Duration(); // cc + return this.length; + } + + public boolean hasLength() { + return this.length != null && !this.length.isEmpty(); + } + + /** + * @param value {@link #length} (Quantity of time the encounter lasted. This excludes the time during leaves of absence.) + */ + public Encounter setLength(Duration value) { + this.length = value; + return this; + } + + /** + * @return {@link #reason} (Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.) + */ + public List getReason() { + if (this.reason == null) + this.reason = new ArrayList(); + return this.reason; + } + + public boolean hasReason() { + if (this.reason == null) + return false; + for (CodeableConcept item : this.reason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reason} (Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.) + */ + // syntactic sugar + public CodeableConcept addReason() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return t; + } + + // syntactic sugar + public Encounter addReason(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return this; + } + + /** * @return {@link #indication} (Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. -The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.) - */ - public List getIndication() { - if (this.indication == null) - this.indication = new ArrayList(); - return this.indication; - } - - public boolean hasIndication() { - if (this.indication == null) - return false; - for (Reference item : this.indication) - if (!item.isEmpty()) - return true; - return false; - } - - /** +The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.) + */ + public List getIndication() { + if (this.indication == null) + this.indication = new ArrayList(); + return this.indication; + } + + public boolean hasIndication() { + if (this.indication == null) + return false; + for (Reference item : this.indication) + if (!item.isEmpty()) + return true; + return false; + } + + /** * @return {@link #indication} (Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. -The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.) - */ - // syntactic sugar - public Reference addIndication() { //3 - Reference t = new Reference(); - if (this.indication == null) - this.indication = new ArrayList(); - this.indication.add(t); - return t; - } - - // syntactic sugar - public Encounter addIndication(Reference t) { //3 - if (t == null) - return this; - if (this.indication == null) - this.indication = new ArrayList(); - this.indication.add(t); - return this; - } - - /** +The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.) + */ + // syntactic sugar + public Reference addIndication() { //3 + Reference t = new Reference(); + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return t; + } + + // syntactic sugar + public Encounter addIndication(Reference t) { //3 + if (t == null) + return this; + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return this; + } + + /** * @return {@link #indication} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. -The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.) - */ - public List getIndicationTarget() { - if (this.indicationTarget == null) - this.indicationTarget = new ArrayList(); - return this.indicationTarget; - } - - /** - * @return {@link #priority} (Indicates the urgency of the encounter.) - */ - public CodeableConcept getPriority() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new CodeableConcept(); // cc - return this.priority; - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (Indicates the urgency of the encounter.) - */ - public Encounter setPriority(CodeableConcept value) { - this.priority = value; - return this; - } - - /** - * @return {@link #hospitalization} (Details about an admission to a clinic.) - */ - public EncounterHospitalizationComponent getHospitalization() { - if (this.hospitalization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.hospitalization"); - else if (Configuration.doAutoCreate()) - this.hospitalization = new EncounterHospitalizationComponent(); // cc - return this.hospitalization; - } - - public boolean hasHospitalization() { - return this.hospitalization != null && !this.hospitalization.isEmpty(); - } - - /** - * @param value {@link #hospitalization} (Details about an admission to a clinic.) - */ - public Encounter setHospitalization(EncounterHospitalizationComponent value) { - this.hospitalization = value; - return this; - } - - /** - * @return {@link #location} (List of locations at which the patient has been.) - */ - public List getLocation() { - if (this.location == null) - this.location = new ArrayList(); - return this.location; - } - - public boolean hasLocation() { - if (this.location == null) - return false; - for (EncounterLocationComponent item : this.location) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #location} (List of locations at which the patient has been.) - */ - // syntactic sugar - public EncounterLocationComponent addLocation() { //3 - EncounterLocationComponent t = new EncounterLocationComponent(); - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return t; - } - - // syntactic sugar - public Encounter addLocation(EncounterLocationComponent t) { //3 - if (t == null) - return this; - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return this; - } - - /** - * @return {@link #serviceProvider} (An organization that is in charge of maintaining the information of this Encounter (e.g., who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.) - */ - public Reference getServiceProvider() { - if (this.serviceProvider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.serviceProvider"); - else if (Configuration.doAutoCreate()) - this.serviceProvider = new Reference(); // cc - return this.serviceProvider; - } - - public boolean hasServiceProvider() { - return this.serviceProvider != null && !this.serviceProvider.isEmpty(); - } - - /** - * @param value {@link #serviceProvider} (An organization that is in charge of maintaining the information of this Encounter (e.g., who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.) - */ - public Encounter setServiceProvider(Reference value) { - this.serviceProvider = value; - return this; - } - - /** - * @return {@link #serviceProvider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An organization that is in charge of maintaining the information of this Encounter (e.g., who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.) - */ - public Organization getServiceProviderTarget() { - if (this.serviceProviderTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.serviceProvider"); - else if (Configuration.doAutoCreate()) - this.serviceProviderTarget = new Organization(); // aa - return this.serviceProviderTarget; - } - - /** - * @param value {@link #serviceProvider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An organization that is in charge of maintaining the information of this Encounter (e.g., who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.) - */ - public Encounter setServiceProviderTarget(Organization value) { - this.serviceProviderTarget = value; - return this; - } - - /** - * @return {@link #partOf} (Another Encounter of which this encounter is a part of (administratively or in time).) - */ - public Reference getPartOf() { - if (this.partOf == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.partOf"); - else if (Configuration.doAutoCreate()) - this.partOf = new Reference(); // cc - return this.partOf; - } - - public boolean hasPartOf() { - return this.partOf != null && !this.partOf.isEmpty(); - } - - /** - * @param value {@link #partOf} (Another Encounter of which this encounter is a part of (administratively or in time).) - */ - public Encounter setPartOf(Reference value) { - this.partOf = value; - return this; - } - - /** - * @return {@link #partOf} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Another Encounter of which this encounter is a part of (administratively or in time).) - */ - public Encounter getPartOfTarget() { - if (this.partOfTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.partOf"); - else if (Configuration.doAutoCreate()) - this.partOfTarget = new Encounter(); // aa - return this.partOfTarget; - } - - /** - * @param value {@link #partOf} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Another Encounter of which this encounter is a part of (administratively or in time).) - */ - public Encounter setPartOfTarget(Encounter value) { - this.partOfTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier(s) by which this encounter is known.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "planned | arrived | in-progress | onleave | finished | cancelled.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("statusHistory", "", "The current status is always found in the current version of the resource. This status history permits the encounter resource to contain the status history without the needing to read through the historical versions of the resource, or even have the server store them.", 0, java.lang.Integer.MAX_VALUE, statusHistory)); - childrenList.add(new Property("class", "code", "inpatient | outpatient | ambulatory | emergency +.", 0, java.lang.Integer.MAX_VALUE, class_)); - childrenList.add(new Property("type", "CodeableConcept", "Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient present at the encounter.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("episodeOfCare", "Reference(EpisodeOfCare)", "Where a specific encounter should be classified as a part of a specific episode of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as govt reporting, or issue tracking.", 0, java.lang.Integer.MAX_VALUE, episodeOfCare)); - childrenList.add(new Property("incomingReferralRequest", "Reference(ReferralRequest)", "The referral request that this encounter is satisfies (incoming referral).", 0, java.lang.Integer.MAX_VALUE, incomingReferralRequest)); - childrenList.add(new Property("participant", "", "The main practitioner responsible for providing the service.", 0, java.lang.Integer.MAX_VALUE, participant)); - childrenList.add(new Property("fulfills", "Reference(Appointment)", "The appointment that scheduled this encounter.", 0, java.lang.Integer.MAX_VALUE, fulfills)); - childrenList.add(new Property("period", "Period", "The start and end time of the encounter.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("length", "Duration", "Quantity of time the encounter lasted. This excludes the time during leaves of absence.", 0, java.lang.Integer.MAX_VALUE, length)); - childrenList.add(new Property("reason", "CodeableConcept", "Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("indication", "Reference(Any)", "Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis.\nThe indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.", 0, java.lang.Integer.MAX_VALUE, indication)); - childrenList.add(new Property("priority", "CodeableConcept", "Indicates the urgency of the encounter.", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("hospitalization", "", "Details about an admission to a clinic.", 0, java.lang.Integer.MAX_VALUE, hospitalization)); - childrenList.add(new Property("location", "", "List of locations at which the patient has been.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("serviceProvider", "Reference(Organization)", "An organization that is in charge of maintaining the information of this Encounter (e.g., who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.", 0, java.lang.Integer.MAX_VALUE, serviceProvider)); - childrenList.add(new Property("partOf", "Reference(Encounter)", "Another Encounter of which this encounter is a part of (administratively or in time).", 0, java.lang.Integer.MAX_VALUE, partOf)); - } - - public Encounter copy() { - Encounter dst = new Encounter(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - if (statusHistory != null) { - dst.statusHistory = new ArrayList(); - for (EncounterStatusHistoryComponent i : statusHistory) - dst.statusHistory.add(i.copy()); - }; - dst.class_ = class_ == null ? null : class_.copy(); - if (type != null) { - dst.type = new ArrayList(); - for (CodeableConcept i : type) - dst.type.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - dst.episodeOfCare = episodeOfCare == null ? null : episodeOfCare.copy(); - if (incomingReferralRequest != null) { - dst.incomingReferralRequest = new ArrayList(); - for (Reference i : incomingReferralRequest) - dst.incomingReferralRequest.add(i.copy()); - }; - if (participant != null) { - dst.participant = new ArrayList(); - for (EncounterParticipantComponent i : participant) - dst.participant.add(i.copy()); - }; - dst.fulfills = fulfills == null ? null : fulfills.copy(); - dst.period = period == null ? null : period.copy(); - dst.length = length == null ? null : length.copy(); - if (reason != null) { - dst.reason = new ArrayList(); - for (CodeableConcept i : reason) - dst.reason.add(i.copy()); - }; - if (indication != null) { - dst.indication = new ArrayList(); - for (Reference i : indication) - dst.indication.add(i.copy()); - }; - dst.priority = priority == null ? null : priority.copy(); - dst.hospitalization = hospitalization == null ? null : hospitalization.copy(); - if (location != null) { - dst.location = new ArrayList(); - for (EncounterLocationComponent i : location) - dst.location.add(i.copy()); - }; - dst.serviceProvider = serviceProvider == null ? null : serviceProvider.copy(); - dst.partOf = partOf == null ? null : partOf.copy(); - return dst; - } - - protected Encounter typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Encounter)) - return false; - Encounter o = (Encounter) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(statusHistory, o.statusHistory, true) - && compareDeep(class_, o.class_, true) && compareDeep(type, o.type, true) && compareDeep(patient, o.patient, true) - && compareDeep(episodeOfCare, o.episodeOfCare, true) && compareDeep(incomingReferralRequest, o.incomingReferralRequest, true) - && compareDeep(participant, o.participant, true) && compareDeep(fulfills, o.fulfills, true) && compareDeep(period, o.period, true) - && compareDeep(length, o.length, true) && compareDeep(reason, o.reason, true) && compareDeep(indication, o.indication, true) - && compareDeep(priority, o.priority, true) && compareDeep(hospitalization, o.hospitalization, true) - && compareDeep(location, o.location, true) && compareDeep(serviceProvider, o.serviceProvider, true) - && compareDeep(partOf, o.partOf, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Encounter)) - return false; - Encounter o = (Encounter) other; - return compareValues(status, o.status, true) && compareValues(class_, o.class_, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (statusHistory == null || statusHistory.isEmpty()) && (class_ == null || class_.isEmpty()) - && (type == null || type.isEmpty()) && (patient == null || patient.isEmpty()) && (episodeOfCare == null || episodeOfCare.isEmpty()) - && (incomingReferralRequest == null || incomingReferralRequest.isEmpty()) && (participant == null || participant.isEmpty()) - && (fulfills == null || fulfills.isEmpty()) && (period == null || period.isEmpty()) && (length == null || length.isEmpty()) - && (reason == null || reason.isEmpty()) && (indication == null || indication.isEmpty()) && (priority == null || priority.isEmpty()) - && (hospitalization == null || hospitalization.isEmpty()) && (location == null || location.isEmpty()) - && (serviceProvider == null || serviceProvider.isEmpty()) && (partOf == null || partOf.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Encounter; - } - - @SearchParamDefinition(name="participant-type", path="Encounter.participant.type", description="Role of participant in encounter", type="token" ) - public static final String SP_PARTICIPANTTYPE = "participant-type"; - @SearchParamDefinition(name="episodeofcare", path="Encounter.episodeOfCare", description="An episode of care that this encounter should be recorded against", type="reference" ) - public static final String SP_EPISODEOFCARE = "episodeofcare"; - @SearchParamDefinition(name="status", path="Encounter.status", description="planned | arrived | in-progress | onleave | finished | cancelled", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="reason", path="Encounter.reason", description="Reason the encounter takes place (code)", type="token" ) - public static final String SP_REASON = "reason"; - @SearchParamDefinition(name="location", path="Encounter.location.location", description="Location the encounter takes place", type="reference" ) - public static final String SP_LOCATION = "location"; - @SearchParamDefinition(name="fulfills", path="Encounter.fulfills", description="The appointment that scheduled this encounter", type="reference" ) - public static final String SP_FULFILLS = "fulfills"; - @SearchParamDefinition(name="indication", path="Encounter.indication", description="Reason the encounter takes place (resource)", type="reference" ) - public static final String SP_INDICATION = "indication"; - @SearchParamDefinition(name="date", path="Encounter.period", description="A date within the period the Encounter lasted", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="type", path="Encounter.type", description="Specific type of encounter", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="special-arrangement", path="Encounter.hospitalization.specialArrangement", description="Wheelchair, translator, stretcher, etc", type="token" ) - public static final String SP_SPECIALARRANGEMENT = "special-arrangement"; - @SearchParamDefinition(name="part-of", path="Encounter.partOf", description="Another Encounter this encounter is part of", type="reference" ) - public static final String SP_PARTOF = "part-of"; - @SearchParamDefinition(name="patient", path="Encounter.patient", description="The patient present at the encounter", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="practitioner", path="Encounter.participant.individual", description="Persons involved in the encounter other than the patient", type="reference" ) - public static final String SP_PRACTITIONER = "practitioner"; - @SearchParamDefinition(name="length", path="Encounter.length", description="Length of encounter in days", type="number" ) - public static final String SP_LENGTH = "length"; - @SearchParamDefinition(name="participant", path="Encounter.participant.individual", description="Persons involved in the encounter other than the patient", type="reference" ) - public static final String SP_PARTICIPANT = "participant"; - @SearchParamDefinition(name="incomingreferral", path="Encounter.incomingReferralRequest", description="Incoming Referral Request", type="reference" ) - public static final String SP_INCOMINGREFERRAL = "incomingreferral"; - @SearchParamDefinition(name="identifier", path="Encounter.identifier", description="Identifier(s) by which this encounter is known", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="location-period", path="Encounter.location.period", description="Time period during which the patient was present at the location", type="date" ) - public static final String SP_LOCATIONPERIOD = "location-period"; - -} - +The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.) + */ + public List getIndicationTarget() { + if (this.indicationTarget == null) + this.indicationTarget = new ArrayList(); + return this.indicationTarget; + } + + /** + * @return {@link #priority} (Indicates the urgency of the encounter.) + */ + public CodeableConcept getPriority() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new CodeableConcept(); // cc + return this.priority; + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Indicates the urgency of the encounter.) + */ + public Encounter setPriority(CodeableConcept value) { + this.priority = value; + return this; + } + + /** + * @return {@link #hospitalization} (Details about an admission to a clinic.) + */ + public EncounterHospitalizationComponent getHospitalization() { + if (this.hospitalization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.hospitalization"); + else if (Configuration.doAutoCreate()) + this.hospitalization = new EncounterHospitalizationComponent(); // cc + return this.hospitalization; + } + + public boolean hasHospitalization() { + return this.hospitalization != null && !this.hospitalization.isEmpty(); + } + + /** + * @param value {@link #hospitalization} (Details about an admission to a clinic.) + */ + public Encounter setHospitalization(EncounterHospitalizationComponent value) { + this.hospitalization = value; + return this; + } + + /** + * @return {@link #location} (List of locations at which the patient has been.) + */ + public List getLocation() { + if (this.location == null) + this.location = new ArrayList(); + return this.location; + } + + public boolean hasLocation() { + if (this.location == null) + return false; + for (EncounterLocationComponent item : this.location) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #location} (List of locations at which the patient has been.) + */ + // syntactic sugar + public EncounterLocationComponent addLocation() { //3 + EncounterLocationComponent t = new EncounterLocationComponent(); + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return t; + } + + // syntactic sugar + public Encounter addLocation(EncounterLocationComponent t) { //3 + if (t == null) + return this; + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return this; + } + + /** + * @return {@link #serviceProvider} (An organization that is in charge of maintaining the information of this Encounter (e.g., who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.) + */ + public Reference getServiceProvider() { + if (this.serviceProvider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.serviceProvider"); + else if (Configuration.doAutoCreate()) + this.serviceProvider = new Reference(); // cc + return this.serviceProvider; + } + + public boolean hasServiceProvider() { + return this.serviceProvider != null && !this.serviceProvider.isEmpty(); + } + + /** + * @param value {@link #serviceProvider} (An organization that is in charge of maintaining the information of this Encounter (e.g., who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.) + */ + public Encounter setServiceProvider(Reference value) { + this.serviceProvider = value; + return this; + } + + /** + * @return {@link #serviceProvider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An organization that is in charge of maintaining the information of this Encounter (e.g., who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.) + */ + public Organization getServiceProviderTarget() { + if (this.serviceProviderTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.serviceProvider"); + else if (Configuration.doAutoCreate()) + this.serviceProviderTarget = new Organization(); // aa + return this.serviceProviderTarget; + } + + /** + * @param value {@link #serviceProvider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An organization that is in charge of maintaining the information of this Encounter (e.g., who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.) + */ + public Encounter setServiceProviderTarget(Organization value) { + this.serviceProviderTarget = value; + return this; + } + + /** + * @return {@link #partOf} (Another Encounter of which this encounter is a part of (administratively or in time).) + */ + public Reference getPartOf() { + if (this.partOf == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.partOf"); + else if (Configuration.doAutoCreate()) + this.partOf = new Reference(); // cc + return this.partOf; + } + + public boolean hasPartOf() { + return this.partOf != null && !this.partOf.isEmpty(); + } + + /** + * @param value {@link #partOf} (Another Encounter of which this encounter is a part of (administratively or in time).) + */ + public Encounter setPartOf(Reference value) { + this.partOf = value; + return this; + } + + /** + * @return {@link #partOf} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Another Encounter of which this encounter is a part of (administratively or in time).) + */ + public Encounter getPartOfTarget() { + if (this.partOfTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.partOf"); + else if (Configuration.doAutoCreate()) + this.partOfTarget = new Encounter(); // aa + return this.partOfTarget; + } + + /** + * @param value {@link #partOf} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Another Encounter of which this encounter is a part of (administratively or in time).) + */ + public Encounter setPartOfTarget(Encounter value) { + this.partOfTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier(s) by which this encounter is known.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "planned | arrived | in-progress | onleave | finished | cancelled.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("statusHistory", "", "The current status is always found in the current version of the resource. This status history permits the encounter resource to contain the status history without the needing to read through the historical versions of the resource, or even have the server store them.", 0, java.lang.Integer.MAX_VALUE, statusHistory)); + childrenList.add(new Property("class", "code", "inpatient | outpatient | ambulatory | emergency +.", 0, java.lang.Integer.MAX_VALUE, class_)); + childrenList.add(new Property("type", "CodeableConcept", "Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient present at the encounter.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("episodeOfCare", "Reference(EpisodeOfCare)", "Where a specific encounter should be classified as a part of a specific episode of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as govt reporting, or issue tracking.", 0, java.lang.Integer.MAX_VALUE, episodeOfCare)); + childrenList.add(new Property("incomingReferralRequest", "Reference(ReferralRequest)", "The referral request that this encounter is satisfies (incoming referral).", 0, java.lang.Integer.MAX_VALUE, incomingReferralRequest)); + childrenList.add(new Property("participant", "", "The main practitioner responsible for providing the service.", 0, java.lang.Integer.MAX_VALUE, participant)); + childrenList.add(new Property("fulfills", "Reference(Appointment)", "The appointment that scheduled this encounter.", 0, java.lang.Integer.MAX_VALUE, fulfills)); + childrenList.add(new Property("period", "Period", "The start and end time of the encounter.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("length", "Duration", "Quantity of time the encounter lasted. This excludes the time during leaves of absence.", 0, java.lang.Integer.MAX_VALUE, length)); + childrenList.add(new Property("reason", "CodeableConcept", "Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("indication", "Reference(Any)", "Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis.\nThe indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.", 0, java.lang.Integer.MAX_VALUE, indication)); + childrenList.add(new Property("priority", "CodeableConcept", "Indicates the urgency of the encounter.", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("hospitalization", "", "Details about an admission to a clinic.", 0, java.lang.Integer.MAX_VALUE, hospitalization)); + childrenList.add(new Property("location", "", "List of locations at which the patient has been.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("serviceProvider", "Reference(Organization)", "An organization that is in charge of maintaining the information of this Encounter (e.g., who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.", 0, java.lang.Integer.MAX_VALUE, serviceProvider)); + childrenList.add(new Property("partOf", "Reference(Encounter)", "Another Encounter of which this encounter is a part of (administratively or in time).", 0, java.lang.Integer.MAX_VALUE, partOf)); + } + + public Encounter copy() { + Encounter dst = new Encounter(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + if (statusHistory != null) { + dst.statusHistory = new ArrayList(); + for (EncounterStatusHistoryComponent i : statusHistory) + dst.statusHistory.add(i.copy()); + }; + dst.class_ = class_ == null ? null : class_.copy(); + if (type != null) { + dst.type = new ArrayList(); + for (CodeableConcept i : type) + dst.type.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + dst.episodeOfCare = episodeOfCare == null ? null : episodeOfCare.copy(); + if (incomingReferralRequest != null) { + dst.incomingReferralRequest = new ArrayList(); + for (Reference i : incomingReferralRequest) + dst.incomingReferralRequest.add(i.copy()); + }; + if (participant != null) { + dst.participant = new ArrayList(); + for (EncounterParticipantComponent i : participant) + dst.participant.add(i.copy()); + }; + dst.fulfills = fulfills == null ? null : fulfills.copy(); + dst.period = period == null ? null : period.copy(); + dst.length = length == null ? null : length.copy(); + if (reason != null) { + dst.reason = new ArrayList(); + for (CodeableConcept i : reason) + dst.reason.add(i.copy()); + }; + if (indication != null) { + dst.indication = new ArrayList(); + for (Reference i : indication) + dst.indication.add(i.copy()); + }; + dst.priority = priority == null ? null : priority.copy(); + dst.hospitalization = hospitalization == null ? null : hospitalization.copy(); + if (location != null) { + dst.location = new ArrayList(); + for (EncounterLocationComponent i : location) + dst.location.add(i.copy()); + }; + dst.serviceProvider = serviceProvider == null ? null : serviceProvider.copy(); + dst.partOf = partOf == null ? null : partOf.copy(); + return dst; + } + + protected Encounter typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Encounter)) + return false; + Encounter o = (Encounter) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(statusHistory, o.statusHistory, true) + && compareDeep(class_, o.class_, true) && compareDeep(type, o.type, true) && compareDeep(patient, o.patient, true) + && compareDeep(episodeOfCare, o.episodeOfCare, true) && compareDeep(incomingReferralRequest, o.incomingReferralRequest, true) + && compareDeep(participant, o.participant, true) && compareDeep(fulfills, o.fulfills, true) && compareDeep(period, o.period, true) + && compareDeep(length, o.length, true) && compareDeep(reason, o.reason, true) && compareDeep(indication, o.indication, true) + && compareDeep(priority, o.priority, true) && compareDeep(hospitalization, o.hospitalization, true) + && compareDeep(location, o.location, true) && compareDeep(serviceProvider, o.serviceProvider, true) + && compareDeep(partOf, o.partOf, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Encounter)) + return false; + Encounter o = (Encounter) other; + return compareValues(status, o.status, true) && compareValues(class_, o.class_, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (statusHistory == null || statusHistory.isEmpty()) && (class_ == null || class_.isEmpty()) + && (type == null || type.isEmpty()) && (patient == null || patient.isEmpty()) && (episodeOfCare == null || episodeOfCare.isEmpty()) + && (incomingReferralRequest == null || incomingReferralRequest.isEmpty()) && (participant == null || participant.isEmpty()) + && (fulfills == null || fulfills.isEmpty()) && (period == null || period.isEmpty()) && (length == null || length.isEmpty()) + && (reason == null || reason.isEmpty()) && (indication == null || indication.isEmpty()) && (priority == null || priority.isEmpty()) + && (hospitalization == null || hospitalization.isEmpty()) && (location == null || location.isEmpty()) + && (serviceProvider == null || serviceProvider.isEmpty()) && (partOf == null || partOf.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Encounter; + } + + @SearchParamDefinition(name="date", path="Encounter.period", description="A date within the period the Encounter lasted", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="Encounter.identifier", description="Identifier(s) by which this encounter is known", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="reason", path="Encounter.reason", description="Reason the encounter takes place (code)", type="token" ) + public static final String SP_REASON = "reason"; + @SearchParamDefinition(name="episodeofcare", path="Encounter.episodeOfCare", description="An episode of care that this encounter should be recorded against", type="reference" ) + public static final String SP_EPISODEOFCARE = "episodeofcare"; + @SearchParamDefinition(name="participant-type", path="Encounter.participant.type", description="Role of participant in encounter", type="token" ) + public static final String SP_PARTICIPANTTYPE = "participant-type"; + @SearchParamDefinition(name="incomingreferral", path="Encounter.incomingReferralRequest", description="Incoming Referral Request", type="reference" ) + public static final String SP_INCOMINGREFERRAL = "incomingreferral"; + @SearchParamDefinition(name="practitioner", path="Encounter.participant.individual", description="Persons involved in the encounter other than the patient", type="reference" ) + public static final String SP_PRACTITIONER = "practitioner"; + @SearchParamDefinition(name="length", path="Encounter.length", description="Length of encounter in days", type="number" ) + public static final String SP_LENGTH = "length"; + @SearchParamDefinition(name="part-of", path="Encounter.partOf", description="Another Encounter this encounter is part of", type="reference" ) + public static final String SP_PARTOF = "part-of"; + @SearchParamDefinition(name="type", path="Encounter.type", description="Specific type of encounter", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="participant", path="Encounter.participant.individual", description="Persons involved in the encounter other than the patient", type="reference" ) + public static final String SP_PARTICIPANT = "participant"; + @SearchParamDefinition(name="patient", path="Encounter.patient", description="The patient present at the encounter", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="fulfills", path="Encounter.fulfills", description="The appointment that scheduled this encounter", type="reference" ) + public static final String SP_FULFILLS = "fulfills"; + @SearchParamDefinition(name="location-period", path="Encounter.location.period", description="Time period during which the patient was present at the location", type="date" ) + public static final String SP_LOCATIONPERIOD = "location-period"; + @SearchParamDefinition(name="location", path="Encounter.location.location", description="Location the encounter takes place", type="reference" ) + public static final String SP_LOCATION = "location"; + @SearchParamDefinition(name="indication", path="Encounter.indication", description="Reason the encounter takes place (resource)", type="reference" ) + public static final String SP_INDICATION = "indication"; + @SearchParamDefinition(name="special-arrangement", path="Encounter.hospitalization.specialArrangement", description="Wheelchair, translator, stretcher, etc", type="token" ) + public static final String SP_SPECIALARRANGEMENT = "special-arrangement"; + @SearchParamDefinition(name="status", path="Encounter.status", description="planned | arrived | in-progress | onleave | finished | cancelled", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EnrollmentRequest.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EnrollmentRequest.java index b4ffe237ce0..d21c799b760 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EnrollmentRequest.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EnrollmentRequest.java @@ -1,646 +1,625 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * This resource provides the insurance Enrollment details to the insurer regarding a specified coverage. - */ -@ResourceDef(name="EnrollmentRequest", profile="http://hl7.org/fhir/Profile/EnrollmentRequest") -public class EnrollmentRequest extends DomainResource { - - /** - * The Response Business Identifier. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=2, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when this resource was created. - */ - @Child(name = "created", type = {DateTimeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) - protected DateTimeType created; - - /** - * The Insurer who is target of the request. - */ - @Child(name = "target", type = {Organization.class}, order=4, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target of the request." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (The Insurer who is target of the request.) - */ - protected Organization targetTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name = "provider", type = {Practitioner.class}, order=5, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner providerTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name = "organization", type = {Organization.class}, order=6, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization organizationTarget; - - /** - * Patient Resource. - */ - @Child(name = "subject", type = {Patient.class}, order=7, min=1, max=1) - @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Patient Resource.) - */ - protected Patient subjectTarget; - - /** - * Reference to the program or plan identification, underwriter or payor. - */ - @Child(name = "coverage", type = {Coverage.class}, order=8, min=1, max=1) - @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) - protected Reference coverage; - - /** - * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) - */ - protected Coverage coverageTarget; - - /** - * The relationship of the patient to the subscriber. - */ - @Child(name = "relationship", type = {Coding.class}, order=9, min=1, max=1) - @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) - protected Coding relationship; - - private static final long serialVersionUID = -1656505325L; - - /* - * Constructor - */ - public EnrollmentRequest() { - super(); - } - - /* - * Constructor - */ - public EnrollmentRequest(Reference subject, Reference coverage, Coding relationship) { - super(); - this.subject = subject; - this.coverage = coverage; - this.relationship = relationship; - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public EnrollmentRequest addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public EnrollmentRequest setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public EnrollmentRequest setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public EnrollmentRequest setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when this resource was created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when this resource was created. - */ - public EnrollmentRequest setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (The Insurer who is target of the request.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); // cc - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The Insurer who is target of the request.) - */ - public EnrollmentRequest setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Insurer who is target of the request.) - */ - public Organization getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Organization(); // aa - return this.targetTarget; - } - - /** - * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who is target of the request.) - */ - public EnrollmentRequest setTargetTarget(Organization value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); // cc - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public EnrollmentRequest setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); // aa - return this.providerTarget; - } - - /** - * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) - */ - public EnrollmentRequest setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); // cc - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public EnrollmentRequest setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); // aa - return this.organizationTarget; - } - - /** - * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) - */ - public EnrollmentRequest setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #subject} (Patient Resource.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (Patient Resource.) - */ - public EnrollmentRequest setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Patient Resource.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.subject"); - else if (Configuration.doAutoCreate()) - this.subjectTarget = new Patient(); // aa - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Patient Resource.) - */ - public EnrollmentRequest setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public Reference getCoverage() { - if (this.coverage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.coverage"); - else if (Configuration.doAutoCreate()) - this.coverage = new Reference(); // cc - return this.coverage; - } - - public boolean hasCoverage() { - return this.coverage != null && !this.coverage.isEmpty(); - } - - /** - * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public EnrollmentRequest setCoverage(Reference value) { - this.coverage = value; - return this; - } - - /** - * @return {@link #coverage} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) - */ - public Coverage getCoverageTarget() { - if (this.coverageTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.coverage"); - else if (Configuration.doAutoCreate()) - this.coverageTarget = new Coverage(); // aa - return this.coverageTarget; - } - - /** - * @param value {@link #coverage} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) - */ - public EnrollmentRequest setCoverageTarget(Coverage value) { - this.coverageTarget = value; - return this; - } - - /** - * @return {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public Coding getRelationship() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new Coding(); // cc - return this.relationship; - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public EnrollmentRequest setRelationship(Coding value) { - this.relationship = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("target", "Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("subject", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); - } - - public EnrollmentRequest copy() { - EnrollmentRequest dst = new EnrollmentRequest(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.target = target == null ? null : target.copy(); - dst.provider = provider == null ? null : provider.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.coverage = coverage == null ? null : coverage.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - return dst; - } - - protected EnrollmentRequest typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof EnrollmentRequest)) - return false; - EnrollmentRequest o = (EnrollmentRequest) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) - && compareDeep(created, o.created, true) && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) - && compareDeep(organization, o.organization, true) && compareDeep(subject, o.subject, true) && compareDeep(coverage, o.coverage, true) - && compareDeep(relationship, o.relationship, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof EnrollmentRequest)) - return false; - EnrollmentRequest o = (EnrollmentRequest) other; - return compareValues(created, o.created, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) - && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) - && (subject == null || subject.isEmpty()) && (coverage == null || coverage.isEmpty()) && (relationship == null || relationship.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.EnrollmentRequest; - } - - @SearchParamDefinition(name="patient", path="EnrollmentRequest.subject", description="The party to be enrolled", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="subject", path="EnrollmentRequest.subject", description="The party to be enrolled", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="identifier", path="EnrollmentRequest.identifier", description="The business identifier of the Enrollment", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * This resource provides the insurance Enrollment details to the insurer regarding a specified coverage. + */ +@ResourceDef(name="EnrollmentRequest", profile="http://hl7.org/fhir/Profile/EnrollmentRequest") +public class EnrollmentRequest extends DomainResource { + + /** + * The Response Business Identifier. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name = "ruleset", type = {Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=2, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when this resource was created. + */ + @Child(name = "created", type = {DateTimeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) + protected DateTimeType created; + + /** + * The Insurer who is target of the request. + */ + @Child(name = "target", type = {Organization.class}, order=4, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target of the request." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (The Insurer who is target of the request.) + */ + protected Organization targetTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name = "provider", type = {Practitioner.class}, order=5, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name = "organization", type = {Organization.class}, order=6, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization organizationTarget; + + /** + * Patient Resource. + */ + @Child(name = "subject", type = {Patient.class}, order=7, min=1, max=1) + @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Patient Resource.) + */ + protected Patient subjectTarget; + + /** + * Reference to the program or plan identification, underwriter or payor. + */ + @Child(name = "coverage", type = {Coverage.class}, order=8, min=1, max=1) + @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) + protected Reference coverage; + + /** + * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) + */ + protected Coverage coverageTarget; + + /** + * The relationship of the patient to the subscriber. + */ + @Child(name = "relationship", type = {Coding.class}, order=9, min=1, max=1) + @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) + protected Coding relationship; + + private static final long serialVersionUID = -1656505325L; + + /* + * Constructor + */ + public EnrollmentRequest() { + super(); + } + + /* + * Constructor + */ + public EnrollmentRequest(Reference subject, Reference coverage, Coding relationship) { + super(); + this.subject = subject; + this.coverage = coverage; + this.relationship = relationship; + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public EnrollmentRequest addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public EnrollmentRequest setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public EnrollmentRequest setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public EnrollmentRequest setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when this resource was created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when this resource was created. + */ + public EnrollmentRequest setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (The Insurer who is target of the request.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); // cc + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The Insurer who is target of the request.) + */ + public EnrollmentRequest setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Insurer who is target of the request.) + */ + public Organization getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); // aa + return this.targetTarget; + } + + /** + * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who is target of the request.) + */ + public EnrollmentRequest setTargetTarget(Organization value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); // cc + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public EnrollmentRequest setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); // aa + return this.providerTarget; + } + + /** + * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public EnrollmentRequest setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); // cc + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public EnrollmentRequest setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); // aa + return this.organizationTarget; + } + + /** + * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) + */ + public EnrollmentRequest setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #subject} (Patient Resource.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Patient Resource.) + */ + public EnrollmentRequest setSubject(Reference value) { + this.subject = value; + return this; + } + + /** + * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Patient Resource.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.subject"); + else if (Configuration.doAutoCreate()) + this.subjectTarget = new Patient(); // aa + return this.subjectTarget; + } + + /** + * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Patient Resource.) + */ + public EnrollmentRequest setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public Reference getCoverage() { + if (this.coverage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.coverage"); + else if (Configuration.doAutoCreate()) + this.coverage = new Reference(); // cc + return this.coverage; + } + + public boolean hasCoverage() { + return this.coverage != null && !this.coverage.isEmpty(); + } + + /** + * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public EnrollmentRequest setCoverage(Reference value) { + this.coverage = value; + return this; + } + + /** + * @return {@link #coverage} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) + */ + public Coverage getCoverageTarget() { + if (this.coverageTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.coverage"); + else if (Configuration.doAutoCreate()) + this.coverageTarget = new Coverage(); // aa + return this.coverageTarget; + } + + /** + * @param value {@link #coverage} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) + */ + public EnrollmentRequest setCoverageTarget(Coverage value) { + this.coverageTarget = value; + return this; + } + + /** + * @return {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public Coding getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new Coding(); // cc + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public EnrollmentRequest setRelationship(Coding value) { + this.relationship = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); + childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); + childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("target", "Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("subject", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); + } + + public EnrollmentRequest copy() { + EnrollmentRequest dst = new EnrollmentRequest(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + dst.created = created == null ? null : created.copy(); + dst.target = target == null ? null : target.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.coverage = coverage == null ? null : coverage.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + return dst; + } + + protected EnrollmentRequest typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof EnrollmentRequest)) + return false; + EnrollmentRequest o = (EnrollmentRequest) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) + && compareDeep(created, o.created, true) && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) + && compareDeep(organization, o.organization, true) && compareDeep(subject, o.subject, true) && compareDeep(coverage, o.coverage, true) + && compareDeep(relationship, o.relationship, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof EnrollmentRequest)) + return false; + EnrollmentRequest o = (EnrollmentRequest) other; + return compareValues(created, o.created, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) + && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) + && (subject == null || subject.isEmpty()) && (coverage == null || coverage.isEmpty()) && (relationship == null || relationship.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.EnrollmentRequest; + } + + @SearchParamDefinition(name="identifier", path="EnrollmentRequest.identifier", description="The business identifier of the Enrollment", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="subject", path="EnrollmentRequest.subject", description="The party to be enrolled", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="patient", path="EnrollmentRequest.subject", description="The party to be enrolled", type="reference" ) + public static final String SP_PATIENT = "patient"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EnrollmentResponse.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EnrollmentResponse.java index 8bed44800f9..d27cc90ef1f 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EnrollmentResponse.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EnrollmentResponse.java @@ -1,732 +1,711 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * This resource provides Enrollment and plan details from the processing of an Enrollment resource. - */ -@ResourceDef(name="EnrollmentResponse", profile="http://hl7.org/fhir/Profile/EnrollmentResponse") -public class EnrollmentResponse extends DomainResource { - - public enum RSLink { - /** - * The processing completed without errors. - */ - COMPLETE, - /** - * The processing identified with errors. - */ - ERROR, - /** - * added to help the parsers - */ - NULL; - public static RSLink fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return COMPLETE; - if ("error".equals(codeString)) - return ERROR; - throw new Exception("Unknown RSLink code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case COMPLETE: return "complete"; - case ERROR: return "error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case COMPLETE: return ""; - case ERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case COMPLETE: return "The processing completed without errors."; - case ERROR: return "The processing identified with errors."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case COMPLETE: return "Complete"; - case ERROR: return "Error"; - default: return "?"; - } - } - } - - public static class RSLinkEnumFactory implements EnumFactory { - public RSLink fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return RSLink.COMPLETE; - if ("error".equals(codeString)) - return RSLink.ERROR; - throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); - } - public String toCode(RSLink code) { - if (code == RSLink.COMPLETE) - return "complete"; - if (code == RSLink.ERROR) - return "error"; - return "?"; - } - } - - /** - * The Response Business Identifier. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * Original request resource reference. - */ - @Child(name = "request", type = {EnrollmentRequest.class}, order=1, min=0, max=1) - @Description(shortDefinition="Claim reference", formalDefinition="Original request resource reference." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (Original request resource reference.) - */ - protected EnrollmentRequest requestTarget; - - /** - * Transaction status: error, complete. - */ - @Child(name = "outcome", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) - protected Enumeration outcome; - - /** - * A description of the status of the adjudication. - */ - @Child(name = "disposition", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) - protected StringType disposition; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=5, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateTimeType created; - - /** - * The Insurer who produced this adjudicated response. - */ - @Child(name = "organization", type = {Organization.class}, order=7, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) - */ - protected Organization organizationTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name = "requestProvider", type = {Practitioner.class}, order=8, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference requestProvider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner requestProviderTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name = "requestOrganization", type = {Organization.class}, order=9, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference requestOrganization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization requestOrganizationTarget; - - private static final long serialVersionUID = -318929031L; - - /* - * Constructor - */ - public EnrollmentResponse() { - super(); - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public EnrollmentResponse addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #request} (Original request resource reference.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); // cc - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request resource reference.) - */ - public EnrollmentResponse setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original request resource reference.) - */ - public EnrollmentRequest getRequestTarget() { - if (this.requestTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.request"); - else if (Configuration.doAutoCreate()) - this.requestTarget = new EnrollmentRequest(); // aa - return this.requestTarget; - } - - /** - * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original request resource reference.) - */ - public EnrollmentResponse setRequestTarget(EnrollmentRequest value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public Enumeration getOutcomeElement() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Enumeration(new RSLinkEnumFactory()); // bb - return this.outcome; - } - - public boolean hasOutcomeElement() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public EnrollmentResponse setOutcomeElement(Enumeration value) { - this.outcome = value; - return this; - } - - /** - * @return Transaction status: error, complete. - */ - public RSLink getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value Transaction status: error, complete. - */ - public EnrollmentResponse setOutcome(RSLink value) { - if (value == null) - this.outcome = null; - else { - if (this.outcome == null) - this.outcome = new Enumeration(new RSLinkEnumFactory()); - this.outcome.setValue(value); - } - return this; - } - - /** - * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public StringType getDispositionElement() { - if (this.disposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.disposition"); - else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); // bb - return this.disposition; - } - - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - /** - * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public EnrollmentResponse setDispositionElement(StringType value) { - this.disposition = value; - return this; - } - - /** - * @return A description of the status of the adjudication. - */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); - } - - /** - * @param value A description of the status of the adjudication. - */ - public EnrollmentResponse setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); - } - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public EnrollmentResponse setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public EnrollmentResponse setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public EnrollmentResponse setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when the enclosed suite of services were performed or completed. - */ - public EnrollmentResponse setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); // cc - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public EnrollmentResponse setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); // aa - return this.organizationTarget; - } - - /** - * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) - */ - public EnrollmentResponse setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getRequestProvider() { - if (this.requestProvider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProvider = new Reference(); // cc - return this.requestProvider; - } - - public boolean hasRequestProvider() { - return this.requestProvider != null && !this.requestProvider.isEmpty(); - } - - /** - * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public EnrollmentResponse setRequestProvider(Reference value) { - this.requestProvider = value; - return this; - } - - /** - * @return {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getRequestProviderTarget() { - if (this.requestProviderTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProviderTarget = new Practitioner(); // aa - return this.requestProviderTarget; - } - - /** - * @param value {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) - */ - public EnrollmentResponse setRequestProviderTarget(Practitioner value) { - this.requestProviderTarget = value; - return this; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getRequestOrganization() { - if (this.requestOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganization = new Reference(); // cc - return this.requestOrganization; - } - - public boolean hasRequestOrganization() { - return this.requestOrganization != null && !this.requestOrganization.isEmpty(); - } - - /** - * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public EnrollmentResponse setRequestOrganization(Reference value) { - this.requestOrganization = value; - return this; - } - - /** - * @return {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) - */ - public Organization getRequestOrganizationTarget() { - if (this.requestOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganizationTarget = new Organization(); // aa - return this.requestOrganizationTarget; - } - - /** - * @param value {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) - */ - public EnrollmentResponse setRequestOrganizationTarget(Organization value) { - this.requestOrganizationTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("request", "Reference(EnrollmentRequest)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition)); - childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); - childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); - } - - public EnrollmentResponse copy() { - EnrollmentResponse dst = new EnrollmentResponse(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.request = request == null ? null : request.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.disposition = disposition == null ? null : disposition.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); - dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); - return dst; - } - - protected EnrollmentResponse typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof EnrollmentResponse)) - return false; - EnrollmentResponse o = (EnrollmentResponse) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true) - && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) - && compareDeep(created, o.created, true) && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) - && compareDeep(requestOrganization, o.requestOrganization, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof EnrollmentResponse)) - return false; - EnrollmentResponse o = (EnrollmentResponse) other; - return compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) - && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) - && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) - && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.EnrollmentResponse; - } - - @SearchParamDefinition(name="identifier", path="EnrollmentResponse.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * This resource provides Enrollment and plan details from the processing of an Enrollment resource. + */ +@ResourceDef(name="EnrollmentResponse", profile="http://hl7.org/fhir/Profile/EnrollmentResponse") +public class EnrollmentResponse extends DomainResource { + + public enum RSLink { + /** + * The processing completed without errors. + */ + COMPLETE, + /** + * The processing identified with errors. + */ + ERROR, + /** + * added to help the parsers + */ + NULL; + public static RSLink fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return COMPLETE; + if ("error".equals(codeString)) + return ERROR; + throw new Exception("Unknown RSLink code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case ERROR: return "error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return ""; + case ERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The processing completed without errors."; + case ERROR: return "The processing identified with errors."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "Complete"; + case ERROR: return "Error"; + default: return "?"; + } + } + } + + public static class RSLinkEnumFactory implements EnumFactory { + public RSLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return RSLink.COMPLETE; + if ("error".equals(codeString)) + return RSLink.ERROR; + throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); + } + public String toCode(RSLink code) { + if (code == RSLink.COMPLETE) + return "complete"; + if (code == RSLink.ERROR) + return "error"; + return "?"; + } + } + + /** + * The Response Business Identifier. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * Original request resource reference. + */ + @Child(name = "request", type = {EnrollmentRequest.class}, order=1, min=0, max=1) + @Description(shortDefinition="Claim reference", formalDefinition="Original request resource reference." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (Original request resource reference.) + */ + protected EnrollmentRequest requestTarget; + + /** + * Transaction status: error, complete. + */ + @Child(name = "outcome", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) + protected Enumeration outcome; + + /** + * A description of the status of the adjudication. + */ + @Child(name = "disposition", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) + protected StringType disposition; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=5, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateTimeType created; + + /** + * The Insurer who produced this adjudicated response. + */ + @Child(name = "organization", type = {Organization.class}, order=7, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) + */ + protected Organization organizationTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name = "requestProvider", type = {Practitioner.class}, order=8, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference requestProvider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner requestProviderTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name = "requestOrganization", type = {Organization.class}, order=9, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference requestOrganization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization requestOrganizationTarget; + + private static final long serialVersionUID = -318929031L; + + /* + * Constructor + */ + public EnrollmentResponse() { + super(); + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public EnrollmentResponse addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #request} (Original request resource reference.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); // cc + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request resource reference.) + */ + public EnrollmentResponse setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original request resource reference.) + */ + public EnrollmentRequest getRequestTarget() { + if (this.requestTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.request"); + else if (Configuration.doAutoCreate()) + this.requestTarget = new EnrollmentRequest(); // aa + return this.requestTarget; + } + + /** + * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original request resource reference.) + */ + public EnrollmentResponse setRequestTarget(EnrollmentRequest value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public Enumeration getOutcomeElement() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new Enumeration(new RSLinkEnumFactory()); // bb + return this.outcome; + } + + public boolean hasOutcomeElement() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public EnrollmentResponse setOutcomeElement(Enumeration value) { + this.outcome = value; + return this; + } + + /** + * @return Transaction status: error, complete. + */ + public RSLink getOutcome() { + return this.outcome == null ? null : this.outcome.getValue(); + } + + /** + * @param value Transaction status: error, complete. + */ + public EnrollmentResponse setOutcome(RSLink value) { + if (value == null) + this.outcome = null; + else { + if (this.outcome == null) + this.outcome = new Enumeration(new RSLinkEnumFactory()); + this.outcome.setValue(value); + } + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); // bb + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public EnrollmentResponse setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication. + */ + public EnrollmentResponse setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public EnrollmentResponse setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public EnrollmentResponse setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public EnrollmentResponse setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when the enclosed suite of services were performed or completed. + */ + public EnrollmentResponse setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); // cc + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public EnrollmentResponse setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); // aa + return this.organizationTarget; + } + + /** + * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) + */ + public EnrollmentResponse setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getRequestProvider() { + if (this.requestProvider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProvider = new Reference(); // cc + return this.requestProvider; + } + + public boolean hasRequestProvider() { + return this.requestProvider != null && !this.requestProvider.isEmpty(); + } + + /** + * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public EnrollmentResponse setRequestProvider(Reference value) { + this.requestProvider = value; + return this; + } + + /** + * @return {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getRequestProviderTarget() { + if (this.requestProviderTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProviderTarget = new Practitioner(); // aa + return this.requestProviderTarget; + } + + /** + * @param value {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public EnrollmentResponse setRequestProviderTarget(Practitioner value) { + this.requestProviderTarget = value; + return this; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getRequestOrganization() { + if (this.requestOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganization = new Reference(); // cc + return this.requestOrganization; + } + + public boolean hasRequestOrganization() { + return this.requestOrganization != null && !this.requestOrganization.isEmpty(); + } + + /** + * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public EnrollmentResponse setRequestOrganization(Reference value) { + this.requestOrganization = value; + return this; + } + + /** + * @return {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) + */ + public Organization getRequestOrganizationTarget() { + if (this.requestOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganizationTarget = new Organization(); // aa + return this.requestOrganizationTarget; + } + + /** + * @param value {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) + */ + public EnrollmentResponse setRequestOrganizationTarget(Organization value) { + this.requestOrganizationTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("request", "Reference(EnrollmentRequest)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome)); + childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition)); + childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); + childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); + childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); + childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); + } + + public EnrollmentResponse copy() { + EnrollmentResponse dst = new EnrollmentResponse(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.request = request == null ? null : request.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.disposition = disposition == null ? null : disposition.copy(); + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + dst.created = created == null ? null : created.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); + dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); + return dst; + } + + protected EnrollmentResponse typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof EnrollmentResponse)) + return false; + EnrollmentResponse o = (EnrollmentResponse) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true) + && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) + && compareDeep(created, o.created, true) && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) + && compareDeep(requestOrganization, o.requestOrganization, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof EnrollmentResponse)) + return false; + EnrollmentResponse o = (EnrollmentResponse) other; + return compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) + && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) + && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) + && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) + && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.EnrollmentResponse; + } + + @SearchParamDefinition(name="identifier", path="EnrollmentResponse.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EnumFactory.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EnumFactory.java index 3a2e02b3017..c722c39e25e 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EnumFactory.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EnumFactory.java @@ -1,77 +1,56 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import org.hl7.fhir.instance.model.api.IBaseEnumFactory; - - -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ - -/** - * Helper class to help manage generic enumerated types - */ -public interface EnumFactory> extends IBaseEnumFactory { - - /** - * Read an enumeration value from the string that represents it on the XML or JSON - * @param codeString the value found in the XML or JSON - * @return the enumeration value - * @throws Exception is the value is not known - */ - public T fromCode(String codeString) throws IllegalArgumentException; - - /** - * Get the XML/JSON representation for an enumerated value - * @param code - the enumeration value - * @return the XML/JSON representation - * @throws Exception if the enumeration is not valid (would usually indicate a code generation bug) - */ - public String toCode(T code); - -} +package org.hl7.fhir.instance.model; + +import org.hl7.fhir.instance.model.api.IBaseEnumFactory; + + +/* +Copyright (c) 2011+, HL7, Inc +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +*/ + +/** + * Helper class to help manage generic enumerated types + */ +public interface EnumFactory> extends IBaseEnumFactory { + + /** + * Read an enumeration value from the string that represents it on the XML or JSON + * @param codeString the value found in the XML or JSON + * @return the enumeration value + * @throws Exception is the value is not known + */ + public T fromCode(String codeString) throws IllegalArgumentException; + + /** + * Get the XML/JSON representation for an enumerated value + * @param code - the enumeration value + * @return the XML/JSON representation + * @throws Exception if the enumeration is not valid (would usually indicate a code generation bug) + */ + public String toCode(T code); + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Enumeration.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Enumeration.java index ba369e7c5a6..87629af3263 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Enumeration.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Enumeration.java @@ -1,114 +1,93 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -import org.hl7.fhir.instance.model.api.IBaseEnumeration; - -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ - -/** - * Primitive type "code" in FHIR, where the code is tied to an enumerated list of possible values - * - */ -@DatatypeDef(name="code", isSpecialization=true) -public class Enumeration> extends PrimitiveType implements IBaseEnumeration { - - private static final long serialVersionUID = 1L; - private EnumFactory myEnumFactory; - - /** - * Constructor - */ - public Enumeration(EnumFactory theEnumFactory) { - if (theEnumFactory == null) - throw new IllegalArgumentException("An enumeration factory must be provided"); - myEnumFactory = theEnumFactory; - } - - /** - * Constructor - */ - public Enumeration(EnumFactory theEnumFactory, T theValue) { - if (theEnumFactory == null) - throw new IllegalArgumentException("An enumeration factory must be provided"); - myEnumFactory = theEnumFactory; - setValue(theValue); - } - - /** - * Constructor - */ - public Enumeration(EnumFactory theEnumFactory, String theValue) { - if (theEnumFactory == null) - throw new IllegalArgumentException("An enumeration factory must be provided"); - myEnumFactory = theEnumFactory; - setValueAsString(theValue); - } - - @Override - protected T parse(String theValue) { - if (myEnumFactory != null) { - return myEnumFactory.fromCode(theValue); - } - return null; - } - - @Override - protected String encode(T theValue) { - return myEnumFactory.toCode(theValue); - } - - @Override - public Enumeration copy() { - return new Enumeration(myEnumFactory, getValue()); - } - - -} +package org.hl7.fhir.instance.model; + +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +import org.hl7.fhir.instance.model.api.IBaseEnumeration; + +/* +Copyright (c) 2011+, HL7, Inc +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +*/ + +/** + * Primitive type "code" in FHIR, where the code is tied to an enumerated list of possible values + * + */ +@DatatypeDef(name="code", isSpecialization=true) +public class Enumeration> extends PrimitiveType implements IBaseEnumeration { + + private static final long serialVersionUID = 1L; + private EnumFactory myEnumFactory; + + /** + * Constructor + */ + public Enumeration(EnumFactory theEnumFactory) { + if (theEnumFactory == null) + throw new IllegalArgumentException("An enumeration factory must be provided"); + myEnumFactory = theEnumFactory; + } + + /** + * Constructor + */ + public Enumeration(EnumFactory theEnumFactory, T theValue) { + if (theEnumFactory == null) + throw new IllegalArgumentException("An enumeration factory must be provided"); + myEnumFactory = theEnumFactory; + setValue(theValue); + } + + /** + * Constructor + */ + public Enumeration(EnumFactory theEnumFactory, String theValue) { + if (theEnumFactory == null) + throw new IllegalArgumentException("An enumeration factory must be provided"); + myEnumFactory = theEnumFactory; + setValueAsString(theValue); + } + + @Override + protected T parse(String theValue) { + if (myEnumFactory != null) { + return myEnumFactory.fromCode(theValue); + } + return null; + } + + @Override + protected String encode(T theValue) { + return myEnumFactory.toCode(theValue); + } + + @Override + public Enumeration copy() { + return new Enumeration(myEnumFactory, getValue()); + } + + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Enumerations.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Enumerations.java index f28b1427ffc..dbe04f8dc59 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Enumerations.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Enumerations.java @@ -1,112 +1,91 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -public class Enumerations { - - public enum ConformanceResourceStatus { - /** - * This resource is still under development - */ - DRAFT, - /** - * This resource is ready for normal use - */ - ACTIVE, - /** - * This resource has been withdrawn or superceded and should no longer be used - */ - RETIRED, - /** - * added to help the parsers - */ - NULL; - public static ConformanceResourceStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return DRAFT; - if ("active".equals(codeString)) - return ACTIVE; - if ("retired".equals(codeString)) - return RETIRED; - throw new Exception("Unknown ConformanceResourceStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case DRAFT: return "draft"; - case ACTIVE: return "active"; - case RETIRED: return "retired"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DRAFT: return ""; - case ACTIVE: return ""; - case RETIRED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DRAFT: return "This resource is still under development"; - case ACTIVE: return "This resource is ready for normal use"; - case RETIRED: return "This resource has been withdrawn or superceded and should no longer be used"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DRAFT: return "Draft"; - case ACTIVE: return "Active"; - case RETIRED: return "Retired"; - default: return "?"; - } - } - } - - public static class ConformanceResourceStatusEnumFactory implements EnumFactory { - public ConformanceResourceStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return ConformanceResourceStatus.DRAFT; - if ("active".equals(codeString)) - return ConformanceResourceStatus.ACTIVE; - if ("retired".equals(codeString)) - return ConformanceResourceStatus.RETIRED; - throw new IllegalArgumentException("Unknown ConformanceResourceStatus code '"+codeString+"'"); - } - public String toCode(ConformanceResourceStatus code) { - if (code == ConformanceResourceStatus.DRAFT) - return "draft"; - if (code == ConformanceResourceStatus.ACTIVE) - return "active"; - if (code == ConformanceResourceStatus.RETIRED) - return "retired"; - return "?"; - } - } - -} +package org.hl7.fhir.instance.model; + +public class Enumerations { + + public enum ConformanceResourceStatus { + /** + * This resource is still under development + */ + DRAFT, + /** + * This resource is ready for normal use + */ + ACTIVE, + /** + * This resource has been withdrawn or superceded and should no longer be used + */ + RETIRED, + /** + * added to help the parsers + */ + NULL; + public static ConformanceResourceStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return DRAFT; + if ("active".equals(codeString)) + return ACTIVE; + if ("retired".equals(codeString)) + return RETIRED; + throw new Exception("Unknown ConformanceResourceStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case DRAFT: return "draft"; + case ACTIVE: return "active"; + case RETIRED: return "retired"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DRAFT: return ""; + case ACTIVE: return ""; + case RETIRED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DRAFT: return "This resource is still under development"; + case ACTIVE: return "This resource is ready for normal use"; + case RETIRED: return "This resource has been withdrawn or superceded and should no longer be used"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DRAFT: return "Draft"; + case ACTIVE: return "Active"; + case RETIRED: return "Retired"; + default: return "?"; + } + } + } + + public static class ConformanceResourceStatusEnumFactory implements EnumFactory { + public ConformanceResourceStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return ConformanceResourceStatus.DRAFT; + if ("active".equals(codeString)) + return ConformanceResourceStatus.ACTIVE; + if ("retired".equals(codeString)) + return ConformanceResourceStatus.RETIRED; + throw new IllegalArgumentException("Unknown ConformanceResourceStatus code '"+codeString+"'"); + } + public String toCode(ConformanceResourceStatus code) { + if (code == ConformanceResourceStatus.DRAFT) + return "draft"; + if (code == ConformanceResourceStatus.ACTIVE) + return "active"; + if (code == ConformanceResourceStatus.RETIRED) + return "retired"; + return "?"; + } + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EpisodeOfCare.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EpisodeOfCare.java index 639dfa2dfc9..fea384111dc 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EpisodeOfCare.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/EpisodeOfCare.java @@ -1,1252 +1,1231 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. - */ -@ResourceDef(name="EpisodeOfCare", profile="http://hl7.org/fhir/Profile/EpisodeOfCare") -public class EpisodeOfCare extends DomainResource { - - public enum EpisodeOfCareStatus { - /** - * This episode of care is planned to start at the date specified in the period.start. During this status an organization may perform assessments to determine if they are eligible to receive services, or be organizing to make resources available to provide care services. - */ - PLANNED, - /** - * This episode has been placed on a waitlist, pending the episode being made active (or cancelled). - */ - WAITLIST, - /** - * This episode of care is current. - */ - ACTIVE, - /** - * This episode of care is on hold, the organization has limited responsibility for the patient (such as while on respite). - */ - ONHOLD, - /** - * This episode of care is finished at the organization is not expecting to be providing care to the patient. Can also be known as "closed", "completed" or other similar terms. - */ - FINISHED, - /** - * The episode of care was cancelled, or withdrawn from service, often selected during the planned stage as the patient may have gone elsewhere, or the circumstances have changed and the organization is unable to provide the care. It indicates that services terminated outside the planned/expected workflow. - */ - CANCELLED, - /** - * added to help the parsers - */ - NULL; - public static EpisodeOfCareStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return PLANNED; - if ("waitlist".equals(codeString)) - return WAITLIST; - if ("active".equals(codeString)) - return ACTIVE; - if ("onhold".equals(codeString)) - return ONHOLD; - if ("finished".equals(codeString)) - return FINISHED; - if ("cancelled".equals(codeString)) - return CANCELLED; - throw new Exception("Unknown EpisodeOfCareStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PLANNED: return "planned"; - case WAITLIST: return "waitlist"; - case ACTIVE: return "active"; - case ONHOLD: return "onhold"; - case FINISHED: return "finished"; - case CANCELLED: return "cancelled"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PLANNED: return ""; - case WAITLIST: return ""; - case ACTIVE: return ""; - case ONHOLD: return ""; - case FINISHED: return ""; - case CANCELLED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PLANNED: return "This episode of care is planned to start at the date specified in the period.start. During this status an organization may perform assessments to determine if they are eligible to receive services, or be organizing to make resources available to provide care services."; - case WAITLIST: return "This episode has been placed on a waitlist, pending the episode being made active (or cancelled)."; - case ACTIVE: return "This episode of care is current."; - case ONHOLD: return "This episode of care is on hold, the organization has limited responsibility for the patient (such as while on respite)."; - case FINISHED: return "This episode of care is finished at the organization is not expecting to be providing care to the patient. Can also be known as 'closed', 'completed' or other similar terms."; - case CANCELLED: return "The episode of care was cancelled, or withdrawn from service, often selected during the planned stage as the patient may have gone elsewhere, or the circumstances have changed and the organization is unable to provide the care. It indicates that services terminated outside the planned/expected workflow."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PLANNED: return "Planned"; - case WAITLIST: return "Waitlist"; - case ACTIVE: return "Active"; - case ONHOLD: return "On Hold"; - case FINISHED: return "Finished"; - case CANCELLED: return "Cancelled"; - default: return "?"; - } - } - } - - public static class EpisodeOfCareStatusEnumFactory implements EnumFactory { - public EpisodeOfCareStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return EpisodeOfCareStatus.PLANNED; - if ("waitlist".equals(codeString)) - return EpisodeOfCareStatus.WAITLIST; - if ("active".equals(codeString)) - return EpisodeOfCareStatus.ACTIVE; - if ("onhold".equals(codeString)) - return EpisodeOfCareStatus.ONHOLD; - if ("finished".equals(codeString)) - return EpisodeOfCareStatus.FINISHED; - if ("cancelled".equals(codeString)) - return EpisodeOfCareStatus.CANCELLED; - throw new IllegalArgumentException("Unknown EpisodeOfCareStatus code '"+codeString+"'"); - } - public String toCode(EpisodeOfCareStatus code) { - if (code == EpisodeOfCareStatus.PLANNED) - return "planned"; - if (code == EpisodeOfCareStatus.WAITLIST) - return "waitlist"; - if (code == EpisodeOfCareStatus.ACTIVE) - return "active"; - if (code == EpisodeOfCareStatus.ONHOLD) - return "onhold"; - if (code == EpisodeOfCareStatus.FINISHED) - return "finished"; - if (code == EpisodeOfCareStatus.CANCELLED) - return "cancelled"; - return "?"; - } - } - - @Block() - public static class EpisodeOfCareStatusHistoryComponent extends BackboneElement implements IBaseBackboneElement { - /** - * planned | waitlist | active | onhold | finished | cancelled. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="planned | waitlist | active | onhold | finished | cancelled", formalDefinition="planned | waitlist | active | onhold | finished | cancelled." ) - protected Enumeration status; - - /** - * The period during this EpisodeOfCare that the specific status applied. - */ - @Child(name = "period", type = {Period.class}, order=2, min=1, max=1) - @Description(shortDefinition="The period during this EpisodeOfCare that the specific status applied", formalDefinition="The period during this EpisodeOfCare that the specific status applied." ) - protected Period period; - - private static final long serialVersionUID = -1192432864L; - - /* - * Constructor - */ - public EpisodeOfCareStatusHistoryComponent() { - super(); - } - - /* - * Constructor - */ - public EpisodeOfCareStatusHistoryComponent(Enumeration status, Period period) { - super(); - this.status = status; - this.period = period; - } - - /** - * @return {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCareStatusHistoryComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new EpisodeOfCareStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public EpisodeOfCareStatusHistoryComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return planned | waitlist | active | onhold | finished | cancelled. - */ - public EpisodeOfCareStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value planned | waitlist | active | onhold | finished | cancelled. - */ - public EpisodeOfCareStatusHistoryComponent setStatus(EpisodeOfCareStatus value) { - if (this.status == null) - this.status = new Enumeration(new EpisodeOfCareStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #period} (The period during this EpisodeOfCare that the specific status applied.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCareStatusHistoryComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The period during this EpisodeOfCare that the specific status applied.) - */ - public EpisodeOfCareStatusHistoryComponent setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("status", "code", "planned | waitlist | active | onhold | finished | cancelled.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("period", "Period", "The period during this EpisodeOfCare that the specific status applied.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - public EpisodeOfCareStatusHistoryComponent copy() { - EpisodeOfCareStatusHistoryComponent dst = new EpisodeOfCareStatusHistoryComponent(); - copyValues(dst); - dst.status = status == null ? null : status.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof EpisodeOfCareStatusHistoryComponent)) - return false; - EpisodeOfCareStatusHistoryComponent o = (EpisodeOfCareStatusHistoryComponent) other; - return compareDeep(status, o.status, true) && compareDeep(period, o.period, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof EpisodeOfCareStatusHistoryComponent)) - return false; - EpisodeOfCareStatusHistoryComponent o = (EpisodeOfCareStatusHistoryComponent) other; - return compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (status == null || status.isEmpty()) && (period == null || period.isEmpty()) - ; - } - - } - - @Block() - public static class EpisodeOfCareCareTeamComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The practitioner (or Organization) within the team. - */ - @Child(name = "member", type = {Practitioner.class, Organization.class}, order=1, min=0, max=1) - @Description(shortDefinition="The practitioner (or Organization) within the team", formalDefinition="The practitioner (or Organization) within the team." ) - protected Reference member; - - /** - * The actual object that is the target of the reference (The practitioner (or Organization) within the team.) - */ - protected Resource memberTarget; - - /** - * The role that this team member is taking within this episode of care. - */ - @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The role that this team member is taking within this episode of care", formalDefinition="The role that this team member is taking within this episode of care." ) - protected List role; - - /** - * The period of time that this practitioner is performing some role within the episode of care. - */ - @Child(name = "period", type = {Period.class}, order=3, min=0, max=1) - @Description(shortDefinition="The period of time that this practitioner is performing some role within the episode of care", formalDefinition="The period of time that this practitioner is performing some role within the episode of care." ) - protected Period period; - - private static final long serialVersionUID = -2134086895L; - - /* - * Constructor - */ - public EpisodeOfCareCareTeamComponent() { - super(); - } - - /** - * @return {@link #member} (The practitioner (or Organization) within the team.) - */ - public Reference getMember() { - if (this.member == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCareCareTeamComponent.member"); - else if (Configuration.doAutoCreate()) - this.member = new Reference(); // cc - return this.member; - } - - public boolean hasMember() { - return this.member != null && !this.member.isEmpty(); - } - - /** - * @param value {@link #member} (The practitioner (or Organization) within the team.) - */ - public EpisodeOfCareCareTeamComponent setMember(Reference value) { - this.member = value; - return this; - } - - /** - * @return {@link #member} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner (or Organization) within the team.) - */ - public Resource getMemberTarget() { - return this.memberTarget; - } - - /** - * @param value {@link #member} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner (or Organization) within the team.) - */ - public EpisodeOfCareCareTeamComponent setMemberTarget(Resource value) { - this.memberTarget = value; - return this; - } - - /** - * @return {@link #role} (The role that this team member is taking within this episode of care.) - */ - public List getRole() { - if (this.role == null) - this.role = new ArrayList(); - return this.role; - } - - public boolean hasRole() { - if (this.role == null) - return false; - for (CodeableConcept item : this.role) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #role} (The role that this team member is taking within this episode of care.) - */ - // syntactic sugar - public CodeableConcept addRole() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.role == null) - this.role = new ArrayList(); - this.role.add(t); - return t; - } - - // syntactic sugar - public EpisodeOfCareCareTeamComponent addRole(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.role == null) - this.role = new ArrayList(); - this.role.add(t); - return this; - } - - /** - * @return {@link #period} (The period of time that this practitioner is performing some role within the episode of care.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCareCareTeamComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The period of time that this practitioner is performing some role within the episode of care.) - */ - public EpisodeOfCareCareTeamComponent setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("member", "Reference(Practitioner|Organization)", "The practitioner (or Organization) within the team.", 0, java.lang.Integer.MAX_VALUE, member)); - childrenList.add(new Property("role", "CodeableConcept", "The role that this team member is taking within this episode of care.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("period", "Period", "The period of time that this practitioner is performing some role within the episode of care.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - public EpisodeOfCareCareTeamComponent copy() { - EpisodeOfCareCareTeamComponent dst = new EpisodeOfCareCareTeamComponent(); - copyValues(dst); - dst.member = member == null ? null : member.copy(); - if (role != null) { - dst.role = new ArrayList(); - for (CodeableConcept i : role) - dst.role.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof EpisodeOfCareCareTeamComponent)) - return false; - EpisodeOfCareCareTeamComponent o = (EpisodeOfCareCareTeamComponent) other; - return compareDeep(member, o.member, true) && compareDeep(role, o.role, true) && compareDeep(period, o.period, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof EpisodeOfCareCareTeamComponent)) - return false; - EpisodeOfCareCareTeamComponent o = (EpisodeOfCareCareTeamComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (member == null || member.isEmpty()) && (role == null || role.isEmpty()) - && (period == null || period.isEmpty()); - } - - } - - /** - * Identifier(s) by which this EpisodeOfCare is known. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Identifier(s) by which this EpisodeOfCare is known", formalDefinition="Identifier(s) by which this EpisodeOfCare is known." ) - protected List identifier; - - /** - * planned | waitlist | active | onhold | finished | cancelled. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="planned | waitlist | active | onhold | finished | cancelled", formalDefinition="planned | waitlist | active | onhold | finished | cancelled." ) - protected Enumeration status; - - /** - * The status history for the EpisodeOfCare. - */ - @Child(name = "statusHistory", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The status history for the EpisodeOfCare", formalDefinition="The status history for the EpisodeOfCare." ) - protected List statusHistory; - - /** - * The type can be very important in processing as this could be used in determining if the EpisodeOfCare is relevant to specific government reporting, or other types of classifications. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Specific type of EpisodeOfCare", formalDefinition="The type can be very important in processing as this could be used in determining if the EpisodeOfCare is relevant to specific government reporting, or other types of classifications." ) - protected List type; - - /** - * The patient that this EpisodeOfCare applies to. - */ - @Child(name = "patient", type = {Patient.class}, order=4, min=1, max=1) - @Description(shortDefinition="The patient that this EpisodeOfCare applies to", formalDefinition="The patient that this EpisodeOfCare applies to." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient that this EpisodeOfCare applies to.) - */ - protected Patient patientTarget; - - /** - * The organization that has assumed the specific responsibilities for the specified duration. - */ - @Child(name = "managingOrganization", type = {Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="The organization that has assumed the specific responsibilities for the specified duration", formalDefinition="The organization that has assumed the specific responsibilities for the specified duration." ) - protected Reference managingOrganization; - - /** - * The actual object that is the target of the reference (The organization that has assumed the specific responsibilities for the specified duration.) - */ - protected Organization managingOrganizationTarget; - - /** - * The interval during which the managing organization assumes the defined responsibility. - */ - @Child(name = "period", type = {Period.class}, order=6, min=0, max=1) - @Description(shortDefinition="The interval during which the managing organization assumes the defined responsibility", formalDefinition="The interval during which the managing organization assumes the defined responsibility." ) - protected Period period; - - /** - * A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for. - */ - @Child(name = "condition", type = {Condition.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for", formalDefinition="A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for." ) - protected List condition; - /** - * The actual objects that are the target of the reference (A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) - */ - protected List conditionTarget; - - - /** - * Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals. - */ - @Child(name = "referralRequest", type = {ReferralRequest.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Referral Request(s) that this EpisodeOfCare manages activities within", formalDefinition="Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals." ) - protected List referralRequest; - /** - * The actual objects that are the target of the reference (Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) - */ - protected List referralRequestTarget; - - - /** - * The practitioner that is the care manager/care co-ordinator for this patient. - */ - @Child(name = "careManager", type = {Practitioner.class}, order=9, min=0, max=1) - @Description(shortDefinition="The practitioner that is the care manager/care co-ordinator for this patient", formalDefinition="The practitioner that is the care manager/care co-ordinator for this patient." ) - protected Reference careManager; - - /** - * The actual object that is the target of the reference (The practitioner that is the care manager/care co-ordinator for this patient.) - */ - protected Practitioner careManagerTarget; - - /** - * The list of practitioners that may be facilitating this episode of care for specific purposes. - */ - @Child(name = "careTeam", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The list of practitioners that may be facilitating this episode of care for specific purposes", formalDefinition="The list of practitioners that may be facilitating this episode of care for specific purposes." ) - protected List careTeam; - - private static final long serialVersionUID = -1251791864L; - - /* - * Constructor - */ - public EpisodeOfCare() { - super(); - } - - /* - * Constructor - */ - public EpisodeOfCare(Enumeration status, Reference patient) { - super(); - this.status = status; - this.patient = patient; - } - - /** - * @return {@link #identifier} (Identifier(s) by which this EpisodeOfCare is known.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifier(s) by which this EpisodeOfCare is known.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public EpisodeOfCare addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCare.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new EpisodeOfCareStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public EpisodeOfCare setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return planned | waitlist | active | onhold | finished | cancelled. - */ - public EpisodeOfCareStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value planned | waitlist | active | onhold | finished | cancelled. - */ - public EpisodeOfCare setStatus(EpisodeOfCareStatus value) { - if (this.status == null) - this.status = new Enumeration(new EpisodeOfCareStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #statusHistory} (The status history for the EpisodeOfCare.) - */ - public List getStatusHistory() { - if (this.statusHistory == null) - this.statusHistory = new ArrayList(); - return this.statusHistory; - } - - public boolean hasStatusHistory() { - if (this.statusHistory == null) - return false; - for (EpisodeOfCareStatusHistoryComponent item : this.statusHistory) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #statusHistory} (The status history for the EpisodeOfCare.) - */ - // syntactic sugar - public EpisodeOfCareStatusHistoryComponent addStatusHistory() { //3 - EpisodeOfCareStatusHistoryComponent t = new EpisodeOfCareStatusHistoryComponent(); - if (this.statusHistory == null) - this.statusHistory = new ArrayList(); - this.statusHistory.add(t); - return t; - } - - // syntactic sugar - public EpisodeOfCare addStatusHistory(EpisodeOfCareStatusHistoryComponent t) { //3 - if (t == null) - return this; - if (this.statusHistory == null) - this.statusHistory = new ArrayList(); - this.statusHistory.add(t); - return this; - } - - /** - * @return {@link #type} (The type can be very important in processing as this could be used in determining if the EpisodeOfCare is relevant to specific government reporting, or other types of classifications.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (CodeableConcept item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (The type can be very important in processing as this could be used in determining if the EpisodeOfCare is relevant to specific government reporting, or other types of classifications.) - */ - // syntactic sugar - public CodeableConcept addType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - // syntactic sugar - public EpisodeOfCare addType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - /** - * @return {@link #patient} (The patient that this EpisodeOfCare applies to.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCare.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The patient that this EpisodeOfCare applies to.) - */ - public EpisodeOfCare setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient that this EpisodeOfCare applies to.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCare.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient that this EpisodeOfCare applies to.) - */ - public EpisodeOfCare setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #managingOrganization} (The organization that has assumed the specific responsibilities for the specified duration.) - */ - public Reference getManagingOrganization() { - if (this.managingOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCare.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganization = new Reference(); // cc - return this.managingOrganization; - } - - public boolean hasManagingOrganization() { - return this.managingOrganization != null && !this.managingOrganization.isEmpty(); - } - - /** - * @param value {@link #managingOrganization} (The organization that has assumed the specific responsibilities for the specified duration.) - */ - public EpisodeOfCare setManagingOrganization(Reference value) { - this.managingOrganization = value; - return this; - } - - /** - * @return {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization that has assumed the specific responsibilities for the specified duration.) - */ - public Organization getManagingOrganizationTarget() { - if (this.managingOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCare.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganizationTarget = new Organization(); // aa - return this.managingOrganizationTarget; - } - - /** - * @param value {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization that has assumed the specific responsibilities for the specified duration.) - */ - public EpisodeOfCare setManagingOrganizationTarget(Organization value) { - this.managingOrganizationTarget = value; - return this; - } - - /** - * @return {@link #period} (The interval during which the managing organization assumes the defined responsibility.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCare.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The interval during which the managing organization assumes the defined responsibility.) - */ - public EpisodeOfCare setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #condition} (A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) - */ - public List getCondition() { - if (this.condition == null) - this.condition = new ArrayList(); - return this.condition; - } - - public boolean hasCondition() { - if (this.condition == null) - return false; - for (Reference item : this.condition) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #condition} (A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) - */ - // syntactic sugar - public Reference addCondition() { //3 - Reference t = new Reference(); - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return t; - } - - // syntactic sugar - public EpisodeOfCare addCondition(Reference t) { //3 - if (t == null) - return this; - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return this; - } - - /** - * @return {@link #condition} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) - */ - public List getConditionTarget() { - if (this.conditionTarget == null) - this.conditionTarget = new ArrayList(); - return this.conditionTarget; - } - - // syntactic sugar - /** - * @return {@link #condition} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) - */ - public Condition addConditionTarget() { - Condition r = new Condition(); - if (this.conditionTarget == null) - this.conditionTarget = new ArrayList(); - this.conditionTarget.add(r); - return r; - } - - /** - * @return {@link #referralRequest} (Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) - */ - public List getReferralRequest() { - if (this.referralRequest == null) - this.referralRequest = new ArrayList(); - return this.referralRequest; - } - - public boolean hasReferralRequest() { - if (this.referralRequest == null) - return false; - for (Reference item : this.referralRequest) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #referralRequest} (Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) - */ - // syntactic sugar - public Reference addReferralRequest() { //3 - Reference t = new Reference(); - if (this.referralRequest == null) - this.referralRequest = new ArrayList(); - this.referralRequest.add(t); - return t; - } - - // syntactic sugar - public EpisodeOfCare addReferralRequest(Reference t) { //3 - if (t == null) - return this; - if (this.referralRequest == null) - this.referralRequest = new ArrayList(); - this.referralRequest.add(t); - return this; - } - - /** - * @return {@link #referralRequest} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) - */ - public List getReferralRequestTarget() { - if (this.referralRequestTarget == null) - this.referralRequestTarget = new ArrayList(); - return this.referralRequestTarget; - } - - // syntactic sugar - /** - * @return {@link #referralRequest} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) - */ - public ReferralRequest addReferralRequestTarget() { - ReferralRequest r = new ReferralRequest(); - if (this.referralRequestTarget == null) - this.referralRequestTarget = new ArrayList(); - this.referralRequestTarget.add(r); - return r; - } - - /** - * @return {@link #careManager} (The practitioner that is the care manager/care co-ordinator for this patient.) - */ - public Reference getCareManager() { - if (this.careManager == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCare.careManager"); - else if (Configuration.doAutoCreate()) - this.careManager = new Reference(); // cc - return this.careManager; - } - - public boolean hasCareManager() { - return this.careManager != null && !this.careManager.isEmpty(); - } - - /** - * @param value {@link #careManager} (The practitioner that is the care manager/care co-ordinator for this patient.) - */ - public EpisodeOfCare setCareManager(Reference value) { - this.careManager = value; - return this; - } - - /** - * @return {@link #careManager} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner that is the care manager/care co-ordinator for this patient.) - */ - public Practitioner getCareManagerTarget() { - if (this.careManagerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCare.careManager"); - else if (Configuration.doAutoCreate()) - this.careManagerTarget = new Practitioner(); // aa - return this.careManagerTarget; - } - - /** - * @param value {@link #careManager} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner that is the care manager/care co-ordinator for this patient.) - */ - public EpisodeOfCare setCareManagerTarget(Practitioner value) { - this.careManagerTarget = value; - return this; - } - - /** - * @return {@link #careTeam} (The list of practitioners that may be facilitating this episode of care for specific purposes.) - */ - public List getCareTeam() { - if (this.careTeam == null) - this.careTeam = new ArrayList(); - return this.careTeam; - } - - public boolean hasCareTeam() { - if (this.careTeam == null) - return false; - for (EpisodeOfCareCareTeamComponent item : this.careTeam) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #careTeam} (The list of practitioners that may be facilitating this episode of care for specific purposes.) - */ - // syntactic sugar - public EpisodeOfCareCareTeamComponent addCareTeam() { //3 - EpisodeOfCareCareTeamComponent t = new EpisodeOfCareCareTeamComponent(); - if (this.careTeam == null) - this.careTeam = new ArrayList(); - this.careTeam.add(t); - return t; - } - - // syntactic sugar - public EpisodeOfCare addCareTeam(EpisodeOfCareCareTeamComponent t) { //3 - if (t == null) - return this; - if (this.careTeam == null) - this.careTeam = new ArrayList(); - this.careTeam.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier(s) by which this EpisodeOfCare is known.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "planned | waitlist | active | onhold | finished | cancelled.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("statusHistory", "", "The status history for the EpisodeOfCare.", 0, java.lang.Integer.MAX_VALUE, statusHistory)); - childrenList.add(new Property("type", "CodeableConcept", "The type can be very important in processing as this could be used in determining if the EpisodeOfCare is relevant to specific government reporting, or other types of classifications.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient that this EpisodeOfCare applies to.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The organization that has assumed the specific responsibilities for the specified duration.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); - childrenList.add(new Property("period", "Period", "The interval during which the managing organization assumes the defined responsibility.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("condition", "Reference(Condition)", "A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.", 0, java.lang.Integer.MAX_VALUE, condition)); - childrenList.add(new Property("referralRequest", "Reference(ReferralRequest)", "Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.", 0, java.lang.Integer.MAX_VALUE, referralRequest)); - childrenList.add(new Property("careManager", "Reference(Practitioner)", "The practitioner that is the care manager/care co-ordinator for this patient.", 0, java.lang.Integer.MAX_VALUE, careManager)); - childrenList.add(new Property("careTeam", "", "The list of practitioners that may be facilitating this episode of care for specific purposes.", 0, java.lang.Integer.MAX_VALUE, careTeam)); - } - - public EpisodeOfCare copy() { - EpisodeOfCare dst = new EpisodeOfCare(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - if (statusHistory != null) { - dst.statusHistory = new ArrayList(); - for (EpisodeOfCareStatusHistoryComponent i : statusHistory) - dst.statusHistory.add(i.copy()); - }; - if (type != null) { - dst.type = new ArrayList(); - for (CodeableConcept i : type) - dst.type.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); - dst.period = period == null ? null : period.copy(); - if (condition != null) { - dst.condition = new ArrayList(); - for (Reference i : condition) - dst.condition.add(i.copy()); - }; - if (referralRequest != null) { - dst.referralRequest = new ArrayList(); - for (Reference i : referralRequest) - dst.referralRequest.add(i.copy()); - }; - dst.careManager = careManager == null ? null : careManager.copy(); - if (careTeam != null) { - dst.careTeam = new ArrayList(); - for (EpisodeOfCareCareTeamComponent i : careTeam) - dst.careTeam.add(i.copy()); - }; - return dst; - } - - protected EpisodeOfCare typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof EpisodeOfCare)) - return false; - EpisodeOfCare o = (EpisodeOfCare) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(statusHistory, o.statusHistory, true) - && compareDeep(type, o.type, true) && compareDeep(patient, o.patient, true) && compareDeep(managingOrganization, o.managingOrganization, true) - && compareDeep(period, o.period, true) && compareDeep(condition, o.condition, true) && compareDeep(referralRequest, o.referralRequest, true) - && compareDeep(careManager, o.careManager, true) && compareDeep(careTeam, o.careTeam, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof EpisodeOfCare)) - return false; - EpisodeOfCare o = (EpisodeOfCare) other; - return compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (statusHistory == null || statusHistory.isEmpty()) && (type == null || type.isEmpty()) - && (patient == null || patient.isEmpty()) && (managingOrganization == null || managingOrganization.isEmpty()) - && (period == null || period.isEmpty()) && (condition == null || condition.isEmpty()) && (referralRequest == null || referralRequest.isEmpty()) - && (careManager == null || careManager.isEmpty()) && (careTeam == null || careTeam.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.EpisodeOfCare; - } - - @SearchParamDefinition(name="organization", path="EpisodeOfCare.managingOrganization", description="The organization that has assumed the specific responsibilities of this EpisodeOfCare", type="reference" ) - public static final String SP_ORGANIZATION = "organization"; - @SearchParamDefinition(name="patient", path="EpisodeOfCare.patient", description="The patient that this EpisodeOfCare applies to", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="condition", path="EpisodeOfCare.condition", description="A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for", type="reference" ) - public static final String SP_CONDITION = "condition"; - @SearchParamDefinition(name="status", path="EpisodeOfCare.status", description="The current status of the Episode of Care as provided (does not check the status history collection)", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="care-manager", path="EpisodeOfCare.careManager", description="The practitioner that is the care manager/care co-ordinator for this patient", type="reference" ) - public static final String SP_CAREMANAGER = "care-manager"; - @SearchParamDefinition(name="type", path="EpisodeOfCare.type", description="Specific type of EpisodeOfCare", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="date", path="EpisodeOfCare.period", description="The provided date search value falls within the episode of care's period", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="incomingreferral", path="EpisodeOfCare.referralRequest", description="Incoming Referral Request", type="reference" ) - public static final String SP_INCOMINGREFERRAL = "incomingreferral"; - @SearchParamDefinition(name="identifier", path="EpisodeOfCare.identifier", description="Identifier(s) by which this EpisodeOfCare is known", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="team-member", path="EpisodeOfCare.careTeam.member", description="A Practitioner or Organization allocated to the care team for this EpisodeOfCare", type="reference" ) - public static final String SP_TEAMMEMBER = "team-member"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. + */ +@ResourceDef(name="EpisodeOfCare", profile="http://hl7.org/fhir/Profile/EpisodeOfCare") +public class EpisodeOfCare extends DomainResource { + + public enum EpisodeOfCareStatus { + /** + * This episode of care is planned to start at the date specified in the period.start. During this status an organization may perform assessments to determine if they are eligible to receive services, or be organizing to make resources available to provide care services. + */ + PLANNED, + /** + * This episode has been placed on a waitlist, pending the episode being made active (or cancelled). + */ + WAITLIST, + /** + * This episode of care is current. + */ + ACTIVE, + /** + * This episode of care is on hold, the organization has limited responsibility for the patient (such as while on respite). + */ + ONHOLD, + /** + * This episode of care is finished at the organization is not expecting to be providing care to the patient. Can also be known as "closed", "completed" or other similar terms. + */ + FINISHED, + /** + * The episode of care was cancelled, or withdrawn from service, often selected during the planned stage as the patient may have gone elsewhere, or the circumstances have changed and the organization is unable to provide the care. It indicates that services terminated outside the planned/expected workflow. + */ + CANCELLED, + /** + * added to help the parsers + */ + NULL; + public static EpisodeOfCareStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return PLANNED; + if ("waitlist".equals(codeString)) + return WAITLIST; + if ("active".equals(codeString)) + return ACTIVE; + if ("onhold".equals(codeString)) + return ONHOLD; + if ("finished".equals(codeString)) + return FINISHED; + if ("cancelled".equals(codeString)) + return CANCELLED; + throw new Exception("Unknown EpisodeOfCareStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PLANNED: return "planned"; + case WAITLIST: return "waitlist"; + case ACTIVE: return "active"; + case ONHOLD: return "onhold"; + case FINISHED: return "finished"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PLANNED: return ""; + case WAITLIST: return ""; + case ACTIVE: return ""; + case ONHOLD: return ""; + case FINISHED: return ""; + case CANCELLED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PLANNED: return "This episode of care is planned to start at the date specified in the period.start. During this status an organization may perform assessments to determine if they are eligible to receive services, or be organizing to make resources available to provide care services."; + case WAITLIST: return "This episode has been placed on a waitlist, pending the episode being made active (or cancelled)."; + case ACTIVE: return "This episode of care is current."; + case ONHOLD: return "This episode of care is on hold, the organization has limited responsibility for the patient (such as while on respite)."; + case FINISHED: return "This episode of care is finished at the organization is not expecting to be providing care to the patient. Can also be known as 'closed', 'completed' or other similar terms."; + case CANCELLED: return "The episode of care was cancelled, or withdrawn from service, often selected during the planned stage as the patient may have gone elsewhere, or the circumstances have changed and the organization is unable to provide the care. It indicates that services terminated outside the planned/expected workflow."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PLANNED: return "Planned"; + case WAITLIST: return "Waitlist"; + case ACTIVE: return "Active"; + case ONHOLD: return "On Hold"; + case FINISHED: return "Finished"; + case CANCELLED: return "Cancelled"; + default: return "?"; + } + } + } + + public static class EpisodeOfCareStatusEnumFactory implements EnumFactory { + public EpisodeOfCareStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return EpisodeOfCareStatus.PLANNED; + if ("waitlist".equals(codeString)) + return EpisodeOfCareStatus.WAITLIST; + if ("active".equals(codeString)) + return EpisodeOfCareStatus.ACTIVE; + if ("onhold".equals(codeString)) + return EpisodeOfCareStatus.ONHOLD; + if ("finished".equals(codeString)) + return EpisodeOfCareStatus.FINISHED; + if ("cancelled".equals(codeString)) + return EpisodeOfCareStatus.CANCELLED; + throw new IllegalArgumentException("Unknown EpisodeOfCareStatus code '"+codeString+"'"); + } + public String toCode(EpisodeOfCareStatus code) { + if (code == EpisodeOfCareStatus.PLANNED) + return "planned"; + if (code == EpisodeOfCareStatus.WAITLIST) + return "waitlist"; + if (code == EpisodeOfCareStatus.ACTIVE) + return "active"; + if (code == EpisodeOfCareStatus.ONHOLD) + return "onhold"; + if (code == EpisodeOfCareStatus.FINISHED) + return "finished"; + if (code == EpisodeOfCareStatus.CANCELLED) + return "cancelled"; + return "?"; + } + } + + @Block() + public static class EpisodeOfCareStatusHistoryComponent extends BackboneElement implements IBaseBackboneElement { + /** + * planned | waitlist | active | onhold | finished | cancelled. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="planned | waitlist | active | onhold | finished | cancelled", formalDefinition="planned | waitlist | active | onhold | finished | cancelled." ) + protected Enumeration status; + + /** + * The period during this EpisodeOfCare that the specific status applied. + */ + @Child(name = "period", type = {Period.class}, order=2, min=1, max=1) + @Description(shortDefinition="The period during this EpisodeOfCare that the specific status applied", formalDefinition="The period during this EpisodeOfCare that the specific status applied." ) + protected Period period; + + private static final long serialVersionUID = -1192432864L; + + /* + * Constructor + */ + public EpisodeOfCareStatusHistoryComponent() { + super(); + } + + /* + * Constructor + */ + public EpisodeOfCareStatusHistoryComponent(Enumeration status, Period period) { + super(); + this.status = status; + this.period = period; + } + + /** + * @return {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EpisodeOfCareStatusHistoryComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new EpisodeOfCareStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public EpisodeOfCareStatusHistoryComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return planned | waitlist | active | onhold | finished | cancelled. + */ + public EpisodeOfCareStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value planned | waitlist | active | onhold | finished | cancelled. + */ + public EpisodeOfCareStatusHistoryComponent setStatus(EpisodeOfCareStatus value) { + if (this.status == null) + this.status = new Enumeration(new EpisodeOfCareStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #period} (The period during this EpisodeOfCare that the specific status applied.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EpisodeOfCareStatusHistoryComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period during this EpisodeOfCare that the specific status applied.) + */ + public EpisodeOfCareStatusHistoryComponent setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("status", "code", "planned | waitlist | active | onhold | finished | cancelled.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("period", "Period", "The period during this EpisodeOfCare that the specific status applied.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + public EpisodeOfCareStatusHistoryComponent copy() { + EpisodeOfCareStatusHistoryComponent dst = new EpisodeOfCareStatusHistoryComponent(); + copyValues(dst); + dst.status = status == null ? null : status.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof EpisodeOfCareStatusHistoryComponent)) + return false; + EpisodeOfCareStatusHistoryComponent o = (EpisodeOfCareStatusHistoryComponent) other; + return compareDeep(status, o.status, true) && compareDeep(period, o.period, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof EpisodeOfCareStatusHistoryComponent)) + return false; + EpisodeOfCareStatusHistoryComponent o = (EpisodeOfCareStatusHistoryComponent) other; + return compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (status == null || status.isEmpty()) && (period == null || period.isEmpty()) + ; + } + + } + + @Block() + public static class EpisodeOfCareCareTeamComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The practitioner (or Organization) within the team. + */ + @Child(name = "member", type = {Practitioner.class, Organization.class}, order=1, min=0, max=1) + @Description(shortDefinition="The practitioner (or Organization) within the team", formalDefinition="The practitioner (or Organization) within the team." ) + protected Reference member; + + /** + * The actual object that is the target of the reference (The practitioner (or Organization) within the team.) + */ + protected Resource memberTarget; + + /** + * The role that this team member is taking within this episode of care. + */ + @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The role that this team member is taking within this episode of care", formalDefinition="The role that this team member is taking within this episode of care." ) + protected List role; + + /** + * The period of time that this practitioner is performing some role within the episode of care. + */ + @Child(name = "period", type = {Period.class}, order=3, min=0, max=1) + @Description(shortDefinition="The period of time that this practitioner is performing some role within the episode of care", formalDefinition="The period of time that this practitioner is performing some role within the episode of care." ) + protected Period period; + + private static final long serialVersionUID = -2134086895L; + + /* + * Constructor + */ + public EpisodeOfCareCareTeamComponent() { + super(); + } + + /** + * @return {@link #member} (The practitioner (or Organization) within the team.) + */ + public Reference getMember() { + if (this.member == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EpisodeOfCareCareTeamComponent.member"); + else if (Configuration.doAutoCreate()) + this.member = new Reference(); // cc + return this.member; + } + + public boolean hasMember() { + return this.member != null && !this.member.isEmpty(); + } + + /** + * @param value {@link #member} (The practitioner (or Organization) within the team.) + */ + public EpisodeOfCareCareTeamComponent setMember(Reference value) { + this.member = value; + return this; + } + + /** + * @return {@link #member} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner (or Organization) within the team.) + */ + public Resource getMemberTarget() { + return this.memberTarget; + } + + /** + * @param value {@link #member} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner (or Organization) within the team.) + */ + public EpisodeOfCareCareTeamComponent setMemberTarget(Resource value) { + this.memberTarget = value; + return this; + } + + /** + * @return {@link #role} (The role that this team member is taking within this episode of care.) + */ + public List getRole() { + if (this.role == null) + this.role = new ArrayList(); + return this.role; + } + + public boolean hasRole() { + if (this.role == null) + return false; + for (CodeableConcept item : this.role) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #role} (The role that this team member is taking within this episode of care.) + */ + // syntactic sugar + public CodeableConcept addRole() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.role == null) + this.role = new ArrayList(); + this.role.add(t); + return t; + } + + // syntactic sugar + public EpisodeOfCareCareTeamComponent addRole(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.role == null) + this.role = new ArrayList(); + this.role.add(t); + return this; + } + + /** + * @return {@link #period} (The period of time that this practitioner is performing some role within the episode of care.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EpisodeOfCareCareTeamComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period of time that this practitioner is performing some role within the episode of care.) + */ + public EpisodeOfCareCareTeamComponent setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("member", "Reference(Practitioner|Organization)", "The practitioner (or Organization) within the team.", 0, java.lang.Integer.MAX_VALUE, member)); + childrenList.add(new Property("role", "CodeableConcept", "The role that this team member is taking within this episode of care.", 0, java.lang.Integer.MAX_VALUE, role)); + childrenList.add(new Property("period", "Period", "The period of time that this practitioner is performing some role within the episode of care.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + public EpisodeOfCareCareTeamComponent copy() { + EpisodeOfCareCareTeamComponent dst = new EpisodeOfCareCareTeamComponent(); + copyValues(dst); + dst.member = member == null ? null : member.copy(); + if (role != null) { + dst.role = new ArrayList(); + for (CodeableConcept i : role) + dst.role.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof EpisodeOfCareCareTeamComponent)) + return false; + EpisodeOfCareCareTeamComponent o = (EpisodeOfCareCareTeamComponent) other; + return compareDeep(member, o.member, true) && compareDeep(role, o.role, true) && compareDeep(period, o.period, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof EpisodeOfCareCareTeamComponent)) + return false; + EpisodeOfCareCareTeamComponent o = (EpisodeOfCareCareTeamComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (member == null || member.isEmpty()) && (role == null || role.isEmpty()) + && (period == null || period.isEmpty()); + } + + } + + /** + * Identifier(s) by which this EpisodeOfCare is known. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Identifier(s) by which this EpisodeOfCare is known", formalDefinition="Identifier(s) by which this EpisodeOfCare is known." ) + protected List identifier; + + /** + * planned | waitlist | active | onhold | finished | cancelled. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="planned | waitlist | active | onhold | finished | cancelled", formalDefinition="planned | waitlist | active | onhold | finished | cancelled." ) + protected Enumeration status; + + /** + * The status history for the EpisodeOfCare. + */ + @Child(name = "statusHistory", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The status history for the EpisodeOfCare", formalDefinition="The status history for the EpisodeOfCare." ) + protected List statusHistory; + + /** + * The type can be very important in processing as this could be used in determining if the EpisodeOfCare is relevant to specific government reporting, or other types of classifications. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Specific type of EpisodeOfCare", formalDefinition="The type can be very important in processing as this could be used in determining if the EpisodeOfCare is relevant to specific government reporting, or other types of classifications." ) + protected List type; + + /** + * The patient that this EpisodeOfCare applies to. + */ + @Child(name = "patient", type = {Patient.class}, order=4, min=1, max=1) + @Description(shortDefinition="The patient that this EpisodeOfCare applies to", formalDefinition="The patient that this EpisodeOfCare applies to." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient that this EpisodeOfCare applies to.) + */ + protected Patient patientTarget; + + /** + * The organization that has assumed the specific responsibilities for the specified duration. + */ + @Child(name = "managingOrganization", type = {Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="The organization that has assumed the specific responsibilities for the specified duration", formalDefinition="The organization that has assumed the specific responsibilities for the specified duration." ) + protected Reference managingOrganization; + + /** + * The actual object that is the target of the reference (The organization that has assumed the specific responsibilities for the specified duration.) + */ + protected Organization managingOrganizationTarget; + + /** + * The interval during which the managing organization assumes the defined responsibility. + */ + @Child(name = "period", type = {Period.class}, order=6, min=0, max=1) + @Description(shortDefinition="The interval during which the managing organization assumes the defined responsibility", formalDefinition="The interval during which the managing organization assumes the defined responsibility." ) + protected Period period; + + /** + * A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for. + */ + @Child(name = "condition", type = {Condition.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for", formalDefinition="A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for." ) + protected List condition; + /** + * The actual objects that are the target of the reference (A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) + */ + protected List conditionTarget; + + + /** + * Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals. + */ + @Child(name = "referralRequest", type = {ReferralRequest.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Referral Request(s) that this EpisodeOfCare manages activities within", formalDefinition="Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals." ) + protected List referralRequest; + /** + * The actual objects that are the target of the reference (Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) + */ + protected List referralRequestTarget; + + + /** + * The practitioner that is the care manager/care co-ordinator for this patient. + */ + @Child(name = "careManager", type = {Practitioner.class}, order=9, min=0, max=1) + @Description(shortDefinition="The practitioner that is the care manager/care co-ordinator for this patient", formalDefinition="The practitioner that is the care manager/care co-ordinator for this patient." ) + protected Reference careManager; + + /** + * The actual object that is the target of the reference (The practitioner that is the care manager/care co-ordinator for this patient.) + */ + protected Practitioner careManagerTarget; + + /** + * The list of practitioners that may be facilitating this episode of care for specific purposes. + */ + @Child(name = "careTeam", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The list of practitioners that may be facilitating this episode of care for specific purposes", formalDefinition="The list of practitioners that may be facilitating this episode of care for specific purposes." ) + protected List careTeam; + + private static final long serialVersionUID = -1251791864L; + + /* + * Constructor + */ + public EpisodeOfCare() { + super(); + } + + /* + * Constructor + */ + public EpisodeOfCare(Enumeration status, Reference patient) { + super(); + this.status = status; + this.patient = patient; + } + + /** + * @return {@link #identifier} (Identifier(s) by which this EpisodeOfCare is known.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Identifier(s) by which this EpisodeOfCare is known.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public EpisodeOfCare addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EpisodeOfCare.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new EpisodeOfCareStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public EpisodeOfCare setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return planned | waitlist | active | onhold | finished | cancelled. + */ + public EpisodeOfCareStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value planned | waitlist | active | onhold | finished | cancelled. + */ + public EpisodeOfCare setStatus(EpisodeOfCareStatus value) { + if (this.status == null) + this.status = new Enumeration(new EpisodeOfCareStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #statusHistory} (The status history for the EpisodeOfCare.) + */ + public List getStatusHistory() { + if (this.statusHistory == null) + this.statusHistory = new ArrayList(); + return this.statusHistory; + } + + public boolean hasStatusHistory() { + if (this.statusHistory == null) + return false; + for (EpisodeOfCareStatusHistoryComponent item : this.statusHistory) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #statusHistory} (The status history for the EpisodeOfCare.) + */ + // syntactic sugar + public EpisodeOfCareStatusHistoryComponent addStatusHistory() { //3 + EpisodeOfCareStatusHistoryComponent t = new EpisodeOfCareStatusHistoryComponent(); + if (this.statusHistory == null) + this.statusHistory = new ArrayList(); + this.statusHistory.add(t); + return t; + } + + // syntactic sugar + public EpisodeOfCare addStatusHistory(EpisodeOfCareStatusHistoryComponent t) { //3 + if (t == null) + return this; + if (this.statusHistory == null) + this.statusHistory = new ArrayList(); + this.statusHistory.add(t); + return this; + } + + /** + * @return {@link #type} (The type can be very important in processing as this could be used in determining if the EpisodeOfCare is relevant to specific government reporting, or other types of classifications.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (CodeableConcept item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (The type can be very important in processing as this could be used in determining if the EpisodeOfCare is relevant to specific government reporting, or other types of classifications.) + */ + // syntactic sugar + public CodeableConcept addType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + // syntactic sugar + public EpisodeOfCare addType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + /** + * @return {@link #patient} (The patient that this EpisodeOfCare applies to.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EpisodeOfCare.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The patient that this EpisodeOfCare applies to.) + */ + public EpisodeOfCare setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient that this EpisodeOfCare applies to.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EpisodeOfCare.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient that this EpisodeOfCare applies to.) + */ + public EpisodeOfCare setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #managingOrganization} (The organization that has assumed the specific responsibilities for the specified duration.) + */ + public Reference getManagingOrganization() { + if (this.managingOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EpisodeOfCare.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganization = new Reference(); // cc + return this.managingOrganization; + } + + public boolean hasManagingOrganization() { + return this.managingOrganization != null && !this.managingOrganization.isEmpty(); + } + + /** + * @param value {@link #managingOrganization} (The organization that has assumed the specific responsibilities for the specified duration.) + */ + public EpisodeOfCare setManagingOrganization(Reference value) { + this.managingOrganization = value; + return this; + } + + /** + * @return {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization that has assumed the specific responsibilities for the specified duration.) + */ + public Organization getManagingOrganizationTarget() { + if (this.managingOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EpisodeOfCare.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganizationTarget = new Organization(); // aa + return this.managingOrganizationTarget; + } + + /** + * @param value {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization that has assumed the specific responsibilities for the specified duration.) + */ + public EpisodeOfCare setManagingOrganizationTarget(Organization value) { + this.managingOrganizationTarget = value; + return this; + } + + /** + * @return {@link #period} (The interval during which the managing organization assumes the defined responsibility.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EpisodeOfCare.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The interval during which the managing organization assumes the defined responsibility.) + */ + public EpisodeOfCare setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #condition} (A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) + */ + public List getCondition() { + if (this.condition == null) + this.condition = new ArrayList(); + return this.condition; + } + + public boolean hasCondition() { + if (this.condition == null) + return false; + for (Reference item : this.condition) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #condition} (A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) + */ + // syntactic sugar + public Reference addCondition() { //3 + Reference t = new Reference(); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return t; + } + + // syntactic sugar + public EpisodeOfCare addCondition(Reference t) { //3 + if (t == null) + return this; + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return this; + } + + /** + * @return {@link #condition} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) + */ + public List getConditionTarget() { + if (this.conditionTarget == null) + this.conditionTarget = new ArrayList(); + return this.conditionTarget; + } + + // syntactic sugar + /** + * @return {@link #condition} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) + */ + public Condition addConditionTarget() { + Condition r = new Condition(); + if (this.conditionTarget == null) + this.conditionTarget = new ArrayList(); + this.conditionTarget.add(r); + return r; + } + + /** + * @return {@link #referralRequest} (Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) + */ + public List getReferralRequest() { + if (this.referralRequest == null) + this.referralRequest = new ArrayList(); + return this.referralRequest; + } + + public boolean hasReferralRequest() { + if (this.referralRequest == null) + return false; + for (Reference item : this.referralRequest) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #referralRequest} (Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) + */ + // syntactic sugar + public Reference addReferralRequest() { //3 + Reference t = new Reference(); + if (this.referralRequest == null) + this.referralRequest = new ArrayList(); + this.referralRequest.add(t); + return t; + } + + // syntactic sugar + public EpisodeOfCare addReferralRequest(Reference t) { //3 + if (t == null) + return this; + if (this.referralRequest == null) + this.referralRequest = new ArrayList(); + this.referralRequest.add(t); + return this; + } + + /** + * @return {@link #referralRequest} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) + */ + public List getReferralRequestTarget() { + if (this.referralRequestTarget == null) + this.referralRequestTarget = new ArrayList(); + return this.referralRequestTarget; + } + + // syntactic sugar + /** + * @return {@link #referralRequest} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) + */ + public ReferralRequest addReferralRequestTarget() { + ReferralRequest r = new ReferralRequest(); + if (this.referralRequestTarget == null) + this.referralRequestTarget = new ArrayList(); + this.referralRequestTarget.add(r); + return r; + } + + /** + * @return {@link #careManager} (The practitioner that is the care manager/care co-ordinator for this patient.) + */ + public Reference getCareManager() { + if (this.careManager == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EpisodeOfCare.careManager"); + else if (Configuration.doAutoCreate()) + this.careManager = new Reference(); // cc + return this.careManager; + } + + public boolean hasCareManager() { + return this.careManager != null && !this.careManager.isEmpty(); + } + + /** + * @param value {@link #careManager} (The practitioner that is the care manager/care co-ordinator for this patient.) + */ + public EpisodeOfCare setCareManager(Reference value) { + this.careManager = value; + return this; + } + + /** + * @return {@link #careManager} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner that is the care manager/care co-ordinator for this patient.) + */ + public Practitioner getCareManagerTarget() { + if (this.careManagerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EpisodeOfCare.careManager"); + else if (Configuration.doAutoCreate()) + this.careManagerTarget = new Practitioner(); // aa + return this.careManagerTarget; + } + + /** + * @param value {@link #careManager} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner that is the care manager/care co-ordinator for this patient.) + */ + public EpisodeOfCare setCareManagerTarget(Practitioner value) { + this.careManagerTarget = value; + return this; + } + + /** + * @return {@link #careTeam} (The list of practitioners that may be facilitating this episode of care for specific purposes.) + */ + public List getCareTeam() { + if (this.careTeam == null) + this.careTeam = new ArrayList(); + return this.careTeam; + } + + public boolean hasCareTeam() { + if (this.careTeam == null) + return false; + for (EpisodeOfCareCareTeamComponent item : this.careTeam) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #careTeam} (The list of practitioners that may be facilitating this episode of care for specific purposes.) + */ + // syntactic sugar + public EpisodeOfCareCareTeamComponent addCareTeam() { //3 + EpisodeOfCareCareTeamComponent t = new EpisodeOfCareCareTeamComponent(); + if (this.careTeam == null) + this.careTeam = new ArrayList(); + this.careTeam.add(t); + return t; + } + + // syntactic sugar + public EpisodeOfCare addCareTeam(EpisodeOfCareCareTeamComponent t) { //3 + if (t == null) + return this; + if (this.careTeam == null) + this.careTeam = new ArrayList(); + this.careTeam.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier(s) by which this EpisodeOfCare is known.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "planned | waitlist | active | onhold | finished | cancelled.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("statusHistory", "", "The status history for the EpisodeOfCare.", 0, java.lang.Integer.MAX_VALUE, statusHistory)); + childrenList.add(new Property("type", "CodeableConcept", "The type can be very important in processing as this could be used in determining if the EpisodeOfCare is relevant to specific government reporting, or other types of classifications.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient that this EpisodeOfCare applies to.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The organization that has assumed the specific responsibilities for the specified duration.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); + childrenList.add(new Property("period", "Period", "The interval during which the managing organization assumes the defined responsibility.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("condition", "Reference(Condition)", "A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("referralRequest", "Reference(ReferralRequest)", "Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.", 0, java.lang.Integer.MAX_VALUE, referralRequest)); + childrenList.add(new Property("careManager", "Reference(Practitioner)", "The practitioner that is the care manager/care co-ordinator for this patient.", 0, java.lang.Integer.MAX_VALUE, careManager)); + childrenList.add(new Property("careTeam", "", "The list of practitioners that may be facilitating this episode of care for specific purposes.", 0, java.lang.Integer.MAX_VALUE, careTeam)); + } + + public EpisodeOfCare copy() { + EpisodeOfCare dst = new EpisodeOfCare(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + if (statusHistory != null) { + dst.statusHistory = new ArrayList(); + for (EpisodeOfCareStatusHistoryComponent i : statusHistory) + dst.statusHistory.add(i.copy()); + }; + if (type != null) { + dst.type = new ArrayList(); + for (CodeableConcept i : type) + dst.type.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); + dst.period = period == null ? null : period.copy(); + if (condition != null) { + dst.condition = new ArrayList(); + for (Reference i : condition) + dst.condition.add(i.copy()); + }; + if (referralRequest != null) { + dst.referralRequest = new ArrayList(); + for (Reference i : referralRequest) + dst.referralRequest.add(i.copy()); + }; + dst.careManager = careManager == null ? null : careManager.copy(); + if (careTeam != null) { + dst.careTeam = new ArrayList(); + for (EpisodeOfCareCareTeamComponent i : careTeam) + dst.careTeam.add(i.copy()); + }; + return dst; + } + + protected EpisodeOfCare typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof EpisodeOfCare)) + return false; + EpisodeOfCare o = (EpisodeOfCare) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(statusHistory, o.statusHistory, true) + && compareDeep(type, o.type, true) && compareDeep(patient, o.patient, true) && compareDeep(managingOrganization, o.managingOrganization, true) + && compareDeep(period, o.period, true) && compareDeep(condition, o.condition, true) && compareDeep(referralRequest, o.referralRequest, true) + && compareDeep(careManager, o.careManager, true) && compareDeep(careTeam, o.careTeam, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof EpisodeOfCare)) + return false; + EpisodeOfCare o = (EpisodeOfCare) other; + return compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (statusHistory == null || statusHistory.isEmpty()) && (type == null || type.isEmpty()) + && (patient == null || patient.isEmpty()) && (managingOrganization == null || managingOrganization.isEmpty()) + && (period == null || period.isEmpty()) && (condition == null || condition.isEmpty()) && (referralRequest == null || referralRequest.isEmpty()) + && (careManager == null || careManager.isEmpty()) && (careTeam == null || careTeam.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.EpisodeOfCare; + } + + @SearchParamDefinition(name="date", path="EpisodeOfCare.period", description="The provided date search value falls within the episode of care's period", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="EpisodeOfCare.identifier", description="Identifier(s) by which this EpisodeOfCare is known", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="condition", path="EpisodeOfCare.condition", description="A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for", type="reference" ) + public static final String SP_CONDITION = "condition"; + @SearchParamDefinition(name="incomingreferral", path="EpisodeOfCare.referralRequest", description="Incoming Referral Request", type="reference" ) + public static final String SP_INCOMINGREFERRAL = "incomingreferral"; + @SearchParamDefinition(name="patient", path="EpisodeOfCare.patient", description="The patient that this EpisodeOfCare applies to", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="organization", path="EpisodeOfCare.managingOrganization", description="The organization that has assumed the specific responsibilities of this EpisodeOfCare", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + @SearchParamDefinition(name="team-member", path="EpisodeOfCare.careTeam.member", description="A Practitioner or Organization allocated to the care team for this EpisodeOfCare", type="reference" ) + public static final String SP_TEAMMEMBER = "team-member"; + @SearchParamDefinition(name="type", path="EpisodeOfCare.type", description="Specific type of EpisodeOfCare", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="care-manager", path="EpisodeOfCare.careManager", description="The practitioner that is the care manager/care co-ordinator for this patient", type="reference" ) + public static final String SP_CAREMANAGER = "care-manager"; + @SearchParamDefinition(name="status", path="EpisodeOfCare.status", description="The current status of the Episode of Care as provided (does not check the status history collection)", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ExplanationOfBenefit.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ExplanationOfBenefit.java index 258492571dc..0fbec4f9684 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ExplanationOfBenefit.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ExplanationOfBenefit.java @@ -1,732 +1,711 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. - */ -@ResourceDef(name="ExplanationOfBenefit", profile="http://hl7.org/fhir/Profile/ExplanationOfBenefit") -public class ExplanationOfBenefit extends DomainResource { - - public enum RSLink { - /** - * The processing completed without errors. - */ - COMPLETE, - /** - * The processing identified with errors. - */ - ERROR, - /** - * added to help the parsers - */ - NULL; - public static RSLink fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return COMPLETE; - if ("error".equals(codeString)) - return ERROR; - throw new Exception("Unknown RSLink code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case COMPLETE: return "complete"; - case ERROR: return "error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case COMPLETE: return ""; - case ERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case COMPLETE: return "The processing completed without errors."; - case ERROR: return "The processing identified with errors."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case COMPLETE: return "Complete"; - case ERROR: return "Error"; - default: return "?"; - } - } - } - - public static class RSLinkEnumFactory implements EnumFactory { - public RSLink fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return RSLink.COMPLETE; - if ("error".equals(codeString)) - return RSLink.ERROR; - throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); - } - public String toCode(RSLink code) { - if (code == RSLink.COMPLETE) - return "complete"; - if (code == RSLink.ERROR) - return "error"; - return "?"; - } - } - - /** - * The Response Business Identifier. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * Original request resource reference. - */ - @Child(name = "request", type = {Claim.class}, order=1, min=0, max=1) - @Description(shortDefinition="Claim reference", formalDefinition="Original request resource reference." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (Original request resource reference.) - */ - protected Claim requestTarget; - - /** - * Transaction status: error, complete. - */ - @Child(name = "outcome", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) - protected Enumeration outcome; - - /** - * A description of the status of the adjudication. - */ - @Child(name = "disposition", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) - protected StringType disposition; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=5, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateTimeType created; - - /** - * The Insurer who produced this adjudicated response. - */ - @Child(name = "organization", type = {Organization.class}, order=7, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) - */ - protected Organization organizationTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name = "requestProvider", type = {Practitioner.class}, order=8, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference requestProvider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner requestProviderTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name = "requestOrganization", type = {Organization.class}, order=9, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference requestOrganization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization requestOrganizationTarget; - - private static final long serialVersionUID = 2098041034L; - - /* - * Constructor - */ - public ExplanationOfBenefit() { - super(); - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public ExplanationOfBenefit addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #request} (Original request resource reference.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); // cc - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request resource reference.) - */ - public ExplanationOfBenefit setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original request resource reference.) - */ - public Claim getRequestTarget() { - if (this.requestTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.request"); - else if (Configuration.doAutoCreate()) - this.requestTarget = new Claim(); // aa - return this.requestTarget; - } - - /** - * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original request resource reference.) - */ - public ExplanationOfBenefit setRequestTarget(Claim value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public Enumeration getOutcomeElement() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Enumeration(new RSLinkEnumFactory()); // bb - return this.outcome; - } - - public boolean hasOutcomeElement() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public ExplanationOfBenefit setOutcomeElement(Enumeration value) { - this.outcome = value; - return this; - } - - /** - * @return Transaction status: error, complete. - */ - public RSLink getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value Transaction status: error, complete. - */ - public ExplanationOfBenefit setOutcome(RSLink value) { - if (value == null) - this.outcome = null; - else { - if (this.outcome == null) - this.outcome = new Enumeration(new RSLinkEnumFactory()); - this.outcome.setValue(value); - } - return this; - } - - /** - * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public StringType getDispositionElement() { - if (this.disposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.disposition"); - else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); // bb - return this.disposition; - } - - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - /** - * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public ExplanationOfBenefit setDispositionElement(StringType value) { - this.disposition = value; - return this; - } - - /** - * @return A description of the status of the adjudication. - */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); - } - - /** - * @param value A description of the status of the adjudication. - */ - public ExplanationOfBenefit setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); - } - return this; - } - - /** - * @return {@link #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 ExplanationOfBenefit.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public ExplanationOfBenefit 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 ExplanationOfBenefit.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public ExplanationOfBenefit setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public ExplanationOfBenefit setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when the enclosed suite of services were performed or completed. - */ - public ExplanationOfBenefit setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); // cc - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public ExplanationOfBenefit setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); // aa - return this.organizationTarget; - } - - /** - * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) - */ - public ExplanationOfBenefit setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getRequestProvider() { - if (this.requestProvider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProvider = new Reference(); // cc - return this.requestProvider; - } - - public boolean hasRequestProvider() { - return this.requestProvider != null && !this.requestProvider.isEmpty(); - } - - /** - * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public ExplanationOfBenefit setRequestProvider(Reference value) { - this.requestProvider = value; - return this; - } - - /** - * @return {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getRequestProviderTarget() { - if (this.requestProviderTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProviderTarget = new Practitioner(); // aa - return this.requestProviderTarget; - } - - /** - * @param value {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) - */ - public ExplanationOfBenefit setRequestProviderTarget(Practitioner value) { - this.requestProviderTarget = value; - return this; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getRequestOrganization() { - if (this.requestOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganization = new Reference(); // cc - return this.requestOrganization; - } - - public boolean hasRequestOrganization() { - return this.requestOrganization != null && !this.requestOrganization.isEmpty(); - } - - /** - * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public ExplanationOfBenefit setRequestOrganization(Reference value) { - this.requestOrganization = value; - return this; - } - - /** - * @return {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) - */ - public Organization getRequestOrganizationTarget() { - if (this.requestOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganizationTarget = new Organization(); // aa - return this.requestOrganizationTarget; - } - - /** - * @param value {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) - */ - public ExplanationOfBenefit setRequestOrganizationTarget(Organization value) { - this.requestOrganizationTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("request", "Reference(Claim)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition)); - childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); - childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); - } - - public ExplanationOfBenefit copy() { - ExplanationOfBenefit dst = new ExplanationOfBenefit(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.request = request == null ? null : request.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.disposition = disposition == null ? null : disposition.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); - dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); - return dst; - } - - protected ExplanationOfBenefit typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ExplanationOfBenefit)) - return false; - ExplanationOfBenefit o = (ExplanationOfBenefit) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true) - && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) - && compareDeep(created, o.created, true) && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) - && compareDeep(requestOrganization, o.requestOrganization, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ExplanationOfBenefit)) - return false; - ExplanationOfBenefit o = (ExplanationOfBenefit) other; - return compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) - && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) - && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) - && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ExplanationOfBenefit; - } - - @SearchParamDefinition(name="identifier", path="ExplanationOfBenefit.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. + */ +@ResourceDef(name="ExplanationOfBenefit", profile="http://hl7.org/fhir/Profile/ExplanationOfBenefit") +public class ExplanationOfBenefit extends DomainResource { + + public enum RSLink { + /** + * The processing completed without errors. + */ + COMPLETE, + /** + * The processing identified with errors. + */ + ERROR, + /** + * added to help the parsers + */ + NULL; + public static RSLink fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return COMPLETE; + if ("error".equals(codeString)) + return ERROR; + throw new Exception("Unknown RSLink code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case ERROR: return "error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return ""; + case ERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The processing completed without errors."; + case ERROR: return "The processing identified with errors."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "Complete"; + case ERROR: return "Error"; + default: return "?"; + } + } + } + + public static class RSLinkEnumFactory implements EnumFactory { + public RSLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return RSLink.COMPLETE; + if ("error".equals(codeString)) + return RSLink.ERROR; + throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); + } + public String toCode(RSLink code) { + if (code == RSLink.COMPLETE) + return "complete"; + if (code == RSLink.ERROR) + return "error"; + return "?"; + } + } + + /** + * The Response Business Identifier. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * Original request resource reference. + */ + @Child(name = "request", type = {Claim.class}, order=1, min=0, max=1) + @Description(shortDefinition="Claim reference", formalDefinition="Original request resource reference." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (Original request resource reference.) + */ + protected Claim requestTarget; + + /** + * Transaction status: error, complete. + */ + @Child(name = "outcome", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) + protected Enumeration outcome; + + /** + * A description of the status of the adjudication. + */ + @Child(name = "disposition", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) + protected StringType disposition; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=5, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateTimeType created; + + /** + * The Insurer who produced this adjudicated response. + */ + @Child(name = "organization", type = {Organization.class}, order=7, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) + */ + protected Organization organizationTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name = "requestProvider", type = {Practitioner.class}, order=8, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference requestProvider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner requestProviderTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name = "requestOrganization", type = {Organization.class}, order=9, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference requestOrganization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization requestOrganizationTarget; + + private static final long serialVersionUID = 2098041034L; + + /* + * Constructor + */ + public ExplanationOfBenefit() { + super(); + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public ExplanationOfBenefit addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #request} (Original request resource reference.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); // cc + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request resource reference.) + */ + public ExplanationOfBenefit setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original request resource reference.) + */ + public Claim getRequestTarget() { + if (this.requestTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.request"); + else if (Configuration.doAutoCreate()) + this.requestTarget = new Claim(); // aa + return this.requestTarget; + } + + /** + * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original request resource reference.) + */ + public ExplanationOfBenefit setRequestTarget(Claim value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public Enumeration getOutcomeElement() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new Enumeration(new RSLinkEnumFactory()); // bb + return this.outcome; + } + + public boolean hasOutcomeElement() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public ExplanationOfBenefit setOutcomeElement(Enumeration value) { + this.outcome = value; + return this; + } + + /** + * @return Transaction status: error, complete. + */ + public RSLink getOutcome() { + return this.outcome == null ? null : this.outcome.getValue(); + } + + /** + * @param value Transaction status: error, complete. + */ + public ExplanationOfBenefit setOutcome(RSLink value) { + if (value == null) + this.outcome = null; + else { + if (this.outcome == null) + this.outcome = new Enumeration(new RSLinkEnumFactory()); + this.outcome.setValue(value); + } + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); // bb + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public ExplanationOfBenefit setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication. + */ + public ExplanationOfBenefit setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + + /** + * @return {@link #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 ExplanationOfBenefit.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public ExplanationOfBenefit 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 ExplanationOfBenefit.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public ExplanationOfBenefit setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public ExplanationOfBenefit setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when the enclosed suite of services were performed or completed. + */ + public ExplanationOfBenefit setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); // cc + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public ExplanationOfBenefit setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); // aa + return this.organizationTarget; + } + + /** + * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) + */ + public ExplanationOfBenefit setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getRequestProvider() { + if (this.requestProvider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProvider = new Reference(); // cc + return this.requestProvider; + } + + public boolean hasRequestProvider() { + return this.requestProvider != null && !this.requestProvider.isEmpty(); + } + + /** + * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public ExplanationOfBenefit setRequestProvider(Reference value) { + this.requestProvider = value; + return this; + } + + /** + * @return {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getRequestProviderTarget() { + if (this.requestProviderTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProviderTarget = new Practitioner(); // aa + return this.requestProviderTarget; + } + + /** + * @param value {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public ExplanationOfBenefit setRequestProviderTarget(Practitioner value) { + this.requestProviderTarget = value; + return this; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getRequestOrganization() { + if (this.requestOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganization = new Reference(); // cc + return this.requestOrganization; + } + + public boolean hasRequestOrganization() { + return this.requestOrganization != null && !this.requestOrganization.isEmpty(); + } + + /** + * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public ExplanationOfBenefit setRequestOrganization(Reference value) { + this.requestOrganization = value; + return this; + } + + /** + * @return {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) + */ + public Organization getRequestOrganizationTarget() { + if (this.requestOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganizationTarget = new Organization(); // aa + return this.requestOrganizationTarget; + } + + /** + * @param value {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) + */ + public ExplanationOfBenefit setRequestOrganizationTarget(Organization value) { + this.requestOrganizationTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("request", "Reference(Claim)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome)); + childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition)); + childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); + childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); + childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); + childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); + } + + public ExplanationOfBenefit copy() { + ExplanationOfBenefit dst = new ExplanationOfBenefit(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.request = request == null ? null : request.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.disposition = disposition == null ? null : disposition.copy(); + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + dst.created = created == null ? null : created.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); + dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); + return dst; + } + + protected ExplanationOfBenefit typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ExplanationOfBenefit)) + return false; + ExplanationOfBenefit o = (ExplanationOfBenefit) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true) + && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) + && compareDeep(created, o.created, true) && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) + && compareDeep(requestOrganization, o.requestOrganization, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ExplanationOfBenefit)) + return false; + ExplanationOfBenefit o = (ExplanationOfBenefit) other; + return compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) + && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) + && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) + && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) + && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ExplanationOfBenefit; + } + + @SearchParamDefinition(name="identifier", path="ExplanationOfBenefit.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Extension.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Extension.java index 6454861832f..3efb2a87a80 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Extension.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Extension.java @@ -1,209 +1,188 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Optional Extensions Element - found in all resources. - */ -@DatatypeDef(name="Extension") -public class Extension extends BaseExtension implements IBaseExtension, IBaseHasExtensions { - - /** - * Source of the definition for the extension code - a logical name or a URL. - */ - @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1) - @Description(shortDefinition="identifies the meaning of the extension", formalDefinition="Source of the definition for the extension code - a logical name or a URL." ) - protected UriType url; - - /** - * Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list). - */ - @Child(name = "value", type = {}, order=1, min=0, max=1) - @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; - - /* - * Constructor - */ - public Extension() { - super(); - } - - /* - * Constructor - */ - 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(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (Source of the definition for the extension code - a logical name or a URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public Extension setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return Source of the definition for the extension code - a logical name or a URL. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value Source of the definition for the extension code - a logical name or a URL. - */ - public Extension setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - /** - * @return {@link #value} (Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).) - */ - public org.hl7.fhir.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 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(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Extension)) - return false; - Extension o = (Extension) other; - return compareDeep(url, o.url, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Extension)) - return false; - Extension o = (Extension) other; - return compareValues(url, o.url, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Optional Extensions Element - found in all resources. + */ +@DatatypeDef(name="Extension") +public class Extension extends BaseExtension implements IBaseExtension, IBaseHasExtensions { + + /** + * Source of the definition for the extension code - a logical name or a URL. + */ + @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1) + @Description(shortDefinition="identifies the meaning of the extension", formalDefinition="Source of the definition for the extension code - a logical name or a URL." ) + protected UriType url; + + /** + * Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list). + */ + @Child(name = "value", type = {}, order=1, min=0, max=1) + @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; + + /* + * Constructor + */ + public Extension() { + super(); + } + + /* + * Constructor + */ + 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(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (Source of the definition for the extension code - a logical name or a URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public Extension setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return Source of the definition for the extension code - a logical name or a URL. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value Source of the definition for the extension code - a logical name or a URL. + */ + public Extension setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + /** + * @return {@link #value} (Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).) + */ + public org.hl7.fhir.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 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(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Extension)) + return false; + Extension o = (Extension) other; + return compareDeep(url, o.url, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Extension)) + return false; + Extension o = (Extension) other; + return compareValues(url, o.url, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ExtensionHelper.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ExtensionHelper.java index d9e9b877204..103d1440020 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ExtensionHelper.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ExtensionHelper.java @@ -1,167 +1,146 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/** - * 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(); - } - - -} +package org.hl7.fhir.instance.model; + +/** + * 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(); + } + + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Factory.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Factory.java index 150f7fe2e82..249a1126d22 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Factory.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Factory.java @@ -1,196 +1,175 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import java.net.URISyntaxException; -import java.text.ParseException; -import java.util.UUID; - -import org.hl7.fhir.instance.model.ContactPoint.ContactPointSystem; -import org.hl7.fhir.instance.model.Narrative.NarrativeStatus; -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.utilities.xhtml.XhtmlParser; - -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ - - - -public class Factory { - - public static IdType newId(String value) { - if (value == null) - return null; - IdType res = new IdType(); - res.setValue(value); - return res; - } - - public static StringType newString_(String value) { - if (value == null) - return null; - StringType res = new StringType(); - res.setValue(value); - return res; - } - - public static UriType newUri(String value) throws URISyntaxException { - if (value == null) - return null; - UriType res = new UriType(); - res.setValue(value); - return res; - } - - public static DateTimeType newDateTime(String value) throws ParseException { - if (value == null) - return null; - return new DateTimeType(value); - } - - public static DateType newDate(String value) throws ParseException { - if (value == null) - return null; - return new DateType(value); - } - - public static CodeType newCode(String value) { - if (value == null) - return null; - CodeType res = new CodeType(); - res.setValue(value); - return res; - } - - public static IntegerType newInteger(int value) { - IntegerType res = new IntegerType(); - res.setValue(value); - return res; - } - - public static IntegerType newInteger(java.lang.Integer value) { - if (value == null) - return null; - IntegerType res = new IntegerType(); - res.setValue(value); - return res; - } - - public static BooleanType newBoolean(boolean value) { - BooleanType res = new BooleanType(); - res.setValue(value); - return res; - } - - public static ContactPoint newContactPoint(ContactPointSystem system, String value) { - ContactPoint res = new ContactPoint(); - res.setSystem(system); - res.setValue(value); - return res; - } - - public static Extension newExtension(String uri, Type value, boolean evenIfNull) throws Exception { - if (!evenIfNull && value == null) - return null; - Extension e = new Extension(); - e.setUrl(uri); - e.setValue(value); - return e; - } - - public static CodeableConcept newCodeableConcept(String code, String system, String display) throws Exception { - CodeableConcept cc = new CodeableConcept(); - Coding c = new Coding(); - c.setCode(code); - c.setSystem(system); - c.setDisplay(display); - cc.getCoding().add(c); - return cc; - } - - public static Reference makeReference(String url) throws Exception { - Reference rr = new Reference(); - rr.setReference(url); - return rr; - } - - public static Narrative newNarrative(NarrativeStatus status, String html) throws Exception { - Narrative n = new Narrative(); - n.setStatus(status); - n.setDiv(new XhtmlParser().parseFragment("
"+Utilities.escapeXml(html)+"
")); - return n; - } - - public static Coding makeCoding(String code) throws Exception { - String[] parts = code.split("\\|"); - Coding c = new Coding(); - if (parts.length == 2) { - c.setSystem(parts[0]); - c.setCode(parts[1]); - } else if (parts.length == 3) { - c.setSystem(parts[0]); - c.setCode(parts[1]); - c.setDisplay(parts[2]); - } else - throw new Exception("Unable to understand the code '"+code+"'. Use the format system|code(|display)"); - return c; - } - - public static Reference makeReference(String url, String text) { - Reference rr = new Reference(); - rr.setReference(url); - if (!Utilities.noString(text)) - rr.setDisplay(text); - return rr; - } - - public static String createUUID() { - return "urn:uuid:"+UUID.randomUUID().toString().toLowerCase(); - } - -} +package org.hl7.fhir.instance.model; + +import java.net.URISyntaxException; +import java.text.ParseException; +import java.util.UUID; + +import org.hl7.fhir.instance.model.ContactPoint.ContactPointSystem; +import org.hl7.fhir.instance.model.Narrative.NarrativeStatus; +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.xhtml.XhtmlParser; + +/* +Copyright (c) 2011+, HL7, Inc +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +*/ + + + +public class Factory { + + public static IdType newId(String value) { + if (value == null) + return null; + IdType res = new IdType(); + res.setValue(value); + return res; + } + + public static StringType newString_(String value) { + if (value == null) + return null; + StringType res = new StringType(); + res.setValue(value); + return res; + } + + public static UriType newUri(String value) throws URISyntaxException { + if (value == null) + return null; + UriType res = new UriType(); + res.setValue(value); + return res; + } + + public static DateTimeType newDateTime(String value) throws ParseException { + if (value == null) + return null; + return new DateTimeType(value); + } + + public static DateType newDate(String value) throws ParseException { + if (value == null) + return null; + return new DateType(value); + } + + public static CodeType newCode(String value) { + if (value == null) + return null; + CodeType res = new CodeType(); + res.setValue(value); + return res; + } + + public static IntegerType newInteger(int value) { + IntegerType res = new IntegerType(); + res.setValue(value); + return res; + } + + public static IntegerType newInteger(java.lang.Integer value) { + if (value == null) + return null; + IntegerType res = new IntegerType(); + res.setValue(value); + return res; + } + + public static BooleanType newBoolean(boolean value) { + BooleanType res = new BooleanType(); + res.setValue(value); + return res; + } + + public static ContactPoint newContactPoint(ContactPointSystem system, String value) { + ContactPoint res = new ContactPoint(); + res.setSystem(system); + res.setValue(value); + return res; + } + + public static Extension newExtension(String uri, Type value, boolean evenIfNull) throws Exception { + if (!evenIfNull && value == null) + return null; + Extension e = new Extension(); + e.setUrl(uri); + e.setValue(value); + return e; + } + + public static CodeableConcept newCodeableConcept(String code, String system, String display) throws Exception { + CodeableConcept cc = new CodeableConcept(); + Coding c = new Coding(); + c.setCode(code); + c.setSystem(system); + c.setDisplay(display); + cc.getCoding().add(c); + return cc; + } + + public static Reference makeReference(String url) throws Exception { + Reference rr = new Reference(); + rr.setReference(url); + return rr; + } + + public static Narrative newNarrative(NarrativeStatus status, String html) throws Exception { + Narrative n = new Narrative(); + n.setStatus(status); + n.setDiv(new XhtmlParser().parseFragment("
"+Utilities.escapeXml(html)+"
")); + return n; + } + + public static Coding makeCoding(String code) throws Exception { + String[] parts = code.split("\\|"); + Coding c = new Coding(); + if (parts.length == 2) { + c.setSystem(parts[0]); + c.setCode(parts[1]); + } else if (parts.length == 3) { + c.setSystem(parts[0]); + c.setCode(parts[1]); + c.setDisplay(parts[2]); + } else + throw new Exception("Unable to understand the code '"+code+"'. Use the format system|code(|display)"); + return c; + } + + public static Reference makeReference(String url, String text) { + Reference rr = new Reference(); + rr.setReference(url); + if (!Utilities.noString(text)) + rr.setDisplay(text); + return rr; + } + + public static String createUUID() { + return "urn:uuid:"+UUID.randomUUID().toString().toLowerCase(); + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/FamilyMemberHistory.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/FamilyMemberHistory.java index ce3e43c12a9..348f78efe25 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/FamilyMemberHistory.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/FamilyMemberHistory.java @@ -1,1093 +1,1072 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Significant health events and conditions for a person related to the patient relevant in the context of care for the patient. - */ -@ResourceDef(name="FamilyMemberHistory", profile="http://hl7.org/fhir/Profile/FamilyMemberHistory") -public class FamilyMemberHistory extends DomainResource { - - public enum AdministrativeGender { - /** - * Male - */ - MALE, - /** - * Female - */ - FEMALE, - /** - * Other - */ - OTHER, - /** - * Unknown - */ - UNKNOWN, - /** - * added to help the parsers - */ - NULL; - public static AdministrativeGender fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return MALE; - if ("female".equals(codeString)) - return FEMALE; - if ("other".equals(codeString)) - return OTHER; - if ("unknown".equals(codeString)) - return UNKNOWN; - throw new Exception("Unknown AdministrativeGender code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case MALE: return "male"; - case FEMALE: return "female"; - case OTHER: return "other"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MALE: return ""; - case FEMALE: return ""; - case OTHER: return ""; - case UNKNOWN: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MALE: return "Male"; - case FEMALE: return "Female"; - case OTHER: return "Other"; - case UNKNOWN: return "Unknown"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MALE: return "Male"; - case FEMALE: return "Female"; - case OTHER: return "Other"; - case UNKNOWN: return "Unknown"; - default: return "?"; - } - } - } - - public static class AdministrativeGenderEnumFactory implements EnumFactory { - public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return AdministrativeGender.MALE; - if ("female".equals(codeString)) - return AdministrativeGender.FEMALE; - if ("other".equals(codeString)) - return AdministrativeGender.OTHER; - if ("unknown".equals(codeString)) - return AdministrativeGender.UNKNOWN; - throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); - } - public String toCode(AdministrativeGender code) { - if (code == AdministrativeGender.MALE) - return "male"; - if (code == AdministrativeGender.FEMALE) - return "female"; - if (code == AdministrativeGender.OTHER) - return "other"; - if (code == AdministrativeGender.UNKNOWN) - return "unknown"; - return "?"; - } - } - - @Block() - public static class FamilyMemberHistoryConditionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Condition suffered by relation", formalDefinition="The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system." ) - protected CodeableConcept type; - - /** - * Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation. - */ - @Child(name = "outcome", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="deceased | permanent disability | etc.", formalDefinition="Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation." ) - protected CodeableConcept outcome; - - /** - * Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence. - */ - @Child(name = "onset", type = {Age.class, Range.class, StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="When condition first manifested", formalDefinition="Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence." ) - protected Type onset; - - /** - * An area where general notes can be placed about this specific condition. - */ - @Child(name = "note", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Extra information about condition", formalDefinition="An area where general notes can be placed about this specific condition." ) - protected StringType note; - - private static final long serialVersionUID = -1664709272L; - - /* - * Constructor - */ - public FamilyMemberHistoryConditionComponent() { - super(); - } - - /* - * Constructor - */ - public FamilyMemberHistoryConditionComponent(CodeableConcept type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyMemberHistoryConditionComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.) - */ - public FamilyMemberHistoryConditionComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #outcome} (Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation.) - */ - public CodeableConcept getOutcome() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyMemberHistoryConditionComponent.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new CodeableConcept(); // cc - return this.outcome; - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation.) - */ - public FamilyMemberHistoryConditionComponent setOutcome(CodeableConcept value) { - this.outcome = value; - return this; - } - - /** - * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) - */ - public Type getOnset() { - return this.onset; - } - - /** - * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) - */ - public Age getOnsetAge() throws Exception { - if (!(this.onset instanceof Age)) - throw new Exception("Type mismatch: the type Age was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (Age) this.onset; - } - - /** - * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) - */ - public Range getOnsetRange() throws Exception { - if (!(this.onset instanceof Range)) - throw new Exception("Type mismatch: the type Range was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (Range) this.onset; - } - - /** - * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) - */ - public StringType getOnsetStringType() throws Exception { - if (!(this.onset instanceof StringType)) - throw new Exception("Type mismatch: the type StringType was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (StringType) this.onset; - } - - public boolean hasOnset() { - return this.onset != null && !this.onset.isEmpty(); - } - - /** - * @param value {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) - */ - public FamilyMemberHistoryConditionComponent setOnset(Type value) { - this.onset = value; - return this; - } - - /** - * @return {@link #note} (An area where general notes can be placed about this specific condition.). 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 FamilyMemberHistoryConditionComponent.note"); - else if (Configuration.doAutoCreate()) - this.note = new StringType(); // bb - 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} (An area where general notes can be placed about this specific condition.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value - */ - public FamilyMemberHistoryConditionComponent setNoteElement(StringType value) { - this.note = value; - return this; - } - - /** - * @return An area where general notes can be placed about this specific condition. - */ - public String getNote() { - return this.note == null ? null : this.note.getValue(); - } - - /** - * @param value An area where general notes can be placed about this specific condition. - */ - public FamilyMemberHistoryConditionComponent setNote(String value) { - if (Utilities.noString(value)) - this.note = null; - else { - if (this.note == null) - this.note = new StringType(); - this.note.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("outcome", "CodeableConcept", "Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation.", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("onset[x]", "Age|Range|string", "Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.", 0, java.lang.Integer.MAX_VALUE, onset)); - childrenList.add(new Property("note", "string", "An area where general notes can be placed about this specific condition.", 0, java.lang.Integer.MAX_VALUE, note)); - } - - public FamilyMemberHistoryConditionComponent copy() { - FamilyMemberHistoryConditionComponent dst = new FamilyMemberHistoryConditionComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.onset = onset == null ? null : onset.copy(); - dst.note = note == null ? null : note.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof FamilyMemberHistoryConditionComponent)) - return false; - FamilyMemberHistoryConditionComponent o = (FamilyMemberHistoryConditionComponent) other; - return compareDeep(type, o.type, true) && compareDeep(outcome, o.outcome, true) && compareDeep(onset, o.onset, true) - && compareDeep(note, o.note, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof FamilyMemberHistoryConditionComponent)) - return false; - FamilyMemberHistoryConditionComponent o = (FamilyMemberHistoryConditionComponent) other; - return compareValues(note, o.note, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (outcome == null || outcome.isEmpty()) - && (onset == null || onset.isEmpty()) && (note == null || note.isEmpty()); - } - - } - - /** - * This records identifiers associated with this family member history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External Id(s) for this record", formalDefinition="This records identifiers associated with this family member history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) - protected List identifier; - - /** - * The person who this history concerns. - */ - @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1) - @Description(shortDefinition="Patient history is about", formalDefinition="The person who this history concerns." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The person who this history concerns.) - */ - protected Patient patientTarget; - - /** - * The date (and possibly time) when the family member history was taken. - */ - @Child(name = "date", type = {DateTimeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="When history was captured/updated", formalDefinition="The date (and possibly time) when the family member history was taken." ) - protected DateTimeType date; - - /** - * This will either be a name or a description. E.g. "Aunt Susan", "my cousin with the red hair". - */ - @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="The family member described", formalDefinition="This will either be a name or a description. E.g. 'Aunt Susan', 'my cousin with the red hair'." ) - protected StringType name; - - /** - * The type of relationship this person has to the patient (father, mother, brother etc.). - */ - @Child(name = "relationship", type = {CodeableConcept.class}, order=4, min=1, max=1) - @Description(shortDefinition="Relationship to the subject", formalDefinition="The type of relationship this person has to the patient (father, mother, brother etc.)." ) - protected CodeableConcept relationship; - - /** - * Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes. - */ - @Child(name = "gender", type = {CodeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes." ) - protected Enumeration gender; - - /** - * The actual or approximate date of birth of the relative. - */ - @Child(name = "born", type = {Period.class, DateType.class, StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="(approximate) date of birth", formalDefinition="The actual or approximate date of birth of the relative." ) - protected Type born; - - /** - * The actual or approximate age of the relative at the time the family member history is recorded. - */ - @Child(name = "age", type = {Age.class, Range.class, StringType.class}, order=7, min=0, max=1) - @Description(shortDefinition="(approximate) age", formalDefinition="The actual or approximate age of the relative at the time the family member history is recorded." ) - protected Type age; - - /** - * The actual or approximate age of the relative at the time the family member history is recorded. - */ - @Child(name = "deceased", type = {BooleanType.class, Age.class, Range.class, DateType.class, StringType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Dead? How old/when?", formalDefinition="The actual or approximate age of the relative at the time the family member history is recorded." ) - protected Type deceased; - - /** - * This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible. - */ - @Child(name = "note", type = {StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="General note about related person", formalDefinition="This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible." ) - protected StringType note; - - /** - * The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition. - */ - @Child(name = "condition", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Condition that the related person had", formalDefinition="The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition." ) - protected List condition; - - private static final long serialVersionUID = 1785160836L; - - /* - * Constructor - */ - public FamilyMemberHistory() { - super(); - } - - /* - * Constructor - */ - public FamilyMemberHistory(Reference patient, CodeableConcept relationship) { - super(); - this.patient = patient; - this.relationship = relationship; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this family member history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this family member history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public FamilyMemberHistory addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #patient} (The person who this history concerns.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyMemberHistory.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The person who this history concerns.) - */ - public FamilyMemberHistory setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person who this history concerns.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyMemberHistory.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person who this history concerns.) - */ - public FamilyMemberHistory setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #date} (The date (and possibly time) when the family member history was taken.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyMemberHistory.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date (and possibly time) when the family member history was taken.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public FamilyMemberHistory setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date (and possibly time) when the family member history was taken. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date (and possibly time) when the family member history was taken. - */ - public FamilyMemberHistory setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (This will either be a name or a description. E.g. "Aunt Susan", "my cousin with the red hair".). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyMemberHistory.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (This will either be a name or a description. E.g. "Aunt Susan", "my cousin with the red hair".). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public FamilyMemberHistory setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return This will either be a name or a description. E.g. "Aunt Susan", "my cousin with the red hair". - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value This will either be a name or a description. E.g. "Aunt Susan", "my cousin with the red hair". - */ - public FamilyMemberHistory setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #relationship} (The type of relationship this person has to the patient (father, mother, brother etc.).) - */ - public CodeableConcept getRelationship() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyMemberHistory.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new CodeableConcept(); // cc - return this.relationship; - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (The type of relationship this person has to the patient (father, mother, brother etc.).) - */ - public FamilyMemberHistory setRelationship(CodeableConcept value) { - this.relationship = value; - return this; - } - - /** - * @return {@link #gender} (Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Enumeration getGenderElement() { - if (this.gender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyMemberHistory.gender"); - else if (Configuration.doAutoCreate()) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb - return this.gender; - } - - public boolean hasGenderElement() { - return this.gender != null && !this.gender.isEmpty(); - } - - public boolean hasGender() { - return this.gender != null && !this.gender.isEmpty(); - } - - /** - * @param value {@link #gender} (Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public FamilyMemberHistory setGenderElement(Enumeration value) { - this.gender = value; - return this; - } - - /** - * @return Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes. - */ - public AdministrativeGender getGender() { - return this.gender == null ? null : this.gender.getValue(); - } - - /** - * @param value Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes. - */ - public FamilyMemberHistory setGender(AdministrativeGender value) { - if (value == null) - this.gender = null; - else { - if (this.gender == null) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); - this.gender.setValue(value); - } - return this; - } - - /** - * @return {@link #born} (The actual or approximate date of birth of the relative.) - */ - public Type getBorn() { - return this.born; - } - - /** - * @return {@link #born} (The actual or approximate date of birth of the relative.) - */ - public Period getBornPeriod() throws Exception { - if (!(this.born instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.born.getClass().getName()+" was encountered"); - return (Period) this.born; - } - - /** - * @return {@link #born} (The actual or approximate date of birth of the relative.) - */ - public DateType getBornDateType() throws Exception { - if (!(this.born instanceof DateType)) - throw new Exception("Type mismatch: the type DateType was expected, but "+this.born.getClass().getName()+" was encountered"); - return (DateType) this.born; - } - - /** - * @return {@link #born} (The actual or approximate date of birth of the relative.) - */ - public StringType getBornStringType() throws Exception { - if (!(this.born instanceof StringType)) - throw new Exception("Type mismatch: the type StringType was expected, but "+this.born.getClass().getName()+" was encountered"); - return (StringType) this.born; - } - - public boolean hasBorn() { - return this.born != null && !this.born.isEmpty(); - } - - /** - * @param value {@link #born} (The actual or approximate date of birth of the relative.) - */ - public FamilyMemberHistory setBorn(Type value) { - this.born = value; - return this; - } - - /** - * @return {@link #age} (The actual or approximate age of the relative at the time the family member history is recorded.) - */ - public Type getAge() { - return this.age; - } - - /** - * @return {@link #age} (The actual or approximate age of the relative at the time the family member history is recorded.) - */ - public Age getAgeAge() throws Exception { - if (!(this.age instanceof Age)) - throw new Exception("Type mismatch: the type Age was expected, but "+this.age.getClass().getName()+" was encountered"); - return (Age) this.age; - } - - /** - * @return {@link #age} (The actual or approximate age of the relative at the time the family member history is recorded.) - */ - public Range getAgeRange() throws Exception { - if (!(this.age instanceof Range)) - throw new Exception("Type mismatch: the type Range was expected, but "+this.age.getClass().getName()+" was encountered"); - return (Range) this.age; - } - - /** - * @return {@link #age} (The actual or approximate age of the relative at the time the family member history is recorded.) - */ - public StringType getAgeStringType() throws Exception { - if (!(this.age instanceof StringType)) - throw new Exception("Type mismatch: the type StringType was expected, but "+this.age.getClass().getName()+" was encountered"); - return (StringType) this.age; - } - - public boolean hasAge() { - return this.age != null && !this.age.isEmpty(); - } - - /** - * @param value {@link #age} (The actual or approximate age of the relative at the time the family member history is recorded.) - */ - public FamilyMemberHistory setAge(Type value) { - this.age = value; - return this; - } - - /** - * @return {@link #deceased} (The actual or approximate age of the relative at the time the family member history is recorded.) - */ - public Type getDeceased() { - return this.deceased; - } - - /** - * @return {@link #deceased} (The actual or approximate age of the relative at the time the family member history is recorded.) - */ - public BooleanType getDeceasedBooleanType() throws Exception { - if (!(this.deceased instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.deceased.getClass().getName()+" was encountered"); - return (BooleanType) this.deceased; - } - - /** - * @return {@link #deceased} (The actual or approximate age of the relative at the time the family member history is recorded.) - */ - public Age getDeceasedAge() throws Exception { - if (!(this.deceased instanceof Age)) - throw new Exception("Type mismatch: the type Age was expected, but "+this.deceased.getClass().getName()+" was encountered"); - return (Age) this.deceased; - } - - /** - * @return {@link #deceased} (The actual or approximate age of the relative at the time the family member history is recorded.) - */ - public Range getDeceasedRange() throws Exception { - if (!(this.deceased instanceof Range)) - throw new Exception("Type mismatch: the type Range was expected, but "+this.deceased.getClass().getName()+" was encountered"); - return (Range) this.deceased; - } - - /** - * @return {@link #deceased} (The actual or approximate age of the relative at the time the family member history is recorded.) - */ - public DateType getDeceasedDateType() throws Exception { - if (!(this.deceased instanceof DateType)) - throw new Exception("Type mismatch: the type DateType was expected, but "+this.deceased.getClass().getName()+" was encountered"); - return (DateType) this.deceased; - } - - /** - * @return {@link #deceased} (The actual or approximate age of the relative at the time the family member history is recorded.) - */ - public StringType getDeceasedStringType() throws Exception { - if (!(this.deceased instanceof StringType)) - throw new Exception("Type mismatch: the type StringType was expected, but "+this.deceased.getClass().getName()+" was encountered"); - return (StringType) this.deceased; - } - - public boolean hasDeceased() { - return this.deceased != null && !this.deceased.isEmpty(); - } - - /** - * @param value {@link #deceased} (The actual or approximate age of the relative at the time the family member history is recorded.) - */ - public FamilyMemberHistory setDeceased(Type value) { - this.deceased = value; - return this; - } - - /** - * @return {@link #note} (This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.). 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 FamilyMemberHistory.note"); - else if (Configuration.doAutoCreate()) - this.note = new StringType(); // bb - 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} (This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value - */ - public FamilyMemberHistory setNoteElement(StringType value) { - this.note = value; - return this; - } - - /** - * @return This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible. - */ - public String getNote() { - return this.note == null ? null : this.note.getValue(); - } - - /** - * @param value This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible. - */ - public FamilyMemberHistory setNote(String value) { - if (Utilities.noString(value)) - this.note = null; - else { - if (this.note == null) - this.note = new StringType(); - this.note.setValue(value); - } - return this; - } - - /** - * @return {@link #condition} (The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.) - */ - public List getCondition() { - if (this.condition == null) - this.condition = new ArrayList(); - return this.condition; - } - - public boolean hasCondition() { - if (this.condition == null) - return false; - for (FamilyMemberHistoryConditionComponent item : this.condition) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #condition} (The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.) - */ - // syntactic sugar - public FamilyMemberHistoryConditionComponent addCondition() { //3 - FamilyMemberHistoryConditionComponent t = new FamilyMemberHistoryConditionComponent(); - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return t; - } - - // syntactic sugar - public FamilyMemberHistory addCondition(FamilyMemberHistoryConditionComponent t) { //3 - if (t == null) - return this; - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this family member history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("patient", "Reference(Patient)", "The person who this history concerns.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("date", "dateTime", "The date (and possibly time) when the family member history was taken.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("name", "string", "This will either be a name or a description. E.g. 'Aunt Susan', 'my cousin with the red hair'.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("relationship", "CodeableConcept", "The type of relationship this person has to the patient (father, mother, brother etc.).", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); - childrenList.add(new Property("born[x]", "Period|date|string", "The actual or approximate date of birth of the relative.", 0, java.lang.Integer.MAX_VALUE, born)); - childrenList.add(new Property("age[x]", "Age|Range|string", "The actual or approximate age of the relative at the time the family member history is recorded.", 0, java.lang.Integer.MAX_VALUE, age)); - childrenList.add(new Property("deceased[x]", "boolean|Age|Range|date|string", "The actual or approximate age of the relative at the time the family member history is recorded.", 0, java.lang.Integer.MAX_VALUE, deceased)); - childrenList.add(new Property("note", "string", "This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.", 0, java.lang.Integer.MAX_VALUE, note)); - childrenList.add(new Property("condition", "", "The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.", 0, java.lang.Integer.MAX_VALUE, condition)); - } - - public FamilyMemberHistory copy() { - FamilyMemberHistory dst = new FamilyMemberHistory(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - dst.date = date == null ? null : date.copy(); - dst.name = name == null ? null : name.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - dst.gender = gender == null ? null : gender.copy(); - dst.born = born == null ? null : born.copy(); - dst.age = age == null ? null : age.copy(); - dst.deceased = deceased == null ? null : deceased.copy(); - dst.note = note == null ? null : note.copy(); - if (condition != null) { - dst.condition = new ArrayList(); - for (FamilyMemberHistoryConditionComponent i : condition) - dst.condition.add(i.copy()); - }; - return dst; - } - - protected FamilyMemberHistory typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof FamilyMemberHistory)) - return false; - FamilyMemberHistory o = (FamilyMemberHistory) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(date, o.date, true) - && compareDeep(name, o.name, true) && compareDeep(relationship, o.relationship, true) && compareDeep(gender, o.gender, true) - && compareDeep(born, o.born, true) && compareDeep(age, o.age, true) && compareDeep(deceased, o.deceased, true) - && compareDeep(note, o.note, true) && compareDeep(condition, o.condition, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof FamilyMemberHistory)) - return false; - FamilyMemberHistory o = (FamilyMemberHistory) other; - return compareValues(date, o.date, true) && compareValues(name, o.name, true) && compareValues(gender, o.gender, true) - && compareValues(note, o.note, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) - && (date == null || date.isEmpty()) && (name == null || name.isEmpty()) && (relationship == null || relationship.isEmpty()) - && (gender == null || gender.isEmpty()) && (born == null || born.isEmpty()) && (age == null || age.isEmpty()) - && (deceased == null || deceased.isEmpty()) && (note == null || note.isEmpty()) && (condition == null || condition.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.FamilyMemberHistory; - } - - @SearchParamDefinition(name="patient", path="FamilyMemberHistory.patient", description="The identity of a subject to list family member history items for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="date", path="FamilyMemberHistory.date", description="When history was captured/updated", type="date" ) - public static final String SP_DATE = "date"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Significant health events and conditions for a person related to the patient relevant in the context of care for the patient. + */ +@ResourceDef(name="FamilyMemberHistory", profile="http://hl7.org/fhir/Profile/FamilyMemberHistory") +public class FamilyMemberHistory extends DomainResource { + + public enum AdministrativeGender { + /** + * Male + */ + MALE, + /** + * Female + */ + FEMALE, + /** + * Other + */ + OTHER, + /** + * Unknown + */ + UNKNOWN, + /** + * added to help the parsers + */ + NULL; + public static AdministrativeGender fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return MALE; + if ("female".equals(codeString)) + return FEMALE; + if ("other".equals(codeString)) + return OTHER; + if ("unknown".equals(codeString)) + return UNKNOWN; + throw new Exception("Unknown AdministrativeGender code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case MALE: return "male"; + case FEMALE: return "female"; + case OTHER: return "other"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MALE: return ""; + case FEMALE: return ""; + case OTHER: return ""; + case UNKNOWN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MALE: return "Male"; + case FEMALE: return "Female"; + case OTHER: return "Other"; + case UNKNOWN: return "Unknown"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MALE: return "Male"; + case FEMALE: return "Female"; + case OTHER: return "Other"; + case UNKNOWN: return "Unknown"; + default: return "?"; + } + } + } + + public static class AdministrativeGenderEnumFactory implements EnumFactory { + public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return AdministrativeGender.MALE; + if ("female".equals(codeString)) + return AdministrativeGender.FEMALE; + if ("other".equals(codeString)) + return AdministrativeGender.OTHER; + if ("unknown".equals(codeString)) + return AdministrativeGender.UNKNOWN; + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); + } + public String toCode(AdministrativeGender code) { + if (code == AdministrativeGender.MALE) + return "male"; + if (code == AdministrativeGender.FEMALE) + return "female"; + if (code == AdministrativeGender.OTHER) + return "other"; + if (code == AdministrativeGender.UNKNOWN) + return "unknown"; + return "?"; + } + } + + @Block() + public static class FamilyMemberHistoryConditionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Condition suffered by relation", formalDefinition="The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system." ) + protected CodeableConcept type; + + /** + * Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation. + */ + @Child(name = "outcome", type = {CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="deceased | permanent disability | etc.", formalDefinition="Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation." ) + protected CodeableConcept outcome; + + /** + * Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence. + */ + @Child(name = "onset", type = {Age.class, Range.class, StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="When condition first manifested", formalDefinition="Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence." ) + protected Type onset; + + /** + * An area where general notes can be placed about this specific condition. + */ + @Child(name = "note", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Extra information about condition", formalDefinition="An area where general notes can be placed about this specific condition." ) + protected StringType note; + + private static final long serialVersionUID = -1664709272L; + + /* + * Constructor + */ + public FamilyMemberHistoryConditionComponent() { + super(); + } + + /* + * Constructor + */ + public FamilyMemberHistoryConditionComponent(CodeableConcept type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyMemberHistoryConditionComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.) + */ + public FamilyMemberHistoryConditionComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #outcome} (Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation.) + */ + public CodeableConcept getOutcome() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyMemberHistoryConditionComponent.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new CodeableConcept(); // cc + return this.outcome; + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation.) + */ + public FamilyMemberHistoryConditionComponent setOutcome(CodeableConcept value) { + this.outcome = value; + return this; + } + + /** + * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) + */ + public Type getOnset() { + return this.onset; + } + + /** + * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) + */ + public Age getOnsetAge() throws Exception { + if (!(this.onset instanceof Age)) + throw new Exception("Type mismatch: the type Age was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (Age) this.onset; + } + + /** + * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) + */ + public Range getOnsetRange() throws Exception { + if (!(this.onset instanceof Range)) + throw new Exception("Type mismatch: the type Range was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (Range) this.onset; + } + + /** + * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) + */ + public StringType getOnsetStringType() throws Exception { + if (!(this.onset instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (StringType) this.onset; + } + + public boolean hasOnset() { + return this.onset != null && !this.onset.isEmpty(); + } + + /** + * @param value {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) + */ + public FamilyMemberHistoryConditionComponent setOnset(Type value) { + this.onset = value; + return this; + } + + /** + * @return {@link #note} (An area where general notes can be placed about this specific condition.). 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 FamilyMemberHistoryConditionComponent.note"); + else if (Configuration.doAutoCreate()) + this.note = new StringType(); // bb + 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} (An area where general notes can be placed about this specific condition.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value + */ + public FamilyMemberHistoryConditionComponent setNoteElement(StringType value) { + this.note = value; + return this; + } + + /** + * @return An area where general notes can be placed about this specific condition. + */ + public String getNote() { + return this.note == null ? null : this.note.getValue(); + } + + /** + * @param value An area where general notes can be placed about this specific condition. + */ + public FamilyMemberHistoryConditionComponent setNote(String value) { + if (Utilities.noString(value)) + this.note = null; + else { + if (this.note == null) + this.note = new StringType(); + this.note.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("outcome", "CodeableConcept", "Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation.", 0, java.lang.Integer.MAX_VALUE, outcome)); + childrenList.add(new Property("onset[x]", "Age|Range|string", "Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.", 0, java.lang.Integer.MAX_VALUE, onset)); + childrenList.add(new Property("note", "string", "An area where general notes can be placed about this specific condition.", 0, java.lang.Integer.MAX_VALUE, note)); + } + + public FamilyMemberHistoryConditionComponent copy() { + FamilyMemberHistoryConditionComponent dst = new FamilyMemberHistoryConditionComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.onset = onset == null ? null : onset.copy(); + dst.note = note == null ? null : note.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof FamilyMemberHistoryConditionComponent)) + return false; + FamilyMemberHistoryConditionComponent o = (FamilyMemberHistoryConditionComponent) other; + return compareDeep(type, o.type, true) && compareDeep(outcome, o.outcome, true) && compareDeep(onset, o.onset, true) + && compareDeep(note, o.note, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof FamilyMemberHistoryConditionComponent)) + return false; + FamilyMemberHistoryConditionComponent o = (FamilyMemberHistoryConditionComponent) other; + return compareValues(note, o.note, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (outcome == null || outcome.isEmpty()) + && (onset == null || onset.isEmpty()) && (note == null || note.isEmpty()); + } + + } + + /** + * This records identifiers associated with this family member history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Id(s) for this record", formalDefinition="This records identifiers associated with this family member history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) + protected List identifier; + + /** + * The person who this history concerns. + */ + @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1) + @Description(shortDefinition="Patient history is about", formalDefinition="The person who this history concerns." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The person who this history concerns.) + */ + protected Patient patientTarget; + + /** + * The date (and possibly time) when the family member history was taken. + */ + @Child(name = "date", type = {DateTimeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="When history was captured/updated", formalDefinition="The date (and possibly time) when the family member history was taken." ) + protected DateTimeType date; + + /** + * This will either be a name or a description. E.g. "Aunt Susan", "my cousin with the red hair". + */ + @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="The family member described", formalDefinition="This will either be a name or a description. E.g. 'Aunt Susan', 'my cousin with the red hair'." ) + protected StringType name; + + /** + * The type of relationship this person has to the patient (father, mother, brother etc.). + */ + @Child(name = "relationship", type = {CodeableConcept.class}, order=4, min=1, max=1) + @Description(shortDefinition="Relationship to the subject", formalDefinition="The type of relationship this person has to the patient (father, mother, brother etc.)." ) + protected CodeableConcept relationship; + + /** + * Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes. + */ + @Child(name = "gender", type = {CodeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes." ) + protected Enumeration gender; + + /** + * The actual or approximate date of birth of the relative. + */ + @Child(name = "born", type = {Period.class, DateType.class, StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="(approximate) date of birth", formalDefinition="The actual or approximate date of birth of the relative." ) + protected Type born; + + /** + * The actual or approximate age of the relative at the time the family member history is recorded. + */ + @Child(name = "age", type = {Age.class, Range.class, StringType.class}, order=7, min=0, max=1) + @Description(shortDefinition="(approximate) age", formalDefinition="The actual or approximate age of the relative at the time the family member history is recorded." ) + protected Type age; + + /** + * The actual or approximate age of the relative at the time the family member history is recorded. + */ + @Child(name = "deceased", type = {BooleanType.class, Age.class, Range.class, DateType.class, StringType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Dead? How old/when?", formalDefinition="The actual or approximate age of the relative at the time the family member history is recorded." ) + protected Type deceased; + + /** + * This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible. + */ + @Child(name = "note", type = {StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="General note about related person", formalDefinition="This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible." ) + protected StringType note; + + /** + * The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition. + */ + @Child(name = "condition", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Condition that the related person had", formalDefinition="The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition." ) + protected List condition; + + private static final long serialVersionUID = 1785160836L; + + /* + * Constructor + */ + public FamilyMemberHistory() { + super(); + } + + /* + * Constructor + */ + public FamilyMemberHistory(Reference patient, CodeableConcept relationship) { + super(); + this.patient = patient; + this.relationship = relationship; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this family member history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this family member history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public FamilyMemberHistory addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #patient} (The person who this history concerns.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyMemberHistory.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The person who this history concerns.) + */ + public FamilyMemberHistory setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person who this history concerns.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyMemberHistory.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person who this history concerns.) + */ + public FamilyMemberHistory setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #date} (The date (and possibly time) when the family member history was taken.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyMemberHistory.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date (and possibly time) when the family member history was taken.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public FamilyMemberHistory setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date (and possibly time) when the family member history was taken. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date (and possibly time) when the family member history was taken. + */ + public FamilyMemberHistory setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (This will either be a name or a description. E.g. "Aunt Susan", "my cousin with the red hair".). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyMemberHistory.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (This will either be a name or a description. E.g. "Aunt Susan", "my cousin with the red hair".). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public FamilyMemberHistory setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return This will either be a name or a description. E.g. "Aunt Susan", "my cousin with the red hair". + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value This will either be a name or a description. E.g. "Aunt Susan", "my cousin with the red hair". + */ + public FamilyMemberHistory setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #relationship} (The type of relationship this person has to the patient (father, mother, brother etc.).) + */ + public CodeableConcept getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyMemberHistory.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new CodeableConcept(); // cc + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The type of relationship this person has to the patient (father, mother, brother etc.).) + */ + public FamilyMemberHistory setRelationship(CodeableConcept value) { + this.relationship = value; + return this; + } + + /** + * @return {@link #gender} (Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Enumeration getGenderElement() { + if (this.gender == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyMemberHistory.gender"); + else if (Configuration.doAutoCreate()) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb + return this.gender; + } + + public boolean hasGenderElement() { + return this.gender != null && !this.gender.isEmpty(); + } + + public boolean hasGender() { + return this.gender != null && !this.gender.isEmpty(); + } + + /** + * @param value {@link #gender} (Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public FamilyMemberHistory setGenderElement(Enumeration value) { + this.gender = value; + return this; + } + + /** + * @return Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes. + */ + public AdministrativeGender getGender() { + return this.gender == null ? null : this.gender.getValue(); + } + + /** + * @param value Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes. + */ + public FamilyMemberHistory setGender(AdministrativeGender value) { + if (value == null) + this.gender = null; + else { + if (this.gender == null) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); + this.gender.setValue(value); + } + return this; + } + + /** + * @return {@link #born} (The actual or approximate date of birth of the relative.) + */ + public Type getBorn() { + return this.born; + } + + /** + * @return {@link #born} (The actual or approximate date of birth of the relative.) + */ + public Period getBornPeriod() throws Exception { + if (!(this.born instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.born.getClass().getName()+" was encountered"); + return (Period) this.born; + } + + /** + * @return {@link #born} (The actual or approximate date of birth of the relative.) + */ + public DateType getBornDateType() throws Exception { + if (!(this.born instanceof DateType)) + throw new Exception("Type mismatch: the type DateType was expected, but "+this.born.getClass().getName()+" was encountered"); + return (DateType) this.born; + } + + /** + * @return {@link #born} (The actual or approximate date of birth of the relative.) + */ + public StringType getBornStringType() throws Exception { + if (!(this.born instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.born.getClass().getName()+" was encountered"); + return (StringType) this.born; + } + + public boolean hasBorn() { + return this.born != null && !this.born.isEmpty(); + } + + /** + * @param value {@link #born} (The actual or approximate date of birth of the relative.) + */ + public FamilyMemberHistory setBorn(Type value) { + this.born = value; + return this; + } + + /** + * @return {@link #age} (The actual or approximate age of the relative at the time the family member history is recorded.) + */ + public Type getAge() { + return this.age; + } + + /** + * @return {@link #age} (The actual or approximate age of the relative at the time the family member history is recorded.) + */ + public Age getAgeAge() throws Exception { + if (!(this.age instanceof Age)) + throw new Exception("Type mismatch: the type Age was expected, but "+this.age.getClass().getName()+" was encountered"); + return (Age) this.age; + } + + /** + * @return {@link #age} (The actual or approximate age of the relative at the time the family member history is recorded.) + */ + public Range getAgeRange() throws Exception { + if (!(this.age instanceof Range)) + throw new Exception("Type mismatch: the type Range was expected, but "+this.age.getClass().getName()+" was encountered"); + return (Range) this.age; + } + + /** + * @return {@link #age} (The actual or approximate age of the relative at the time the family member history is recorded.) + */ + public StringType getAgeStringType() throws Exception { + if (!(this.age instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.age.getClass().getName()+" was encountered"); + return (StringType) this.age; + } + + public boolean hasAge() { + return this.age != null && !this.age.isEmpty(); + } + + /** + * @param value {@link #age} (The actual or approximate age of the relative at the time the family member history is recorded.) + */ + public FamilyMemberHistory setAge(Type value) { + this.age = value; + return this; + } + + /** + * @return {@link #deceased} (The actual or approximate age of the relative at the time the family member history is recorded.) + */ + public Type getDeceased() { + return this.deceased; + } + + /** + * @return {@link #deceased} (The actual or approximate age of the relative at the time the family member history is recorded.) + */ + public BooleanType getDeceasedBooleanType() throws Exception { + if (!(this.deceased instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.deceased.getClass().getName()+" was encountered"); + return (BooleanType) this.deceased; + } + + /** + * @return {@link #deceased} (The actual or approximate age of the relative at the time the family member history is recorded.) + */ + public Age getDeceasedAge() throws Exception { + if (!(this.deceased instanceof Age)) + throw new Exception("Type mismatch: the type Age was expected, but "+this.deceased.getClass().getName()+" was encountered"); + return (Age) this.deceased; + } + + /** + * @return {@link #deceased} (The actual or approximate age of the relative at the time the family member history is recorded.) + */ + public Range getDeceasedRange() throws Exception { + if (!(this.deceased instanceof Range)) + throw new Exception("Type mismatch: the type Range was expected, but "+this.deceased.getClass().getName()+" was encountered"); + return (Range) this.deceased; + } + + /** + * @return {@link #deceased} (The actual or approximate age of the relative at the time the family member history is recorded.) + */ + public DateType getDeceasedDateType() throws Exception { + if (!(this.deceased instanceof DateType)) + throw new Exception("Type mismatch: the type DateType was expected, but "+this.deceased.getClass().getName()+" was encountered"); + return (DateType) this.deceased; + } + + /** + * @return {@link #deceased} (The actual or approximate age of the relative at the time the family member history is recorded.) + */ + public StringType getDeceasedStringType() throws Exception { + if (!(this.deceased instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.deceased.getClass().getName()+" was encountered"); + return (StringType) this.deceased; + } + + public boolean hasDeceased() { + return this.deceased != null && !this.deceased.isEmpty(); + } + + /** + * @param value {@link #deceased} (The actual or approximate age of the relative at the time the family member history is recorded.) + */ + public FamilyMemberHistory setDeceased(Type value) { + this.deceased = value; + return this; + } + + /** + * @return {@link #note} (This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.). 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 FamilyMemberHistory.note"); + else if (Configuration.doAutoCreate()) + this.note = new StringType(); // bb + 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} (This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value + */ + public FamilyMemberHistory setNoteElement(StringType value) { + this.note = value; + return this; + } + + /** + * @return This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible. + */ + public String getNote() { + return this.note == null ? null : this.note.getValue(); + } + + /** + * @param value This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible. + */ + public FamilyMemberHistory setNote(String value) { + if (Utilities.noString(value)) + this.note = null; + else { + if (this.note == null) + this.note = new StringType(); + this.note.setValue(value); + } + return this; + } + + /** + * @return {@link #condition} (The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.) + */ + public List getCondition() { + if (this.condition == null) + this.condition = new ArrayList(); + return this.condition; + } + + public boolean hasCondition() { + if (this.condition == null) + return false; + for (FamilyMemberHistoryConditionComponent item : this.condition) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #condition} (The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.) + */ + // syntactic sugar + public FamilyMemberHistoryConditionComponent addCondition() { //3 + FamilyMemberHistoryConditionComponent t = new FamilyMemberHistoryConditionComponent(); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return t; + } + + // syntactic sugar + public FamilyMemberHistory addCondition(FamilyMemberHistoryConditionComponent t) { //3 + if (t == null) + return this; + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this family member history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("patient", "Reference(Patient)", "The person who this history concerns.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("date", "dateTime", "The date (and possibly time) when the family member history was taken.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("name", "string", "This will either be a name or a description. E.g. 'Aunt Susan', 'my cousin with the red hair'.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("relationship", "CodeableConcept", "The type of relationship this person has to the patient (father, mother, brother etc.).", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); + childrenList.add(new Property("born[x]", "Period|date|string", "The actual or approximate date of birth of the relative.", 0, java.lang.Integer.MAX_VALUE, born)); + childrenList.add(new Property("age[x]", "Age|Range|string", "The actual or approximate age of the relative at the time the family member history is recorded.", 0, java.lang.Integer.MAX_VALUE, age)); + childrenList.add(new Property("deceased[x]", "boolean|Age|Range|date|string", "The actual or approximate age of the relative at the time the family member history is recorded.", 0, java.lang.Integer.MAX_VALUE, deceased)); + childrenList.add(new Property("note", "string", "This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("condition", "", "The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.", 0, java.lang.Integer.MAX_VALUE, condition)); + } + + public FamilyMemberHistory copy() { + FamilyMemberHistory dst = new FamilyMemberHistory(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + dst.date = date == null ? null : date.copy(); + dst.name = name == null ? null : name.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + dst.gender = gender == null ? null : gender.copy(); + dst.born = born == null ? null : born.copy(); + dst.age = age == null ? null : age.copy(); + dst.deceased = deceased == null ? null : deceased.copy(); + dst.note = note == null ? null : note.copy(); + if (condition != null) { + dst.condition = new ArrayList(); + for (FamilyMemberHistoryConditionComponent i : condition) + dst.condition.add(i.copy()); + }; + return dst; + } + + protected FamilyMemberHistory typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof FamilyMemberHistory)) + return false; + FamilyMemberHistory o = (FamilyMemberHistory) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(date, o.date, true) + && compareDeep(name, o.name, true) && compareDeep(relationship, o.relationship, true) && compareDeep(gender, o.gender, true) + && compareDeep(born, o.born, true) && compareDeep(age, o.age, true) && compareDeep(deceased, o.deceased, true) + && compareDeep(note, o.note, true) && compareDeep(condition, o.condition, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof FamilyMemberHistory)) + return false; + FamilyMemberHistory o = (FamilyMemberHistory) other; + return compareValues(date, o.date, true) && compareValues(name, o.name, true) && compareValues(gender, o.gender, true) + && compareValues(note, o.note, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) + && (date == null || date.isEmpty()) && (name == null || name.isEmpty()) && (relationship == null || relationship.isEmpty()) + && (gender == null || gender.isEmpty()) && (born == null || born.isEmpty()) && (age == null || age.isEmpty()) + && (deceased == null || deceased.isEmpty()) && (note == null || note.isEmpty()) && (condition == null || condition.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.FamilyMemberHistory; + } + + @SearchParamDefinition(name="date", path="FamilyMemberHistory.date", description="When history was captured/updated", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="patient", path="FamilyMemberHistory.patient", description="The identity of a subject to list family member history items for", type="reference" ) + public static final String SP_PATIENT = "patient"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/FhirEnum.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/FhirEnum.java new file mode 100644 index 00000000000..b3c66a722a8 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/FhirEnum.java @@ -0,0 +1,66 @@ +package org.hl7.fhir.instance.model; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 - 2015 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + + + +/* +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(); + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Flag.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Flag.java index 105b08db4a7..dd6ec79dbce 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Flag.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Flag.java @@ -1,549 +1,528 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Prospective warnings of potential issues when providing care to the patient. - */ -@ResourceDef(name="Flag", profile="http://hl7.org/fhir/Profile/Flag") -public class Flag extends DomainResource { - - public enum FlagStatus { - /** - * A current flag that should be displayed to a user. A system may use the category to determine which roles should view the flag. - */ - ACTIVE, - /** - * The flag does not need to be displayed any more. - */ - INACTIVE, - /** - * The flag was added in error, and should no longer be displayed. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static FlagStatus fromCode(String codeString) throws Exception { - 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 Exception("Unknown FlagStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ACTIVE: return "active"; - case INACTIVE: return "inactive"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ACTIVE: return ""; - case INACTIVE: return ""; - case ENTEREDINERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ACTIVE: return "A current flag that should be displayed to a user. A system may use the category to determine which roles should view the flag."; - case INACTIVE: return "The flag does not need to be displayed any more."; - case ENTEREDINERROR: return "The flag was added in error, and should no longer be displayed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ACTIVE: return "Active"; - case INACTIVE: return "Inactive"; - case ENTEREDINERROR: return "Entered In Error"; - default: return "?"; - } - } - } - - public static class FlagStatusEnumFactory implements EnumFactory { - public FlagStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return FlagStatus.ACTIVE; - if ("inactive".equals(codeString)) - return FlagStatus.INACTIVE; - if ("entered-in-error".equals(codeString)) - return FlagStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown FlagStatus code '"+codeString+"'"); - } - public String toCode(FlagStatus code) { - if (code == FlagStatus.ACTIVE) - return "active"; - if (code == FlagStatus.INACTIVE) - return "inactive"; - if (code == FlagStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - } - - /** - * Identifier assigned to the flag for external use (outside the FHIR environment). - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business identifier", formalDefinition="Identifier assigned to the flag for external use (outside the FHIR environment)." ) - protected List identifier; - - /** - * Allows an flag to be divided into different categories like clinical, administrative etc. - */ - @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Clinical, administrative, etc.", formalDefinition="Allows an flag to be divided into different categories like clinical, administrative etc." ) - protected CodeableConcept category; - - /** - * Supports basic workflow. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="active | inactive | entered-in-error", formalDefinition="Supports basic workflow." ) - protected Enumeration status; - - /** - * The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified. - */ - @Child(name = "period", type = {Period.class}, order=3, min=0, max=1) - @Description(shortDefinition="Time period when flag is active", formalDefinition="The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified." ) - protected Period period; - - /** - * The patient record this flag is associated with. - */ - @Child(name = "patient", type = {Patient.class}, order=4, min=1, max=1) - @Description(shortDefinition="Who is flag about?", formalDefinition="The patient record this flag is associated with." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient record this flag is associated with.) - */ - protected Patient patientTarget; - - /** - * The person or device that created the flag. - */ - @Child(name = "author", type = {Practitioner.class, Patient.class, Device.class}, order=5, min=0, max=1) - @Description(shortDefinition="Flag creator", formalDefinition="The person or device that created the flag." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (The person or device that created the flag.) - */ - protected Resource authorTarget; - - /** - * The coded value or textual component of the flag to display to the user. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=6, min=1, max=1) - @Description(shortDefinition="Partially deaf, Requires easy open caps, No permanent address, etc.", formalDefinition="The coded value or textual component of the flag to display to the user." ) - protected CodeableConcept code; - - private static final long serialVersionUID = 1117780761L; - - /* - * Constructor - */ - public Flag() { - super(); - } - - /* - * Constructor - */ - public Flag(Enumeration status, Reference patient, CodeableConcept code) { - super(); - this.status = status; - this.patient = patient; - this.code = code; - } - - /** - * @return {@link #identifier} (Identifier assigned to the flag for external use (outside the FHIR environment).) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifier assigned to the flag for external use (outside the FHIR environment).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Flag addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #category} (Allows an flag to be divided into different categories like clinical, administrative etc.) - */ - public CodeableConcept getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Flag.category"); - else if (Configuration.doAutoCreate()) - this.category = new CodeableConcept(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Allows an flag to be divided into different categories like clinical, administrative etc.) - */ - public Flag setCategory(CodeableConcept value) { - this.category = value; - return this; - } - - /** - * @return {@link #status} (Supports basic workflow.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Flag.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new FlagStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Supports basic workflow.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Flag setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Supports basic workflow. - */ - public FlagStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Supports basic workflow. - */ - public Flag setStatus(FlagStatus value) { - if (this.status == null) - this.status = new Enumeration(new FlagStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #period} (The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Flag.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.) - */ - public Flag setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #patient} (The patient record this flag is associated with.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Flag.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The patient record this flag is associated with.) - */ - public Flag setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient record this flag is associated with.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Flag.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient record this flag is associated with.) - */ - public Flag setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #author} (The person or device that created the flag.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Flag.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); // cc - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (The person or device that created the flag.) - */ - public Flag setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person or device that created the flag.) - */ - public Resource getAuthorTarget() { - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person or device that created the flag.) - */ - public Flag setAuthorTarget(Resource value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #code} (The coded value or textual component of the flag to display to the user.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Flag.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (The coded value or textual component of the flag to display to the user.) - */ - public Flag setCode(CodeableConcept value) { - this.code = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier assigned to the flag for external use (outside the FHIR environment).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("category", "CodeableConcept", "Allows an flag to be divided into different categories like clinical, administrative etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("status", "code", "Supports basic workflow.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("period", "Period", "The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient record this flag is associated with.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("author", "Reference(Practitioner|Patient|Device)", "The person or device that created the flag.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("code", "CodeableConcept", "The coded value or textual component of the flag to display to the user.", 0, java.lang.Integer.MAX_VALUE, code)); - } - - public Flag copy() { - Flag dst = new Flag(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.category = category == null ? null : category.copy(); - dst.status = status == null ? null : status.copy(); - dst.period = period == null ? null : period.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.author = author == null ? null : author.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - protected Flag typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Flag)) - return false; - Flag o = (Flag) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(category, o.category, true) && compareDeep(status, o.status, true) - && compareDeep(period, o.period, true) && compareDeep(patient, o.patient, true) && compareDeep(author, o.author, true) - && compareDeep(code, o.code, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Flag)) - return false; - Flag o = (Flag) other; - return compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty()) - && (status == null || status.isEmpty()) && (period == null || period.isEmpty()) && (patient == null || patient.isEmpty()) - && (author == null || author.isEmpty()) && (code == null || code.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Flag; - } - - @SearchParamDefinition(name="author", path="Flag.author", description="Flag creator", type="reference" ) - public static final String SP_AUTHOR = "author"; - @SearchParamDefinition(name="patient", path="Flag.patient", description="The identity of a subject to list flags for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="subject", path="Flag.patient", description="The identity of a subject to list flags for", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="date", path="Flag.period", description="Time period when flag is active", type="date" ) - public static final String SP_DATE = "date"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Prospective warnings of potential issues when providing care to the patient. + */ +@ResourceDef(name="Flag", profile="http://hl7.org/fhir/Profile/Flag") +public class Flag extends DomainResource { + + public enum FlagStatus { + /** + * A current flag that should be displayed to a user. A system may use the category to determine which roles should view the flag. + */ + ACTIVE, + /** + * The flag does not need to be displayed any more. + */ + INACTIVE, + /** + * The flag was added in error, and should no longer be displayed. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static FlagStatus fromCode(String codeString) throws Exception { + 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 Exception("Unknown FlagStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ACTIVE: return "active"; + case INACTIVE: return "inactive"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACTIVE: return ""; + case INACTIVE: return ""; + case ENTEREDINERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACTIVE: return "A current flag that should be displayed to a user. A system may use the category to determine which roles should view the flag."; + case INACTIVE: return "The flag does not need to be displayed any more."; + case ENTEREDINERROR: return "The flag was added in error, and should no longer be displayed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACTIVE: return "Active"; + case INACTIVE: return "Inactive"; + case ENTEREDINERROR: return "Entered In Error"; + default: return "?"; + } + } + } + + public static class FlagStatusEnumFactory implements EnumFactory { + public FlagStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return FlagStatus.ACTIVE; + if ("inactive".equals(codeString)) + return FlagStatus.INACTIVE; + if ("entered-in-error".equals(codeString)) + return FlagStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown FlagStatus code '"+codeString+"'"); + } + public String toCode(FlagStatus code) { + if (code == FlagStatus.ACTIVE) + return "active"; + if (code == FlagStatus.INACTIVE) + return "inactive"; + if (code == FlagStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + } + + /** + * Identifier assigned to the flag for external use (outside the FHIR environment). + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business identifier", formalDefinition="Identifier assigned to the flag for external use (outside the FHIR environment)." ) + protected List identifier; + + /** + * Allows an flag to be divided into different categories like clinical, administrative etc. + */ + @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Clinical, administrative, etc.", formalDefinition="Allows an flag to be divided into different categories like clinical, administrative etc." ) + protected CodeableConcept category; + + /** + * Supports basic workflow. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="active | inactive | entered-in-error", formalDefinition="Supports basic workflow." ) + protected Enumeration status; + + /** + * The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified. + */ + @Child(name = "period", type = {Period.class}, order=3, min=0, max=1) + @Description(shortDefinition="Time period when flag is active", formalDefinition="The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified." ) + protected Period period; + + /** + * The patient record this flag is associated with. + */ + @Child(name = "patient", type = {Patient.class}, order=4, min=1, max=1) + @Description(shortDefinition="Who is flag about?", formalDefinition="The patient record this flag is associated with." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient record this flag is associated with.) + */ + protected Patient patientTarget; + + /** + * The person or device that created the flag. + */ + @Child(name = "author", type = {Practitioner.class, Patient.class, Device.class}, order=5, min=0, max=1) + @Description(shortDefinition="Flag creator", formalDefinition="The person or device that created the flag." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (The person or device that created the flag.) + */ + protected Resource authorTarget; + + /** + * The coded value or textual component of the flag to display to the user. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=6, min=1, max=1) + @Description(shortDefinition="Partially deaf, Requires easy open caps, No permanent address, etc.", formalDefinition="The coded value or textual component of the flag to display to the user." ) + protected CodeableConcept code; + + private static final long serialVersionUID = 1117780761L; + + /* + * Constructor + */ + public Flag() { + super(); + } + + /* + * Constructor + */ + public Flag(Enumeration status, Reference patient, CodeableConcept code) { + super(); + this.status = status; + this.patient = patient; + this.code = code; + } + + /** + * @return {@link #identifier} (Identifier assigned to the flag for external use (outside the FHIR environment).) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Identifier assigned to the flag for external use (outside the FHIR environment).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Flag addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #category} (Allows an flag to be divided into different categories like clinical, administrative etc.) + */ + public CodeableConcept getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Flag.category"); + else if (Configuration.doAutoCreate()) + this.category = new CodeableConcept(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Allows an flag to be divided into different categories like clinical, administrative etc.) + */ + public Flag setCategory(CodeableConcept value) { + this.category = value; + return this; + } + + /** + * @return {@link #status} (Supports basic workflow.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Flag.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new FlagStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (Supports basic workflow.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Flag setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Supports basic workflow. + */ + public FlagStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Supports basic workflow. + */ + public Flag setStatus(FlagStatus value) { + if (this.status == null) + this.status = new Enumeration(new FlagStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #period} (The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Flag.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.) + */ + public Flag setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #patient} (The patient record this flag is associated with.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Flag.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The patient record this flag is associated with.) + */ + public Flag setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient record this flag is associated with.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Flag.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient record this flag is associated with.) + */ + public Flag setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #author} (The person or device that created the flag.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Flag.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); // cc + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (The person or device that created the flag.) + */ + public Flag setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person or device that created the flag.) + */ + public Resource getAuthorTarget() { + return this.authorTarget; + } + + /** + * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person or device that created the flag.) + */ + public Flag setAuthorTarget(Resource value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #code} (The coded value or textual component of the flag to display to the user.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Flag.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (The coded value or textual component of the flag to display to the user.) + */ + public Flag setCode(CodeableConcept value) { + this.code = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier assigned to the flag for external use (outside the FHIR environment).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("category", "CodeableConcept", "Allows an flag to be divided into different categories like clinical, administrative etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("status", "code", "Supports basic workflow.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("period", "Period", "The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient record this flag is associated with.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("author", "Reference(Practitioner|Patient|Device)", "The person or device that created the flag.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("code", "CodeableConcept", "The coded value or textual component of the flag to display to the user.", 0, java.lang.Integer.MAX_VALUE, code)); + } + + public Flag copy() { + Flag dst = new Flag(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.category = category == null ? null : category.copy(); + dst.status = status == null ? null : status.copy(); + dst.period = period == null ? null : period.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.author = author == null ? null : author.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + protected Flag typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Flag)) + return false; + Flag o = (Flag) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(category, o.category, true) && compareDeep(status, o.status, true) + && compareDeep(period, o.period, true) && compareDeep(patient, o.patient, true) && compareDeep(author, o.author, true) + && compareDeep(code, o.code, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Flag)) + return false; + Flag o = (Flag) other; + return compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty()) + && (status == null || status.isEmpty()) && (period == null || period.isEmpty()) && (patient == null || patient.isEmpty()) + && (author == null || author.isEmpty()) && (code == null || code.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Flag; + } + + @SearchParamDefinition(name="date", path="Flag.period", description="Time period when flag is active", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="subject", path="Flag.patient", description="The identity of a subject to list flags for", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="patient", path="Flag.patient", description="The identity of a subject to list flags for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="author", path="Flag.author", description="Flag creator", type="reference" ) + public static final String SP_AUTHOR = "author"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Goal.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Goal.java index 298cbee7331..7e56bfeee22 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Goal.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Goal.java @@ -1,992 +1,971 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Describes the intended objective(s) of patient care, for example, weight loss, restoring an activity of daily living, etc. - */ -@ResourceDef(name="Goal", profile="http://hl7.org/fhir/Profile/Goal") -public class Goal extends DomainResource { - - public enum GoalStatus { - /** - * A goal is proposed for this patient. - */ - PROPOSED, - /** - * A goal is planned for this patient. - */ - PLANNED, - /** - * The goal is being sought but has not yet been reached. (Also applies if goal was reached in the past but there has been regression and goal is being sought again). - */ - INPROGRESS, - /** - * The goal has been met and no further action is needed. - */ - ACHIEVED, - /** - * The goal has been met, but ongoing activity is needed to sustain the goal objective. - */ - SUSTAINING, - /** - * The goal is no longer being sought. - */ - CANCELLED, - /** - * A proposed goal was accepted. - */ - ACCEPTED, - /** - * A proposed goal was rejected. - */ - REJECTED, - /** - * added to help the parsers - */ - NULL; - public static GoalStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("planned".equals(codeString)) - return PLANNED; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("achieved".equals(codeString)) - return ACHIEVED; - if ("sustaining".equals(codeString)) - return SUSTAINING; - if ("cancelled".equals(codeString)) - return CANCELLED; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("rejected".equals(codeString)) - return REJECTED; - throw new Exception("Unknown GoalStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PROPOSED: return "proposed"; - case PLANNED: return "planned"; - case INPROGRESS: return "in-progress"; - case ACHIEVED: return "achieved"; - case SUSTAINING: return "sustaining"; - case CANCELLED: return "cancelled"; - case ACCEPTED: return "accepted"; - case REJECTED: return "rejected"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PROPOSED: return ""; - case PLANNED: return ""; - case INPROGRESS: return ""; - case ACHIEVED: return ""; - case SUSTAINING: return ""; - case CANCELLED: return ""; - case ACCEPTED: return ""; - case REJECTED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PROPOSED: return "A goal is proposed for this patient."; - case PLANNED: return "A goal is planned for this patient."; - case INPROGRESS: return "The goal is being sought but has not yet been reached. (Also applies if goal was reached in the past but there has been regression and goal is being sought again)."; - case ACHIEVED: return "The goal has been met and no further action is needed."; - case SUSTAINING: return "The goal has been met, but ongoing activity is needed to sustain the goal objective."; - case CANCELLED: return "The goal is no longer being sought."; - case ACCEPTED: return "A proposed goal was accepted."; - case REJECTED: return "A proposed goal was rejected."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PROPOSED: return "Proposed"; - case PLANNED: return "Planned"; - case INPROGRESS: return "In Progress"; - case ACHIEVED: return "Achieved"; - case SUSTAINING: return "Sustaining"; - case CANCELLED: return "Cancelled"; - case ACCEPTED: return "Accepted"; - case REJECTED: return "Rejected"; - default: return "?"; - } - } - } - - public static class GoalStatusEnumFactory implements EnumFactory { - public GoalStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return GoalStatus.PROPOSED; - if ("planned".equals(codeString)) - return GoalStatus.PLANNED; - if ("in-progress".equals(codeString)) - return GoalStatus.INPROGRESS; - if ("achieved".equals(codeString)) - return GoalStatus.ACHIEVED; - if ("sustaining".equals(codeString)) - return GoalStatus.SUSTAINING; - if ("cancelled".equals(codeString)) - return GoalStatus.CANCELLED; - if ("accepted".equals(codeString)) - return GoalStatus.ACCEPTED; - if ("rejected".equals(codeString)) - return GoalStatus.REJECTED; - throw new IllegalArgumentException("Unknown GoalStatus code '"+codeString+"'"); - } - public String toCode(GoalStatus code) { - if (code == GoalStatus.PROPOSED) - return "proposed"; - if (code == GoalStatus.PLANNED) - return "planned"; - if (code == GoalStatus.INPROGRESS) - return "in-progress"; - if (code == GoalStatus.ACHIEVED) - return "achieved"; - if (code == GoalStatus.SUSTAINING) - return "sustaining"; - if (code == GoalStatus.CANCELLED) - return "cancelled"; - if (code == GoalStatus.ACCEPTED) - return "accepted"; - if (code == GoalStatus.REJECTED) - return "rejected"; - return "?"; - } - } - - @Block() - public static class GoalOutcomeComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Details of what's changed (or not changed). - */ - @Child(name = "result", type = {CodeableConcept.class, Observation.class}, order=1, min=0, max=1) - @Description(shortDefinition="Code or observation that resulted from gual", formalDefinition="Details of what's changed (or not changed)." ) - protected Type result; - - private static final long serialVersionUID = 1994317639L; - - /* - * Constructor - */ - public GoalOutcomeComponent() { - super(); - } - - /** - * @return {@link #result} (Details of what's changed (or not changed).) - */ - public Type getResult() { - return this.result; - } - - /** - * @return {@link #result} (Details of what's changed (or not changed).) - */ - public CodeableConcept getResultCodeableConcept() throws Exception { - if (!(this.result instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.result.getClass().getName()+" was encountered"); - return (CodeableConcept) this.result; - } - - /** - * @return {@link #result} (Details of what's changed (or not changed).) - */ - public Reference getResultReference() throws Exception { - if (!(this.result instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.result.getClass().getName()+" was encountered"); - return (Reference) this.result; - } - - public boolean hasResult() { - return this.result != null && !this.result.isEmpty(); - } - - /** - * @param value {@link #result} (Details of what's changed (or not changed).) - */ - public GoalOutcomeComponent setResult(Type value) { - this.result = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("result[x]", "CodeableConcept|Reference(Observation)", "Details of what's changed (or not changed).", 0, java.lang.Integer.MAX_VALUE, result)); - } - - public GoalOutcomeComponent copy() { - GoalOutcomeComponent dst = new GoalOutcomeComponent(); - copyValues(dst); - dst.result = result == null ? null : result.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof GoalOutcomeComponent)) - return false; - GoalOutcomeComponent o = (GoalOutcomeComponent) other; - return compareDeep(result, o.result, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof GoalOutcomeComponent)) - return false; - GoalOutcomeComponent o = (GoalOutcomeComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (result == null || result.isEmpty()); - } - - } - - /** - * This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External Ids for this goal", formalDefinition="This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) - protected List identifier; - - /** - * Identifies the patient/subject whose intended care is described by the plan. - */ - @Child(name = "patient", type = {Patient.class}, order=1, min=0, max=1) - @Description(shortDefinition="The patient for whom this goal is intended for", formalDefinition="Identifies the patient/subject whose intended care is described by the plan." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (Identifies the patient/subject whose intended care is described by the plan.) - */ - protected Patient patientTarget; - - /** - * Indicates when the goal is intended to be reached. - */ - @Child(name = "targetDate", type = {DateType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Reach goal on or before", formalDefinition="Indicates when the goal is intended to be reached." ) - protected DateType targetDate; - - /** - * Human-readable description of a specific desired objective of care. - */ - @Child(name = "description", type = {StringType.class}, order=3, min=1, max=1) - @Description(shortDefinition="What's the desired outcome?", formalDefinition="Human-readable description of a specific desired objective of care." ) - protected StringType description; - - /** - * Indicates whether the goal has been reached and is still considered relevant. - */ - @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1) - @Description(shortDefinition="proposed | planned | in-progress | achieved | sustaining | cancelled | accepted | rejected", formalDefinition="Indicates whether the goal has been reached and is still considered relevant." ) - protected Enumeration status; - - /** - * Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc. - */ - @Child(name = "statusDate", type = {DateType.class}, order=5, min=0, max=1) - @Description(shortDefinition="When goal status took effect", formalDefinition="Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc." ) - protected DateType statusDate; - - /** - * Indicates whose goal this is - patient goal, practitioner goal, etc. - */ - @Child(name = "author", type = {Patient.class, Practitioner.class, RelatedPerson.class}, order=6, min=0, max=1) - @Description(shortDefinition="Who's responsible for creating Goal?", formalDefinition="Indicates whose goal this is - patient goal, practitioner goal, etc." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (Indicates whose goal this is - patient goal, practitioner goal, etc.) - */ - protected Resource authorTarget; - - /** - * Identifies the level of importance associated with reaching/sustaining the goal. - */ - @Child(name = "priority", type = {CodeableConcept.class}, order=7, min=0, max=1) - @Description(shortDefinition="high | medium |low", formalDefinition="Identifies the level of importance associated with reaching/sustaining the goal." ) - protected CodeableConcept priority; - - /** - * The identified conditions and other health record elements that are intended to be addressed by the goal. - */ - @Child(name = "concern", type = {Condition.class, Observation.class, MedicationStatement.class, NutritionOrder.class, ProcedureRequest.class, RiskAssessment.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Health issues this goal addresses", formalDefinition="The identified conditions and other health record elements that are intended to be addressed by the goal." ) - protected List concern; - /** - * The actual objects that are the target of the reference (The identified conditions and other health record elements that are intended to be addressed by the goal.) - */ - protected List concernTarget; - - - /** - * Any comments related to the goal. - */ - @Child(name = "notes", type = {StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Comments about the goal", formalDefinition="Any comments related to the goal." ) - protected StringType notes; - - /** - * Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved. - */ - @Child(name = "outcome", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="What was end result of goal?", formalDefinition="Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved." ) - protected List outcome; - - private static final long serialVersionUID = -314822558L; - - /* - * Constructor - */ - public Goal() { - super(); - } - - /* - * Constructor - */ - public Goal(StringType description, Enumeration status) { - super(); - this.description = description; - this.status = status; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Goal addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Goal.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.) - */ - public Goal setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Goal.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.) - */ - public Goal setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #targetDate} (Indicates when the goal is intended to be reached.). This is the underlying object with id, value and extensions. The accessor "getTargetDate" gives direct access to the value - */ - public DateType getTargetDateElement() { - if (this.targetDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Goal.targetDate"); - else if (Configuration.doAutoCreate()) - this.targetDate = new DateType(); // bb - return this.targetDate; - } - - public boolean hasTargetDateElement() { - return this.targetDate != null && !this.targetDate.isEmpty(); - } - - public boolean hasTargetDate() { - return this.targetDate != null && !this.targetDate.isEmpty(); - } - - /** - * @param value {@link #targetDate} (Indicates when the goal is intended to be reached.). This is the underlying object with id, value and extensions. The accessor "getTargetDate" gives direct access to the value - */ - public Goal setTargetDateElement(DateType value) { - this.targetDate = value; - return this; - } - - /** - * @return Indicates when the goal is intended to be reached. - */ - public Date getTargetDate() { - return this.targetDate == null ? null : this.targetDate.getValue(); - } - - /** - * @param value Indicates when the goal is intended to be reached. - */ - public Goal setTargetDate(Date value) { - if (value == null) - this.targetDate = null; - else { - if (this.targetDate == null) - this.targetDate = new DateType(); - this.targetDate.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (Human-readable description of a specific desired objective of care.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Goal.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Human-readable description of a specific desired objective of care.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public Goal setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Human-readable description of a specific desired objective of care. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Human-readable description of a specific desired objective of care. - */ - public Goal setDescription(String value) { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - return this; - } - - /** - * @return {@link #status} (Indicates whether the goal has been reached and is still considered relevant.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Goal.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new GoalStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Indicates whether the goal has been reached and is still considered relevant.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Goal setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Indicates whether the goal has been reached and is still considered relevant. - */ - public GoalStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Indicates whether the goal has been reached and is still considered relevant. - */ - public Goal setStatus(GoalStatus value) { - if (this.status == null) - this.status = new Enumeration(new GoalStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #statusDate} (Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value - */ - public DateType getStatusDateElement() { - if (this.statusDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Goal.statusDate"); - else if (Configuration.doAutoCreate()) - this.statusDate = new DateType(); // bb - return this.statusDate; - } - - public boolean hasStatusDateElement() { - return this.statusDate != null && !this.statusDate.isEmpty(); - } - - public boolean hasStatusDate() { - return this.statusDate != null && !this.statusDate.isEmpty(); - } - - /** - * @param value {@link #statusDate} (Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value - */ - public Goal setStatusDateElement(DateType value) { - this.statusDate = value; - return this; - } - - /** - * @return Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc. - */ - public Date getStatusDate() { - return this.statusDate == null ? null : this.statusDate.getValue(); - } - - /** - * @param value Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc. - */ - public Goal setStatusDate(Date value) { - if (value == null) - this.statusDate = null; - else { - if (this.statusDate == null) - this.statusDate = new DateType(); - this.statusDate.setValue(value); - } - return this; - } - - /** - * @return {@link #author} (Indicates whose goal this is - patient goal, practitioner goal, etc.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Goal.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); // cc - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Indicates whose goal this is - patient goal, practitioner goal, etc.) - */ - public Goal setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates whose goal this is - patient goal, practitioner goal, etc.) - */ - public Resource getAuthorTarget() { - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates whose goal this is - patient goal, practitioner goal, etc.) - */ - public Goal setAuthorTarget(Resource value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #priority} (Identifies the level of importance associated with reaching/sustaining the goal.) - */ - public CodeableConcept getPriority() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Goal.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new CodeableConcept(); // cc - return this.priority; - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (Identifies the level of importance associated with reaching/sustaining the goal.) - */ - public Goal setPriority(CodeableConcept value) { - this.priority = value; - return this; - } - - /** - * @return {@link #concern} (The identified conditions and other health record elements that are intended to be addressed by the goal.) - */ - public List getConcern() { - if (this.concern == null) - this.concern = new ArrayList(); - return this.concern; - } - - public boolean hasConcern() { - if (this.concern == null) - return false; - for (Reference item : this.concern) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #concern} (The identified conditions and other health record elements that are intended to be addressed by the goal.) - */ - // syntactic sugar - public Reference addConcern() { //3 - Reference t = new Reference(); - if (this.concern == null) - this.concern = new ArrayList(); - this.concern.add(t); - return t; - } - - // syntactic sugar - public Goal addConcern(Reference t) { //3 - if (t == null) - return this; - if (this.concern == null) - this.concern = new ArrayList(); - this.concern.add(t); - return this; - } - - /** - * @return {@link #concern} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The identified conditions and other health record elements that are intended to be addressed by the goal.) - */ - public List getConcernTarget() { - if (this.concernTarget == null) - this.concernTarget = new ArrayList(); - return this.concernTarget; - } - - /** - * @return {@link #notes} (Any comments related to the goal.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public StringType getNotesElement() { - if (this.notes == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Goal.notes"); - else if (Configuration.doAutoCreate()) - this.notes = new StringType(); // bb - return this.notes; - } - - public boolean hasNotesElement() { - return this.notes != null && !this.notes.isEmpty(); - } - - public boolean hasNotes() { - return this.notes != null && !this.notes.isEmpty(); - } - - /** - * @param value {@link #notes} (Any comments related to the goal.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public Goal setNotesElement(StringType value) { - this.notes = value; - return this; - } - - /** - * @return Any comments related to the goal. - */ - public String getNotes() { - return this.notes == null ? null : this.notes.getValue(); - } - - /** - * @param value Any comments related to the goal. - */ - public Goal setNotes(String value) { - if (Utilities.noString(value)) - this.notes = null; - else { - if (this.notes == null) - this.notes = new StringType(); - this.notes.setValue(value); - } - return this; - } - - /** - * @return {@link #outcome} (Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved.) - */ - public List getOutcome() { - if (this.outcome == null) - this.outcome = new ArrayList(); - return this.outcome; - } - - public boolean hasOutcome() { - if (this.outcome == null) - return false; - for (GoalOutcomeComponent item : this.outcome) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #outcome} (Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved.) - */ - // syntactic sugar - public GoalOutcomeComponent addOutcome() { //3 - GoalOutcomeComponent t = new GoalOutcomeComponent(); - if (this.outcome == null) - this.outcome = new ArrayList(); - this.outcome.add(t); - return t; - } - - // syntactic sugar - public Goal addOutcome(GoalOutcomeComponent t) { //3 - if (t == null) - return this; - if (this.outcome == null) - this.outcome = new ArrayList(); - this.outcome.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("patient", "Reference(Patient)", "Identifies the patient/subject whose intended care is described by the plan.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("targetDate", "date", "Indicates when the goal is intended to be reached.", 0, java.lang.Integer.MAX_VALUE, targetDate)); - childrenList.add(new Property("description", "string", "Human-readable description of a specific desired objective of care.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("status", "code", "Indicates whether the goal has been reached and is still considered relevant.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("statusDate", "date", "Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc.", 0, java.lang.Integer.MAX_VALUE, statusDate)); - childrenList.add(new Property("author", "Reference(Patient|Practitioner|RelatedPerson)", "Indicates whose goal this is - patient goal, practitioner goal, etc.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("priority", "CodeableConcept", "Identifies the level of importance associated with reaching/sustaining the goal.", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("concern", "Reference(Condition|Observation|MedicationStatement|NutritionOrder|ProcedureRequest|RiskAssessment)", "The identified conditions and other health record elements that are intended to be addressed by the goal.", 0, java.lang.Integer.MAX_VALUE, concern)); - childrenList.add(new Property("notes", "string", "Any comments related to the goal.", 0, java.lang.Integer.MAX_VALUE, notes)); - childrenList.add(new Property("outcome", "", "Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved.", 0, java.lang.Integer.MAX_VALUE, outcome)); - } - - public Goal copy() { - Goal dst = new Goal(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - dst.targetDate = targetDate == null ? null : targetDate.copy(); - dst.description = description == null ? null : description.copy(); - dst.status = status == null ? null : status.copy(); - dst.statusDate = statusDate == null ? null : statusDate.copy(); - dst.author = author == null ? null : author.copy(); - dst.priority = priority == null ? null : priority.copy(); - if (concern != null) { - dst.concern = new ArrayList(); - for (Reference i : concern) - dst.concern.add(i.copy()); - }; - dst.notes = notes == null ? null : notes.copy(); - if (outcome != null) { - dst.outcome = new ArrayList(); - for (GoalOutcomeComponent i : outcome) - dst.outcome.add(i.copy()); - }; - return dst; - } - - protected Goal typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Goal)) - return false; - Goal o = (Goal) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(targetDate, o.targetDate, true) - && compareDeep(description, o.description, true) && compareDeep(status, o.status, true) && compareDeep(statusDate, o.statusDate, true) - && compareDeep(author, o.author, true) && compareDeep(priority, o.priority, true) && compareDeep(concern, o.concern, true) - && compareDeep(notes, o.notes, true) && compareDeep(outcome, o.outcome, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Goal)) - return false; - Goal o = (Goal) other; - return compareValues(targetDate, o.targetDate, true) && compareValues(description, o.description, true) - && compareValues(status, o.status, true) && compareValues(statusDate, o.statusDate, true) && compareValues(notes, o.notes, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) - && (targetDate == null || targetDate.isEmpty()) && (description == null || description.isEmpty()) - && (status == null || status.isEmpty()) && (statusDate == null || statusDate.isEmpty()) && (author == null || author.isEmpty()) - && (priority == null || priority.isEmpty()) && (concern == null || concern.isEmpty()) && (notes == null || notes.isEmpty()) - && (outcome == null || outcome.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Goal; - } - - @SearchParamDefinition(name="patient", path="Goal.patient", description="The patient for whom this goal is intended for", type="reference" ) - public static final String SP_PATIENT = "patient"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Describes the intended objective(s) of patient care, for example, weight loss, restoring an activity of daily living, etc. + */ +@ResourceDef(name="Goal", profile="http://hl7.org/fhir/Profile/Goal") +public class Goal extends DomainResource { + + public enum GoalStatus { + /** + * A goal is proposed for this patient. + */ + PROPOSED, + /** + * A goal is planned for this patient. + */ + PLANNED, + /** + * The goal is being sought but has not yet been reached. (Also applies if goal was reached in the past but there has been regression and goal is being sought again). + */ + INPROGRESS, + /** + * The goal has been met and no further action is needed. + */ + ACHIEVED, + /** + * The goal has been met, but ongoing activity is needed to sustain the goal objective. + */ + SUSTAINING, + /** + * The goal is no longer being sought. + */ + CANCELLED, + /** + * A proposed goal was accepted. + */ + ACCEPTED, + /** + * A proposed goal was rejected. + */ + REJECTED, + /** + * added to help the parsers + */ + NULL; + public static GoalStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("planned".equals(codeString)) + return PLANNED; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("achieved".equals(codeString)) + return ACHIEVED; + if ("sustaining".equals(codeString)) + return SUSTAINING; + if ("cancelled".equals(codeString)) + return CANCELLED; + if ("accepted".equals(codeString)) + return ACCEPTED; + if ("rejected".equals(codeString)) + return REJECTED; + throw new Exception("Unknown GoalStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROPOSED: return "proposed"; + case PLANNED: return "planned"; + case INPROGRESS: return "in-progress"; + case ACHIEVED: return "achieved"; + case SUSTAINING: return "sustaining"; + case CANCELLED: return "cancelled"; + case ACCEPTED: return "accepted"; + case REJECTED: return "rejected"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROPOSED: return ""; + case PLANNED: return ""; + case INPROGRESS: return ""; + case ACHIEVED: return ""; + case SUSTAINING: return ""; + case CANCELLED: return ""; + case ACCEPTED: return ""; + case REJECTED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROPOSED: return "A goal is proposed for this patient."; + case PLANNED: return "A goal is planned for this patient."; + case INPROGRESS: return "The goal is being sought but has not yet been reached. (Also applies if goal was reached in the past but there has been regression and goal is being sought again)."; + case ACHIEVED: return "The goal has been met and no further action is needed."; + case SUSTAINING: return "The goal has been met, but ongoing activity is needed to sustain the goal objective."; + case CANCELLED: return "The goal is no longer being sought."; + case ACCEPTED: return "A proposed goal was accepted."; + case REJECTED: return "A proposed goal was rejected."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROPOSED: return "Proposed"; + case PLANNED: return "Planned"; + case INPROGRESS: return "In Progress"; + case ACHIEVED: return "Achieved"; + case SUSTAINING: return "Sustaining"; + case CANCELLED: return "Cancelled"; + case ACCEPTED: return "Accepted"; + case REJECTED: return "Rejected"; + default: return "?"; + } + } + } + + public static class GoalStatusEnumFactory implements EnumFactory { + public GoalStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return GoalStatus.PROPOSED; + if ("planned".equals(codeString)) + return GoalStatus.PLANNED; + if ("in-progress".equals(codeString)) + return GoalStatus.INPROGRESS; + if ("achieved".equals(codeString)) + return GoalStatus.ACHIEVED; + if ("sustaining".equals(codeString)) + return GoalStatus.SUSTAINING; + if ("cancelled".equals(codeString)) + return GoalStatus.CANCELLED; + if ("accepted".equals(codeString)) + return GoalStatus.ACCEPTED; + if ("rejected".equals(codeString)) + return GoalStatus.REJECTED; + throw new IllegalArgumentException("Unknown GoalStatus code '"+codeString+"'"); + } + public String toCode(GoalStatus code) { + if (code == GoalStatus.PROPOSED) + return "proposed"; + if (code == GoalStatus.PLANNED) + return "planned"; + if (code == GoalStatus.INPROGRESS) + return "in-progress"; + if (code == GoalStatus.ACHIEVED) + return "achieved"; + if (code == GoalStatus.SUSTAINING) + return "sustaining"; + if (code == GoalStatus.CANCELLED) + return "cancelled"; + if (code == GoalStatus.ACCEPTED) + return "accepted"; + if (code == GoalStatus.REJECTED) + return "rejected"; + return "?"; + } + } + + @Block() + public static class GoalOutcomeComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Details of what's changed (or not changed). + */ + @Child(name = "result", type = {CodeableConcept.class, Observation.class}, order=1, min=0, max=1) + @Description(shortDefinition="Code or observation that resulted from gual", formalDefinition="Details of what's changed (or not changed)." ) + protected Type result; + + private static final long serialVersionUID = 1994317639L; + + /* + * Constructor + */ + public GoalOutcomeComponent() { + super(); + } + + /** + * @return {@link #result} (Details of what's changed (or not changed).) + */ + public Type getResult() { + return this.result; + } + + /** + * @return {@link #result} (Details of what's changed (or not changed).) + */ + public CodeableConcept getResultCodeableConcept() throws Exception { + if (!(this.result instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.result.getClass().getName()+" was encountered"); + return (CodeableConcept) this.result; + } + + /** + * @return {@link #result} (Details of what's changed (or not changed).) + */ + public Reference getResultReference() throws Exception { + if (!(this.result instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.result.getClass().getName()+" was encountered"); + return (Reference) this.result; + } + + public boolean hasResult() { + return this.result != null && !this.result.isEmpty(); + } + + /** + * @param value {@link #result} (Details of what's changed (or not changed).) + */ + public GoalOutcomeComponent setResult(Type value) { + this.result = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("result[x]", "CodeableConcept|Reference(Observation)", "Details of what's changed (or not changed).", 0, java.lang.Integer.MAX_VALUE, result)); + } + + public GoalOutcomeComponent copy() { + GoalOutcomeComponent dst = new GoalOutcomeComponent(); + copyValues(dst); + dst.result = result == null ? null : result.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof GoalOutcomeComponent)) + return false; + GoalOutcomeComponent o = (GoalOutcomeComponent) other; + return compareDeep(result, o.result, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof GoalOutcomeComponent)) + return false; + GoalOutcomeComponent o = (GoalOutcomeComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (result == null || result.isEmpty()); + } + + } + + /** + * This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Ids for this goal", formalDefinition="This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) + protected List identifier; + + /** + * Identifies the patient/subject whose intended care is described by the plan. + */ + @Child(name = "patient", type = {Patient.class}, order=1, min=0, max=1) + @Description(shortDefinition="The patient for whom this goal is intended for", formalDefinition="Identifies the patient/subject whose intended care is described by the plan." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Identifies the patient/subject whose intended care is described by the plan.) + */ + protected Patient patientTarget; + + /** + * Indicates when the goal is intended to be reached. + */ + @Child(name = "targetDate", type = {DateType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Reach goal on or before", formalDefinition="Indicates when the goal is intended to be reached." ) + protected DateType targetDate; + + /** + * Human-readable description of a specific desired objective of care. + */ + @Child(name = "description", type = {StringType.class}, order=3, min=1, max=1) + @Description(shortDefinition="What's the desired outcome?", formalDefinition="Human-readable description of a specific desired objective of care." ) + protected StringType description; + + /** + * Indicates whether the goal has been reached and is still considered relevant. + */ + @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1) + @Description(shortDefinition="proposed | planned | in-progress | achieved | sustaining | cancelled | accepted | rejected", formalDefinition="Indicates whether the goal has been reached and is still considered relevant." ) + protected Enumeration status; + + /** + * Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc. + */ + @Child(name = "statusDate", type = {DateType.class}, order=5, min=0, max=1) + @Description(shortDefinition="When goal status took effect", formalDefinition="Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc." ) + protected DateType statusDate; + + /** + * Indicates whose goal this is - patient goal, practitioner goal, etc. + */ + @Child(name = "author", type = {Patient.class, Practitioner.class, RelatedPerson.class}, order=6, min=0, max=1) + @Description(shortDefinition="Who's responsible for creating Goal?", formalDefinition="Indicates whose goal this is - patient goal, practitioner goal, etc." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (Indicates whose goal this is - patient goal, practitioner goal, etc.) + */ + protected Resource authorTarget; + + /** + * Identifies the level of importance associated with reaching/sustaining the goal. + */ + @Child(name = "priority", type = {CodeableConcept.class}, order=7, min=0, max=1) + @Description(shortDefinition="high | medium |low", formalDefinition="Identifies the level of importance associated with reaching/sustaining the goal." ) + protected CodeableConcept priority; + + /** + * The identified conditions and other health record elements that are intended to be addressed by the goal. + */ + @Child(name = "concern", type = {Condition.class, Observation.class, MedicationStatement.class, NutritionOrder.class, ProcedureRequest.class, RiskAssessment.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Health issues this goal addresses", formalDefinition="The identified conditions and other health record elements that are intended to be addressed by the goal." ) + protected List concern; + /** + * The actual objects that are the target of the reference (The identified conditions and other health record elements that are intended to be addressed by the goal.) + */ + protected List concernTarget; + + + /** + * Any comments related to the goal. + */ + @Child(name = "notes", type = {StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Comments about the goal", formalDefinition="Any comments related to the goal." ) + protected StringType notes; + + /** + * Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved. + */ + @Child(name = "outcome", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="What was end result of goal?", formalDefinition="Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved." ) + protected List outcome; + + private static final long serialVersionUID = -314822558L; + + /* + * Constructor + */ + public Goal() { + super(); + } + + /* + * Constructor + */ + public Goal(StringType description, Enumeration status) { + super(); + this.description = description; + this.status = status; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Goal addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Goal.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.) + */ + public Goal setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Goal.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.) + */ + public Goal setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #targetDate} (Indicates when the goal is intended to be reached.). This is the underlying object with id, value and extensions. The accessor "getTargetDate" gives direct access to the value + */ + public DateType getTargetDateElement() { + if (this.targetDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Goal.targetDate"); + else if (Configuration.doAutoCreate()) + this.targetDate = new DateType(); // bb + return this.targetDate; + } + + public boolean hasTargetDateElement() { + return this.targetDate != null && !this.targetDate.isEmpty(); + } + + public boolean hasTargetDate() { + return this.targetDate != null && !this.targetDate.isEmpty(); + } + + /** + * @param value {@link #targetDate} (Indicates when the goal is intended to be reached.). This is the underlying object with id, value and extensions. The accessor "getTargetDate" gives direct access to the value + */ + public Goal setTargetDateElement(DateType value) { + this.targetDate = value; + return this; + } + + /** + * @return Indicates when the goal is intended to be reached. + */ + public Date getTargetDate() { + return this.targetDate == null ? null : this.targetDate.getValue(); + } + + /** + * @param value Indicates when the goal is intended to be reached. + */ + public Goal setTargetDate(Date value) { + if (value == null) + this.targetDate = null; + else { + if (this.targetDate == null) + this.targetDate = new DateType(); + this.targetDate.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (Human-readable description of a specific desired objective of care.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Goal.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Human-readable description of a specific desired objective of care.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public Goal setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Human-readable description of a specific desired objective of care. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Human-readable description of a specific desired objective of care. + */ + public Goal setDescription(String value) { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + return this; + } + + /** + * @return {@link #status} (Indicates whether the goal has been reached and is still considered relevant.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Goal.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new GoalStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (Indicates whether the goal has been reached and is still considered relevant.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Goal setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Indicates whether the goal has been reached and is still considered relevant. + */ + public GoalStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Indicates whether the goal has been reached and is still considered relevant. + */ + public Goal setStatus(GoalStatus value) { + if (this.status == null) + this.status = new Enumeration(new GoalStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #statusDate} (Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value + */ + public DateType getStatusDateElement() { + if (this.statusDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Goal.statusDate"); + else if (Configuration.doAutoCreate()) + this.statusDate = new DateType(); // bb + return this.statusDate; + } + + public boolean hasStatusDateElement() { + return this.statusDate != null && !this.statusDate.isEmpty(); + } + + public boolean hasStatusDate() { + return this.statusDate != null && !this.statusDate.isEmpty(); + } + + /** + * @param value {@link #statusDate} (Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value + */ + public Goal setStatusDateElement(DateType value) { + this.statusDate = value; + return this; + } + + /** + * @return Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc. + */ + public Date getStatusDate() { + return this.statusDate == null ? null : this.statusDate.getValue(); + } + + /** + * @param value Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc. + */ + public Goal setStatusDate(Date value) { + if (value == null) + this.statusDate = null; + else { + if (this.statusDate == null) + this.statusDate = new DateType(); + this.statusDate.setValue(value); + } + return this; + } + + /** + * @return {@link #author} (Indicates whose goal this is - patient goal, practitioner goal, etc.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Goal.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); // cc + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Indicates whose goal this is - patient goal, practitioner goal, etc.) + */ + public Goal setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates whose goal this is - patient goal, practitioner goal, etc.) + */ + public Resource getAuthorTarget() { + return this.authorTarget; + } + + /** + * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates whose goal this is - patient goal, practitioner goal, etc.) + */ + public Goal setAuthorTarget(Resource value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #priority} (Identifies the level of importance associated with reaching/sustaining the goal.) + */ + public CodeableConcept getPriority() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Goal.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new CodeableConcept(); // cc + return this.priority; + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Identifies the level of importance associated with reaching/sustaining the goal.) + */ + public Goal setPriority(CodeableConcept value) { + this.priority = value; + return this; + } + + /** + * @return {@link #concern} (The identified conditions and other health record elements that are intended to be addressed by the goal.) + */ + public List getConcern() { + if (this.concern == null) + this.concern = new ArrayList(); + return this.concern; + } + + public boolean hasConcern() { + if (this.concern == null) + return false; + for (Reference item : this.concern) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concern} (The identified conditions and other health record elements that are intended to be addressed by the goal.) + */ + // syntactic sugar + public Reference addConcern() { //3 + Reference t = new Reference(); + if (this.concern == null) + this.concern = new ArrayList(); + this.concern.add(t); + return t; + } + + // syntactic sugar + public Goal addConcern(Reference t) { //3 + if (t == null) + return this; + if (this.concern == null) + this.concern = new ArrayList(); + this.concern.add(t); + return this; + } + + /** + * @return {@link #concern} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The identified conditions and other health record elements that are intended to be addressed by the goal.) + */ + public List getConcernTarget() { + if (this.concernTarget == null) + this.concernTarget = new ArrayList(); + return this.concernTarget; + } + + /** + * @return {@link #notes} (Any comments related to the goal.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public StringType getNotesElement() { + if (this.notes == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Goal.notes"); + else if (Configuration.doAutoCreate()) + this.notes = new StringType(); // bb + return this.notes; + } + + public boolean hasNotesElement() { + return this.notes != null && !this.notes.isEmpty(); + } + + public boolean hasNotes() { + return this.notes != null && !this.notes.isEmpty(); + } + + /** + * @param value {@link #notes} (Any comments related to the goal.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public Goal setNotesElement(StringType value) { + this.notes = value; + return this; + } + + /** + * @return Any comments related to the goal. + */ + public String getNotes() { + return this.notes == null ? null : this.notes.getValue(); + } + + /** + * @param value Any comments related to the goal. + */ + public Goal setNotes(String value) { + if (Utilities.noString(value)) + this.notes = null; + else { + if (this.notes == null) + this.notes = new StringType(); + this.notes.setValue(value); + } + return this; + } + + /** + * @return {@link #outcome} (Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved.) + */ + public List getOutcome() { + if (this.outcome == null) + this.outcome = new ArrayList(); + return this.outcome; + } + + public boolean hasOutcome() { + if (this.outcome == null) + return false; + for (GoalOutcomeComponent item : this.outcome) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #outcome} (Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved.) + */ + // syntactic sugar + public GoalOutcomeComponent addOutcome() { //3 + GoalOutcomeComponent t = new GoalOutcomeComponent(); + if (this.outcome == null) + this.outcome = new ArrayList(); + this.outcome.add(t); + return t; + } + + // syntactic sugar + public Goal addOutcome(GoalOutcomeComponent t) { //3 + if (t == null) + return this; + if (this.outcome == null) + this.outcome = new ArrayList(); + this.outcome.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("patient", "Reference(Patient)", "Identifies the patient/subject whose intended care is described by the plan.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("targetDate", "date", "Indicates when the goal is intended to be reached.", 0, java.lang.Integer.MAX_VALUE, targetDate)); + childrenList.add(new Property("description", "string", "Human-readable description of a specific desired objective of care.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("status", "code", "Indicates whether the goal has been reached and is still considered relevant.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("statusDate", "date", "Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc.", 0, java.lang.Integer.MAX_VALUE, statusDate)); + childrenList.add(new Property("author", "Reference(Patient|Practitioner|RelatedPerson)", "Indicates whose goal this is - patient goal, practitioner goal, etc.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("priority", "CodeableConcept", "Identifies the level of importance associated with reaching/sustaining the goal.", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("concern", "Reference(Condition|Observation|MedicationStatement|NutritionOrder|ProcedureRequest|RiskAssessment)", "The identified conditions and other health record elements that are intended to be addressed by the goal.", 0, java.lang.Integer.MAX_VALUE, concern)); + childrenList.add(new Property("notes", "string", "Any comments related to the goal.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("outcome", "", "Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved.", 0, java.lang.Integer.MAX_VALUE, outcome)); + } + + public Goal copy() { + Goal dst = new Goal(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + dst.targetDate = targetDate == null ? null : targetDate.copy(); + dst.description = description == null ? null : description.copy(); + dst.status = status == null ? null : status.copy(); + dst.statusDate = statusDate == null ? null : statusDate.copy(); + dst.author = author == null ? null : author.copy(); + dst.priority = priority == null ? null : priority.copy(); + if (concern != null) { + dst.concern = new ArrayList(); + for (Reference i : concern) + dst.concern.add(i.copy()); + }; + dst.notes = notes == null ? null : notes.copy(); + if (outcome != null) { + dst.outcome = new ArrayList(); + for (GoalOutcomeComponent i : outcome) + dst.outcome.add(i.copy()); + }; + return dst; + } + + protected Goal typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Goal)) + return false; + Goal o = (Goal) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(targetDate, o.targetDate, true) + && compareDeep(description, o.description, true) && compareDeep(status, o.status, true) && compareDeep(statusDate, o.statusDate, true) + && compareDeep(author, o.author, true) && compareDeep(priority, o.priority, true) && compareDeep(concern, o.concern, true) + && compareDeep(notes, o.notes, true) && compareDeep(outcome, o.outcome, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Goal)) + return false; + Goal o = (Goal) other; + return compareValues(targetDate, o.targetDate, true) && compareValues(description, o.description, true) + && compareValues(status, o.status, true) && compareValues(statusDate, o.statusDate, true) && compareValues(notes, o.notes, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) + && (targetDate == null || targetDate.isEmpty()) && (description == null || description.isEmpty()) + && (status == null || status.isEmpty()) && (statusDate == null || statusDate.isEmpty()) && (author == null || author.isEmpty()) + && (priority == null || priority.isEmpty()) && (concern == null || concern.isEmpty()) && (notes == null || notes.isEmpty()) + && (outcome == null || outcome.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Goal; + } + + @SearchParamDefinition(name="patient", path="Goal.patient", description="The patient for whom this goal is intended for", type="reference" ) + public static final String SP_PATIENT = "patient"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Group.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Group.java index cb0981dcce3..d8ae5a4d575 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Group.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Group.java @@ -1,901 +1,880 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized. I.e. A collection of entities that isn't an Organization. - */ -@ResourceDef(name="Group", profile="http://hl7.org/fhir/Profile/Group") -public class Group extends DomainResource { - - public enum GroupType { - /** - * Group contains "person" Patient resources. - */ - PERSON, - /** - * Group contains "animal" Patient resources. - */ - ANIMAL, - /** - * Group contains healthcare practitioner resources. - */ - PRACTITIONER, - /** - * Group contains Device resources. - */ - DEVICE, - /** - * Group contains Medication resources. - */ - MEDICATION, - /** - * Group contains Substance resources. - */ - SUBSTANCE, - /** - * added to help the parsers - */ - NULL; - public static GroupType fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("person".equals(codeString)) - return PERSON; - if ("animal".equals(codeString)) - return ANIMAL; - if ("practitioner".equals(codeString)) - return PRACTITIONER; - if ("device".equals(codeString)) - return DEVICE; - if ("medication".equals(codeString)) - return MEDICATION; - if ("substance".equals(codeString)) - return SUBSTANCE; - throw new Exception("Unknown GroupType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PERSON: return "person"; - case ANIMAL: return "animal"; - case PRACTITIONER: return "practitioner"; - case DEVICE: return "device"; - case MEDICATION: return "medication"; - case SUBSTANCE: return "substance"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PERSON: return ""; - case ANIMAL: return ""; - case PRACTITIONER: return ""; - case DEVICE: return ""; - case MEDICATION: return ""; - case SUBSTANCE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PERSON: return "Group contains 'person' Patient resources."; - case ANIMAL: return "Group contains 'animal' Patient resources."; - case PRACTITIONER: return "Group contains healthcare practitioner resources."; - case DEVICE: return "Group contains Device resources."; - case MEDICATION: return "Group contains Medication resources."; - case SUBSTANCE: return "Group contains Substance resources."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PERSON: return "Person"; - case ANIMAL: return "Animal"; - case PRACTITIONER: return "Practitioner"; - case DEVICE: return "Device"; - case MEDICATION: return "Medication"; - case SUBSTANCE: return "Substance"; - default: return "?"; - } - } - } - - public static class GroupTypeEnumFactory implements EnumFactory { - public GroupType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("person".equals(codeString)) - return GroupType.PERSON; - if ("animal".equals(codeString)) - return GroupType.ANIMAL; - if ("practitioner".equals(codeString)) - return GroupType.PRACTITIONER; - if ("device".equals(codeString)) - return GroupType.DEVICE; - if ("medication".equals(codeString)) - return GroupType.MEDICATION; - if ("substance".equals(codeString)) - return GroupType.SUBSTANCE; - throw new IllegalArgumentException("Unknown GroupType code '"+codeString+"'"); - } - public String toCode(GroupType code) { - if (code == GroupType.PERSON) - return "person"; - if (code == GroupType.ANIMAL) - return "animal"; - if (code == GroupType.PRACTITIONER) - return "practitioner"; - if (code == GroupType.DEVICE) - return "device"; - if (code == GroupType.MEDICATION) - return "medication"; - if (code == GroupType.SUBSTANCE) - return "substance"; - return "?"; - } - } - - @Block() - public static class GroupCharacteristicComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A code that identifies the kind of trait being asserted. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Kind of characteristic", formalDefinition="A code that identifies the kind of trait being asserted." ) - protected CodeableConcept code; - - /** - * The value of the trait that holds (or does not hold - see 'exclude') for members of the group. - */ - @Child(name = "value", type = {CodeableConcept.class, BooleanType.class, Quantity.class, Range.class}, order=2, min=1, max=1) - @Description(shortDefinition="Value held by characteristic", formalDefinition="The value of the trait that holds (or does not hold - see 'exclude') for members of the group." ) - protected Type value; - - /** - * If true, indicates the characteristic is one that is NOT held by members of the group. - */ - @Child(name = "exclude", type = {BooleanType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Group includes or excludes", formalDefinition="If true, indicates the characteristic is one that is NOT held by members of the group." ) - protected BooleanType exclude; - - private static final long serialVersionUID = 803478031L; - - /* - * Constructor - */ - public GroupCharacteristicComponent() { - super(); - } - - /* - * Constructor - */ - public GroupCharacteristicComponent(CodeableConcept code, Type value, BooleanType exclude) { - super(); - this.code = code; - this.value = value; - this.exclude = exclude; - } - - /** - * @return {@link #code} (A code that identifies the kind of trait being asserted.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupCharacteristicComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A code that identifies the kind of trait being asserted.) - */ - public GroupCharacteristicComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) - */ - public Type getValue() { - return this.value; - } - - /** - * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) - */ - public CodeableConcept getValueCodeableConcept() throws Exception { - if (!(this.value instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered"); - return (CodeableConcept) this.value; - } - - /** - * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) - */ - public BooleanType getValueBooleanType() throws Exception { - if (!(this.value instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (BooleanType) this.value; - } - - /** - * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) - */ - public Quantity getValueQuantity() throws Exception { - if (!(this.value instanceof Quantity)) - throw new Exception("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Quantity) this.value; - } - - /** - * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) - */ - public Range getValueRange() throws Exception { - if (!(this.value instanceof Range)) - throw new Exception("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Range) this.value; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) - */ - public GroupCharacteristicComponent setValue(Type value) { - this.value = value; - return this; - } - - /** - * @return {@link #exclude} (If true, indicates the characteristic is one that is NOT held by members of the group.). This is the underlying object with id, value and extensions. The accessor "getExclude" gives direct access to the value - */ - public BooleanType getExcludeElement() { - if (this.exclude == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupCharacteristicComponent.exclude"); - else if (Configuration.doAutoCreate()) - this.exclude = new BooleanType(); // bb - return this.exclude; - } - - public boolean hasExcludeElement() { - return this.exclude != null && !this.exclude.isEmpty(); - } - - public boolean hasExclude() { - return this.exclude != null && !this.exclude.isEmpty(); - } - - /** - * @param value {@link #exclude} (If true, indicates the characteristic is one that is NOT held by members of the group.). This is the underlying object with id, value and extensions. The accessor "getExclude" gives direct access to the value - */ - public GroupCharacteristicComponent setExcludeElement(BooleanType value) { - this.exclude = value; - return this; - } - - /** - * @return If true, indicates the characteristic is one that is NOT held by members of the group. - */ - public boolean getExclude() { - return this.exclude == null || this.exclude.isEmpty() ? false : this.exclude.getValue(); - } - - /** - * @param value If true, indicates the characteristic is one that is NOT held by members of the group. - */ - public GroupCharacteristicComponent setExclude(boolean value) { - if (this.exclude == null) - this.exclude = new BooleanType(); - this.exclude.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "A code that identifies the kind of trait being asserted.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("value[x]", "CodeableConcept|boolean|Quantity|Range", "The value of the trait that holds (or does not hold - see 'exclude') for members of the group.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("exclude", "boolean", "If true, indicates the characteristic is one that is NOT held by members of the group.", 0, java.lang.Integer.MAX_VALUE, exclude)); - } - - public GroupCharacteristicComponent copy() { - GroupCharacteristicComponent dst = new GroupCharacteristicComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.value = value == null ? null : value.copy(); - dst.exclude = exclude == null ? null : exclude.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof GroupCharacteristicComponent)) - return false; - GroupCharacteristicComponent o = (GroupCharacteristicComponent) other; - return compareDeep(code, o.code, true) && compareDeep(value, o.value, true) && compareDeep(exclude, o.exclude, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof GroupCharacteristicComponent)) - return false; - GroupCharacteristicComponent o = (GroupCharacteristicComponent) other; - return compareValues(exclude, o.exclude, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (value == null || value.isEmpty()) - && (exclude == null || exclude.isEmpty()); - } - - } - - /** - * A unique business identifier for this group. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1) - @Description(shortDefinition="Unique id", formalDefinition="A unique business identifier for this group." ) - protected Identifier identifier; - - /** - * Identifies the broad classification of the kind of resources the group includes. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="person | animal | practitioner | device | medication | substance", formalDefinition="Identifies the broad classification of the kind of resources the group includes." ) - protected Enumeration type; - - /** - * If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals. - */ - @Child(name = "actual", type = {BooleanType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Descriptive or actual", formalDefinition="If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals." ) - protected BooleanType actual; - - /** - * Provides a specific type of resource the group includes. E.g. "cow", "syringe", etc. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Kind of Group members", formalDefinition="Provides a specific type of resource the group includes. E.g. 'cow', 'syringe', etc." ) - protected CodeableConcept code; - - /** - * A label assigned to the group for human identification and communication. - */ - @Child(name = "name", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Label for Group", formalDefinition="A label assigned to the group for human identification and communication." ) - protected StringType name; - - /** - * A count of the number of resource instances that are part of the group. - */ - @Child(name = "quantity", type = {UnsignedIntType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Number of members", formalDefinition="A count of the number of resource instances that are part of the group." ) - protected UnsignedIntType quantity; - - /** - * Identifies the traits shared by members of the group. - */ - @Child(name = "characteristic", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Trait of group members", formalDefinition="Identifies the traits shared by members of the group." ) - protected List characteristic; - - /** - * Identifies the resource instances that are members of the group. - */ - @Child(name = "member", type = {Patient.class, Practitioner.class, Device.class, Medication.class, Substance.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who or what is in group", formalDefinition="Identifies the resource instances that are members of the group." ) - protected List member; - /** - * The actual objects that are the target of the reference (Identifies the resource instances that are members of the group.) - */ - protected List memberTarget; - - - private static final long serialVersionUID = -1024529199L; - - /* - * Constructor - */ - public Group() { - super(); - } - - /* - * Constructor - */ - public Group(Enumeration type, BooleanType actual) { - super(); - this.type = type; - this.actual = actual; - } - - /** - * @return {@link #identifier} (A unique business identifier for this group.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Group.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (A unique business identifier for this group.) - */ - public Group setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #type} (Identifies the broad classification of the kind of resources the group includes.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Group.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new GroupTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Identifies the broad classification of the kind of resources the group includes.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Group setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Identifies the broad classification of the kind of resources the group includes. - */ - public GroupType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Identifies the broad classification of the kind of resources the group includes. - */ - public Group setType(GroupType value) { - if (this.type == null) - this.type = new Enumeration(new GroupTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #actual} (If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value - */ - public BooleanType getActualElement() { - if (this.actual == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Group.actual"); - else if (Configuration.doAutoCreate()) - this.actual = new BooleanType(); // bb - return this.actual; - } - - public boolean hasActualElement() { - return this.actual != null && !this.actual.isEmpty(); - } - - public boolean hasActual() { - return this.actual != null && !this.actual.isEmpty(); - } - - /** - * @param value {@link #actual} (If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value - */ - public Group setActualElement(BooleanType value) { - this.actual = value; - return this; - } - - /** - * @return If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals. - */ - public boolean getActual() { - return this.actual == null || this.actual.isEmpty() ? false : this.actual.getValue(); - } - - /** - * @param value If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals. - */ - public Group setActual(boolean value) { - if (this.actual == null) - this.actual = new BooleanType(); - this.actual.setValue(value); - return this; - } - - /** - * @return {@link #code} (Provides a specific type of resource the group includes. E.g. "cow", "syringe", etc.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Group.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Provides a specific type of resource the group includes. E.g. "cow", "syringe", etc.) - */ - public Group setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #name} (A label assigned to the group for human identification and communication.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Group.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A label assigned to the group for human identification and communication.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public Group setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A label assigned to the group for human identification and communication. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A label assigned to the group for human identification and communication. - */ - public Group setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #quantity} (A count of the number of resource instances that are part of the group.). This is the underlying object with id, value and extensions. The accessor "getQuantity" gives direct access to the value - */ - public UnsignedIntType getQuantityElement() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Group.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new UnsignedIntType(); // bb - return this.quantity; - } - - public boolean hasQuantityElement() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (A count of the number of resource instances that are part of the group.). This is the underlying object with id, value and extensions. The accessor "getQuantity" gives direct access to the value - */ - public Group setQuantityElement(UnsignedIntType value) { - this.quantity = value; - return this; - } - - /** - * @return A count of the number of resource instances that are part of the group. - */ - public int getQuantity() { - return this.quantity == null || this.quantity.isEmpty() ? 0 : this.quantity.getValue(); - } - - /** - * @param value A count of the number of resource instances that are part of the group. - */ - public Group setQuantity(int value) { - if (this.quantity == null) - this.quantity = new UnsignedIntType(); - this.quantity.setValue(value); - return this; - } - - /** - * @return {@link #characteristic} (Identifies the traits shared by members of the group.) - */ - public List getCharacteristic() { - if (this.characteristic == null) - this.characteristic = new ArrayList(); - return this.characteristic; - } - - public boolean hasCharacteristic() { - if (this.characteristic == null) - return false; - for (GroupCharacteristicComponent item : this.characteristic) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #characteristic} (Identifies the traits shared by members of the group.) - */ - // syntactic sugar - public GroupCharacteristicComponent addCharacteristic() { //3 - GroupCharacteristicComponent t = new GroupCharacteristicComponent(); - if (this.characteristic == null) - this.characteristic = new ArrayList(); - this.characteristic.add(t); - return t; - } - - // syntactic sugar - public Group addCharacteristic(GroupCharacteristicComponent t) { //3 - if (t == null) - return this; - if (this.characteristic == null) - this.characteristic = new ArrayList(); - this.characteristic.add(t); - return this; - } - - /** - * @return {@link #member} (Identifies the resource instances that are members of the group.) - */ - public List getMember() { - if (this.member == null) - this.member = new ArrayList(); - return this.member; - } - - public boolean hasMember() { - if (this.member == null) - return false; - for (Reference item : this.member) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #member} (Identifies the resource instances that are members of the group.) - */ - // syntactic sugar - public Reference addMember() { //3 - Reference t = new Reference(); - if (this.member == null) - this.member = new ArrayList(); - this.member.add(t); - return t; - } - - // syntactic sugar - public Group addMember(Reference t) { //3 - if (t == null) - return this; - if (this.member == null) - this.member = new ArrayList(); - this.member.add(t); - return this; - } - - /** - * @return {@link #member} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies the resource instances that are members of the group.) - */ - public List getMemberTarget() { - if (this.memberTarget == null) - this.memberTarget = new ArrayList(); - return this.memberTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "A unique business identifier for this group.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("type", "code", "Identifies the broad classification of the kind of resources the group includes.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("actual", "boolean", "If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals.", 0, java.lang.Integer.MAX_VALUE, actual)); - childrenList.add(new Property("code", "CodeableConcept", "Provides a specific type of resource the group includes. E.g. 'cow', 'syringe', etc.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("name", "string", "A label assigned to the group for human identification and communication.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("quantity", "unsignedInt", "A count of the number of resource instances that are part of the group.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("characteristic", "", "Identifies the traits shared by members of the group.", 0, java.lang.Integer.MAX_VALUE, characteristic)); - childrenList.add(new Property("member", "Reference(Patient|Practitioner|Device|Medication|Substance)", "Identifies the resource instances that are members of the group.", 0, java.lang.Integer.MAX_VALUE, member)); - } - - public Group copy() { - Group dst = new Group(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.type = type == null ? null : type.copy(); - dst.actual = actual == null ? null : actual.copy(); - dst.code = code == null ? null : code.copy(); - dst.name = name == null ? null : name.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - if (characteristic != null) { - dst.characteristic = new ArrayList(); - for (GroupCharacteristicComponent i : characteristic) - dst.characteristic.add(i.copy()); - }; - if (member != null) { - dst.member = new ArrayList(); - for (Reference i : member) - dst.member.add(i.copy()); - }; - return dst; - } - - protected Group typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Group)) - return false; - Group o = (Group) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(actual, o.actual, true) - && compareDeep(code, o.code, true) && compareDeep(name, o.name, true) && compareDeep(quantity, o.quantity, true) - && compareDeep(characteristic, o.characteristic, true) && compareDeep(member, o.member, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Group)) - return false; - Group o = (Group) other; - return compareValues(type, o.type, true) && compareValues(actual, o.actual, true) && compareValues(name, o.name, true) - && compareValues(quantity, o.quantity, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) - && (actual == null || actual.isEmpty()) && (code == null || code.isEmpty()) && (name == null || name.isEmpty()) - && (quantity == null || quantity.isEmpty()) && (characteristic == null || characteristic.isEmpty()) - && (member == null || member.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Group; - } - - @SearchParamDefinition(name="member", path="Group.member", description="Who or what is in group", type="reference" ) - public static final String SP_MEMBER = "member"; - @SearchParamDefinition(name="characteristic-value", path="", description="A composite of both characteristic and value", type="composite" ) - public static final String SP_CHARACTERISTICVALUE = "characteristic-value"; - @SearchParamDefinition(name="value", path="Group.characteristic.value[x]", description="Value held by characteristic", type="token" ) - public static final String SP_VALUE = "value"; - @SearchParamDefinition(name="actual", path="Group.actual", description="Descriptive or actual", type="token" ) - public static final String SP_ACTUAL = "actual"; - @SearchParamDefinition(name="exclude", path="Group.characteristic.exclude", description="Group includes or excludes", type="token" ) - public static final String SP_EXCLUDE = "exclude"; - @SearchParamDefinition(name="code", path="Group.code", description="The kind of resources contained", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="characteristic", path="Group.characteristic.code", description="Kind of characteristic", type="token" ) - public static final String SP_CHARACTERISTIC = "characteristic"; - @SearchParamDefinition(name="type", path="Group.type", description="The type of resources the group contains", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="identifier", path="Group.identifier", description="Unique id", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized. I.e. A collection of entities that isn't an Organization. + */ +@ResourceDef(name="Group", profile="http://hl7.org/fhir/Profile/Group") +public class Group extends DomainResource { + + public enum GroupType { + /** + * Group contains "person" Patient resources. + */ + PERSON, + /** + * Group contains "animal" Patient resources. + */ + ANIMAL, + /** + * Group contains healthcare practitioner resources. + */ + PRACTITIONER, + /** + * Group contains Device resources. + */ + DEVICE, + /** + * Group contains Medication resources. + */ + MEDICATION, + /** + * Group contains Substance resources. + */ + SUBSTANCE, + /** + * added to help the parsers + */ + NULL; + public static GroupType fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("person".equals(codeString)) + return PERSON; + if ("animal".equals(codeString)) + return ANIMAL; + if ("practitioner".equals(codeString)) + return PRACTITIONER; + if ("device".equals(codeString)) + return DEVICE; + if ("medication".equals(codeString)) + return MEDICATION; + if ("substance".equals(codeString)) + return SUBSTANCE; + throw new Exception("Unknown GroupType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PERSON: return "person"; + case ANIMAL: return "animal"; + case PRACTITIONER: return "practitioner"; + case DEVICE: return "device"; + case MEDICATION: return "medication"; + case SUBSTANCE: return "substance"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PERSON: return ""; + case ANIMAL: return ""; + case PRACTITIONER: return ""; + case DEVICE: return ""; + case MEDICATION: return ""; + case SUBSTANCE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PERSON: return "Group contains 'person' Patient resources."; + case ANIMAL: return "Group contains 'animal' Patient resources."; + case PRACTITIONER: return "Group contains healthcare practitioner resources."; + case DEVICE: return "Group contains Device resources."; + case MEDICATION: return "Group contains Medication resources."; + case SUBSTANCE: return "Group contains Substance resources."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PERSON: return "Person"; + case ANIMAL: return "Animal"; + case PRACTITIONER: return "Practitioner"; + case DEVICE: return "Device"; + case MEDICATION: return "Medication"; + case SUBSTANCE: return "Substance"; + default: return "?"; + } + } + } + + public static class GroupTypeEnumFactory implements EnumFactory { + public GroupType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("person".equals(codeString)) + return GroupType.PERSON; + if ("animal".equals(codeString)) + return GroupType.ANIMAL; + if ("practitioner".equals(codeString)) + return GroupType.PRACTITIONER; + if ("device".equals(codeString)) + return GroupType.DEVICE; + if ("medication".equals(codeString)) + return GroupType.MEDICATION; + if ("substance".equals(codeString)) + return GroupType.SUBSTANCE; + throw new IllegalArgumentException("Unknown GroupType code '"+codeString+"'"); + } + public String toCode(GroupType code) { + if (code == GroupType.PERSON) + return "person"; + if (code == GroupType.ANIMAL) + return "animal"; + if (code == GroupType.PRACTITIONER) + return "practitioner"; + if (code == GroupType.DEVICE) + return "device"; + if (code == GroupType.MEDICATION) + return "medication"; + if (code == GroupType.SUBSTANCE) + return "substance"; + return "?"; + } + } + + @Block() + public static class GroupCharacteristicComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A code that identifies the kind of trait being asserted. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Kind of characteristic", formalDefinition="A code that identifies the kind of trait being asserted." ) + protected CodeableConcept code; + + /** + * The value of the trait that holds (or does not hold - see 'exclude') for members of the group. + */ + @Child(name = "value", type = {CodeableConcept.class, BooleanType.class, Quantity.class, Range.class}, order=2, min=1, max=1) + @Description(shortDefinition="Value held by characteristic", formalDefinition="The value of the trait that holds (or does not hold - see 'exclude') for members of the group." ) + protected Type value; + + /** + * If true, indicates the characteristic is one that is NOT held by members of the group. + */ + @Child(name = "exclude", type = {BooleanType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Group includes or excludes", formalDefinition="If true, indicates the characteristic is one that is NOT held by members of the group." ) + protected BooleanType exclude; + + private static final long serialVersionUID = 803478031L; + + /* + * Constructor + */ + public GroupCharacteristicComponent() { + super(); + } + + /* + * Constructor + */ + public GroupCharacteristicComponent(CodeableConcept code, Type value, BooleanType exclude) { + super(); + this.code = code; + this.value = value; + this.exclude = exclude; + } + + /** + * @return {@link #code} (A code that identifies the kind of trait being asserted.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupCharacteristicComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A code that identifies the kind of trait being asserted.) + */ + public GroupCharacteristicComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) + */ + public Type getValue() { + return this.value; + } + + /** + * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) + */ + public CodeableConcept getValueCodeableConcept() throws Exception { + if (!(this.value instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered"); + return (CodeableConcept) this.value; + } + + /** + * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) + */ + public BooleanType getValueBooleanType() throws Exception { + if (!(this.value instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (BooleanType) this.value; + } + + /** + * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) + */ + public Quantity getValueQuantity() throws Exception { + if (!(this.value instanceof Quantity)) + throw new Exception("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Quantity) this.value; + } + + /** + * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) + */ + public Range getValueRange() throws Exception { + if (!(this.value instanceof Range)) + throw new Exception("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Range) this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) + */ + public GroupCharacteristicComponent setValue(Type value) { + this.value = value; + return this; + } + + /** + * @return {@link #exclude} (If true, indicates the characteristic is one that is NOT held by members of the group.). This is the underlying object with id, value and extensions. The accessor "getExclude" gives direct access to the value + */ + public BooleanType getExcludeElement() { + if (this.exclude == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupCharacteristicComponent.exclude"); + else if (Configuration.doAutoCreate()) + this.exclude = new BooleanType(); // bb + return this.exclude; + } + + public boolean hasExcludeElement() { + return this.exclude != null && !this.exclude.isEmpty(); + } + + public boolean hasExclude() { + return this.exclude != null && !this.exclude.isEmpty(); + } + + /** + * @param value {@link #exclude} (If true, indicates the characteristic is one that is NOT held by members of the group.). This is the underlying object with id, value and extensions. The accessor "getExclude" gives direct access to the value + */ + public GroupCharacteristicComponent setExcludeElement(BooleanType value) { + this.exclude = value; + return this; + } + + /** + * @return If true, indicates the characteristic is one that is NOT held by members of the group. + */ + public boolean getExclude() { + return this.exclude == null || this.exclude.isEmpty() ? false : this.exclude.getValue(); + } + + /** + * @param value If true, indicates the characteristic is one that is NOT held by members of the group. + */ + public GroupCharacteristicComponent setExclude(boolean value) { + if (this.exclude == null) + this.exclude = new BooleanType(); + this.exclude.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "A code that identifies the kind of trait being asserted.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("value[x]", "CodeableConcept|boolean|Quantity|Range", "The value of the trait that holds (or does not hold - see 'exclude') for members of the group.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("exclude", "boolean", "If true, indicates the characteristic is one that is NOT held by members of the group.", 0, java.lang.Integer.MAX_VALUE, exclude)); + } + + public GroupCharacteristicComponent copy() { + GroupCharacteristicComponent dst = new GroupCharacteristicComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.value = value == null ? null : value.copy(); + dst.exclude = exclude == null ? null : exclude.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof GroupCharacteristicComponent)) + return false; + GroupCharacteristicComponent o = (GroupCharacteristicComponent) other; + return compareDeep(code, o.code, true) && compareDeep(value, o.value, true) && compareDeep(exclude, o.exclude, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof GroupCharacteristicComponent)) + return false; + GroupCharacteristicComponent o = (GroupCharacteristicComponent) other; + return compareValues(exclude, o.exclude, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (value == null || value.isEmpty()) + && (exclude == null || exclude.isEmpty()); + } + + } + + /** + * A unique business identifier for this group. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1) + @Description(shortDefinition="Unique id", formalDefinition="A unique business identifier for this group." ) + protected Identifier identifier; + + /** + * Identifies the broad classification of the kind of resources the group includes. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="person | animal | practitioner | device | medication | substance", formalDefinition="Identifies the broad classification of the kind of resources the group includes." ) + protected Enumeration type; + + /** + * If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals. + */ + @Child(name = "actual", type = {BooleanType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Descriptive or actual", formalDefinition="If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals." ) + protected BooleanType actual; + + /** + * Provides a specific type of resource the group includes. E.g. "cow", "syringe", etc. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Kind of Group members", formalDefinition="Provides a specific type of resource the group includes. E.g. 'cow', 'syringe', etc." ) + protected CodeableConcept code; + + /** + * A label assigned to the group for human identification and communication. + */ + @Child(name = "name", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Label for Group", formalDefinition="A label assigned to the group for human identification and communication." ) + protected StringType name; + + /** + * A count of the number of resource instances that are part of the group. + */ + @Child(name = "quantity", type = {UnsignedIntType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Number of members", formalDefinition="A count of the number of resource instances that are part of the group." ) + protected UnsignedIntType quantity; + + /** + * Identifies the traits shared by members of the group. + */ + @Child(name = "characteristic", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Trait of group members", formalDefinition="Identifies the traits shared by members of the group." ) + protected List characteristic; + + /** + * Identifies the resource instances that are members of the group. + */ + @Child(name = "member", type = {Patient.class, Practitioner.class, Device.class, Medication.class, Substance.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who or what is in group", formalDefinition="Identifies the resource instances that are members of the group." ) + protected List member; + /** + * The actual objects that are the target of the reference (Identifies the resource instances that are members of the group.) + */ + protected List memberTarget; + + + private static final long serialVersionUID = -1024529199L; + + /* + * Constructor + */ + public Group() { + super(); + } + + /* + * Constructor + */ + public Group(Enumeration type, BooleanType actual) { + super(); + this.type = type; + this.actual = actual; + } + + /** + * @return {@link #identifier} (A unique business identifier for this group.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Group.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (A unique business identifier for this group.) + */ + public Group setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #type} (Identifies the broad classification of the kind of resources the group includes.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Group.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new GroupTypeEnumFactory()); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Identifies the broad classification of the kind of resources the group includes.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Group setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Identifies the broad classification of the kind of resources the group includes. + */ + public GroupType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Identifies the broad classification of the kind of resources the group includes. + */ + public Group setType(GroupType value) { + if (this.type == null) + this.type = new Enumeration(new GroupTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #actual} (If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value + */ + public BooleanType getActualElement() { + if (this.actual == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Group.actual"); + else if (Configuration.doAutoCreate()) + this.actual = new BooleanType(); // bb + return this.actual; + } + + public boolean hasActualElement() { + return this.actual != null && !this.actual.isEmpty(); + } + + public boolean hasActual() { + return this.actual != null && !this.actual.isEmpty(); + } + + /** + * @param value {@link #actual} (If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value + */ + public Group setActualElement(BooleanType value) { + this.actual = value; + return this; + } + + /** + * @return If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals. + */ + public boolean getActual() { + return this.actual == null || this.actual.isEmpty() ? false : this.actual.getValue(); + } + + /** + * @param value If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals. + */ + public Group setActual(boolean value) { + if (this.actual == null) + this.actual = new BooleanType(); + this.actual.setValue(value); + return this; + } + + /** + * @return {@link #code} (Provides a specific type of resource the group includes. E.g. "cow", "syringe", etc.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Group.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Provides a specific type of resource the group includes. E.g. "cow", "syringe", etc.) + */ + public Group setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #name} (A label assigned to the group for human identification and communication.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Group.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A label assigned to the group for human identification and communication.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public Group setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A label assigned to the group for human identification and communication. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A label assigned to the group for human identification and communication. + */ + public Group setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #quantity} (A count of the number of resource instances that are part of the group.). This is the underlying object with id, value and extensions. The accessor "getQuantity" gives direct access to the value + */ + public UnsignedIntType getQuantityElement() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Group.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new UnsignedIntType(); // bb + return this.quantity; + } + + public boolean hasQuantityElement() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (A count of the number of resource instances that are part of the group.). This is the underlying object with id, value and extensions. The accessor "getQuantity" gives direct access to the value + */ + public Group setQuantityElement(UnsignedIntType value) { + this.quantity = value; + return this; + } + + /** + * @return A count of the number of resource instances that are part of the group. + */ + public int getQuantity() { + return this.quantity == null || this.quantity.isEmpty() ? 0 : this.quantity.getValue(); + } + + /** + * @param value A count of the number of resource instances that are part of the group. + */ + public Group setQuantity(int value) { + if (this.quantity == null) + this.quantity = new UnsignedIntType(); + this.quantity.setValue(value); + return this; + } + + /** + * @return {@link #characteristic} (Identifies the traits shared by members of the group.) + */ + public List getCharacteristic() { + if (this.characteristic == null) + this.characteristic = new ArrayList(); + return this.characteristic; + } + + public boolean hasCharacteristic() { + if (this.characteristic == null) + return false; + for (GroupCharacteristicComponent item : this.characteristic) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #characteristic} (Identifies the traits shared by members of the group.) + */ + // syntactic sugar + public GroupCharacteristicComponent addCharacteristic() { //3 + GroupCharacteristicComponent t = new GroupCharacteristicComponent(); + if (this.characteristic == null) + this.characteristic = new ArrayList(); + this.characteristic.add(t); + return t; + } + + // syntactic sugar + public Group addCharacteristic(GroupCharacteristicComponent t) { //3 + if (t == null) + return this; + if (this.characteristic == null) + this.characteristic = new ArrayList(); + this.characteristic.add(t); + return this; + } + + /** + * @return {@link #member} (Identifies the resource instances that are members of the group.) + */ + public List getMember() { + if (this.member == null) + this.member = new ArrayList(); + return this.member; + } + + public boolean hasMember() { + if (this.member == null) + return false; + for (Reference item : this.member) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #member} (Identifies the resource instances that are members of the group.) + */ + // syntactic sugar + public Reference addMember() { //3 + Reference t = new Reference(); + if (this.member == null) + this.member = new ArrayList(); + this.member.add(t); + return t; + } + + // syntactic sugar + public Group addMember(Reference t) { //3 + if (t == null) + return this; + if (this.member == null) + this.member = new ArrayList(); + this.member.add(t); + return this; + } + + /** + * @return {@link #member} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies the resource instances that are members of the group.) + */ + public List getMemberTarget() { + if (this.memberTarget == null) + this.memberTarget = new ArrayList(); + return this.memberTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "A unique business identifier for this group.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("type", "code", "Identifies the broad classification of the kind of resources the group includes.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("actual", "boolean", "If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals.", 0, java.lang.Integer.MAX_VALUE, actual)); + childrenList.add(new Property("code", "CodeableConcept", "Provides a specific type of resource the group includes. E.g. 'cow', 'syringe', etc.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("name", "string", "A label assigned to the group for human identification and communication.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("quantity", "unsignedInt", "A count of the number of resource instances that are part of the group.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("characteristic", "", "Identifies the traits shared by members of the group.", 0, java.lang.Integer.MAX_VALUE, characteristic)); + childrenList.add(new Property("member", "Reference(Patient|Practitioner|Device|Medication|Substance)", "Identifies the resource instances that are members of the group.", 0, java.lang.Integer.MAX_VALUE, member)); + } + + public Group copy() { + Group dst = new Group(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.type = type == null ? null : type.copy(); + dst.actual = actual == null ? null : actual.copy(); + dst.code = code == null ? null : code.copy(); + dst.name = name == null ? null : name.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + if (characteristic != null) { + dst.characteristic = new ArrayList(); + for (GroupCharacteristicComponent i : characteristic) + dst.characteristic.add(i.copy()); + }; + if (member != null) { + dst.member = new ArrayList(); + for (Reference i : member) + dst.member.add(i.copy()); + }; + return dst; + } + + protected Group typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Group)) + return false; + Group o = (Group) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(actual, o.actual, true) + && compareDeep(code, o.code, true) && compareDeep(name, o.name, true) && compareDeep(quantity, o.quantity, true) + && compareDeep(characteristic, o.characteristic, true) && compareDeep(member, o.member, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Group)) + return false; + Group o = (Group) other; + return compareValues(type, o.type, true) && compareValues(actual, o.actual, true) && compareValues(name, o.name, true) + && compareValues(quantity, o.quantity, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) + && (actual == null || actual.isEmpty()) && (code == null || code.isEmpty()) && (name == null || name.isEmpty()) + && (quantity == null || quantity.isEmpty()) && (characteristic == null || characteristic.isEmpty()) + && (member == null || member.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Group; + } + + @SearchParamDefinition(name="actual", path="Group.actual", description="Descriptive or actual", type="token" ) + public static final String SP_ACTUAL = "actual"; + @SearchParamDefinition(name="identifier", path="Group.identifier", description="Unique id", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="characteristic-value", path="", description="A composite of both characteristic and value", type="composite" ) + public static final String SP_CHARACTERISTICVALUE = "characteristic-value"; + @SearchParamDefinition(name="code", path="Group.code", description="The kind of resources contained", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="member", path="Group.member", description="Who or what is in group", type="reference" ) + public static final String SP_MEMBER = "member"; + @SearchParamDefinition(name="exclude", path="Group.characteristic.exclude", description="Group includes or excludes", type="token" ) + public static final String SP_EXCLUDE = "exclude"; + @SearchParamDefinition(name="type", path="Group.type", description="The type of resources the group contains", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="value", path="Group.characteristic.value[x]", description="Value held by characteristic", type="token" ) + public static final String SP_VALUE = "value"; + @SearchParamDefinition(name="characteristic", path="Group.characteristic.code", description="Kind of characteristic", type="token" ) + public static final String SP_CHARACTERISTIC = "characteristic"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/HealthcareService.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/HealthcareService.java index 5341e7e9886..0c655d76a97 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/HealthcareService.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/HealthcareService.java @@ -1,2071 +1,2050 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * The details of a Healthcare Service available at a location. - */ -@ResourceDef(name="HealthcareService", profile="http://hl7.org/fhir/Profile/HealthcareService") -public class HealthcareService extends DomainResource { - - public enum DaysOfWeek { - /** - * Monday. - */ - MON, - /** - * Tuesday. - */ - TUE, - /** - * Wednesday. - */ - WED, - /** - * Thursday. - */ - THU, - /** - * Friday. - */ - FRI, - /** - * Saturday. - */ - SAT, - /** - * Sunday. - */ - SUN, - /** - * added to help the parsers - */ - NULL; - public static DaysOfWeek fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("mon".equals(codeString)) - return MON; - if ("tue".equals(codeString)) - return TUE; - if ("wed".equals(codeString)) - return WED; - if ("thu".equals(codeString)) - return THU; - if ("fri".equals(codeString)) - return FRI; - if ("sat".equals(codeString)) - return SAT; - if ("sun".equals(codeString)) - return SUN; - throw new Exception("Unknown DaysOfWeek code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case MON: return "mon"; - case TUE: return "tue"; - case WED: return "wed"; - case THU: return "thu"; - case FRI: return "fri"; - case SAT: return "sat"; - case SUN: return "sun"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MON: return ""; - case TUE: return ""; - case WED: return ""; - case THU: return ""; - case FRI: return ""; - case SAT: return ""; - case SUN: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MON: return "Monday."; - case TUE: return "Tuesday."; - case WED: return "Wednesday."; - case THU: return "Thursday."; - case FRI: return "Friday."; - case SAT: return "Saturday."; - case SUN: return "Sunday."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MON: return "Monday"; - case TUE: return "Tuesday"; - case WED: return "Wednesday"; - case THU: return "Thursday"; - case FRI: return "Friday"; - case SAT: return "Saturday"; - case SUN: return "Sunday"; - default: return "?"; - } - } - } - - public static class DaysOfWeekEnumFactory implements EnumFactory { - public DaysOfWeek fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("mon".equals(codeString)) - return DaysOfWeek.MON; - if ("tue".equals(codeString)) - return DaysOfWeek.TUE; - if ("wed".equals(codeString)) - return DaysOfWeek.WED; - if ("thu".equals(codeString)) - return DaysOfWeek.THU; - if ("fri".equals(codeString)) - return DaysOfWeek.FRI; - if ("sat".equals(codeString)) - return DaysOfWeek.SAT; - if ("sun".equals(codeString)) - return DaysOfWeek.SUN; - throw new IllegalArgumentException("Unknown DaysOfWeek code '"+codeString+"'"); - } - public String toCode(DaysOfWeek code) { - if (code == DaysOfWeek.MON) - return "mon"; - if (code == DaysOfWeek.TUE) - return "tue"; - if (code == DaysOfWeek.WED) - return "wed"; - if (code == DaysOfWeek.THU) - return "thu"; - if (code == DaysOfWeek.FRI) - return "fri"; - if (code == DaysOfWeek.SAT) - return "sat"; - if (code == DaysOfWeek.SUN) - return "sun"; - return "?"; - } - } - - @Block() - public static class ServiceTypeComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The specific type of service being delivered or performed. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="The specific type of service being delivered or performed", formalDefinition="The specific type of service being delivered or performed." ) - protected CodeableConcept type; - - /** - * Collection of Specialties handled by the Service Site. This is more of a Medical Term. - */ - @Child(name = "specialty", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Collection of Specialties handled by the Service Site. This is more of a Medical Term", formalDefinition="Collection of Specialties handled by the Service Site. This is more of a Medical Term." ) - protected List specialty; - - private static final long serialVersionUID = 1703986174L; - - /* - * Constructor - */ - public ServiceTypeComponent() { - super(); - } - - /* - * Constructor - */ - public ServiceTypeComponent(CodeableConcept type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (The specific type of service being delivered or performed.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ServiceTypeComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The specific type of service being delivered or performed.) - */ - public ServiceTypeComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #specialty} (Collection of Specialties handled by the Service Site. This is more of a Medical Term.) - */ - public List getSpecialty() { - if (this.specialty == null) - this.specialty = new ArrayList(); - return this.specialty; - } - - public boolean hasSpecialty() { - if (this.specialty == null) - return false; - for (CodeableConcept item : this.specialty) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specialty} (Collection of Specialties handled by the Service Site. This is more of a Medical Term.) - */ - // syntactic sugar - public CodeableConcept addSpecialty() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.specialty == null) - this.specialty = new ArrayList(); - this.specialty.add(t); - return t; - } - - // syntactic sugar - public ServiceTypeComponent addSpecialty(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.specialty == null) - this.specialty = new ArrayList(); - this.specialty.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "The specific type of service being delivered or performed.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("specialty", "CodeableConcept", "Collection of Specialties handled by the Service Site. This is more of a Medical Term.", 0, java.lang.Integer.MAX_VALUE, specialty)); - } - - public ServiceTypeComponent copy() { - ServiceTypeComponent dst = new ServiceTypeComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - if (specialty != null) { - dst.specialty = new ArrayList(); - for (CodeableConcept i : specialty) - dst.specialty.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ServiceTypeComponent)) - return false; - ServiceTypeComponent o = (ServiceTypeComponent) other; - return compareDeep(type, o.type, true) && compareDeep(specialty, o.specialty, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ServiceTypeComponent)) - return false; - ServiceTypeComponent o = (ServiceTypeComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (specialty == null || specialty.isEmpty()) - ; - } - - } - - @Block() - public static class HealthcareServiceAvailableTimeComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Indicates which Days of the week are available between the Start and End Times. - */ - @Child(name = "daysOfWeek", type = {CodeType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="mon | tue | wed | thu | fri | sat | sun", formalDefinition="Indicates which Days of the week are available between the Start and End Times." ) - protected List> daysOfWeek; - - /** - * Is this always available? (hence times are irrelevant) e.g. 24 hour service. - */ - @Child(name = "allDay", type = {BooleanType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Is this always available? (hence times are irrelevant) e.g. 24 hour service", formalDefinition="Is this always available? (hence times are irrelevant) e.g. 24 hour service." ) - protected BooleanType allDay; - - /** - * The opening time of day. Note: If the AllDay flag is set, then this time is ignored. - */ - @Child(name = "availableStartTime", type = {TimeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="The opening time of day. Note: If the AllDay flag is set, then this time is ignored", formalDefinition="The opening time of day. Note: If the AllDay flag is set, then this time is ignored." ) - protected TimeType availableStartTime; - - /** - * The closing time of day. Note: If the AllDay flag is set, then this time is ignored. - */ - @Child(name = "availableEndTime", type = {TimeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="The closing time of day. Note: If the AllDay flag is set, then this time is ignored", formalDefinition="The closing time of day. Note: If the AllDay flag is set, then this time is ignored." ) - protected TimeType availableEndTime; - - private static final long serialVersionUID = -2139510127L; - - /* - * Constructor - */ - public HealthcareServiceAvailableTimeComponent() { - super(); - } - - /** - * @return {@link #daysOfWeek} (Indicates which Days of the week are available between the Start and End Times.) - */ - public List> getDaysOfWeek() { - if (this.daysOfWeek == null) - this.daysOfWeek = new ArrayList>(); - return this.daysOfWeek; - } - - public boolean hasDaysOfWeek() { - if (this.daysOfWeek == null) - return false; - for (Enumeration item : this.daysOfWeek) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #daysOfWeek} (Indicates which Days of the week are available between the Start and End Times.) - */ - // syntactic sugar - public Enumeration addDaysOfWeekElement() {//2 - Enumeration t = new Enumeration(new DaysOfWeekEnumFactory()); - if (this.daysOfWeek == null) - this.daysOfWeek = new ArrayList>(); - this.daysOfWeek.add(t); - return t; - } - - /** - * @param value {@link #daysOfWeek} (Indicates which Days of the week are available between the Start and End Times.) - */ - public HealthcareServiceAvailableTimeComponent addDaysOfWeek(DaysOfWeek value) { //1 - Enumeration t = new Enumeration(new DaysOfWeekEnumFactory()); - t.setValue(value); - if (this.daysOfWeek == null) - this.daysOfWeek = new ArrayList>(); - this.daysOfWeek.add(t); - return this; - } - - /** - * @param value {@link #daysOfWeek} (Indicates which Days of the week are available between the Start and End Times.) - */ - public boolean hasDaysOfWeek(DaysOfWeek value) { - if (this.daysOfWeek == null) - return false; - for (Enumeration v : this.daysOfWeek) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #allDay} (Is this always available? (hence times are irrelevant) e.g. 24 hour service.). This is the underlying object with id, value and extensions. The accessor "getAllDay" gives direct access to the value - */ - public BooleanType getAllDayElement() { - if (this.allDay == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.allDay"); - else if (Configuration.doAutoCreate()) - this.allDay = new BooleanType(); // bb - return this.allDay; - } - - public boolean hasAllDayElement() { - return this.allDay != null && !this.allDay.isEmpty(); - } - - public boolean hasAllDay() { - return this.allDay != null && !this.allDay.isEmpty(); - } - - /** - * @param value {@link #allDay} (Is this always available? (hence times are irrelevant) e.g. 24 hour service.). This is the underlying object with id, value and extensions. The accessor "getAllDay" gives direct access to the value - */ - public HealthcareServiceAvailableTimeComponent setAllDayElement(BooleanType value) { - this.allDay = value; - return this; - } - - /** - * @return Is this always available? (hence times are irrelevant) e.g. 24 hour service. - */ - public boolean getAllDay() { - return this.allDay == null || this.allDay.isEmpty() ? false : this.allDay.getValue(); - } - - /** - * @param value Is this always available? (hence times are irrelevant) e.g. 24 hour service. - */ - public HealthcareServiceAvailableTimeComponent setAllDay(boolean value) { - if (this.allDay == null) - this.allDay = new BooleanType(); - this.allDay.setValue(value); - return this; - } - - /** - * @return {@link #availableStartTime} (The opening time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableStartTime" gives direct access to the value - */ - public TimeType getAvailableStartTimeElement() { - if (this.availableStartTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.availableStartTime"); - else if (Configuration.doAutoCreate()) - this.availableStartTime = new TimeType(); // bb - return this.availableStartTime; - } - - public boolean hasAvailableStartTimeElement() { - return this.availableStartTime != null && !this.availableStartTime.isEmpty(); - } - - public boolean hasAvailableStartTime() { - return this.availableStartTime != null && !this.availableStartTime.isEmpty(); - } - - /** - * @param value {@link #availableStartTime} (The opening time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableStartTime" gives direct access to the value - */ - public HealthcareServiceAvailableTimeComponent setAvailableStartTimeElement(TimeType value) { - this.availableStartTime = value; - return this; - } - - /** - * @return The opening time of day. Note: If the AllDay flag is set, then this time is ignored. - */ - public String getAvailableStartTime() { - return this.availableStartTime == null ? null : this.availableStartTime.getValue(); - } - - /** - * @param value The opening time of day. Note: If the AllDay flag is set, then this time is ignored. - */ - public HealthcareServiceAvailableTimeComponent setAvailableStartTime(String value) { - if (value == null) - this.availableStartTime = null; - else { - if (this.availableStartTime == null) - this.availableStartTime = new TimeType(); - this.availableStartTime.setValue(value); - } - return this; - } - - /** - * @return {@link #availableEndTime} (The closing time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableEndTime" gives direct access to the value - */ - public TimeType getAvailableEndTimeElement() { - if (this.availableEndTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.availableEndTime"); - else if (Configuration.doAutoCreate()) - this.availableEndTime = new TimeType(); // bb - return this.availableEndTime; - } - - public boolean hasAvailableEndTimeElement() { - return this.availableEndTime != null && !this.availableEndTime.isEmpty(); - } - - public boolean hasAvailableEndTime() { - return this.availableEndTime != null && !this.availableEndTime.isEmpty(); - } - - /** - * @param value {@link #availableEndTime} (The closing time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableEndTime" gives direct access to the value - */ - public HealthcareServiceAvailableTimeComponent setAvailableEndTimeElement(TimeType value) { - this.availableEndTime = value; - return this; - } - - /** - * @return The closing time of day. Note: If the AllDay flag is set, then this time is ignored. - */ - public String getAvailableEndTime() { - return this.availableEndTime == null ? null : this.availableEndTime.getValue(); - } - - /** - * @param value The closing time of day. Note: If the AllDay flag is set, then this time is ignored. - */ - public HealthcareServiceAvailableTimeComponent setAvailableEndTime(String value) { - if (value == null) - this.availableEndTime = null; - else { - if (this.availableEndTime == null) - this.availableEndTime = new TimeType(); - this.availableEndTime.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("daysOfWeek", "code", "Indicates which Days of the week are available between the Start and End Times.", 0, java.lang.Integer.MAX_VALUE, daysOfWeek)); - childrenList.add(new Property("allDay", "boolean", "Is this always available? (hence times are irrelevant) e.g. 24 hour service.", 0, java.lang.Integer.MAX_VALUE, allDay)); - childrenList.add(new Property("availableStartTime", "time", "The opening time of day. Note: If the AllDay flag is set, then this time is ignored.", 0, java.lang.Integer.MAX_VALUE, availableStartTime)); - childrenList.add(new Property("availableEndTime", "time", "The closing time of day. Note: If the AllDay flag is set, then this time is ignored.", 0, java.lang.Integer.MAX_VALUE, availableEndTime)); - } - - public HealthcareServiceAvailableTimeComponent copy() { - HealthcareServiceAvailableTimeComponent dst = new HealthcareServiceAvailableTimeComponent(); - copyValues(dst); - if (daysOfWeek != null) { - dst.daysOfWeek = new ArrayList>(); - for (Enumeration i : daysOfWeek) - dst.daysOfWeek.add(i.copy()); - }; - dst.allDay = allDay == null ? null : allDay.copy(); - dst.availableStartTime = availableStartTime == null ? null : availableStartTime.copy(); - dst.availableEndTime = availableEndTime == null ? null : availableEndTime.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof HealthcareServiceAvailableTimeComponent)) - return false; - HealthcareServiceAvailableTimeComponent o = (HealthcareServiceAvailableTimeComponent) other; - return compareDeep(daysOfWeek, o.daysOfWeek, true) && compareDeep(allDay, o.allDay, true) && compareDeep(availableStartTime, o.availableStartTime, true) - && compareDeep(availableEndTime, o.availableEndTime, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof HealthcareServiceAvailableTimeComponent)) - return false; - HealthcareServiceAvailableTimeComponent o = (HealthcareServiceAvailableTimeComponent) other; - return compareValues(daysOfWeek, o.daysOfWeek, true) && compareValues(allDay, o.allDay, true) && compareValues(availableStartTime, o.availableStartTime, true) - && compareValues(availableEndTime, o.availableEndTime, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (daysOfWeek == null || daysOfWeek.isEmpty()) && (allDay == null || allDay.isEmpty()) - && (availableStartTime == null || availableStartTime.isEmpty()) && (availableEndTime == null || availableEndTime.isEmpty()) - ; - } - - } - - @Block() - public static class HealthcareServiceNotAvailableComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The reason that can be presented to the user as to why this time is not available. - */ - @Child(name = "description", type = {StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="The reason that can be presented to the user as to why this time is not available", formalDefinition="The reason that can be presented to the user as to why this time is not available." ) - protected StringType description; - - /** - * Service is not available (seasonally or for a public holiday) from this date. - */ - @Child(name = "during", type = {Period.class}, order=2, min=0, max=1) - @Description(shortDefinition="Service is not available (seasonally or for a public holiday) from this date", formalDefinition="Service is not available (seasonally or for a public holiday) from this date." ) - protected Period during; - - private static final long serialVersionUID = 310849929L; - - /* - * Constructor - */ - public HealthcareServiceNotAvailableComponent() { - super(); - } - - /* - * Constructor - */ - public HealthcareServiceNotAvailableComponent(StringType description) { - super(); - this.description = description; - } - - /** - * @return {@link #description} (The reason that can be presented to the user as to why this time is not available.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareServiceNotAvailableComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (The reason that can be presented to the user as to why this time is not available.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public HealthcareServiceNotAvailableComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return The reason that can be presented to the user as to why this time is not available. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value The reason that can be presented to the user as to why this time is not available. - */ - public HealthcareServiceNotAvailableComponent setDescription(String value) { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - return this; - } - - /** - * @return {@link #during} (Service is not available (seasonally or for a public holiday) from this date.) - */ - public Period getDuring() { - if (this.during == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareServiceNotAvailableComponent.during"); - else if (Configuration.doAutoCreate()) - this.during = new Period(); // cc - return this.during; - } - - public boolean hasDuring() { - return this.during != null && !this.during.isEmpty(); - } - - /** - * @param value {@link #during} (Service is not available (seasonally or for a public holiday) from this date.) - */ - public HealthcareServiceNotAvailableComponent setDuring(Period value) { - this.during = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("description", "string", "The reason that can be presented to the user as to why this time is not available.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("during", "Period", "Service is not available (seasonally or for a public holiday) from this date.", 0, java.lang.Integer.MAX_VALUE, during)); - } - - public HealthcareServiceNotAvailableComponent copy() { - HealthcareServiceNotAvailableComponent dst = new HealthcareServiceNotAvailableComponent(); - copyValues(dst); - dst.description = description == null ? null : description.copy(); - dst.during = during == null ? null : during.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof HealthcareServiceNotAvailableComponent)) - return false; - HealthcareServiceNotAvailableComponent o = (HealthcareServiceNotAvailableComponent) other; - return compareDeep(description, o.description, true) && compareDeep(during, o.during, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof HealthcareServiceNotAvailableComponent)) - return false; - HealthcareServiceNotAvailableComponent o = (HealthcareServiceNotAvailableComponent) other; - return compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (description == null || description.isEmpty()) && (during == null || during.isEmpty()) - ; - } - - } - - /** - * External Identifiers for this item. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External Identifiers for this item", formalDefinition="External Identifiers for this item." ) - protected List identifier; - - /** - * The organization that provides this Healthcare Service. - */ - @Child(name = "providedBy", type = {Organization.class}, order=1, min=0, max=1) - @Description(shortDefinition="The organization that provides this Healthcare Service", formalDefinition="The organization that provides this Healthcare Service." ) - protected Reference providedBy; - - /** - * The actual object that is the target of the reference (The organization that provides this Healthcare Service.) - */ - protected Organization providedByTarget; - - /** - * The location where this healthcare service may be provided. - */ - @Child(name = "location", type = {Location.class}, order=2, min=1, max=1) - @Description(shortDefinition="The location where this healthcare service may be provided", formalDefinition="The location where this healthcare service may be provided." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (The location where this healthcare service may be provided.) - */ - protected Location locationTarget; - - /** - * Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type. - */ - @Child(name = "serviceCategory", type = {CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type", formalDefinition="Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type." ) - protected CodeableConcept serviceCategory; - - /** - * A specific type of service that may be delivered or performed. - */ - @Child(name = "serviceType", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A specific type of service that may be delivered or performed", formalDefinition="A specific type of service that may be delivered or performed." ) - protected List serviceType; - - /** - * Further description of the service as it would be presented to a consumer while searching. - */ - @Child(name = "serviceName", type = {StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Further description of the service as it would be presented to a consumer while searching", formalDefinition="Further description of the service as it would be presented to a consumer while searching." ) - protected StringType serviceName; - - /** - * Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName. - */ - @Child(name = "comment", type = {StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName", formalDefinition="Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName." ) - protected StringType comment; - - /** - * Extra details about the service that can't be placed in the other fields. - */ - @Child(name = "extraDetails", type = {StringType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Extra details about the service that can't be placed in the other fields", formalDefinition="Extra details about the service that can't be placed in the other fields." ) - protected StringType extraDetails; - - /** - * If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list. - */ - @Child(name = "photo", type = {Attachment.class}, order=8, min=0, max=1) - @Description(shortDefinition="If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list", formalDefinition="If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list." ) - protected Attachment photo; - - /** - * List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts", formalDefinition="List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts." ) - protected List telecom; - - /** - * The location(s) that this service is available to (not where the service is provided). - */ - @Child(name = "coverageArea", type = {Location.class}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The location(s) that this service is available to (not where the service is provided)", formalDefinition="The location(s) that this service is available to (not where the service is provided)." ) - protected List coverageArea; - /** - * The actual objects that are the target of the reference (The location(s) that this service is available to (not where the service is provided).) - */ - protected List coverageAreaTarget; - - - /** - * The code(s) that detail the conditions under which the healthcare service is available/offered. - */ - @Child(name = "serviceProvisionCode", type = {CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The code(s) that detail the conditions under which the healthcare service is available/offered", formalDefinition="The code(s) that detail the conditions under which the healthcare service is available/offered." ) - protected List serviceProvisionCode; - - /** - * Does this service have specific eligibility requirements that need to be met in order to use the service. - */ - @Child(name = "eligibility", type = {CodeableConcept.class}, order=12, min=0, max=1) - @Description(shortDefinition="Does this service have specific eligibility requirements that need to be met in order to use the service", formalDefinition="Does this service have specific eligibility requirements that need to be met in order to use the service." ) - protected CodeableConcept eligibility; - - /** - * The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page. - */ - @Child(name = "eligibilityNote", type = {StringType.class}, order=13, min=0, max=1) - @Description(shortDefinition="Describes the eligibility conditions for the service", formalDefinition="The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page." ) - protected StringType eligibilityNote; - - /** - * Program Names that can be used to categorize the service. - */ - @Child(name = "programName", type = {StringType.class}, order=14, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Program Names that can be used to categorize the service", formalDefinition="Program Names that can be used to categorize the service." ) - protected List programName; - - /** - * Collection of Characteristics (attributes). - */ - @Child(name = "characteristic", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Collection of Characteristics (attributes)", formalDefinition="Collection of Characteristics (attributes)." ) - protected List characteristic; - - /** - * Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required. - */ - @Child(name = "referralMethod", type = {CodeableConcept.class}, order=16, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Ways that the service accepts referrals", formalDefinition="Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required." ) - protected List referralMethod; - - /** - * The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available. - */ - @Child(name = "publicKey", type = {StringType.class}, order=17, min=0, max=1) - @Description(shortDefinition="The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available", formalDefinition="The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available." ) - protected StringType publicKey; - - /** - * Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service. - */ - @Child(name = "appointmentRequired", type = {BooleanType.class}, order=18, min=0, max=1) - @Description(shortDefinition="Indicates if an appointment is required for access to this service", formalDefinition="Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service." ) - protected BooleanType appointmentRequired; - - /** - * A Collection of times that the Service Site is available. - */ - @Child(name = "availableTime", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A Collection of times that the Service Site is available", formalDefinition="A Collection of times that the Service Site is available." ) - protected List availableTime; - - /** - * The HealthcareService is not available during this period of time due to the provided reason. - */ - @Child(name = "notAvailable", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The HealthcareService is not available during this period of time due to the provided reason", formalDefinition="The HealthcareService is not available during this period of time due to the provided reason." ) - protected List notAvailable; - - /** - * A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times. - */ - @Child(name = "availabilityExceptions", type = {StringType.class}, order=21, min=0, max=1) - @Description(shortDefinition="A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times", formalDefinition="A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times." ) - protected StringType availabilityExceptions; - - private static final long serialVersionUID = 543354370L; - - /* - * Constructor - */ - public HealthcareService() { - super(); - } - - /* - * Constructor - */ - public HealthcareService(Reference location) { - super(); - this.location = location; - } - - /** - * @return {@link #identifier} (External Identifiers for this item.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (External Identifiers for this item.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public HealthcareService addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #providedBy} (The organization that provides this Healthcare Service.) - */ - public Reference getProvidedBy() { - if (this.providedBy == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.providedBy"); - else if (Configuration.doAutoCreate()) - this.providedBy = new Reference(); // cc - return this.providedBy; - } - - public boolean hasProvidedBy() { - return this.providedBy != null && !this.providedBy.isEmpty(); - } - - /** - * @param value {@link #providedBy} (The organization that provides this Healthcare Service.) - */ - public HealthcareService setProvidedBy(Reference value) { - this.providedBy = value; - return this; - } - - /** - * @return {@link #providedBy} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization that provides this Healthcare Service.) - */ - public Organization getProvidedByTarget() { - if (this.providedByTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.providedBy"); - else if (Configuration.doAutoCreate()) - this.providedByTarget = new Organization(); // aa - return this.providedByTarget; - } - - /** - * @param value {@link #providedBy} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization that provides this Healthcare Service.) - */ - public HealthcareService setProvidedByTarget(Organization value) { - this.providedByTarget = value; - return this; - } - - /** - * @return {@link #location} (The location where this healthcare service may be provided.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); // cc - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (The location where this healthcare service may be provided.) - */ - public HealthcareService setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The location where this healthcare service may be provided.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); // aa - return this.locationTarget; - } - - /** - * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The location where this healthcare service may be provided.) - */ - public HealthcareService setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #serviceCategory} (Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type.) - */ - public CodeableConcept getServiceCategory() { - if (this.serviceCategory == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.serviceCategory"); - else if (Configuration.doAutoCreate()) - this.serviceCategory = new CodeableConcept(); // cc - return this.serviceCategory; - } - - public boolean hasServiceCategory() { - return this.serviceCategory != null && !this.serviceCategory.isEmpty(); - } - - /** - * @param value {@link #serviceCategory} (Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type.) - */ - public HealthcareService setServiceCategory(CodeableConcept value) { - this.serviceCategory = value; - return this; - } - - /** - * @return {@link #serviceType} (A specific type of service that may be delivered or performed.) - */ - public List getServiceType() { - if (this.serviceType == null) - this.serviceType = new ArrayList(); - return this.serviceType; - } - - public boolean hasServiceType() { - if (this.serviceType == null) - return false; - for (ServiceTypeComponent item : this.serviceType) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #serviceType} (A specific type of service that may be delivered or performed.) - */ - // syntactic sugar - public ServiceTypeComponent addServiceType() { //3 - ServiceTypeComponent t = new ServiceTypeComponent(); - if (this.serviceType == null) - this.serviceType = new ArrayList(); - this.serviceType.add(t); - return t; - } - - // syntactic sugar - public HealthcareService addServiceType(ServiceTypeComponent t) { //3 - if (t == null) - return this; - if (this.serviceType == null) - this.serviceType = new ArrayList(); - this.serviceType.add(t); - return this; - } - - /** - * @return {@link #serviceName} (Further description of the service as it would be presented to a consumer while searching.). This is the underlying object with id, value and extensions. The accessor "getServiceName" gives direct access to the value - */ - public StringType getServiceNameElement() { - if (this.serviceName == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.serviceName"); - else if (Configuration.doAutoCreate()) - this.serviceName = new StringType(); // bb - return this.serviceName; - } - - public boolean hasServiceNameElement() { - return this.serviceName != null && !this.serviceName.isEmpty(); - } - - public boolean hasServiceName() { - return this.serviceName != null && !this.serviceName.isEmpty(); - } - - /** - * @param value {@link #serviceName} (Further description of the service as it would be presented to a consumer while searching.). This is the underlying object with id, value and extensions. The accessor "getServiceName" gives direct access to the value - */ - public HealthcareService setServiceNameElement(StringType value) { - this.serviceName = value; - return this; - } - - /** - * @return Further description of the service as it would be presented to a consumer while searching. - */ - public String getServiceName() { - return this.serviceName == null ? null : this.serviceName.getValue(); - } - - /** - * @param value Further description of the service as it would be presented to a consumer while searching. - */ - public HealthcareService setServiceName(String value) { - if (Utilities.noString(value)) - this.serviceName = null; - else { - if (this.serviceName == null) - this.serviceName = new StringType(); - this.serviceName.setValue(value); - } - return this; - } - - /** - * @return {@link #comment} (Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); // bb - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public HealthcareService setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName. - */ - public HealthcareService setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - /** - * @return {@link #extraDetails} (Extra details about the service that can't be placed in the other fields.). This is the underlying object with id, value and extensions. The accessor "getExtraDetails" gives direct access to the value - */ - public StringType getExtraDetailsElement() { - if (this.extraDetails == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.extraDetails"); - else if (Configuration.doAutoCreate()) - this.extraDetails = new StringType(); // bb - return this.extraDetails; - } - - public boolean hasExtraDetailsElement() { - return this.extraDetails != null && !this.extraDetails.isEmpty(); - } - - public boolean hasExtraDetails() { - return this.extraDetails != null && !this.extraDetails.isEmpty(); - } - - /** - * @param value {@link #extraDetails} (Extra details about the service that can't be placed in the other fields.). This is the underlying object with id, value and extensions. The accessor "getExtraDetails" gives direct access to the value - */ - public HealthcareService setExtraDetailsElement(StringType value) { - this.extraDetails = value; - return this; - } - - /** - * @return Extra details about the service that can't be placed in the other fields. - */ - public String getExtraDetails() { - return this.extraDetails == null ? null : this.extraDetails.getValue(); - } - - /** - * @param value Extra details about the service that can't be placed in the other fields. - */ - public HealthcareService setExtraDetails(String value) { - if (Utilities.noString(value)) - this.extraDetails = null; - else { - if (this.extraDetails == null) - this.extraDetails = new StringType(); - this.extraDetails.setValue(value); - } - return this; - } - - /** - * @return {@link #photo} (If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list.) - */ - public Attachment getPhoto() { - if (this.photo == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.photo"); - else if (Configuration.doAutoCreate()) - this.photo = new Attachment(); // cc - return this.photo; - } - - public boolean hasPhoto() { - return this.photo != null && !this.photo.isEmpty(); - } - - /** - * @param value {@link #photo} (If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list.) - */ - public HealthcareService setPhoto(Attachment value) { - this.photo = value; - return this; - } - - /** - * @return {@link #telecom} (List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public HealthcareService addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #coverageArea} (The location(s) that this service is available to (not where the service is provided).) - */ - public List getCoverageArea() { - if (this.coverageArea == null) - this.coverageArea = new ArrayList(); - return this.coverageArea; - } - - public boolean hasCoverageArea() { - if (this.coverageArea == null) - return false; - for (Reference item : this.coverageArea) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #coverageArea} (The location(s) that this service is available to (not where the service is provided).) - */ - // syntactic sugar - public Reference addCoverageArea() { //3 - Reference t = new Reference(); - if (this.coverageArea == null) - this.coverageArea = new ArrayList(); - this.coverageArea.add(t); - return t; - } - - // syntactic sugar - public HealthcareService addCoverageArea(Reference t) { //3 - if (t == null) - return this; - if (this.coverageArea == null) - this.coverageArea = new ArrayList(); - this.coverageArea.add(t); - return this; - } - - /** - * @return {@link #coverageArea} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The location(s) that this service is available to (not where the service is provided).) - */ - public List getCoverageAreaTarget() { - if (this.coverageAreaTarget == null) - this.coverageAreaTarget = new ArrayList(); - return this.coverageAreaTarget; - } - - // syntactic sugar - /** - * @return {@link #coverageArea} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The location(s) that this service is available to (not where the service is provided).) - */ - public Location addCoverageAreaTarget() { - Location r = new Location(); - if (this.coverageAreaTarget == null) - this.coverageAreaTarget = new ArrayList(); - this.coverageAreaTarget.add(r); - return r; - } - - /** - * @return {@link #serviceProvisionCode} (The code(s) that detail the conditions under which the healthcare service is available/offered.) - */ - public List getServiceProvisionCode() { - if (this.serviceProvisionCode == null) - this.serviceProvisionCode = new ArrayList(); - return this.serviceProvisionCode; - } - - public boolean hasServiceProvisionCode() { - if (this.serviceProvisionCode == null) - return false; - for (CodeableConcept item : this.serviceProvisionCode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #serviceProvisionCode} (The code(s) that detail the conditions under which the healthcare service is available/offered.) - */ - // syntactic sugar - public CodeableConcept addServiceProvisionCode() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.serviceProvisionCode == null) - this.serviceProvisionCode = new ArrayList(); - this.serviceProvisionCode.add(t); - return t; - } - - // syntactic sugar - public HealthcareService addServiceProvisionCode(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.serviceProvisionCode == null) - this.serviceProvisionCode = new ArrayList(); - this.serviceProvisionCode.add(t); - return this; - } - - /** - * @return {@link #eligibility} (Does this service have specific eligibility requirements that need to be met in order to use the service.) - */ - public CodeableConcept getEligibility() { - if (this.eligibility == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.eligibility"); - else if (Configuration.doAutoCreate()) - this.eligibility = new CodeableConcept(); // cc - return this.eligibility; - } - - public boolean hasEligibility() { - return this.eligibility != null && !this.eligibility.isEmpty(); - } - - /** - * @param value {@link #eligibility} (Does this service have specific eligibility requirements that need to be met in order to use the service.) - */ - public HealthcareService setEligibility(CodeableConcept value) { - this.eligibility = value; - return this; - } - - /** - * @return {@link #eligibilityNote} (The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page.). This is the underlying object with id, value and extensions. The accessor "getEligibilityNote" gives direct access to the value - */ - public StringType getEligibilityNoteElement() { - if (this.eligibilityNote == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.eligibilityNote"); - else if (Configuration.doAutoCreate()) - this.eligibilityNote = new StringType(); // bb - return this.eligibilityNote; - } - - public boolean hasEligibilityNoteElement() { - return this.eligibilityNote != null && !this.eligibilityNote.isEmpty(); - } - - public boolean hasEligibilityNote() { - return this.eligibilityNote != null && !this.eligibilityNote.isEmpty(); - } - - /** - * @param value {@link #eligibilityNote} (The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page.). This is the underlying object with id, value and extensions. The accessor "getEligibilityNote" gives direct access to the value - */ - public HealthcareService setEligibilityNoteElement(StringType value) { - this.eligibilityNote = value; - return this; - } - - /** - * @return The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page. - */ - public String getEligibilityNote() { - return this.eligibilityNote == null ? null : this.eligibilityNote.getValue(); - } - - /** - * @param value The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page. - */ - public HealthcareService setEligibilityNote(String value) { - if (Utilities.noString(value)) - this.eligibilityNote = null; - else { - if (this.eligibilityNote == null) - this.eligibilityNote = new StringType(); - this.eligibilityNote.setValue(value); - } - return this; - } - - /** - * @return {@link #programName} (Program Names that can be used to categorize the service.) - */ - public List getProgramName() { - if (this.programName == null) - this.programName = new ArrayList(); - return this.programName; - } - - public boolean hasProgramName() { - if (this.programName == null) - return false; - for (StringType item : this.programName) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #programName} (Program Names that can be used to categorize the service.) - */ - // syntactic sugar - public StringType addProgramNameElement() {//2 - StringType t = new StringType(); - if (this.programName == null) - this.programName = new ArrayList(); - this.programName.add(t); - return t; - } - - /** - * @param value {@link #programName} (Program Names that can be used to categorize the service.) - */ - public HealthcareService addProgramName(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.programName == null) - this.programName = new ArrayList(); - this.programName.add(t); - return this; - } - - /** - * @param value {@link #programName} (Program Names that can be used to categorize the service.) - */ - public boolean hasProgramName(String value) { - if (this.programName == null) - return false; - for (StringType v : this.programName) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #characteristic} (Collection of Characteristics (attributes).) - */ - public List getCharacteristic() { - if (this.characteristic == null) - this.characteristic = new ArrayList(); - return this.characteristic; - } - - public boolean hasCharacteristic() { - if (this.characteristic == null) - return false; - for (CodeableConcept item : this.characteristic) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #characteristic} (Collection of Characteristics (attributes).) - */ - // syntactic sugar - public CodeableConcept addCharacteristic() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.characteristic == null) - this.characteristic = new ArrayList(); - this.characteristic.add(t); - return t; - } - - // syntactic sugar - public HealthcareService addCharacteristic(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.characteristic == null) - this.characteristic = new ArrayList(); - this.characteristic.add(t); - return this; - } - - /** - * @return {@link #referralMethod} (Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required.) - */ - public List getReferralMethod() { - if (this.referralMethod == null) - this.referralMethod = new ArrayList(); - return this.referralMethod; - } - - public boolean hasReferralMethod() { - if (this.referralMethod == null) - return false; - for (CodeableConcept item : this.referralMethod) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #referralMethod} (Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required.) - */ - // syntactic sugar - public CodeableConcept addReferralMethod() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.referralMethod == null) - this.referralMethod = new ArrayList(); - this.referralMethod.add(t); - return t; - } - - // syntactic sugar - public HealthcareService addReferralMethod(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.referralMethod == null) - this.referralMethod = new ArrayList(); - this.referralMethod.add(t); - return this; - } - - /** - * @return {@link #publicKey} (The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available.). This is the underlying object with id, value and extensions. The accessor "getPublicKey" gives direct access to the value - */ - public StringType getPublicKeyElement() { - if (this.publicKey == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.publicKey"); - else if (Configuration.doAutoCreate()) - this.publicKey = new StringType(); // bb - return this.publicKey; - } - - public boolean hasPublicKeyElement() { - return this.publicKey != null && !this.publicKey.isEmpty(); - } - - public boolean hasPublicKey() { - return this.publicKey != null && !this.publicKey.isEmpty(); - } - - /** - * @param value {@link #publicKey} (The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available.). This is the underlying object with id, value and extensions. The accessor "getPublicKey" gives direct access to the value - */ - public HealthcareService setPublicKeyElement(StringType value) { - this.publicKey = value; - return this; - } - - /** - * @return The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available. - */ - public String getPublicKey() { - return this.publicKey == null ? null : this.publicKey.getValue(); - } - - /** - * @param value The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available. - */ - public HealthcareService setPublicKey(String value) { - if (Utilities.noString(value)) - this.publicKey = null; - else { - if (this.publicKey == null) - this.publicKey = new StringType(); - this.publicKey.setValue(value); - } - return this; - } - - /** - * @return {@link #appointmentRequired} (Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service.). This is the underlying object with id, value and extensions. The accessor "getAppointmentRequired" gives direct access to the value - */ - public BooleanType getAppointmentRequiredElement() { - if (this.appointmentRequired == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.appointmentRequired"); - else if (Configuration.doAutoCreate()) - this.appointmentRequired = new BooleanType(); // bb - return this.appointmentRequired; - } - - public boolean hasAppointmentRequiredElement() { - return this.appointmentRequired != null && !this.appointmentRequired.isEmpty(); - } - - public boolean hasAppointmentRequired() { - return this.appointmentRequired != null && !this.appointmentRequired.isEmpty(); - } - - /** - * @param value {@link #appointmentRequired} (Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service.). This is the underlying object with id, value and extensions. The accessor "getAppointmentRequired" gives direct access to the value - */ - public HealthcareService setAppointmentRequiredElement(BooleanType value) { - this.appointmentRequired = value; - return this; - } - - /** - * @return Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service. - */ - public boolean getAppointmentRequired() { - return this.appointmentRequired == null || this.appointmentRequired.isEmpty() ? false : this.appointmentRequired.getValue(); - } - - /** - * @param value Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service. - */ - public HealthcareService setAppointmentRequired(boolean value) { - if (this.appointmentRequired == null) - this.appointmentRequired = new BooleanType(); - this.appointmentRequired.setValue(value); - return this; - } - - /** - * @return {@link #availableTime} (A Collection of times that the Service Site is available.) - */ - public List getAvailableTime() { - if (this.availableTime == null) - this.availableTime = new ArrayList(); - return this.availableTime; - } - - public boolean hasAvailableTime() { - if (this.availableTime == null) - return false; - for (HealthcareServiceAvailableTimeComponent item : this.availableTime) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #availableTime} (A Collection of times that the Service Site is available.) - */ - // syntactic sugar - public HealthcareServiceAvailableTimeComponent addAvailableTime() { //3 - HealthcareServiceAvailableTimeComponent t = new HealthcareServiceAvailableTimeComponent(); - if (this.availableTime == null) - this.availableTime = new ArrayList(); - this.availableTime.add(t); - return t; - } - - // syntactic sugar - public HealthcareService addAvailableTime(HealthcareServiceAvailableTimeComponent t) { //3 - if (t == null) - return this; - if (this.availableTime == null) - this.availableTime = new ArrayList(); - this.availableTime.add(t); - return this; - } - - /** - * @return {@link #notAvailable} (The HealthcareService is not available during this period of time due to the provided reason.) - */ - public List getNotAvailable() { - if (this.notAvailable == null) - this.notAvailable = new ArrayList(); - return this.notAvailable; - } - - public boolean hasNotAvailable() { - if (this.notAvailable == null) - return false; - for (HealthcareServiceNotAvailableComponent item : this.notAvailable) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #notAvailable} (The HealthcareService is not available during this period of time due to the provided reason.) - */ - // syntactic sugar - public HealthcareServiceNotAvailableComponent addNotAvailable() { //3 - HealthcareServiceNotAvailableComponent t = new HealthcareServiceNotAvailableComponent(); - if (this.notAvailable == null) - this.notAvailable = new ArrayList(); - this.notAvailable.add(t); - return t; - } - - // syntactic sugar - public HealthcareService addNotAvailable(HealthcareServiceNotAvailableComponent t) { //3 - if (t == null) - return this; - if (this.notAvailable == null) - this.notAvailable = new ArrayList(); - this.notAvailable.add(t); - return this; - } - - /** - * @return {@link #availabilityExceptions} (A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times.). This is the underlying object with id, value and extensions. The accessor "getAvailabilityExceptions" gives direct access to the value - */ - public StringType getAvailabilityExceptionsElement() { - if (this.availabilityExceptions == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.availabilityExceptions"); - else if (Configuration.doAutoCreate()) - this.availabilityExceptions = new StringType(); // bb - return this.availabilityExceptions; - } - - public boolean hasAvailabilityExceptionsElement() { - return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty(); - } - - public boolean hasAvailabilityExceptions() { - return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty(); - } - - /** - * @param value {@link #availabilityExceptions} (A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times.). This is the underlying object with id, value and extensions. The accessor "getAvailabilityExceptions" gives direct access to the value - */ - public HealthcareService setAvailabilityExceptionsElement(StringType value) { - this.availabilityExceptions = value; - return this; - } - - /** - * @return A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times. - */ - public String getAvailabilityExceptions() { - return this.availabilityExceptions == null ? null : this.availabilityExceptions.getValue(); - } - - /** - * @param value A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times. - */ - public HealthcareService setAvailabilityExceptions(String value) { - if (Utilities.noString(value)) - this.availabilityExceptions = null; - else { - if (this.availabilityExceptions == null) - this.availabilityExceptions = new StringType(); - this.availabilityExceptions.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "External Identifiers for this item.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("providedBy", "Reference(Organization)", "The organization that provides this Healthcare Service.", 0, java.lang.Integer.MAX_VALUE, providedBy)); - childrenList.add(new Property("location", "Reference(Location)", "The location where this healthcare service may be provided.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("serviceCategory", "CodeableConcept", "Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type.", 0, java.lang.Integer.MAX_VALUE, serviceCategory)); - childrenList.add(new Property("serviceType", "", "A specific type of service that may be delivered or performed.", 0, java.lang.Integer.MAX_VALUE, serviceType)); - childrenList.add(new Property("serviceName", "string", "Further description of the service as it would be presented to a consumer while searching.", 0, java.lang.Integer.MAX_VALUE, serviceName)); - childrenList.add(new Property("comment", "string", "Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.", 0, java.lang.Integer.MAX_VALUE, comment)); - childrenList.add(new Property("extraDetails", "string", "Extra details about the service that can't be placed in the other fields.", 0, java.lang.Integer.MAX_VALUE, extraDetails)); - childrenList.add(new Property("photo", "Attachment", "If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list.", 0, java.lang.Integer.MAX_VALUE, photo)); - childrenList.add(new Property("telecom", "ContactPoint", "List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("coverageArea", "Reference(Location)", "The location(s) that this service is available to (not where the service is provided).", 0, java.lang.Integer.MAX_VALUE, coverageArea)); - childrenList.add(new Property("serviceProvisionCode", "CodeableConcept", "The code(s) that detail the conditions under which the healthcare service is available/offered.", 0, java.lang.Integer.MAX_VALUE, serviceProvisionCode)); - childrenList.add(new Property("eligibility", "CodeableConcept", "Does this service have specific eligibility requirements that need to be met in order to use the service.", 0, java.lang.Integer.MAX_VALUE, eligibility)); - childrenList.add(new Property("eligibilityNote", "string", "The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page.", 0, java.lang.Integer.MAX_VALUE, eligibilityNote)); - childrenList.add(new Property("programName", "string", "Program Names that can be used to categorize the service.", 0, java.lang.Integer.MAX_VALUE, programName)); - childrenList.add(new Property("characteristic", "CodeableConcept", "Collection of Characteristics (attributes).", 0, java.lang.Integer.MAX_VALUE, characteristic)); - childrenList.add(new Property("referralMethod", "CodeableConcept", "Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required.", 0, java.lang.Integer.MAX_VALUE, referralMethod)); - childrenList.add(new Property("publicKey", "string", "The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available.", 0, java.lang.Integer.MAX_VALUE, publicKey)); - childrenList.add(new Property("appointmentRequired", "boolean", "Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service.", 0, java.lang.Integer.MAX_VALUE, appointmentRequired)); - childrenList.add(new Property("availableTime", "", "A Collection of times that the Service Site is available.", 0, java.lang.Integer.MAX_VALUE, availableTime)); - childrenList.add(new Property("notAvailable", "", "The HealthcareService is not available during this period of time due to the provided reason.", 0, java.lang.Integer.MAX_VALUE, notAvailable)); - childrenList.add(new Property("availabilityExceptions", "string", "A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times.", 0, java.lang.Integer.MAX_VALUE, availabilityExceptions)); - } - - public HealthcareService copy() { - HealthcareService dst = new HealthcareService(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.providedBy = providedBy == null ? null : providedBy.copy(); - dst.location = location == null ? null : location.copy(); - dst.serviceCategory = serviceCategory == null ? null : serviceCategory.copy(); - if (serviceType != null) { - dst.serviceType = new ArrayList(); - for (ServiceTypeComponent i : serviceType) - dst.serviceType.add(i.copy()); - }; - dst.serviceName = serviceName == null ? null : serviceName.copy(); - dst.comment = comment == null ? null : comment.copy(); - dst.extraDetails = extraDetails == null ? null : extraDetails.copy(); - dst.photo = photo == null ? null : photo.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - if (coverageArea != null) { - dst.coverageArea = new ArrayList(); - for (Reference i : coverageArea) - dst.coverageArea.add(i.copy()); - }; - if (serviceProvisionCode != null) { - dst.serviceProvisionCode = new ArrayList(); - for (CodeableConcept i : serviceProvisionCode) - dst.serviceProvisionCode.add(i.copy()); - }; - dst.eligibility = eligibility == null ? null : eligibility.copy(); - dst.eligibilityNote = eligibilityNote == null ? null : eligibilityNote.copy(); - if (programName != null) { - dst.programName = new ArrayList(); - for (StringType i : programName) - dst.programName.add(i.copy()); - }; - if (characteristic != null) { - dst.characteristic = new ArrayList(); - for (CodeableConcept i : characteristic) - dst.characteristic.add(i.copy()); - }; - if (referralMethod != null) { - dst.referralMethod = new ArrayList(); - for (CodeableConcept i : referralMethod) - dst.referralMethod.add(i.copy()); - }; - dst.publicKey = publicKey == null ? null : publicKey.copy(); - dst.appointmentRequired = appointmentRequired == null ? null : appointmentRequired.copy(); - if (availableTime != null) { - dst.availableTime = new ArrayList(); - for (HealthcareServiceAvailableTimeComponent i : availableTime) - dst.availableTime.add(i.copy()); - }; - if (notAvailable != null) { - dst.notAvailable = new ArrayList(); - for (HealthcareServiceNotAvailableComponent i : notAvailable) - dst.notAvailable.add(i.copy()); - }; - dst.availabilityExceptions = availabilityExceptions == null ? null : availabilityExceptions.copy(); - return dst; - } - - protected HealthcareService typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof HealthcareService)) - return false; - HealthcareService o = (HealthcareService) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(providedBy, o.providedBy, true) - && compareDeep(location, o.location, true) && compareDeep(serviceCategory, o.serviceCategory, true) - && compareDeep(serviceType, o.serviceType, true) && compareDeep(serviceName, o.serviceName, true) - && compareDeep(comment, o.comment, true) && compareDeep(extraDetails, o.extraDetails, true) && compareDeep(photo, o.photo, true) - && compareDeep(telecom, o.telecom, true) && compareDeep(coverageArea, o.coverageArea, true) && compareDeep(serviceProvisionCode, o.serviceProvisionCode, true) - && compareDeep(eligibility, o.eligibility, true) && compareDeep(eligibilityNote, o.eligibilityNote, true) - && compareDeep(programName, o.programName, true) && compareDeep(characteristic, o.characteristic, true) - && compareDeep(referralMethod, o.referralMethod, true) && compareDeep(publicKey, o.publicKey, true) - && compareDeep(appointmentRequired, o.appointmentRequired, true) && compareDeep(availableTime, o.availableTime, true) - && compareDeep(notAvailable, o.notAvailable, true) && compareDeep(availabilityExceptions, o.availabilityExceptions, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof HealthcareService)) - return false; - HealthcareService o = (HealthcareService) other; - return compareValues(serviceName, o.serviceName, true) && compareValues(comment, o.comment, true) && compareValues(extraDetails, o.extraDetails, true) - && compareValues(eligibilityNote, o.eligibilityNote, true) && compareValues(programName, o.programName, true) - && compareValues(publicKey, o.publicKey, true) && compareValues(appointmentRequired, o.appointmentRequired, true) - && compareValues(availabilityExceptions, o.availabilityExceptions, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (providedBy == null || providedBy.isEmpty()) - && (location == null || location.isEmpty()) && (serviceCategory == null || serviceCategory.isEmpty()) - && (serviceType == null || serviceType.isEmpty()) && (serviceName == null || serviceName.isEmpty()) - && (comment == null || comment.isEmpty()) && (extraDetails == null || extraDetails.isEmpty()) - && (photo == null || photo.isEmpty()) && (telecom == null || telecom.isEmpty()) && (coverageArea == null || coverageArea.isEmpty()) - && (serviceProvisionCode == null || serviceProvisionCode.isEmpty()) && (eligibility == null || eligibility.isEmpty()) - && (eligibilityNote == null || eligibilityNote.isEmpty()) && (programName == null || programName.isEmpty()) - && (characteristic == null || characteristic.isEmpty()) && (referralMethod == null || referralMethod.isEmpty()) - && (publicKey == null || publicKey.isEmpty()) && (appointmentRequired == null || appointmentRequired.isEmpty()) - && (availableTime == null || availableTime.isEmpty()) && (notAvailable == null || notAvailable.isEmpty()) - && (availabilityExceptions == null || availabilityExceptions.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.HealthcareService; - } - - @SearchParamDefinition(name="servicecategory", path="HealthcareService.serviceCategory", description="Service Category of the Healthcare Service", type="token" ) - public static final String SP_SERVICECATEGORY = "servicecategory"; - @SearchParamDefinition(name="organization", path="HealthcareService.providedBy", description="The organization that provides this Healthcare Service", type="reference" ) - public static final String SP_ORGANIZATION = "organization"; - @SearchParamDefinition(name="servicetype", path="HealthcareService.serviceType.type", description="The type of service provided by this healthcare service", type="token" ) - public static final String SP_SERVICETYPE = "servicetype"; - @SearchParamDefinition(name="location", path="HealthcareService.location", description="The location of the Healthcare Service", type="reference" ) - public static final String SP_LOCATION = "location"; - @SearchParamDefinition(name="name", path="HealthcareService.serviceName", description="A portion of the Healthcare service name", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="programname", path="HealthcareService.programName", description="One of the Program Names serviced by this HealthcareService", type="string" ) - public static final String SP_PROGRAMNAME = "programname"; - @SearchParamDefinition(name="characteristic", path="HealthcareService.characteristic", description="One of the HealthcareService's characteristics", type="token" ) - public static final String SP_CHARACTERISTIC = "characteristic"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * The details of a Healthcare Service available at a location. + */ +@ResourceDef(name="HealthcareService", profile="http://hl7.org/fhir/Profile/HealthcareService") +public class HealthcareService extends DomainResource { + + public enum DaysOfWeek { + /** + * Monday. + */ + MON, + /** + * Tuesday. + */ + TUE, + /** + * Wednesday. + */ + WED, + /** + * Thursday. + */ + THU, + /** + * Friday. + */ + FRI, + /** + * Saturday. + */ + SAT, + /** + * Sunday. + */ + SUN, + /** + * added to help the parsers + */ + NULL; + public static DaysOfWeek fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("mon".equals(codeString)) + return MON; + if ("tue".equals(codeString)) + return TUE; + if ("wed".equals(codeString)) + return WED; + if ("thu".equals(codeString)) + return THU; + if ("fri".equals(codeString)) + return FRI; + if ("sat".equals(codeString)) + return SAT; + if ("sun".equals(codeString)) + return SUN; + throw new Exception("Unknown DaysOfWeek code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case MON: return "mon"; + case TUE: return "tue"; + case WED: return "wed"; + case THU: return "thu"; + case FRI: return "fri"; + case SAT: return "sat"; + case SUN: return "sun"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MON: return ""; + case TUE: return ""; + case WED: return ""; + case THU: return ""; + case FRI: return ""; + case SAT: return ""; + case SUN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MON: return "Monday."; + case TUE: return "Tuesday."; + case WED: return "Wednesday."; + case THU: return "Thursday."; + case FRI: return "Friday."; + case SAT: return "Saturday."; + case SUN: return "Sunday."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MON: return "Monday"; + case TUE: return "Tuesday"; + case WED: return "Wednesday"; + case THU: return "Thursday"; + case FRI: return "Friday"; + case SAT: return "Saturday"; + case SUN: return "Sunday"; + default: return "?"; + } + } + } + + public static class DaysOfWeekEnumFactory implements EnumFactory { + public DaysOfWeek fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("mon".equals(codeString)) + return DaysOfWeek.MON; + if ("tue".equals(codeString)) + return DaysOfWeek.TUE; + if ("wed".equals(codeString)) + return DaysOfWeek.WED; + if ("thu".equals(codeString)) + return DaysOfWeek.THU; + if ("fri".equals(codeString)) + return DaysOfWeek.FRI; + if ("sat".equals(codeString)) + return DaysOfWeek.SAT; + if ("sun".equals(codeString)) + return DaysOfWeek.SUN; + throw new IllegalArgumentException("Unknown DaysOfWeek code '"+codeString+"'"); + } + public String toCode(DaysOfWeek code) { + if (code == DaysOfWeek.MON) + return "mon"; + if (code == DaysOfWeek.TUE) + return "tue"; + if (code == DaysOfWeek.WED) + return "wed"; + if (code == DaysOfWeek.THU) + return "thu"; + if (code == DaysOfWeek.FRI) + return "fri"; + if (code == DaysOfWeek.SAT) + return "sat"; + if (code == DaysOfWeek.SUN) + return "sun"; + return "?"; + } + } + + @Block() + public static class ServiceTypeComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The specific type of service being delivered or performed. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="The specific type of service being delivered or performed", formalDefinition="The specific type of service being delivered or performed." ) + protected CodeableConcept type; + + /** + * Collection of Specialties handled by the Service Site. This is more of a Medical Term. + */ + @Child(name = "specialty", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Collection of Specialties handled by the Service Site. This is more of a Medical Term", formalDefinition="Collection of Specialties handled by the Service Site. This is more of a Medical Term." ) + protected List specialty; + + private static final long serialVersionUID = 1703986174L; + + /* + * Constructor + */ + public ServiceTypeComponent() { + super(); + } + + /* + * Constructor + */ + public ServiceTypeComponent(CodeableConcept type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (The specific type of service being delivered or performed.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ServiceTypeComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The specific type of service being delivered or performed.) + */ + public ServiceTypeComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #specialty} (Collection of Specialties handled by the Service Site. This is more of a Medical Term.) + */ + public List getSpecialty() { + if (this.specialty == null) + this.specialty = new ArrayList(); + return this.specialty; + } + + public boolean hasSpecialty() { + if (this.specialty == null) + return false; + for (CodeableConcept item : this.specialty) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specialty} (Collection of Specialties handled by the Service Site. This is more of a Medical Term.) + */ + // syntactic sugar + public CodeableConcept addSpecialty() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.specialty == null) + this.specialty = new ArrayList(); + this.specialty.add(t); + return t; + } + + // syntactic sugar + public ServiceTypeComponent addSpecialty(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.specialty == null) + this.specialty = new ArrayList(); + this.specialty.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "The specific type of service being delivered or performed.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("specialty", "CodeableConcept", "Collection of Specialties handled by the Service Site. This is more of a Medical Term.", 0, java.lang.Integer.MAX_VALUE, specialty)); + } + + public ServiceTypeComponent copy() { + ServiceTypeComponent dst = new ServiceTypeComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + if (specialty != null) { + dst.specialty = new ArrayList(); + for (CodeableConcept i : specialty) + dst.specialty.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ServiceTypeComponent)) + return false; + ServiceTypeComponent o = (ServiceTypeComponent) other; + return compareDeep(type, o.type, true) && compareDeep(specialty, o.specialty, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ServiceTypeComponent)) + return false; + ServiceTypeComponent o = (ServiceTypeComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (specialty == null || specialty.isEmpty()) + ; + } + + } + + @Block() + public static class HealthcareServiceAvailableTimeComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Indicates which Days of the week are available between the Start and End Times. + */ + @Child(name = "daysOfWeek", type = {CodeType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="mon | tue | wed | thu | fri | sat | sun", formalDefinition="Indicates which Days of the week are available between the Start and End Times." ) + protected List> daysOfWeek; + + /** + * Is this always available? (hence times are irrelevant) e.g. 24 hour service. + */ + @Child(name = "allDay", type = {BooleanType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Is this always available? (hence times are irrelevant) e.g. 24 hour service", formalDefinition="Is this always available? (hence times are irrelevant) e.g. 24 hour service." ) + protected BooleanType allDay; + + /** + * The opening time of day. Note: If the AllDay flag is set, then this time is ignored. + */ + @Child(name = "availableStartTime", type = {TimeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="The opening time of day. Note: If the AllDay flag is set, then this time is ignored", formalDefinition="The opening time of day. Note: If the AllDay flag is set, then this time is ignored." ) + protected TimeType availableStartTime; + + /** + * The closing time of day. Note: If the AllDay flag is set, then this time is ignored. + */ + @Child(name = "availableEndTime", type = {TimeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="The closing time of day. Note: If the AllDay flag is set, then this time is ignored", formalDefinition="The closing time of day. Note: If the AllDay flag is set, then this time is ignored." ) + protected TimeType availableEndTime; + + private static final long serialVersionUID = -2139510127L; + + /* + * Constructor + */ + public HealthcareServiceAvailableTimeComponent() { + super(); + } + + /** + * @return {@link #daysOfWeek} (Indicates which Days of the week are available between the Start and End Times.) + */ + public List> getDaysOfWeek() { + if (this.daysOfWeek == null) + this.daysOfWeek = new ArrayList>(); + return this.daysOfWeek; + } + + public boolean hasDaysOfWeek() { + if (this.daysOfWeek == null) + return false; + for (Enumeration item : this.daysOfWeek) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #daysOfWeek} (Indicates which Days of the week are available between the Start and End Times.) + */ + // syntactic sugar + public Enumeration addDaysOfWeekElement() {//2 + Enumeration t = new Enumeration(new DaysOfWeekEnumFactory()); + if (this.daysOfWeek == null) + this.daysOfWeek = new ArrayList>(); + this.daysOfWeek.add(t); + return t; + } + + /** + * @param value {@link #daysOfWeek} (Indicates which Days of the week are available between the Start and End Times.) + */ + public HealthcareServiceAvailableTimeComponent addDaysOfWeek(DaysOfWeek value) { //1 + Enumeration t = new Enumeration(new DaysOfWeekEnumFactory()); + t.setValue(value); + if (this.daysOfWeek == null) + this.daysOfWeek = new ArrayList>(); + this.daysOfWeek.add(t); + return this; + } + + /** + * @param value {@link #daysOfWeek} (Indicates which Days of the week are available between the Start and End Times.) + */ + public boolean hasDaysOfWeek(DaysOfWeek value) { + if (this.daysOfWeek == null) + return false; + for (Enumeration v : this.daysOfWeek) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #allDay} (Is this always available? (hence times are irrelevant) e.g. 24 hour service.). This is the underlying object with id, value and extensions. The accessor "getAllDay" gives direct access to the value + */ + public BooleanType getAllDayElement() { + if (this.allDay == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.allDay"); + else if (Configuration.doAutoCreate()) + this.allDay = new BooleanType(); // bb + return this.allDay; + } + + public boolean hasAllDayElement() { + return this.allDay != null && !this.allDay.isEmpty(); + } + + public boolean hasAllDay() { + return this.allDay != null && !this.allDay.isEmpty(); + } + + /** + * @param value {@link #allDay} (Is this always available? (hence times are irrelevant) e.g. 24 hour service.). This is the underlying object with id, value and extensions. The accessor "getAllDay" gives direct access to the value + */ + public HealthcareServiceAvailableTimeComponent setAllDayElement(BooleanType value) { + this.allDay = value; + return this; + } + + /** + * @return Is this always available? (hence times are irrelevant) e.g. 24 hour service. + */ + public boolean getAllDay() { + return this.allDay == null || this.allDay.isEmpty() ? false : this.allDay.getValue(); + } + + /** + * @param value Is this always available? (hence times are irrelevant) e.g. 24 hour service. + */ + public HealthcareServiceAvailableTimeComponent setAllDay(boolean value) { + if (this.allDay == null) + this.allDay = new BooleanType(); + this.allDay.setValue(value); + return this; + } + + /** + * @return {@link #availableStartTime} (The opening time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableStartTime" gives direct access to the value + */ + public TimeType getAvailableStartTimeElement() { + if (this.availableStartTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.availableStartTime"); + else if (Configuration.doAutoCreate()) + this.availableStartTime = new TimeType(); // bb + return this.availableStartTime; + } + + public boolean hasAvailableStartTimeElement() { + return this.availableStartTime != null && !this.availableStartTime.isEmpty(); + } + + public boolean hasAvailableStartTime() { + return this.availableStartTime != null && !this.availableStartTime.isEmpty(); + } + + /** + * @param value {@link #availableStartTime} (The opening time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableStartTime" gives direct access to the value + */ + public HealthcareServiceAvailableTimeComponent setAvailableStartTimeElement(TimeType value) { + this.availableStartTime = value; + return this; + } + + /** + * @return The opening time of day. Note: If the AllDay flag is set, then this time is ignored. + */ + public String getAvailableStartTime() { + return this.availableStartTime == null ? null : this.availableStartTime.getValue(); + } + + /** + * @param value The opening time of day. Note: If the AllDay flag is set, then this time is ignored. + */ + public HealthcareServiceAvailableTimeComponent setAvailableStartTime(String value) { + if (value == null) + this.availableStartTime = null; + else { + if (this.availableStartTime == null) + this.availableStartTime = new TimeType(); + this.availableStartTime.setValue(value); + } + return this; + } + + /** + * @return {@link #availableEndTime} (The closing time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableEndTime" gives direct access to the value + */ + public TimeType getAvailableEndTimeElement() { + if (this.availableEndTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.availableEndTime"); + else if (Configuration.doAutoCreate()) + this.availableEndTime = new TimeType(); // bb + return this.availableEndTime; + } + + public boolean hasAvailableEndTimeElement() { + return this.availableEndTime != null && !this.availableEndTime.isEmpty(); + } + + public boolean hasAvailableEndTime() { + return this.availableEndTime != null && !this.availableEndTime.isEmpty(); + } + + /** + * @param value {@link #availableEndTime} (The closing time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableEndTime" gives direct access to the value + */ + public HealthcareServiceAvailableTimeComponent setAvailableEndTimeElement(TimeType value) { + this.availableEndTime = value; + return this; + } + + /** + * @return The closing time of day. Note: If the AllDay flag is set, then this time is ignored. + */ + public String getAvailableEndTime() { + return this.availableEndTime == null ? null : this.availableEndTime.getValue(); + } + + /** + * @param value The closing time of day. Note: If the AllDay flag is set, then this time is ignored. + */ + public HealthcareServiceAvailableTimeComponent setAvailableEndTime(String value) { + if (value == null) + this.availableEndTime = null; + else { + if (this.availableEndTime == null) + this.availableEndTime = new TimeType(); + this.availableEndTime.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("daysOfWeek", "code", "Indicates which Days of the week are available between the Start and End Times.", 0, java.lang.Integer.MAX_VALUE, daysOfWeek)); + childrenList.add(new Property("allDay", "boolean", "Is this always available? (hence times are irrelevant) e.g. 24 hour service.", 0, java.lang.Integer.MAX_VALUE, allDay)); + childrenList.add(new Property("availableStartTime", "time", "The opening time of day. Note: If the AllDay flag is set, then this time is ignored.", 0, java.lang.Integer.MAX_VALUE, availableStartTime)); + childrenList.add(new Property("availableEndTime", "time", "The closing time of day. Note: If the AllDay flag is set, then this time is ignored.", 0, java.lang.Integer.MAX_VALUE, availableEndTime)); + } + + public HealthcareServiceAvailableTimeComponent copy() { + HealthcareServiceAvailableTimeComponent dst = new HealthcareServiceAvailableTimeComponent(); + copyValues(dst); + if (daysOfWeek != null) { + dst.daysOfWeek = new ArrayList>(); + for (Enumeration i : daysOfWeek) + dst.daysOfWeek.add(i.copy()); + }; + dst.allDay = allDay == null ? null : allDay.copy(); + dst.availableStartTime = availableStartTime == null ? null : availableStartTime.copy(); + dst.availableEndTime = availableEndTime == null ? null : availableEndTime.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof HealthcareServiceAvailableTimeComponent)) + return false; + HealthcareServiceAvailableTimeComponent o = (HealthcareServiceAvailableTimeComponent) other; + return compareDeep(daysOfWeek, o.daysOfWeek, true) && compareDeep(allDay, o.allDay, true) && compareDeep(availableStartTime, o.availableStartTime, true) + && compareDeep(availableEndTime, o.availableEndTime, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof HealthcareServiceAvailableTimeComponent)) + return false; + HealthcareServiceAvailableTimeComponent o = (HealthcareServiceAvailableTimeComponent) other; + return compareValues(daysOfWeek, o.daysOfWeek, true) && compareValues(allDay, o.allDay, true) && compareValues(availableStartTime, o.availableStartTime, true) + && compareValues(availableEndTime, o.availableEndTime, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (daysOfWeek == null || daysOfWeek.isEmpty()) && (allDay == null || allDay.isEmpty()) + && (availableStartTime == null || availableStartTime.isEmpty()) && (availableEndTime == null || availableEndTime.isEmpty()) + ; + } + + } + + @Block() + public static class HealthcareServiceNotAvailableComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The reason that can be presented to the user as to why this time is not available. + */ + @Child(name = "description", type = {StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="The reason that can be presented to the user as to why this time is not available", formalDefinition="The reason that can be presented to the user as to why this time is not available." ) + protected StringType description; + + /** + * Service is not available (seasonally or for a public holiday) from this date. + */ + @Child(name = "during", type = {Period.class}, order=2, min=0, max=1) + @Description(shortDefinition="Service is not available (seasonally or for a public holiday) from this date", formalDefinition="Service is not available (seasonally or for a public holiday) from this date." ) + protected Period during; + + private static final long serialVersionUID = 310849929L; + + /* + * Constructor + */ + public HealthcareServiceNotAvailableComponent() { + super(); + } + + /* + * Constructor + */ + public HealthcareServiceNotAvailableComponent(StringType description) { + super(); + this.description = description; + } + + /** + * @return {@link #description} (The reason that can be presented to the user as to why this time is not available.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareServiceNotAvailableComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (The reason that can be presented to the user as to why this time is not available.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public HealthcareServiceNotAvailableComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return The reason that can be presented to the user as to why this time is not available. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value The reason that can be presented to the user as to why this time is not available. + */ + public HealthcareServiceNotAvailableComponent setDescription(String value) { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + return this; + } + + /** + * @return {@link #during} (Service is not available (seasonally or for a public holiday) from this date.) + */ + public Period getDuring() { + if (this.during == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareServiceNotAvailableComponent.during"); + else if (Configuration.doAutoCreate()) + this.during = new Period(); // cc + return this.during; + } + + public boolean hasDuring() { + return this.during != null && !this.during.isEmpty(); + } + + /** + * @param value {@link #during} (Service is not available (seasonally or for a public holiday) from this date.) + */ + public HealthcareServiceNotAvailableComponent setDuring(Period value) { + this.during = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("description", "string", "The reason that can be presented to the user as to why this time is not available.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("during", "Period", "Service is not available (seasonally or for a public holiday) from this date.", 0, java.lang.Integer.MAX_VALUE, during)); + } + + public HealthcareServiceNotAvailableComponent copy() { + HealthcareServiceNotAvailableComponent dst = new HealthcareServiceNotAvailableComponent(); + copyValues(dst); + dst.description = description == null ? null : description.copy(); + dst.during = during == null ? null : during.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof HealthcareServiceNotAvailableComponent)) + return false; + HealthcareServiceNotAvailableComponent o = (HealthcareServiceNotAvailableComponent) other; + return compareDeep(description, o.description, true) && compareDeep(during, o.during, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof HealthcareServiceNotAvailableComponent)) + return false; + HealthcareServiceNotAvailableComponent o = (HealthcareServiceNotAvailableComponent) other; + return compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (description == null || description.isEmpty()) && (during == null || during.isEmpty()) + ; + } + + } + + /** + * External Identifiers for this item. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Identifiers for this item", formalDefinition="External Identifiers for this item." ) + protected List identifier; + + /** + * The organization that provides this Healthcare Service. + */ + @Child(name = "providedBy", type = {Organization.class}, order=1, min=0, max=1) + @Description(shortDefinition="The organization that provides this Healthcare Service", formalDefinition="The organization that provides this Healthcare Service." ) + protected Reference providedBy; + + /** + * The actual object that is the target of the reference (The organization that provides this Healthcare Service.) + */ + protected Organization providedByTarget; + + /** + * The location where this healthcare service may be provided. + */ + @Child(name = "location", type = {Location.class}, order=2, min=1, max=1) + @Description(shortDefinition="The location where this healthcare service may be provided", formalDefinition="The location where this healthcare service may be provided." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (The location where this healthcare service may be provided.) + */ + protected Location locationTarget; + + /** + * Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type. + */ + @Child(name = "serviceCategory", type = {CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type", formalDefinition="Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type." ) + protected CodeableConcept serviceCategory; + + /** + * A specific type of service that may be delivered or performed. + */ + @Child(name = "serviceType", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A specific type of service that may be delivered or performed", formalDefinition="A specific type of service that may be delivered or performed." ) + protected List serviceType; + + /** + * Further description of the service as it would be presented to a consumer while searching. + */ + @Child(name = "serviceName", type = {StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Further description of the service as it would be presented to a consumer while searching", formalDefinition="Further description of the service as it would be presented to a consumer while searching." ) + protected StringType serviceName; + + /** + * Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName. + */ + @Child(name = "comment", type = {StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName", formalDefinition="Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName." ) + protected StringType comment; + + /** + * Extra details about the service that can't be placed in the other fields. + */ + @Child(name = "extraDetails", type = {StringType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Extra details about the service that can't be placed in the other fields", formalDefinition="Extra details about the service that can't be placed in the other fields." ) + protected StringType extraDetails; + + /** + * If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list. + */ + @Child(name = "photo", type = {Attachment.class}, order=8, min=0, max=1) + @Description(shortDefinition="If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list", formalDefinition="If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list." ) + protected Attachment photo; + + /** + * List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts", formalDefinition="List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts." ) + protected List telecom; + + /** + * The location(s) that this service is available to (not where the service is provided). + */ + @Child(name = "coverageArea", type = {Location.class}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The location(s) that this service is available to (not where the service is provided)", formalDefinition="The location(s) that this service is available to (not where the service is provided)." ) + protected List coverageArea; + /** + * The actual objects that are the target of the reference (The location(s) that this service is available to (not where the service is provided).) + */ + protected List coverageAreaTarget; + + + /** + * The code(s) that detail the conditions under which the healthcare service is available/offered. + */ + @Child(name = "serviceProvisionCode", type = {CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The code(s) that detail the conditions under which the healthcare service is available/offered", formalDefinition="The code(s) that detail the conditions under which the healthcare service is available/offered." ) + protected List serviceProvisionCode; + + /** + * Does this service have specific eligibility requirements that need to be met in order to use the service. + */ + @Child(name = "eligibility", type = {CodeableConcept.class}, order=12, min=0, max=1) + @Description(shortDefinition="Does this service have specific eligibility requirements that need to be met in order to use the service", formalDefinition="Does this service have specific eligibility requirements that need to be met in order to use the service." ) + protected CodeableConcept eligibility; + + /** + * The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page. + */ + @Child(name = "eligibilityNote", type = {StringType.class}, order=13, min=0, max=1) + @Description(shortDefinition="Describes the eligibility conditions for the service", formalDefinition="The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page." ) + protected StringType eligibilityNote; + + /** + * Program Names that can be used to categorize the service. + */ + @Child(name = "programName", type = {StringType.class}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Program Names that can be used to categorize the service", formalDefinition="Program Names that can be used to categorize the service." ) + protected List programName; + + /** + * Collection of Characteristics (attributes). + */ + @Child(name = "characteristic", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Collection of Characteristics (attributes)", formalDefinition="Collection of Characteristics (attributes)." ) + protected List characteristic; + + /** + * Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required. + */ + @Child(name = "referralMethod", type = {CodeableConcept.class}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Ways that the service accepts referrals", formalDefinition="Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required." ) + protected List referralMethod; + + /** + * The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available. + */ + @Child(name = "publicKey", type = {StringType.class}, order=17, min=0, max=1) + @Description(shortDefinition="The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available", formalDefinition="The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available." ) + protected StringType publicKey; + + /** + * Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service. + */ + @Child(name = "appointmentRequired", type = {BooleanType.class}, order=18, min=0, max=1) + @Description(shortDefinition="Indicates if an appointment is required for access to this service", formalDefinition="Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service." ) + protected BooleanType appointmentRequired; + + /** + * A Collection of times that the Service Site is available. + */ + @Child(name = "availableTime", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A Collection of times that the Service Site is available", formalDefinition="A Collection of times that the Service Site is available." ) + protected List availableTime; + + /** + * The HealthcareService is not available during this period of time due to the provided reason. + */ + @Child(name = "notAvailable", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The HealthcareService is not available during this period of time due to the provided reason", formalDefinition="The HealthcareService is not available during this period of time due to the provided reason." ) + protected List notAvailable; + + /** + * A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times. + */ + @Child(name = "availabilityExceptions", type = {StringType.class}, order=21, min=0, max=1) + @Description(shortDefinition="A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times", formalDefinition="A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times." ) + protected StringType availabilityExceptions; + + private static final long serialVersionUID = 543354370L; + + /* + * Constructor + */ + public HealthcareService() { + super(); + } + + /* + * Constructor + */ + public HealthcareService(Reference location) { + super(); + this.location = location; + } + + /** + * @return {@link #identifier} (External Identifiers for this item.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (External Identifiers for this item.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public HealthcareService addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #providedBy} (The organization that provides this Healthcare Service.) + */ + public Reference getProvidedBy() { + if (this.providedBy == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.providedBy"); + else if (Configuration.doAutoCreate()) + this.providedBy = new Reference(); // cc + return this.providedBy; + } + + public boolean hasProvidedBy() { + return this.providedBy != null && !this.providedBy.isEmpty(); + } + + /** + * @param value {@link #providedBy} (The organization that provides this Healthcare Service.) + */ + public HealthcareService setProvidedBy(Reference value) { + this.providedBy = value; + return this; + } + + /** + * @return {@link #providedBy} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization that provides this Healthcare Service.) + */ + public Organization getProvidedByTarget() { + if (this.providedByTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.providedBy"); + else if (Configuration.doAutoCreate()) + this.providedByTarget = new Organization(); // aa + return this.providedByTarget; + } + + /** + * @param value {@link #providedBy} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization that provides this Healthcare Service.) + */ + public HealthcareService setProvidedByTarget(Organization value) { + this.providedByTarget = value; + return this; + } + + /** + * @return {@link #location} (The location where this healthcare service may be provided.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); // cc + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (The location where this healthcare service may be provided.) + */ + public HealthcareService setLocation(Reference value) { + this.location = value; + return this; + } + + /** + * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The location where this healthcare service may be provided.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); // aa + return this.locationTarget; + } + + /** + * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The location where this healthcare service may be provided.) + */ + public HealthcareService setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #serviceCategory} (Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type.) + */ + public CodeableConcept getServiceCategory() { + if (this.serviceCategory == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.serviceCategory"); + else if (Configuration.doAutoCreate()) + this.serviceCategory = new CodeableConcept(); // cc + return this.serviceCategory; + } + + public boolean hasServiceCategory() { + return this.serviceCategory != null && !this.serviceCategory.isEmpty(); + } + + /** + * @param value {@link #serviceCategory} (Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type.) + */ + public HealthcareService setServiceCategory(CodeableConcept value) { + this.serviceCategory = value; + return this; + } + + /** + * @return {@link #serviceType} (A specific type of service that may be delivered or performed.) + */ + public List getServiceType() { + if (this.serviceType == null) + this.serviceType = new ArrayList(); + return this.serviceType; + } + + public boolean hasServiceType() { + if (this.serviceType == null) + return false; + for (ServiceTypeComponent item : this.serviceType) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #serviceType} (A specific type of service that may be delivered or performed.) + */ + // syntactic sugar + public ServiceTypeComponent addServiceType() { //3 + ServiceTypeComponent t = new ServiceTypeComponent(); + if (this.serviceType == null) + this.serviceType = new ArrayList(); + this.serviceType.add(t); + return t; + } + + // syntactic sugar + public HealthcareService addServiceType(ServiceTypeComponent t) { //3 + if (t == null) + return this; + if (this.serviceType == null) + this.serviceType = new ArrayList(); + this.serviceType.add(t); + return this; + } + + /** + * @return {@link #serviceName} (Further description of the service as it would be presented to a consumer while searching.). This is the underlying object with id, value and extensions. The accessor "getServiceName" gives direct access to the value + */ + public StringType getServiceNameElement() { + if (this.serviceName == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.serviceName"); + else if (Configuration.doAutoCreate()) + this.serviceName = new StringType(); // bb + return this.serviceName; + } + + public boolean hasServiceNameElement() { + return this.serviceName != null && !this.serviceName.isEmpty(); + } + + public boolean hasServiceName() { + return this.serviceName != null && !this.serviceName.isEmpty(); + } + + /** + * @param value {@link #serviceName} (Further description of the service as it would be presented to a consumer while searching.). This is the underlying object with id, value and extensions. The accessor "getServiceName" gives direct access to the value + */ + public HealthcareService setServiceNameElement(StringType value) { + this.serviceName = value; + return this; + } + + /** + * @return Further description of the service as it would be presented to a consumer while searching. + */ + public String getServiceName() { + return this.serviceName == null ? null : this.serviceName.getValue(); + } + + /** + * @param value Further description of the service as it would be presented to a consumer while searching. + */ + public HealthcareService setServiceName(String value) { + if (Utilities.noString(value)) + this.serviceName = null; + else { + if (this.serviceName == null) + this.serviceName = new StringType(); + this.serviceName.setValue(value); + } + return this; + } + + /** + * @return {@link #comment} (Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); // bb + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public HealthcareService setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName. + */ + public HealthcareService setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + /** + * @return {@link #extraDetails} (Extra details about the service that can't be placed in the other fields.). This is the underlying object with id, value and extensions. The accessor "getExtraDetails" gives direct access to the value + */ + public StringType getExtraDetailsElement() { + if (this.extraDetails == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.extraDetails"); + else if (Configuration.doAutoCreate()) + this.extraDetails = new StringType(); // bb + return this.extraDetails; + } + + public boolean hasExtraDetailsElement() { + return this.extraDetails != null && !this.extraDetails.isEmpty(); + } + + public boolean hasExtraDetails() { + return this.extraDetails != null && !this.extraDetails.isEmpty(); + } + + /** + * @param value {@link #extraDetails} (Extra details about the service that can't be placed in the other fields.). This is the underlying object with id, value and extensions. The accessor "getExtraDetails" gives direct access to the value + */ + public HealthcareService setExtraDetailsElement(StringType value) { + this.extraDetails = value; + return this; + } + + /** + * @return Extra details about the service that can't be placed in the other fields. + */ + public String getExtraDetails() { + return this.extraDetails == null ? null : this.extraDetails.getValue(); + } + + /** + * @param value Extra details about the service that can't be placed in the other fields. + */ + public HealthcareService setExtraDetails(String value) { + if (Utilities.noString(value)) + this.extraDetails = null; + else { + if (this.extraDetails == null) + this.extraDetails = new StringType(); + this.extraDetails.setValue(value); + } + return this; + } + + /** + * @return {@link #photo} (If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list.) + */ + public Attachment getPhoto() { + if (this.photo == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.photo"); + else if (Configuration.doAutoCreate()) + this.photo = new Attachment(); // cc + return this.photo; + } + + public boolean hasPhoto() { + return this.photo != null && !this.photo.isEmpty(); + } + + /** + * @param value {@link #photo} (If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list.) + */ + public HealthcareService setPhoto(Attachment value) { + this.photo = value; + return this; + } + + /** + * @return {@link #telecom} (List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public HealthcareService addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @return {@link #coverageArea} (The location(s) that this service is available to (not where the service is provided).) + */ + public List getCoverageArea() { + if (this.coverageArea == null) + this.coverageArea = new ArrayList(); + return this.coverageArea; + } + + public boolean hasCoverageArea() { + if (this.coverageArea == null) + return false; + for (Reference item : this.coverageArea) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #coverageArea} (The location(s) that this service is available to (not where the service is provided).) + */ + // syntactic sugar + public Reference addCoverageArea() { //3 + Reference t = new Reference(); + if (this.coverageArea == null) + this.coverageArea = new ArrayList(); + this.coverageArea.add(t); + return t; + } + + // syntactic sugar + public HealthcareService addCoverageArea(Reference t) { //3 + if (t == null) + return this; + if (this.coverageArea == null) + this.coverageArea = new ArrayList(); + this.coverageArea.add(t); + return this; + } + + /** + * @return {@link #coverageArea} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The location(s) that this service is available to (not where the service is provided).) + */ + public List getCoverageAreaTarget() { + if (this.coverageAreaTarget == null) + this.coverageAreaTarget = new ArrayList(); + return this.coverageAreaTarget; + } + + // syntactic sugar + /** + * @return {@link #coverageArea} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The location(s) that this service is available to (not where the service is provided).) + */ + public Location addCoverageAreaTarget() { + Location r = new Location(); + if (this.coverageAreaTarget == null) + this.coverageAreaTarget = new ArrayList(); + this.coverageAreaTarget.add(r); + return r; + } + + /** + * @return {@link #serviceProvisionCode} (The code(s) that detail the conditions under which the healthcare service is available/offered.) + */ + public List getServiceProvisionCode() { + if (this.serviceProvisionCode == null) + this.serviceProvisionCode = new ArrayList(); + return this.serviceProvisionCode; + } + + public boolean hasServiceProvisionCode() { + if (this.serviceProvisionCode == null) + return false; + for (CodeableConcept item : this.serviceProvisionCode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #serviceProvisionCode} (The code(s) that detail the conditions under which the healthcare service is available/offered.) + */ + // syntactic sugar + public CodeableConcept addServiceProvisionCode() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.serviceProvisionCode == null) + this.serviceProvisionCode = new ArrayList(); + this.serviceProvisionCode.add(t); + return t; + } + + // syntactic sugar + public HealthcareService addServiceProvisionCode(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.serviceProvisionCode == null) + this.serviceProvisionCode = new ArrayList(); + this.serviceProvisionCode.add(t); + return this; + } + + /** + * @return {@link #eligibility} (Does this service have specific eligibility requirements that need to be met in order to use the service.) + */ + public CodeableConcept getEligibility() { + if (this.eligibility == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.eligibility"); + else if (Configuration.doAutoCreate()) + this.eligibility = new CodeableConcept(); // cc + return this.eligibility; + } + + public boolean hasEligibility() { + return this.eligibility != null && !this.eligibility.isEmpty(); + } + + /** + * @param value {@link #eligibility} (Does this service have specific eligibility requirements that need to be met in order to use the service.) + */ + public HealthcareService setEligibility(CodeableConcept value) { + this.eligibility = value; + return this; + } + + /** + * @return {@link #eligibilityNote} (The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page.). This is the underlying object with id, value and extensions. The accessor "getEligibilityNote" gives direct access to the value + */ + public StringType getEligibilityNoteElement() { + if (this.eligibilityNote == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.eligibilityNote"); + else if (Configuration.doAutoCreate()) + this.eligibilityNote = new StringType(); // bb + return this.eligibilityNote; + } + + public boolean hasEligibilityNoteElement() { + return this.eligibilityNote != null && !this.eligibilityNote.isEmpty(); + } + + public boolean hasEligibilityNote() { + return this.eligibilityNote != null && !this.eligibilityNote.isEmpty(); + } + + /** + * @param value {@link #eligibilityNote} (The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page.). This is the underlying object with id, value and extensions. The accessor "getEligibilityNote" gives direct access to the value + */ + public HealthcareService setEligibilityNoteElement(StringType value) { + this.eligibilityNote = value; + return this; + } + + /** + * @return The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page. + */ + public String getEligibilityNote() { + return this.eligibilityNote == null ? null : this.eligibilityNote.getValue(); + } + + /** + * @param value The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page. + */ + public HealthcareService setEligibilityNote(String value) { + if (Utilities.noString(value)) + this.eligibilityNote = null; + else { + if (this.eligibilityNote == null) + this.eligibilityNote = new StringType(); + this.eligibilityNote.setValue(value); + } + return this; + } + + /** + * @return {@link #programName} (Program Names that can be used to categorize the service.) + */ + public List getProgramName() { + if (this.programName == null) + this.programName = new ArrayList(); + return this.programName; + } + + public boolean hasProgramName() { + if (this.programName == null) + return false; + for (StringType item : this.programName) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #programName} (Program Names that can be used to categorize the service.) + */ + // syntactic sugar + public StringType addProgramNameElement() {//2 + StringType t = new StringType(); + if (this.programName == null) + this.programName = new ArrayList(); + this.programName.add(t); + return t; + } + + /** + * @param value {@link #programName} (Program Names that can be used to categorize the service.) + */ + public HealthcareService addProgramName(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.programName == null) + this.programName = new ArrayList(); + this.programName.add(t); + return this; + } + + /** + * @param value {@link #programName} (Program Names that can be used to categorize the service.) + */ + public boolean hasProgramName(String value) { + if (this.programName == null) + return false; + for (StringType v : this.programName) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #characteristic} (Collection of Characteristics (attributes).) + */ + public List getCharacteristic() { + if (this.characteristic == null) + this.characteristic = new ArrayList(); + return this.characteristic; + } + + public boolean hasCharacteristic() { + if (this.characteristic == null) + return false; + for (CodeableConcept item : this.characteristic) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #characteristic} (Collection of Characteristics (attributes).) + */ + // syntactic sugar + public CodeableConcept addCharacteristic() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.characteristic == null) + this.characteristic = new ArrayList(); + this.characteristic.add(t); + return t; + } + + // syntactic sugar + public HealthcareService addCharacteristic(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.characteristic == null) + this.characteristic = new ArrayList(); + this.characteristic.add(t); + return this; + } + + /** + * @return {@link #referralMethod} (Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required.) + */ + public List getReferralMethod() { + if (this.referralMethod == null) + this.referralMethod = new ArrayList(); + return this.referralMethod; + } + + public boolean hasReferralMethod() { + if (this.referralMethod == null) + return false; + for (CodeableConcept item : this.referralMethod) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #referralMethod} (Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required.) + */ + // syntactic sugar + public CodeableConcept addReferralMethod() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.referralMethod == null) + this.referralMethod = new ArrayList(); + this.referralMethod.add(t); + return t; + } + + // syntactic sugar + public HealthcareService addReferralMethod(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.referralMethod == null) + this.referralMethod = new ArrayList(); + this.referralMethod.add(t); + return this; + } + + /** + * @return {@link #publicKey} (The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available.). This is the underlying object with id, value and extensions. The accessor "getPublicKey" gives direct access to the value + */ + public StringType getPublicKeyElement() { + if (this.publicKey == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.publicKey"); + else if (Configuration.doAutoCreate()) + this.publicKey = new StringType(); // bb + return this.publicKey; + } + + public boolean hasPublicKeyElement() { + return this.publicKey != null && !this.publicKey.isEmpty(); + } + + public boolean hasPublicKey() { + return this.publicKey != null && !this.publicKey.isEmpty(); + } + + /** + * @param value {@link #publicKey} (The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available.). This is the underlying object with id, value and extensions. The accessor "getPublicKey" gives direct access to the value + */ + public HealthcareService setPublicKeyElement(StringType value) { + this.publicKey = value; + return this; + } + + /** + * @return The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available. + */ + public String getPublicKey() { + return this.publicKey == null ? null : this.publicKey.getValue(); + } + + /** + * @param value The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available. + */ + public HealthcareService setPublicKey(String value) { + if (Utilities.noString(value)) + this.publicKey = null; + else { + if (this.publicKey == null) + this.publicKey = new StringType(); + this.publicKey.setValue(value); + } + return this; + } + + /** + * @return {@link #appointmentRequired} (Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service.). This is the underlying object with id, value and extensions. The accessor "getAppointmentRequired" gives direct access to the value + */ + public BooleanType getAppointmentRequiredElement() { + if (this.appointmentRequired == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.appointmentRequired"); + else if (Configuration.doAutoCreate()) + this.appointmentRequired = new BooleanType(); // bb + return this.appointmentRequired; + } + + public boolean hasAppointmentRequiredElement() { + return this.appointmentRequired != null && !this.appointmentRequired.isEmpty(); + } + + public boolean hasAppointmentRequired() { + return this.appointmentRequired != null && !this.appointmentRequired.isEmpty(); + } + + /** + * @param value {@link #appointmentRequired} (Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service.). This is the underlying object with id, value and extensions. The accessor "getAppointmentRequired" gives direct access to the value + */ + public HealthcareService setAppointmentRequiredElement(BooleanType value) { + this.appointmentRequired = value; + return this; + } + + /** + * @return Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service. + */ + public boolean getAppointmentRequired() { + return this.appointmentRequired == null || this.appointmentRequired.isEmpty() ? false : this.appointmentRequired.getValue(); + } + + /** + * @param value Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service. + */ + public HealthcareService setAppointmentRequired(boolean value) { + if (this.appointmentRequired == null) + this.appointmentRequired = new BooleanType(); + this.appointmentRequired.setValue(value); + return this; + } + + /** + * @return {@link #availableTime} (A Collection of times that the Service Site is available.) + */ + public List getAvailableTime() { + if (this.availableTime == null) + this.availableTime = new ArrayList(); + return this.availableTime; + } + + public boolean hasAvailableTime() { + if (this.availableTime == null) + return false; + for (HealthcareServiceAvailableTimeComponent item : this.availableTime) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #availableTime} (A Collection of times that the Service Site is available.) + */ + // syntactic sugar + public HealthcareServiceAvailableTimeComponent addAvailableTime() { //3 + HealthcareServiceAvailableTimeComponent t = new HealthcareServiceAvailableTimeComponent(); + if (this.availableTime == null) + this.availableTime = new ArrayList(); + this.availableTime.add(t); + return t; + } + + // syntactic sugar + public HealthcareService addAvailableTime(HealthcareServiceAvailableTimeComponent t) { //3 + if (t == null) + return this; + if (this.availableTime == null) + this.availableTime = new ArrayList(); + this.availableTime.add(t); + return this; + } + + /** + * @return {@link #notAvailable} (The HealthcareService is not available during this period of time due to the provided reason.) + */ + public List getNotAvailable() { + if (this.notAvailable == null) + this.notAvailable = new ArrayList(); + return this.notAvailable; + } + + public boolean hasNotAvailable() { + if (this.notAvailable == null) + return false; + for (HealthcareServiceNotAvailableComponent item : this.notAvailable) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #notAvailable} (The HealthcareService is not available during this period of time due to the provided reason.) + */ + // syntactic sugar + public HealthcareServiceNotAvailableComponent addNotAvailable() { //3 + HealthcareServiceNotAvailableComponent t = new HealthcareServiceNotAvailableComponent(); + if (this.notAvailable == null) + this.notAvailable = new ArrayList(); + this.notAvailable.add(t); + return t; + } + + // syntactic sugar + public HealthcareService addNotAvailable(HealthcareServiceNotAvailableComponent t) { //3 + if (t == null) + return this; + if (this.notAvailable == null) + this.notAvailable = new ArrayList(); + this.notAvailable.add(t); + return this; + } + + /** + * @return {@link #availabilityExceptions} (A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times.). This is the underlying object with id, value and extensions. The accessor "getAvailabilityExceptions" gives direct access to the value + */ + public StringType getAvailabilityExceptionsElement() { + if (this.availabilityExceptions == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.availabilityExceptions"); + else if (Configuration.doAutoCreate()) + this.availabilityExceptions = new StringType(); // bb + return this.availabilityExceptions; + } + + public boolean hasAvailabilityExceptionsElement() { + return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty(); + } + + public boolean hasAvailabilityExceptions() { + return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty(); + } + + /** + * @param value {@link #availabilityExceptions} (A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times.). This is the underlying object with id, value and extensions. The accessor "getAvailabilityExceptions" gives direct access to the value + */ + public HealthcareService setAvailabilityExceptionsElement(StringType value) { + this.availabilityExceptions = value; + return this; + } + + /** + * @return A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times. + */ + public String getAvailabilityExceptions() { + return this.availabilityExceptions == null ? null : this.availabilityExceptions.getValue(); + } + + /** + * @param value A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times. + */ + public HealthcareService setAvailabilityExceptions(String value) { + if (Utilities.noString(value)) + this.availabilityExceptions = null; + else { + if (this.availabilityExceptions == null) + this.availabilityExceptions = new StringType(); + this.availabilityExceptions.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "External Identifiers for this item.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("providedBy", "Reference(Organization)", "The organization that provides this Healthcare Service.", 0, java.lang.Integer.MAX_VALUE, providedBy)); + childrenList.add(new Property("location", "Reference(Location)", "The location where this healthcare service may be provided.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("serviceCategory", "CodeableConcept", "Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type.", 0, java.lang.Integer.MAX_VALUE, serviceCategory)); + childrenList.add(new Property("serviceType", "", "A specific type of service that may be delivered or performed.", 0, java.lang.Integer.MAX_VALUE, serviceType)); + childrenList.add(new Property("serviceName", "string", "Further description of the service as it would be presented to a consumer while searching.", 0, java.lang.Integer.MAX_VALUE, serviceName)); + childrenList.add(new Property("comment", "string", "Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.", 0, java.lang.Integer.MAX_VALUE, comment)); + childrenList.add(new Property("extraDetails", "string", "Extra details about the service that can't be placed in the other fields.", 0, java.lang.Integer.MAX_VALUE, extraDetails)); + childrenList.add(new Property("photo", "Attachment", "If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list.", 0, java.lang.Integer.MAX_VALUE, photo)); + childrenList.add(new Property("telecom", "ContactPoint", "List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("coverageArea", "Reference(Location)", "The location(s) that this service is available to (not where the service is provided).", 0, java.lang.Integer.MAX_VALUE, coverageArea)); + childrenList.add(new Property("serviceProvisionCode", "CodeableConcept", "The code(s) that detail the conditions under which the healthcare service is available/offered.", 0, java.lang.Integer.MAX_VALUE, serviceProvisionCode)); + childrenList.add(new Property("eligibility", "CodeableConcept", "Does this service have specific eligibility requirements that need to be met in order to use the service.", 0, java.lang.Integer.MAX_VALUE, eligibility)); + childrenList.add(new Property("eligibilityNote", "string", "The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page.", 0, java.lang.Integer.MAX_VALUE, eligibilityNote)); + childrenList.add(new Property("programName", "string", "Program Names that can be used to categorize the service.", 0, java.lang.Integer.MAX_VALUE, programName)); + childrenList.add(new Property("characteristic", "CodeableConcept", "Collection of Characteristics (attributes).", 0, java.lang.Integer.MAX_VALUE, characteristic)); + childrenList.add(new Property("referralMethod", "CodeableConcept", "Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required.", 0, java.lang.Integer.MAX_VALUE, referralMethod)); + childrenList.add(new Property("publicKey", "string", "The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available.", 0, java.lang.Integer.MAX_VALUE, publicKey)); + childrenList.add(new Property("appointmentRequired", "boolean", "Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service.", 0, java.lang.Integer.MAX_VALUE, appointmentRequired)); + childrenList.add(new Property("availableTime", "", "A Collection of times that the Service Site is available.", 0, java.lang.Integer.MAX_VALUE, availableTime)); + childrenList.add(new Property("notAvailable", "", "The HealthcareService is not available during this period of time due to the provided reason.", 0, java.lang.Integer.MAX_VALUE, notAvailable)); + childrenList.add(new Property("availabilityExceptions", "string", "A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times.", 0, java.lang.Integer.MAX_VALUE, availabilityExceptions)); + } + + public HealthcareService copy() { + HealthcareService dst = new HealthcareService(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.providedBy = providedBy == null ? null : providedBy.copy(); + dst.location = location == null ? null : location.copy(); + dst.serviceCategory = serviceCategory == null ? null : serviceCategory.copy(); + if (serviceType != null) { + dst.serviceType = new ArrayList(); + for (ServiceTypeComponent i : serviceType) + dst.serviceType.add(i.copy()); + }; + dst.serviceName = serviceName == null ? null : serviceName.copy(); + dst.comment = comment == null ? null : comment.copy(); + dst.extraDetails = extraDetails == null ? null : extraDetails.copy(); + dst.photo = photo == null ? null : photo.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + if (coverageArea != null) { + dst.coverageArea = new ArrayList(); + for (Reference i : coverageArea) + dst.coverageArea.add(i.copy()); + }; + if (serviceProvisionCode != null) { + dst.serviceProvisionCode = new ArrayList(); + for (CodeableConcept i : serviceProvisionCode) + dst.serviceProvisionCode.add(i.copy()); + }; + dst.eligibility = eligibility == null ? null : eligibility.copy(); + dst.eligibilityNote = eligibilityNote == null ? null : eligibilityNote.copy(); + if (programName != null) { + dst.programName = new ArrayList(); + for (StringType i : programName) + dst.programName.add(i.copy()); + }; + if (characteristic != null) { + dst.characteristic = new ArrayList(); + for (CodeableConcept i : characteristic) + dst.characteristic.add(i.copy()); + }; + if (referralMethod != null) { + dst.referralMethod = new ArrayList(); + for (CodeableConcept i : referralMethod) + dst.referralMethod.add(i.copy()); + }; + dst.publicKey = publicKey == null ? null : publicKey.copy(); + dst.appointmentRequired = appointmentRequired == null ? null : appointmentRequired.copy(); + if (availableTime != null) { + dst.availableTime = new ArrayList(); + for (HealthcareServiceAvailableTimeComponent i : availableTime) + dst.availableTime.add(i.copy()); + }; + if (notAvailable != null) { + dst.notAvailable = new ArrayList(); + for (HealthcareServiceNotAvailableComponent i : notAvailable) + dst.notAvailable.add(i.copy()); + }; + dst.availabilityExceptions = availabilityExceptions == null ? null : availabilityExceptions.copy(); + return dst; + } + + protected HealthcareService typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof HealthcareService)) + return false; + HealthcareService o = (HealthcareService) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(providedBy, o.providedBy, true) + && compareDeep(location, o.location, true) && compareDeep(serviceCategory, o.serviceCategory, true) + && compareDeep(serviceType, o.serviceType, true) && compareDeep(serviceName, o.serviceName, true) + && compareDeep(comment, o.comment, true) && compareDeep(extraDetails, o.extraDetails, true) && compareDeep(photo, o.photo, true) + && compareDeep(telecom, o.telecom, true) && compareDeep(coverageArea, o.coverageArea, true) && compareDeep(serviceProvisionCode, o.serviceProvisionCode, true) + && compareDeep(eligibility, o.eligibility, true) && compareDeep(eligibilityNote, o.eligibilityNote, true) + && compareDeep(programName, o.programName, true) && compareDeep(characteristic, o.characteristic, true) + && compareDeep(referralMethod, o.referralMethod, true) && compareDeep(publicKey, o.publicKey, true) + && compareDeep(appointmentRequired, o.appointmentRequired, true) && compareDeep(availableTime, o.availableTime, true) + && compareDeep(notAvailable, o.notAvailable, true) && compareDeep(availabilityExceptions, o.availabilityExceptions, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof HealthcareService)) + return false; + HealthcareService o = (HealthcareService) other; + return compareValues(serviceName, o.serviceName, true) && compareValues(comment, o.comment, true) && compareValues(extraDetails, o.extraDetails, true) + && compareValues(eligibilityNote, o.eligibilityNote, true) && compareValues(programName, o.programName, true) + && compareValues(publicKey, o.publicKey, true) && compareValues(appointmentRequired, o.appointmentRequired, true) + && compareValues(availabilityExceptions, o.availabilityExceptions, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (providedBy == null || providedBy.isEmpty()) + && (location == null || location.isEmpty()) && (serviceCategory == null || serviceCategory.isEmpty()) + && (serviceType == null || serviceType.isEmpty()) && (serviceName == null || serviceName.isEmpty()) + && (comment == null || comment.isEmpty()) && (extraDetails == null || extraDetails.isEmpty()) + && (photo == null || photo.isEmpty()) && (telecom == null || telecom.isEmpty()) && (coverageArea == null || coverageArea.isEmpty()) + && (serviceProvisionCode == null || serviceProvisionCode.isEmpty()) && (eligibility == null || eligibility.isEmpty()) + && (eligibilityNote == null || eligibilityNote.isEmpty()) && (programName == null || programName.isEmpty()) + && (characteristic == null || characteristic.isEmpty()) && (referralMethod == null || referralMethod.isEmpty()) + && (publicKey == null || publicKey.isEmpty()) && (appointmentRequired == null || appointmentRequired.isEmpty()) + && (availableTime == null || availableTime.isEmpty()) && (notAvailable == null || notAvailable.isEmpty()) + && (availabilityExceptions == null || availabilityExceptions.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.HealthcareService; + } + + @SearchParamDefinition(name="servicecategory", path="HealthcareService.serviceCategory", description="Service Category of the Healthcare Service", type="token" ) + public static final String SP_SERVICECATEGORY = "servicecategory"; + @SearchParamDefinition(name="servicetype", path="HealthcareService.serviceType.type", description="The type of service provided by this healthcare service", type="token" ) + public static final String SP_SERVICETYPE = "servicetype"; + @SearchParamDefinition(name="organization", path="HealthcareService.providedBy", description="The organization that provides this Healthcare Service", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + @SearchParamDefinition(name="name", path="HealthcareService.serviceName", description="A portion of the Healthcare service name", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="programname", path="HealthcareService.programName", description="One of the Program Names serviced by this HealthcareService", type="string" ) + public static final String SP_PROGRAMNAME = "programname"; + @SearchParamDefinition(name="location", path="HealthcareService.location", description="The location of the Healthcare Service", type="reference" ) + public static final String SP_LOCATION = "location"; + @SearchParamDefinition(name="characteristic", path="HealthcareService.characteristic", description="One of the HealthcareService's characteristics", type="token" ) + public static final String SP_CHARACTERISTIC = "characteristic"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/HumanName.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/HumanName.java index 0ee973db90e..e236cfef150 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/HumanName.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/HumanName.java @@ -1,683 +1,662 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A human's name with the ability to identify parts and usage. - */ -@DatatypeDef(name="HumanName") -public class HumanName extends Type implements ICompositeType { - - public enum NameUse { - /** - * Known as/conventional/the one you normally use. - */ - USUAL, - /** - * The formal name as registered in an official (government) registry, but which name might not be commonly used. May be called "legal name". - */ - OFFICIAL, - /** - * A temporary name. Name.period can provide more detailed information. This may also be used for temporary names assigned at birth or in emergency situations. - */ - TEMP, - /** - * A name that is used to address the person in an informal manner, but is not part of their formal or usual name. - */ - NICKNAME, - /** - * Anonymous assigned name, alias, or pseudonym (used to protect a person's identity for privacy reasons). - */ - ANONYMOUS, - /** - * This name is no longer in use (or was never correct, but retained for records). - */ - OLD, - /** - * A name used prior to marriage. Marriage naming customs vary greatly around the world. This name use is for use by applications that collect and store "maiden" names. Though the concept of maiden name is often gender specific, the use of this term is not gender specific. The use of this term does not imply any particular history for a person's name, nor should the maiden name be determined algorithmically. - */ - MAIDEN, - /** - * added to help the parsers - */ - NULL; - public static NameUse fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("usual".equals(codeString)) - return USUAL; - if ("official".equals(codeString)) - return OFFICIAL; - if ("temp".equals(codeString)) - return TEMP; - if ("nickname".equals(codeString)) - return NICKNAME; - if ("anonymous".equals(codeString)) - return ANONYMOUS; - if ("old".equals(codeString)) - return OLD; - if ("maiden".equals(codeString)) - return MAIDEN; - throw new Exception("Unknown NameUse code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case USUAL: return "usual"; - case OFFICIAL: return "official"; - case TEMP: return "temp"; - case NICKNAME: return "nickname"; - case ANONYMOUS: return "anonymous"; - case OLD: return "old"; - case MAIDEN: return "maiden"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case USUAL: return ""; - case OFFICIAL: return ""; - case TEMP: return ""; - case NICKNAME: return ""; - case ANONYMOUS: return ""; - case OLD: return ""; - case MAIDEN: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case USUAL: return "Known as/conventional/the one you normally use."; - case OFFICIAL: return "The formal name as registered in an official (government) registry, but which name might not be commonly used. May be called 'legal name'."; - case TEMP: return "A temporary name. Name.period can provide more detailed information. This may also be used for temporary names assigned at birth or in emergency situations."; - case NICKNAME: return "A name that is used to address the person in an informal manner, but is not part of their formal or usual name."; - case ANONYMOUS: return "Anonymous assigned name, alias, or pseudonym (used to protect a person's identity for privacy reasons)."; - case OLD: return "This name is no longer in use (or was never correct, but retained for records)."; - case MAIDEN: return "A name used prior to marriage. Marriage naming customs vary greatly around the world. This name use is for use by applications that collect and store 'maiden' names. Though the concept of maiden name is often gender specific, the use of this term is not gender specific. The use of this term does not imply any particular history for a person's name, nor should the maiden name be determined algorithmically."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case USUAL: return "Usual"; - case OFFICIAL: return "Official"; - case TEMP: return "Temp"; - case NICKNAME: return "Nickname"; - case ANONYMOUS: return "Anonymous"; - case OLD: return "Old"; - case MAIDEN: return "Maiden"; - default: return "?"; - } - } - } - - public static class NameUseEnumFactory implements EnumFactory { - public NameUse fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("usual".equals(codeString)) - return NameUse.USUAL; - if ("official".equals(codeString)) - return NameUse.OFFICIAL; - if ("temp".equals(codeString)) - return NameUse.TEMP; - if ("nickname".equals(codeString)) - return NameUse.NICKNAME; - if ("anonymous".equals(codeString)) - return NameUse.ANONYMOUS; - if ("old".equals(codeString)) - return NameUse.OLD; - if ("maiden".equals(codeString)) - return NameUse.MAIDEN; - throw new IllegalArgumentException("Unknown NameUse code '"+codeString+"'"); - } - public String toCode(NameUse code) { - if (code == NameUse.USUAL) - return "usual"; - if (code == NameUse.OFFICIAL) - return "official"; - if (code == NameUse.TEMP) - return "temp"; - if (code == NameUse.NICKNAME) - return "nickname"; - if (code == NameUse.ANONYMOUS) - return "anonymous"; - if (code == NameUse.OLD) - return "old"; - if (code == NameUse.MAIDEN) - return "maiden"; - return "?"; - } - } - - /** - * Identifies the purpose for this name. - */ - @Child(name = "use", type = {CodeType.class}, order=0, min=0, max=1) - @Description(shortDefinition="usual | official | temp | nickname | anonymous | old | maiden", formalDefinition="Identifies the purpose for this name." ) - protected Enumeration use; - - /** - * A full text representation of the name. - */ - @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Text representation of the full name", formalDefinition="A full text representation of the name." ) - protected StringType text; - - /** - * The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. - */ - @Child(name = "family", type = {StringType.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Family name (often called 'Surname')", formalDefinition="The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father." ) - protected List family; - - /** - * Given name. - */ - @Child(name = "given", type = {StringType.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Given names (not always 'first'). Includes middle names", formalDefinition="Given name." ) - protected List given; - - /** - * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name. - */ - @Child(name = "prefix", type = {StringType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Parts that come before the name", formalDefinition="Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name." ) - protected List prefix; - - /** - * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name. - */ - @Child(name = "suffix", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Parts that come after the name", formalDefinition="Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name." ) - protected List suffix; - - /** - * Indicates the period of time when this name was valid for the named person. - */ - @Child(name = "period", type = {Period.class}, order=6, min=0, max=1) - @Description(shortDefinition="Time period when name was/is in use", formalDefinition="Indicates the period of time when this name was valid for the named person." ) - protected Period period; - - private static final long serialVersionUID = -210174642L; - - /* - * Constructor - */ - public HumanName() { - super(); - } - - /** - * @return {@link #use} (Identifies the purpose for this name.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HumanName.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(new NameUseEnumFactory()); // bb - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (Identifies the purpose for this name.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public HumanName setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return Identifies the purpose for this name. - */ - public NameUse getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value Identifies the purpose for this name. - */ - public HumanName setUse(NameUse value) { - if (value == null) - this.use = null; - else { - if (this.use == null) - this.use = new Enumeration(new NameUseEnumFactory()); - this.use.setValue(value); - } - return this; - } - - /** - * @return {@link #text} (A full text representation of the name.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HumanName.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (A full text representation of the name.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public HumanName setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return A full text representation of the name. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value A full text representation of the name. - */ - public HumanName setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) - */ - public List getFamily() { - if (this.family == null) - this.family = new ArrayList(); - return this.family; - } - - public boolean hasFamily() { - if (this.family == null) - return false; - for (StringType item : this.family) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) - */ - // syntactic sugar - public StringType addFamilyElement() {//2 - StringType t = new StringType(); - if (this.family == null) - this.family = new ArrayList(); - this.family.add(t); - return t; - } - - /** - * @param value {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) - */ - public HumanName addFamily(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.family == null) - this.family = new ArrayList(); - this.family.add(t); - return this; - } - - /** - * @param value {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) - */ - public boolean hasFamily(String value) { - if (this.family == null) - return false; - for (StringType v : this.family) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #given} (Given name.) - */ - public List getGiven() { - if (this.given == null) - this.given = new ArrayList(); - return this.given; - } - - public boolean hasGiven() { - if (this.given == null) - return false; - for (StringType item : this.given) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #given} (Given name.) - */ - // syntactic sugar - public StringType addGivenElement() {//2 - StringType t = new StringType(); - if (this.given == null) - this.given = new ArrayList(); - this.given.add(t); - return t; - } - - /** - * @param value {@link #given} (Given name.) - */ - public HumanName addGiven(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.given == null) - this.given = new ArrayList(); - this.given.add(t); - return this; - } - - /** - * @param value {@link #given} (Given name.) - */ - public boolean hasGiven(String value) { - if (this.given == null) - return false; - for (StringType v : this.given) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) - */ - public List getPrefix() { - if (this.prefix == null) - this.prefix = new ArrayList(); - return this.prefix; - } - - public boolean hasPrefix() { - if (this.prefix == null) - return false; - for (StringType item : this.prefix) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) - */ - // syntactic sugar - public StringType addPrefixElement() {//2 - StringType t = new StringType(); - if (this.prefix == null) - this.prefix = new ArrayList(); - this.prefix.add(t); - return t; - } - - /** - * @param value {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) - */ - public HumanName addPrefix(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.prefix == null) - this.prefix = new ArrayList(); - this.prefix.add(t); - return this; - } - - /** - * @param value {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) - */ - public boolean hasPrefix(String value) { - if (this.prefix == null) - return false; - for (StringType v : this.prefix) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) - */ - public List getSuffix() { - if (this.suffix == null) - this.suffix = new ArrayList(); - return this.suffix; - } - - public boolean hasSuffix() { - if (this.suffix == null) - return false; - for (StringType item : this.suffix) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) - */ - // syntactic sugar - public StringType addSuffixElement() {//2 - StringType t = new StringType(); - if (this.suffix == null) - this.suffix = new ArrayList(); - this.suffix.add(t); - return t; - } - - /** - * @param value {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) - */ - public HumanName addSuffix(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.suffix == null) - this.suffix = new ArrayList(); - this.suffix.add(t); - return this; - } - - /** - * @param value {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) - */ - public boolean hasSuffix(String value) { - if (this.suffix == null) - return false; - for (StringType v : this.suffix) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #period} (Indicates the period of time when this name was valid for the named person.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HumanName.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (Indicates the period of time when this name was valid for the named person.) - */ - public HumanName setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("use", "code", "Identifies the purpose for this name.", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("text", "string", "A full text representation of the name.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("family", "string", "The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.", 0, java.lang.Integer.MAX_VALUE, family)); - childrenList.add(new Property("given", "string", "Given name.", 0, java.lang.Integer.MAX_VALUE, given)); - childrenList.add(new Property("prefix", "string", "Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.", 0, java.lang.Integer.MAX_VALUE, prefix)); - childrenList.add(new Property("suffix", "string", "Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.", 0, java.lang.Integer.MAX_VALUE, suffix)); - childrenList.add(new Property("period", "Period", "Indicates the period of time when this name was valid for the named person.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - public HumanName copy() { - HumanName dst = new HumanName(); - copyValues(dst); - dst.use = use == null ? null : use.copy(); - dst.text = text == null ? null : text.copy(); - if (family != null) { - dst.family = new ArrayList(); - for (StringType i : family) - dst.family.add(i.copy()); - }; - if (given != null) { - dst.given = new ArrayList(); - for (StringType i : given) - dst.given.add(i.copy()); - }; - if (prefix != null) { - dst.prefix = new ArrayList(); - for (StringType i : prefix) - dst.prefix.add(i.copy()); - }; - if (suffix != null) { - dst.suffix = new ArrayList(); - for (StringType i : suffix) - dst.suffix.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - return dst; - } - - protected HumanName typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof HumanName)) - return false; - HumanName o = (HumanName) other; - return compareDeep(use, o.use, true) && compareDeep(text, o.text, true) && compareDeep(family, o.family, true) - && compareDeep(given, o.given, true) && compareDeep(prefix, o.prefix, true) && compareDeep(suffix, o.suffix, true) - && compareDeep(period, o.period, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof HumanName)) - return false; - HumanName o = (HumanName) other; - return compareValues(use, o.use, true) && compareValues(text, o.text, true) && compareValues(family, o.family, true) - && compareValues(given, o.given, true) && compareValues(prefix, o.prefix, true) && compareValues(suffix, o.suffix, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (use == null || use.isEmpty()) && (text == null || text.isEmpty()) - && (family == null || family.isEmpty()) && (given == null || given.isEmpty()) && (prefix == null || prefix.isEmpty()) - && (suffix == null || suffix.isEmpty()) && (period == null || period.isEmpty()); - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A human's name with the ability to identify parts and usage. + */ +@DatatypeDef(name="HumanName") +public class HumanName extends Type implements ICompositeType { + + public enum NameUse { + /** + * Known as/conventional/the one you normally use. + */ + USUAL, + /** + * The formal name as registered in an official (government) registry, but which name might not be commonly used. May be called "legal name". + */ + OFFICIAL, + /** + * A temporary name. Name.period can provide more detailed information. This may also be used for temporary names assigned at birth or in emergency situations. + */ + TEMP, + /** + * A name that is used to address the person in an informal manner, but is not part of their formal or usual name. + */ + NICKNAME, + /** + * Anonymous assigned name, alias, or pseudonym (used to protect a person's identity for privacy reasons). + */ + ANONYMOUS, + /** + * This name is no longer in use (or was never correct, but retained for records). + */ + OLD, + /** + * A name used prior to marriage. Marriage naming customs vary greatly around the world. This name use is for use by applications that collect and store "maiden" names. Though the concept of maiden name is often gender specific, the use of this term is not gender specific. The use of this term does not imply any particular history for a person's name, nor should the maiden name be determined algorithmically. + */ + MAIDEN, + /** + * added to help the parsers + */ + NULL; + public static NameUse fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("usual".equals(codeString)) + return USUAL; + if ("official".equals(codeString)) + return OFFICIAL; + if ("temp".equals(codeString)) + return TEMP; + if ("nickname".equals(codeString)) + return NICKNAME; + if ("anonymous".equals(codeString)) + return ANONYMOUS; + if ("old".equals(codeString)) + return OLD; + if ("maiden".equals(codeString)) + return MAIDEN; + throw new Exception("Unknown NameUse code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case USUAL: return "usual"; + case OFFICIAL: return "official"; + case TEMP: return "temp"; + case NICKNAME: return "nickname"; + case ANONYMOUS: return "anonymous"; + case OLD: return "old"; + case MAIDEN: return "maiden"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case USUAL: return ""; + case OFFICIAL: return ""; + case TEMP: return ""; + case NICKNAME: return ""; + case ANONYMOUS: return ""; + case OLD: return ""; + case MAIDEN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case USUAL: return "Known as/conventional/the one you normally use."; + case OFFICIAL: return "The formal name as registered in an official (government) registry, but which name might not be commonly used. May be called 'legal name'."; + case TEMP: return "A temporary name. Name.period can provide more detailed information. This may also be used for temporary names assigned at birth or in emergency situations."; + case NICKNAME: return "A name that is used to address the person in an informal manner, but is not part of their formal or usual name."; + case ANONYMOUS: return "Anonymous assigned name, alias, or pseudonym (used to protect a person's identity for privacy reasons)."; + case OLD: return "This name is no longer in use (or was never correct, but retained for records)."; + case MAIDEN: return "A name used prior to marriage. Marriage naming customs vary greatly around the world. This name use is for use by applications that collect and store 'maiden' names. Though the concept of maiden name is often gender specific, the use of this term is not gender specific. The use of this term does not imply any particular history for a person's name, nor should the maiden name be determined algorithmically."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case USUAL: return "Usual"; + case OFFICIAL: return "Official"; + case TEMP: return "Temp"; + case NICKNAME: return "Nickname"; + case ANONYMOUS: return "Anonymous"; + case OLD: return "Old"; + case MAIDEN: return "Maiden"; + default: return "?"; + } + } + } + + public static class NameUseEnumFactory implements EnumFactory { + public NameUse fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("usual".equals(codeString)) + return NameUse.USUAL; + if ("official".equals(codeString)) + return NameUse.OFFICIAL; + if ("temp".equals(codeString)) + return NameUse.TEMP; + if ("nickname".equals(codeString)) + return NameUse.NICKNAME; + if ("anonymous".equals(codeString)) + return NameUse.ANONYMOUS; + if ("old".equals(codeString)) + return NameUse.OLD; + if ("maiden".equals(codeString)) + return NameUse.MAIDEN; + throw new IllegalArgumentException("Unknown NameUse code '"+codeString+"'"); + } + public String toCode(NameUse code) { + if (code == NameUse.USUAL) + return "usual"; + if (code == NameUse.OFFICIAL) + return "official"; + if (code == NameUse.TEMP) + return "temp"; + if (code == NameUse.NICKNAME) + return "nickname"; + if (code == NameUse.ANONYMOUS) + return "anonymous"; + if (code == NameUse.OLD) + return "old"; + if (code == NameUse.MAIDEN) + return "maiden"; + return "?"; + } + } + + /** + * Identifies the purpose for this name. + */ + @Child(name = "use", type = {CodeType.class}, order=0, min=0, max=1) + @Description(shortDefinition="usual | official | temp | nickname | anonymous | old | maiden", formalDefinition="Identifies the purpose for this name." ) + protected Enumeration use; + + /** + * A full text representation of the name. + */ + @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Text representation of the full name", formalDefinition="A full text representation of the name." ) + protected StringType text; + + /** + * The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. + */ + @Child(name = "family", type = {StringType.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Family name (often called 'Surname')", formalDefinition="The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father." ) + protected List family; + + /** + * Given name. + */ + @Child(name = "given", type = {StringType.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Given names (not always 'first'). Includes middle names", formalDefinition="Given name." ) + protected List given; + + /** + * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name. + */ + @Child(name = "prefix", type = {StringType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Parts that come before the name", formalDefinition="Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name." ) + protected List prefix; + + /** + * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name. + */ + @Child(name = "suffix", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Parts that come after the name", formalDefinition="Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name." ) + protected List suffix; + + /** + * Indicates the period of time when this name was valid for the named person. + */ + @Child(name = "period", type = {Period.class}, order=6, min=0, max=1) + @Description(shortDefinition="Time period when name was/is in use", formalDefinition="Indicates the period of time when this name was valid for the named person." ) + protected Period period; + + private static final long serialVersionUID = -210174642L; + + /* + * Constructor + */ + public HumanName() { + super(); + } + + /** + * @return {@link #use} (Identifies the purpose for this name.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Enumeration getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HumanName.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(new NameUseEnumFactory()); // bb + return this.use; + } + + public boolean hasUseElement() { + return this.use != null && !this.use.isEmpty(); + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (Identifies the purpose for this name.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public HumanName setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return Identifies the purpose for this name. + */ + public NameUse getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value Identifies the purpose for this name. + */ + public HumanName setUse(NameUse value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(new NameUseEnumFactory()); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #text} (A full text representation of the name.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HumanName.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (A full text representation of the name.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public HumanName setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return A full text representation of the name. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value A full text representation of the name. + */ + public HumanName setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) + */ + public List getFamily() { + if (this.family == null) + this.family = new ArrayList(); + return this.family; + } + + public boolean hasFamily() { + if (this.family == null) + return false; + for (StringType item : this.family) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) + */ + // syntactic sugar + public StringType addFamilyElement() {//2 + StringType t = new StringType(); + if (this.family == null) + this.family = new ArrayList(); + this.family.add(t); + return t; + } + + /** + * @param value {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) + */ + public HumanName addFamily(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.family == null) + this.family = new ArrayList(); + this.family.add(t); + return this; + } + + /** + * @param value {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) + */ + public boolean hasFamily(String value) { + if (this.family == null) + return false; + for (StringType v : this.family) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #given} (Given name.) + */ + public List getGiven() { + if (this.given == null) + this.given = new ArrayList(); + return this.given; + } + + public boolean hasGiven() { + if (this.given == null) + return false; + for (StringType item : this.given) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #given} (Given name.) + */ + // syntactic sugar + public StringType addGivenElement() {//2 + StringType t = new StringType(); + if (this.given == null) + this.given = new ArrayList(); + this.given.add(t); + return t; + } + + /** + * @param value {@link #given} (Given name.) + */ + public HumanName addGiven(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.given == null) + this.given = new ArrayList(); + this.given.add(t); + return this; + } + + /** + * @param value {@link #given} (Given name.) + */ + public boolean hasGiven(String value) { + if (this.given == null) + return false; + for (StringType v : this.given) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) + */ + public List getPrefix() { + if (this.prefix == null) + this.prefix = new ArrayList(); + return this.prefix; + } + + public boolean hasPrefix() { + if (this.prefix == null) + return false; + for (StringType item : this.prefix) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) + */ + // syntactic sugar + public StringType addPrefixElement() {//2 + StringType t = new StringType(); + if (this.prefix == null) + this.prefix = new ArrayList(); + this.prefix.add(t); + return t; + } + + /** + * @param value {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) + */ + public HumanName addPrefix(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.prefix == null) + this.prefix = new ArrayList(); + this.prefix.add(t); + return this; + } + + /** + * @param value {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) + */ + public boolean hasPrefix(String value) { + if (this.prefix == null) + return false; + for (StringType v : this.prefix) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) + */ + public List getSuffix() { + if (this.suffix == null) + this.suffix = new ArrayList(); + return this.suffix; + } + + public boolean hasSuffix() { + if (this.suffix == null) + return false; + for (StringType item : this.suffix) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) + */ + // syntactic sugar + public StringType addSuffixElement() {//2 + StringType t = new StringType(); + if (this.suffix == null) + this.suffix = new ArrayList(); + this.suffix.add(t); + return t; + } + + /** + * @param value {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) + */ + public HumanName addSuffix(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.suffix == null) + this.suffix = new ArrayList(); + this.suffix.add(t); + return this; + } + + /** + * @param value {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) + */ + public boolean hasSuffix(String value) { + if (this.suffix == null) + return false; + for (StringType v : this.suffix) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #period} (Indicates the period of time when this name was valid for the named person.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HumanName.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Indicates the period of time when this name was valid for the named person.) + */ + public HumanName setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("use", "code", "Identifies the purpose for this name.", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("text", "string", "A full text representation of the name.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("family", "string", "The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.", 0, java.lang.Integer.MAX_VALUE, family)); + childrenList.add(new Property("given", "string", "Given name.", 0, java.lang.Integer.MAX_VALUE, given)); + childrenList.add(new Property("prefix", "string", "Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.", 0, java.lang.Integer.MAX_VALUE, prefix)); + childrenList.add(new Property("suffix", "string", "Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.", 0, java.lang.Integer.MAX_VALUE, suffix)); + childrenList.add(new Property("period", "Period", "Indicates the period of time when this name was valid for the named person.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + public HumanName copy() { + HumanName dst = new HumanName(); + copyValues(dst); + dst.use = use == null ? null : use.copy(); + dst.text = text == null ? null : text.copy(); + if (family != null) { + dst.family = new ArrayList(); + for (StringType i : family) + dst.family.add(i.copy()); + }; + if (given != null) { + dst.given = new ArrayList(); + for (StringType i : given) + dst.given.add(i.copy()); + }; + if (prefix != null) { + dst.prefix = new ArrayList(); + for (StringType i : prefix) + dst.prefix.add(i.copy()); + }; + if (suffix != null) { + dst.suffix = new ArrayList(); + for (StringType i : suffix) + dst.suffix.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + return dst; + } + + protected HumanName typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof HumanName)) + return false; + HumanName o = (HumanName) other; + return compareDeep(use, o.use, true) && compareDeep(text, o.text, true) && compareDeep(family, o.family, true) + && compareDeep(given, o.given, true) && compareDeep(prefix, o.prefix, true) && compareDeep(suffix, o.suffix, true) + && compareDeep(period, o.period, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof HumanName)) + return false; + HumanName o = (HumanName) other; + return compareValues(use, o.use, true) && compareValues(text, o.text, true) && compareValues(family, o.family, true) + && compareValues(given, o.given, true) && compareValues(prefix, o.prefix, true) && compareValues(suffix, o.suffix, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (use == null || use.isEmpty()) && (text == null || text.isEmpty()) + && (family == null || family.isEmpty()) && (given == null || given.isEmpty()) && (prefix == null || prefix.isEmpty()) + && (suffix == null || suffix.isEmpty()) && (period == null || period.isEmpty()); + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/IPrimitiveType.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/IPrimitiveType.java new file mode 100644 index 00000000000..1d6685a2a29 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/IPrimitiveType.java @@ -0,0 +1,36 @@ +package org.hl7.fhir.instance.model; + +import org.hl7.fhir.instance.model.api.IBaseDatatype; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 - 2015 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + + +public interface IPrimitiveType extends IBaseDatatype { + + void setValueAsString(String theValue) throws IllegalArgumentException; + + String getValueAsString(); + + T getValue(); + + IPrimitiveType setValue(T theValue) throws IllegalArgumentException; + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/IdType.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/IdType.java index e53dbd167b1..cf3112b0405 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/IdType.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/IdType.java @@ -1,568 +1,547 @@ -/* -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; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import static org.apache.commons.lang3.StringUtils.*; - -import java.math.BigDecimal; - -import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.Validate; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -import org.hl7.fhir.instance.model.api.IIdType; - -/** - * Primitive type "id" in FHIR: a string from 1 to 64 characters, only containing letters, digits, "-" and "." - */ -@DatatypeDef(name = "id") -public class IdType extends UriType implements IIdType { - - public static final int MAX_LENGTH = 64; - private static final long serialVersionUID = 4L; - - private String myBaseUrl; - private boolean myHaveComponentParts; - private String myResourceType; - private String myUnqualifiedId; - private String myUnqualifiedVersionId; - private volatile String myValue; - - /** - * Create a new empty ID - */ - public IdType() { - super(); - } - - /** - * Create a new ID, using a BigDecimal input. Uses {@link BigDecimal#toPlainString()} to generate the string representation. - */ - public IdType(BigDecimal thePid) { - if (thePid != null) { - setValue(toPlainStringWithNpeThrowIfNeeded(thePid)); - } else { - setValue(null); - } - } - - /** - * Create a new ID using a long - */ - public IdType(long theId) { - setValue(Long.toString(theId)); - } - - /** - * Create a new ID using a string. This String may contain a simple ID (e.g. "1234") or it may contain a complete URL (http://example.com/fhir/Patient/1234). - * - *

- * Description: A whole number in the range 0 to 2^64-1 (optionally represented in hex), a uuid, an oid, or any other combination of lowercase letters, numerals, "-" and ".", with a length - * limit of 36 characters. - *

- *

- * regex: [a-z0-9\-\.]{1,36} - *

- */ - public IdType(String theValue) { - setValue(theValue); - } - - /** - * Constructor - * - * @param theResourceType - * The resource type (e.g. "Patient") - * @param theIdPart - * The ID (e.g. "123") - */ - public IdType(String theResourceType, BigDecimal theIdPart) { - this(theResourceType, toPlainStringWithNpeThrowIfNeeded(theIdPart)); - } - - /** - * Constructor - * - * @param theResourceType - * The resource type (e.g. "Patient") - * @param theIdPart - * The ID (e.g. "123") - */ - public IdType(String theResourceType, Long theIdPart) { - this(theResourceType, toPlainStringWithNpeThrowIfNeeded(theIdPart)); - } - - /** - * Constructor - * - * @param theResourceType - * The resource type (e.g. "Patient") - * @param theId - * The ID (e.g. "123") - */ - public IdType(String theResourceType, String theId) { - this(theResourceType, theId, null); - } - - /** - * Constructor - * - * @param theResourceType - * The resource type (e.g. "Patient") - * @param theId - * The ID (e.g. "123") - * @param theVersionId - * The version ID ("e.g. "456") - */ - public IdType(String theResourceType, String theId, String theVersionId) { - this(null,theResourceType,theId,theVersionId); - } - - /** - * Constructor - * - * @param theBaseUrl - * The server base URL (e.g. "http://example.com/fhir") - * @param theResourceType - * The resource type (e.g. "Patient") - * @param theId - * The ID (e.g. "123") - * @param theVersionId - * The version ID ("e.g. "456") - */ - public IdType(String theBaseUrl, String theResourceType, String theId, String theVersionId) { - myBaseUrl = theBaseUrl; - myResourceType = theResourceType; - myUnqualifiedId = theId; - myUnqualifiedVersionId = StringUtils.defaultIfBlank(theVersionId, null); - myHaveComponentParts = true; - } - - /** - * Creates an ID based on a given URL - */ - public IdType(UriType theUrl) { - setValue(theUrl.getValueAsString()); - } - - /** - * @deprecated Use {@link #getIdPartAsBigDecimal()} instead (this method was deprocated because its name is ambiguous) - */ - @Deprecated - public BigDecimal asBigDecimal() { - return getIdPartAsBigDecimal(); - } - - /** - * Returns true if this IdDt matches the given IdDt in terms of resource type and ID, but ignores the URL base - */ - @SuppressWarnings("deprecation") - public boolean equalsIgnoreBase(IdType theId) { - if (theId == null) { - return false; - } - if (theId.isEmpty()) { - return isEmpty(); - } - return ObjectUtils.equals(getResourceType(), theId.getResourceType()) && ObjectUtils.equals(getIdPart(), theId.getIdPart()) && ObjectUtils.equals(getVersionIdPart(), theId.getVersionIdPart()); - } - - - - @Override - public boolean equals(Object theArg0) { - if (!(theArg0 instanceof IdType)) { - return false; - } - IdType id = (IdType)theArg0; - return StringUtils.equals(getValueAsString(), id.getValueAsString()); - } - - @Override - public int hashCode() { - HashCodeBuilder b = new HashCodeBuilder(); - b.append(getValueAsString()); - return b.toHashCode(); - } - - /** - * Returns the portion of this resource ID which corresponds to the server base URL. For example given the resource ID http://example.com/fhir/Patient/123 the base URL would be - * http://example.com/fhir. - *

- * This method may return null if the ID contains no base (e.g. "Patient/123") - *

- */ - public String getBaseUrl() { - return myBaseUrl; - } - - public String getIdPart() { - return myUnqualifiedId; - } - - /** - * Returns the unqualified portion of this ID as a big decimal, or null if the value is null - * - * @throws NumberFormatException - * If the value is not a valid BigDecimal - */ - public BigDecimal getIdPartAsBigDecimal() { - String val = getIdPart(); - if (isBlank(val)) { - return null; - } - return new BigDecimal(val); - } - - /** - * Returns the unqualified portion of this ID as a {@link Long}, or null if the value is null - * - * @throws NumberFormatException - * If the value is not a valid Long - */ - public Long getIdPartAsLong() { - String val = getIdPart(); - if (isBlank(val)) { - return null; - } - return Long.parseLong(val); - } - - public String getResourceType() { - return myResourceType; - } - - /** - * Returns the value of this ID. Note that this value may be a fully qualified URL, a relative/partial URL, or a simple ID. Use {@link #getIdPart()} to get just the ID portion. - * - * @see #getIdPart() - */ - @Override - public String getValue() { - if (myValue == null && myHaveComponentParts) { - StringBuilder b = new StringBuilder(); - if (isNotBlank(myBaseUrl)) { - b.append(myBaseUrl); - if (myBaseUrl.charAt(myBaseUrl.length()-1)!='/') { - b.append('/'); - } - } - - if (isNotBlank(myResourceType)) { - b.append(myResourceType); - } - - if (b.length() > 0) { - b.append('/'); - } - - b.append(myUnqualifiedId); - if (isNotBlank(myUnqualifiedVersionId)) { - b.append("/_history/"); - b.append(myUnqualifiedVersionId); - } - String value = b.toString(); - myValue = value; - } - return myValue; - } - - @Override - public String getValueAsString() { - return getValue(); - } - - public String getVersionIdPart() { - return myUnqualifiedVersionId; - } - - public Long getVersionIdPartAsLong() { - if (!hasVersionIdPart()) { - return null; - } else { - return Long.parseLong(getVersionIdPart()); - } - } - - /** - * Returns true if this ID has a base url - * - * @see #getBaseUrl() - */ - public boolean hasBaseUrl() { - return isNotBlank(myBaseUrl); - } - - public boolean hasIdPart() { - return isNotBlank(getIdPart()); - } - - public boolean hasResourceType() { - return isNotBlank(myResourceType); - } - - public boolean hasVersionIdPart() { - return isNotBlank(getVersionIdPart()); - } - - /** - * Returns true if this ID contains an absolute URL (in other words, a URL starting with "http://" or "https://" - */ - public boolean isAbsolute() { - if (StringUtils.isBlank(getValue())) { - return false; - } - return isAbsolute(getValue()); - } - - /** - * Returns true if the unqualified ID is a valid {@link Long} value (in other words, it consists only of digits) - */ - public boolean isIdPartValidLong() { - String id = getIdPart(); - if (StringUtils.isBlank(id)) { - return false; - } - for (int i = 0; i < id.length(); i++) { - if (Character.isDigit(id.charAt(i)) == false) { - return false; - } - } - return true; - } - - /** - * Returns true if the ID is a local reference (in other words, it begins with the '#' character) - */ - public boolean isLocal() { - return myUnqualifiedId != null && myUnqualifiedId.isEmpty() == false && myUnqualifiedId.charAt(0) == '#'; - } - - /** - * Copies the value from the given IdDt to this IdDt. It is generally not neccesary to use this method but it is provided for consistency with the rest of the API. - */ - public void setId(IdType theId) { - setValue(theId.getValue()); - } - - /** - * Set the value - * - *

- * Description: A whole number in the range 0 to 2^64-1 (optionally represented in hex), a uuid, an oid, or any other combination of lowercase letters, numerals, "-" and ".", with a length - * limit of 36 characters. - *

- *

- * regex: [a-z0-9\-\.]{1,36} - *

- */ - @Override - public IdType setValue(String theValue) { - // TODO: add validation - myValue = theValue; - myHaveComponentParts = false; - if (StringUtils.isBlank(theValue)) { - myBaseUrl = null; - myValue = null; - myUnqualifiedId = null; - myUnqualifiedVersionId = null; - myResourceType = null; - } else if (theValue.charAt(0)== '#') { - myValue = theValue; - myUnqualifiedId = theValue; - myUnqualifiedVersionId=null; - myResourceType = null; - myHaveComponentParts = true; - } else { - int vidIndex = theValue.indexOf("/_history/"); - int idIndex; - if (vidIndex != -1) { - myUnqualifiedVersionId = theValue.substring(vidIndex + "/_history/".length()); - idIndex = theValue.lastIndexOf('/', vidIndex - 1); - myUnqualifiedId = theValue.substring(idIndex + 1, vidIndex); - } else { - idIndex = theValue.lastIndexOf('/'); - myUnqualifiedId = theValue.substring(idIndex + 1); - myUnqualifiedVersionId = null; - } - - myBaseUrl = null; - if (idIndex <= 0) { - myResourceType = null; - } else { - int typeIndex = theValue.lastIndexOf('/', idIndex - 1); - if (typeIndex == -1) { - myResourceType = theValue.substring(0, idIndex); - } else { - myResourceType = theValue.substring(typeIndex + 1, idIndex); - - if (typeIndex > 4) { - myBaseUrl = theValue.substring(0, typeIndex); - } - - } - } - - } - return this; - } - - /** - * Set the value - * - *

- * Description: A whole number in the range 0 to 2^64-1 (optionally represented in hex), a uuid, an oid, or any other combination of lowercase letters, numerals, "-" and ".", with a length - * limit of 36 characters. - *

- *

- * regex: [a-z0-9\-\.]{1,36} - *

- */ - @Override - public void setValueAsString(String theValue) { - setValue(theValue); - } - - @Override - public String toString() { - return getValue(); - } - - /** - * Returns a new IdDt containing this IdDt's values but with no server base URL if one - * is present in this IdDt. For example, if this IdDt contains the ID "http://foo/Patient/1", - * this method will return a new IdDt containing ID "Patient/1". - */ - public IdType toUnqualified() { - return new IdType(getResourceType(), getIdPart(), getVersionIdPart()); - } - - public IdType toUnqualifiedVersionless() { - return new IdType(getResourceType(), getIdPart()); - } - - public IdType toVersionless() { - return new IdType(getBaseUrl(), getResourceType(), getIdPart(), null); - } - - public IdType withResourceType(String theResourceName) { - return new IdType(theResourceName, getIdPart(), getVersionIdPart()); - } - - /** - * Returns a view of this ID as a fully qualified URL, given a server base and resource name (which will only be used if the ID does not already contain those respective parts). Essentially, - * because IdDt can contain either a complete URL or a partial one (or even jut a simple ID), this method may be used to translate into a complete URL. - * - * @param theServerBase - * The server base (e.g. "http://example.com/fhir") - * @param theResourceType - * The resource name (e.g. "Patient") - * @return A fully qualified URL for this ID (e.g. "http://example.com/fhir/Patient/1") - */ - public IdType withServerBase(String theServerBase, String theResourceType) { - return new IdType(theServerBase, theResourceType, getIdPart(), getVersionIdPart()); - } - - /** - * Creates a new instance of this ID which is identical, but refers to the specific version of this resource ID noted by theVersion. - * - * @param theVersion - * The actual version string, e.g. "1" - * @return A new instance of IdDt which is identical, but refers to the specific version of this resource ID noted by theVersion. - */ - public IdType withVersion(String theVersion) { - Validate.notBlank(theVersion, "Version may not be null or empty"); - - String existingValue = getValue(); - - int i = existingValue.indexOf("_history"); - String value; - if (i > 1) { - value = existingValue.substring(0, i - 1); - } else { - value = existingValue; - } - - return new IdType(value + "/_history/" + theVersion); - } - - private static String toPlainStringWithNpeThrowIfNeeded(BigDecimal theIdPart) { - if (theIdPart == null) { - throw new NullPointerException("BigDecimal ID can not be null"); - } - return theIdPart.toPlainString(); - } - - private static String toPlainStringWithNpeThrowIfNeeded(Long theIdPart) { - if (theIdPart == null) { - throw new NullPointerException("Long ID can not be null"); - } - return theIdPart.toString(); - } - - @Override - public boolean isEmpty() { - return isBlank(getValue()); - } - - @Override - public IdType copy() { - return new IdType(getValue()); - } - - - private static boolean isAbsolute(String theValue) { - String value = theValue.toLowerCase(); - return value.startsWith("http://") || value.startsWith("https://"); - } - - -} +/* +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; + +import static org.apache.commons.lang3.StringUtils.*; + +import java.math.BigDecimal; + +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Validate; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +import org.hl7.fhir.instance.model.api.IIdType; + +/** + * Primitive type "id" in FHIR: a string from 1 to 64 characters, only containing letters, digits, "-" and "." + */ +@DatatypeDef(name = "id") +public class IdType extends UriType implements IIdType { + + public static final int MAX_LENGTH = 64; + private static final long serialVersionUID = 4L; + + private String myBaseUrl; + private boolean myHaveComponentParts; + private String myResourceType; + private String myUnqualifiedId; + private String myUnqualifiedVersionId; + private volatile String myValue; + + /** + * Create a new empty ID + */ + public IdType() { + super(); + } + + /** + * Create a new ID, using a BigDecimal input. Uses {@link BigDecimal#toPlainString()} to generate the string representation. + */ + public IdType(BigDecimal thePid) { + if (thePid != null) { + setValue(toPlainStringWithNpeThrowIfNeeded(thePid)); + } else { + setValue(null); + } + } + + /** + * Create a new ID using a long + */ + public IdType(long theId) { + setValue(Long.toString(theId)); + } + + /** + * Create a new ID using a string. This String may contain a simple ID (e.g. "1234") or it may contain a complete URL (http://example.com/fhir/Patient/1234). + * + *

+ * Description: A whole number in the range 0 to 2^64-1 (optionally represented in hex), a uuid, an oid, or any other combination of lowercase letters, numerals, "-" and ".", with a length + * limit of 36 characters. + *

+ *

+ * regex: [a-z0-9\-\.]{1,36} + *

+ */ + public IdType(String theValue) { + setValue(theValue); + } + + /** + * Constructor + * + * @param theResourceType + * The resource type (e.g. "Patient") + * @param theIdPart + * The ID (e.g. "123") + */ + public IdType(String theResourceType, BigDecimal theIdPart) { + this(theResourceType, toPlainStringWithNpeThrowIfNeeded(theIdPart)); + } + + /** + * Constructor + * + * @param theResourceType + * The resource type (e.g. "Patient") + * @param theIdPart + * The ID (e.g. "123") + */ + public IdType(String theResourceType, Long theIdPart) { + this(theResourceType, toPlainStringWithNpeThrowIfNeeded(theIdPart)); + } + + /** + * Constructor + * + * @param theResourceType + * The resource type (e.g. "Patient") + * @param theId + * The ID (e.g. "123") + */ + public IdType(String theResourceType, String theId) { + this(theResourceType, theId, null); + } + + /** + * Constructor + * + * @param theResourceType + * The resource type (e.g. "Patient") + * @param theId + * The ID (e.g. "123") + * @param theVersionId + * The version ID ("e.g. "456") + */ + public IdType(String theResourceType, String theId, String theVersionId) { + this(null,theResourceType,theId,theVersionId); + } + + /** + * Constructor + * + * @param theBaseUrl + * The server base URL (e.g. "http://example.com/fhir") + * @param theResourceType + * The resource type (e.g. "Patient") + * @param theId + * The ID (e.g. "123") + * @param theVersionId + * The version ID ("e.g. "456") + */ + public IdType(String theBaseUrl, String theResourceType, String theId, String theVersionId) { + myBaseUrl = theBaseUrl; + myResourceType = theResourceType; + myUnqualifiedId = theId; + myUnqualifiedVersionId = StringUtils.defaultIfBlank(theVersionId, null); + myHaveComponentParts = true; + } + + /** + * Creates an ID based on a given URL + */ + public IdType(UriType theUrl) { + setValue(theUrl.getValueAsString()); + } + + /** + * @deprecated Use {@link #getIdPartAsBigDecimal()} instead (this method was deprocated because its name is ambiguous) + */ + @Deprecated + public BigDecimal asBigDecimal() { + return getIdPartAsBigDecimal(); + } + + /** + * Returns true if this IdDt matches the given IdDt in terms of resource type and ID, but ignores the URL base + */ + @SuppressWarnings("deprecation") + public boolean equalsIgnoreBase(IdType theId) { + if (theId == null) { + return false; + } + if (theId.isEmpty()) { + return isEmpty(); + } + return ObjectUtils.equals(getResourceType(), theId.getResourceType()) && ObjectUtils.equals(getIdPart(), theId.getIdPart()) && ObjectUtils.equals(getVersionIdPart(), theId.getVersionIdPart()); + } + + + + @Override + public boolean equals(Object theArg0) { + if (!(theArg0 instanceof IdType)) { + return false; + } + IdType id = (IdType)theArg0; + return StringUtils.equals(getValueAsString(), id.getValueAsString()); + } + + @Override + public int hashCode() { + HashCodeBuilder b = new HashCodeBuilder(); + b.append(getValueAsString()); + return b.toHashCode(); + } + + /** + * Returns the portion of this resource ID which corresponds to the server base URL. For example given the resource ID http://example.com/fhir/Patient/123 the base URL would be + * http://example.com/fhir. + *

+ * This method may return null if the ID contains no base (e.g. "Patient/123") + *

+ */ + public String getBaseUrl() { + return myBaseUrl; + } + + public String getIdPart() { + return myUnqualifiedId; + } + + /** + * Returns the unqualified portion of this ID as a big decimal, or null if the value is null + * + * @throws NumberFormatException + * If the value is not a valid BigDecimal + */ + public BigDecimal getIdPartAsBigDecimal() { + String val = getIdPart(); + if (isBlank(val)) { + return null; + } + return new BigDecimal(val); + } + + /** + * Returns the unqualified portion of this ID as a {@link Long}, or null if the value is null + * + * @throws NumberFormatException + * If the value is not a valid Long + */ + public Long getIdPartAsLong() { + String val = getIdPart(); + if (isBlank(val)) { + return null; + } + return Long.parseLong(val); + } + + public String getResourceType() { + return myResourceType; + } + + /** + * Returns the value of this ID. Note that this value may be a fully qualified URL, a relative/partial URL, or a simple ID. Use {@link #getIdPart()} to get just the ID portion. + * + * @see #getIdPart() + */ + @Override + public String getValue() { + if (myValue == null && myHaveComponentParts) { + StringBuilder b = new StringBuilder(); + if (isNotBlank(myBaseUrl)) { + b.append(myBaseUrl); + if (myBaseUrl.charAt(myBaseUrl.length()-1)!='/') { + b.append('/'); + } + } + + if (isNotBlank(myResourceType)) { + b.append(myResourceType); + } + + if (b.length() > 0) { + b.append('/'); + } + + b.append(myUnqualifiedId); + if (isNotBlank(myUnqualifiedVersionId)) { + b.append("/_history/"); + b.append(myUnqualifiedVersionId); + } + String value = b.toString(); + myValue = value; + } + return myValue; + } + + @Override + public String getValueAsString() { + return getValue(); + } + + public String getVersionIdPart() { + return myUnqualifiedVersionId; + } + + public Long getVersionIdPartAsLong() { + if (!hasVersionIdPart()) { + return null; + } else { + return Long.parseLong(getVersionIdPart()); + } + } + + /** + * Returns true if this ID has a base url + * + * @see #getBaseUrl() + */ + public boolean hasBaseUrl() { + return isNotBlank(myBaseUrl); + } + + public boolean hasIdPart() { + return isNotBlank(getIdPart()); + } + + public boolean hasResourceType() { + return isNotBlank(myResourceType); + } + + public boolean hasVersionIdPart() { + return isNotBlank(getVersionIdPart()); + } + + /** + * Returns true if this ID contains an absolute URL (in other words, a URL starting with "http://" or "https://" + */ + public boolean isAbsolute() { + if (StringUtils.isBlank(getValue())) { + return false; + } + return isAbsolute(getValue()); + } + + /** + * Returns true if the unqualified ID is a valid {@link Long} value (in other words, it consists only of digits) + */ + public boolean isIdPartValidLong() { + String id = getIdPart(); + if (StringUtils.isBlank(id)) { + return false; + } + for (int i = 0; i < id.length(); i++) { + if (Character.isDigit(id.charAt(i)) == false) { + return false; + } + } + return true; + } + + /** + * Returns true if the ID is a local reference (in other words, it begins with the '#' character) + */ + public boolean isLocal() { + return myUnqualifiedId != null && myUnqualifiedId.isEmpty() == false && myUnqualifiedId.charAt(0) == '#'; + } + + /** + * Copies the value from the given IdDt to this IdDt. It is generally not neccesary to use this method but it is provided for consistency with the rest of the API. + */ + public void setId(IdType theId) { + setValue(theId.getValue()); + } + + /** + * Set the value + * + *

+ * Description: A whole number in the range 0 to 2^64-1 (optionally represented in hex), a uuid, an oid, or any other combination of lowercase letters, numerals, "-" and ".", with a length + * limit of 36 characters. + *

+ *

+ * regex: [a-z0-9\-\.]{1,36} + *

+ */ + @Override + public IdType setValue(String theValue) { + // TODO: add validation + myValue = theValue; + myHaveComponentParts = false; + if (StringUtils.isBlank(theValue)) { + myBaseUrl = null; + myValue = null; + myUnqualifiedId = null; + myUnqualifiedVersionId = null; + myResourceType = null; + } else if (theValue.charAt(0)== '#') { + myValue = theValue; + myUnqualifiedId = theValue; + myUnqualifiedVersionId=null; + myResourceType = null; + myHaveComponentParts = true; + } else { + int vidIndex = theValue.indexOf("/_history/"); + int idIndex; + if (vidIndex != -1) { + myUnqualifiedVersionId = theValue.substring(vidIndex + "/_history/".length()); + idIndex = theValue.lastIndexOf('/', vidIndex - 1); + myUnqualifiedId = theValue.substring(idIndex + 1, vidIndex); + } else { + idIndex = theValue.lastIndexOf('/'); + myUnqualifiedId = theValue.substring(idIndex + 1); + myUnqualifiedVersionId = null; + } + + myBaseUrl = null; + if (idIndex <= 0) { + myResourceType = null; + } else { + int typeIndex = theValue.lastIndexOf('/', idIndex - 1); + if (typeIndex == -1) { + myResourceType = theValue.substring(0, idIndex); + } else { + myResourceType = theValue.substring(typeIndex + 1, idIndex); + + if (typeIndex > 4) { + myBaseUrl = theValue.substring(0, typeIndex); + } + + } + } + + } + return this; + } + + /** + * Set the value + * + *

+ * Description: A whole number in the range 0 to 2^64-1 (optionally represented in hex), a uuid, an oid, or any other combination of lowercase letters, numerals, "-" and ".", with a length + * limit of 36 characters. + *

+ *

+ * regex: [a-z0-9\-\.]{1,36} + *

+ */ + @Override + public void setValueAsString(String theValue) { + setValue(theValue); + } + + @Override + public String toString() { + return getValue(); + } + + /** + * Returns a new IdDt containing this IdDt's values but with no server base URL if one + * is present in this IdDt. For example, if this IdDt contains the ID "http://foo/Patient/1", + * this method will return a new IdDt containing ID "Patient/1". + */ + public IdType toUnqualified() { + return new IdType(getResourceType(), getIdPart(), getVersionIdPart()); + } + + public IdType toUnqualifiedVersionless() { + return new IdType(getResourceType(), getIdPart()); + } + + public IdType toVersionless() { + return new IdType(getBaseUrl(), getResourceType(), getIdPart(), null); + } + + public IdType withResourceType(String theResourceName) { + return new IdType(theResourceName, getIdPart(), getVersionIdPart()); + } + + /** + * Returns a view of this ID as a fully qualified URL, given a server base and resource name (which will only be used if the ID does not already contain those respective parts). Essentially, + * because IdDt can contain either a complete URL or a partial one (or even jut a simple ID), this method may be used to translate into a complete URL. + * + * @param theServerBase + * The server base (e.g. "http://example.com/fhir") + * @param theResourceType + * The resource name (e.g. "Patient") + * @return A fully qualified URL for this ID (e.g. "http://example.com/fhir/Patient/1") + */ + public IdType withServerBase(String theServerBase, String theResourceType) { + return new IdType(theServerBase, theResourceType, getIdPart(), getVersionIdPart()); + } + + /** + * Creates a new instance of this ID which is identical, but refers to the specific version of this resource ID noted by theVersion. + * + * @param theVersion + * The actual version string, e.g. "1" + * @return A new instance of IdDt which is identical, but refers to the specific version of this resource ID noted by theVersion. + */ + public IdType withVersion(String theVersion) { + Validate.notBlank(theVersion, "Version may not be null or empty"); + + String existingValue = getValue(); + + int i = existingValue.indexOf("_history"); + String value; + if (i > 1) { + value = existingValue.substring(0, i - 1); + } else { + value = existingValue; + } + + return new IdType(value + "/_history/" + theVersion); + } + + private static String toPlainStringWithNpeThrowIfNeeded(BigDecimal theIdPart) { + if (theIdPart == null) { + throw new NullPointerException("BigDecimal ID can not be null"); + } + return theIdPart.toPlainString(); + } + + private static String toPlainStringWithNpeThrowIfNeeded(Long theIdPart) { + if (theIdPart == null) { + throw new NullPointerException("Long ID can not be null"); + } + return theIdPart.toString(); + } + + @Override + public boolean isEmpty() { + return isBlank(getValue()); + } + + @Override + public IdType copy() { + return new IdType(getValue()); + } + + + private static boolean isAbsolute(String theValue) { + String value = theValue.toLowerCase(); + return value.startsWith("http://") || value.startsWith("https://"); + } + + +} \ No newline at end of file diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Identifier.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Identifier.java index 1a1c9fbce89..6b59898c210 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Identifier.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Identifier.java @@ -1,521 +1,500 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A technical identifier - identifies some entity uniquely and unambiguously. - */ -@DatatypeDef(name="Identifier") -public class Identifier extends Type implements ICompositeType { - - public enum IdentifierUse { - /** - * the identifier recommended for display and use in real-world interactions. - */ - USUAL, - /** - * the identifier considered to be most trusted for the identification of this item. - */ - OFFICIAL, - /** - * A temporary identifier. - */ - TEMP, - /** - * An identifier that was assigned in secondary use - it serves to identify the object in a relative context, but cannot be consistently assigned to the same object again in a different context. - */ - SECONDARY, - /** - * added to help the parsers - */ - NULL; - public static IdentifierUse fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("usual".equals(codeString)) - return USUAL; - if ("official".equals(codeString)) - return OFFICIAL; - if ("temp".equals(codeString)) - return TEMP; - if ("secondary".equals(codeString)) - return SECONDARY; - throw new Exception("Unknown IdentifierUse code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case USUAL: return "usual"; - case OFFICIAL: return "official"; - case TEMP: return "temp"; - case SECONDARY: return "secondary"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case USUAL: return ""; - case OFFICIAL: return ""; - case TEMP: return ""; - case SECONDARY: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case USUAL: return "the identifier recommended for display and use in real-world interactions."; - case OFFICIAL: return "the identifier considered to be most trusted for the identification of this item."; - case TEMP: return "A temporary identifier."; - case SECONDARY: return "An identifier that was assigned in secondary use - it serves to identify the object in a relative context, but cannot be consistently assigned to the same object again in a different context."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case USUAL: return "Usual"; - case OFFICIAL: return "Official"; - case TEMP: return "Temp"; - case SECONDARY: return "Secondary"; - default: return "?"; - } - } - } - - public static class IdentifierUseEnumFactory implements EnumFactory { - public IdentifierUse fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("usual".equals(codeString)) - return IdentifierUse.USUAL; - if ("official".equals(codeString)) - return IdentifierUse.OFFICIAL; - if ("temp".equals(codeString)) - return IdentifierUse.TEMP; - if ("secondary".equals(codeString)) - return IdentifierUse.SECONDARY; - throw new IllegalArgumentException("Unknown IdentifierUse code '"+codeString+"'"); - } - public String toCode(IdentifierUse code) { - if (code == IdentifierUse.USUAL) - return "usual"; - if (code == IdentifierUse.OFFICIAL) - return "official"; - if (code == IdentifierUse.TEMP) - return "temp"; - if (code == IdentifierUse.SECONDARY) - return "secondary"; - return "?"; - } - } - - /** - * The purpose of this identifier. - */ - @Child(name = "use", type = {CodeType.class}, order=0, min=0, max=1) - @Description(shortDefinition="usual | official | temp | secondary (If known)", formalDefinition="The purpose of this identifier." ) - protected Enumeration use; - - /** - * A coded type for the identifier that can be used to determine which identifier to use for a specific purpose. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Description of identifier", formalDefinition="A coded type for the identifier that can be used to determine which identifier to use for a specific purpose." ) - protected CodeableConcept type; - - /** - * Establishes the namespace in which set of possible id values is unique. - */ - @Child(name = "system", type = {UriType.class}, order=2, min=0, max=1) - @Description(shortDefinition="The namespace for the identifier", formalDefinition="Establishes the namespace in which set of possible id values is unique." ) - protected UriType system; - - /** - * The portion of the identifier typically displayed to the user and which is unique within the context of the system. - */ - @Child(name = "value", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="The value that is unique", formalDefinition="The portion of the identifier typically displayed to the user and which is unique within the context of the system." ) - protected StringType value; - - /** - * Time period during which identifier is/was valid for use. - */ - @Child(name = "period", type = {Period.class}, order=4, min=0, max=1) - @Description(shortDefinition="Time period when id is/was valid for use", formalDefinition="Time period during which identifier is/was valid for use." ) - protected Period period; - - /** - * Organization that issued/manages the identifier. - */ - @Child(name = "assigner", type = {Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="Organization that issued id (may be just text)", formalDefinition="Organization that issued/manages the identifier." ) - protected Reference assigner; - - /** - * The actual object that is the target of the reference (Organization that issued/manages the identifier.) - */ - protected Organization assignerTarget; - - private static final long serialVersionUID = -478840981L; - - /* - * Constructor - */ - public Identifier() { - super(); - } - - /** - * @return {@link #use} (The purpose of this identifier.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Identifier.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(new IdentifierUseEnumFactory()); // bb - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (The purpose of this identifier.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Identifier setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return The purpose of this identifier. - */ - public IdentifierUse getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value The purpose of this identifier. - */ - public Identifier setUse(IdentifierUse value) { - if (value == null) - this.use = null; - else { - if (this.use == null) - this.use = new Enumeration(new IdentifierUseEnumFactory()); - this.use.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Identifier.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.) - */ - public Identifier setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #system} (Establishes the namespace in which set of possible id values is unique.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public UriType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Identifier.system"); - else if (Configuration.doAutoCreate()) - this.system = new UriType(); // bb - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (Establishes the namespace in which set of possible id values is unique.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public Identifier setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return Establishes the namespace in which set of possible id values is unique. - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value Establishes the namespace in which set of possible id values is unique. - */ - public Identifier setSystem(String value) { - if (Utilities.noString(value)) - this.system = null; - else { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - } - return this; - } - - /** - * @return {@link #value} (The portion of the identifier typically displayed to the user and which is unique within the context of the system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Identifier.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The portion of the identifier typically displayed to the user and which is unique within the context of the system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public Identifier setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The portion of the identifier typically displayed to the user and which is unique within the context of the system. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The portion of the identifier typically displayed to the user and which is unique within the context of the system. - */ - public Identifier setValue(String value) { - if (Utilities.noString(value)) - this.value = null; - else { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - } - return this; - } - - /** - * @return {@link #period} (Time period during which identifier is/was valid for use.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Identifier.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (Time period during which identifier is/was valid for use.) - */ - public Identifier setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #assigner} (Organization that issued/manages the identifier.) - */ - public Reference getAssigner() { - if (this.assigner == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Identifier.assigner"); - else if (Configuration.doAutoCreate()) - this.assigner = new Reference(); // cc - return this.assigner; - } - - public boolean hasAssigner() { - return this.assigner != null && !this.assigner.isEmpty(); - } - - /** - * @param value {@link #assigner} (Organization that issued/manages the identifier.) - */ - public Identifier setAssigner(Reference value) { - this.assigner = value; - return this; - } - - /** - * @return {@link #assigner} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Organization that issued/manages the identifier.) - */ - public Organization getAssignerTarget() { - if (this.assignerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Identifier.assigner"); - else if (Configuration.doAutoCreate()) - this.assignerTarget = new Organization(); // aa - return this.assignerTarget; - } - - /** - * @param value {@link #assigner} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Organization that issued/manages the identifier.) - */ - public Identifier setAssignerTarget(Organization value) { - this.assignerTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("use", "code", "The purpose of this identifier.", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("type", "CodeableConcept", "A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("system", "uri", "Establishes the namespace in which set of possible id values is unique.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("value", "string", "The portion of the identifier typically displayed to the user and which is unique within the context of the system.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("period", "Period", "Time period during which identifier is/was valid for use.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("assigner", "Reference(Organization)", "Organization that issued/manages the identifier.", 0, java.lang.Integer.MAX_VALUE, assigner)); - } - - public Identifier copy() { - Identifier dst = new Identifier(); - copyValues(dst); - dst.use = use == null ? null : use.copy(); - dst.type = type == null ? null : type.copy(); - dst.system = system == null ? null : system.copy(); - dst.value = value == null ? null : value.copy(); - dst.period = period == null ? null : period.copy(); - dst.assigner = assigner == null ? null : assigner.copy(); - return dst; - } - - protected Identifier typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Identifier)) - return false; - Identifier o = (Identifier) other; - return compareDeep(use, o.use, true) && compareDeep(type, o.type, true) && compareDeep(system, o.system, true) - && compareDeep(value, o.value, true) && compareDeep(period, o.period, true) && compareDeep(assigner, o.assigner, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Identifier)) - return false; - Identifier o = (Identifier) other; - return compareValues(use, o.use, true) && compareValues(system, o.system, true) && compareValues(value, o.value, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (use == null || use.isEmpty()) && (type == null || type.isEmpty()) - && (system == null || system.isEmpty()) && (value == null || value.isEmpty()) && (period == null || period.isEmpty()) - && (assigner == null || assigner.isEmpty()); - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A technical identifier - identifies some entity uniquely and unambiguously. + */ +@DatatypeDef(name="Identifier") +public class Identifier extends Type implements ICompositeType { + + public enum IdentifierUse { + /** + * the identifier recommended for display and use in real-world interactions. + */ + USUAL, + /** + * the identifier considered to be most trusted for the identification of this item. + */ + OFFICIAL, + /** + * A temporary identifier. + */ + TEMP, + /** + * An identifier that was assigned in secondary use - it serves to identify the object in a relative context, but cannot be consistently assigned to the same object again in a different context. + */ + SECONDARY, + /** + * added to help the parsers + */ + NULL; + public static IdentifierUse fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("usual".equals(codeString)) + return USUAL; + if ("official".equals(codeString)) + return OFFICIAL; + if ("temp".equals(codeString)) + return TEMP; + if ("secondary".equals(codeString)) + return SECONDARY; + throw new Exception("Unknown IdentifierUse code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case USUAL: return "usual"; + case OFFICIAL: return "official"; + case TEMP: return "temp"; + case SECONDARY: return "secondary"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case USUAL: return ""; + case OFFICIAL: return ""; + case TEMP: return ""; + case SECONDARY: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case USUAL: return "the identifier recommended for display and use in real-world interactions."; + case OFFICIAL: return "the identifier considered to be most trusted for the identification of this item."; + case TEMP: return "A temporary identifier."; + case SECONDARY: return "An identifier that was assigned in secondary use - it serves to identify the object in a relative context, but cannot be consistently assigned to the same object again in a different context."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case USUAL: return "Usual"; + case OFFICIAL: return "Official"; + case TEMP: return "Temp"; + case SECONDARY: return "Secondary"; + default: return "?"; + } + } + } + + public static class IdentifierUseEnumFactory implements EnumFactory { + public IdentifierUse fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("usual".equals(codeString)) + return IdentifierUse.USUAL; + if ("official".equals(codeString)) + return IdentifierUse.OFFICIAL; + if ("temp".equals(codeString)) + return IdentifierUse.TEMP; + if ("secondary".equals(codeString)) + return IdentifierUse.SECONDARY; + throw new IllegalArgumentException("Unknown IdentifierUse code '"+codeString+"'"); + } + public String toCode(IdentifierUse code) { + if (code == IdentifierUse.USUAL) + return "usual"; + if (code == IdentifierUse.OFFICIAL) + return "official"; + if (code == IdentifierUse.TEMP) + return "temp"; + if (code == IdentifierUse.SECONDARY) + return "secondary"; + return "?"; + } + } + + /** + * The purpose of this identifier. + */ + @Child(name = "use", type = {CodeType.class}, order=0, min=0, max=1) + @Description(shortDefinition="usual | official | temp | secondary (If known)", formalDefinition="The purpose of this identifier." ) + protected Enumeration use; + + /** + * A coded type for the identifier that can be used to determine which identifier to use for a specific purpose. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Description of identifier", formalDefinition="A coded type for the identifier that can be used to determine which identifier to use for a specific purpose." ) + protected CodeableConcept type; + + /** + * Establishes the namespace in which set of possible id values is unique. + */ + @Child(name = "system", type = {UriType.class}, order=2, min=0, max=1) + @Description(shortDefinition="The namespace for the identifier", formalDefinition="Establishes the namespace in which set of possible id values is unique." ) + protected UriType system; + + /** + * The portion of the identifier typically displayed to the user and which is unique within the context of the system. + */ + @Child(name = "value", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="The value that is unique", formalDefinition="The portion of the identifier typically displayed to the user and which is unique within the context of the system." ) + protected StringType value; + + /** + * Time period during which identifier is/was valid for use. + */ + @Child(name = "period", type = {Period.class}, order=4, min=0, max=1) + @Description(shortDefinition="Time period when id is/was valid for use", formalDefinition="Time period during which identifier is/was valid for use." ) + protected Period period; + + /** + * Organization that issued/manages the identifier. + */ + @Child(name = "assigner", type = {Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Organization that issued id (may be just text)", formalDefinition="Organization that issued/manages the identifier." ) + protected Reference assigner; + + /** + * The actual object that is the target of the reference (Organization that issued/manages the identifier.) + */ + protected Organization assignerTarget; + + private static final long serialVersionUID = -478840981L; + + /* + * Constructor + */ + public Identifier() { + super(); + } + + /** + * @return {@link #use} (The purpose of this identifier.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Enumeration getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Identifier.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(new IdentifierUseEnumFactory()); // bb + return this.use; + } + + public boolean hasUseElement() { + return this.use != null && !this.use.isEmpty(); + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (The purpose of this identifier.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Identifier setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return The purpose of this identifier. + */ + public IdentifierUse getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value The purpose of this identifier. + */ + public Identifier setUse(IdentifierUse value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(new IdentifierUseEnumFactory()); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Identifier.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.) + */ + public Identifier setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #system} (Establishes the namespace in which set of possible id values is unique.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public UriType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Identifier.system"); + else if (Configuration.doAutoCreate()) + this.system = new UriType(); // bb + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (Establishes the namespace in which set of possible id values is unique.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public Identifier setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return Establishes the namespace in which set of possible id values is unique. + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value Establishes the namespace in which set of possible id values is unique. + */ + public Identifier setSystem(String value) { + if (Utilities.noString(value)) + this.system = null; + else { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + } + return this; + } + + /** + * @return {@link #value} (The portion of the identifier typically displayed to the user and which is unique within the context of the system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Identifier.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The portion of the identifier typically displayed to the user and which is unique within the context of the system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public Identifier setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The portion of the identifier typically displayed to the user and which is unique within the context of the system. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The portion of the identifier typically displayed to the user and which is unique within the context of the system. + */ + public Identifier setValue(String value) { + if (Utilities.noString(value)) + this.value = null; + else { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + } + return this; + } + + /** + * @return {@link #period} (Time period during which identifier is/was valid for use.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Identifier.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Time period during which identifier is/was valid for use.) + */ + public Identifier setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #assigner} (Organization that issued/manages the identifier.) + */ + public Reference getAssigner() { + if (this.assigner == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Identifier.assigner"); + else if (Configuration.doAutoCreate()) + this.assigner = new Reference(); // cc + return this.assigner; + } + + public boolean hasAssigner() { + return this.assigner != null && !this.assigner.isEmpty(); + } + + /** + * @param value {@link #assigner} (Organization that issued/manages the identifier.) + */ + public Identifier setAssigner(Reference value) { + this.assigner = value; + return this; + } + + /** + * @return {@link #assigner} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Organization that issued/manages the identifier.) + */ + public Organization getAssignerTarget() { + if (this.assignerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Identifier.assigner"); + else if (Configuration.doAutoCreate()) + this.assignerTarget = new Organization(); // aa + return this.assignerTarget; + } + + /** + * @param value {@link #assigner} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Organization that issued/manages the identifier.) + */ + public Identifier setAssignerTarget(Organization value) { + this.assignerTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("use", "code", "The purpose of this identifier.", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("type", "CodeableConcept", "A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("system", "uri", "Establishes the namespace in which set of possible id values is unique.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("value", "string", "The portion of the identifier typically displayed to the user and which is unique within the context of the system.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("period", "Period", "Time period during which identifier is/was valid for use.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("assigner", "Reference(Organization)", "Organization that issued/manages the identifier.", 0, java.lang.Integer.MAX_VALUE, assigner)); + } + + public Identifier copy() { + Identifier dst = new Identifier(); + copyValues(dst); + dst.use = use == null ? null : use.copy(); + dst.type = type == null ? null : type.copy(); + dst.system = system == null ? null : system.copy(); + dst.value = value == null ? null : value.copy(); + dst.period = period == null ? null : period.copy(); + dst.assigner = assigner == null ? null : assigner.copy(); + return dst; + } + + protected Identifier typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Identifier)) + return false; + Identifier o = (Identifier) other; + return compareDeep(use, o.use, true) && compareDeep(type, o.type, true) && compareDeep(system, o.system, true) + && compareDeep(value, o.value, true) && compareDeep(period, o.period, true) && compareDeep(assigner, o.assigner, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Identifier)) + return false; + Identifier o = (Identifier) other; + return compareValues(use, o.use, true) && compareValues(system, o.system, true) && compareValues(value, o.value, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (use == null || use.isEmpty()) && (type == null || type.isEmpty()) + && (system == null || system.isEmpty()) && (value == null || value.isEmpty()) && (period == null || period.isEmpty()) + && (assigner == null || assigner.isEmpty()); + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ImagingObjectSelection.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ImagingObjectSelection.java index 04ba61dcc10..220f1b82b74 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ImagingObjectSelection.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ImagingObjectSelection.java @@ -1,1411 +1,1390 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A set of DICOM SOP Instances of a patient, selected for some application purpose, e.g., quality assurance, teaching, conference, consulting, etc. Objects selected can be from different studies, but must be of the same patient. - */ -@ResourceDef(name="ImagingObjectSelection", profile="http://hl7.org/fhir/Profile/ImagingObjectSelection") -public class ImagingObjectSelection extends DomainResource { - - @Block() - public static class StudyComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Study instance uid of the SOP instances in the selection. - */ - @Child(name = "uid", type = {OidType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Study instance uid", formalDefinition="Study instance uid of the SOP instances in the selection." ) - protected OidType uid; - - /** - * WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection. - */ - @Child(name = "url", type = {UriType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Retrieve URL", formalDefinition="WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection." ) - protected UriType url; - - /** - * Series indetity and locating information of the DICOM SOP instances in the selection. - */ - @Child(name = "series", type = {}, order=3, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Series identity of the selected instances", formalDefinition="Series indetity and locating information of the DICOM SOP instances in the selection." ) - protected List series; - - private static final long serialVersionUID = -1632673574L; - - /* - * Constructor - */ - public StudyComponent() { - super(); - } - - /* - * Constructor - */ - public StudyComponent(OidType uid) { - super(); - this.uid = uid; - } - - /** - * @return {@link #uid} (Study instance uid of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyComponent.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); // bb - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (Study instance uid of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public StudyComponent setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return Study instance uid of the SOP instances in the selection. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value Study instance uid of the SOP instances in the selection. - */ - public StudyComponent setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #url} (WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public StudyComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection. - */ - public StudyComponent setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #series} (Series indetity and locating information of the DICOM SOP instances in the selection.) - */ - public List getSeries() { - if (this.series == null) - this.series = new ArrayList(); - return this.series; - } - - public boolean hasSeries() { - if (this.series == null) - return false; - for (SeriesComponent item : this.series) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #series} (Series indetity and locating information of the DICOM SOP instances in the selection.) - */ - // syntactic sugar - public SeriesComponent addSeries() { //3 - SeriesComponent t = new SeriesComponent(); - if (this.series == null) - this.series = new ArrayList(); - this.series.add(t); - return t; - } - - // syntactic sugar - public StudyComponent addSeries(SeriesComponent t) { //3 - if (t == null) - return this; - if (this.series == null) - this.series = new ArrayList(); - this.series.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("uid", "oid", "Study instance uid of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("url", "uri", "WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("series", "", "Series indetity and locating information of the DICOM SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, series)); - } - - public StudyComponent copy() { - StudyComponent dst = new StudyComponent(); - copyValues(dst); - dst.uid = uid == null ? null : uid.copy(); - dst.url = url == null ? null : url.copy(); - if (series != null) { - dst.series = new ArrayList(); - for (SeriesComponent i : series) - dst.series.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StudyComponent)) - return false; - StudyComponent o = (StudyComponent) other; - return compareDeep(uid, o.uid, true) && compareDeep(url, o.url, true) && compareDeep(series, o.series, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StudyComponent)) - return false; - StudyComponent o = (StudyComponent) other; - return compareValues(uid, o.uid, true) && compareValues(url, o.url, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (uid == null || uid.isEmpty()) && (url == null || url.isEmpty()) && (series == null || series.isEmpty()) - ; - } - - } - - @Block() - public static class SeriesComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Series instance uid of the SOP instances in the selection. - */ - @Child(name = "uid", type = {OidType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Series instance uid", formalDefinition="Series instance uid of the SOP instances in the selection." ) - protected OidType uid; - - /** - * WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection. - */ - @Child(name = "url", type = {UriType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Retrieve URL", formalDefinition="WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection." ) - protected UriType url; - - /** - * Identity and locating information of the selected DICOM SOP instances. - */ - @Child(name = "instance", type = {}, order=3, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The selected instance", formalDefinition="Identity and locating information of the selected DICOM SOP instances." ) - protected List instance; - - private static final long serialVersionUID = 229247770L; - - /* - * Constructor - */ - public SeriesComponent() { - super(); - } - - /** - * @return {@link #uid} (Series instance uid of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SeriesComponent.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); // bb - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (Series instance uid of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public SeriesComponent setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return Series instance uid of the SOP instances in the selection. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value Series instance uid of the SOP instances in the selection. - */ - public SeriesComponent setUid(String value) { - if (Utilities.noString(value)) - this.uid = null; - else { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - } - return this; - } - - /** - * @return {@link #url} (WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SeriesComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public SeriesComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection. - */ - public SeriesComponent setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #instance} (Identity and locating information of the selected DICOM SOP instances.) - */ - public List getInstance() { - if (this.instance == null) - this.instance = new ArrayList(); - return this.instance; - } - - public boolean hasInstance() { - if (this.instance == null) - return false; - for (InstanceComponent item : this.instance) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #instance} (Identity and locating information of the selected DICOM SOP instances.) - */ - // syntactic sugar - public InstanceComponent addInstance() { //3 - InstanceComponent t = new InstanceComponent(); - if (this.instance == null) - this.instance = new ArrayList(); - this.instance.add(t); - return t; - } - - // syntactic sugar - public SeriesComponent addInstance(InstanceComponent t) { //3 - if (t == null) - return this; - if (this.instance == null) - this.instance = new ArrayList(); - this.instance.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("uid", "oid", "Series instance uid of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("url", "uri", "WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("instance", "", "Identity and locating information of the selected DICOM SOP instances.", 0, java.lang.Integer.MAX_VALUE, instance)); - } - - public SeriesComponent copy() { - SeriesComponent dst = new SeriesComponent(); - copyValues(dst); - dst.uid = uid == null ? null : uid.copy(); - dst.url = url == null ? null : url.copy(); - if (instance != null) { - dst.instance = new ArrayList(); - for (InstanceComponent i : instance) - dst.instance.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SeriesComponent)) - return false; - SeriesComponent o = (SeriesComponent) other; - return compareDeep(uid, o.uid, true) && compareDeep(url, o.url, true) && compareDeep(instance, o.instance, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SeriesComponent)) - return false; - SeriesComponent o = (SeriesComponent) other; - return compareValues(uid, o.uid, true) && compareValues(url, o.url, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (uid == null || uid.isEmpty()) && (url == null || url.isEmpty()) && (instance == null || instance.isEmpty()) - ; - } - - } - - @Block() - public static class InstanceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * SOP class uid of the selected instance. - */ - @Child(name = "sopClass", type = {OidType.class}, order=1, min=1, max=1) - @Description(shortDefinition="SOP class uid of instance", formalDefinition="SOP class uid of the selected instance." ) - protected OidType sopClass; - - /** - * SOP Instance uid of the selected instance. - */ - @Child(name = "uid", type = {OidType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Uid of the selected instance", formalDefinition="SOP Instance uid of the selected instance." ) - protected OidType uid; - - /** - * WADO-RS URL to retrieve the DICOM SOP Instance. - */ - @Child(name = "url", type = {UriType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Retrieve URL", formalDefinition="WADO-RS URL to retrieve the DICOM SOP Instance." ) - protected UriType url; - - /** - * Identity and location information of the frames in the selected instance. - */ - @Child(name = "frames", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The frame set", formalDefinition="Identity and location information of the frames in the selected instance." ) - protected List frames; - - private static final long serialVersionUID = 1641180916L; - - /* - * Constructor - */ - public InstanceComponent() { - super(); - } - - /* - * Constructor - */ - public InstanceComponent(OidType sopClass, OidType uid, UriType url) { - super(); - this.sopClass = sopClass; - this.uid = uid; - this.url = url; - } - - /** - * @return {@link #sopClass} (SOP class uid of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getSopClass" gives direct access to the value - */ - public OidType getSopClassElement() { - if (this.sopClass == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstanceComponent.sopClass"); - else if (Configuration.doAutoCreate()) - this.sopClass = new OidType(); // bb - return this.sopClass; - } - - public boolean hasSopClassElement() { - return this.sopClass != null && !this.sopClass.isEmpty(); - } - - public boolean hasSopClass() { - return this.sopClass != null && !this.sopClass.isEmpty(); - } - - /** - * @param value {@link #sopClass} (SOP class uid of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getSopClass" gives direct access to the value - */ - public InstanceComponent setSopClassElement(OidType value) { - this.sopClass = value; - return this; - } - - /** - * @return SOP class uid of the selected instance. - */ - public String getSopClass() { - return this.sopClass == null ? null : this.sopClass.getValue(); - } - - /** - * @param value SOP class uid of the selected instance. - */ - public InstanceComponent setSopClass(String value) { - if (this.sopClass == null) - this.sopClass = new OidType(); - this.sopClass.setValue(value); - return this; - } - - /** - * @return {@link #uid} (SOP Instance uid of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstanceComponent.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); // bb - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (SOP Instance uid of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public InstanceComponent setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return SOP Instance uid of the selected instance. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value SOP Instance uid of the selected instance. - */ - public InstanceComponent setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #url} (WADO-RS URL to retrieve the DICOM SOP Instance.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstanceComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (WADO-RS URL to retrieve the DICOM SOP Instance.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public InstanceComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return WADO-RS URL to retrieve the DICOM SOP Instance. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value WADO-RS URL to retrieve the DICOM SOP Instance. - */ - public InstanceComponent setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - /** - * @return {@link #frames} (Identity and location information of the frames in the selected instance.) - */ - public List getFrames() { - if (this.frames == null) - this.frames = new ArrayList(); - return this.frames; - } - - public boolean hasFrames() { - if (this.frames == null) - return false; - for (FramesComponent item : this.frames) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #frames} (Identity and location information of the frames in the selected instance.) - */ - // syntactic sugar - public FramesComponent addFrames() { //3 - FramesComponent t = new FramesComponent(); - if (this.frames == null) - this.frames = new ArrayList(); - this.frames.add(t); - return t; - } - - // syntactic sugar - public InstanceComponent addFrames(FramesComponent t) { //3 - if (t == null) - return this; - if (this.frames == null) - this.frames = new ArrayList(); - this.frames.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sopClass", "oid", "SOP class uid of the selected instance.", 0, java.lang.Integer.MAX_VALUE, sopClass)); - childrenList.add(new Property("uid", "oid", "SOP Instance uid of the selected instance.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("url", "uri", "WADO-RS URL to retrieve the DICOM SOP Instance.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("frames", "", "Identity and location information of the frames in the selected instance.", 0, java.lang.Integer.MAX_VALUE, frames)); - } - - public InstanceComponent copy() { - InstanceComponent dst = new InstanceComponent(); - copyValues(dst); - dst.sopClass = sopClass == null ? null : sopClass.copy(); - dst.uid = uid == null ? null : uid.copy(); - dst.url = url == null ? null : url.copy(); - if (frames != null) { - dst.frames = new ArrayList(); - for (FramesComponent i : frames) - dst.frames.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof InstanceComponent)) - return false; - InstanceComponent o = (InstanceComponent) other; - return compareDeep(sopClass, o.sopClass, true) && compareDeep(uid, o.uid, true) && compareDeep(url, o.url, true) - && compareDeep(frames, o.frames, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof InstanceComponent)) - return false; - InstanceComponent o = (InstanceComponent) other; - return compareValues(sopClass, o.sopClass, true) && compareValues(uid, o.uid, true) && compareValues(url, o.url, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (sopClass == null || sopClass.isEmpty()) && (uid == null || uid.isEmpty()) - && (url == null || url.isEmpty()) && (frames == null || frames.isEmpty()); - } - - } - - @Block() - public static class FramesComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The frame numbers in the frame set. - */ - @Child(name = "frameNumbers", type = {UnsignedIntType.class}, order=1, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Frame numbers", formalDefinition="The frame numbers in the frame set." ) - protected List frameNumbers; - - /** - * WADO-RS URL to retrieve the DICOM frames. - */ - @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Retrieve URL", formalDefinition="WADO-RS URL to retrieve the DICOM frames." ) - protected UriType url; - - private static final long serialVersionUID = -2068206970L; - - /* - * Constructor - */ - public FramesComponent() { - super(); - } - - /* - * Constructor - */ - public FramesComponent(UriType url) { - super(); - this.url = url; - } - - /** - * @return {@link #frameNumbers} (The frame numbers in the frame set.) - */ - public List getFrameNumbers() { - if (this.frameNumbers == null) - this.frameNumbers = new ArrayList(); - return this.frameNumbers; - } - - public boolean hasFrameNumbers() { - if (this.frameNumbers == null) - return false; - for (UnsignedIntType item : this.frameNumbers) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #frameNumbers} (The frame numbers in the frame set.) - */ - // syntactic sugar - public UnsignedIntType addFrameNumbersElement() {//2 - UnsignedIntType t = new UnsignedIntType(); - if (this.frameNumbers == null) - this.frameNumbers = new ArrayList(); - this.frameNumbers.add(t); - return t; - } - - /** - * @param value {@link #frameNumbers} (The frame numbers in the frame set.) - */ - public FramesComponent addFrameNumbers(int value) { //1 - UnsignedIntType t = new UnsignedIntType(); - t.setValue(value); - if (this.frameNumbers == null) - this.frameNumbers = new ArrayList(); - this.frameNumbers.add(t); - return this; - } - - /** - * @param value {@link #frameNumbers} (The frame numbers in the frame set.) - */ - public boolean hasFrameNumbers(int value) { - if (this.frameNumbers == null) - return false; - for (UnsignedIntType v : this.frameNumbers) - if (v.equals(value)) // unsignedInt - return true; - return false; - } - - /** - * @return {@link #url} (WADO-RS URL to retrieve the DICOM frames.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FramesComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (WADO-RS URL to retrieve the DICOM frames.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public FramesComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return WADO-RS URL to retrieve the DICOM frames. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value WADO-RS URL to retrieve the DICOM frames. - */ - public FramesComponent setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("frameNumbers", "unsignedInt", "The frame numbers in the frame set.", 0, java.lang.Integer.MAX_VALUE, frameNumbers)); - childrenList.add(new Property("url", "uri", "WADO-RS URL to retrieve the DICOM frames.", 0, java.lang.Integer.MAX_VALUE, url)); - } - - public FramesComponent copy() { - FramesComponent dst = new FramesComponent(); - copyValues(dst); - if (frameNumbers != null) { - dst.frameNumbers = new ArrayList(); - for (UnsignedIntType i : frameNumbers) - dst.frameNumbers.add(i.copy()); - }; - dst.url = url == null ? null : url.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof FramesComponent)) - return false; - FramesComponent o = (FramesComponent) other; - return compareDeep(frameNumbers, o.frameNumbers, true) && compareDeep(url, o.url, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof FramesComponent)) - return false; - FramesComponent o = (FramesComponent) other; - return compareValues(frameNumbers, o.frameNumbers, true) && compareValues(url, o.url, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (frameNumbers == null || frameNumbers.isEmpty()) && (url == null || url.isEmpty()) - ; - } - - } - - /** - * Instance UID of the DICOM KOS SOP Instances represenetd in this resource. - */ - @Child(name = "uid", type = {OidType.class}, order=0, min=1, max=1) - @Description(shortDefinition="Instance UID", formalDefinition="Instance UID of the DICOM KOS SOP Instances represenetd in this resource." ) - protected OidType uid; - - /** - * A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection. - */ - @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1) - @Description(shortDefinition="Patient of the selected objects", formalDefinition="A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.) - */ - protected Patient patientTarget; - - /** - * The reason for, or significance of, the selection of objects referenced in the resource. - */ - @Child(name = "title", type = {CodeableConcept.class}, order=2, min=1, max=1) - @Description(shortDefinition="Reason for selection", formalDefinition="The reason for, or significance of, the selection of objects referenced in the resource." ) - protected CodeableConcept title; - - /** - * Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. - */ - @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Description text", formalDefinition="Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection." ) - protected StringType description; - - /** - * Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion. - */ - @Child(name = "author", type = {Practitioner.class, Device.class, Organization.class, Patient.class, RelatedPerson.class}, order=4, min=0, max=1) - @Description(shortDefinition="Author (human or machine)", formalDefinition="Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) - */ - protected Resource authorTarget; - - /** - * Date and time when the key object selection was authored. Note that this is the date and time the DICOM SOP instances in the selection were selected (selection decision making). It is different from the creation date and time of the selection resource. - */ - @Child(name = "authoringTime", type = {DateTimeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Authoring time of the selection", formalDefinition="Date and time when the key object selection was authored. Note that this is the date and time the DICOM SOP instances in the selection were selected (selection decision making). It is different from the creation date and time of the selection resource." ) - protected DateTimeType authoringTime; - - /** - * Study identity and locating information of the DICOM SOP instances in the selection. - */ - @Child(name = "study", type = {}, order=6, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Study identity of the selected instances", formalDefinition="Study identity and locating information of the DICOM SOP instances in the selection." ) - protected List study; - - private static final long serialVersionUID = -1961832713L; - - /* - * Constructor - */ - public ImagingObjectSelection() { - super(); - } - - /* - * Constructor - */ - public ImagingObjectSelection(OidType uid, Reference patient, CodeableConcept title) { - super(); - this.uid = uid; - this.patient = patient; - this.title = title; - } - - /** - * @return {@link #uid} (Instance UID of the DICOM KOS SOP Instances represenetd in this resource.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingObjectSelection.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); // bb - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (Instance UID of the DICOM KOS SOP Instances represenetd in this resource.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public ImagingObjectSelection setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return Instance UID of the DICOM KOS SOP Instances represenetd in this resource. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value Instance UID of the DICOM KOS SOP Instances represenetd in this resource. - */ - public ImagingObjectSelection setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #patient} (A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingObjectSelection.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.) - */ - public ImagingObjectSelection setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingObjectSelection.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.) - */ - public ImagingObjectSelection setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #title} (The reason for, or significance of, the selection of objects referenced in the resource.) - */ - public CodeableConcept getTitle() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingObjectSelection.title"); - else if (Configuration.doAutoCreate()) - this.title = new CodeableConcept(); // cc - return this.title; - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (The reason for, or significance of, the selection of objects referenced in the resource.) - */ - public ImagingObjectSelection setTitle(CodeableConcept value) { - this.title = value; - return this; - } - - /** - * @return {@link #description} (Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingObjectSelection.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ImagingObjectSelection setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. - */ - public ImagingObjectSelection setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #author} (Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingObjectSelection.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); // cc - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) - */ - public ImagingObjectSelection setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) - */ - public Resource getAuthorTarget() { - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) - */ - public ImagingObjectSelection setAuthorTarget(Resource value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #authoringTime} (Date and time when the key object selection was authored. Note that this is the date and time the DICOM SOP instances in the selection were selected (selection decision making). It is different from the creation date and time of the selection resource.). This is the underlying object with id, value and extensions. The accessor "getAuthoringTime" gives direct access to the value - */ - public DateTimeType getAuthoringTimeElement() { - if (this.authoringTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingObjectSelection.authoringTime"); - else if (Configuration.doAutoCreate()) - this.authoringTime = new DateTimeType(); // bb - return this.authoringTime; - } - - public boolean hasAuthoringTimeElement() { - return this.authoringTime != null && !this.authoringTime.isEmpty(); - } - - public boolean hasAuthoringTime() { - return this.authoringTime != null && !this.authoringTime.isEmpty(); - } - - /** - * @param value {@link #authoringTime} (Date and time when the key object selection was authored. Note that this is the date and time the DICOM SOP instances in the selection were selected (selection decision making). It is different from the creation date and time of the selection resource.). This is the underlying object with id, value and extensions. The accessor "getAuthoringTime" gives direct access to the value - */ - public ImagingObjectSelection setAuthoringTimeElement(DateTimeType value) { - this.authoringTime = value; - return this; - } - - /** - * @return Date and time when the key object selection was authored. Note that this is the date and time the DICOM SOP instances in the selection were selected (selection decision making). It is different from the creation date and time of the selection resource. - */ - public Date getAuthoringTime() { - return this.authoringTime == null ? null : this.authoringTime.getValue(); - } - - /** - * @param value Date and time when the key object selection was authored. Note that this is the date and time the DICOM SOP instances in the selection were selected (selection decision making). It is different from the creation date and time of the selection resource. - */ - public ImagingObjectSelection setAuthoringTime(Date value) { - if (value == null) - this.authoringTime = null; - else { - if (this.authoringTime == null) - this.authoringTime = new DateTimeType(); - this.authoringTime.setValue(value); - } - return this; - } - - /** - * @return {@link #study} (Study identity and locating information of the DICOM SOP instances in the selection.) - */ - public List getStudy() { - if (this.study == null) - this.study = new ArrayList(); - return this.study; - } - - public boolean hasStudy() { - if (this.study == null) - return false; - for (StudyComponent item : this.study) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #study} (Study identity and locating information of the DICOM SOP instances in the selection.) - */ - // syntactic sugar - public StudyComponent addStudy() { //3 - StudyComponent t = new StudyComponent(); - if (this.study == null) - this.study = new ArrayList(); - this.study.add(t); - return t; - } - - // syntactic sugar - public ImagingObjectSelection addStudy(StudyComponent t) { //3 - if (t == null) - return this; - if (this.study == null) - this.study = new ArrayList(); - this.study.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("uid", "oid", "Instance UID of the DICOM KOS SOP Instances represenetd in this resource.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("patient", "Reference(Patient)", "A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("title", "CodeableConcept", "The reason for, or significance of, the selection of objects referenced in the resource.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("description", "string", "Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("author", "Reference(Practitioner|Device|Organization|Patient|RelatedPerson)", "Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("authoringTime", "dateTime", "Date and time when the key object selection was authored. Note that this is the date and time the DICOM SOP instances in the selection were selected (selection decision making). It is different from the creation date and time of the selection resource.", 0, java.lang.Integer.MAX_VALUE, authoringTime)); - childrenList.add(new Property("study", "", "Study identity and locating information of the DICOM SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, study)); - } - - public ImagingObjectSelection copy() { - ImagingObjectSelection dst = new ImagingObjectSelection(); - copyValues(dst); - dst.uid = uid == null ? null : uid.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.title = title == null ? null : title.copy(); - dst.description = description == null ? null : description.copy(); - dst.author = author == null ? null : author.copy(); - dst.authoringTime = authoringTime == null ? null : authoringTime.copy(); - if (study != null) { - dst.study = new ArrayList(); - for (StudyComponent i : study) - dst.study.add(i.copy()); - }; - return dst; - } - - protected ImagingObjectSelection typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImagingObjectSelection)) - return false; - ImagingObjectSelection o = (ImagingObjectSelection) other; - return compareDeep(uid, o.uid, true) && compareDeep(patient, o.patient, true) && compareDeep(title, o.title, true) - && compareDeep(description, o.description, true) && compareDeep(author, o.author, true) && compareDeep(authoringTime, o.authoringTime, true) - && compareDeep(study, o.study, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImagingObjectSelection)) - return false; - ImagingObjectSelection o = (ImagingObjectSelection) other; - return compareValues(uid, o.uid, true) && compareValues(description, o.description, true) && compareValues(authoringTime, o.authoringTime, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (uid == null || uid.isEmpty()) && (patient == null || patient.isEmpty()) - && (title == null || title.isEmpty()) && (description == null || description.isEmpty()) && (author == null || author.isEmpty()) - && (authoringTime == null || authoringTime.isEmpty()) && (study == null || study.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ImagingObjectSelection; - } - - @SearchParamDefinition(name="selected-study", path="ImagingObjectSelection.study.uid", description="Study selected in key DICOM object selection", type="token" ) - public static final String SP_SELECTEDSTUDY = "selected-study"; - @SearchParamDefinition(name="author", path="ImagingObjectSelection.author", description="Author of key DICOM object selection", type="reference" ) - public static final String SP_AUTHOR = "author"; - @SearchParamDefinition(name="title", path="ImagingObjectSelection.title", description="Title of key DICOM object selection", type="token" ) - public static final String SP_TITLE = "title"; - @SearchParamDefinition(name="patient", path="ImagingObjectSelection.patient", description="Subject of key DICOM object selection", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="authoring-time", path="ImagingObjectSelection.authoringTime", description="Time of key DICOM object selection authoring", type="date" ) - public static final String SP_AUTHORINGTIME = "authoring-time"; - @SearchParamDefinition(name="identifier", path="ImagingObjectSelection.uid", description="UID of key DICOM object selection", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A set of DICOM SOP Instances of a patient, selected for some application purpose, e.g., quality assurance, teaching, conference, consulting, etc. Objects selected can be from different studies, but must be of the same patient. + */ +@ResourceDef(name="ImagingObjectSelection", profile="http://hl7.org/fhir/Profile/ImagingObjectSelection") +public class ImagingObjectSelection extends DomainResource { + + @Block() + public static class StudyComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Study instance uid of the SOP instances in the selection. + */ + @Child(name = "uid", type = {OidType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Study instance uid", formalDefinition="Study instance uid of the SOP instances in the selection." ) + protected OidType uid; + + /** + * WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection. + */ + @Child(name = "url", type = {UriType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Retrieve URL", formalDefinition="WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection." ) + protected UriType url; + + /** + * Series indetity and locating information of the DICOM SOP instances in the selection. + */ + @Child(name = "series", type = {}, order=3, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Series identity of the selected instances", formalDefinition="Series indetity and locating information of the DICOM SOP instances in the selection." ) + protected List series; + + private static final long serialVersionUID = -1632673574L; + + /* + * Constructor + */ + public StudyComponent() { + super(); + } + + /* + * Constructor + */ + public StudyComponent(OidType uid) { + super(); + this.uid = uid; + } + + /** + * @return {@link #uid} (Study instance uid of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StudyComponent.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); // bb + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (Study instance uid of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public StudyComponent setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return Study instance uid of the SOP instances in the selection. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value Study instance uid of the SOP instances in the selection. + */ + public StudyComponent setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #url} (WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StudyComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public StudyComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection. + */ + public StudyComponent setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #series} (Series indetity and locating information of the DICOM SOP instances in the selection.) + */ + public List getSeries() { + if (this.series == null) + this.series = new ArrayList(); + return this.series; + } + + public boolean hasSeries() { + if (this.series == null) + return false; + for (SeriesComponent item : this.series) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #series} (Series indetity and locating information of the DICOM SOP instances in the selection.) + */ + // syntactic sugar + public SeriesComponent addSeries() { //3 + SeriesComponent t = new SeriesComponent(); + if (this.series == null) + this.series = new ArrayList(); + this.series.add(t); + return t; + } + + // syntactic sugar + public StudyComponent addSeries(SeriesComponent t) { //3 + if (t == null) + return this; + if (this.series == null) + this.series = new ArrayList(); + this.series.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("uid", "oid", "Study instance uid of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("url", "uri", "WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("series", "", "Series indetity and locating information of the DICOM SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, series)); + } + + public StudyComponent copy() { + StudyComponent dst = new StudyComponent(); + copyValues(dst); + dst.uid = uid == null ? null : uid.copy(); + dst.url = url == null ? null : url.copy(); + if (series != null) { + dst.series = new ArrayList(); + for (SeriesComponent i : series) + dst.series.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StudyComponent)) + return false; + StudyComponent o = (StudyComponent) other; + return compareDeep(uid, o.uid, true) && compareDeep(url, o.url, true) && compareDeep(series, o.series, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StudyComponent)) + return false; + StudyComponent o = (StudyComponent) other; + return compareValues(uid, o.uid, true) && compareValues(url, o.url, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (uid == null || uid.isEmpty()) && (url == null || url.isEmpty()) && (series == null || series.isEmpty()) + ; + } + + } + + @Block() + public static class SeriesComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Series instance uid of the SOP instances in the selection. + */ + @Child(name = "uid", type = {OidType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Series instance uid", formalDefinition="Series instance uid of the SOP instances in the selection." ) + protected OidType uid; + + /** + * WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection. + */ + @Child(name = "url", type = {UriType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Retrieve URL", formalDefinition="WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection." ) + protected UriType url; + + /** + * Identity and locating information of the selected DICOM SOP instances. + */ + @Child(name = "instance", type = {}, order=3, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The selected instance", formalDefinition="Identity and locating information of the selected DICOM SOP instances." ) + protected List instance; + + private static final long serialVersionUID = 229247770L; + + /* + * Constructor + */ + public SeriesComponent() { + super(); + } + + /** + * @return {@link #uid} (Series instance uid of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SeriesComponent.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); // bb + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (Series instance uid of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public SeriesComponent setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return Series instance uid of the SOP instances in the selection. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value Series instance uid of the SOP instances in the selection. + */ + public SeriesComponent setUid(String value) { + if (Utilities.noString(value)) + this.uid = null; + else { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + } + return this; + } + + /** + * @return {@link #url} (WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SeriesComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public SeriesComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection. + */ + public SeriesComponent setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #instance} (Identity and locating information of the selected DICOM SOP instances.) + */ + public List getInstance() { + if (this.instance == null) + this.instance = new ArrayList(); + return this.instance; + } + + public boolean hasInstance() { + if (this.instance == null) + return false; + for (InstanceComponent item : this.instance) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #instance} (Identity and locating information of the selected DICOM SOP instances.) + */ + // syntactic sugar + public InstanceComponent addInstance() { //3 + InstanceComponent t = new InstanceComponent(); + if (this.instance == null) + this.instance = new ArrayList(); + this.instance.add(t); + return t; + } + + // syntactic sugar + public SeriesComponent addInstance(InstanceComponent t) { //3 + if (t == null) + return this; + if (this.instance == null) + this.instance = new ArrayList(); + this.instance.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("uid", "oid", "Series instance uid of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("url", "uri", "WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("instance", "", "Identity and locating information of the selected DICOM SOP instances.", 0, java.lang.Integer.MAX_VALUE, instance)); + } + + public SeriesComponent copy() { + SeriesComponent dst = new SeriesComponent(); + copyValues(dst); + dst.uid = uid == null ? null : uid.copy(); + dst.url = url == null ? null : url.copy(); + if (instance != null) { + dst.instance = new ArrayList(); + for (InstanceComponent i : instance) + dst.instance.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SeriesComponent)) + return false; + SeriesComponent o = (SeriesComponent) other; + return compareDeep(uid, o.uid, true) && compareDeep(url, o.url, true) && compareDeep(instance, o.instance, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SeriesComponent)) + return false; + SeriesComponent o = (SeriesComponent) other; + return compareValues(uid, o.uid, true) && compareValues(url, o.url, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (uid == null || uid.isEmpty()) && (url == null || url.isEmpty()) && (instance == null || instance.isEmpty()) + ; + } + + } + + @Block() + public static class InstanceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * SOP class uid of the selected instance. + */ + @Child(name = "sopClass", type = {OidType.class}, order=1, min=1, max=1) + @Description(shortDefinition="SOP class uid of instance", formalDefinition="SOP class uid of the selected instance." ) + protected OidType sopClass; + + /** + * SOP Instance uid of the selected instance. + */ + @Child(name = "uid", type = {OidType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Uid of the selected instance", formalDefinition="SOP Instance uid of the selected instance." ) + protected OidType uid; + + /** + * WADO-RS URL to retrieve the DICOM SOP Instance. + */ + @Child(name = "url", type = {UriType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Retrieve URL", formalDefinition="WADO-RS URL to retrieve the DICOM SOP Instance." ) + protected UriType url; + + /** + * Identity and location information of the frames in the selected instance. + */ + @Child(name = "frames", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The frame set", formalDefinition="Identity and location information of the frames in the selected instance." ) + protected List frames; + + private static final long serialVersionUID = 1641180916L; + + /* + * Constructor + */ + public InstanceComponent() { + super(); + } + + /* + * Constructor + */ + public InstanceComponent(OidType sopClass, OidType uid, UriType url) { + super(); + this.sopClass = sopClass; + this.uid = uid; + this.url = url; + } + + /** + * @return {@link #sopClass} (SOP class uid of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getSopClass" gives direct access to the value + */ + public OidType getSopClassElement() { + if (this.sopClass == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstanceComponent.sopClass"); + else if (Configuration.doAutoCreate()) + this.sopClass = new OidType(); // bb + return this.sopClass; + } + + public boolean hasSopClassElement() { + return this.sopClass != null && !this.sopClass.isEmpty(); + } + + public boolean hasSopClass() { + return this.sopClass != null && !this.sopClass.isEmpty(); + } + + /** + * @param value {@link #sopClass} (SOP class uid of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getSopClass" gives direct access to the value + */ + public InstanceComponent setSopClassElement(OidType value) { + this.sopClass = value; + return this; + } + + /** + * @return SOP class uid of the selected instance. + */ + public String getSopClass() { + return this.sopClass == null ? null : this.sopClass.getValue(); + } + + /** + * @param value SOP class uid of the selected instance. + */ + public InstanceComponent setSopClass(String value) { + if (this.sopClass == null) + this.sopClass = new OidType(); + this.sopClass.setValue(value); + return this; + } + + /** + * @return {@link #uid} (SOP Instance uid of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstanceComponent.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); // bb + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (SOP Instance uid of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public InstanceComponent setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return SOP Instance uid of the selected instance. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value SOP Instance uid of the selected instance. + */ + public InstanceComponent setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #url} (WADO-RS URL to retrieve the DICOM SOP Instance.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstanceComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (WADO-RS URL to retrieve the DICOM SOP Instance.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public InstanceComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return WADO-RS URL to retrieve the DICOM SOP Instance. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value WADO-RS URL to retrieve the DICOM SOP Instance. + */ + public InstanceComponent setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + /** + * @return {@link #frames} (Identity and location information of the frames in the selected instance.) + */ + public List getFrames() { + if (this.frames == null) + this.frames = new ArrayList(); + return this.frames; + } + + public boolean hasFrames() { + if (this.frames == null) + return false; + for (FramesComponent item : this.frames) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #frames} (Identity and location information of the frames in the selected instance.) + */ + // syntactic sugar + public FramesComponent addFrames() { //3 + FramesComponent t = new FramesComponent(); + if (this.frames == null) + this.frames = new ArrayList(); + this.frames.add(t); + return t; + } + + // syntactic sugar + public InstanceComponent addFrames(FramesComponent t) { //3 + if (t == null) + return this; + if (this.frames == null) + this.frames = new ArrayList(); + this.frames.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sopClass", "oid", "SOP class uid of the selected instance.", 0, java.lang.Integer.MAX_VALUE, sopClass)); + childrenList.add(new Property("uid", "oid", "SOP Instance uid of the selected instance.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("url", "uri", "WADO-RS URL to retrieve the DICOM SOP Instance.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("frames", "", "Identity and location information of the frames in the selected instance.", 0, java.lang.Integer.MAX_VALUE, frames)); + } + + public InstanceComponent copy() { + InstanceComponent dst = new InstanceComponent(); + copyValues(dst); + dst.sopClass = sopClass == null ? null : sopClass.copy(); + dst.uid = uid == null ? null : uid.copy(); + dst.url = url == null ? null : url.copy(); + if (frames != null) { + dst.frames = new ArrayList(); + for (FramesComponent i : frames) + dst.frames.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof InstanceComponent)) + return false; + InstanceComponent o = (InstanceComponent) other; + return compareDeep(sopClass, o.sopClass, true) && compareDeep(uid, o.uid, true) && compareDeep(url, o.url, true) + && compareDeep(frames, o.frames, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof InstanceComponent)) + return false; + InstanceComponent o = (InstanceComponent) other; + return compareValues(sopClass, o.sopClass, true) && compareValues(uid, o.uid, true) && compareValues(url, o.url, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (sopClass == null || sopClass.isEmpty()) && (uid == null || uid.isEmpty()) + && (url == null || url.isEmpty()) && (frames == null || frames.isEmpty()); + } + + } + + @Block() + public static class FramesComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The frame numbers in the frame set. + */ + @Child(name = "frameNumbers", type = {UnsignedIntType.class}, order=1, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Frame numbers", formalDefinition="The frame numbers in the frame set." ) + protected List frameNumbers; + + /** + * WADO-RS URL to retrieve the DICOM frames. + */ + @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Retrieve URL", formalDefinition="WADO-RS URL to retrieve the DICOM frames." ) + protected UriType url; + + private static final long serialVersionUID = -2068206970L; + + /* + * Constructor + */ + public FramesComponent() { + super(); + } + + /* + * Constructor + */ + public FramesComponent(UriType url) { + super(); + this.url = url; + } + + /** + * @return {@link #frameNumbers} (The frame numbers in the frame set.) + */ + public List getFrameNumbers() { + if (this.frameNumbers == null) + this.frameNumbers = new ArrayList(); + return this.frameNumbers; + } + + public boolean hasFrameNumbers() { + if (this.frameNumbers == null) + return false; + for (UnsignedIntType item : this.frameNumbers) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #frameNumbers} (The frame numbers in the frame set.) + */ + // syntactic sugar + public UnsignedIntType addFrameNumbersElement() {//2 + UnsignedIntType t = new UnsignedIntType(); + if (this.frameNumbers == null) + this.frameNumbers = new ArrayList(); + this.frameNumbers.add(t); + return t; + } + + /** + * @param value {@link #frameNumbers} (The frame numbers in the frame set.) + */ + public FramesComponent addFrameNumbers(int value) { //1 + UnsignedIntType t = new UnsignedIntType(); + t.setValue(value); + if (this.frameNumbers == null) + this.frameNumbers = new ArrayList(); + this.frameNumbers.add(t); + return this; + } + + /** + * @param value {@link #frameNumbers} (The frame numbers in the frame set.) + */ + public boolean hasFrameNumbers(int value) { + if (this.frameNumbers == null) + return false; + for (UnsignedIntType v : this.frameNumbers) + if (v.equals(value)) // unsignedInt + return true; + return false; + } + + /** + * @return {@link #url} (WADO-RS URL to retrieve the DICOM frames.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FramesComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (WADO-RS URL to retrieve the DICOM frames.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public FramesComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return WADO-RS URL to retrieve the DICOM frames. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value WADO-RS URL to retrieve the DICOM frames. + */ + public FramesComponent setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("frameNumbers", "unsignedInt", "The frame numbers in the frame set.", 0, java.lang.Integer.MAX_VALUE, frameNumbers)); + childrenList.add(new Property("url", "uri", "WADO-RS URL to retrieve the DICOM frames.", 0, java.lang.Integer.MAX_VALUE, url)); + } + + public FramesComponent copy() { + FramesComponent dst = new FramesComponent(); + copyValues(dst); + if (frameNumbers != null) { + dst.frameNumbers = new ArrayList(); + for (UnsignedIntType i : frameNumbers) + dst.frameNumbers.add(i.copy()); + }; + dst.url = url == null ? null : url.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof FramesComponent)) + return false; + FramesComponent o = (FramesComponent) other; + return compareDeep(frameNumbers, o.frameNumbers, true) && compareDeep(url, o.url, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof FramesComponent)) + return false; + FramesComponent o = (FramesComponent) other; + return compareValues(frameNumbers, o.frameNumbers, true) && compareValues(url, o.url, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (frameNumbers == null || frameNumbers.isEmpty()) && (url == null || url.isEmpty()) + ; + } + + } + + /** + * Instance UID of the DICOM KOS SOP Instances represenetd in this resource. + */ + @Child(name = "uid", type = {OidType.class}, order=0, min=1, max=1) + @Description(shortDefinition="Instance UID", formalDefinition="Instance UID of the DICOM KOS SOP Instances represenetd in this resource." ) + protected OidType uid; + + /** + * A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection. + */ + @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1) + @Description(shortDefinition="Patient of the selected objects", formalDefinition="A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.) + */ + protected Patient patientTarget; + + /** + * The reason for, or significance of, the selection of objects referenced in the resource. + */ + @Child(name = "title", type = {CodeableConcept.class}, order=2, min=1, max=1) + @Description(shortDefinition="Reason for selection", formalDefinition="The reason for, or significance of, the selection of objects referenced in the resource." ) + protected CodeableConcept title; + + /** + * Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. + */ + @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Description text", formalDefinition="Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection." ) + protected StringType description; + + /** + * Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion. + */ + @Child(name = "author", type = {Practitioner.class, Device.class, Organization.class, Patient.class, RelatedPerson.class}, order=4, min=0, max=1) + @Description(shortDefinition="Author (human or machine)", formalDefinition="Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) + */ + protected Resource authorTarget; + + /** + * Date and time when the key object selection was authored. Note that this is the date and time the DICOM SOP instances in the selection were selected (selection decision making). It is different from the creation date and time of the selection resource. + */ + @Child(name = "authoringTime", type = {DateTimeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Authoring time of the selection", formalDefinition="Date and time when the key object selection was authored. Note that this is the date and time the DICOM SOP instances in the selection were selected (selection decision making). It is different from the creation date and time of the selection resource." ) + protected DateTimeType authoringTime; + + /** + * Study identity and locating information of the DICOM SOP instances in the selection. + */ + @Child(name = "study", type = {}, order=6, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Study identity of the selected instances", formalDefinition="Study identity and locating information of the DICOM SOP instances in the selection." ) + protected List study; + + private static final long serialVersionUID = -1961832713L; + + /* + * Constructor + */ + public ImagingObjectSelection() { + super(); + } + + /* + * Constructor + */ + public ImagingObjectSelection(OidType uid, Reference patient, CodeableConcept title) { + super(); + this.uid = uid; + this.patient = patient; + this.title = title; + } + + /** + * @return {@link #uid} (Instance UID of the DICOM KOS SOP Instances represenetd in this resource.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingObjectSelection.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); // bb + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (Instance UID of the DICOM KOS SOP Instances represenetd in this resource.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public ImagingObjectSelection setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return Instance UID of the DICOM KOS SOP Instances represenetd in this resource. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value Instance UID of the DICOM KOS SOP Instances represenetd in this resource. + */ + public ImagingObjectSelection setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #patient} (A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingObjectSelection.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.) + */ + public ImagingObjectSelection setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingObjectSelection.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.) + */ + public ImagingObjectSelection setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #title} (The reason for, or significance of, the selection of objects referenced in the resource.) + */ + public CodeableConcept getTitle() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingObjectSelection.title"); + else if (Configuration.doAutoCreate()) + this.title = new CodeableConcept(); // cc + return this.title; + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (The reason for, or significance of, the selection of objects referenced in the resource.) + */ + public ImagingObjectSelection setTitle(CodeableConcept value) { + this.title = value; + return this; + } + + /** + * @return {@link #description} (Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingObjectSelection.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ImagingObjectSelection setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. + */ + public ImagingObjectSelection setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #author} (Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingObjectSelection.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); // cc + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) + */ + public ImagingObjectSelection setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) + */ + public Resource getAuthorTarget() { + return this.authorTarget; + } + + /** + * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) + */ + public ImagingObjectSelection setAuthorTarget(Resource value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #authoringTime} (Date and time when the key object selection was authored. Note that this is the date and time the DICOM SOP instances in the selection were selected (selection decision making). It is different from the creation date and time of the selection resource.). This is the underlying object with id, value and extensions. The accessor "getAuthoringTime" gives direct access to the value + */ + public DateTimeType getAuthoringTimeElement() { + if (this.authoringTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingObjectSelection.authoringTime"); + else if (Configuration.doAutoCreate()) + this.authoringTime = new DateTimeType(); // bb + return this.authoringTime; + } + + public boolean hasAuthoringTimeElement() { + return this.authoringTime != null && !this.authoringTime.isEmpty(); + } + + public boolean hasAuthoringTime() { + return this.authoringTime != null && !this.authoringTime.isEmpty(); + } + + /** + * @param value {@link #authoringTime} (Date and time when the key object selection was authored. Note that this is the date and time the DICOM SOP instances in the selection were selected (selection decision making). It is different from the creation date and time of the selection resource.). This is the underlying object with id, value and extensions. The accessor "getAuthoringTime" gives direct access to the value + */ + public ImagingObjectSelection setAuthoringTimeElement(DateTimeType value) { + this.authoringTime = value; + return this; + } + + /** + * @return Date and time when the key object selection was authored. Note that this is the date and time the DICOM SOP instances in the selection were selected (selection decision making). It is different from the creation date and time of the selection resource. + */ + public Date getAuthoringTime() { + return this.authoringTime == null ? null : this.authoringTime.getValue(); + } + + /** + * @param value Date and time when the key object selection was authored. Note that this is the date and time the DICOM SOP instances in the selection were selected (selection decision making). It is different from the creation date and time of the selection resource. + */ + public ImagingObjectSelection setAuthoringTime(Date value) { + if (value == null) + this.authoringTime = null; + else { + if (this.authoringTime == null) + this.authoringTime = new DateTimeType(); + this.authoringTime.setValue(value); + } + return this; + } + + /** + * @return {@link #study} (Study identity and locating information of the DICOM SOP instances in the selection.) + */ + public List getStudy() { + if (this.study == null) + this.study = new ArrayList(); + return this.study; + } + + public boolean hasStudy() { + if (this.study == null) + return false; + for (StudyComponent item : this.study) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #study} (Study identity and locating information of the DICOM SOP instances in the selection.) + */ + // syntactic sugar + public StudyComponent addStudy() { //3 + StudyComponent t = new StudyComponent(); + if (this.study == null) + this.study = new ArrayList(); + this.study.add(t); + return t; + } + + // syntactic sugar + public ImagingObjectSelection addStudy(StudyComponent t) { //3 + if (t == null) + return this; + if (this.study == null) + this.study = new ArrayList(); + this.study.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("uid", "oid", "Instance UID of the DICOM KOS SOP Instances represenetd in this resource.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("patient", "Reference(Patient)", "A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("title", "CodeableConcept", "The reason for, or significance of, the selection of objects referenced in the resource.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("description", "string", "Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("author", "Reference(Practitioner|Device|Organization|Patient|RelatedPerson)", "Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("authoringTime", "dateTime", "Date and time when the key object selection was authored. Note that this is the date and time the DICOM SOP instances in the selection were selected (selection decision making). It is different from the creation date and time of the selection resource.", 0, java.lang.Integer.MAX_VALUE, authoringTime)); + childrenList.add(new Property("study", "", "Study identity and locating information of the DICOM SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, study)); + } + + public ImagingObjectSelection copy() { + ImagingObjectSelection dst = new ImagingObjectSelection(); + copyValues(dst); + dst.uid = uid == null ? null : uid.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.title = title == null ? null : title.copy(); + dst.description = description == null ? null : description.copy(); + dst.author = author == null ? null : author.copy(); + dst.authoringTime = authoringTime == null ? null : authoringTime.copy(); + if (study != null) { + dst.study = new ArrayList(); + for (StudyComponent i : study) + dst.study.add(i.copy()); + }; + return dst; + } + + protected ImagingObjectSelection typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImagingObjectSelection)) + return false; + ImagingObjectSelection o = (ImagingObjectSelection) other; + return compareDeep(uid, o.uid, true) && compareDeep(patient, o.patient, true) && compareDeep(title, o.title, true) + && compareDeep(description, o.description, true) && compareDeep(author, o.author, true) && compareDeep(authoringTime, o.authoringTime, true) + && compareDeep(study, o.study, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImagingObjectSelection)) + return false; + ImagingObjectSelection o = (ImagingObjectSelection) other; + return compareValues(uid, o.uid, true) && compareValues(description, o.description, true) && compareValues(authoringTime, o.authoringTime, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (uid == null || uid.isEmpty()) && (patient == null || patient.isEmpty()) + && (title == null || title.isEmpty()) && (description == null || description.isEmpty()) && (author == null || author.isEmpty()) + && (authoringTime == null || authoringTime.isEmpty()) && (study == null || study.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ImagingObjectSelection; + } + + @SearchParamDefinition(name="identifier", path="ImagingObjectSelection.uid", description="UID of key DICOM object selection", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="authoring-time", path="ImagingObjectSelection.authoringTime", description="Time of key DICOM object selection authoring", type="date" ) + public static final String SP_AUTHORINGTIME = "authoring-time"; + @SearchParamDefinition(name="selected-study", path="ImagingObjectSelection.study.uid", description="Study selected in key DICOM object selection", type="token" ) + public static final String SP_SELECTEDSTUDY = "selected-study"; + @SearchParamDefinition(name="author", path="ImagingObjectSelection.author", description="Author of key DICOM object selection", type="reference" ) + public static final String SP_AUTHOR = "author"; + @SearchParamDefinition(name="patient", path="ImagingObjectSelection.patient", description="Subject of key DICOM object selection", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="title", path="ImagingObjectSelection.title", description="Title of key DICOM object selection", type="token" ) + public static final String SP_TITLE = "title"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ImagingStudy.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ImagingStudy.java index 4397aeb9b36..4d59c36324b 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ImagingStudy.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ImagingStudy.java @@ -1,3597 +1,3576 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Representation of the content produced in a DICOM imaging study. A study comprises a set of Series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A Series is of only one modality (e.g., X-ray, CT, MR, ultrasound), but a Study may have multiple Series of different modalities. - */ -@ResourceDef(name="ImagingStudy", profile="http://hl7.org/fhir/Profile/ImagingStudy") -public class ImagingStudy extends DomainResource { - - public enum ImagingModality { - /** - * - */ - AR, - /** - * - */ - BMD, - /** - * - */ - BDUS, - /** - * - */ - EPS, - /** - * - */ - CR, - /** - * - */ - CT, - /** - * - */ - DX, - /** - * - */ - ECG, - /** - * - */ - ES, - /** - * - */ - XC, - /** - * - */ - GM, - /** - * - */ - HD, - /** - * - */ - IO, - /** - * - */ - IVOCT, - /** - * - */ - IVUS, - /** - * - */ - KER, - /** - * - */ - LEN, - /** - * - */ - MR, - /** - * - */ - MG, - /** - * - */ - NM, - /** - * - */ - OAM, - /** - * - */ - OCT, - /** - * - */ - OPM, - /** - * - */ - OP, - /** - * - */ - OPR, - /** - * - */ - OPT, - /** - * - */ - OPV, - /** - * - */ - PX, - /** - * - */ - PT, - /** - * - */ - RF, - /** - * - */ - RG, - /** - * - */ - SM, - /** - * - */ - SRF, - /** - * - */ - US, - /** - * - */ - VA, - /** - * - */ - XA, - /** - * added to help the parsers - */ - NULL; - public static ImagingModality fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("AR".equals(codeString)) - return AR; - if ("BMD".equals(codeString)) - return BMD; - if ("BDUS".equals(codeString)) - return BDUS; - if ("EPS".equals(codeString)) - return EPS; - if ("CR".equals(codeString)) - return CR; - if ("CT".equals(codeString)) - return CT; - if ("DX".equals(codeString)) - return DX; - if ("ECG".equals(codeString)) - return ECG; - if ("ES".equals(codeString)) - return ES; - if ("XC".equals(codeString)) - return XC; - if ("GM".equals(codeString)) - return GM; - if ("HD".equals(codeString)) - return HD; - if ("IO".equals(codeString)) - return IO; - if ("IVOCT".equals(codeString)) - return IVOCT; - if ("IVUS".equals(codeString)) - return IVUS; - if ("KER".equals(codeString)) - return KER; - if ("LEN".equals(codeString)) - return LEN; - if ("MR".equals(codeString)) - return MR; - if ("MG".equals(codeString)) - return MG; - if ("NM".equals(codeString)) - return NM; - if ("OAM".equals(codeString)) - return OAM; - if ("OCT".equals(codeString)) - return OCT; - if ("OPM".equals(codeString)) - return OPM; - if ("OP".equals(codeString)) - return OP; - if ("OPR".equals(codeString)) - return OPR; - if ("OPT".equals(codeString)) - return OPT; - if ("OPV".equals(codeString)) - return OPV; - if ("PX".equals(codeString)) - return PX; - if ("PT".equals(codeString)) - return PT; - if ("RF".equals(codeString)) - return RF; - if ("RG".equals(codeString)) - return RG; - if ("SM".equals(codeString)) - return SM; - if ("SRF".equals(codeString)) - return SRF; - if ("US".equals(codeString)) - return US; - if ("VA".equals(codeString)) - return VA; - if ("XA".equals(codeString)) - return XA; - throw new Exception("Unknown ImagingModality code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case AR: return "AR"; - case BMD: return "BMD"; - case BDUS: return "BDUS"; - case EPS: return "EPS"; - case CR: return "CR"; - case CT: return "CT"; - case DX: return "DX"; - case ECG: return "ECG"; - case ES: return "ES"; - case XC: return "XC"; - case GM: return "GM"; - case HD: return "HD"; - case IO: return "IO"; - case IVOCT: return "IVOCT"; - case IVUS: return "IVUS"; - case KER: return "KER"; - case LEN: return "LEN"; - case MR: return "MR"; - case MG: return "MG"; - case NM: return "NM"; - case OAM: return "OAM"; - case OCT: return "OCT"; - case OPM: return "OPM"; - case OP: return "OP"; - case OPR: return "OPR"; - case OPT: return "OPT"; - case OPV: return "OPV"; - case PX: return "PX"; - case PT: return "PT"; - case RF: return "RF"; - case RG: return "RG"; - case SM: return "SM"; - case SRF: return "SRF"; - case US: return "US"; - case VA: return "VA"; - case XA: return "XA"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case AR: return "http://nema.org/dicom/dicm"; - case BMD: return "http://nema.org/dicom/dicm"; - case BDUS: return "http://nema.org/dicom/dicm"; - case EPS: return "http://nema.org/dicom/dicm"; - case CR: return "http://nema.org/dicom/dicm"; - case CT: return "http://nema.org/dicom/dicm"; - case DX: return "http://nema.org/dicom/dicm"; - case ECG: return "http://nema.org/dicom/dicm"; - case ES: return "http://nema.org/dicom/dicm"; - case XC: return "http://nema.org/dicom/dicm"; - case GM: return "http://nema.org/dicom/dicm"; - case HD: return "http://nema.org/dicom/dicm"; - case IO: return "http://nema.org/dicom/dicm"; - case IVOCT: return "http://nema.org/dicom/dicm"; - case IVUS: return "http://nema.org/dicom/dicm"; - case KER: return "http://nema.org/dicom/dicm"; - case LEN: return "http://nema.org/dicom/dicm"; - case MR: return "http://nema.org/dicom/dicm"; - case MG: return "http://nema.org/dicom/dicm"; - case NM: return "http://nema.org/dicom/dicm"; - case OAM: return "http://nema.org/dicom/dicm"; - case OCT: return "http://nema.org/dicom/dicm"; - case OPM: return "http://nema.org/dicom/dicm"; - case OP: return "http://nema.org/dicom/dicm"; - case OPR: return "http://nema.org/dicom/dicm"; - case OPT: return "http://nema.org/dicom/dicm"; - case OPV: return "http://nema.org/dicom/dicm"; - case PX: return "http://nema.org/dicom/dicm"; - case PT: return "http://nema.org/dicom/dicm"; - case RF: return "http://nema.org/dicom/dicm"; - case RG: return "http://nema.org/dicom/dicm"; - case SM: return "http://nema.org/dicom/dicm"; - case SRF: return "http://nema.org/dicom/dicm"; - case US: return "http://nema.org/dicom/dicm"; - case VA: return "http://nema.org/dicom/dicm"; - case XA: return "http://nema.org/dicom/dicm"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case AR: return ""; - case BMD: return ""; - case BDUS: return ""; - case EPS: return ""; - case CR: return ""; - case CT: return ""; - case DX: return ""; - case ECG: return ""; - case ES: return ""; - case XC: return ""; - case GM: return ""; - case HD: return ""; - case IO: return ""; - case IVOCT: return ""; - case IVUS: return ""; - case KER: return ""; - case LEN: return ""; - case MR: return ""; - case MG: return ""; - case NM: return ""; - case OAM: return ""; - case OCT: return ""; - case OPM: return ""; - case OP: return ""; - case OPR: return ""; - case OPT: return ""; - case OPV: return ""; - case PX: return ""; - case PT: return ""; - case RF: return ""; - case RG: return ""; - case SM: return ""; - case SRF: return ""; - case US: return ""; - case VA: return ""; - case XA: return ""; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case AR: return "A R"; - case BMD: return "B M D"; - case BDUS: return "B D U S"; - case EPS: return "E P S"; - case CR: return "C R"; - case CT: return "C T"; - case DX: return "D X"; - case ECG: return "E C G"; - case ES: return "E S"; - case XC: return "X C"; - case GM: return "G M"; - case HD: return "H D"; - case IO: return "I O"; - case IVOCT: return "I V O C T"; - case IVUS: return "I V U S"; - case KER: return "K E R"; - case LEN: return "L E N"; - case MR: return "M R"; - case MG: return "M G"; - case NM: return "N M"; - case OAM: return "O A M"; - case OCT: return "O C T"; - case OPM: return "O P M"; - case OP: return "O P"; - case OPR: return "O P R"; - case OPT: return "O P T"; - case OPV: return "O P V"; - case PX: return "P X"; - case PT: return "P T"; - case RF: return "R F"; - case RG: return "R G"; - case SM: return "S M"; - case SRF: return "S R F"; - case US: return "U S"; - case VA: return "V A"; - case XA: return "X A"; - default: return "?"; - } - } - } - - public static class ImagingModalityEnumFactory implements EnumFactory { - public ImagingModality fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("AR".equals(codeString)) - return ImagingModality.AR; - if ("BMD".equals(codeString)) - return ImagingModality.BMD; - if ("BDUS".equals(codeString)) - return ImagingModality.BDUS; - if ("EPS".equals(codeString)) - return ImagingModality.EPS; - if ("CR".equals(codeString)) - return ImagingModality.CR; - if ("CT".equals(codeString)) - return ImagingModality.CT; - if ("DX".equals(codeString)) - return ImagingModality.DX; - if ("ECG".equals(codeString)) - return ImagingModality.ECG; - if ("ES".equals(codeString)) - return ImagingModality.ES; - if ("XC".equals(codeString)) - return ImagingModality.XC; - if ("GM".equals(codeString)) - return ImagingModality.GM; - if ("HD".equals(codeString)) - return ImagingModality.HD; - if ("IO".equals(codeString)) - return ImagingModality.IO; - if ("IVOCT".equals(codeString)) - return ImagingModality.IVOCT; - if ("IVUS".equals(codeString)) - return ImagingModality.IVUS; - if ("KER".equals(codeString)) - return ImagingModality.KER; - if ("LEN".equals(codeString)) - return ImagingModality.LEN; - if ("MR".equals(codeString)) - return ImagingModality.MR; - if ("MG".equals(codeString)) - return ImagingModality.MG; - if ("NM".equals(codeString)) - return ImagingModality.NM; - if ("OAM".equals(codeString)) - return ImagingModality.OAM; - if ("OCT".equals(codeString)) - return ImagingModality.OCT; - if ("OPM".equals(codeString)) - return ImagingModality.OPM; - if ("OP".equals(codeString)) - return ImagingModality.OP; - if ("OPR".equals(codeString)) - return ImagingModality.OPR; - if ("OPT".equals(codeString)) - return ImagingModality.OPT; - if ("OPV".equals(codeString)) - return ImagingModality.OPV; - if ("PX".equals(codeString)) - return ImagingModality.PX; - if ("PT".equals(codeString)) - return ImagingModality.PT; - if ("RF".equals(codeString)) - return ImagingModality.RF; - if ("RG".equals(codeString)) - return ImagingModality.RG; - if ("SM".equals(codeString)) - return ImagingModality.SM; - if ("SRF".equals(codeString)) - return ImagingModality.SRF; - if ("US".equals(codeString)) - return ImagingModality.US; - if ("VA".equals(codeString)) - return ImagingModality.VA; - if ("XA".equals(codeString)) - return ImagingModality.XA; - throw new IllegalArgumentException("Unknown ImagingModality code '"+codeString+"'"); - } - public String toCode(ImagingModality code) { - if (code == ImagingModality.AR) - return "AR"; - if (code == ImagingModality.BMD) - return "BMD"; - if (code == ImagingModality.BDUS) - return "BDUS"; - if (code == ImagingModality.EPS) - return "EPS"; - if (code == ImagingModality.CR) - return "CR"; - if (code == ImagingModality.CT) - return "CT"; - if (code == ImagingModality.DX) - return "DX"; - if (code == ImagingModality.ECG) - return "ECG"; - if (code == ImagingModality.ES) - return "ES"; - if (code == ImagingModality.XC) - return "XC"; - if (code == ImagingModality.GM) - return "GM"; - if (code == ImagingModality.HD) - return "HD"; - if (code == ImagingModality.IO) - return "IO"; - if (code == ImagingModality.IVOCT) - return "IVOCT"; - if (code == ImagingModality.IVUS) - return "IVUS"; - if (code == ImagingModality.KER) - return "KER"; - if (code == ImagingModality.LEN) - return "LEN"; - if (code == ImagingModality.MR) - return "MR"; - if (code == ImagingModality.MG) - return "MG"; - if (code == ImagingModality.NM) - return "NM"; - if (code == ImagingModality.OAM) - return "OAM"; - if (code == ImagingModality.OCT) - return "OCT"; - if (code == ImagingModality.OPM) - return "OPM"; - if (code == ImagingModality.OP) - return "OP"; - if (code == ImagingModality.OPR) - return "OPR"; - if (code == ImagingModality.OPT) - return "OPT"; - if (code == ImagingModality.OPV) - return "OPV"; - if (code == ImagingModality.PX) - return "PX"; - if (code == ImagingModality.PT) - return "PT"; - if (code == ImagingModality.RF) - return "RF"; - if (code == ImagingModality.RG) - return "RG"; - if (code == ImagingModality.SM) - return "SM"; - if (code == ImagingModality.SRF) - return "SRF"; - if (code == ImagingModality.US) - return "US"; - if (code == ImagingModality.VA) - return "VA"; - if (code == ImagingModality.XA) - return "XA"; - return "?"; - } - } - - public enum InstanceAvailability { - /** - * Resources are immediately available,. - */ - ONLINE, - /** - * Resources need to be retrieved by manual intervention. - */ - OFFLINE, - /** - * Resources need to be retrieved from relatively slow media. - */ - NEARLINE, - /** - * Resources cannot be retrieved. - */ - UNAVAILABLE, - /** - * added to help the parsers - */ - NULL; - public static InstanceAvailability fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("ONLINE".equals(codeString)) - return ONLINE; - if ("OFFLINE".equals(codeString)) - return OFFLINE; - if ("NEARLINE".equals(codeString)) - return NEARLINE; - if ("UNAVAILABLE".equals(codeString)) - return UNAVAILABLE; - throw new Exception("Unknown InstanceAvailability code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ONLINE: return "ONLINE"; - case OFFLINE: return "OFFLINE"; - case NEARLINE: return "NEARLINE"; - case UNAVAILABLE: return "UNAVAILABLE"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ONLINE: return "http://nema.org/dicom/dicm"; - case OFFLINE: return "http://nema.org/dicom/dicm"; - case NEARLINE: return "http://nema.org/dicom/dicm"; - case UNAVAILABLE: return "http://nema.org/dicom/dicm"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ONLINE: return "Resources are immediately available,."; - case OFFLINE: return "Resources need to be retrieved by manual intervention."; - case NEARLINE: return "Resources need to be retrieved from relatively slow media."; - case UNAVAILABLE: return "Resources cannot be retrieved."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ONLINE: return "O N L I N E"; - case OFFLINE: return "O F F L I N E"; - case NEARLINE: return "N E A R L I N E"; - case UNAVAILABLE: return "U N A V A I L A B L E"; - default: return "?"; - } - } - } - - public static class InstanceAvailabilityEnumFactory implements EnumFactory { - public InstanceAvailability fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("ONLINE".equals(codeString)) - return InstanceAvailability.ONLINE; - if ("OFFLINE".equals(codeString)) - return InstanceAvailability.OFFLINE; - if ("NEARLINE".equals(codeString)) - return InstanceAvailability.NEARLINE; - if ("UNAVAILABLE".equals(codeString)) - return InstanceAvailability.UNAVAILABLE; - throw new IllegalArgumentException("Unknown InstanceAvailability code '"+codeString+"'"); - } - public String toCode(InstanceAvailability code) { - if (code == InstanceAvailability.ONLINE) - return "ONLINE"; - if (code == InstanceAvailability.OFFLINE) - return "OFFLINE"; - if (code == InstanceAvailability.NEARLINE) - return "NEARLINE"; - if (code == InstanceAvailability.UNAVAILABLE) - return "UNAVAILABLE"; - return "?"; - } - } - - public enum Modality { - /** - * - */ - AR, - /** - * - */ - AU, - /** - * - */ - BDUS, - /** - * - */ - BI, - /** - * - */ - BMD, - /** - * - */ - CR, - /** - * - */ - CT, - /** - * - */ - DG, - /** - * - */ - DX, - /** - * - */ - ECG, - /** - * - */ - EPS, - /** - * - */ - ES, - /** - * - */ - GM, - /** - * - */ - HC, - /** - * - */ - HD, - /** - * - */ - IO, - /** - * - */ - IVOCT, - /** - * - */ - IVUS, - /** - * - */ - KER, - /** - * - */ - KO, - /** - * - */ - LEN, - /** - * - */ - LS, - /** - * - */ - MG, - /** - * - */ - MR, - /** - * - */ - NM, - /** - * - */ - OAM, - /** - * - */ - OCT, - /** - * - */ - OP, - /** - * - */ - OPM, - /** - * - */ - OPT, - /** - * - */ - OPV, - /** - * - */ - OT, - /** - * - */ - PR, - /** - * - */ - PT, - /** - * - */ - PX, - /** - * - */ - REG, - /** - * - */ - RF, - /** - * - */ - RG, - /** - * - */ - RTDOSE, - /** - * - */ - RTIMAGE, - /** - * - */ - RTPLAN, - /** - * - */ - RTRECORD, - /** - * - */ - RTSTRUCT, - /** - * - */ - SEG, - /** - * - */ - SM, - /** - * - */ - SMR, - /** - * - */ - SR, - /** - * - */ - SRF, - /** - * - */ - TG, - /** - * - */ - US, - /** - * - */ - VA, - /** - * - */ - XA, - /** - * - */ - XC, - /** - * added to help the parsers - */ - NULL; - public static Modality fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("AR".equals(codeString)) - return AR; - if ("AU".equals(codeString)) - return AU; - if ("BDUS".equals(codeString)) - return BDUS; - if ("BI".equals(codeString)) - return BI; - if ("BMD".equals(codeString)) - return BMD; - if ("CR".equals(codeString)) - return CR; - if ("CT".equals(codeString)) - return CT; - if ("DG".equals(codeString)) - return DG; - if ("DX".equals(codeString)) - return DX; - if ("ECG".equals(codeString)) - return ECG; - if ("EPS".equals(codeString)) - return EPS; - if ("ES".equals(codeString)) - return ES; - if ("GM".equals(codeString)) - return GM; - if ("HC".equals(codeString)) - return HC; - if ("HD".equals(codeString)) - return HD; - if ("IO".equals(codeString)) - return IO; - if ("IVOCT".equals(codeString)) - return IVOCT; - if ("IVUS".equals(codeString)) - return IVUS; - if ("KER".equals(codeString)) - return KER; - if ("KO".equals(codeString)) - return KO; - if ("LEN".equals(codeString)) - return LEN; - if ("LS".equals(codeString)) - return LS; - if ("MG".equals(codeString)) - return MG; - if ("MR".equals(codeString)) - return MR; - if ("NM".equals(codeString)) - return NM; - if ("OAM".equals(codeString)) - return OAM; - if ("OCT".equals(codeString)) - return OCT; - if ("OP".equals(codeString)) - return OP; - if ("OPM".equals(codeString)) - return OPM; - if ("OPT".equals(codeString)) - return OPT; - if ("OPV".equals(codeString)) - return OPV; - if ("OT".equals(codeString)) - return OT; - if ("PR".equals(codeString)) - return PR; - if ("PT".equals(codeString)) - return PT; - if ("PX".equals(codeString)) - return PX; - if ("REG".equals(codeString)) - return REG; - if ("RF".equals(codeString)) - return RF; - if ("RG".equals(codeString)) - return RG; - if ("RTDOSE".equals(codeString)) - return RTDOSE; - if ("RTIMAGE".equals(codeString)) - return RTIMAGE; - if ("RTPLAN".equals(codeString)) - return RTPLAN; - if ("RTRECORD".equals(codeString)) - return RTRECORD; - if ("RTSTRUCT".equals(codeString)) - return RTSTRUCT; - if ("SEG".equals(codeString)) - return SEG; - if ("SM".equals(codeString)) - return SM; - if ("SMR".equals(codeString)) - return SMR; - if ("SR".equals(codeString)) - return SR; - if ("SRF".equals(codeString)) - return SRF; - if ("TG".equals(codeString)) - return TG; - if ("US".equals(codeString)) - return US; - if ("VA".equals(codeString)) - return VA; - if ("XA".equals(codeString)) - return XA; - if ("XC".equals(codeString)) - return XC; - throw new Exception("Unknown Modality code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case AR: return "AR"; - case AU: return "AU"; - case BDUS: return "BDUS"; - case BI: return "BI"; - case BMD: return "BMD"; - case CR: return "CR"; - case CT: return "CT"; - case DG: return "DG"; - case DX: return "DX"; - case ECG: return "ECG"; - case EPS: return "EPS"; - case ES: return "ES"; - case GM: return "GM"; - case HC: return "HC"; - case HD: return "HD"; - case IO: return "IO"; - case IVOCT: return "IVOCT"; - case IVUS: return "IVUS"; - case KER: return "KER"; - case KO: return "KO"; - case LEN: return "LEN"; - case LS: return "LS"; - case MG: return "MG"; - case MR: return "MR"; - case NM: return "NM"; - case OAM: return "OAM"; - case OCT: return "OCT"; - case OP: return "OP"; - case OPM: return "OPM"; - case OPT: return "OPT"; - case OPV: return "OPV"; - case OT: return "OT"; - case PR: return "PR"; - case PT: return "PT"; - case PX: return "PX"; - case REG: return "REG"; - case RF: return "RF"; - case RG: return "RG"; - case RTDOSE: return "RTDOSE"; - case RTIMAGE: return "RTIMAGE"; - case RTPLAN: return "RTPLAN"; - case RTRECORD: return "RTRECORD"; - case RTSTRUCT: return "RTSTRUCT"; - case SEG: return "SEG"; - case SM: return "SM"; - case SMR: return "SMR"; - case SR: return "SR"; - case SRF: return "SRF"; - case TG: return "TG"; - case US: return "US"; - case VA: return "VA"; - case XA: return "XA"; - case XC: return "XC"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case AR: return "http://nema.org/dicom/dicm"; - case AU: return "http://nema.org/dicom/dicm"; - case BDUS: return "http://nema.org/dicom/dicm"; - case BI: return "http://nema.org/dicom/dicm"; - case BMD: return "http://nema.org/dicom/dicm"; - case CR: return "http://nema.org/dicom/dicm"; - case CT: return "http://nema.org/dicom/dicm"; - case DG: return "http://nema.org/dicom/dicm"; - case DX: return "http://nema.org/dicom/dicm"; - case ECG: return "http://nema.org/dicom/dicm"; - case EPS: return "http://nema.org/dicom/dicm"; - case ES: return "http://nema.org/dicom/dicm"; - case GM: return "http://nema.org/dicom/dicm"; - case HC: return "http://nema.org/dicom/dicm"; - case HD: return "http://nema.org/dicom/dicm"; - case IO: return "http://nema.org/dicom/dicm"; - case IVOCT: return "http://nema.org/dicom/dicm"; - case IVUS: return "http://nema.org/dicom/dicm"; - case KER: return "http://nema.org/dicom/dicm"; - case KO: return "http://nema.org/dicom/dicm"; - case LEN: return "http://nema.org/dicom/dicm"; - case LS: return "http://nema.org/dicom/dicm"; - case MG: return "http://nema.org/dicom/dicm"; - case MR: return "http://nema.org/dicom/dicm"; - case NM: return "http://nema.org/dicom/dicm"; - case OAM: return "http://nema.org/dicom/dicm"; - case OCT: return "http://nema.org/dicom/dicm"; - case OP: return "http://nema.org/dicom/dicm"; - case OPM: return "http://nema.org/dicom/dicm"; - case OPT: return "http://nema.org/dicom/dicm"; - case OPV: return "http://nema.org/dicom/dicm"; - case OT: return "http://nema.org/dicom/dicm"; - case PR: return "http://nema.org/dicom/dicm"; - case PT: return "http://nema.org/dicom/dicm"; - case PX: return "http://nema.org/dicom/dicm"; - case REG: return "http://nema.org/dicom/dicm"; - case RF: return "http://nema.org/dicom/dicm"; - case RG: return "http://nema.org/dicom/dicm"; - case RTDOSE: return "http://nema.org/dicom/dicm"; - case RTIMAGE: return "http://nema.org/dicom/dicm"; - case RTPLAN: return "http://nema.org/dicom/dicm"; - case RTRECORD: return "http://nema.org/dicom/dicm"; - case RTSTRUCT: return "http://nema.org/dicom/dicm"; - case SEG: return "http://nema.org/dicom/dicm"; - case SM: return "http://nema.org/dicom/dicm"; - case SMR: return "http://nema.org/dicom/dicm"; - case SR: return "http://nema.org/dicom/dicm"; - case SRF: return "http://nema.org/dicom/dicm"; - case TG: return "http://nema.org/dicom/dicm"; - case US: return "http://nema.org/dicom/dicm"; - case VA: return "http://nema.org/dicom/dicm"; - case XA: return "http://nema.org/dicom/dicm"; - case XC: return "http://nema.org/dicom/dicm"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case AR: return ""; - case AU: return ""; - case BDUS: return ""; - case BI: return ""; - case BMD: return ""; - case CR: return ""; - case CT: return ""; - case DG: return ""; - case DX: return ""; - case ECG: return ""; - case EPS: return ""; - case ES: return ""; - case GM: return ""; - case HC: return ""; - case HD: return ""; - case IO: return ""; - case IVOCT: return ""; - case IVUS: return ""; - case KER: return ""; - case KO: return ""; - case LEN: return ""; - case LS: return ""; - case MG: return ""; - case MR: return ""; - case NM: return ""; - case OAM: return ""; - case OCT: return ""; - case OP: return ""; - case OPM: return ""; - case OPT: return ""; - case OPV: return ""; - case OT: return ""; - case PR: return ""; - case PT: return ""; - case PX: return ""; - case REG: return ""; - case RF: return ""; - case RG: return ""; - case RTDOSE: return ""; - case RTIMAGE: return ""; - case RTPLAN: return ""; - case RTRECORD: return ""; - case RTSTRUCT: return ""; - case SEG: return ""; - case SM: return ""; - case SMR: return ""; - case SR: return ""; - case SRF: return ""; - case TG: return ""; - case US: return ""; - case VA: return ""; - case XA: return ""; - case XC: return ""; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case AR: return "A R"; - case AU: return "A U"; - case BDUS: return "B D U S"; - case BI: return "B I"; - case BMD: return "B M D"; - case CR: return "C R"; - case CT: return "C T"; - case DG: return "D G"; - case DX: return "D X"; - case ECG: return "E C G"; - case EPS: return "E P S"; - case ES: return "E S"; - case GM: return "G M"; - case HC: return "H C"; - case HD: return "H D"; - case IO: return "I O"; - case IVOCT: return "I V O C T"; - case IVUS: return "I V U S"; - case KER: return "K E R"; - case KO: return "K O"; - case LEN: return "L E N"; - case LS: return "L S"; - case MG: return "M G"; - case MR: return "M R"; - case NM: return "N M"; - case OAM: return "O A M"; - case OCT: return "O C T"; - case OP: return "O P"; - case OPM: return "O P M"; - case OPT: return "O P T"; - case OPV: return "O P V"; - case OT: return "O T"; - case PR: return "P R"; - case PT: return "P T"; - case PX: return "P X"; - case REG: return "R E G"; - case RF: return "R F"; - case RG: return "R G"; - case RTDOSE: return "R T D O S E"; - case RTIMAGE: return "R T I M A G E"; - case RTPLAN: return "R T P L A N"; - case RTRECORD: return "R T R E C O R D"; - case RTSTRUCT: return "R T S T R U C T"; - case SEG: return "S E G"; - case SM: return "S M"; - case SMR: return "S M R"; - case SR: return "S R"; - case SRF: return "S R F"; - case TG: return "T G"; - case US: return "U S"; - case VA: return "V A"; - case XA: return "X A"; - case XC: return "X C"; - default: return "?"; - } - } - } - - public static class ModalityEnumFactory implements EnumFactory { - public Modality fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("AR".equals(codeString)) - return Modality.AR; - if ("AU".equals(codeString)) - return Modality.AU; - if ("BDUS".equals(codeString)) - return Modality.BDUS; - if ("BI".equals(codeString)) - return Modality.BI; - if ("BMD".equals(codeString)) - return Modality.BMD; - if ("CR".equals(codeString)) - return Modality.CR; - if ("CT".equals(codeString)) - return Modality.CT; - if ("DG".equals(codeString)) - return Modality.DG; - if ("DX".equals(codeString)) - return Modality.DX; - if ("ECG".equals(codeString)) - return Modality.ECG; - if ("EPS".equals(codeString)) - return Modality.EPS; - if ("ES".equals(codeString)) - return Modality.ES; - if ("GM".equals(codeString)) - return Modality.GM; - if ("HC".equals(codeString)) - return Modality.HC; - if ("HD".equals(codeString)) - return Modality.HD; - if ("IO".equals(codeString)) - return Modality.IO; - if ("IVOCT".equals(codeString)) - return Modality.IVOCT; - if ("IVUS".equals(codeString)) - return Modality.IVUS; - if ("KER".equals(codeString)) - return Modality.KER; - if ("KO".equals(codeString)) - return Modality.KO; - if ("LEN".equals(codeString)) - return Modality.LEN; - if ("LS".equals(codeString)) - return Modality.LS; - if ("MG".equals(codeString)) - return Modality.MG; - if ("MR".equals(codeString)) - return Modality.MR; - if ("NM".equals(codeString)) - return Modality.NM; - if ("OAM".equals(codeString)) - return Modality.OAM; - if ("OCT".equals(codeString)) - return Modality.OCT; - if ("OP".equals(codeString)) - return Modality.OP; - if ("OPM".equals(codeString)) - return Modality.OPM; - if ("OPT".equals(codeString)) - return Modality.OPT; - if ("OPV".equals(codeString)) - return Modality.OPV; - if ("OT".equals(codeString)) - return Modality.OT; - if ("PR".equals(codeString)) - return Modality.PR; - if ("PT".equals(codeString)) - return Modality.PT; - if ("PX".equals(codeString)) - return Modality.PX; - if ("REG".equals(codeString)) - return Modality.REG; - if ("RF".equals(codeString)) - return Modality.RF; - if ("RG".equals(codeString)) - return Modality.RG; - if ("RTDOSE".equals(codeString)) - return Modality.RTDOSE; - if ("RTIMAGE".equals(codeString)) - return Modality.RTIMAGE; - if ("RTPLAN".equals(codeString)) - return Modality.RTPLAN; - if ("RTRECORD".equals(codeString)) - return Modality.RTRECORD; - if ("RTSTRUCT".equals(codeString)) - return Modality.RTSTRUCT; - if ("SEG".equals(codeString)) - return Modality.SEG; - if ("SM".equals(codeString)) - return Modality.SM; - if ("SMR".equals(codeString)) - return Modality.SMR; - if ("SR".equals(codeString)) - return Modality.SR; - if ("SRF".equals(codeString)) - return Modality.SRF; - if ("TG".equals(codeString)) - return Modality.TG; - if ("US".equals(codeString)) - return Modality.US; - if ("VA".equals(codeString)) - return Modality.VA; - if ("XA".equals(codeString)) - return Modality.XA; - if ("XC".equals(codeString)) - return Modality.XC; - throw new IllegalArgumentException("Unknown Modality code '"+codeString+"'"); - } - public String toCode(Modality code) { - if (code == Modality.AR) - return "AR"; - if (code == Modality.AU) - return "AU"; - if (code == Modality.BDUS) - return "BDUS"; - if (code == Modality.BI) - return "BI"; - if (code == Modality.BMD) - return "BMD"; - if (code == Modality.CR) - return "CR"; - if (code == Modality.CT) - return "CT"; - if (code == Modality.DG) - return "DG"; - if (code == Modality.DX) - return "DX"; - if (code == Modality.ECG) - return "ECG"; - if (code == Modality.EPS) - return "EPS"; - if (code == Modality.ES) - return "ES"; - if (code == Modality.GM) - return "GM"; - if (code == Modality.HC) - return "HC"; - if (code == Modality.HD) - return "HD"; - if (code == Modality.IO) - return "IO"; - if (code == Modality.IVOCT) - return "IVOCT"; - if (code == Modality.IVUS) - return "IVUS"; - if (code == Modality.KER) - return "KER"; - if (code == Modality.KO) - return "KO"; - if (code == Modality.LEN) - return "LEN"; - if (code == Modality.LS) - return "LS"; - if (code == Modality.MG) - return "MG"; - if (code == Modality.MR) - return "MR"; - if (code == Modality.NM) - return "NM"; - if (code == Modality.OAM) - return "OAM"; - if (code == Modality.OCT) - return "OCT"; - if (code == Modality.OP) - return "OP"; - if (code == Modality.OPM) - return "OPM"; - if (code == Modality.OPT) - return "OPT"; - if (code == Modality.OPV) - return "OPV"; - if (code == Modality.OT) - return "OT"; - if (code == Modality.PR) - return "PR"; - if (code == Modality.PT) - return "PT"; - if (code == Modality.PX) - return "PX"; - if (code == Modality.REG) - return "REG"; - if (code == Modality.RF) - return "RF"; - if (code == Modality.RG) - return "RG"; - if (code == Modality.RTDOSE) - return "RTDOSE"; - if (code == Modality.RTIMAGE) - return "RTIMAGE"; - if (code == Modality.RTPLAN) - return "RTPLAN"; - if (code == Modality.RTRECORD) - return "RTRECORD"; - if (code == Modality.RTSTRUCT) - return "RTSTRUCT"; - if (code == Modality.SEG) - return "SEG"; - if (code == Modality.SM) - return "SM"; - if (code == Modality.SMR) - return "SMR"; - if (code == Modality.SR) - return "SR"; - if (code == Modality.SRF) - return "SRF"; - if (code == Modality.TG) - return "TG"; - if (code == Modality.US) - return "US"; - if (code == Modality.VA) - return "VA"; - if (code == Modality.XA) - return "XA"; - if (code == Modality.XC) - return "XC"; - return "?"; - } - } - - @Block() - public static class ImagingStudySeriesComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The Numeric identifier of this series in the study. - */ - @Child(name = "number", type = {UnsignedIntType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Numeric identifier of this series (0020,0011)", formalDefinition="The Numeric identifier of this series in the study." ) - protected UnsignedIntType number; - - /** - * The modality of this series sequence. - */ - @Child(name = "modality", type = {CodeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="The modality of the instances in the series (0008,0060)", formalDefinition="The modality of this series sequence." ) - protected Enumeration modality; - - /** - * Formal identifier for this series. - */ - @Child(name = "uid", type = {OidType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Formal identifier for this series (0020,000E)", formalDefinition="Formal identifier for this series." ) - protected OidType uid; - - /** - * A description of the series. - */ - @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="A description of the series (0008,103E)", formalDefinition="A description of the series." ) - protected StringType description; - - /** - * Number of SOP Instances in Series. - */ - @Child(name = "numberOfInstances", type = {UnsignedIntType.class}, order=5, min=1, max=1) - @Description(shortDefinition="Number of Series Related Instances (0020,1209)", formalDefinition="Number of SOP Instances in Series." ) - protected UnsignedIntType numberOfInstances; - - /** - * Availability of series (online, offline or nearline). - */ - @Child(name = "availability", type = {CodeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)", formalDefinition="Availability of series (online, offline or nearline)." ) - protected Enumeration availability; - - /** - * WADO-RS resource where the Series is available. - */ - @Child(name = "url", type = {UriType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Retrieve URI (0008,1115 > 0008,1190)", formalDefinition="WADO-RS resource where the Series is available." ) - protected UriType url; - - /** - * Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed. - */ - @Child(name = "bodySite", type = {Coding.class}, order=8, min=0, max=1) - @Description(shortDefinition="Body part examined (Map from 0018,0015)", formalDefinition="Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed." ) - protected Coding bodySite; - - /** - * Laterality if bodySite is paired anatomic structure and laterality is not pre-coordinated in bodySite code, map from (0020, 0060). - */ - @Child(name = "laterality", type = {Coding.class}, order=9, min=0, max=1) - @Description(shortDefinition="Body part laterality", formalDefinition="Laterality if bodySite is paired anatomic structure and laterality is not pre-coordinated in bodySite code, map from (0020, 0060)." ) - protected Coding laterality; - - /** - * The date and time when the series was started. - */ - @Child(name = "dateTime", type = {DateTimeType.class}, order=10, min=0, max=1) - @Description(shortDefinition="When the series started", formalDefinition="The date and time when the series was started." ) - protected DateTimeType dateTime; - - /** - * A single SOP Instance within the series, e.g., an image, or presentation state. - */ - @Child(name = "instance", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A single instance taken from a patient (image or other)", formalDefinition="A single SOP Instance within the series, e.g., an image, or presentation state." ) - protected List instance; - - private static final long serialVersionUID = 1186612269L; - - /* - * Constructor - */ - public ImagingStudySeriesComponent() { - super(); - } - - /* - * Constructor - */ - public ImagingStudySeriesComponent(Enumeration modality, OidType uid, UnsignedIntType numberOfInstances) { - super(); - this.modality = modality; - this.uid = uid; - this.numberOfInstances = numberOfInstances; - } - - /** - * @return {@link #number} (The Numeric identifier of this series in the study.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value - */ - public UnsignedIntType getNumberElement() { - if (this.number == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.number"); - else if (Configuration.doAutoCreate()) - this.number = new UnsignedIntType(); // bb - return this.number; - } - - public boolean hasNumberElement() { - return this.number != null && !this.number.isEmpty(); - } - - public boolean hasNumber() { - return this.number != null && !this.number.isEmpty(); - } - - /** - * @param value {@link #number} (The Numeric identifier of this series in the study.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value - */ - public ImagingStudySeriesComponent setNumberElement(UnsignedIntType value) { - this.number = value; - return this; - } - - /** - * @return The Numeric identifier of this series in the study. - */ - public int getNumber() { - return this.number == null || this.number.isEmpty() ? 0 : this.number.getValue(); - } - - /** - * @param value The Numeric identifier of this series in the study. - */ - public ImagingStudySeriesComponent setNumber(int value) { - if (this.number == null) - this.number = new UnsignedIntType(); - this.number.setValue(value); - return this; - } - - /** - * @return {@link #modality} (The modality of this series sequence.). This is the underlying object with id, value and extensions. The accessor "getModality" gives direct access to the value - */ - public Enumeration getModalityElement() { - if (this.modality == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.modality"); - else if (Configuration.doAutoCreate()) - this.modality = new Enumeration(new ModalityEnumFactory()); // bb - return this.modality; - } - - public boolean hasModalityElement() { - return this.modality != null && !this.modality.isEmpty(); - } - - public boolean hasModality() { - return this.modality != null && !this.modality.isEmpty(); - } - - /** - * @param value {@link #modality} (The modality of this series sequence.). This is the underlying object with id, value and extensions. The accessor "getModality" gives direct access to the value - */ - public ImagingStudySeriesComponent setModalityElement(Enumeration value) { - this.modality = value; - return this; - } - - /** - * @return The modality of this series sequence. - */ - public Modality getModality() { - return this.modality == null ? null : this.modality.getValue(); - } - - /** - * @param value The modality of this series sequence. - */ - public ImagingStudySeriesComponent setModality(Modality value) { - if (this.modality == null) - this.modality = new Enumeration(new ModalityEnumFactory()); - this.modality.setValue(value); - return this; - } - - /** - * @return {@link #uid} (Formal identifier for this series.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); // bb - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (Formal identifier for this series.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public ImagingStudySeriesComponent setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return Formal identifier for this series. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value Formal identifier for this series. - */ - public ImagingStudySeriesComponent setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #description} (A description of the series.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A description of the series.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ImagingStudySeriesComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A description of the series. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A description of the series. - */ - public ImagingStudySeriesComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #numberOfInstances} (Number of SOP Instances in Series.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value - */ - public UnsignedIntType getNumberOfInstancesElement() { - if (this.numberOfInstances == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.numberOfInstances"); - else if (Configuration.doAutoCreate()) - this.numberOfInstances = new UnsignedIntType(); // bb - return this.numberOfInstances; - } - - public boolean hasNumberOfInstancesElement() { - return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); - } - - public boolean hasNumberOfInstances() { - return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); - } - - /** - * @param value {@link #numberOfInstances} (Number of SOP Instances in Series.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value - */ - public ImagingStudySeriesComponent setNumberOfInstancesElement(UnsignedIntType value) { - this.numberOfInstances = value; - return this; - } - - /** - * @return Number of SOP Instances in Series. - */ - public int getNumberOfInstances() { - return this.numberOfInstances == null || this.numberOfInstances.isEmpty() ? 0 : this.numberOfInstances.getValue(); - } - - /** - * @param value Number of SOP Instances in Series. - */ - public ImagingStudySeriesComponent setNumberOfInstances(int value) { - if (this.numberOfInstances == null) - this.numberOfInstances = new UnsignedIntType(); - this.numberOfInstances.setValue(value); - return this; - } - - /** - * @return {@link #availability} (Availability of series (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value - */ - public Enumeration getAvailabilityElement() { - if (this.availability == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.availability"); - else if (Configuration.doAutoCreate()) - this.availability = new Enumeration(new InstanceAvailabilityEnumFactory()); // bb - return this.availability; - } - - public boolean hasAvailabilityElement() { - return this.availability != null && !this.availability.isEmpty(); - } - - public boolean hasAvailability() { - return this.availability != null && !this.availability.isEmpty(); - } - - /** - * @param value {@link #availability} (Availability of series (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value - */ - public ImagingStudySeriesComponent setAvailabilityElement(Enumeration value) { - this.availability = value; - return this; - } - - /** - * @return Availability of series (online, offline or nearline). - */ - public InstanceAvailability getAvailability() { - return this.availability == null ? null : this.availability.getValue(); - } - - /** - * @param value Availability of series (online, offline or nearline). - */ - public ImagingStudySeriesComponent setAvailability(InstanceAvailability value) { - if (value == null) - this.availability = null; - else { - if (this.availability == null) - this.availability = new Enumeration(new InstanceAvailabilityEnumFactory()); - this.availability.setValue(value); - } - return this; - } - - /** - * @return {@link #url} (WADO-RS resource where the Series is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (WADO-RS resource where the Series is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public ImagingStudySeriesComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return WADO-RS resource where the Series is available. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value WADO-RS resource where the Series is available. - */ - public ImagingStudySeriesComponent setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #bodySite} (Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed.) - */ - public Coding getBodySite() { - if (this.bodySite == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.bodySite"); - else if (Configuration.doAutoCreate()) - this.bodySite = new Coding(); // cc - return this.bodySite; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed.) - */ - public ImagingStudySeriesComponent setBodySite(Coding value) { - this.bodySite = value; - return this; - } - - /** - * @return {@link #laterality} (Laterality if bodySite is paired anatomic structure and laterality is not pre-coordinated in bodySite code, map from (0020, 0060).) - */ - public Coding getLaterality() { - if (this.laterality == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.laterality"); - else if (Configuration.doAutoCreate()) - this.laterality = new Coding(); // cc - return this.laterality; - } - - public boolean hasLaterality() { - return this.laterality != null && !this.laterality.isEmpty(); - } - - /** - * @param value {@link #laterality} (Laterality if bodySite is paired anatomic structure and laterality is not pre-coordinated in bodySite code, map from (0020, 0060).) - */ - public ImagingStudySeriesComponent setLaterality(Coding value) { - this.laterality = value; - return this; - } - - /** - * @return {@link #dateTime} (The date and time when the series was started.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public DateTimeType getDateTimeElement() { - if (this.dateTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.dateTime"); - else if (Configuration.doAutoCreate()) - this.dateTime = new DateTimeType(); // bb - return this.dateTime; - } - - public boolean hasDateTimeElement() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - public boolean hasDateTime() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - /** - * @param value {@link #dateTime} (The date and time when the series was started.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public ImagingStudySeriesComponent setDateTimeElement(DateTimeType value) { - this.dateTime = value; - return this; - } - - /** - * @return The date and time when the series was started. - */ - public Date getDateTime() { - return this.dateTime == null ? null : this.dateTime.getValue(); - } - - /** - * @param value The date and time when the series was started. - */ - public ImagingStudySeriesComponent setDateTime(Date value) { - if (value == null) - this.dateTime = null; - else { - if (this.dateTime == null) - this.dateTime = new DateTimeType(); - this.dateTime.setValue(value); - } - return this; - } - - /** - * @return {@link #instance} (A single SOP Instance within the series, e.g., an image, or presentation state.) - */ - public List getInstance() { - if (this.instance == null) - this.instance = new ArrayList(); - return this.instance; - } - - public boolean hasInstance() { - if (this.instance == null) - return false; - for (ImagingStudySeriesInstanceComponent item : this.instance) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #instance} (A single SOP Instance within the series, e.g., an image, or presentation state.) - */ - // syntactic sugar - public ImagingStudySeriesInstanceComponent addInstance() { //3 - ImagingStudySeriesInstanceComponent t = new ImagingStudySeriesInstanceComponent(); - if (this.instance == null) - this.instance = new ArrayList(); - this.instance.add(t); - return t; - } - - // syntactic sugar - public ImagingStudySeriesComponent addInstance(ImagingStudySeriesInstanceComponent t) { //3 - if (t == null) - return this; - if (this.instance == null) - this.instance = new ArrayList(); - this.instance.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("number", "unsignedInt", "The Numeric identifier of this series in the study.", 0, java.lang.Integer.MAX_VALUE, number)); - childrenList.add(new Property("modality", "code", "The modality of this series sequence.", 0, java.lang.Integer.MAX_VALUE, modality)); - childrenList.add(new Property("uid", "oid", "Formal identifier for this series.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("description", "string", "A description of the series.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("numberOfInstances", "unsignedInt", "Number of SOP Instances in Series.", 0, java.lang.Integer.MAX_VALUE, numberOfInstances)); - childrenList.add(new Property("availability", "code", "Availability of series (online, offline or nearline).", 0, java.lang.Integer.MAX_VALUE, availability)); - childrenList.add(new Property("url", "uri", "WADO-RS resource where the Series is available.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("bodySite", "Coding", "Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed.", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("laterality", "Coding", "Laterality if bodySite is paired anatomic structure and laterality is not pre-coordinated in bodySite code, map from (0020, 0060).", 0, java.lang.Integer.MAX_VALUE, laterality)); - childrenList.add(new Property("dateTime", "dateTime", "The date and time when the series was started.", 0, java.lang.Integer.MAX_VALUE, dateTime)); - childrenList.add(new Property("instance", "", "A single SOP Instance within the series, e.g., an image, or presentation state.", 0, java.lang.Integer.MAX_VALUE, instance)); - } - - public ImagingStudySeriesComponent copy() { - ImagingStudySeriesComponent dst = new ImagingStudySeriesComponent(); - copyValues(dst); - dst.number = number == null ? null : number.copy(); - dst.modality = modality == null ? null : modality.copy(); - dst.uid = uid == null ? null : uid.copy(); - dst.description = description == null ? null : description.copy(); - dst.numberOfInstances = numberOfInstances == null ? null : numberOfInstances.copy(); - dst.availability = availability == null ? null : availability.copy(); - dst.url = url == null ? null : url.copy(); - dst.bodySite = bodySite == null ? null : bodySite.copy(); - dst.laterality = laterality == null ? null : laterality.copy(); - dst.dateTime = dateTime == null ? null : dateTime.copy(); - if (instance != null) { - dst.instance = new ArrayList(); - for (ImagingStudySeriesInstanceComponent i : instance) - dst.instance.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImagingStudySeriesComponent)) - return false; - ImagingStudySeriesComponent o = (ImagingStudySeriesComponent) other; - return compareDeep(number, o.number, true) && compareDeep(modality, o.modality, true) && compareDeep(uid, o.uid, true) - && compareDeep(description, o.description, true) && compareDeep(numberOfInstances, o.numberOfInstances, true) - && compareDeep(availability, o.availability, true) && compareDeep(url, o.url, true) && compareDeep(bodySite, o.bodySite, true) - && compareDeep(laterality, o.laterality, true) && compareDeep(dateTime, o.dateTime, true) && compareDeep(instance, o.instance, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImagingStudySeriesComponent)) - return false; - ImagingStudySeriesComponent o = (ImagingStudySeriesComponent) other; - return compareValues(number, o.number, true) && compareValues(modality, o.modality, true) && compareValues(uid, o.uid, true) - && compareValues(description, o.description, true) && compareValues(numberOfInstances, o.numberOfInstances, true) - && compareValues(availability, o.availability, true) && compareValues(url, o.url, true) && compareValues(dateTime, o.dateTime, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (number == null || number.isEmpty()) && (modality == null || modality.isEmpty()) - && (uid == null || uid.isEmpty()) && (description == null || description.isEmpty()) && (numberOfInstances == null || numberOfInstances.isEmpty()) - && (availability == null || availability.isEmpty()) && (url == null || url.isEmpty()) && (bodySite == null || bodySite.isEmpty()) - && (laterality == null || laterality.isEmpty()) && (dateTime == null || dateTime.isEmpty()) - && (instance == null || instance.isEmpty()); - } - - } - - @Block() - public static class ImagingStudySeriesInstanceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The number of this image in the series. - */ - @Child(name = "number", type = {UnsignedIntType.class}, order=1, min=0, max=1) - @Description(shortDefinition="The number of this instance in the series (0020,0013)", formalDefinition="The number of this image in the series." ) - protected UnsignedIntType number; - - /** - * Formal identifier for this image. - */ - @Child(name = "uid", type = {OidType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Formal identifier for this instance (0008,0018)", formalDefinition="Formal identifier for this image." ) - protected OidType uid; - - /** - * DICOM Image type. - */ - @Child(name = "sopclass", type = {OidType.class}, order=3, min=1, max=1) - @Description(shortDefinition="DICOM class type (0008,0016)", formalDefinition="DICOM Image type." ) - protected OidType sopclass; - - /** - * A human-friendly SOP Class name. - */ - @Child(name = "type", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Type of instance (image etc) (0004,1430)", formalDefinition="A human-friendly SOP Class name." ) - protected StringType type; - - /** - * The description of the instance. - */ - @Child(name = "title", type = {StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Description (0070,0080 | 0040,A043 > 0008,0104 | 0042,0010 | 0008,0008)", formalDefinition="The description of the instance." ) - protected StringType title; - - /** - * Content of the instance or a rendering thereof (e.g., a JPEG of an image, or an XML of a structured report). May be represented by inline encoding, or by a URL reference to a WADO-RS service that makes the instance available. Multiple content attachments may be used for alternate representations of the instance. - */ - @Child(name = "content", type = {Attachment.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Content of the instance", formalDefinition="Content of the instance or a rendering thereof (e.g., a JPEG of an image, or an XML of a structured report). May be represented by inline encoding, or by a URL reference to a WADO-RS service that makes the instance available. Multiple content attachments may be used for alternate representations of the instance." ) - protected List content; - - private static final long serialVersionUID = 264997991L; - - /* - * Constructor - */ - public ImagingStudySeriesInstanceComponent() { - super(); - } - - /* - * Constructor - */ - public ImagingStudySeriesInstanceComponent(OidType uid, OidType sopclass) { - super(); - this.uid = uid; - this.sopclass = sopclass; - } - - /** - * @return {@link #number} (The number of this image in the series.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value - */ - public UnsignedIntType getNumberElement() { - if (this.number == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.number"); - else if (Configuration.doAutoCreate()) - this.number = new UnsignedIntType(); // bb - return this.number; - } - - public boolean hasNumberElement() { - return this.number != null && !this.number.isEmpty(); - } - - public boolean hasNumber() { - return this.number != null && !this.number.isEmpty(); - } - - /** - * @param value {@link #number} (The number of this image in the series.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value - */ - public ImagingStudySeriesInstanceComponent setNumberElement(UnsignedIntType value) { - this.number = value; - return this; - } - - /** - * @return The number of this image in the series. - */ - public int getNumber() { - return this.number == null || this.number.isEmpty() ? 0 : this.number.getValue(); - } - - /** - * @param value The number of this image in the series. - */ - public ImagingStudySeriesInstanceComponent setNumber(int value) { - if (this.number == null) - this.number = new UnsignedIntType(); - this.number.setValue(value); - return this; - } - - /** - * @return {@link #uid} (Formal identifier for this image.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); // bb - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (Formal identifier for this image.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public ImagingStudySeriesInstanceComponent setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return Formal identifier for this image. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value Formal identifier for this image. - */ - public ImagingStudySeriesInstanceComponent setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #sopclass} (DICOM Image type.). This is the underlying object with id, value and extensions. The accessor "getSopclass" gives direct access to the value - */ - public OidType getSopclassElement() { - if (this.sopclass == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.sopclass"); - else if (Configuration.doAutoCreate()) - this.sopclass = new OidType(); // bb - return this.sopclass; - } - - public boolean hasSopclassElement() { - return this.sopclass != null && !this.sopclass.isEmpty(); - } - - public boolean hasSopclass() { - return this.sopclass != null && !this.sopclass.isEmpty(); - } - - /** - * @param value {@link #sopclass} (DICOM Image type.). This is the underlying object with id, value and extensions. The accessor "getSopclass" gives direct access to the value - */ - public ImagingStudySeriesInstanceComponent setSopclassElement(OidType value) { - this.sopclass = value; - return this; - } - - /** - * @return DICOM Image type. - */ - public String getSopclass() { - return this.sopclass == null ? null : this.sopclass.getValue(); - } - - /** - * @param value DICOM Image type. - */ - public ImagingStudySeriesInstanceComponent setSopclass(String value) { - if (this.sopclass == null) - this.sopclass = new OidType(); - this.sopclass.setValue(value); - return this; - } - - /** - * @return {@link #type} (A human-friendly SOP Class name.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public StringType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new StringType(); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (A human-friendly SOP Class name.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ImagingStudySeriesInstanceComponent setTypeElement(StringType value) { - this.type = value; - return this; - } - - /** - * @return A human-friendly SOP Class name. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value A human-friendly SOP Class name. - */ - public ImagingStudySeriesInstanceComponent setType(String value) { - if (Utilities.noString(value)) - this.type = null; - else { - if (this.type == null) - this.type = new StringType(); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #title} (The description of the instance.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); // bb - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (The description of the instance.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public ImagingStudySeriesInstanceComponent setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return The description of the instance. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value The description of the instance. - */ - public ImagingStudySeriesInstanceComponent setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #content} (Content of the instance or a rendering thereof (e.g., a JPEG of an image, or an XML of a structured report). May be represented by inline encoding, or by a URL reference to a WADO-RS service that makes the instance available. Multiple content attachments may be used for alternate representations of the instance.) - */ - public List getContent() { - if (this.content == null) - this.content = new ArrayList(); - return this.content; - } - - public boolean hasContent() { - if (this.content == null) - return false; - for (Attachment item : this.content) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #content} (Content of the instance or a rendering thereof (e.g., a JPEG of an image, or an XML of a structured report). May be represented by inline encoding, or by a URL reference to a WADO-RS service that makes the instance available. Multiple content attachments may be used for alternate representations of the instance.) - */ - // syntactic sugar - public Attachment addContent() { //3 - Attachment t = new Attachment(); - if (this.content == null) - this.content = new ArrayList(); - this.content.add(t); - return t; - } - - // syntactic sugar - public ImagingStudySeriesInstanceComponent addContent(Attachment t) { //3 - if (t == null) - return this; - if (this.content == null) - this.content = new ArrayList(); - this.content.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("number", "unsignedInt", "The number of this image in the series.", 0, java.lang.Integer.MAX_VALUE, number)); - childrenList.add(new Property("uid", "oid", "Formal identifier for this image.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("sopclass", "oid", "DICOM Image type.", 0, java.lang.Integer.MAX_VALUE, sopclass)); - childrenList.add(new Property("type", "string", "A human-friendly SOP Class name.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("title", "string", "The description of the instance.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("content", "Attachment", "Content of the instance or a rendering thereof (e.g., a JPEG of an image, or an XML of a structured report). May be represented by inline encoding, or by a URL reference to a WADO-RS service that makes the instance available. Multiple content attachments may be used for alternate representations of the instance.", 0, java.lang.Integer.MAX_VALUE, content)); - } - - public ImagingStudySeriesInstanceComponent copy() { - ImagingStudySeriesInstanceComponent dst = new ImagingStudySeriesInstanceComponent(); - copyValues(dst); - dst.number = number == null ? null : number.copy(); - dst.uid = uid == null ? null : uid.copy(); - dst.sopclass = sopclass == null ? null : sopclass.copy(); - dst.type = type == null ? null : type.copy(); - dst.title = title == null ? null : title.copy(); - if (content != null) { - dst.content = new ArrayList(); - for (Attachment i : content) - dst.content.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImagingStudySeriesInstanceComponent)) - return false; - ImagingStudySeriesInstanceComponent o = (ImagingStudySeriesInstanceComponent) other; - return compareDeep(number, o.number, true) && compareDeep(uid, o.uid, true) && compareDeep(sopclass, o.sopclass, true) - && compareDeep(type, o.type, true) && compareDeep(title, o.title, true) && compareDeep(content, o.content, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImagingStudySeriesInstanceComponent)) - return false; - ImagingStudySeriesInstanceComponent o = (ImagingStudySeriesInstanceComponent) other; - return compareValues(number, o.number, true) && compareValues(uid, o.uid, true) && compareValues(sopclass, o.sopclass, true) - && compareValues(type, o.type, true) && compareValues(title, o.title, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (number == null || number.isEmpty()) && (uid == null || uid.isEmpty()) - && (sopclass == null || sopclass.isEmpty()) && (type == null || type.isEmpty()) && (title == null || title.isEmpty()) - && (content == null || content.isEmpty()); - } - - } - - /** - * Date and Time the study started. Timezone Offset From UTC. - */ - @Child(name = "started", type = {DateTimeType.class}, order=0, min=0, max=1) - @Description(shortDefinition="When the study was started (0008,0020)+(0008,0030)", formalDefinition="Date and Time the study started. Timezone Offset From UTC." ) - protected DateTimeType started; - - /** - * The patient imaged in the study. - */ - @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1) - @Description(shortDefinition="Who the images are of", formalDefinition="The patient imaged in the study." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient imaged in the study.) - */ - protected Patient patientTarget; - - /** - * Formal identifier for the study. - */ - @Child(name = "uid", type = {OidType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Formal identifier for the study (0020,000D)", formalDefinition="Formal identifier for the study." ) - protected OidType uid; - - /** - * Accession Number. - */ - @Child(name = "accession", type = {Identifier.class}, order=3, min=0, max=1) - @Description(shortDefinition="Accession Number (0008,0050)", formalDefinition="Accession Number." ) - protected Identifier accession; - - /** - * Other identifiers for the study. - */ - @Child(name = "identifier", type = {Identifier.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Other identifiers for the study (0020,0010)", formalDefinition="Other identifiers for the study." ) - protected List identifier; - - /** - * A list of the diagnostic orders that resulted in this imaging study being performed. - */ - @Child(name = "order", type = {DiagnosticOrder.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Order(s) that caused this study to be performed", formalDefinition="A list of the diagnostic orders that resulted in this imaging study being performed." ) - protected List order; - /** - * The actual objects that are the target of the reference (A list of the diagnostic orders that resulted in this imaging study being performed.) - */ - protected List orderTarget; - - - /** - * A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19). - */ - @Child(name = "modalityList", type = {CodeType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="All series.modality if actual acquisition modalities", formalDefinition="A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19)." ) - protected List> modalityList; - - /** - * The requesting/referring physician. - */ - @Child(name = "referrer", type = {Practitioner.class}, order=7, min=0, max=1) - @Description(shortDefinition="Referring physician (0008,0090)", formalDefinition="The requesting/referring physician." ) - protected Reference referrer; - - /** - * The actual object that is the target of the reference (The requesting/referring physician.) - */ - protected Practitioner referrerTarget; - - /** - * Availability of study (online, offline or nearline). - */ - @Child(name = "availability", type = {CodeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)", formalDefinition="Availability of study (online, offline or nearline)." ) - protected Enumeration availability; - - /** - * WADO-RS resource where Study is available. - */ - @Child(name = "url", type = {UriType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Retrieve URI (0008,1190)", formalDefinition="WADO-RS resource where Study is available." ) - protected UriType url; - - /** - * Number of Series in Study. - */ - @Child(name = "numberOfSeries", type = {UnsignedIntType.class}, order=10, min=1, max=1) - @Description(shortDefinition="Number of Study Related Series (0020,1206)", formalDefinition="Number of Series in Study." ) - protected UnsignedIntType numberOfSeries; - - /** - * Number of SOP Instances in Study. - */ - @Child(name = "numberOfInstances", type = {UnsignedIntType.class}, order=11, min=1, max=1) - @Description(shortDefinition="Number of Study Related Instances (0020,1208)", formalDefinition="Number of SOP Instances in Study." ) - protected UnsignedIntType numberOfInstances; - - /** - * Diagnoses etc provided with request. - */ - @Child(name = "clinicalInformation", type = {StringType.class}, order=12, min=0, max=1) - @Description(shortDefinition="Diagnoses etc with request (0040,1002)", formalDefinition="Diagnoses etc provided with request." ) - protected StringType clinicalInformation; - - /** - * Type of procedure performed. - */ - @Child(name = "procedure", type = {Coding.class}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Type of procedure performed (0008,1032)", formalDefinition="Type of procedure performed." ) - protected List procedure; - - /** - * Who read study and interpreted the images. - */ - @Child(name = "interpreter", type = {Practitioner.class}, order=14, min=0, max=1) - @Description(shortDefinition="Who interpreted images (0008,1060)", formalDefinition="Who read study and interpreted the images." ) - protected Reference interpreter; - - /** - * The actual object that is the target of the reference (Who read study and interpreted the images.) - */ - protected Practitioner interpreterTarget; - - /** - * Institution-generated description or classification of the Study performed. - */ - @Child(name = "description", type = {StringType.class}, order=15, min=0, max=1) - @Description(shortDefinition="Institution-generated description (0008,1030)", formalDefinition="Institution-generated description or classification of the Study performed." ) - protected StringType description; - - /** - * Each study has one or more series of image instances. - */ - @Child(name = "series", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Each study has one or more series of instances", formalDefinition="Each study has one or more series of image instances." ) - protected List series; - - private static final long serialVersionUID = 206272292L; - - /* - * Constructor - */ - public ImagingStudy() { - super(); - } - - /* - * Constructor - */ - public ImagingStudy(Reference patient, OidType uid, UnsignedIntType numberOfSeries, UnsignedIntType numberOfInstances) { - super(); - this.patient = patient; - this.uid = uid; - this.numberOfSeries = numberOfSeries; - this.numberOfInstances = numberOfInstances; - } - - /** - * @return {@link #started} (Date and Time the study started. Timezone Offset From UTC.). This is the underlying object with id, value and extensions. The accessor "getStarted" gives direct access to the value - */ - public DateTimeType getStartedElement() { - if (this.started == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.started"); - else if (Configuration.doAutoCreate()) - this.started = new DateTimeType(); // bb - return this.started; - } - - public boolean hasStartedElement() { - return this.started != null && !this.started.isEmpty(); - } - - public boolean hasStarted() { - return this.started != null && !this.started.isEmpty(); - } - - /** - * @param value {@link #started} (Date and Time the study started. Timezone Offset From UTC.). This is the underlying object with id, value and extensions. The accessor "getStarted" gives direct access to the value - */ - public ImagingStudy setStartedElement(DateTimeType value) { - this.started = value; - return this; - } - - /** - * @return Date and Time the study started. Timezone Offset From UTC. - */ - public Date getStarted() { - return this.started == null ? null : this.started.getValue(); - } - - /** - * @param value Date and Time the study started. Timezone Offset From UTC. - */ - public ImagingStudy setStarted(Date value) { - if (value == null) - this.started = null; - else { - if (this.started == null) - this.started = new DateTimeType(); - this.started.setValue(value); - } - return this; - } - - /** - * @return {@link #patient} (The patient imaged in the study.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The patient imaged in the study.) - */ - public ImagingStudy setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient imaged in the study.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient imaged in the study.) - */ - public ImagingStudy setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #uid} (Formal identifier for the study.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); // bb - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (Formal identifier for the study.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public ImagingStudy setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return Formal identifier for the study. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value Formal identifier for the study. - */ - public ImagingStudy setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #accession} (Accession Number.) - */ - public Identifier getAccession() { - if (this.accession == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.accession"); - else if (Configuration.doAutoCreate()) - this.accession = new Identifier(); // cc - return this.accession; - } - - public boolean hasAccession() { - return this.accession != null && !this.accession.isEmpty(); - } - - /** - * @param value {@link #accession} (Accession Number.) - */ - public ImagingStudy setAccession(Identifier value) { - this.accession = value; - return this; - } - - /** - * @return {@link #identifier} (Other identifiers for the study.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Other identifiers for the study.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public ImagingStudy addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #order} (A list of the diagnostic orders that resulted in this imaging study being performed.) - */ - public List getOrder() { - if (this.order == null) - this.order = new ArrayList(); - return this.order; - } - - public boolean hasOrder() { - if (this.order == null) - return false; - for (Reference item : this.order) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #order} (A list of the diagnostic orders that resulted in this imaging study being performed.) - */ - // syntactic sugar - public Reference addOrder() { //3 - Reference t = new Reference(); - if (this.order == null) - this.order = new ArrayList(); - this.order.add(t); - return t; - } - - // syntactic sugar - public ImagingStudy addOrder(Reference t) { //3 - if (t == null) - return this; - if (this.order == null) - this.order = new ArrayList(); - this.order.add(t); - return this; - } - - /** - * @return {@link #order} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A list of the diagnostic orders that resulted in this imaging study being performed.) - */ - public List getOrderTarget() { - if (this.orderTarget == null) - this.orderTarget = new ArrayList(); - return this.orderTarget; - } - - // syntactic sugar - /** - * @return {@link #order} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. A list of the diagnostic orders that resulted in this imaging study being performed.) - */ - public DiagnosticOrder addOrderTarget() { - DiagnosticOrder r = new DiagnosticOrder(); - if (this.orderTarget == null) - this.orderTarget = new ArrayList(); - this.orderTarget.add(r); - return r; - } - - /** - * @return {@link #modalityList} (A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).) - */ - public List> getModalityList() { - if (this.modalityList == null) - this.modalityList = new ArrayList>(); - return this.modalityList; - } - - public boolean hasModalityList() { - if (this.modalityList == null) - return false; - for (Enumeration item : this.modalityList) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #modalityList} (A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).) - */ - // syntactic sugar - public Enumeration addModalityListElement() {//2 - Enumeration t = new Enumeration(new ImagingModalityEnumFactory()); - if (this.modalityList == null) - this.modalityList = new ArrayList>(); - this.modalityList.add(t); - return t; - } - - /** - * @param value {@link #modalityList} (A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).) - */ - public ImagingStudy addModalityList(ImagingModality value) { //1 - Enumeration t = new Enumeration(new ImagingModalityEnumFactory()); - t.setValue(value); - if (this.modalityList == null) - this.modalityList = new ArrayList>(); - this.modalityList.add(t); - return this; - } - - /** - * @param value {@link #modalityList} (A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).) - */ - public boolean hasModalityList(ImagingModality value) { - if (this.modalityList == null) - return false; - for (Enumeration v : this.modalityList) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #referrer} (The requesting/referring physician.) - */ - public Reference getReferrer() { - if (this.referrer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.referrer"); - else if (Configuration.doAutoCreate()) - this.referrer = new Reference(); // cc - return this.referrer; - } - - public boolean hasReferrer() { - return this.referrer != null && !this.referrer.isEmpty(); - } - - /** - * @param value {@link #referrer} (The requesting/referring physician.) - */ - public ImagingStudy setReferrer(Reference value) { - this.referrer = value; - return this; - } - - /** - * @return {@link #referrer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The requesting/referring physician.) - */ - public Practitioner getReferrerTarget() { - if (this.referrerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.referrer"); - else if (Configuration.doAutoCreate()) - this.referrerTarget = new Practitioner(); // aa - return this.referrerTarget; - } - - /** - * @param value {@link #referrer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The requesting/referring physician.) - */ - public ImagingStudy setReferrerTarget(Practitioner value) { - this.referrerTarget = value; - return this; - } - - /** - * @return {@link #availability} (Availability of study (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value - */ - public Enumeration getAvailabilityElement() { - if (this.availability == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.availability"); - else if (Configuration.doAutoCreate()) - this.availability = new Enumeration(new InstanceAvailabilityEnumFactory()); // bb - return this.availability; - } - - public boolean hasAvailabilityElement() { - return this.availability != null && !this.availability.isEmpty(); - } - - public boolean hasAvailability() { - return this.availability != null && !this.availability.isEmpty(); - } - - /** - * @param value {@link #availability} (Availability of study (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value - */ - public ImagingStudy setAvailabilityElement(Enumeration value) { - this.availability = value; - return this; - } - - /** - * @return Availability of study (online, offline or nearline). - */ - public InstanceAvailability getAvailability() { - return this.availability == null ? null : this.availability.getValue(); - } - - /** - * @param value Availability of study (online, offline or nearline). - */ - public ImagingStudy setAvailability(InstanceAvailability value) { - if (value == null) - this.availability = null; - else { - if (this.availability == null) - this.availability = new Enumeration(new InstanceAvailabilityEnumFactory()); - this.availability.setValue(value); - } - return this; - } - - /** - * @return {@link #url} (WADO-RS resource where Study is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (WADO-RS resource where Study is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public ImagingStudy setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return WADO-RS resource where Study is available. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value WADO-RS resource where Study is available. - */ - public ImagingStudy setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #numberOfSeries} (Number of Series in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfSeries" gives direct access to the value - */ - public UnsignedIntType getNumberOfSeriesElement() { - if (this.numberOfSeries == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.numberOfSeries"); - else if (Configuration.doAutoCreate()) - this.numberOfSeries = new UnsignedIntType(); // bb - return this.numberOfSeries; - } - - public boolean hasNumberOfSeriesElement() { - return this.numberOfSeries != null && !this.numberOfSeries.isEmpty(); - } - - public boolean hasNumberOfSeries() { - return this.numberOfSeries != null && !this.numberOfSeries.isEmpty(); - } - - /** - * @param value {@link #numberOfSeries} (Number of Series in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfSeries" gives direct access to the value - */ - public ImagingStudy setNumberOfSeriesElement(UnsignedIntType value) { - this.numberOfSeries = value; - return this; - } - - /** - * @return Number of Series in Study. - */ - public int getNumberOfSeries() { - return this.numberOfSeries == null || this.numberOfSeries.isEmpty() ? 0 : this.numberOfSeries.getValue(); - } - - /** - * @param value Number of Series in Study. - */ - public ImagingStudy setNumberOfSeries(int value) { - if (this.numberOfSeries == null) - this.numberOfSeries = new UnsignedIntType(); - this.numberOfSeries.setValue(value); - return this; - } - - /** - * @return {@link #numberOfInstances} (Number of SOP Instances in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value - */ - public UnsignedIntType getNumberOfInstancesElement() { - if (this.numberOfInstances == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.numberOfInstances"); - else if (Configuration.doAutoCreate()) - this.numberOfInstances = new UnsignedIntType(); // bb - return this.numberOfInstances; - } - - public boolean hasNumberOfInstancesElement() { - return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); - } - - public boolean hasNumberOfInstances() { - return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); - } - - /** - * @param value {@link #numberOfInstances} (Number of SOP Instances in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value - */ - public ImagingStudy setNumberOfInstancesElement(UnsignedIntType value) { - this.numberOfInstances = value; - return this; - } - - /** - * @return Number of SOP Instances in Study. - */ - public int getNumberOfInstances() { - return this.numberOfInstances == null || this.numberOfInstances.isEmpty() ? 0 : this.numberOfInstances.getValue(); - } - - /** - * @param value Number of SOP Instances in Study. - */ - public ImagingStudy setNumberOfInstances(int value) { - if (this.numberOfInstances == null) - this.numberOfInstances = new UnsignedIntType(); - this.numberOfInstances.setValue(value); - return this; - } - - /** - * @return {@link #clinicalInformation} (Diagnoses etc provided with request.). This is the underlying object with id, value and extensions. The accessor "getClinicalInformation" gives direct access to the value - */ - public StringType getClinicalInformationElement() { - if (this.clinicalInformation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.clinicalInformation"); - else if (Configuration.doAutoCreate()) - this.clinicalInformation = new StringType(); // bb - return this.clinicalInformation; - } - - public boolean hasClinicalInformationElement() { - return this.clinicalInformation != null && !this.clinicalInformation.isEmpty(); - } - - public boolean hasClinicalInformation() { - return this.clinicalInformation != null && !this.clinicalInformation.isEmpty(); - } - - /** - * @param value {@link #clinicalInformation} (Diagnoses etc provided with request.). This is the underlying object with id, value and extensions. The accessor "getClinicalInformation" gives direct access to the value - */ - public ImagingStudy setClinicalInformationElement(StringType value) { - this.clinicalInformation = value; - return this; - } - - /** - * @return Diagnoses etc provided with request. - */ - public String getClinicalInformation() { - return this.clinicalInformation == null ? null : this.clinicalInformation.getValue(); - } - - /** - * @param value Diagnoses etc provided with request. - */ - public ImagingStudy setClinicalInformation(String value) { - if (Utilities.noString(value)) - this.clinicalInformation = null; - else { - if (this.clinicalInformation == null) - this.clinicalInformation = new StringType(); - this.clinicalInformation.setValue(value); - } - return this; - } - - /** - * @return {@link #procedure} (Type of procedure performed.) - */ - public List getProcedure() { - if (this.procedure == null) - this.procedure = new ArrayList(); - return this.procedure; - } - - public boolean hasProcedure() { - if (this.procedure == null) - return false; - for (Coding item : this.procedure) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #procedure} (Type of procedure performed.) - */ - // syntactic sugar - public Coding addProcedure() { //3 - Coding t = new Coding(); - if (this.procedure == null) - this.procedure = new ArrayList(); - this.procedure.add(t); - return t; - } - - // syntactic sugar - public ImagingStudy addProcedure(Coding t) { //3 - if (t == null) - return this; - if (this.procedure == null) - this.procedure = new ArrayList(); - this.procedure.add(t); - return this; - } - - /** - * @return {@link #interpreter} (Who read study and interpreted the images.) - */ - public Reference getInterpreter() { - if (this.interpreter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.interpreter"); - else if (Configuration.doAutoCreate()) - this.interpreter = new Reference(); // cc - return this.interpreter; - } - - public boolean hasInterpreter() { - return this.interpreter != null && !this.interpreter.isEmpty(); - } - - /** - * @param value {@link #interpreter} (Who read study and interpreted the images.) - */ - public ImagingStudy setInterpreter(Reference value) { - this.interpreter = value; - return this; - } - - /** - * @return {@link #interpreter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who read study and interpreted the images.) - */ - public Practitioner getInterpreterTarget() { - if (this.interpreterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.interpreter"); - else if (Configuration.doAutoCreate()) - this.interpreterTarget = new Practitioner(); // aa - return this.interpreterTarget; - } - - /** - * @param value {@link #interpreter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who read study and interpreted the images.) - */ - public ImagingStudy setInterpreterTarget(Practitioner value) { - this.interpreterTarget = value; - return this; - } - - /** - * @return {@link #description} (Institution-generated description or classification of the Study performed.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Institution-generated description or classification of the Study performed.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ImagingStudy setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Institution-generated description or classification of the Study performed. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Institution-generated description or classification of the Study performed. - */ - public ImagingStudy setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #series} (Each study has one or more series of image instances.) - */ - public List getSeries() { - if (this.series == null) - this.series = new ArrayList(); - return this.series; - } - - public boolean hasSeries() { - if (this.series == null) - return false; - for (ImagingStudySeriesComponent item : this.series) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #series} (Each study has one or more series of image instances.) - */ - // syntactic sugar - public ImagingStudySeriesComponent addSeries() { //3 - ImagingStudySeriesComponent t = new ImagingStudySeriesComponent(); - if (this.series == null) - this.series = new ArrayList(); - this.series.add(t); - return t; - } - - // syntactic sugar - public ImagingStudy addSeries(ImagingStudySeriesComponent t) { //3 - if (t == null) - return this; - if (this.series == null) - this.series = new ArrayList(); - this.series.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("started", "dateTime", "Date and Time the study started. Timezone Offset From UTC.", 0, java.lang.Integer.MAX_VALUE, started)); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient imaged in the study.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("uid", "oid", "Formal identifier for the study.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("accession", "Identifier", "Accession Number.", 0, java.lang.Integer.MAX_VALUE, accession)); - childrenList.add(new Property("identifier", "Identifier", "Other identifiers for the study.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("order", "Reference(DiagnosticOrder)", "A list of the diagnostic orders that resulted in this imaging study being performed.", 0, java.lang.Integer.MAX_VALUE, order)); - childrenList.add(new Property("modalityList", "code", "A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).", 0, java.lang.Integer.MAX_VALUE, modalityList)); - childrenList.add(new Property("referrer", "Reference(Practitioner)", "The requesting/referring physician.", 0, java.lang.Integer.MAX_VALUE, referrer)); - childrenList.add(new Property("availability", "code", "Availability of study (online, offline or nearline).", 0, java.lang.Integer.MAX_VALUE, availability)); - childrenList.add(new Property("url", "uri", "WADO-RS resource where Study is available.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("numberOfSeries", "unsignedInt", "Number of Series in Study.", 0, java.lang.Integer.MAX_VALUE, numberOfSeries)); - childrenList.add(new Property("numberOfInstances", "unsignedInt", "Number of SOP Instances in Study.", 0, java.lang.Integer.MAX_VALUE, numberOfInstances)); - childrenList.add(new Property("clinicalInformation", "string", "Diagnoses etc provided with request.", 0, java.lang.Integer.MAX_VALUE, clinicalInformation)); - childrenList.add(new Property("procedure", "Coding", "Type of procedure performed.", 0, java.lang.Integer.MAX_VALUE, procedure)); - childrenList.add(new Property("interpreter", "Reference(Practitioner)", "Who read study and interpreted the images.", 0, java.lang.Integer.MAX_VALUE, interpreter)); - childrenList.add(new Property("description", "string", "Institution-generated description or classification of the Study performed.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("series", "", "Each study has one or more series of image instances.", 0, java.lang.Integer.MAX_VALUE, series)); - } - - public ImagingStudy copy() { - ImagingStudy dst = new ImagingStudy(); - copyValues(dst); - dst.started = started == null ? null : started.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.uid = uid == null ? null : uid.copy(); - dst.accession = accession == null ? null : accession.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - if (order != null) { - dst.order = new ArrayList(); - for (Reference i : order) - dst.order.add(i.copy()); - }; - if (modalityList != null) { - dst.modalityList = new ArrayList>(); - for (Enumeration i : modalityList) - dst.modalityList.add(i.copy()); - }; - dst.referrer = referrer == null ? null : referrer.copy(); - dst.availability = availability == null ? null : availability.copy(); - dst.url = url == null ? null : url.copy(); - dst.numberOfSeries = numberOfSeries == null ? null : numberOfSeries.copy(); - dst.numberOfInstances = numberOfInstances == null ? null : numberOfInstances.copy(); - dst.clinicalInformation = clinicalInformation == null ? null : clinicalInformation.copy(); - if (procedure != null) { - dst.procedure = new ArrayList(); - for (Coding i : procedure) - dst.procedure.add(i.copy()); - }; - dst.interpreter = interpreter == null ? null : interpreter.copy(); - dst.description = description == null ? null : description.copy(); - if (series != null) { - dst.series = new ArrayList(); - for (ImagingStudySeriesComponent i : series) - dst.series.add(i.copy()); - }; - return dst; - } - - protected ImagingStudy typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImagingStudy)) - return false; - ImagingStudy o = (ImagingStudy) other; - return compareDeep(started, o.started, true) && compareDeep(patient, o.patient, true) && compareDeep(uid, o.uid, true) - && compareDeep(accession, o.accession, true) && compareDeep(identifier, o.identifier, true) && compareDeep(order, o.order, true) - && compareDeep(modalityList, o.modalityList, true) && compareDeep(referrer, o.referrer, true) && compareDeep(availability, o.availability, true) - && compareDeep(url, o.url, true) && compareDeep(numberOfSeries, o.numberOfSeries, true) && compareDeep(numberOfInstances, o.numberOfInstances, true) - && compareDeep(clinicalInformation, o.clinicalInformation, true) && compareDeep(procedure, o.procedure, true) - && compareDeep(interpreter, o.interpreter, true) && compareDeep(description, o.description, true) - && compareDeep(series, o.series, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImagingStudy)) - return false; - ImagingStudy o = (ImagingStudy) other; - return compareValues(started, o.started, true) && compareValues(uid, o.uid, true) && compareValues(modalityList, o.modalityList, true) - && compareValues(availability, o.availability, true) && compareValues(url, o.url, true) && compareValues(numberOfSeries, o.numberOfSeries, true) - && compareValues(numberOfInstances, o.numberOfInstances, true) && compareValues(clinicalInformation, o.clinicalInformation, true) - && compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (started == null || started.isEmpty()) && (patient == null || patient.isEmpty()) - && (uid == null || uid.isEmpty()) && (accession == null || accession.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (order == null || order.isEmpty()) && (modalityList == null || modalityList.isEmpty()) - && (referrer == null || referrer.isEmpty()) && (availability == null || availability.isEmpty()) - && (url == null || url.isEmpty()) && (numberOfSeries == null || numberOfSeries.isEmpty()) - && (numberOfInstances == null || numberOfInstances.isEmpty()) && (clinicalInformation == null || clinicalInformation.isEmpty()) - && (procedure == null || procedure.isEmpty()) && (interpreter == null || interpreter.isEmpty()) - && (description == null || description.isEmpty()) && (series == null || series.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ImagingStudy; - } - - @SearchParamDefinition(name="uid", path="ImagingStudy.series.instance.uid", description="Formal identifier for this instance (0008,0018)", type="token" ) - public static final String SP_UID = "uid"; - @SearchParamDefinition(name="series", path="ImagingStudy.series.uid", description="The series id for the image", type="token" ) - public static final String SP_SERIES = "series"; - @SearchParamDefinition(name="patient", path="ImagingStudy.patient", description="Who the study is about", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="order", path="ImagingStudy.order", description="The order for the image", type="reference" ) - public static final String SP_ORDER = "order"; - @SearchParamDefinition(name="bodysite", path="ImagingStudy.series.bodySite", description="Body part examined (Map from 0018,0015)", type="token" ) - public static final String SP_BODYSITE = "bodysite"; - @SearchParamDefinition(name="accession", path="ImagingStudy.accession", description="The accession id for the image", type="token" ) - public static final String SP_ACCESSION = "accession"; - @SearchParamDefinition(name="study", path="ImagingStudy.uid", description="The study id for the image", type="token" ) - public static final String SP_STUDY = "study"; - @SearchParamDefinition(name="modality", path="ImagingStudy.series.modality", description="The modality of the image", type="token" ) - public static final String SP_MODALITY = "modality"; - @SearchParamDefinition(name="started", path="ImagingStudy.started", description="When the study was started", type="date" ) - public static final String SP_STARTED = "started"; - @SearchParamDefinition(name="dicom-class", path="ImagingStudy.series.instance.sopclass", description="DICOM class type (0008,0016)", type="token" ) - public static final String SP_DICOMCLASS = "dicom-class"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Representation of the content produced in a DICOM imaging study. A study comprises a set of Series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A Series is of only one modality (e.g., X-ray, CT, MR, ultrasound), but a Study may have multiple Series of different modalities. + */ +@ResourceDef(name="ImagingStudy", profile="http://hl7.org/fhir/Profile/ImagingStudy") +public class ImagingStudy extends DomainResource { + + public enum ImagingModality { + /** + * + */ + AR, + /** + * + */ + BMD, + /** + * + */ + BDUS, + /** + * + */ + EPS, + /** + * + */ + CR, + /** + * + */ + CT, + /** + * + */ + DX, + /** + * + */ + ECG, + /** + * + */ + ES, + /** + * + */ + XC, + /** + * + */ + GM, + /** + * + */ + HD, + /** + * + */ + IO, + /** + * + */ + IVOCT, + /** + * + */ + IVUS, + /** + * + */ + KER, + /** + * + */ + LEN, + /** + * + */ + MR, + /** + * + */ + MG, + /** + * + */ + NM, + /** + * + */ + OAM, + /** + * + */ + OCT, + /** + * + */ + OPM, + /** + * + */ + OP, + /** + * + */ + OPR, + /** + * + */ + OPT, + /** + * + */ + OPV, + /** + * + */ + PX, + /** + * + */ + PT, + /** + * + */ + RF, + /** + * + */ + RG, + /** + * + */ + SM, + /** + * + */ + SRF, + /** + * + */ + US, + /** + * + */ + VA, + /** + * + */ + XA, + /** + * added to help the parsers + */ + NULL; + public static ImagingModality fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("AR".equals(codeString)) + return AR; + if ("BMD".equals(codeString)) + return BMD; + if ("BDUS".equals(codeString)) + return BDUS; + if ("EPS".equals(codeString)) + return EPS; + if ("CR".equals(codeString)) + return CR; + if ("CT".equals(codeString)) + return CT; + if ("DX".equals(codeString)) + return DX; + if ("ECG".equals(codeString)) + return ECG; + if ("ES".equals(codeString)) + return ES; + if ("XC".equals(codeString)) + return XC; + if ("GM".equals(codeString)) + return GM; + if ("HD".equals(codeString)) + return HD; + if ("IO".equals(codeString)) + return IO; + if ("IVOCT".equals(codeString)) + return IVOCT; + if ("IVUS".equals(codeString)) + return IVUS; + if ("KER".equals(codeString)) + return KER; + if ("LEN".equals(codeString)) + return LEN; + if ("MR".equals(codeString)) + return MR; + if ("MG".equals(codeString)) + return MG; + if ("NM".equals(codeString)) + return NM; + if ("OAM".equals(codeString)) + return OAM; + if ("OCT".equals(codeString)) + return OCT; + if ("OPM".equals(codeString)) + return OPM; + if ("OP".equals(codeString)) + return OP; + if ("OPR".equals(codeString)) + return OPR; + if ("OPT".equals(codeString)) + return OPT; + if ("OPV".equals(codeString)) + return OPV; + if ("PX".equals(codeString)) + return PX; + if ("PT".equals(codeString)) + return PT; + if ("RF".equals(codeString)) + return RF; + if ("RG".equals(codeString)) + return RG; + if ("SM".equals(codeString)) + return SM; + if ("SRF".equals(codeString)) + return SRF; + if ("US".equals(codeString)) + return US; + if ("VA".equals(codeString)) + return VA; + if ("XA".equals(codeString)) + return XA; + throw new Exception("Unknown ImagingModality code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case AR: return "AR"; + case BMD: return "BMD"; + case BDUS: return "BDUS"; + case EPS: return "EPS"; + case CR: return "CR"; + case CT: return "CT"; + case DX: return "DX"; + case ECG: return "ECG"; + case ES: return "ES"; + case XC: return "XC"; + case GM: return "GM"; + case HD: return "HD"; + case IO: return "IO"; + case IVOCT: return "IVOCT"; + case IVUS: return "IVUS"; + case KER: return "KER"; + case LEN: return "LEN"; + case MR: return "MR"; + case MG: return "MG"; + case NM: return "NM"; + case OAM: return "OAM"; + case OCT: return "OCT"; + case OPM: return "OPM"; + case OP: return "OP"; + case OPR: return "OPR"; + case OPT: return "OPT"; + case OPV: return "OPV"; + case PX: return "PX"; + case PT: return "PT"; + case RF: return "RF"; + case RG: return "RG"; + case SM: return "SM"; + case SRF: return "SRF"; + case US: return "US"; + case VA: return "VA"; + case XA: return "XA"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case AR: return "http://nema.org/dicom/dicm"; + case BMD: return "http://nema.org/dicom/dicm"; + case BDUS: return "http://nema.org/dicom/dicm"; + case EPS: return "http://nema.org/dicom/dicm"; + case CR: return "http://nema.org/dicom/dicm"; + case CT: return "http://nema.org/dicom/dicm"; + case DX: return "http://nema.org/dicom/dicm"; + case ECG: return "http://nema.org/dicom/dicm"; + case ES: return "http://nema.org/dicom/dicm"; + case XC: return "http://nema.org/dicom/dicm"; + case GM: return "http://nema.org/dicom/dicm"; + case HD: return "http://nema.org/dicom/dicm"; + case IO: return "http://nema.org/dicom/dicm"; + case IVOCT: return "http://nema.org/dicom/dicm"; + case IVUS: return "http://nema.org/dicom/dicm"; + case KER: return "http://nema.org/dicom/dicm"; + case LEN: return "http://nema.org/dicom/dicm"; + case MR: return "http://nema.org/dicom/dicm"; + case MG: return "http://nema.org/dicom/dicm"; + case NM: return "http://nema.org/dicom/dicm"; + case OAM: return "http://nema.org/dicom/dicm"; + case OCT: return "http://nema.org/dicom/dicm"; + case OPM: return "http://nema.org/dicom/dicm"; + case OP: return "http://nema.org/dicom/dicm"; + case OPR: return "http://nema.org/dicom/dicm"; + case OPT: return "http://nema.org/dicom/dicm"; + case OPV: return "http://nema.org/dicom/dicm"; + case PX: return "http://nema.org/dicom/dicm"; + case PT: return "http://nema.org/dicom/dicm"; + case RF: return "http://nema.org/dicom/dicm"; + case RG: return "http://nema.org/dicom/dicm"; + case SM: return "http://nema.org/dicom/dicm"; + case SRF: return "http://nema.org/dicom/dicm"; + case US: return "http://nema.org/dicom/dicm"; + case VA: return "http://nema.org/dicom/dicm"; + case XA: return "http://nema.org/dicom/dicm"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case AR: return ""; + case BMD: return ""; + case BDUS: return ""; + case EPS: return ""; + case CR: return ""; + case CT: return ""; + case DX: return ""; + case ECG: return ""; + case ES: return ""; + case XC: return ""; + case GM: return ""; + case HD: return ""; + case IO: return ""; + case IVOCT: return ""; + case IVUS: return ""; + case KER: return ""; + case LEN: return ""; + case MR: return ""; + case MG: return ""; + case NM: return ""; + case OAM: return ""; + case OCT: return ""; + case OPM: return ""; + case OP: return ""; + case OPR: return ""; + case OPT: return ""; + case OPV: return ""; + case PX: return ""; + case PT: return ""; + case RF: return ""; + case RG: return ""; + case SM: return ""; + case SRF: return ""; + case US: return ""; + case VA: return ""; + case XA: return ""; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case AR: return "A R"; + case BMD: return "B M D"; + case BDUS: return "B D U S"; + case EPS: return "E P S"; + case CR: return "C R"; + case CT: return "C T"; + case DX: return "D X"; + case ECG: return "E C G"; + case ES: return "E S"; + case XC: return "X C"; + case GM: return "G M"; + case HD: return "H D"; + case IO: return "I O"; + case IVOCT: return "I V O C T"; + case IVUS: return "I V U S"; + case KER: return "K E R"; + case LEN: return "L E N"; + case MR: return "M R"; + case MG: return "M G"; + case NM: return "N M"; + case OAM: return "O A M"; + case OCT: return "O C T"; + case OPM: return "O P M"; + case OP: return "O P"; + case OPR: return "O P R"; + case OPT: return "O P T"; + case OPV: return "O P V"; + case PX: return "P X"; + case PT: return "P T"; + case RF: return "R F"; + case RG: return "R G"; + case SM: return "S M"; + case SRF: return "S R F"; + case US: return "U S"; + case VA: return "V A"; + case XA: return "X A"; + default: return "?"; + } + } + } + + public static class ImagingModalityEnumFactory implements EnumFactory { + public ImagingModality fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("AR".equals(codeString)) + return ImagingModality.AR; + if ("BMD".equals(codeString)) + return ImagingModality.BMD; + if ("BDUS".equals(codeString)) + return ImagingModality.BDUS; + if ("EPS".equals(codeString)) + return ImagingModality.EPS; + if ("CR".equals(codeString)) + return ImagingModality.CR; + if ("CT".equals(codeString)) + return ImagingModality.CT; + if ("DX".equals(codeString)) + return ImagingModality.DX; + if ("ECG".equals(codeString)) + return ImagingModality.ECG; + if ("ES".equals(codeString)) + return ImagingModality.ES; + if ("XC".equals(codeString)) + return ImagingModality.XC; + if ("GM".equals(codeString)) + return ImagingModality.GM; + if ("HD".equals(codeString)) + return ImagingModality.HD; + if ("IO".equals(codeString)) + return ImagingModality.IO; + if ("IVOCT".equals(codeString)) + return ImagingModality.IVOCT; + if ("IVUS".equals(codeString)) + return ImagingModality.IVUS; + if ("KER".equals(codeString)) + return ImagingModality.KER; + if ("LEN".equals(codeString)) + return ImagingModality.LEN; + if ("MR".equals(codeString)) + return ImagingModality.MR; + if ("MG".equals(codeString)) + return ImagingModality.MG; + if ("NM".equals(codeString)) + return ImagingModality.NM; + if ("OAM".equals(codeString)) + return ImagingModality.OAM; + if ("OCT".equals(codeString)) + return ImagingModality.OCT; + if ("OPM".equals(codeString)) + return ImagingModality.OPM; + if ("OP".equals(codeString)) + return ImagingModality.OP; + if ("OPR".equals(codeString)) + return ImagingModality.OPR; + if ("OPT".equals(codeString)) + return ImagingModality.OPT; + if ("OPV".equals(codeString)) + return ImagingModality.OPV; + if ("PX".equals(codeString)) + return ImagingModality.PX; + if ("PT".equals(codeString)) + return ImagingModality.PT; + if ("RF".equals(codeString)) + return ImagingModality.RF; + if ("RG".equals(codeString)) + return ImagingModality.RG; + if ("SM".equals(codeString)) + return ImagingModality.SM; + if ("SRF".equals(codeString)) + return ImagingModality.SRF; + if ("US".equals(codeString)) + return ImagingModality.US; + if ("VA".equals(codeString)) + return ImagingModality.VA; + if ("XA".equals(codeString)) + return ImagingModality.XA; + throw new IllegalArgumentException("Unknown ImagingModality code '"+codeString+"'"); + } + public String toCode(ImagingModality code) { + if (code == ImagingModality.AR) + return "AR"; + if (code == ImagingModality.BMD) + return "BMD"; + if (code == ImagingModality.BDUS) + return "BDUS"; + if (code == ImagingModality.EPS) + return "EPS"; + if (code == ImagingModality.CR) + return "CR"; + if (code == ImagingModality.CT) + return "CT"; + if (code == ImagingModality.DX) + return "DX"; + if (code == ImagingModality.ECG) + return "ECG"; + if (code == ImagingModality.ES) + return "ES"; + if (code == ImagingModality.XC) + return "XC"; + if (code == ImagingModality.GM) + return "GM"; + if (code == ImagingModality.HD) + return "HD"; + if (code == ImagingModality.IO) + return "IO"; + if (code == ImagingModality.IVOCT) + return "IVOCT"; + if (code == ImagingModality.IVUS) + return "IVUS"; + if (code == ImagingModality.KER) + return "KER"; + if (code == ImagingModality.LEN) + return "LEN"; + if (code == ImagingModality.MR) + return "MR"; + if (code == ImagingModality.MG) + return "MG"; + if (code == ImagingModality.NM) + return "NM"; + if (code == ImagingModality.OAM) + return "OAM"; + if (code == ImagingModality.OCT) + return "OCT"; + if (code == ImagingModality.OPM) + return "OPM"; + if (code == ImagingModality.OP) + return "OP"; + if (code == ImagingModality.OPR) + return "OPR"; + if (code == ImagingModality.OPT) + return "OPT"; + if (code == ImagingModality.OPV) + return "OPV"; + if (code == ImagingModality.PX) + return "PX"; + if (code == ImagingModality.PT) + return "PT"; + if (code == ImagingModality.RF) + return "RF"; + if (code == ImagingModality.RG) + return "RG"; + if (code == ImagingModality.SM) + return "SM"; + if (code == ImagingModality.SRF) + return "SRF"; + if (code == ImagingModality.US) + return "US"; + if (code == ImagingModality.VA) + return "VA"; + if (code == ImagingModality.XA) + return "XA"; + return "?"; + } + } + + public enum InstanceAvailability { + /** + * Resources are immediately available,. + */ + ONLINE, + /** + * Resources need to be retrieved by manual intervention. + */ + OFFLINE, + /** + * Resources need to be retrieved from relatively slow media. + */ + NEARLINE, + /** + * Resources cannot be retrieved. + */ + UNAVAILABLE, + /** + * added to help the parsers + */ + NULL; + public static InstanceAvailability fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("ONLINE".equals(codeString)) + return ONLINE; + if ("OFFLINE".equals(codeString)) + return OFFLINE; + if ("NEARLINE".equals(codeString)) + return NEARLINE; + if ("UNAVAILABLE".equals(codeString)) + return UNAVAILABLE; + throw new Exception("Unknown InstanceAvailability code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ONLINE: return "ONLINE"; + case OFFLINE: return "OFFLINE"; + case NEARLINE: return "NEARLINE"; + case UNAVAILABLE: return "UNAVAILABLE"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ONLINE: return "http://nema.org/dicom/dicm"; + case OFFLINE: return "http://nema.org/dicom/dicm"; + case NEARLINE: return "http://nema.org/dicom/dicm"; + case UNAVAILABLE: return "http://nema.org/dicom/dicm"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ONLINE: return "Resources are immediately available,."; + case OFFLINE: return "Resources need to be retrieved by manual intervention."; + case NEARLINE: return "Resources need to be retrieved from relatively slow media."; + case UNAVAILABLE: return "Resources cannot be retrieved."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ONLINE: return "O N L I N E"; + case OFFLINE: return "O F F L I N E"; + case NEARLINE: return "N E A R L I N E"; + case UNAVAILABLE: return "U N A V A I L A B L E"; + default: return "?"; + } + } + } + + public static class InstanceAvailabilityEnumFactory implements EnumFactory { + public InstanceAvailability fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("ONLINE".equals(codeString)) + return InstanceAvailability.ONLINE; + if ("OFFLINE".equals(codeString)) + return InstanceAvailability.OFFLINE; + if ("NEARLINE".equals(codeString)) + return InstanceAvailability.NEARLINE; + if ("UNAVAILABLE".equals(codeString)) + return InstanceAvailability.UNAVAILABLE; + throw new IllegalArgumentException("Unknown InstanceAvailability code '"+codeString+"'"); + } + public String toCode(InstanceAvailability code) { + if (code == InstanceAvailability.ONLINE) + return "ONLINE"; + if (code == InstanceAvailability.OFFLINE) + return "OFFLINE"; + if (code == InstanceAvailability.NEARLINE) + return "NEARLINE"; + if (code == InstanceAvailability.UNAVAILABLE) + return "UNAVAILABLE"; + return "?"; + } + } + + public enum Modality { + /** + * + */ + AR, + /** + * + */ + AU, + /** + * + */ + BDUS, + /** + * + */ + BI, + /** + * + */ + BMD, + /** + * + */ + CR, + /** + * + */ + CT, + /** + * + */ + DG, + /** + * + */ + DX, + /** + * + */ + ECG, + /** + * + */ + EPS, + /** + * + */ + ES, + /** + * + */ + GM, + /** + * + */ + HC, + /** + * + */ + HD, + /** + * + */ + IO, + /** + * + */ + IVOCT, + /** + * + */ + IVUS, + /** + * + */ + KER, + /** + * + */ + KO, + /** + * + */ + LEN, + /** + * + */ + LS, + /** + * + */ + MG, + /** + * + */ + MR, + /** + * + */ + NM, + /** + * + */ + OAM, + /** + * + */ + OCT, + /** + * + */ + OP, + /** + * + */ + OPM, + /** + * + */ + OPT, + /** + * + */ + OPV, + /** + * + */ + OT, + /** + * + */ + PR, + /** + * + */ + PT, + /** + * + */ + PX, + /** + * + */ + REG, + /** + * + */ + RF, + /** + * + */ + RG, + /** + * + */ + RTDOSE, + /** + * + */ + RTIMAGE, + /** + * + */ + RTPLAN, + /** + * + */ + RTRECORD, + /** + * + */ + RTSTRUCT, + /** + * + */ + SEG, + /** + * + */ + SM, + /** + * + */ + SMR, + /** + * + */ + SR, + /** + * + */ + SRF, + /** + * + */ + TG, + /** + * + */ + US, + /** + * + */ + VA, + /** + * + */ + XA, + /** + * + */ + XC, + /** + * added to help the parsers + */ + NULL; + public static Modality fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("AR".equals(codeString)) + return AR; + if ("AU".equals(codeString)) + return AU; + if ("BDUS".equals(codeString)) + return BDUS; + if ("BI".equals(codeString)) + return BI; + if ("BMD".equals(codeString)) + return BMD; + if ("CR".equals(codeString)) + return CR; + if ("CT".equals(codeString)) + return CT; + if ("DG".equals(codeString)) + return DG; + if ("DX".equals(codeString)) + return DX; + if ("ECG".equals(codeString)) + return ECG; + if ("EPS".equals(codeString)) + return EPS; + if ("ES".equals(codeString)) + return ES; + if ("GM".equals(codeString)) + return GM; + if ("HC".equals(codeString)) + return HC; + if ("HD".equals(codeString)) + return HD; + if ("IO".equals(codeString)) + return IO; + if ("IVOCT".equals(codeString)) + return IVOCT; + if ("IVUS".equals(codeString)) + return IVUS; + if ("KER".equals(codeString)) + return KER; + if ("KO".equals(codeString)) + return KO; + if ("LEN".equals(codeString)) + return LEN; + if ("LS".equals(codeString)) + return LS; + if ("MG".equals(codeString)) + return MG; + if ("MR".equals(codeString)) + return MR; + if ("NM".equals(codeString)) + return NM; + if ("OAM".equals(codeString)) + return OAM; + if ("OCT".equals(codeString)) + return OCT; + if ("OP".equals(codeString)) + return OP; + if ("OPM".equals(codeString)) + return OPM; + if ("OPT".equals(codeString)) + return OPT; + if ("OPV".equals(codeString)) + return OPV; + if ("OT".equals(codeString)) + return OT; + if ("PR".equals(codeString)) + return PR; + if ("PT".equals(codeString)) + return PT; + if ("PX".equals(codeString)) + return PX; + if ("REG".equals(codeString)) + return REG; + if ("RF".equals(codeString)) + return RF; + if ("RG".equals(codeString)) + return RG; + if ("RTDOSE".equals(codeString)) + return RTDOSE; + if ("RTIMAGE".equals(codeString)) + return RTIMAGE; + if ("RTPLAN".equals(codeString)) + return RTPLAN; + if ("RTRECORD".equals(codeString)) + return RTRECORD; + if ("RTSTRUCT".equals(codeString)) + return RTSTRUCT; + if ("SEG".equals(codeString)) + return SEG; + if ("SM".equals(codeString)) + return SM; + if ("SMR".equals(codeString)) + return SMR; + if ("SR".equals(codeString)) + return SR; + if ("SRF".equals(codeString)) + return SRF; + if ("TG".equals(codeString)) + return TG; + if ("US".equals(codeString)) + return US; + if ("VA".equals(codeString)) + return VA; + if ("XA".equals(codeString)) + return XA; + if ("XC".equals(codeString)) + return XC; + throw new Exception("Unknown Modality code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case AR: return "AR"; + case AU: return "AU"; + case BDUS: return "BDUS"; + case BI: return "BI"; + case BMD: return "BMD"; + case CR: return "CR"; + case CT: return "CT"; + case DG: return "DG"; + case DX: return "DX"; + case ECG: return "ECG"; + case EPS: return "EPS"; + case ES: return "ES"; + case GM: return "GM"; + case HC: return "HC"; + case HD: return "HD"; + case IO: return "IO"; + case IVOCT: return "IVOCT"; + case IVUS: return "IVUS"; + case KER: return "KER"; + case KO: return "KO"; + case LEN: return "LEN"; + case LS: return "LS"; + case MG: return "MG"; + case MR: return "MR"; + case NM: return "NM"; + case OAM: return "OAM"; + case OCT: return "OCT"; + case OP: return "OP"; + case OPM: return "OPM"; + case OPT: return "OPT"; + case OPV: return "OPV"; + case OT: return "OT"; + case PR: return "PR"; + case PT: return "PT"; + case PX: return "PX"; + case REG: return "REG"; + case RF: return "RF"; + case RG: return "RG"; + case RTDOSE: return "RTDOSE"; + case RTIMAGE: return "RTIMAGE"; + case RTPLAN: return "RTPLAN"; + case RTRECORD: return "RTRECORD"; + case RTSTRUCT: return "RTSTRUCT"; + case SEG: return "SEG"; + case SM: return "SM"; + case SMR: return "SMR"; + case SR: return "SR"; + case SRF: return "SRF"; + case TG: return "TG"; + case US: return "US"; + case VA: return "VA"; + case XA: return "XA"; + case XC: return "XC"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case AR: return "http://nema.org/dicom/dicm"; + case AU: return "http://nema.org/dicom/dicm"; + case BDUS: return "http://nema.org/dicom/dicm"; + case BI: return "http://nema.org/dicom/dicm"; + case BMD: return "http://nema.org/dicom/dicm"; + case CR: return "http://nema.org/dicom/dicm"; + case CT: return "http://nema.org/dicom/dicm"; + case DG: return "http://nema.org/dicom/dicm"; + case DX: return "http://nema.org/dicom/dicm"; + case ECG: return "http://nema.org/dicom/dicm"; + case EPS: return "http://nema.org/dicom/dicm"; + case ES: return "http://nema.org/dicom/dicm"; + case GM: return "http://nema.org/dicom/dicm"; + case HC: return "http://nema.org/dicom/dicm"; + case HD: return "http://nema.org/dicom/dicm"; + case IO: return "http://nema.org/dicom/dicm"; + case IVOCT: return "http://nema.org/dicom/dicm"; + case IVUS: return "http://nema.org/dicom/dicm"; + case KER: return "http://nema.org/dicom/dicm"; + case KO: return "http://nema.org/dicom/dicm"; + case LEN: return "http://nema.org/dicom/dicm"; + case LS: return "http://nema.org/dicom/dicm"; + case MG: return "http://nema.org/dicom/dicm"; + case MR: return "http://nema.org/dicom/dicm"; + case NM: return "http://nema.org/dicom/dicm"; + case OAM: return "http://nema.org/dicom/dicm"; + case OCT: return "http://nema.org/dicom/dicm"; + case OP: return "http://nema.org/dicom/dicm"; + case OPM: return "http://nema.org/dicom/dicm"; + case OPT: return "http://nema.org/dicom/dicm"; + case OPV: return "http://nema.org/dicom/dicm"; + case OT: return "http://nema.org/dicom/dicm"; + case PR: return "http://nema.org/dicom/dicm"; + case PT: return "http://nema.org/dicom/dicm"; + case PX: return "http://nema.org/dicom/dicm"; + case REG: return "http://nema.org/dicom/dicm"; + case RF: return "http://nema.org/dicom/dicm"; + case RG: return "http://nema.org/dicom/dicm"; + case RTDOSE: return "http://nema.org/dicom/dicm"; + case RTIMAGE: return "http://nema.org/dicom/dicm"; + case RTPLAN: return "http://nema.org/dicom/dicm"; + case RTRECORD: return "http://nema.org/dicom/dicm"; + case RTSTRUCT: return "http://nema.org/dicom/dicm"; + case SEG: return "http://nema.org/dicom/dicm"; + case SM: return "http://nema.org/dicom/dicm"; + case SMR: return "http://nema.org/dicom/dicm"; + case SR: return "http://nema.org/dicom/dicm"; + case SRF: return "http://nema.org/dicom/dicm"; + case TG: return "http://nema.org/dicom/dicm"; + case US: return "http://nema.org/dicom/dicm"; + case VA: return "http://nema.org/dicom/dicm"; + case XA: return "http://nema.org/dicom/dicm"; + case XC: return "http://nema.org/dicom/dicm"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case AR: return ""; + case AU: return ""; + case BDUS: return ""; + case BI: return ""; + case BMD: return ""; + case CR: return ""; + case CT: return ""; + case DG: return ""; + case DX: return ""; + case ECG: return ""; + case EPS: return ""; + case ES: return ""; + case GM: return ""; + case HC: return ""; + case HD: return ""; + case IO: return ""; + case IVOCT: return ""; + case IVUS: return ""; + case KER: return ""; + case KO: return ""; + case LEN: return ""; + case LS: return ""; + case MG: return ""; + case MR: return ""; + case NM: return ""; + case OAM: return ""; + case OCT: return ""; + case OP: return ""; + case OPM: return ""; + case OPT: return ""; + case OPV: return ""; + case OT: return ""; + case PR: return ""; + case PT: return ""; + case PX: return ""; + case REG: return ""; + case RF: return ""; + case RG: return ""; + case RTDOSE: return ""; + case RTIMAGE: return ""; + case RTPLAN: return ""; + case RTRECORD: return ""; + case RTSTRUCT: return ""; + case SEG: return ""; + case SM: return ""; + case SMR: return ""; + case SR: return ""; + case SRF: return ""; + case TG: return ""; + case US: return ""; + case VA: return ""; + case XA: return ""; + case XC: return ""; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case AR: return "A R"; + case AU: return "A U"; + case BDUS: return "B D U S"; + case BI: return "B I"; + case BMD: return "B M D"; + case CR: return "C R"; + case CT: return "C T"; + case DG: return "D G"; + case DX: return "D X"; + case ECG: return "E C G"; + case EPS: return "E P S"; + case ES: return "E S"; + case GM: return "G M"; + case HC: return "H C"; + case HD: return "H D"; + case IO: return "I O"; + case IVOCT: return "I V O C T"; + case IVUS: return "I V U S"; + case KER: return "K E R"; + case KO: return "K O"; + case LEN: return "L E N"; + case LS: return "L S"; + case MG: return "M G"; + case MR: return "M R"; + case NM: return "N M"; + case OAM: return "O A M"; + case OCT: return "O C T"; + case OP: return "O P"; + case OPM: return "O P M"; + case OPT: return "O P T"; + case OPV: return "O P V"; + case OT: return "O T"; + case PR: return "P R"; + case PT: return "P T"; + case PX: return "P X"; + case REG: return "R E G"; + case RF: return "R F"; + case RG: return "R G"; + case RTDOSE: return "R T D O S E"; + case RTIMAGE: return "R T I M A G E"; + case RTPLAN: return "R T P L A N"; + case RTRECORD: return "R T R E C O R D"; + case RTSTRUCT: return "R T S T R U C T"; + case SEG: return "S E G"; + case SM: return "S M"; + case SMR: return "S M R"; + case SR: return "S R"; + case SRF: return "S R F"; + case TG: return "T G"; + case US: return "U S"; + case VA: return "V A"; + case XA: return "X A"; + case XC: return "X C"; + default: return "?"; + } + } + } + + public static class ModalityEnumFactory implements EnumFactory { + public Modality fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("AR".equals(codeString)) + return Modality.AR; + if ("AU".equals(codeString)) + return Modality.AU; + if ("BDUS".equals(codeString)) + return Modality.BDUS; + if ("BI".equals(codeString)) + return Modality.BI; + if ("BMD".equals(codeString)) + return Modality.BMD; + if ("CR".equals(codeString)) + return Modality.CR; + if ("CT".equals(codeString)) + return Modality.CT; + if ("DG".equals(codeString)) + return Modality.DG; + if ("DX".equals(codeString)) + return Modality.DX; + if ("ECG".equals(codeString)) + return Modality.ECG; + if ("EPS".equals(codeString)) + return Modality.EPS; + if ("ES".equals(codeString)) + return Modality.ES; + if ("GM".equals(codeString)) + return Modality.GM; + if ("HC".equals(codeString)) + return Modality.HC; + if ("HD".equals(codeString)) + return Modality.HD; + if ("IO".equals(codeString)) + return Modality.IO; + if ("IVOCT".equals(codeString)) + return Modality.IVOCT; + if ("IVUS".equals(codeString)) + return Modality.IVUS; + if ("KER".equals(codeString)) + return Modality.KER; + if ("KO".equals(codeString)) + return Modality.KO; + if ("LEN".equals(codeString)) + return Modality.LEN; + if ("LS".equals(codeString)) + return Modality.LS; + if ("MG".equals(codeString)) + return Modality.MG; + if ("MR".equals(codeString)) + return Modality.MR; + if ("NM".equals(codeString)) + return Modality.NM; + if ("OAM".equals(codeString)) + return Modality.OAM; + if ("OCT".equals(codeString)) + return Modality.OCT; + if ("OP".equals(codeString)) + return Modality.OP; + if ("OPM".equals(codeString)) + return Modality.OPM; + if ("OPT".equals(codeString)) + return Modality.OPT; + if ("OPV".equals(codeString)) + return Modality.OPV; + if ("OT".equals(codeString)) + return Modality.OT; + if ("PR".equals(codeString)) + return Modality.PR; + if ("PT".equals(codeString)) + return Modality.PT; + if ("PX".equals(codeString)) + return Modality.PX; + if ("REG".equals(codeString)) + return Modality.REG; + if ("RF".equals(codeString)) + return Modality.RF; + if ("RG".equals(codeString)) + return Modality.RG; + if ("RTDOSE".equals(codeString)) + return Modality.RTDOSE; + if ("RTIMAGE".equals(codeString)) + return Modality.RTIMAGE; + if ("RTPLAN".equals(codeString)) + return Modality.RTPLAN; + if ("RTRECORD".equals(codeString)) + return Modality.RTRECORD; + if ("RTSTRUCT".equals(codeString)) + return Modality.RTSTRUCT; + if ("SEG".equals(codeString)) + return Modality.SEG; + if ("SM".equals(codeString)) + return Modality.SM; + if ("SMR".equals(codeString)) + return Modality.SMR; + if ("SR".equals(codeString)) + return Modality.SR; + if ("SRF".equals(codeString)) + return Modality.SRF; + if ("TG".equals(codeString)) + return Modality.TG; + if ("US".equals(codeString)) + return Modality.US; + if ("VA".equals(codeString)) + return Modality.VA; + if ("XA".equals(codeString)) + return Modality.XA; + if ("XC".equals(codeString)) + return Modality.XC; + throw new IllegalArgumentException("Unknown Modality code '"+codeString+"'"); + } + public String toCode(Modality code) { + if (code == Modality.AR) + return "AR"; + if (code == Modality.AU) + return "AU"; + if (code == Modality.BDUS) + return "BDUS"; + if (code == Modality.BI) + return "BI"; + if (code == Modality.BMD) + return "BMD"; + if (code == Modality.CR) + return "CR"; + if (code == Modality.CT) + return "CT"; + if (code == Modality.DG) + return "DG"; + if (code == Modality.DX) + return "DX"; + if (code == Modality.ECG) + return "ECG"; + if (code == Modality.EPS) + return "EPS"; + if (code == Modality.ES) + return "ES"; + if (code == Modality.GM) + return "GM"; + if (code == Modality.HC) + return "HC"; + if (code == Modality.HD) + return "HD"; + if (code == Modality.IO) + return "IO"; + if (code == Modality.IVOCT) + return "IVOCT"; + if (code == Modality.IVUS) + return "IVUS"; + if (code == Modality.KER) + return "KER"; + if (code == Modality.KO) + return "KO"; + if (code == Modality.LEN) + return "LEN"; + if (code == Modality.LS) + return "LS"; + if (code == Modality.MG) + return "MG"; + if (code == Modality.MR) + return "MR"; + if (code == Modality.NM) + return "NM"; + if (code == Modality.OAM) + return "OAM"; + if (code == Modality.OCT) + return "OCT"; + if (code == Modality.OP) + return "OP"; + if (code == Modality.OPM) + return "OPM"; + if (code == Modality.OPT) + return "OPT"; + if (code == Modality.OPV) + return "OPV"; + if (code == Modality.OT) + return "OT"; + if (code == Modality.PR) + return "PR"; + if (code == Modality.PT) + return "PT"; + if (code == Modality.PX) + return "PX"; + if (code == Modality.REG) + return "REG"; + if (code == Modality.RF) + return "RF"; + if (code == Modality.RG) + return "RG"; + if (code == Modality.RTDOSE) + return "RTDOSE"; + if (code == Modality.RTIMAGE) + return "RTIMAGE"; + if (code == Modality.RTPLAN) + return "RTPLAN"; + if (code == Modality.RTRECORD) + return "RTRECORD"; + if (code == Modality.RTSTRUCT) + return "RTSTRUCT"; + if (code == Modality.SEG) + return "SEG"; + if (code == Modality.SM) + return "SM"; + if (code == Modality.SMR) + return "SMR"; + if (code == Modality.SR) + return "SR"; + if (code == Modality.SRF) + return "SRF"; + if (code == Modality.TG) + return "TG"; + if (code == Modality.US) + return "US"; + if (code == Modality.VA) + return "VA"; + if (code == Modality.XA) + return "XA"; + if (code == Modality.XC) + return "XC"; + return "?"; + } + } + + @Block() + public static class ImagingStudySeriesComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The Numeric identifier of this series in the study. + */ + @Child(name = "number", type = {UnsignedIntType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Numeric identifier of this series (0020,0011)", formalDefinition="The Numeric identifier of this series in the study." ) + protected UnsignedIntType number; + + /** + * The modality of this series sequence. + */ + @Child(name = "modality", type = {CodeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="The modality of the instances in the series (0008,0060)", formalDefinition="The modality of this series sequence." ) + protected Enumeration modality; + + /** + * Formal identifier for this series. + */ + @Child(name = "uid", type = {OidType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Formal identifier for this series (0020,000E)", formalDefinition="Formal identifier for this series." ) + protected OidType uid; + + /** + * A description of the series. + */ + @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="A description of the series (0008,103E)", formalDefinition="A description of the series." ) + protected StringType description; + + /** + * Number of SOP Instances in Series. + */ + @Child(name = "numberOfInstances", type = {UnsignedIntType.class}, order=5, min=1, max=1) + @Description(shortDefinition="Number of Series Related Instances (0020,1209)", formalDefinition="Number of SOP Instances in Series." ) + protected UnsignedIntType numberOfInstances; + + /** + * Availability of series (online, offline or nearline). + */ + @Child(name = "availability", type = {CodeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)", formalDefinition="Availability of series (online, offline or nearline)." ) + protected Enumeration availability; + + /** + * WADO-RS resource where the Series is available. + */ + @Child(name = "url", type = {UriType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Retrieve URI (0008,1115 > 0008,1190)", formalDefinition="WADO-RS resource where the Series is available." ) + protected UriType url; + + /** + * Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed. + */ + @Child(name = "bodySite", type = {Coding.class}, order=8, min=0, max=1) + @Description(shortDefinition="Body part examined (Map from 0018,0015)", formalDefinition="Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed." ) + protected Coding bodySite; + + /** + * Laterality if bodySite is paired anatomic structure and laterality is not pre-coordinated in bodySite code, map from (0020, 0060). + */ + @Child(name = "laterality", type = {Coding.class}, order=9, min=0, max=1) + @Description(shortDefinition="Body part laterality", formalDefinition="Laterality if bodySite is paired anatomic structure and laterality is not pre-coordinated in bodySite code, map from (0020, 0060)." ) + protected Coding laterality; + + /** + * The date and time when the series was started. + */ + @Child(name = "dateTime", type = {DateTimeType.class}, order=10, min=0, max=1) + @Description(shortDefinition="When the series started", formalDefinition="The date and time when the series was started." ) + protected DateTimeType dateTime; + + /** + * A single SOP Instance within the series, e.g., an image, or presentation state. + */ + @Child(name = "instance", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A single instance taken from a patient (image or other)", formalDefinition="A single SOP Instance within the series, e.g., an image, or presentation state." ) + protected List instance; + + private static final long serialVersionUID = 1186612269L; + + /* + * Constructor + */ + public ImagingStudySeriesComponent() { + super(); + } + + /* + * Constructor + */ + public ImagingStudySeriesComponent(Enumeration modality, OidType uid, UnsignedIntType numberOfInstances) { + super(); + this.modality = modality; + this.uid = uid; + this.numberOfInstances = numberOfInstances; + } + + /** + * @return {@link #number} (The Numeric identifier of this series in the study.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value + */ + public UnsignedIntType getNumberElement() { + if (this.number == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.number"); + else if (Configuration.doAutoCreate()) + this.number = new UnsignedIntType(); // bb + return this.number; + } + + public boolean hasNumberElement() { + return this.number != null && !this.number.isEmpty(); + } + + public boolean hasNumber() { + return this.number != null && !this.number.isEmpty(); + } + + /** + * @param value {@link #number} (The Numeric identifier of this series in the study.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value + */ + public ImagingStudySeriesComponent setNumberElement(UnsignedIntType value) { + this.number = value; + return this; + } + + /** + * @return The Numeric identifier of this series in the study. + */ + public int getNumber() { + return this.number == null || this.number.isEmpty() ? 0 : this.number.getValue(); + } + + /** + * @param value The Numeric identifier of this series in the study. + */ + public ImagingStudySeriesComponent setNumber(int value) { + if (this.number == null) + this.number = new UnsignedIntType(); + this.number.setValue(value); + return this; + } + + /** + * @return {@link #modality} (The modality of this series sequence.). This is the underlying object with id, value and extensions. The accessor "getModality" gives direct access to the value + */ + public Enumeration getModalityElement() { + if (this.modality == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.modality"); + else if (Configuration.doAutoCreate()) + this.modality = new Enumeration(new ModalityEnumFactory()); // bb + return this.modality; + } + + public boolean hasModalityElement() { + return this.modality != null && !this.modality.isEmpty(); + } + + public boolean hasModality() { + return this.modality != null && !this.modality.isEmpty(); + } + + /** + * @param value {@link #modality} (The modality of this series sequence.). This is the underlying object with id, value and extensions. The accessor "getModality" gives direct access to the value + */ + public ImagingStudySeriesComponent setModalityElement(Enumeration value) { + this.modality = value; + return this; + } + + /** + * @return The modality of this series sequence. + */ + public Modality getModality() { + return this.modality == null ? null : this.modality.getValue(); + } + + /** + * @param value The modality of this series sequence. + */ + public ImagingStudySeriesComponent setModality(Modality value) { + if (this.modality == null) + this.modality = new Enumeration(new ModalityEnumFactory()); + this.modality.setValue(value); + return this; + } + + /** + * @return {@link #uid} (Formal identifier for this series.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); // bb + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (Formal identifier for this series.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public ImagingStudySeriesComponent setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return Formal identifier for this series. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value Formal identifier for this series. + */ + public ImagingStudySeriesComponent setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #description} (A description of the series.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (A description of the series.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ImagingStudySeriesComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A description of the series. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A description of the series. + */ + public ImagingStudySeriesComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #numberOfInstances} (Number of SOP Instances in Series.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value + */ + public UnsignedIntType getNumberOfInstancesElement() { + if (this.numberOfInstances == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.numberOfInstances"); + else if (Configuration.doAutoCreate()) + this.numberOfInstances = new UnsignedIntType(); // bb + return this.numberOfInstances; + } + + public boolean hasNumberOfInstancesElement() { + return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); + } + + public boolean hasNumberOfInstances() { + return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); + } + + /** + * @param value {@link #numberOfInstances} (Number of SOP Instances in Series.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value + */ + public ImagingStudySeriesComponent setNumberOfInstancesElement(UnsignedIntType value) { + this.numberOfInstances = value; + return this; + } + + /** + * @return Number of SOP Instances in Series. + */ + public int getNumberOfInstances() { + return this.numberOfInstances == null || this.numberOfInstances.isEmpty() ? 0 : this.numberOfInstances.getValue(); + } + + /** + * @param value Number of SOP Instances in Series. + */ + public ImagingStudySeriesComponent setNumberOfInstances(int value) { + if (this.numberOfInstances == null) + this.numberOfInstances = new UnsignedIntType(); + this.numberOfInstances.setValue(value); + return this; + } + + /** + * @return {@link #availability} (Availability of series (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value + */ + public Enumeration getAvailabilityElement() { + if (this.availability == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.availability"); + else if (Configuration.doAutoCreate()) + this.availability = new Enumeration(new InstanceAvailabilityEnumFactory()); // bb + return this.availability; + } + + public boolean hasAvailabilityElement() { + return this.availability != null && !this.availability.isEmpty(); + } + + public boolean hasAvailability() { + return this.availability != null && !this.availability.isEmpty(); + } + + /** + * @param value {@link #availability} (Availability of series (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value + */ + public ImagingStudySeriesComponent setAvailabilityElement(Enumeration value) { + this.availability = value; + return this; + } + + /** + * @return Availability of series (online, offline or nearline). + */ + public InstanceAvailability getAvailability() { + return this.availability == null ? null : this.availability.getValue(); + } + + /** + * @param value Availability of series (online, offline or nearline). + */ + public ImagingStudySeriesComponent setAvailability(InstanceAvailability value) { + if (value == null) + this.availability = null; + else { + if (this.availability == null) + this.availability = new Enumeration(new InstanceAvailabilityEnumFactory()); + this.availability.setValue(value); + } + return this; + } + + /** + * @return {@link #url} (WADO-RS resource where the Series is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (WADO-RS resource where the Series is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public ImagingStudySeriesComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return WADO-RS resource where the Series is available. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value WADO-RS resource where the Series is available. + */ + public ImagingStudySeriesComponent setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #bodySite} (Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed.) + */ + public Coding getBodySite() { + if (this.bodySite == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.bodySite"); + else if (Configuration.doAutoCreate()) + this.bodySite = new Coding(); // cc + return this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed.) + */ + public ImagingStudySeriesComponent setBodySite(Coding value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #laterality} (Laterality if bodySite is paired anatomic structure and laterality is not pre-coordinated in bodySite code, map from (0020, 0060).) + */ + public Coding getLaterality() { + if (this.laterality == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.laterality"); + else if (Configuration.doAutoCreate()) + this.laterality = new Coding(); // cc + return this.laterality; + } + + public boolean hasLaterality() { + return this.laterality != null && !this.laterality.isEmpty(); + } + + /** + * @param value {@link #laterality} (Laterality if bodySite is paired anatomic structure and laterality is not pre-coordinated in bodySite code, map from (0020, 0060).) + */ + public ImagingStudySeriesComponent setLaterality(Coding value) { + this.laterality = value; + return this; + } + + /** + * @return {@link #dateTime} (The date and time when the series was started.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public DateTimeType getDateTimeElement() { + if (this.dateTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.dateTime"); + else if (Configuration.doAutoCreate()) + this.dateTime = new DateTimeType(); // bb + return this.dateTime; + } + + public boolean hasDateTimeElement() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + public boolean hasDateTime() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + /** + * @param value {@link #dateTime} (The date and time when the series was started.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public ImagingStudySeriesComponent setDateTimeElement(DateTimeType value) { + this.dateTime = value; + return this; + } + + /** + * @return The date and time when the series was started. + */ + public Date getDateTime() { + return this.dateTime == null ? null : this.dateTime.getValue(); + } + + /** + * @param value The date and time when the series was started. + */ + public ImagingStudySeriesComponent setDateTime(Date value) { + if (value == null) + this.dateTime = null; + else { + if (this.dateTime == null) + this.dateTime = new DateTimeType(); + this.dateTime.setValue(value); + } + return this; + } + + /** + * @return {@link #instance} (A single SOP Instance within the series, e.g., an image, or presentation state.) + */ + public List getInstance() { + if (this.instance == null) + this.instance = new ArrayList(); + return this.instance; + } + + public boolean hasInstance() { + if (this.instance == null) + return false; + for (ImagingStudySeriesInstanceComponent item : this.instance) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #instance} (A single SOP Instance within the series, e.g., an image, or presentation state.) + */ + // syntactic sugar + public ImagingStudySeriesInstanceComponent addInstance() { //3 + ImagingStudySeriesInstanceComponent t = new ImagingStudySeriesInstanceComponent(); + if (this.instance == null) + this.instance = new ArrayList(); + this.instance.add(t); + return t; + } + + // syntactic sugar + public ImagingStudySeriesComponent addInstance(ImagingStudySeriesInstanceComponent t) { //3 + if (t == null) + return this; + if (this.instance == null) + this.instance = new ArrayList(); + this.instance.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("number", "unsignedInt", "The Numeric identifier of this series in the study.", 0, java.lang.Integer.MAX_VALUE, number)); + childrenList.add(new Property("modality", "code", "The modality of this series sequence.", 0, java.lang.Integer.MAX_VALUE, modality)); + childrenList.add(new Property("uid", "oid", "Formal identifier for this series.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("description", "string", "A description of the series.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("numberOfInstances", "unsignedInt", "Number of SOP Instances in Series.", 0, java.lang.Integer.MAX_VALUE, numberOfInstances)); + childrenList.add(new Property("availability", "code", "Availability of series (online, offline or nearline).", 0, java.lang.Integer.MAX_VALUE, availability)); + childrenList.add(new Property("url", "uri", "WADO-RS resource where the Series is available.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("bodySite", "Coding", "Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed.", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("laterality", "Coding", "Laterality if bodySite is paired anatomic structure and laterality is not pre-coordinated in bodySite code, map from (0020, 0060).", 0, java.lang.Integer.MAX_VALUE, laterality)); + childrenList.add(new Property("dateTime", "dateTime", "The date and time when the series was started.", 0, java.lang.Integer.MAX_VALUE, dateTime)); + childrenList.add(new Property("instance", "", "A single SOP Instance within the series, e.g., an image, or presentation state.", 0, java.lang.Integer.MAX_VALUE, instance)); + } + + public ImagingStudySeriesComponent copy() { + ImagingStudySeriesComponent dst = new ImagingStudySeriesComponent(); + copyValues(dst); + dst.number = number == null ? null : number.copy(); + dst.modality = modality == null ? null : modality.copy(); + dst.uid = uid == null ? null : uid.copy(); + dst.description = description == null ? null : description.copy(); + dst.numberOfInstances = numberOfInstances == null ? null : numberOfInstances.copy(); + dst.availability = availability == null ? null : availability.copy(); + dst.url = url == null ? null : url.copy(); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + dst.laterality = laterality == null ? null : laterality.copy(); + dst.dateTime = dateTime == null ? null : dateTime.copy(); + if (instance != null) { + dst.instance = new ArrayList(); + for (ImagingStudySeriesInstanceComponent i : instance) + dst.instance.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImagingStudySeriesComponent)) + return false; + ImagingStudySeriesComponent o = (ImagingStudySeriesComponent) other; + return compareDeep(number, o.number, true) && compareDeep(modality, o.modality, true) && compareDeep(uid, o.uid, true) + && compareDeep(description, o.description, true) && compareDeep(numberOfInstances, o.numberOfInstances, true) + && compareDeep(availability, o.availability, true) && compareDeep(url, o.url, true) && compareDeep(bodySite, o.bodySite, true) + && compareDeep(laterality, o.laterality, true) && compareDeep(dateTime, o.dateTime, true) && compareDeep(instance, o.instance, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImagingStudySeriesComponent)) + return false; + ImagingStudySeriesComponent o = (ImagingStudySeriesComponent) other; + return compareValues(number, o.number, true) && compareValues(modality, o.modality, true) && compareValues(uid, o.uid, true) + && compareValues(description, o.description, true) && compareValues(numberOfInstances, o.numberOfInstances, true) + && compareValues(availability, o.availability, true) && compareValues(url, o.url, true) && compareValues(dateTime, o.dateTime, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (number == null || number.isEmpty()) && (modality == null || modality.isEmpty()) + && (uid == null || uid.isEmpty()) && (description == null || description.isEmpty()) && (numberOfInstances == null || numberOfInstances.isEmpty()) + && (availability == null || availability.isEmpty()) && (url == null || url.isEmpty()) && (bodySite == null || bodySite.isEmpty()) + && (laterality == null || laterality.isEmpty()) && (dateTime == null || dateTime.isEmpty()) + && (instance == null || instance.isEmpty()); + } + + } + + @Block() + public static class ImagingStudySeriesInstanceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The number of this image in the series. + */ + @Child(name = "number", type = {UnsignedIntType.class}, order=1, min=0, max=1) + @Description(shortDefinition="The number of this instance in the series (0020,0013)", formalDefinition="The number of this image in the series." ) + protected UnsignedIntType number; + + /** + * Formal identifier for this image. + */ + @Child(name = "uid", type = {OidType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Formal identifier for this instance (0008,0018)", formalDefinition="Formal identifier for this image." ) + protected OidType uid; + + /** + * DICOM Image type. + */ + @Child(name = "sopclass", type = {OidType.class}, order=3, min=1, max=1) + @Description(shortDefinition="DICOM class type (0008,0016)", formalDefinition="DICOM Image type." ) + protected OidType sopclass; + + /** + * A human-friendly SOP Class name. + */ + @Child(name = "type", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Type of instance (image etc) (0004,1430)", formalDefinition="A human-friendly SOP Class name." ) + protected StringType type; + + /** + * The description of the instance. + */ + @Child(name = "title", type = {StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Description (0070,0080 | 0040,A043 > 0008,0104 | 0042,0010 | 0008,0008)", formalDefinition="The description of the instance." ) + protected StringType title; + + /** + * Content of the instance or a rendering thereof (e.g., a JPEG of an image, or an XML of a structured report). May be represented by inline encoding, or by a URL reference to a WADO-RS service that makes the instance available. Multiple content attachments may be used for alternate representations of the instance. + */ + @Child(name = "content", type = {Attachment.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Content of the instance", formalDefinition="Content of the instance or a rendering thereof (e.g., a JPEG of an image, or an XML of a structured report). May be represented by inline encoding, or by a URL reference to a WADO-RS service that makes the instance available. Multiple content attachments may be used for alternate representations of the instance." ) + protected List content; + + private static final long serialVersionUID = 264997991L; + + /* + * Constructor + */ + public ImagingStudySeriesInstanceComponent() { + super(); + } + + /* + * Constructor + */ + public ImagingStudySeriesInstanceComponent(OidType uid, OidType sopclass) { + super(); + this.uid = uid; + this.sopclass = sopclass; + } + + /** + * @return {@link #number} (The number of this image in the series.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value + */ + public UnsignedIntType getNumberElement() { + if (this.number == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.number"); + else if (Configuration.doAutoCreate()) + this.number = new UnsignedIntType(); // bb + return this.number; + } + + public boolean hasNumberElement() { + return this.number != null && !this.number.isEmpty(); + } + + public boolean hasNumber() { + return this.number != null && !this.number.isEmpty(); + } + + /** + * @param value {@link #number} (The number of this image in the series.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value + */ + public ImagingStudySeriesInstanceComponent setNumberElement(UnsignedIntType value) { + this.number = value; + return this; + } + + /** + * @return The number of this image in the series. + */ + public int getNumber() { + return this.number == null || this.number.isEmpty() ? 0 : this.number.getValue(); + } + + /** + * @param value The number of this image in the series. + */ + public ImagingStudySeriesInstanceComponent setNumber(int value) { + if (this.number == null) + this.number = new UnsignedIntType(); + this.number.setValue(value); + return this; + } + + /** + * @return {@link #uid} (Formal identifier for this image.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); // bb + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (Formal identifier for this image.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public ImagingStudySeriesInstanceComponent setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return Formal identifier for this image. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value Formal identifier for this image. + */ + public ImagingStudySeriesInstanceComponent setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #sopclass} (DICOM Image type.). This is the underlying object with id, value and extensions. The accessor "getSopclass" gives direct access to the value + */ + public OidType getSopclassElement() { + if (this.sopclass == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.sopclass"); + else if (Configuration.doAutoCreate()) + this.sopclass = new OidType(); // bb + return this.sopclass; + } + + public boolean hasSopclassElement() { + return this.sopclass != null && !this.sopclass.isEmpty(); + } + + public boolean hasSopclass() { + return this.sopclass != null && !this.sopclass.isEmpty(); + } + + /** + * @param value {@link #sopclass} (DICOM Image type.). This is the underlying object with id, value and extensions. The accessor "getSopclass" gives direct access to the value + */ + public ImagingStudySeriesInstanceComponent setSopclassElement(OidType value) { + this.sopclass = value; + return this; + } + + /** + * @return DICOM Image type. + */ + public String getSopclass() { + return this.sopclass == null ? null : this.sopclass.getValue(); + } + + /** + * @param value DICOM Image type. + */ + public ImagingStudySeriesInstanceComponent setSopclass(String value) { + if (this.sopclass == null) + this.sopclass = new OidType(); + this.sopclass.setValue(value); + return this; + } + + /** + * @return {@link #type} (A human-friendly SOP Class name.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public StringType getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new StringType(); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (A human-friendly SOP Class name.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ImagingStudySeriesInstanceComponent setTypeElement(StringType value) { + this.type = value; + return this; + } + + /** + * @return A human-friendly SOP Class name. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value A human-friendly SOP Class name. + */ + public ImagingStudySeriesInstanceComponent setType(String value) { + if (Utilities.noString(value)) + this.type = null; + else { + if (this.type == null) + this.type = new StringType(); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #title} (The description of the instance.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); // bb + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (The description of the instance.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public ImagingStudySeriesInstanceComponent setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return The description of the instance. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value The description of the instance. + */ + public ImagingStudySeriesInstanceComponent setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #content} (Content of the instance or a rendering thereof (e.g., a JPEG of an image, or an XML of a structured report). May be represented by inline encoding, or by a URL reference to a WADO-RS service that makes the instance available. Multiple content attachments may be used for alternate representations of the instance.) + */ + public List getContent() { + if (this.content == null) + this.content = new ArrayList(); + return this.content; + } + + public boolean hasContent() { + if (this.content == null) + return false; + for (Attachment item : this.content) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #content} (Content of the instance or a rendering thereof (e.g., a JPEG of an image, or an XML of a structured report). May be represented by inline encoding, or by a URL reference to a WADO-RS service that makes the instance available. Multiple content attachments may be used for alternate representations of the instance.) + */ + // syntactic sugar + public Attachment addContent() { //3 + Attachment t = new Attachment(); + if (this.content == null) + this.content = new ArrayList(); + this.content.add(t); + return t; + } + + // syntactic sugar + public ImagingStudySeriesInstanceComponent addContent(Attachment t) { //3 + if (t == null) + return this; + if (this.content == null) + this.content = new ArrayList(); + this.content.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("number", "unsignedInt", "The number of this image in the series.", 0, java.lang.Integer.MAX_VALUE, number)); + childrenList.add(new Property("uid", "oid", "Formal identifier for this image.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("sopclass", "oid", "DICOM Image type.", 0, java.lang.Integer.MAX_VALUE, sopclass)); + childrenList.add(new Property("type", "string", "A human-friendly SOP Class name.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("title", "string", "The description of the instance.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("content", "Attachment", "Content of the instance or a rendering thereof (e.g., a JPEG of an image, or an XML of a structured report). May be represented by inline encoding, or by a URL reference to a WADO-RS service that makes the instance available. Multiple content attachments may be used for alternate representations of the instance.", 0, java.lang.Integer.MAX_VALUE, content)); + } + + public ImagingStudySeriesInstanceComponent copy() { + ImagingStudySeriesInstanceComponent dst = new ImagingStudySeriesInstanceComponent(); + copyValues(dst); + dst.number = number == null ? null : number.copy(); + dst.uid = uid == null ? null : uid.copy(); + dst.sopclass = sopclass == null ? null : sopclass.copy(); + dst.type = type == null ? null : type.copy(); + dst.title = title == null ? null : title.copy(); + if (content != null) { + dst.content = new ArrayList(); + for (Attachment i : content) + dst.content.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImagingStudySeriesInstanceComponent)) + return false; + ImagingStudySeriesInstanceComponent o = (ImagingStudySeriesInstanceComponent) other; + return compareDeep(number, o.number, true) && compareDeep(uid, o.uid, true) && compareDeep(sopclass, o.sopclass, true) + && compareDeep(type, o.type, true) && compareDeep(title, o.title, true) && compareDeep(content, o.content, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImagingStudySeriesInstanceComponent)) + return false; + ImagingStudySeriesInstanceComponent o = (ImagingStudySeriesInstanceComponent) other; + return compareValues(number, o.number, true) && compareValues(uid, o.uid, true) && compareValues(sopclass, o.sopclass, true) + && compareValues(type, o.type, true) && compareValues(title, o.title, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (number == null || number.isEmpty()) && (uid == null || uid.isEmpty()) + && (sopclass == null || sopclass.isEmpty()) && (type == null || type.isEmpty()) && (title == null || title.isEmpty()) + && (content == null || content.isEmpty()); + } + + } + + /** + * Date and Time the study started. Timezone Offset From UTC. + */ + @Child(name = "started", type = {DateTimeType.class}, order=0, min=0, max=1) + @Description(shortDefinition="When the study was started (0008,0020)+(0008,0030)", formalDefinition="Date and Time the study started. Timezone Offset From UTC." ) + protected DateTimeType started; + + /** + * The patient imaged in the study. + */ + @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1) + @Description(shortDefinition="Who the images are of", formalDefinition="The patient imaged in the study." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient imaged in the study.) + */ + protected Patient patientTarget; + + /** + * Formal identifier for the study. + */ + @Child(name = "uid", type = {OidType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Formal identifier for the study (0020,000D)", formalDefinition="Formal identifier for the study." ) + protected OidType uid; + + /** + * Accession Number. + */ + @Child(name = "accession", type = {Identifier.class}, order=3, min=0, max=1) + @Description(shortDefinition="Accession Number (0008,0050)", formalDefinition="Accession Number." ) + protected Identifier accession; + + /** + * Other identifiers for the study. + */ + @Child(name = "identifier", type = {Identifier.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Other identifiers for the study (0020,0010)", formalDefinition="Other identifiers for the study." ) + protected List identifier; + + /** + * A list of the diagnostic orders that resulted in this imaging study being performed. + */ + @Child(name = "order", type = {DiagnosticOrder.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Order(s) that caused this study to be performed", formalDefinition="A list of the diagnostic orders that resulted in this imaging study being performed." ) + protected List order; + /** + * The actual objects that are the target of the reference (A list of the diagnostic orders that resulted in this imaging study being performed.) + */ + protected List orderTarget; + + + /** + * A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19). + */ + @Child(name = "modalityList", type = {CodeType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="All series.modality if actual acquisition modalities", formalDefinition="A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19)." ) + protected List> modalityList; + + /** + * The requesting/referring physician. + */ + @Child(name = "referrer", type = {Practitioner.class}, order=7, min=0, max=1) + @Description(shortDefinition="Referring physician (0008,0090)", formalDefinition="The requesting/referring physician." ) + protected Reference referrer; + + /** + * The actual object that is the target of the reference (The requesting/referring physician.) + */ + protected Practitioner referrerTarget; + + /** + * Availability of study (online, offline or nearline). + */ + @Child(name = "availability", type = {CodeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)", formalDefinition="Availability of study (online, offline or nearline)." ) + protected Enumeration availability; + + /** + * WADO-RS resource where Study is available. + */ + @Child(name = "url", type = {UriType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Retrieve URI (0008,1190)", formalDefinition="WADO-RS resource where Study is available." ) + protected UriType url; + + /** + * Number of Series in Study. + */ + @Child(name = "numberOfSeries", type = {UnsignedIntType.class}, order=10, min=1, max=1) + @Description(shortDefinition="Number of Study Related Series (0020,1206)", formalDefinition="Number of Series in Study." ) + protected UnsignedIntType numberOfSeries; + + /** + * Number of SOP Instances in Study. + */ + @Child(name = "numberOfInstances", type = {UnsignedIntType.class}, order=11, min=1, max=1) + @Description(shortDefinition="Number of Study Related Instances (0020,1208)", formalDefinition="Number of SOP Instances in Study." ) + protected UnsignedIntType numberOfInstances; + + /** + * Diagnoses etc provided with request. + */ + @Child(name = "clinicalInformation", type = {StringType.class}, order=12, min=0, max=1) + @Description(shortDefinition="Diagnoses etc with request (0040,1002)", formalDefinition="Diagnoses etc provided with request." ) + protected StringType clinicalInformation; + + /** + * Type of procedure performed. + */ + @Child(name = "procedure", type = {Coding.class}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Type of procedure performed (0008,1032)", formalDefinition="Type of procedure performed." ) + protected List procedure; + + /** + * Who read study and interpreted the images. + */ + @Child(name = "interpreter", type = {Practitioner.class}, order=14, min=0, max=1) + @Description(shortDefinition="Who interpreted images (0008,1060)", formalDefinition="Who read study and interpreted the images." ) + protected Reference interpreter; + + /** + * The actual object that is the target of the reference (Who read study and interpreted the images.) + */ + protected Practitioner interpreterTarget; + + /** + * Institution-generated description or classification of the Study performed. + */ + @Child(name = "description", type = {StringType.class}, order=15, min=0, max=1) + @Description(shortDefinition="Institution-generated description (0008,1030)", formalDefinition="Institution-generated description or classification of the Study performed." ) + protected StringType description; + + /** + * Each study has one or more series of image instances. + */ + @Child(name = "series", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Each study has one or more series of instances", formalDefinition="Each study has one or more series of image instances." ) + protected List series; + + private static final long serialVersionUID = 206272292L; + + /* + * Constructor + */ + public ImagingStudy() { + super(); + } + + /* + * Constructor + */ + public ImagingStudy(Reference patient, OidType uid, UnsignedIntType numberOfSeries, UnsignedIntType numberOfInstances) { + super(); + this.patient = patient; + this.uid = uid; + this.numberOfSeries = numberOfSeries; + this.numberOfInstances = numberOfInstances; + } + + /** + * @return {@link #started} (Date and Time the study started. Timezone Offset From UTC.). This is the underlying object with id, value and extensions. The accessor "getStarted" gives direct access to the value + */ + public DateTimeType getStartedElement() { + if (this.started == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.started"); + else if (Configuration.doAutoCreate()) + this.started = new DateTimeType(); // bb + return this.started; + } + + public boolean hasStartedElement() { + return this.started != null && !this.started.isEmpty(); + } + + public boolean hasStarted() { + return this.started != null && !this.started.isEmpty(); + } + + /** + * @param value {@link #started} (Date and Time the study started. Timezone Offset From UTC.). This is the underlying object with id, value and extensions. The accessor "getStarted" gives direct access to the value + */ + public ImagingStudy setStartedElement(DateTimeType value) { + this.started = value; + return this; + } + + /** + * @return Date and Time the study started. Timezone Offset From UTC. + */ + public Date getStarted() { + return this.started == null ? null : this.started.getValue(); + } + + /** + * @param value Date and Time the study started. Timezone Offset From UTC. + */ + public ImagingStudy setStarted(Date value) { + if (value == null) + this.started = null; + else { + if (this.started == null) + this.started = new DateTimeType(); + this.started.setValue(value); + } + return this; + } + + /** + * @return {@link #patient} (The patient imaged in the study.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The patient imaged in the study.) + */ + public ImagingStudy setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient imaged in the study.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient imaged in the study.) + */ + public ImagingStudy setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #uid} (Formal identifier for the study.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); // bb + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (Formal identifier for the study.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public ImagingStudy setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return Formal identifier for the study. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value Formal identifier for the study. + */ + public ImagingStudy setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #accession} (Accession Number.) + */ + public Identifier getAccession() { + if (this.accession == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.accession"); + else if (Configuration.doAutoCreate()) + this.accession = new Identifier(); // cc + return this.accession; + } + + public boolean hasAccession() { + return this.accession != null && !this.accession.isEmpty(); + } + + /** + * @param value {@link #accession} (Accession Number.) + */ + public ImagingStudy setAccession(Identifier value) { + this.accession = value; + return this; + } + + /** + * @return {@link #identifier} (Other identifiers for the study.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Other identifiers for the study.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public ImagingStudy addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #order} (A list of the diagnostic orders that resulted in this imaging study being performed.) + */ + public List getOrder() { + if (this.order == null) + this.order = new ArrayList(); + return this.order; + } + + public boolean hasOrder() { + if (this.order == null) + return false; + for (Reference item : this.order) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #order} (A list of the diagnostic orders that resulted in this imaging study being performed.) + */ + // syntactic sugar + public Reference addOrder() { //3 + Reference t = new Reference(); + if (this.order == null) + this.order = new ArrayList(); + this.order.add(t); + return t; + } + + // syntactic sugar + public ImagingStudy addOrder(Reference t) { //3 + if (t == null) + return this; + if (this.order == null) + this.order = new ArrayList(); + this.order.add(t); + return this; + } + + /** + * @return {@link #order} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A list of the diagnostic orders that resulted in this imaging study being performed.) + */ + public List getOrderTarget() { + if (this.orderTarget == null) + this.orderTarget = new ArrayList(); + return this.orderTarget; + } + + // syntactic sugar + /** + * @return {@link #order} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. A list of the diagnostic orders that resulted in this imaging study being performed.) + */ + public DiagnosticOrder addOrderTarget() { + DiagnosticOrder r = new DiagnosticOrder(); + if (this.orderTarget == null) + this.orderTarget = new ArrayList(); + this.orderTarget.add(r); + return r; + } + + /** + * @return {@link #modalityList} (A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).) + */ + public List> getModalityList() { + if (this.modalityList == null) + this.modalityList = new ArrayList>(); + return this.modalityList; + } + + public boolean hasModalityList() { + if (this.modalityList == null) + return false; + for (Enumeration item : this.modalityList) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modalityList} (A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).) + */ + // syntactic sugar + public Enumeration addModalityListElement() {//2 + Enumeration t = new Enumeration(new ImagingModalityEnumFactory()); + if (this.modalityList == null) + this.modalityList = new ArrayList>(); + this.modalityList.add(t); + return t; + } + + /** + * @param value {@link #modalityList} (A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).) + */ + public ImagingStudy addModalityList(ImagingModality value) { //1 + Enumeration t = new Enumeration(new ImagingModalityEnumFactory()); + t.setValue(value); + if (this.modalityList == null) + this.modalityList = new ArrayList>(); + this.modalityList.add(t); + return this; + } + + /** + * @param value {@link #modalityList} (A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).) + */ + public boolean hasModalityList(ImagingModality value) { + if (this.modalityList == null) + return false; + for (Enumeration v : this.modalityList) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #referrer} (The requesting/referring physician.) + */ + public Reference getReferrer() { + if (this.referrer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.referrer"); + else if (Configuration.doAutoCreate()) + this.referrer = new Reference(); // cc + return this.referrer; + } + + public boolean hasReferrer() { + return this.referrer != null && !this.referrer.isEmpty(); + } + + /** + * @param value {@link #referrer} (The requesting/referring physician.) + */ + public ImagingStudy setReferrer(Reference value) { + this.referrer = value; + return this; + } + + /** + * @return {@link #referrer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The requesting/referring physician.) + */ + public Practitioner getReferrerTarget() { + if (this.referrerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.referrer"); + else if (Configuration.doAutoCreate()) + this.referrerTarget = new Practitioner(); // aa + return this.referrerTarget; + } + + /** + * @param value {@link #referrer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The requesting/referring physician.) + */ + public ImagingStudy setReferrerTarget(Practitioner value) { + this.referrerTarget = value; + return this; + } + + /** + * @return {@link #availability} (Availability of study (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value + */ + public Enumeration getAvailabilityElement() { + if (this.availability == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.availability"); + else if (Configuration.doAutoCreate()) + this.availability = new Enumeration(new InstanceAvailabilityEnumFactory()); // bb + return this.availability; + } + + public boolean hasAvailabilityElement() { + return this.availability != null && !this.availability.isEmpty(); + } + + public boolean hasAvailability() { + return this.availability != null && !this.availability.isEmpty(); + } + + /** + * @param value {@link #availability} (Availability of study (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value + */ + public ImagingStudy setAvailabilityElement(Enumeration value) { + this.availability = value; + return this; + } + + /** + * @return Availability of study (online, offline or nearline). + */ + public InstanceAvailability getAvailability() { + return this.availability == null ? null : this.availability.getValue(); + } + + /** + * @param value Availability of study (online, offline or nearline). + */ + public ImagingStudy setAvailability(InstanceAvailability value) { + if (value == null) + this.availability = null; + else { + if (this.availability == null) + this.availability = new Enumeration(new InstanceAvailabilityEnumFactory()); + this.availability.setValue(value); + } + return this; + } + + /** + * @return {@link #url} (WADO-RS resource where Study is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (WADO-RS resource where Study is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public ImagingStudy setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return WADO-RS resource where Study is available. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value WADO-RS resource where Study is available. + */ + public ImagingStudy setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #numberOfSeries} (Number of Series in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfSeries" gives direct access to the value + */ + public UnsignedIntType getNumberOfSeriesElement() { + if (this.numberOfSeries == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.numberOfSeries"); + else if (Configuration.doAutoCreate()) + this.numberOfSeries = new UnsignedIntType(); // bb + return this.numberOfSeries; + } + + public boolean hasNumberOfSeriesElement() { + return this.numberOfSeries != null && !this.numberOfSeries.isEmpty(); + } + + public boolean hasNumberOfSeries() { + return this.numberOfSeries != null && !this.numberOfSeries.isEmpty(); + } + + /** + * @param value {@link #numberOfSeries} (Number of Series in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfSeries" gives direct access to the value + */ + public ImagingStudy setNumberOfSeriesElement(UnsignedIntType value) { + this.numberOfSeries = value; + return this; + } + + /** + * @return Number of Series in Study. + */ + public int getNumberOfSeries() { + return this.numberOfSeries == null || this.numberOfSeries.isEmpty() ? 0 : this.numberOfSeries.getValue(); + } + + /** + * @param value Number of Series in Study. + */ + public ImagingStudy setNumberOfSeries(int value) { + if (this.numberOfSeries == null) + this.numberOfSeries = new UnsignedIntType(); + this.numberOfSeries.setValue(value); + return this; + } + + /** + * @return {@link #numberOfInstances} (Number of SOP Instances in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value + */ + public UnsignedIntType getNumberOfInstancesElement() { + if (this.numberOfInstances == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.numberOfInstances"); + else if (Configuration.doAutoCreate()) + this.numberOfInstances = new UnsignedIntType(); // bb + return this.numberOfInstances; + } + + public boolean hasNumberOfInstancesElement() { + return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); + } + + public boolean hasNumberOfInstances() { + return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); + } + + /** + * @param value {@link #numberOfInstances} (Number of SOP Instances in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value + */ + public ImagingStudy setNumberOfInstancesElement(UnsignedIntType value) { + this.numberOfInstances = value; + return this; + } + + /** + * @return Number of SOP Instances in Study. + */ + public int getNumberOfInstances() { + return this.numberOfInstances == null || this.numberOfInstances.isEmpty() ? 0 : this.numberOfInstances.getValue(); + } + + /** + * @param value Number of SOP Instances in Study. + */ + public ImagingStudy setNumberOfInstances(int value) { + if (this.numberOfInstances == null) + this.numberOfInstances = new UnsignedIntType(); + this.numberOfInstances.setValue(value); + return this; + } + + /** + * @return {@link #clinicalInformation} (Diagnoses etc provided with request.). This is the underlying object with id, value and extensions. The accessor "getClinicalInformation" gives direct access to the value + */ + public StringType getClinicalInformationElement() { + if (this.clinicalInformation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.clinicalInformation"); + else if (Configuration.doAutoCreate()) + this.clinicalInformation = new StringType(); // bb + return this.clinicalInformation; + } + + public boolean hasClinicalInformationElement() { + return this.clinicalInformation != null && !this.clinicalInformation.isEmpty(); + } + + public boolean hasClinicalInformation() { + return this.clinicalInformation != null && !this.clinicalInformation.isEmpty(); + } + + /** + * @param value {@link #clinicalInformation} (Diagnoses etc provided with request.). This is the underlying object with id, value and extensions. The accessor "getClinicalInformation" gives direct access to the value + */ + public ImagingStudy setClinicalInformationElement(StringType value) { + this.clinicalInformation = value; + return this; + } + + /** + * @return Diagnoses etc provided with request. + */ + public String getClinicalInformation() { + return this.clinicalInformation == null ? null : this.clinicalInformation.getValue(); + } + + /** + * @param value Diagnoses etc provided with request. + */ + public ImagingStudy setClinicalInformation(String value) { + if (Utilities.noString(value)) + this.clinicalInformation = null; + else { + if (this.clinicalInformation == null) + this.clinicalInformation = new StringType(); + this.clinicalInformation.setValue(value); + } + return this; + } + + /** + * @return {@link #procedure} (Type of procedure performed.) + */ + public List getProcedure() { + if (this.procedure == null) + this.procedure = new ArrayList(); + return this.procedure; + } + + public boolean hasProcedure() { + if (this.procedure == null) + return false; + for (Coding item : this.procedure) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #procedure} (Type of procedure performed.) + */ + // syntactic sugar + public Coding addProcedure() { //3 + Coding t = new Coding(); + if (this.procedure == null) + this.procedure = new ArrayList(); + this.procedure.add(t); + return t; + } + + // syntactic sugar + public ImagingStudy addProcedure(Coding t) { //3 + if (t == null) + return this; + if (this.procedure == null) + this.procedure = new ArrayList(); + this.procedure.add(t); + return this; + } + + /** + * @return {@link #interpreter} (Who read study and interpreted the images.) + */ + public Reference getInterpreter() { + if (this.interpreter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.interpreter"); + else if (Configuration.doAutoCreate()) + this.interpreter = new Reference(); // cc + return this.interpreter; + } + + public boolean hasInterpreter() { + return this.interpreter != null && !this.interpreter.isEmpty(); + } + + /** + * @param value {@link #interpreter} (Who read study and interpreted the images.) + */ + public ImagingStudy setInterpreter(Reference value) { + this.interpreter = value; + return this; + } + + /** + * @return {@link #interpreter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who read study and interpreted the images.) + */ + public Practitioner getInterpreterTarget() { + if (this.interpreterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.interpreter"); + else if (Configuration.doAutoCreate()) + this.interpreterTarget = new Practitioner(); // aa + return this.interpreterTarget; + } + + /** + * @param value {@link #interpreter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who read study and interpreted the images.) + */ + public ImagingStudy setInterpreterTarget(Practitioner value) { + this.interpreterTarget = value; + return this; + } + + /** + * @return {@link #description} (Institution-generated description or classification of the Study performed.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Institution-generated description or classification of the Study performed.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ImagingStudy setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Institution-generated description or classification of the Study performed. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Institution-generated description or classification of the Study performed. + */ + public ImagingStudy setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #series} (Each study has one or more series of image instances.) + */ + public List getSeries() { + if (this.series == null) + this.series = new ArrayList(); + return this.series; + } + + public boolean hasSeries() { + if (this.series == null) + return false; + for (ImagingStudySeriesComponent item : this.series) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #series} (Each study has one or more series of image instances.) + */ + // syntactic sugar + public ImagingStudySeriesComponent addSeries() { //3 + ImagingStudySeriesComponent t = new ImagingStudySeriesComponent(); + if (this.series == null) + this.series = new ArrayList(); + this.series.add(t); + return t; + } + + // syntactic sugar + public ImagingStudy addSeries(ImagingStudySeriesComponent t) { //3 + if (t == null) + return this; + if (this.series == null) + this.series = new ArrayList(); + this.series.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("started", "dateTime", "Date and Time the study started. Timezone Offset From UTC.", 0, java.lang.Integer.MAX_VALUE, started)); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient imaged in the study.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("uid", "oid", "Formal identifier for the study.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("accession", "Identifier", "Accession Number.", 0, java.lang.Integer.MAX_VALUE, accession)); + childrenList.add(new Property("identifier", "Identifier", "Other identifiers for the study.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("order", "Reference(DiagnosticOrder)", "A list of the diagnostic orders that resulted in this imaging study being performed.", 0, java.lang.Integer.MAX_VALUE, order)); + childrenList.add(new Property("modalityList", "code", "A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).", 0, java.lang.Integer.MAX_VALUE, modalityList)); + childrenList.add(new Property("referrer", "Reference(Practitioner)", "The requesting/referring physician.", 0, java.lang.Integer.MAX_VALUE, referrer)); + childrenList.add(new Property("availability", "code", "Availability of study (online, offline or nearline).", 0, java.lang.Integer.MAX_VALUE, availability)); + childrenList.add(new Property("url", "uri", "WADO-RS resource where Study is available.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("numberOfSeries", "unsignedInt", "Number of Series in Study.", 0, java.lang.Integer.MAX_VALUE, numberOfSeries)); + childrenList.add(new Property("numberOfInstances", "unsignedInt", "Number of SOP Instances in Study.", 0, java.lang.Integer.MAX_VALUE, numberOfInstances)); + childrenList.add(new Property("clinicalInformation", "string", "Diagnoses etc provided with request.", 0, java.lang.Integer.MAX_VALUE, clinicalInformation)); + childrenList.add(new Property("procedure", "Coding", "Type of procedure performed.", 0, java.lang.Integer.MAX_VALUE, procedure)); + childrenList.add(new Property("interpreter", "Reference(Practitioner)", "Who read study and interpreted the images.", 0, java.lang.Integer.MAX_VALUE, interpreter)); + childrenList.add(new Property("description", "string", "Institution-generated description or classification of the Study performed.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("series", "", "Each study has one or more series of image instances.", 0, java.lang.Integer.MAX_VALUE, series)); + } + + public ImagingStudy copy() { + ImagingStudy dst = new ImagingStudy(); + copyValues(dst); + dst.started = started == null ? null : started.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.uid = uid == null ? null : uid.copy(); + dst.accession = accession == null ? null : accession.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + if (order != null) { + dst.order = new ArrayList(); + for (Reference i : order) + dst.order.add(i.copy()); + }; + if (modalityList != null) { + dst.modalityList = new ArrayList>(); + for (Enumeration i : modalityList) + dst.modalityList.add(i.copy()); + }; + dst.referrer = referrer == null ? null : referrer.copy(); + dst.availability = availability == null ? null : availability.copy(); + dst.url = url == null ? null : url.copy(); + dst.numberOfSeries = numberOfSeries == null ? null : numberOfSeries.copy(); + dst.numberOfInstances = numberOfInstances == null ? null : numberOfInstances.copy(); + dst.clinicalInformation = clinicalInformation == null ? null : clinicalInformation.copy(); + if (procedure != null) { + dst.procedure = new ArrayList(); + for (Coding i : procedure) + dst.procedure.add(i.copy()); + }; + dst.interpreter = interpreter == null ? null : interpreter.copy(); + dst.description = description == null ? null : description.copy(); + if (series != null) { + dst.series = new ArrayList(); + for (ImagingStudySeriesComponent i : series) + dst.series.add(i.copy()); + }; + return dst; + } + + protected ImagingStudy typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImagingStudy)) + return false; + ImagingStudy o = (ImagingStudy) other; + return compareDeep(started, o.started, true) && compareDeep(patient, o.patient, true) && compareDeep(uid, o.uid, true) + && compareDeep(accession, o.accession, true) && compareDeep(identifier, o.identifier, true) && compareDeep(order, o.order, true) + && compareDeep(modalityList, o.modalityList, true) && compareDeep(referrer, o.referrer, true) && compareDeep(availability, o.availability, true) + && compareDeep(url, o.url, true) && compareDeep(numberOfSeries, o.numberOfSeries, true) && compareDeep(numberOfInstances, o.numberOfInstances, true) + && compareDeep(clinicalInformation, o.clinicalInformation, true) && compareDeep(procedure, o.procedure, true) + && compareDeep(interpreter, o.interpreter, true) && compareDeep(description, o.description, true) + && compareDeep(series, o.series, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImagingStudy)) + return false; + ImagingStudy o = (ImagingStudy) other; + return compareValues(started, o.started, true) && compareValues(uid, o.uid, true) && compareValues(modalityList, o.modalityList, true) + && compareValues(availability, o.availability, true) && compareValues(url, o.url, true) && compareValues(numberOfSeries, o.numberOfSeries, true) + && compareValues(numberOfInstances, o.numberOfInstances, true) && compareValues(clinicalInformation, o.clinicalInformation, true) + && compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (started == null || started.isEmpty()) && (patient == null || patient.isEmpty()) + && (uid == null || uid.isEmpty()) && (accession == null || accession.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (order == null || order.isEmpty()) && (modalityList == null || modalityList.isEmpty()) + && (referrer == null || referrer.isEmpty()) && (availability == null || availability.isEmpty()) + && (url == null || url.isEmpty()) && (numberOfSeries == null || numberOfSeries.isEmpty()) + && (numberOfInstances == null || numberOfInstances.isEmpty()) && (clinicalInformation == null || clinicalInformation.isEmpty()) + && (procedure == null || procedure.isEmpty()) && (interpreter == null || interpreter.isEmpty()) + && (description == null || description.isEmpty()) && (series == null || series.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ImagingStudy; + } + + @SearchParamDefinition(name="uid", path="ImagingStudy.series.instance.uid", description="Formal identifier for this instance (0008,0018)", type="token" ) + public static final String SP_UID = "uid"; + @SearchParamDefinition(name="study", path="ImagingStudy.uid", description="The study id for the image", type="token" ) + public static final String SP_STUDY = "study"; + @SearchParamDefinition(name="dicom-class", path="ImagingStudy.series.instance.sopclass", description="DICOM class type (0008,0016)", type="token" ) + public static final String SP_DICOMCLASS = "dicom-class"; + @SearchParamDefinition(name="modality", path="ImagingStudy.series.modality", description="The modality of the image", type="token" ) + public static final String SP_MODALITY = "modality"; + @SearchParamDefinition(name="bodysite", path="ImagingStudy.series.bodySite", description="Body part examined (Map from 0018,0015)", type="token" ) + public static final String SP_BODYSITE = "bodysite"; + @SearchParamDefinition(name="patient", path="ImagingStudy.patient", description="Who the study is about", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="series", path="ImagingStudy.series.uid", description="The series id for the image", type="token" ) + public static final String SP_SERIES = "series"; + @SearchParamDefinition(name="started", path="ImagingStudy.started", description="When the study was started", type="date" ) + public static final String SP_STARTED = "started"; + @SearchParamDefinition(name="accession", path="ImagingStudy.accession", description="The accession id for the image", type="token" ) + public static final String SP_ACCESSION = "accession"; + @SearchParamDefinition(name="order", path="ImagingStudy.order", description="The order for the image", type="reference" ) + public static final String SP_ORDER = "order"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Immunization.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Immunization.java index 624f2f90f72..6a432da0e4b 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Immunization.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Immunization.java @@ -1,1955 +1,1934 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Immunization event information. - */ -@ResourceDef(name="Immunization", profile="http://hl7.org/fhir/Profile/Immunization") -public class Immunization extends DomainResource { - - @Block() - public static class ImmunizationExplanationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Reasons why a vaccine was administered. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Why immunization occurred", formalDefinition="Reasons why a vaccine was administered." ) - protected List reason; - - /** - * Reason why a vaccine was not administered. - */ - @Child(name = "reasonNotGiven", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Why immunization did not occur", formalDefinition="Reason why a vaccine was not administered." ) - protected List reasonNotGiven; - - private static final long serialVersionUID = -539821866L; - - /* - * Constructor - */ - public ImmunizationExplanationComponent() { - super(); - } - - /** - * @return {@link #reason} (Reasons why a vaccine was administered.) - */ - public List getReason() { - if (this.reason == null) - this.reason = new ArrayList(); - return this.reason; - } - - public boolean hasReason() { - if (this.reason == null) - return false; - for (CodeableConcept item : this.reason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reason} (Reasons why a vaccine was administered.) - */ - // syntactic sugar - public CodeableConcept addReason() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return t; - } - - // syntactic sugar - public ImmunizationExplanationComponent addReason(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return this; - } - - /** - * @return {@link #reasonNotGiven} (Reason why a vaccine was not administered.) - */ - public List getReasonNotGiven() { - if (this.reasonNotGiven == null) - this.reasonNotGiven = new ArrayList(); - return this.reasonNotGiven; - } - - public boolean hasReasonNotGiven() { - if (this.reasonNotGiven == null) - return false; - for (CodeableConcept item : this.reasonNotGiven) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reasonNotGiven} (Reason why a vaccine was not administered.) - */ - // syntactic sugar - public CodeableConcept addReasonNotGiven() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reasonNotGiven == null) - this.reasonNotGiven = new ArrayList(); - this.reasonNotGiven.add(t); - return t; - } - - // syntactic sugar - public ImmunizationExplanationComponent addReasonNotGiven(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reasonNotGiven == null) - this.reasonNotGiven = new ArrayList(); - this.reasonNotGiven.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("reason", "CodeableConcept", "Reasons why a vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("reasonNotGiven", "CodeableConcept", "Reason why a vaccine was not administered.", 0, java.lang.Integer.MAX_VALUE, reasonNotGiven)); - } - - public ImmunizationExplanationComponent copy() { - ImmunizationExplanationComponent dst = new ImmunizationExplanationComponent(); - copyValues(dst); - if (reason != null) { - dst.reason = new ArrayList(); - for (CodeableConcept i : reason) - dst.reason.add(i.copy()); - }; - if (reasonNotGiven != null) { - dst.reasonNotGiven = new ArrayList(); - for (CodeableConcept i : reasonNotGiven) - dst.reasonNotGiven.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImmunizationExplanationComponent)) - return false; - ImmunizationExplanationComponent o = (ImmunizationExplanationComponent) other; - return compareDeep(reason, o.reason, true) && compareDeep(reasonNotGiven, o.reasonNotGiven, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImmunizationExplanationComponent)) - return false; - ImmunizationExplanationComponent o = (ImmunizationExplanationComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (reason == null || reason.isEmpty()) && (reasonNotGiven == null || reasonNotGiven.isEmpty()) - ; - } - - } - - @Block() - public static class ImmunizationReactionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Date of reaction to the immunization. - */ - @Child(name = "date", type = {DateTimeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="When did reaction start?", formalDefinition="Date of reaction to the immunization." ) - protected DateTimeType date; - - /** - * Details of the reaction. - */ - @Child(name = "detail", type = {Observation.class}, order=2, min=0, max=1) - @Description(shortDefinition="Additional information on reaction", formalDefinition="Details of the reaction." ) - protected Reference detail; - - /** - * The actual object that is the target of the reference (Details of the reaction.) - */ - protected Observation detailTarget; - - /** - * Self-reported indicator. - */ - @Child(name = "reported", type = {BooleanType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Was reaction self-reported?", formalDefinition="Self-reported indicator." ) - protected BooleanType reported; - - private static final long serialVersionUID = -1297668556L; - - /* - * Constructor - */ - public ImmunizationReactionComponent() { - super(); - } - - /** - * @return {@link #date} (Date of reaction to the immunization.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationReactionComponent.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (Date of reaction to the immunization.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ImmunizationReactionComponent setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return Date of reaction to the immunization. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value Date of reaction to the immunization. - */ - public ImmunizationReactionComponent setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #detail} (Details of the reaction.) - */ - public Reference getDetail() { - if (this.detail == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationReactionComponent.detail"); - else if (Configuration.doAutoCreate()) - this.detail = new Reference(); // cc - return this.detail; - } - - public boolean hasDetail() { - return this.detail != null && !this.detail.isEmpty(); - } - - /** - * @param value {@link #detail} (Details of the reaction.) - */ - public ImmunizationReactionComponent setDetail(Reference value) { - this.detail = value; - return this; - } - - /** - * @return {@link #detail} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Details of the reaction.) - */ - public Observation getDetailTarget() { - if (this.detailTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationReactionComponent.detail"); - else if (Configuration.doAutoCreate()) - this.detailTarget = new Observation(); // aa - return this.detailTarget; - } - - /** - * @param value {@link #detail} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Details of the reaction.) - */ - public ImmunizationReactionComponent setDetailTarget(Observation value) { - this.detailTarget = value; - return this; - } - - /** - * @return {@link #reported} (Self-reported indicator.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value - */ - public BooleanType getReportedElement() { - if (this.reported == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationReactionComponent.reported"); - else if (Configuration.doAutoCreate()) - this.reported = new BooleanType(); // bb - return this.reported; - } - - public boolean hasReportedElement() { - return this.reported != null && !this.reported.isEmpty(); - } - - public boolean hasReported() { - return this.reported != null && !this.reported.isEmpty(); - } - - /** - * @param value {@link #reported} (Self-reported indicator.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value - */ - public ImmunizationReactionComponent setReportedElement(BooleanType value) { - this.reported = value; - return this; - } - - /** - * @return Self-reported indicator. - */ - public boolean getReported() { - return this.reported == null || this.reported.isEmpty() ? false : this.reported.getValue(); - } - - /** - * @param value Self-reported indicator. - */ - public ImmunizationReactionComponent setReported(boolean value) { - if (this.reported == null) - this.reported = new BooleanType(); - this.reported.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("date", "dateTime", "Date of reaction to the immunization.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("detail", "Reference(Observation)", "Details of the reaction.", 0, java.lang.Integer.MAX_VALUE, detail)); - childrenList.add(new Property("reported", "boolean", "Self-reported indicator.", 0, java.lang.Integer.MAX_VALUE, reported)); - } - - public ImmunizationReactionComponent copy() { - ImmunizationReactionComponent dst = new ImmunizationReactionComponent(); - copyValues(dst); - dst.date = date == null ? null : date.copy(); - dst.detail = detail == null ? null : detail.copy(); - dst.reported = reported == null ? null : reported.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImmunizationReactionComponent)) - return false; - ImmunizationReactionComponent o = (ImmunizationReactionComponent) other; - return compareDeep(date, o.date, true) && compareDeep(detail, o.detail, true) && compareDeep(reported, o.reported, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImmunizationReactionComponent)) - return false; - ImmunizationReactionComponent o = (ImmunizationReactionComponent) other; - return compareValues(date, o.date, true) && compareValues(reported, o.reported, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (date == null || date.isEmpty()) && (detail == null || detail.isEmpty()) - && (reported == null || reported.isEmpty()); - } - - } - - @Block() - public static class ImmunizationVaccinationProtocolComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Nominal position in a series. - */ - @Child(name = "doseSequence", type = {PositiveIntType.class}, order=1, min=1, max=1) - @Description(shortDefinition="What dose number within series?", formalDefinition="Nominal position in a series." ) - protected PositiveIntType doseSequence; - - /** - * Contains the description about the protocol under which the vaccine was administered. - */ - @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Details of vaccine protocol", formalDefinition="Contains the description about the protocol under which the vaccine was administered." ) - protected StringType description; - - /** - * Indicates the authority who published the protocol? E.g. ACIP. - */ - @Child(name = "authority", type = {Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Who is responsible for protocol", formalDefinition="Indicates the authority who published the protocol? E.g. ACIP." ) - protected Reference authority; - - /** - * The actual object that is the target of the reference (Indicates the authority who published the protocol? E.g. ACIP.) - */ - protected Organization authorityTarget; - - /** - * One possible path to achieve presumed immunity against a disease - within the context of an authority. - */ - @Child(name = "series", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Name of vaccine series", formalDefinition="One possible path to achieve presumed immunity against a disease - within the context of an authority." ) - protected StringType series; - - /** - * The recommended number of doses to achieve immunity. - */ - @Child(name = "seriesDoses", type = {PositiveIntType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Recommended number of doses for immunity", formalDefinition="The recommended number of doses to achieve immunity." ) - protected PositiveIntType seriesDoses; - - /** - * The targeted disease. - */ - @Child(name = "doseTarget", type = {CodeableConcept.class}, order=6, min=1, max=1) - @Description(shortDefinition="Disease immunized against", formalDefinition="The targeted disease." ) - protected CodeableConcept doseTarget; - - /** - * Indicates if the immunization event should "count" against the protocol. - */ - @Child(name = "doseStatus", type = {CodeableConcept.class}, order=7, min=1, max=1) - @Description(shortDefinition="Does dose count towards immunity?", formalDefinition="Indicates if the immunization event should 'count' against the protocol." ) - protected CodeableConcept doseStatus; - - /** - * Provides an explanation as to why a immunization event should or should not count against the protocol. - */ - @Child(name = "doseStatusReason", type = {CodeableConcept.class}, order=8, min=0, max=1) - @Description(shortDefinition="Why does does count/not count?", formalDefinition="Provides an explanation as to why a immunization event should or should not count against the protocol." ) - protected CodeableConcept doseStatusReason; - - private static final long serialVersionUID = -783437472L; - - /* - * Constructor - */ - public ImmunizationVaccinationProtocolComponent() { - super(); - } - - /* - * Constructor - */ - public ImmunizationVaccinationProtocolComponent(PositiveIntType doseSequence, CodeableConcept doseTarget, CodeableConcept doseStatus) { - super(); - this.doseSequence = doseSequence; - this.doseTarget = doseTarget; - this.doseStatus = doseStatus; - } - - /** - * @return {@link #doseSequence} (Nominal position in a series.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value - */ - public PositiveIntType getDoseSequenceElement() { - if (this.doseSequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseSequence"); - else if (Configuration.doAutoCreate()) - this.doseSequence = new PositiveIntType(); // bb - return this.doseSequence; - } - - public boolean hasDoseSequenceElement() { - return this.doseSequence != null && !this.doseSequence.isEmpty(); - } - - public boolean hasDoseSequence() { - return this.doseSequence != null && !this.doseSequence.isEmpty(); - } - - /** - * @param value {@link #doseSequence} (Nominal position in a series.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value - */ - public ImmunizationVaccinationProtocolComponent setDoseSequenceElement(PositiveIntType value) { - this.doseSequence = value; - return this; - } - - /** - * @return Nominal position in a series. - */ - public int getDoseSequence() { - return this.doseSequence == null || this.doseSequence.isEmpty() ? 0 : this.doseSequence.getValue(); - } - - /** - * @param value Nominal position in a series. - */ - public ImmunizationVaccinationProtocolComponent setDoseSequence(int value) { - if (this.doseSequence == null) - this.doseSequence = new PositiveIntType(); - this.doseSequence.setValue(value); - return this; - } - - /** - * @return {@link #description} (Contains the description about the protocol under which the vaccine was administered.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Contains the description about the protocol under which the vaccine was administered.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ImmunizationVaccinationProtocolComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Contains the description about the protocol under which the vaccine was administered. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Contains the description about the protocol under which the vaccine was administered. - */ - public ImmunizationVaccinationProtocolComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #authority} (Indicates the authority who published the protocol? E.g. ACIP.) - */ - public Reference getAuthority() { - if (this.authority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.authority"); - else if (Configuration.doAutoCreate()) - this.authority = new Reference(); // cc - return this.authority; - } - - public boolean hasAuthority() { - return this.authority != null && !this.authority.isEmpty(); - } - - /** - * @param value {@link #authority} (Indicates the authority who published the protocol? E.g. ACIP.) - */ - public ImmunizationVaccinationProtocolComponent setAuthority(Reference value) { - this.authority = value; - return this; - } - - /** - * @return {@link #authority} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates the authority who published the protocol? E.g. ACIP.) - */ - public Organization getAuthorityTarget() { - if (this.authorityTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.authority"); - else if (Configuration.doAutoCreate()) - this.authorityTarget = new Organization(); // aa - return this.authorityTarget; - } - - /** - * @param value {@link #authority} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates the authority who published the protocol? E.g. ACIP.) - */ - public ImmunizationVaccinationProtocolComponent setAuthorityTarget(Organization value) { - this.authorityTarget = value; - return this; - } - - /** - * @return {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value - */ - public StringType getSeriesElement() { - if (this.series == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.series"); - else if (Configuration.doAutoCreate()) - this.series = new StringType(); // bb - return this.series; - } - - public boolean hasSeriesElement() { - return this.series != null && !this.series.isEmpty(); - } - - public boolean hasSeries() { - return this.series != null && !this.series.isEmpty(); - } - - /** - * @param value {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value - */ - public ImmunizationVaccinationProtocolComponent setSeriesElement(StringType value) { - this.series = value; - return this; - } - - /** - * @return One possible path to achieve presumed immunity against a disease - within the context of an authority. - */ - public String getSeries() { - return this.series == null ? null : this.series.getValue(); - } - - /** - * @param value One possible path to achieve presumed immunity against a disease - within the context of an authority. - */ - public ImmunizationVaccinationProtocolComponent setSeries(String value) { - if (Utilities.noString(value)) - this.series = null; - else { - if (this.series == null) - this.series = new StringType(); - this.series.setValue(value); - } - return this; - } - - /** - * @return {@link #seriesDoses} (The recommended number of doses to achieve immunity.). This is the underlying object with id, value and extensions. The accessor "getSeriesDoses" gives direct access to the value - */ - public PositiveIntType getSeriesDosesElement() { - if (this.seriesDoses == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.seriesDoses"); - else if (Configuration.doAutoCreate()) - this.seriesDoses = new PositiveIntType(); // bb - return this.seriesDoses; - } - - public boolean hasSeriesDosesElement() { - return this.seriesDoses != null && !this.seriesDoses.isEmpty(); - } - - public boolean hasSeriesDoses() { - return this.seriesDoses != null && !this.seriesDoses.isEmpty(); - } - - /** - * @param value {@link #seriesDoses} (The recommended number of doses to achieve immunity.). This is the underlying object with id, value and extensions. The accessor "getSeriesDoses" gives direct access to the value - */ - public ImmunizationVaccinationProtocolComponent setSeriesDosesElement(PositiveIntType value) { - this.seriesDoses = value; - return this; - } - - /** - * @return The recommended number of doses to achieve immunity. - */ - public int getSeriesDoses() { - return this.seriesDoses == null || this.seriesDoses.isEmpty() ? 0 : this.seriesDoses.getValue(); - } - - /** - * @param value The recommended number of doses to achieve immunity. - */ - public ImmunizationVaccinationProtocolComponent setSeriesDoses(int value) { - if (this.seriesDoses == null) - this.seriesDoses = new PositiveIntType(); - this.seriesDoses.setValue(value); - return this; - } - - /** - * @return {@link #doseTarget} (The targeted disease.) - */ - public CodeableConcept getDoseTarget() { - if (this.doseTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseTarget"); - else if (Configuration.doAutoCreate()) - this.doseTarget = new CodeableConcept(); // cc - return this.doseTarget; - } - - public boolean hasDoseTarget() { - return this.doseTarget != null && !this.doseTarget.isEmpty(); - } - - /** - * @param value {@link #doseTarget} (The targeted disease.) - */ - public ImmunizationVaccinationProtocolComponent setDoseTarget(CodeableConcept value) { - this.doseTarget = value; - return this; - } - - /** - * @return {@link #doseStatus} (Indicates if the immunization event should "count" against the protocol.) - */ - public CodeableConcept getDoseStatus() { - if (this.doseStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseStatus"); - else if (Configuration.doAutoCreate()) - this.doseStatus = new CodeableConcept(); // cc - return this.doseStatus; - } - - public boolean hasDoseStatus() { - return this.doseStatus != null && !this.doseStatus.isEmpty(); - } - - /** - * @param value {@link #doseStatus} (Indicates if the immunization event should "count" against the protocol.) - */ - public ImmunizationVaccinationProtocolComponent setDoseStatus(CodeableConcept value) { - this.doseStatus = value; - return this; - } - - /** - * @return {@link #doseStatusReason} (Provides an explanation as to why a immunization event should or should not count against the protocol.) - */ - public CodeableConcept getDoseStatusReason() { - if (this.doseStatusReason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseStatusReason"); - else if (Configuration.doAutoCreate()) - this.doseStatusReason = new CodeableConcept(); // cc - return this.doseStatusReason; - } - - public boolean hasDoseStatusReason() { - return this.doseStatusReason != null && !this.doseStatusReason.isEmpty(); - } - - /** - * @param value {@link #doseStatusReason} (Provides an explanation as to why a immunization event should or should not count against the protocol.) - */ - public ImmunizationVaccinationProtocolComponent setDoseStatusReason(CodeableConcept value) { - this.doseStatusReason = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("doseSequence", "positiveInt", "Nominal position in a series.", 0, java.lang.Integer.MAX_VALUE, doseSequence)); - childrenList.add(new Property("description", "string", "Contains the description about the protocol under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("authority", "Reference(Organization)", "Indicates the authority who published the protocol? E.g. ACIP.", 0, java.lang.Integer.MAX_VALUE, authority)); - childrenList.add(new Property("series", "string", "One possible path to achieve presumed immunity against a disease - within the context of an authority.", 0, java.lang.Integer.MAX_VALUE, series)); - childrenList.add(new Property("seriesDoses", "positiveInt", "The recommended number of doses to achieve immunity.", 0, java.lang.Integer.MAX_VALUE, seriesDoses)); - childrenList.add(new Property("doseTarget", "CodeableConcept", "The targeted disease.", 0, java.lang.Integer.MAX_VALUE, doseTarget)); - childrenList.add(new Property("doseStatus", "CodeableConcept", "Indicates if the immunization event should 'count' against the protocol.", 0, java.lang.Integer.MAX_VALUE, doseStatus)); - childrenList.add(new Property("doseStatusReason", "CodeableConcept", "Provides an explanation as to why a immunization event should or should not count against the protocol.", 0, java.lang.Integer.MAX_VALUE, doseStatusReason)); - } - - public ImmunizationVaccinationProtocolComponent copy() { - ImmunizationVaccinationProtocolComponent dst = new ImmunizationVaccinationProtocolComponent(); - copyValues(dst); - dst.doseSequence = doseSequence == null ? null : doseSequence.copy(); - dst.description = description == null ? null : description.copy(); - dst.authority = authority == null ? null : authority.copy(); - dst.series = series == null ? null : series.copy(); - dst.seriesDoses = seriesDoses == null ? null : seriesDoses.copy(); - dst.doseTarget = doseTarget == null ? null : doseTarget.copy(); - dst.doseStatus = doseStatus == null ? null : doseStatus.copy(); - dst.doseStatusReason = doseStatusReason == null ? null : doseStatusReason.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImmunizationVaccinationProtocolComponent)) - return false; - ImmunizationVaccinationProtocolComponent o = (ImmunizationVaccinationProtocolComponent) other; - return compareDeep(doseSequence, o.doseSequence, true) && compareDeep(description, o.description, true) - && compareDeep(authority, o.authority, true) && compareDeep(series, o.series, true) && compareDeep(seriesDoses, o.seriesDoses, true) - && compareDeep(doseTarget, o.doseTarget, true) && compareDeep(doseStatus, o.doseStatus, true) && compareDeep(doseStatusReason, o.doseStatusReason, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImmunizationVaccinationProtocolComponent)) - return false; - ImmunizationVaccinationProtocolComponent o = (ImmunizationVaccinationProtocolComponent) other; - return compareValues(doseSequence, o.doseSequence, true) && compareValues(description, o.description, true) - && compareValues(series, o.series, true) && compareValues(seriesDoses, o.seriesDoses, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (doseSequence == null || doseSequence.isEmpty()) && (description == null || description.isEmpty()) - && (authority == null || authority.isEmpty()) && (series == null || series.isEmpty()) && (seriesDoses == null || seriesDoses.isEmpty()) - && (doseTarget == null || doseTarget.isEmpty()) && (doseStatus == null || doseStatus.isEmpty()) - && (doseStatusReason == null || doseStatusReason.isEmpty()); - } - - } - - /** - * A unique identifier assigned to this immunization record. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business identifier", formalDefinition="A unique identifier assigned to this immunization record." ) - protected List identifier; - - /** - * Date vaccine administered or was to be administered. - */ - @Child(name = "date", type = {DateTimeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Vaccination administration date", formalDefinition="Date vaccine administered or was to be administered." ) - protected DateTimeType date; - - /** - * Vaccine that was administered or was to be administered. - */ - @Child(name = "vaccineType", type = {CodeableConcept.class}, order=2, min=1, max=1) - @Description(shortDefinition="Vaccine product administered", formalDefinition="Vaccine that was administered or was to be administered." ) - protected CodeableConcept vaccineType; - - /** - * The patient who either received or did not receive the immunization. - */ - @Child(name = "patient", type = {Patient.class}, order=3, min=1, max=1) - @Description(shortDefinition="Who was immunized?", formalDefinition="The patient who either received or did not receive the immunization." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient who either received or did not receive the immunization.) - */ - protected Patient patientTarget; - - /** - * Indicates if the vaccination was or was not given. - */ - @Child(name = "wasNotGiven", type = {BooleanType.class}, order=4, min=1, max=1) - @Description(shortDefinition="Was immunization given?", formalDefinition="Indicates if the vaccination was or was not given." ) - protected BooleanType wasNotGiven; - - /** - * True if this administration was reported rather than directly administered. - */ - @Child(name = "reported", type = {BooleanType.class}, order=5, min=1, max=1) - @Description(shortDefinition="Is this a self-reported record?", formalDefinition="True if this administration was reported rather than directly administered." ) - protected BooleanType reported; - - /** - * Clinician who administered the vaccine. - */ - @Child(name = "performer", type = {Practitioner.class}, order=6, min=0, max=1) - @Description(shortDefinition="Who administered vaccine?", formalDefinition="Clinician who administered the vaccine." ) - protected Reference performer; - - /** - * The actual object that is the target of the reference (Clinician who administered the vaccine.) - */ - protected Practitioner performerTarget; - - /** - * Clinician who ordered the vaccination. - */ - @Child(name = "requester", type = {Practitioner.class}, order=7, min=0, max=1) - @Description(shortDefinition="Who ordered vaccination?", formalDefinition="Clinician who ordered the vaccination." ) - protected Reference requester; - - /** - * The actual object that is the target of the reference (Clinician who ordered the vaccination.) - */ - protected Practitioner requesterTarget; - - /** - * The visit or admission or other contact between patient and health care provider the immunization was performed as part of. - */ - @Child(name = "encounter", type = {Encounter.class}, order=8, min=0, max=1) - @Description(shortDefinition="Encounter administered as part of", formalDefinition="The visit or admission or other contact between patient and health care provider the immunization was performed as part of." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.) - */ - protected Encounter encounterTarget; - - /** - * Name of vaccine manufacturer. - */ - @Child(name = "manufacturer", type = {Organization.class}, order=9, min=0, max=1) - @Description(shortDefinition="Vaccine manufacturer", formalDefinition="Name of vaccine manufacturer." ) - protected Reference manufacturer; - - /** - * The actual object that is the target of the reference (Name of vaccine manufacturer.) - */ - protected Organization manufacturerTarget; - - /** - * The service delivery location where the vaccine administration occurred. - */ - @Child(name = "location", type = {Location.class}, order=10, min=0, max=1) - @Description(shortDefinition="Where did vaccination occur?", formalDefinition="The service delivery location where the vaccine administration occurred." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (The service delivery location where the vaccine administration occurred.) - */ - protected Location locationTarget; - - /** - * Lot number of the vaccine product. - */ - @Child(name = "lotNumber", type = {StringType.class}, order=11, min=0, max=1) - @Description(shortDefinition="Vaccine lot number", formalDefinition="Lot number of the vaccine product." ) - protected StringType lotNumber; - - /** - * Date vaccine batch expires. - */ - @Child(name = "expirationDate", type = {DateType.class}, order=12, min=0, max=1) - @Description(shortDefinition="Vaccine expiration date", formalDefinition="Date vaccine batch expires." ) - protected DateType expirationDate; - - /** - * Body site where vaccine was administered. - */ - @Child(name = "site", type = {CodeableConcept.class}, order=13, min=0, max=1) - @Description(shortDefinition="Body site vaccine was administered", formalDefinition="Body site where vaccine was administered." ) - protected CodeableConcept site; - - /** - * The path by which the vaccine product is taken into the body. - */ - @Child(name = "route", type = {CodeableConcept.class}, order=14, min=0, max=1) - @Description(shortDefinition="How vaccine entered body", formalDefinition="The path by which the vaccine product is taken into the body." ) - protected CodeableConcept route; - - /** - * The quantity of vaccine product that was administered. - */ - @Child(name = "doseQuantity", type = {Quantity.class}, order=15, min=0, max=1) - @Description(shortDefinition="Amount of vaccine administered", formalDefinition="The quantity of vaccine product that was administered." ) - protected Quantity doseQuantity; - - /** - * Reasons why a vaccine was or was not administered. - */ - @Child(name = "explanation", type = {}, order=16, min=0, max=1) - @Description(shortDefinition="Administration / non-administration reasons", formalDefinition="Reasons why a vaccine was or was not administered." ) - protected ImmunizationExplanationComponent explanation; - - /** - * Categorical data indicating that an adverse event is associated in time to an immunization. - */ - @Child(name = "reaction", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Details of a reaction that follows immunization", formalDefinition="Categorical data indicating that an adverse event is associated in time to an immunization." ) - protected List reaction; - - /** - * Contains information about the protocol(s) under which the vaccine was administered. - */ - @Child(name = "vaccinationProtocol", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="What protocol was followed", formalDefinition="Contains information about the protocol(s) under which the vaccine was administered." ) - protected List vaccinationProtocol; - - private static final long serialVersionUID = -1610924217L; - - /* - * Constructor - */ - public Immunization() { - super(); - } - - /* - * Constructor - */ - public Immunization(DateTimeType date, CodeableConcept vaccineType, Reference patient, BooleanType wasNotGiven, BooleanType reported) { - super(); - this.date = date; - this.vaccineType = vaccineType; - this.patient = patient; - this.wasNotGiven = wasNotGiven; - this.reported = reported; - } - - /** - * @return {@link #identifier} (A unique identifier assigned to this immunization record.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (A unique identifier assigned to this immunization record.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Immunization addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #date} (Date vaccine administered or was to be administered.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (Date vaccine administered or was to be administered.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public Immunization setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return Date vaccine administered or was to be administered. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value Date vaccine administered or was to be administered. - */ - public Immunization setDate(Date value) { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - return this; - } - - /** - * @return {@link #vaccineType} (Vaccine that was administered or was to be administered.) - */ - public CodeableConcept getVaccineType() { - if (this.vaccineType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.vaccineType"); - else if (Configuration.doAutoCreate()) - this.vaccineType = new CodeableConcept(); // cc - return this.vaccineType; - } - - public boolean hasVaccineType() { - return this.vaccineType != null && !this.vaccineType.isEmpty(); - } - - /** - * @param value {@link #vaccineType} (Vaccine that was administered or was to be administered.) - */ - public Immunization setVaccineType(CodeableConcept value) { - this.vaccineType = value; - return this; - } - - /** - * @return {@link #patient} (The patient who either received or did not receive the immunization.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The patient who either received or did not receive the immunization.) - */ - public Immunization setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who either received or did not receive the immunization.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who either received or did not receive the immunization.) - */ - public Immunization setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #wasNotGiven} (Indicates if the vaccination was or was not given.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value - */ - public BooleanType getWasNotGivenElement() { - if (this.wasNotGiven == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.wasNotGiven"); - else if (Configuration.doAutoCreate()) - this.wasNotGiven = new BooleanType(); // bb - return this.wasNotGiven; - } - - public boolean hasWasNotGivenElement() { - return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); - } - - public boolean hasWasNotGiven() { - return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); - } - - /** - * @param value {@link #wasNotGiven} (Indicates if the vaccination was or was not given.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value - */ - public Immunization setWasNotGivenElement(BooleanType value) { - this.wasNotGiven = value; - return this; - } - - /** - * @return Indicates if the vaccination was or was not given. - */ - public boolean getWasNotGiven() { - return this.wasNotGiven == null || this.wasNotGiven.isEmpty() ? false : this.wasNotGiven.getValue(); - } - - /** - * @param value Indicates if the vaccination was or was not given. - */ - public Immunization setWasNotGiven(boolean value) { - if (this.wasNotGiven == null) - this.wasNotGiven = new BooleanType(); - this.wasNotGiven.setValue(value); - return this; - } - - /** - * @return {@link #reported} (True if this administration was reported rather than directly administered.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value - */ - public BooleanType getReportedElement() { - if (this.reported == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.reported"); - else if (Configuration.doAutoCreate()) - this.reported = new BooleanType(); // bb - return this.reported; - } - - public boolean hasReportedElement() { - return this.reported != null && !this.reported.isEmpty(); - } - - public boolean hasReported() { - return this.reported != null && !this.reported.isEmpty(); - } - - /** - * @param value {@link #reported} (True if this administration was reported rather than directly administered.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value - */ - public Immunization setReportedElement(BooleanType value) { - this.reported = value; - return this; - } - - /** - * @return True if this administration was reported rather than directly administered. - */ - public boolean getReported() { - return this.reported == null || this.reported.isEmpty() ? false : this.reported.getValue(); - } - - /** - * @param value True if this administration was reported rather than directly administered. - */ - public Immunization setReported(boolean value) { - if (this.reported == null) - this.reported = new BooleanType(); - this.reported.setValue(value); - return this; - } - - /** - * @return {@link #performer} (Clinician who administered the vaccine.) - */ - public Reference getPerformer() { - if (this.performer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.performer"); - else if (Configuration.doAutoCreate()) - this.performer = new Reference(); // cc - return this.performer; - } - - public boolean hasPerformer() { - return this.performer != null && !this.performer.isEmpty(); - } - - /** - * @param value {@link #performer} (Clinician who administered the vaccine.) - */ - public Immunization setPerformer(Reference value) { - this.performer = value; - return this; - } - - /** - * @return {@link #performer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Clinician who administered the vaccine.) - */ - public Practitioner getPerformerTarget() { - if (this.performerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.performer"); - else if (Configuration.doAutoCreate()) - this.performerTarget = new Practitioner(); // aa - return this.performerTarget; - } - - /** - * @param value {@link #performer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Clinician who administered the vaccine.) - */ - public Immunization setPerformerTarget(Practitioner value) { - this.performerTarget = value; - return this; - } - - /** - * @return {@link #requester} (Clinician who ordered the vaccination.) - */ - public Reference getRequester() { - if (this.requester == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.requester"); - else if (Configuration.doAutoCreate()) - this.requester = new Reference(); // cc - return this.requester; - } - - public boolean hasRequester() { - return this.requester != null && !this.requester.isEmpty(); - } - - /** - * @param value {@link #requester} (Clinician who ordered the vaccination.) - */ - public Immunization setRequester(Reference value) { - this.requester = value; - return this; - } - - /** - * @return {@link #requester} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Clinician who ordered the vaccination.) - */ - public Practitioner getRequesterTarget() { - if (this.requesterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.requester"); - else if (Configuration.doAutoCreate()) - this.requesterTarget = new Practitioner(); // aa - return this.requesterTarget; - } - - /** - * @param value {@link #requester} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Clinician who ordered the vaccination.) - */ - public Immunization setRequesterTarget(Practitioner value) { - this.requesterTarget = value; - return this; - } - - /** - * @return {@link #encounter} (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.) - */ - public Immunization setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.) - */ - public Immunization setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #manufacturer} (Name of vaccine manufacturer.) - */ - public Reference getManufacturer() { - if (this.manufacturer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.manufacturer"); - else if (Configuration.doAutoCreate()) - this.manufacturer = new Reference(); // cc - return this.manufacturer; - } - - public boolean hasManufacturer() { - return this.manufacturer != null && !this.manufacturer.isEmpty(); - } - - /** - * @param value {@link #manufacturer} (Name of vaccine manufacturer.) - */ - public Immunization setManufacturer(Reference value) { - this.manufacturer = value; - return this; - } - - /** - * @return {@link #manufacturer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Name of vaccine manufacturer.) - */ - public Organization getManufacturerTarget() { - if (this.manufacturerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.manufacturer"); - else if (Configuration.doAutoCreate()) - this.manufacturerTarget = new Organization(); // aa - return this.manufacturerTarget; - } - - /** - * @param value {@link #manufacturer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Name of vaccine manufacturer.) - */ - public Immunization setManufacturerTarget(Organization value) { - this.manufacturerTarget = value; - return this; - } - - /** - * @return {@link #location} (The service delivery location where the vaccine administration occurred.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); // cc - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (The service delivery location where the vaccine administration occurred.) - */ - public Immunization setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The service delivery location where the vaccine administration occurred.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); // aa - return this.locationTarget; - } - - /** - * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The service delivery location where the vaccine administration occurred.) - */ - public Immunization setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #lotNumber} (Lot number of the vaccine product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value - */ - public StringType getLotNumberElement() { - if (this.lotNumber == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.lotNumber"); - else if (Configuration.doAutoCreate()) - this.lotNumber = new StringType(); // bb - return this.lotNumber; - } - - public boolean hasLotNumberElement() { - return this.lotNumber != null && !this.lotNumber.isEmpty(); - } - - public boolean hasLotNumber() { - return this.lotNumber != null && !this.lotNumber.isEmpty(); - } - - /** - * @param value {@link #lotNumber} (Lot number of the vaccine product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value - */ - public Immunization setLotNumberElement(StringType value) { - this.lotNumber = value; - return this; - } - - /** - * @return Lot number of the vaccine product. - */ - public String getLotNumber() { - return this.lotNumber == null ? null : this.lotNumber.getValue(); - } - - /** - * @param value Lot number of the vaccine product. - */ - public Immunization setLotNumber(String value) { - if (Utilities.noString(value)) - this.lotNumber = null; - else { - if (this.lotNumber == null) - this.lotNumber = new StringType(); - this.lotNumber.setValue(value); - } - return this; - } - - /** - * @return {@link #expirationDate} (Date vaccine batch expires.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value - */ - public DateType getExpirationDateElement() { - if (this.expirationDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.expirationDate"); - else if (Configuration.doAutoCreate()) - this.expirationDate = new DateType(); // bb - return this.expirationDate; - } - - public boolean hasExpirationDateElement() { - return this.expirationDate != null && !this.expirationDate.isEmpty(); - } - - public boolean hasExpirationDate() { - return this.expirationDate != null && !this.expirationDate.isEmpty(); - } - - /** - * @param value {@link #expirationDate} (Date vaccine batch expires.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value - */ - public Immunization setExpirationDateElement(DateType value) { - this.expirationDate = value; - return this; - } - - /** - * @return Date vaccine batch expires. - */ - public Date getExpirationDate() { - return this.expirationDate == null ? null : this.expirationDate.getValue(); - } - - /** - * @param value Date vaccine batch expires. - */ - public Immunization setExpirationDate(Date value) { - if (value == null) - this.expirationDate = null; - else { - if (this.expirationDate == null) - this.expirationDate = new DateType(); - this.expirationDate.setValue(value); - } - return this; - } - - /** - * @return {@link #site} (Body site where vaccine was administered.) - */ - public CodeableConcept getSite() { - if (this.site == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.site"); - else if (Configuration.doAutoCreate()) - this.site = new CodeableConcept(); // cc - return this.site; - } - - public boolean hasSite() { - return this.site != null && !this.site.isEmpty(); - } - - /** - * @param value {@link #site} (Body site where vaccine was administered.) - */ - public Immunization setSite(CodeableConcept value) { - this.site = value; - return this; - } - - /** - * @return {@link #route} (The path by which the vaccine product is taken into the body.) - */ - public CodeableConcept getRoute() { - if (this.route == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.route"); - else if (Configuration.doAutoCreate()) - this.route = new CodeableConcept(); // cc - return this.route; - } - - public boolean hasRoute() { - return this.route != null && !this.route.isEmpty(); - } - - /** - * @param value {@link #route} (The path by which the vaccine product is taken into the body.) - */ - public Immunization setRoute(CodeableConcept value) { - this.route = value; - return this; - } - - /** - * @return {@link #doseQuantity} (The quantity of vaccine product that was administered.) - */ - public Quantity getDoseQuantity() { - if (this.doseQuantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.doseQuantity"); - else if (Configuration.doAutoCreate()) - this.doseQuantity = new Quantity(); // cc - return this.doseQuantity; - } - - public boolean hasDoseQuantity() { - return this.doseQuantity != null && !this.doseQuantity.isEmpty(); - } - - /** - * @param value {@link #doseQuantity} (The quantity of vaccine product that was administered.) - */ - public Immunization setDoseQuantity(Quantity value) { - this.doseQuantity = value; - return this; - } - - /** - * @return {@link #explanation} (Reasons why a vaccine was or was not administered.) - */ - public ImmunizationExplanationComponent getExplanation() { - if (this.explanation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.explanation"); - else if (Configuration.doAutoCreate()) - this.explanation = new ImmunizationExplanationComponent(); // cc - return this.explanation; - } - - public boolean hasExplanation() { - return this.explanation != null && !this.explanation.isEmpty(); - } - - /** - * @param value {@link #explanation} (Reasons why a vaccine was or was not administered.) - */ - public Immunization setExplanation(ImmunizationExplanationComponent value) { - this.explanation = value; - return this; - } - - /** - * @return {@link #reaction} (Categorical data indicating that an adverse event is associated in time to an immunization.) - */ - public List getReaction() { - if (this.reaction == null) - this.reaction = new ArrayList(); - return this.reaction; - } - - public boolean hasReaction() { - if (this.reaction == null) - return false; - for (ImmunizationReactionComponent item : this.reaction) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reaction} (Categorical data indicating that an adverse event is associated in time to an immunization.) - */ - // syntactic sugar - public ImmunizationReactionComponent addReaction() { //3 - ImmunizationReactionComponent t = new ImmunizationReactionComponent(); - if (this.reaction == null) - this.reaction = new ArrayList(); - this.reaction.add(t); - return t; - } - - // syntactic sugar - public Immunization addReaction(ImmunizationReactionComponent t) { //3 - if (t == null) - return this; - if (this.reaction == null) - this.reaction = new ArrayList(); - this.reaction.add(t); - return this; - } - - /** - * @return {@link #vaccinationProtocol} (Contains information about the protocol(s) under which the vaccine was administered.) - */ - public List getVaccinationProtocol() { - if (this.vaccinationProtocol == null) - this.vaccinationProtocol = new ArrayList(); - return this.vaccinationProtocol; - } - - public boolean hasVaccinationProtocol() { - if (this.vaccinationProtocol == null) - return false; - for (ImmunizationVaccinationProtocolComponent item : this.vaccinationProtocol) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #vaccinationProtocol} (Contains information about the protocol(s) under which the vaccine was administered.) - */ - // syntactic sugar - public ImmunizationVaccinationProtocolComponent addVaccinationProtocol() { //3 - ImmunizationVaccinationProtocolComponent t = new ImmunizationVaccinationProtocolComponent(); - if (this.vaccinationProtocol == null) - this.vaccinationProtocol = new ArrayList(); - this.vaccinationProtocol.add(t); - return t; - } - - // syntactic sugar - public Immunization addVaccinationProtocol(ImmunizationVaccinationProtocolComponent t) { //3 - if (t == null) - return this; - if (this.vaccinationProtocol == null) - this.vaccinationProtocol = new ArrayList(); - this.vaccinationProtocol.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "A unique identifier assigned to this immunization record.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("date", "dateTime", "Date vaccine administered or was to be administered.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("vaccineType", "CodeableConcept", "Vaccine that was administered or was to be administered.", 0, java.lang.Integer.MAX_VALUE, vaccineType)); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient who either received or did not receive the immunization.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("wasNotGiven", "boolean", "Indicates if the vaccination was or was not given.", 0, java.lang.Integer.MAX_VALUE, wasNotGiven)); - childrenList.add(new Property("reported", "boolean", "True if this administration was reported rather than directly administered.", 0, java.lang.Integer.MAX_VALUE, reported)); - childrenList.add(new Property("performer", "Reference(Practitioner)", "Clinician who administered the vaccine.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("requester", "Reference(Practitioner)", "Clinician who ordered the vaccination.", 0, java.lang.Integer.MAX_VALUE, requester)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The visit or admission or other contact between patient and health care provider the immunization was performed as part of.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("manufacturer", "Reference(Organization)", "Name of vaccine manufacturer.", 0, java.lang.Integer.MAX_VALUE, manufacturer)); - childrenList.add(new Property("location", "Reference(Location)", "The service delivery location where the vaccine administration occurred.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("lotNumber", "string", "Lot number of the vaccine product.", 0, java.lang.Integer.MAX_VALUE, lotNumber)); - childrenList.add(new Property("expirationDate", "date", "Date vaccine batch expires.", 0, java.lang.Integer.MAX_VALUE, expirationDate)); - childrenList.add(new Property("site", "CodeableConcept", "Body site where vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, site)); - childrenList.add(new Property("route", "CodeableConcept", "The path by which the vaccine product is taken into the body.", 0, java.lang.Integer.MAX_VALUE, route)); - childrenList.add(new Property("doseQuantity", "Quantity", "The quantity of vaccine product that was administered.", 0, java.lang.Integer.MAX_VALUE, doseQuantity)); - childrenList.add(new Property("explanation", "", "Reasons why a vaccine was or was not administered.", 0, java.lang.Integer.MAX_VALUE, explanation)); - childrenList.add(new Property("reaction", "", "Categorical data indicating that an adverse event is associated in time to an immunization.", 0, java.lang.Integer.MAX_VALUE, reaction)); - childrenList.add(new Property("vaccinationProtocol", "", "Contains information about the protocol(s) under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, vaccinationProtocol)); - } - - public Immunization copy() { - Immunization dst = new Immunization(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.date = date == null ? null : date.copy(); - dst.vaccineType = vaccineType == null ? null : vaccineType.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.wasNotGiven = wasNotGiven == null ? null : wasNotGiven.copy(); - dst.reported = reported == null ? null : reported.copy(); - dst.performer = performer == null ? null : performer.copy(); - dst.requester = requester == null ? null : requester.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.manufacturer = manufacturer == null ? null : manufacturer.copy(); - dst.location = location == null ? null : location.copy(); - dst.lotNumber = lotNumber == null ? null : lotNumber.copy(); - dst.expirationDate = expirationDate == null ? null : expirationDate.copy(); - dst.site = site == null ? null : site.copy(); - dst.route = route == null ? null : route.copy(); - dst.doseQuantity = doseQuantity == null ? null : doseQuantity.copy(); - dst.explanation = explanation == null ? null : explanation.copy(); - if (reaction != null) { - dst.reaction = new ArrayList(); - for (ImmunizationReactionComponent i : reaction) - dst.reaction.add(i.copy()); - }; - if (vaccinationProtocol != null) { - dst.vaccinationProtocol = new ArrayList(); - for (ImmunizationVaccinationProtocolComponent i : vaccinationProtocol) - dst.vaccinationProtocol.add(i.copy()); - }; - return dst; - } - - protected Immunization typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Immunization)) - return false; - Immunization o = (Immunization) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(date, o.date, true) && compareDeep(vaccineType, o.vaccineType, true) - && compareDeep(patient, o.patient, true) && compareDeep(wasNotGiven, o.wasNotGiven, true) && compareDeep(reported, o.reported, true) - && compareDeep(performer, o.performer, true) && compareDeep(requester, o.requester, true) && compareDeep(encounter, o.encounter, true) - && compareDeep(manufacturer, o.manufacturer, true) && compareDeep(location, o.location, true) && compareDeep(lotNumber, o.lotNumber, true) - && compareDeep(expirationDate, o.expirationDate, true) && compareDeep(site, o.site, true) && compareDeep(route, o.route, true) - && compareDeep(doseQuantity, o.doseQuantity, true) && compareDeep(explanation, o.explanation, true) - && compareDeep(reaction, o.reaction, true) && compareDeep(vaccinationProtocol, o.vaccinationProtocol, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Immunization)) - return false; - Immunization o = (Immunization) other; - return compareValues(date, o.date, true) && compareValues(wasNotGiven, o.wasNotGiven, true) && compareValues(reported, o.reported, true) - && compareValues(lotNumber, o.lotNumber, true) && compareValues(expirationDate, o.expirationDate, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (date == null || date.isEmpty()) - && (vaccineType == null || vaccineType.isEmpty()) && (patient == null || patient.isEmpty()) - && (wasNotGiven == null || wasNotGiven.isEmpty()) && (reported == null || reported.isEmpty()) - && (performer == null || performer.isEmpty()) && (requester == null || requester.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (manufacturer == null || manufacturer.isEmpty()) - && (location == null || location.isEmpty()) && (lotNumber == null || lotNumber.isEmpty()) - && (expirationDate == null || expirationDate.isEmpty()) && (site == null || site.isEmpty()) - && (route == null || route.isEmpty()) && (doseQuantity == null || doseQuantity.isEmpty()) - && (explanation == null || explanation.isEmpty()) && (reaction == null || reaction.isEmpty()) - && (vaccinationProtocol == null || vaccinationProtocol.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Immunization; - } - - @SearchParamDefinition(name="reaction", path="Immunization.reaction.detail", description="Additional information on reaction", type="reference" ) - public static final String SP_REACTION = "reaction"; - @SearchParamDefinition(name="requester", path="Immunization.requester", description="The practitioner who ordered the vaccination", type="reference" ) - public static final String SP_REQUESTER = "requester"; - @SearchParamDefinition(name="dose-sequence", path="Immunization.vaccinationProtocol.doseSequence", description="What dose number within series?", type="number" ) - public static final String SP_DOSESEQUENCE = "dose-sequence"; - @SearchParamDefinition(name="vaccine-type", path="Immunization.vaccineType", description="Vaccine Product Type Administered", type="token" ) - public static final String SP_VACCINETYPE = "vaccine-type"; - @SearchParamDefinition(name="location", path="Immunization.location", description="The service delivery location or facility in which the vaccine was / was to be administered", type="reference" ) - public static final String SP_LOCATION = "location"; - @SearchParamDefinition(name="reason", path="Immunization.explanation.reason", description="Why immunization occurred", type="token" ) - public static final String SP_REASON = "reason"; - @SearchParamDefinition(name="subject", path="Immunization.patient", description="The patient for the vaccination record", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="reaction-date", path="Immunization.reaction.date", description="When did reaction start?", type="date" ) - public static final String SP_REACTIONDATE = "reaction-date"; - @SearchParamDefinition(name="notgiven", path="Immunization.wasNotGiven", description="Administrations which were not given", type="token" ) - public static final String SP_NOTGIVEN = "notgiven"; - @SearchParamDefinition(name="date", path="Immunization.date", description="Vaccination (non)-Administration Date", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="reason-not-given", path="Immunization.explanation.reasonNotGiven", description="Explanation of reason vaccination was not administered", type="token" ) - public static final String SP_REASONNOTGIVEN = "reason-not-given"; - @SearchParamDefinition(name="patient", path="Immunization.patient", description="The patient for the vaccination record", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="lot-number", path="Immunization.lotNumber", description="Vaccine Lot Number", type="string" ) - public static final String SP_LOTNUMBER = "lot-number"; - @SearchParamDefinition(name="manufacturer", path="Immunization.manufacturer", description="Vaccine Manufacturer", type="reference" ) - public static final String SP_MANUFACTURER = "manufacturer"; - @SearchParamDefinition(name="performer", path="Immunization.performer", description="The practitioner who administered the vaccination", type="reference" ) - public static final String SP_PERFORMER = "performer"; - @SearchParamDefinition(name="identifier", path="Immunization.identifier", description="Business identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Immunization event information. + */ +@ResourceDef(name="Immunization", profile="http://hl7.org/fhir/Profile/Immunization") +public class Immunization extends DomainResource { + + @Block() + public static class ImmunizationExplanationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Reasons why a vaccine was administered. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Why immunization occurred", formalDefinition="Reasons why a vaccine was administered." ) + protected List reason; + + /** + * Reason why a vaccine was not administered. + */ + @Child(name = "reasonNotGiven", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Why immunization did not occur", formalDefinition="Reason why a vaccine was not administered." ) + protected List reasonNotGiven; + + private static final long serialVersionUID = -539821866L; + + /* + * Constructor + */ + public ImmunizationExplanationComponent() { + super(); + } + + /** + * @return {@link #reason} (Reasons why a vaccine was administered.) + */ + public List getReason() { + if (this.reason == null) + this.reason = new ArrayList(); + return this.reason; + } + + public boolean hasReason() { + if (this.reason == null) + return false; + for (CodeableConcept item : this.reason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reason} (Reasons why a vaccine was administered.) + */ + // syntactic sugar + public CodeableConcept addReason() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return t; + } + + // syntactic sugar + public ImmunizationExplanationComponent addReason(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return this; + } + + /** + * @return {@link #reasonNotGiven} (Reason why a vaccine was not administered.) + */ + public List getReasonNotGiven() { + if (this.reasonNotGiven == null) + this.reasonNotGiven = new ArrayList(); + return this.reasonNotGiven; + } + + public boolean hasReasonNotGiven() { + if (this.reasonNotGiven == null) + return false; + for (CodeableConcept item : this.reasonNotGiven) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reasonNotGiven} (Reason why a vaccine was not administered.) + */ + // syntactic sugar + public CodeableConcept addReasonNotGiven() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reasonNotGiven == null) + this.reasonNotGiven = new ArrayList(); + this.reasonNotGiven.add(t); + return t; + } + + // syntactic sugar + public ImmunizationExplanationComponent addReasonNotGiven(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reasonNotGiven == null) + this.reasonNotGiven = new ArrayList(); + this.reasonNotGiven.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("reason", "CodeableConcept", "Reasons why a vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("reasonNotGiven", "CodeableConcept", "Reason why a vaccine was not administered.", 0, java.lang.Integer.MAX_VALUE, reasonNotGiven)); + } + + public ImmunizationExplanationComponent copy() { + ImmunizationExplanationComponent dst = new ImmunizationExplanationComponent(); + copyValues(dst); + if (reason != null) { + dst.reason = new ArrayList(); + for (CodeableConcept i : reason) + dst.reason.add(i.copy()); + }; + if (reasonNotGiven != null) { + dst.reasonNotGiven = new ArrayList(); + for (CodeableConcept i : reasonNotGiven) + dst.reasonNotGiven.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImmunizationExplanationComponent)) + return false; + ImmunizationExplanationComponent o = (ImmunizationExplanationComponent) other; + return compareDeep(reason, o.reason, true) && compareDeep(reasonNotGiven, o.reasonNotGiven, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImmunizationExplanationComponent)) + return false; + ImmunizationExplanationComponent o = (ImmunizationExplanationComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (reason == null || reason.isEmpty()) && (reasonNotGiven == null || reasonNotGiven.isEmpty()) + ; + } + + } + + @Block() + public static class ImmunizationReactionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Date of reaction to the immunization. + */ + @Child(name = "date", type = {DateTimeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="When did reaction start?", formalDefinition="Date of reaction to the immunization." ) + protected DateTimeType date; + + /** + * Details of the reaction. + */ + @Child(name = "detail", type = {Observation.class}, order=2, min=0, max=1) + @Description(shortDefinition="Additional information on reaction", formalDefinition="Details of the reaction." ) + protected Reference detail; + + /** + * The actual object that is the target of the reference (Details of the reaction.) + */ + protected Observation detailTarget; + + /** + * Self-reported indicator. + */ + @Child(name = "reported", type = {BooleanType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Was reaction self-reported?", formalDefinition="Self-reported indicator." ) + protected BooleanType reported; + + private static final long serialVersionUID = -1297668556L; + + /* + * Constructor + */ + public ImmunizationReactionComponent() { + super(); + } + + /** + * @return {@link #date} (Date of reaction to the immunization.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationReactionComponent.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (Date of reaction to the immunization.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ImmunizationReactionComponent setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return Date of reaction to the immunization. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value Date of reaction to the immunization. + */ + public ImmunizationReactionComponent setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #detail} (Details of the reaction.) + */ + public Reference getDetail() { + if (this.detail == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationReactionComponent.detail"); + else if (Configuration.doAutoCreate()) + this.detail = new Reference(); // cc + return this.detail; + } + + public boolean hasDetail() { + return this.detail != null && !this.detail.isEmpty(); + } + + /** + * @param value {@link #detail} (Details of the reaction.) + */ + public ImmunizationReactionComponent setDetail(Reference value) { + this.detail = value; + return this; + } + + /** + * @return {@link #detail} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Details of the reaction.) + */ + public Observation getDetailTarget() { + if (this.detailTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationReactionComponent.detail"); + else if (Configuration.doAutoCreate()) + this.detailTarget = new Observation(); // aa + return this.detailTarget; + } + + /** + * @param value {@link #detail} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Details of the reaction.) + */ + public ImmunizationReactionComponent setDetailTarget(Observation value) { + this.detailTarget = value; + return this; + } + + /** + * @return {@link #reported} (Self-reported indicator.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value + */ + public BooleanType getReportedElement() { + if (this.reported == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationReactionComponent.reported"); + else if (Configuration.doAutoCreate()) + this.reported = new BooleanType(); // bb + return this.reported; + } + + public boolean hasReportedElement() { + return this.reported != null && !this.reported.isEmpty(); + } + + public boolean hasReported() { + return this.reported != null && !this.reported.isEmpty(); + } + + /** + * @param value {@link #reported} (Self-reported indicator.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value + */ + public ImmunizationReactionComponent setReportedElement(BooleanType value) { + this.reported = value; + return this; + } + + /** + * @return Self-reported indicator. + */ + public boolean getReported() { + return this.reported == null || this.reported.isEmpty() ? false : this.reported.getValue(); + } + + /** + * @param value Self-reported indicator. + */ + public ImmunizationReactionComponent setReported(boolean value) { + if (this.reported == null) + this.reported = new BooleanType(); + this.reported.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("date", "dateTime", "Date of reaction to the immunization.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("detail", "Reference(Observation)", "Details of the reaction.", 0, java.lang.Integer.MAX_VALUE, detail)); + childrenList.add(new Property("reported", "boolean", "Self-reported indicator.", 0, java.lang.Integer.MAX_VALUE, reported)); + } + + public ImmunizationReactionComponent copy() { + ImmunizationReactionComponent dst = new ImmunizationReactionComponent(); + copyValues(dst); + dst.date = date == null ? null : date.copy(); + dst.detail = detail == null ? null : detail.copy(); + dst.reported = reported == null ? null : reported.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImmunizationReactionComponent)) + return false; + ImmunizationReactionComponent o = (ImmunizationReactionComponent) other; + return compareDeep(date, o.date, true) && compareDeep(detail, o.detail, true) && compareDeep(reported, o.reported, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImmunizationReactionComponent)) + return false; + ImmunizationReactionComponent o = (ImmunizationReactionComponent) other; + return compareValues(date, o.date, true) && compareValues(reported, o.reported, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (date == null || date.isEmpty()) && (detail == null || detail.isEmpty()) + && (reported == null || reported.isEmpty()); + } + + } + + @Block() + public static class ImmunizationVaccinationProtocolComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Nominal position in a series. + */ + @Child(name = "doseSequence", type = {PositiveIntType.class}, order=1, min=1, max=1) + @Description(shortDefinition="What dose number within series?", formalDefinition="Nominal position in a series." ) + protected PositiveIntType doseSequence; + + /** + * Contains the description about the protocol under which the vaccine was administered. + */ + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Details of vaccine protocol", formalDefinition="Contains the description about the protocol under which the vaccine was administered." ) + protected StringType description; + + /** + * Indicates the authority who published the protocol? E.g. ACIP. + */ + @Child(name = "authority", type = {Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Who is responsible for protocol", formalDefinition="Indicates the authority who published the protocol? E.g. ACIP." ) + protected Reference authority; + + /** + * The actual object that is the target of the reference (Indicates the authority who published the protocol? E.g. ACIP.) + */ + protected Organization authorityTarget; + + /** + * One possible path to achieve presumed immunity against a disease - within the context of an authority. + */ + @Child(name = "series", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Name of vaccine series", formalDefinition="One possible path to achieve presumed immunity against a disease - within the context of an authority." ) + protected StringType series; + + /** + * The recommended number of doses to achieve immunity. + */ + @Child(name = "seriesDoses", type = {PositiveIntType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Recommended number of doses for immunity", formalDefinition="The recommended number of doses to achieve immunity." ) + protected PositiveIntType seriesDoses; + + /** + * The targeted disease. + */ + @Child(name = "doseTarget", type = {CodeableConcept.class}, order=6, min=1, max=1) + @Description(shortDefinition="Disease immunized against", formalDefinition="The targeted disease." ) + protected CodeableConcept doseTarget; + + /** + * Indicates if the immunization event should "count" against the protocol. + */ + @Child(name = "doseStatus", type = {CodeableConcept.class}, order=7, min=1, max=1) + @Description(shortDefinition="Does dose count towards immunity?", formalDefinition="Indicates if the immunization event should 'count' against the protocol." ) + protected CodeableConcept doseStatus; + + /** + * Provides an explanation as to why a immunization event should or should not count against the protocol. + */ + @Child(name = "doseStatusReason", type = {CodeableConcept.class}, order=8, min=0, max=1) + @Description(shortDefinition="Why does does count/not count?", formalDefinition="Provides an explanation as to why a immunization event should or should not count against the protocol." ) + protected CodeableConcept doseStatusReason; + + private static final long serialVersionUID = -783437472L; + + /* + * Constructor + */ + public ImmunizationVaccinationProtocolComponent() { + super(); + } + + /* + * Constructor + */ + public ImmunizationVaccinationProtocolComponent(PositiveIntType doseSequence, CodeableConcept doseTarget, CodeableConcept doseStatus) { + super(); + this.doseSequence = doseSequence; + this.doseTarget = doseTarget; + this.doseStatus = doseStatus; + } + + /** + * @return {@link #doseSequence} (Nominal position in a series.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value + */ + public PositiveIntType getDoseSequenceElement() { + if (this.doseSequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseSequence"); + else if (Configuration.doAutoCreate()) + this.doseSequence = new PositiveIntType(); // bb + return this.doseSequence; + } + + public boolean hasDoseSequenceElement() { + return this.doseSequence != null && !this.doseSequence.isEmpty(); + } + + public boolean hasDoseSequence() { + return this.doseSequence != null && !this.doseSequence.isEmpty(); + } + + /** + * @param value {@link #doseSequence} (Nominal position in a series.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value + */ + public ImmunizationVaccinationProtocolComponent setDoseSequenceElement(PositiveIntType value) { + this.doseSequence = value; + return this; + } + + /** + * @return Nominal position in a series. + */ + public int getDoseSequence() { + return this.doseSequence == null || this.doseSequence.isEmpty() ? 0 : this.doseSequence.getValue(); + } + + /** + * @param value Nominal position in a series. + */ + public ImmunizationVaccinationProtocolComponent setDoseSequence(int value) { + if (this.doseSequence == null) + this.doseSequence = new PositiveIntType(); + this.doseSequence.setValue(value); + return this; + } + + /** + * @return {@link #description} (Contains the description about the protocol under which the vaccine was administered.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Contains the description about the protocol under which the vaccine was administered.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ImmunizationVaccinationProtocolComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Contains the description about the protocol under which the vaccine was administered. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Contains the description about the protocol under which the vaccine was administered. + */ + public ImmunizationVaccinationProtocolComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #authority} (Indicates the authority who published the protocol? E.g. ACIP.) + */ + public Reference getAuthority() { + if (this.authority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.authority"); + else if (Configuration.doAutoCreate()) + this.authority = new Reference(); // cc + return this.authority; + } + + public boolean hasAuthority() { + return this.authority != null && !this.authority.isEmpty(); + } + + /** + * @param value {@link #authority} (Indicates the authority who published the protocol? E.g. ACIP.) + */ + public ImmunizationVaccinationProtocolComponent setAuthority(Reference value) { + this.authority = value; + return this; + } + + /** + * @return {@link #authority} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates the authority who published the protocol? E.g. ACIP.) + */ + public Organization getAuthorityTarget() { + if (this.authorityTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.authority"); + else if (Configuration.doAutoCreate()) + this.authorityTarget = new Organization(); // aa + return this.authorityTarget; + } + + /** + * @param value {@link #authority} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates the authority who published the protocol? E.g. ACIP.) + */ + public ImmunizationVaccinationProtocolComponent setAuthorityTarget(Organization value) { + this.authorityTarget = value; + return this; + } + + /** + * @return {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value + */ + public StringType getSeriesElement() { + if (this.series == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.series"); + else if (Configuration.doAutoCreate()) + this.series = new StringType(); // bb + return this.series; + } + + public boolean hasSeriesElement() { + return this.series != null && !this.series.isEmpty(); + } + + public boolean hasSeries() { + return this.series != null && !this.series.isEmpty(); + } + + /** + * @param value {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value + */ + public ImmunizationVaccinationProtocolComponent setSeriesElement(StringType value) { + this.series = value; + return this; + } + + /** + * @return One possible path to achieve presumed immunity against a disease - within the context of an authority. + */ + public String getSeries() { + return this.series == null ? null : this.series.getValue(); + } + + /** + * @param value One possible path to achieve presumed immunity against a disease - within the context of an authority. + */ + public ImmunizationVaccinationProtocolComponent setSeries(String value) { + if (Utilities.noString(value)) + this.series = null; + else { + if (this.series == null) + this.series = new StringType(); + this.series.setValue(value); + } + return this; + } + + /** + * @return {@link #seriesDoses} (The recommended number of doses to achieve immunity.). This is the underlying object with id, value and extensions. The accessor "getSeriesDoses" gives direct access to the value + */ + public PositiveIntType getSeriesDosesElement() { + if (this.seriesDoses == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.seriesDoses"); + else if (Configuration.doAutoCreate()) + this.seriesDoses = new PositiveIntType(); // bb + return this.seriesDoses; + } + + public boolean hasSeriesDosesElement() { + return this.seriesDoses != null && !this.seriesDoses.isEmpty(); + } + + public boolean hasSeriesDoses() { + return this.seriesDoses != null && !this.seriesDoses.isEmpty(); + } + + /** + * @param value {@link #seriesDoses} (The recommended number of doses to achieve immunity.). This is the underlying object with id, value and extensions. The accessor "getSeriesDoses" gives direct access to the value + */ + public ImmunizationVaccinationProtocolComponent setSeriesDosesElement(PositiveIntType value) { + this.seriesDoses = value; + return this; + } + + /** + * @return The recommended number of doses to achieve immunity. + */ + public int getSeriesDoses() { + return this.seriesDoses == null || this.seriesDoses.isEmpty() ? 0 : this.seriesDoses.getValue(); + } + + /** + * @param value The recommended number of doses to achieve immunity. + */ + public ImmunizationVaccinationProtocolComponent setSeriesDoses(int value) { + if (this.seriesDoses == null) + this.seriesDoses = new PositiveIntType(); + this.seriesDoses.setValue(value); + return this; + } + + /** + * @return {@link #doseTarget} (The targeted disease.) + */ + public CodeableConcept getDoseTarget() { + if (this.doseTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseTarget"); + else if (Configuration.doAutoCreate()) + this.doseTarget = new CodeableConcept(); // cc + return this.doseTarget; + } + + public boolean hasDoseTarget() { + return this.doseTarget != null && !this.doseTarget.isEmpty(); + } + + /** + * @param value {@link #doseTarget} (The targeted disease.) + */ + public ImmunizationVaccinationProtocolComponent setDoseTarget(CodeableConcept value) { + this.doseTarget = value; + return this; + } + + /** + * @return {@link #doseStatus} (Indicates if the immunization event should "count" against the protocol.) + */ + public CodeableConcept getDoseStatus() { + if (this.doseStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseStatus"); + else if (Configuration.doAutoCreate()) + this.doseStatus = new CodeableConcept(); // cc + return this.doseStatus; + } + + public boolean hasDoseStatus() { + return this.doseStatus != null && !this.doseStatus.isEmpty(); + } + + /** + * @param value {@link #doseStatus} (Indicates if the immunization event should "count" against the protocol.) + */ + public ImmunizationVaccinationProtocolComponent setDoseStatus(CodeableConcept value) { + this.doseStatus = value; + return this; + } + + /** + * @return {@link #doseStatusReason} (Provides an explanation as to why a immunization event should or should not count against the protocol.) + */ + public CodeableConcept getDoseStatusReason() { + if (this.doseStatusReason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseStatusReason"); + else if (Configuration.doAutoCreate()) + this.doseStatusReason = new CodeableConcept(); // cc + return this.doseStatusReason; + } + + public boolean hasDoseStatusReason() { + return this.doseStatusReason != null && !this.doseStatusReason.isEmpty(); + } + + /** + * @param value {@link #doseStatusReason} (Provides an explanation as to why a immunization event should or should not count against the protocol.) + */ + public ImmunizationVaccinationProtocolComponent setDoseStatusReason(CodeableConcept value) { + this.doseStatusReason = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("doseSequence", "positiveInt", "Nominal position in a series.", 0, java.lang.Integer.MAX_VALUE, doseSequence)); + childrenList.add(new Property("description", "string", "Contains the description about the protocol under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("authority", "Reference(Organization)", "Indicates the authority who published the protocol? E.g. ACIP.", 0, java.lang.Integer.MAX_VALUE, authority)); + childrenList.add(new Property("series", "string", "One possible path to achieve presumed immunity against a disease - within the context of an authority.", 0, java.lang.Integer.MAX_VALUE, series)); + childrenList.add(new Property("seriesDoses", "positiveInt", "The recommended number of doses to achieve immunity.", 0, java.lang.Integer.MAX_VALUE, seriesDoses)); + childrenList.add(new Property("doseTarget", "CodeableConcept", "The targeted disease.", 0, java.lang.Integer.MAX_VALUE, doseTarget)); + childrenList.add(new Property("doseStatus", "CodeableConcept", "Indicates if the immunization event should 'count' against the protocol.", 0, java.lang.Integer.MAX_VALUE, doseStatus)); + childrenList.add(new Property("doseStatusReason", "CodeableConcept", "Provides an explanation as to why a immunization event should or should not count against the protocol.", 0, java.lang.Integer.MAX_VALUE, doseStatusReason)); + } + + public ImmunizationVaccinationProtocolComponent copy() { + ImmunizationVaccinationProtocolComponent dst = new ImmunizationVaccinationProtocolComponent(); + copyValues(dst); + dst.doseSequence = doseSequence == null ? null : doseSequence.copy(); + dst.description = description == null ? null : description.copy(); + dst.authority = authority == null ? null : authority.copy(); + dst.series = series == null ? null : series.copy(); + dst.seriesDoses = seriesDoses == null ? null : seriesDoses.copy(); + dst.doseTarget = doseTarget == null ? null : doseTarget.copy(); + dst.doseStatus = doseStatus == null ? null : doseStatus.copy(); + dst.doseStatusReason = doseStatusReason == null ? null : doseStatusReason.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImmunizationVaccinationProtocolComponent)) + return false; + ImmunizationVaccinationProtocolComponent o = (ImmunizationVaccinationProtocolComponent) other; + return compareDeep(doseSequence, o.doseSequence, true) && compareDeep(description, o.description, true) + && compareDeep(authority, o.authority, true) && compareDeep(series, o.series, true) && compareDeep(seriesDoses, o.seriesDoses, true) + && compareDeep(doseTarget, o.doseTarget, true) && compareDeep(doseStatus, o.doseStatus, true) && compareDeep(doseStatusReason, o.doseStatusReason, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImmunizationVaccinationProtocolComponent)) + return false; + ImmunizationVaccinationProtocolComponent o = (ImmunizationVaccinationProtocolComponent) other; + return compareValues(doseSequence, o.doseSequence, true) && compareValues(description, o.description, true) + && compareValues(series, o.series, true) && compareValues(seriesDoses, o.seriesDoses, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (doseSequence == null || doseSequence.isEmpty()) && (description == null || description.isEmpty()) + && (authority == null || authority.isEmpty()) && (series == null || series.isEmpty()) && (seriesDoses == null || seriesDoses.isEmpty()) + && (doseTarget == null || doseTarget.isEmpty()) && (doseStatus == null || doseStatus.isEmpty()) + && (doseStatusReason == null || doseStatusReason.isEmpty()); + } + + } + + /** + * A unique identifier assigned to this immunization record. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business identifier", formalDefinition="A unique identifier assigned to this immunization record." ) + protected List identifier; + + /** + * Date vaccine administered or was to be administered. + */ + @Child(name = "date", type = {DateTimeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Vaccination administration date", formalDefinition="Date vaccine administered or was to be administered." ) + protected DateTimeType date; + + /** + * Vaccine that was administered or was to be administered. + */ + @Child(name = "vaccineType", type = {CodeableConcept.class}, order=2, min=1, max=1) + @Description(shortDefinition="Vaccine product administered", formalDefinition="Vaccine that was administered or was to be administered." ) + protected CodeableConcept vaccineType; + + /** + * The patient who either received or did not receive the immunization. + */ + @Child(name = "patient", type = {Patient.class}, order=3, min=1, max=1) + @Description(shortDefinition="Who was immunized?", formalDefinition="The patient who either received or did not receive the immunization." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient who either received or did not receive the immunization.) + */ + protected Patient patientTarget; + + /** + * Indicates if the vaccination was or was not given. + */ + @Child(name = "wasNotGiven", type = {BooleanType.class}, order=4, min=1, max=1) + @Description(shortDefinition="Was immunization given?", formalDefinition="Indicates if the vaccination was or was not given." ) + protected BooleanType wasNotGiven; + + /** + * True if this administration was reported rather than directly administered. + */ + @Child(name = "reported", type = {BooleanType.class}, order=5, min=1, max=1) + @Description(shortDefinition="Is this a self-reported record?", formalDefinition="True if this administration was reported rather than directly administered." ) + protected BooleanType reported; + + /** + * Clinician who administered the vaccine. + */ + @Child(name = "performer", type = {Practitioner.class}, order=6, min=0, max=1) + @Description(shortDefinition="Who administered vaccine?", formalDefinition="Clinician who administered the vaccine." ) + protected Reference performer; + + /** + * The actual object that is the target of the reference (Clinician who administered the vaccine.) + */ + protected Practitioner performerTarget; + + /** + * Clinician who ordered the vaccination. + */ + @Child(name = "requester", type = {Practitioner.class}, order=7, min=0, max=1) + @Description(shortDefinition="Who ordered vaccination?", formalDefinition="Clinician who ordered the vaccination." ) + protected Reference requester; + + /** + * The actual object that is the target of the reference (Clinician who ordered the vaccination.) + */ + protected Practitioner requesterTarget; + + /** + * The visit or admission or other contact between patient and health care provider the immunization was performed as part of. + */ + @Child(name = "encounter", type = {Encounter.class}, order=8, min=0, max=1) + @Description(shortDefinition="Encounter administered as part of", formalDefinition="The visit or admission or other contact between patient and health care provider the immunization was performed as part of." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.) + */ + protected Encounter encounterTarget; + + /** + * Name of vaccine manufacturer. + */ + @Child(name = "manufacturer", type = {Organization.class}, order=9, min=0, max=1) + @Description(shortDefinition="Vaccine manufacturer", formalDefinition="Name of vaccine manufacturer." ) + protected Reference manufacturer; + + /** + * The actual object that is the target of the reference (Name of vaccine manufacturer.) + */ + protected Organization manufacturerTarget; + + /** + * The service delivery location where the vaccine administration occurred. + */ + @Child(name = "location", type = {Location.class}, order=10, min=0, max=1) + @Description(shortDefinition="Where did vaccination occur?", formalDefinition="The service delivery location where the vaccine administration occurred." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (The service delivery location where the vaccine administration occurred.) + */ + protected Location locationTarget; + + /** + * Lot number of the vaccine product. + */ + @Child(name = "lotNumber", type = {StringType.class}, order=11, min=0, max=1) + @Description(shortDefinition="Vaccine lot number", formalDefinition="Lot number of the vaccine product." ) + protected StringType lotNumber; + + /** + * Date vaccine batch expires. + */ + @Child(name = "expirationDate", type = {DateType.class}, order=12, min=0, max=1) + @Description(shortDefinition="Vaccine expiration date", formalDefinition="Date vaccine batch expires." ) + protected DateType expirationDate; + + /** + * Body site where vaccine was administered. + */ + @Child(name = "site", type = {CodeableConcept.class}, order=13, min=0, max=1) + @Description(shortDefinition="Body site vaccine was administered", formalDefinition="Body site where vaccine was administered." ) + protected CodeableConcept site; + + /** + * The path by which the vaccine product is taken into the body. + */ + @Child(name = "route", type = {CodeableConcept.class}, order=14, min=0, max=1) + @Description(shortDefinition="How vaccine entered body", formalDefinition="The path by which the vaccine product is taken into the body." ) + protected CodeableConcept route; + + /** + * The quantity of vaccine product that was administered. + */ + @Child(name = "doseQuantity", type = {Quantity.class}, order=15, min=0, max=1) + @Description(shortDefinition="Amount of vaccine administered", formalDefinition="The quantity of vaccine product that was administered." ) + protected Quantity doseQuantity; + + /** + * Reasons why a vaccine was or was not administered. + */ + @Child(name = "explanation", type = {}, order=16, min=0, max=1) + @Description(shortDefinition="Administration / non-administration reasons", formalDefinition="Reasons why a vaccine was or was not administered." ) + protected ImmunizationExplanationComponent explanation; + + /** + * Categorical data indicating that an adverse event is associated in time to an immunization. + */ + @Child(name = "reaction", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Details of a reaction that follows immunization", formalDefinition="Categorical data indicating that an adverse event is associated in time to an immunization." ) + protected List reaction; + + /** + * Contains information about the protocol(s) under which the vaccine was administered. + */ + @Child(name = "vaccinationProtocol", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="What protocol was followed", formalDefinition="Contains information about the protocol(s) under which the vaccine was administered." ) + protected List vaccinationProtocol; + + private static final long serialVersionUID = -1610924217L; + + /* + * Constructor + */ + public Immunization() { + super(); + } + + /* + * Constructor + */ + public Immunization(DateTimeType date, CodeableConcept vaccineType, Reference patient, BooleanType wasNotGiven, BooleanType reported) { + super(); + this.date = date; + this.vaccineType = vaccineType; + this.patient = patient; + this.wasNotGiven = wasNotGiven; + this.reported = reported; + } + + /** + * @return {@link #identifier} (A unique identifier assigned to this immunization record.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (A unique identifier assigned to this immunization record.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Immunization addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #date} (Date vaccine administered or was to be administered.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (Date vaccine administered or was to be administered.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public Immunization setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return Date vaccine administered or was to be administered. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value Date vaccine administered or was to be administered. + */ + public Immunization setDate(Date value) { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + return this; + } + + /** + * @return {@link #vaccineType} (Vaccine that was administered or was to be administered.) + */ + public CodeableConcept getVaccineType() { + if (this.vaccineType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.vaccineType"); + else if (Configuration.doAutoCreate()) + this.vaccineType = new CodeableConcept(); // cc + return this.vaccineType; + } + + public boolean hasVaccineType() { + return this.vaccineType != null && !this.vaccineType.isEmpty(); + } + + /** + * @param value {@link #vaccineType} (Vaccine that was administered or was to be administered.) + */ + public Immunization setVaccineType(CodeableConcept value) { + this.vaccineType = value; + return this; + } + + /** + * @return {@link #patient} (The patient who either received or did not receive the immunization.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The patient who either received or did not receive the immunization.) + */ + public Immunization setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who either received or did not receive the immunization.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who either received or did not receive the immunization.) + */ + public Immunization setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #wasNotGiven} (Indicates if the vaccination was or was not given.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value + */ + public BooleanType getWasNotGivenElement() { + if (this.wasNotGiven == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.wasNotGiven"); + else if (Configuration.doAutoCreate()) + this.wasNotGiven = new BooleanType(); // bb + return this.wasNotGiven; + } + + public boolean hasWasNotGivenElement() { + return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); + } + + public boolean hasWasNotGiven() { + return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); + } + + /** + * @param value {@link #wasNotGiven} (Indicates if the vaccination was or was not given.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value + */ + public Immunization setWasNotGivenElement(BooleanType value) { + this.wasNotGiven = value; + return this; + } + + /** + * @return Indicates if the vaccination was or was not given. + */ + public boolean getWasNotGiven() { + return this.wasNotGiven == null || this.wasNotGiven.isEmpty() ? false : this.wasNotGiven.getValue(); + } + + /** + * @param value Indicates if the vaccination was or was not given. + */ + public Immunization setWasNotGiven(boolean value) { + if (this.wasNotGiven == null) + this.wasNotGiven = new BooleanType(); + this.wasNotGiven.setValue(value); + return this; + } + + /** + * @return {@link #reported} (True if this administration was reported rather than directly administered.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value + */ + public BooleanType getReportedElement() { + if (this.reported == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.reported"); + else if (Configuration.doAutoCreate()) + this.reported = new BooleanType(); // bb + return this.reported; + } + + public boolean hasReportedElement() { + return this.reported != null && !this.reported.isEmpty(); + } + + public boolean hasReported() { + return this.reported != null && !this.reported.isEmpty(); + } + + /** + * @param value {@link #reported} (True if this administration was reported rather than directly administered.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value + */ + public Immunization setReportedElement(BooleanType value) { + this.reported = value; + return this; + } + + /** + * @return True if this administration was reported rather than directly administered. + */ + public boolean getReported() { + return this.reported == null || this.reported.isEmpty() ? false : this.reported.getValue(); + } + + /** + * @param value True if this administration was reported rather than directly administered. + */ + public Immunization setReported(boolean value) { + if (this.reported == null) + this.reported = new BooleanType(); + this.reported.setValue(value); + return this; + } + + /** + * @return {@link #performer} (Clinician who administered the vaccine.) + */ + public Reference getPerformer() { + if (this.performer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.performer"); + else if (Configuration.doAutoCreate()) + this.performer = new Reference(); // cc + return this.performer; + } + + public boolean hasPerformer() { + return this.performer != null && !this.performer.isEmpty(); + } + + /** + * @param value {@link #performer} (Clinician who administered the vaccine.) + */ + public Immunization setPerformer(Reference value) { + this.performer = value; + return this; + } + + /** + * @return {@link #performer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Clinician who administered the vaccine.) + */ + public Practitioner getPerformerTarget() { + if (this.performerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.performer"); + else if (Configuration.doAutoCreate()) + this.performerTarget = new Practitioner(); // aa + return this.performerTarget; + } + + /** + * @param value {@link #performer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Clinician who administered the vaccine.) + */ + public Immunization setPerformerTarget(Practitioner value) { + this.performerTarget = value; + return this; + } + + /** + * @return {@link #requester} (Clinician who ordered the vaccination.) + */ + public Reference getRequester() { + if (this.requester == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.requester"); + else if (Configuration.doAutoCreate()) + this.requester = new Reference(); // cc + return this.requester; + } + + public boolean hasRequester() { + return this.requester != null && !this.requester.isEmpty(); + } + + /** + * @param value {@link #requester} (Clinician who ordered the vaccination.) + */ + public Immunization setRequester(Reference value) { + this.requester = value; + return this; + } + + /** + * @return {@link #requester} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Clinician who ordered the vaccination.) + */ + public Practitioner getRequesterTarget() { + if (this.requesterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.requester"); + else if (Configuration.doAutoCreate()) + this.requesterTarget = new Practitioner(); // aa + return this.requesterTarget; + } + + /** + * @param value {@link #requester} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Clinician who ordered the vaccination.) + */ + public Immunization setRequesterTarget(Practitioner value) { + this.requesterTarget = value; + return this; + } + + /** + * @return {@link #encounter} (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.) + */ + public Immunization setEncounter(Reference value) { + this.encounter = value; + return this; + } + + /** + * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + return this.encounterTarget; + } + + /** + * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.) + */ + public Immunization setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #manufacturer} (Name of vaccine manufacturer.) + */ + public Reference getManufacturer() { + if (this.manufacturer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.manufacturer"); + else if (Configuration.doAutoCreate()) + this.manufacturer = new Reference(); // cc + return this.manufacturer; + } + + public boolean hasManufacturer() { + return this.manufacturer != null && !this.manufacturer.isEmpty(); + } + + /** + * @param value {@link #manufacturer} (Name of vaccine manufacturer.) + */ + public Immunization setManufacturer(Reference value) { + this.manufacturer = value; + return this; + } + + /** + * @return {@link #manufacturer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Name of vaccine manufacturer.) + */ + public Organization getManufacturerTarget() { + if (this.manufacturerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.manufacturer"); + else if (Configuration.doAutoCreate()) + this.manufacturerTarget = new Organization(); // aa + return this.manufacturerTarget; + } + + /** + * @param value {@link #manufacturer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Name of vaccine manufacturer.) + */ + public Immunization setManufacturerTarget(Organization value) { + this.manufacturerTarget = value; + return this; + } + + /** + * @return {@link #location} (The service delivery location where the vaccine administration occurred.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); // cc + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (The service delivery location where the vaccine administration occurred.) + */ + public Immunization setLocation(Reference value) { + this.location = value; + return this; + } + + /** + * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The service delivery location where the vaccine administration occurred.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); // aa + return this.locationTarget; + } + + /** + * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The service delivery location where the vaccine administration occurred.) + */ + public Immunization setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #lotNumber} (Lot number of the vaccine product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value + */ + public StringType getLotNumberElement() { + if (this.lotNumber == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.lotNumber"); + else if (Configuration.doAutoCreate()) + this.lotNumber = new StringType(); // bb + return this.lotNumber; + } + + public boolean hasLotNumberElement() { + return this.lotNumber != null && !this.lotNumber.isEmpty(); + } + + public boolean hasLotNumber() { + return this.lotNumber != null && !this.lotNumber.isEmpty(); + } + + /** + * @param value {@link #lotNumber} (Lot number of the vaccine product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value + */ + public Immunization setLotNumberElement(StringType value) { + this.lotNumber = value; + return this; + } + + /** + * @return Lot number of the vaccine product. + */ + public String getLotNumber() { + return this.lotNumber == null ? null : this.lotNumber.getValue(); + } + + /** + * @param value Lot number of the vaccine product. + */ + public Immunization setLotNumber(String value) { + if (Utilities.noString(value)) + this.lotNumber = null; + else { + if (this.lotNumber == null) + this.lotNumber = new StringType(); + this.lotNumber.setValue(value); + } + return this; + } + + /** + * @return {@link #expirationDate} (Date vaccine batch expires.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value + */ + public DateType getExpirationDateElement() { + if (this.expirationDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.expirationDate"); + else if (Configuration.doAutoCreate()) + this.expirationDate = new DateType(); // bb + return this.expirationDate; + } + + public boolean hasExpirationDateElement() { + return this.expirationDate != null && !this.expirationDate.isEmpty(); + } + + public boolean hasExpirationDate() { + return this.expirationDate != null && !this.expirationDate.isEmpty(); + } + + /** + * @param value {@link #expirationDate} (Date vaccine batch expires.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value + */ + public Immunization setExpirationDateElement(DateType value) { + this.expirationDate = value; + return this; + } + + /** + * @return Date vaccine batch expires. + */ + public Date getExpirationDate() { + return this.expirationDate == null ? null : this.expirationDate.getValue(); + } + + /** + * @param value Date vaccine batch expires. + */ + public Immunization setExpirationDate(Date value) { + if (value == null) + this.expirationDate = null; + else { + if (this.expirationDate == null) + this.expirationDate = new DateType(); + this.expirationDate.setValue(value); + } + return this; + } + + /** + * @return {@link #site} (Body site where vaccine was administered.) + */ + public CodeableConcept getSite() { + if (this.site == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.site"); + else if (Configuration.doAutoCreate()) + this.site = new CodeableConcept(); // cc + return this.site; + } + + public boolean hasSite() { + return this.site != null && !this.site.isEmpty(); + } + + /** + * @param value {@link #site} (Body site where vaccine was administered.) + */ + public Immunization setSite(CodeableConcept value) { + this.site = value; + return this; + } + + /** + * @return {@link #route} (The path by which the vaccine product is taken into the body.) + */ + public CodeableConcept getRoute() { + if (this.route == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.route"); + else if (Configuration.doAutoCreate()) + this.route = new CodeableConcept(); // cc + return this.route; + } + + public boolean hasRoute() { + return this.route != null && !this.route.isEmpty(); + } + + /** + * @param value {@link #route} (The path by which the vaccine product is taken into the body.) + */ + public Immunization setRoute(CodeableConcept value) { + this.route = value; + return this; + } + + /** + * @return {@link #doseQuantity} (The quantity of vaccine product that was administered.) + */ + public Quantity getDoseQuantity() { + if (this.doseQuantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.doseQuantity"); + else if (Configuration.doAutoCreate()) + this.doseQuantity = new Quantity(); // cc + return this.doseQuantity; + } + + public boolean hasDoseQuantity() { + return this.doseQuantity != null && !this.doseQuantity.isEmpty(); + } + + /** + * @param value {@link #doseQuantity} (The quantity of vaccine product that was administered.) + */ + public Immunization setDoseQuantity(Quantity value) { + this.doseQuantity = value; + return this; + } + + /** + * @return {@link #explanation} (Reasons why a vaccine was or was not administered.) + */ + public ImmunizationExplanationComponent getExplanation() { + if (this.explanation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.explanation"); + else if (Configuration.doAutoCreate()) + this.explanation = new ImmunizationExplanationComponent(); // cc + return this.explanation; + } + + public boolean hasExplanation() { + return this.explanation != null && !this.explanation.isEmpty(); + } + + /** + * @param value {@link #explanation} (Reasons why a vaccine was or was not administered.) + */ + public Immunization setExplanation(ImmunizationExplanationComponent value) { + this.explanation = value; + return this; + } + + /** + * @return {@link #reaction} (Categorical data indicating that an adverse event is associated in time to an immunization.) + */ + public List getReaction() { + if (this.reaction == null) + this.reaction = new ArrayList(); + return this.reaction; + } + + public boolean hasReaction() { + if (this.reaction == null) + return false; + for (ImmunizationReactionComponent item : this.reaction) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reaction} (Categorical data indicating that an adverse event is associated in time to an immunization.) + */ + // syntactic sugar + public ImmunizationReactionComponent addReaction() { //3 + ImmunizationReactionComponent t = new ImmunizationReactionComponent(); + if (this.reaction == null) + this.reaction = new ArrayList(); + this.reaction.add(t); + return t; + } + + // syntactic sugar + public Immunization addReaction(ImmunizationReactionComponent t) { //3 + if (t == null) + return this; + if (this.reaction == null) + this.reaction = new ArrayList(); + this.reaction.add(t); + return this; + } + + /** + * @return {@link #vaccinationProtocol} (Contains information about the protocol(s) under which the vaccine was administered.) + */ + public List getVaccinationProtocol() { + if (this.vaccinationProtocol == null) + this.vaccinationProtocol = new ArrayList(); + return this.vaccinationProtocol; + } + + public boolean hasVaccinationProtocol() { + if (this.vaccinationProtocol == null) + return false; + for (ImmunizationVaccinationProtocolComponent item : this.vaccinationProtocol) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #vaccinationProtocol} (Contains information about the protocol(s) under which the vaccine was administered.) + */ + // syntactic sugar + public ImmunizationVaccinationProtocolComponent addVaccinationProtocol() { //3 + ImmunizationVaccinationProtocolComponent t = new ImmunizationVaccinationProtocolComponent(); + if (this.vaccinationProtocol == null) + this.vaccinationProtocol = new ArrayList(); + this.vaccinationProtocol.add(t); + return t; + } + + // syntactic sugar + public Immunization addVaccinationProtocol(ImmunizationVaccinationProtocolComponent t) { //3 + if (t == null) + return this; + if (this.vaccinationProtocol == null) + this.vaccinationProtocol = new ArrayList(); + this.vaccinationProtocol.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "A unique identifier assigned to this immunization record.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("date", "dateTime", "Date vaccine administered or was to be administered.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("vaccineType", "CodeableConcept", "Vaccine that was administered or was to be administered.", 0, java.lang.Integer.MAX_VALUE, vaccineType)); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient who either received or did not receive the immunization.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("wasNotGiven", "boolean", "Indicates if the vaccination was or was not given.", 0, java.lang.Integer.MAX_VALUE, wasNotGiven)); + childrenList.add(new Property("reported", "boolean", "True if this administration was reported rather than directly administered.", 0, java.lang.Integer.MAX_VALUE, reported)); + childrenList.add(new Property("performer", "Reference(Practitioner)", "Clinician who administered the vaccine.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("requester", "Reference(Practitioner)", "Clinician who ordered the vaccination.", 0, java.lang.Integer.MAX_VALUE, requester)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The visit or admission or other contact between patient and health care provider the immunization was performed as part of.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("manufacturer", "Reference(Organization)", "Name of vaccine manufacturer.", 0, java.lang.Integer.MAX_VALUE, manufacturer)); + childrenList.add(new Property("location", "Reference(Location)", "The service delivery location where the vaccine administration occurred.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("lotNumber", "string", "Lot number of the vaccine product.", 0, java.lang.Integer.MAX_VALUE, lotNumber)); + childrenList.add(new Property("expirationDate", "date", "Date vaccine batch expires.", 0, java.lang.Integer.MAX_VALUE, expirationDate)); + childrenList.add(new Property("site", "CodeableConcept", "Body site where vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, site)); + childrenList.add(new Property("route", "CodeableConcept", "The path by which the vaccine product is taken into the body.", 0, java.lang.Integer.MAX_VALUE, route)); + childrenList.add(new Property("doseQuantity", "Quantity", "The quantity of vaccine product that was administered.", 0, java.lang.Integer.MAX_VALUE, doseQuantity)); + childrenList.add(new Property("explanation", "", "Reasons why a vaccine was or was not administered.", 0, java.lang.Integer.MAX_VALUE, explanation)); + childrenList.add(new Property("reaction", "", "Categorical data indicating that an adverse event is associated in time to an immunization.", 0, java.lang.Integer.MAX_VALUE, reaction)); + childrenList.add(new Property("vaccinationProtocol", "", "Contains information about the protocol(s) under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, vaccinationProtocol)); + } + + public Immunization copy() { + Immunization dst = new Immunization(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.date = date == null ? null : date.copy(); + dst.vaccineType = vaccineType == null ? null : vaccineType.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.wasNotGiven = wasNotGiven == null ? null : wasNotGiven.copy(); + dst.reported = reported == null ? null : reported.copy(); + dst.performer = performer == null ? null : performer.copy(); + dst.requester = requester == null ? null : requester.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.manufacturer = manufacturer == null ? null : manufacturer.copy(); + dst.location = location == null ? null : location.copy(); + dst.lotNumber = lotNumber == null ? null : lotNumber.copy(); + dst.expirationDate = expirationDate == null ? null : expirationDate.copy(); + dst.site = site == null ? null : site.copy(); + dst.route = route == null ? null : route.copy(); + dst.doseQuantity = doseQuantity == null ? null : doseQuantity.copy(); + dst.explanation = explanation == null ? null : explanation.copy(); + if (reaction != null) { + dst.reaction = new ArrayList(); + for (ImmunizationReactionComponent i : reaction) + dst.reaction.add(i.copy()); + }; + if (vaccinationProtocol != null) { + dst.vaccinationProtocol = new ArrayList(); + for (ImmunizationVaccinationProtocolComponent i : vaccinationProtocol) + dst.vaccinationProtocol.add(i.copy()); + }; + return dst; + } + + protected Immunization typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Immunization)) + return false; + Immunization o = (Immunization) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(date, o.date, true) && compareDeep(vaccineType, o.vaccineType, true) + && compareDeep(patient, o.patient, true) && compareDeep(wasNotGiven, o.wasNotGiven, true) && compareDeep(reported, o.reported, true) + && compareDeep(performer, o.performer, true) && compareDeep(requester, o.requester, true) && compareDeep(encounter, o.encounter, true) + && compareDeep(manufacturer, o.manufacturer, true) && compareDeep(location, o.location, true) && compareDeep(lotNumber, o.lotNumber, true) + && compareDeep(expirationDate, o.expirationDate, true) && compareDeep(site, o.site, true) && compareDeep(route, o.route, true) + && compareDeep(doseQuantity, o.doseQuantity, true) && compareDeep(explanation, o.explanation, true) + && compareDeep(reaction, o.reaction, true) && compareDeep(vaccinationProtocol, o.vaccinationProtocol, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Immunization)) + return false; + Immunization o = (Immunization) other; + return compareValues(date, o.date, true) && compareValues(wasNotGiven, o.wasNotGiven, true) && compareValues(reported, o.reported, true) + && compareValues(lotNumber, o.lotNumber, true) && compareValues(expirationDate, o.expirationDate, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (date == null || date.isEmpty()) + && (vaccineType == null || vaccineType.isEmpty()) && (patient == null || patient.isEmpty()) + && (wasNotGiven == null || wasNotGiven.isEmpty()) && (reported == null || reported.isEmpty()) + && (performer == null || performer.isEmpty()) && (requester == null || requester.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (manufacturer == null || manufacturer.isEmpty()) + && (location == null || location.isEmpty()) && (lotNumber == null || lotNumber.isEmpty()) + && (expirationDate == null || expirationDate.isEmpty()) && (site == null || site.isEmpty()) + && (route == null || route.isEmpty()) && (doseQuantity == null || doseQuantity.isEmpty()) + && (explanation == null || explanation.isEmpty()) && (reaction == null || reaction.isEmpty()) + && (vaccinationProtocol == null || vaccinationProtocol.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Immunization; + } + + @SearchParamDefinition(name="date", path="Immunization.date", description="Vaccination (non)-Administration Date", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="requester", path="Immunization.requester", description="The practitioner who ordered the vaccination", type="reference" ) + public static final String SP_REQUESTER = "requester"; + @SearchParamDefinition(name="identifier", path="Immunization.identifier", description="Business identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="reason", path="Immunization.explanation.reason", description="Why immunization occurred", type="token" ) + public static final String SP_REASON = "reason"; + @SearchParamDefinition(name="performer", path="Immunization.performer", description="The practitioner who administered the vaccination", type="reference" ) + public static final String SP_PERFORMER = "performer"; + @SearchParamDefinition(name="reaction", path="Immunization.reaction.detail", description="Additional information on reaction", type="reference" ) + public static final String SP_REACTION = "reaction"; + @SearchParamDefinition(name="lot-number", path="Immunization.lotNumber", description="Vaccine Lot Number", type="string" ) + public static final String SP_LOTNUMBER = "lot-number"; + @SearchParamDefinition(name="subject", path="Immunization.patient", description="The patient for the vaccination record", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="vaccine-type", path="Immunization.vaccineType", description="Vaccine Product Type Administered", type="token" ) + public static final String SP_VACCINETYPE = "vaccine-type"; + @SearchParamDefinition(name="notgiven", path="Immunization.wasNotGiven", description="Administrations which were not given", type="token" ) + public static final String SP_NOTGIVEN = "notgiven"; + @SearchParamDefinition(name="manufacturer", path="Immunization.manufacturer", description="Vaccine Manufacturer", type="reference" ) + public static final String SP_MANUFACTURER = "manufacturer"; + @SearchParamDefinition(name="dose-sequence", path="Immunization.vaccinationProtocol.doseSequence", description="What dose number within series?", type="number" ) + public static final String SP_DOSESEQUENCE = "dose-sequence"; + @SearchParamDefinition(name="patient", path="Immunization.patient", description="The patient for the vaccination record", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="reason-not-given", path="Immunization.explanation.reasonNotGiven", description="Explanation of reason vaccination was not administered", type="token" ) + public static final String SP_REASONNOTGIVEN = "reason-not-given"; + @SearchParamDefinition(name="location", path="Immunization.location", description="The service delivery location or facility in which the vaccine was / was to be administered", type="reference" ) + public static final String SP_LOCATION = "location"; + @SearchParamDefinition(name="reaction-date", path="Immunization.reaction.date", description="When did reaction start?", type="date" ) + public static final String SP_REACTIONDATE = "reaction-date"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ImmunizationRecommendation.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ImmunizationRecommendation.java index e9a5ca138dc..0f1cbde7933 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ImmunizationRecommendation.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ImmunizationRecommendation.java @@ -1,1210 +1,1189 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A patient's point-of-time immunization status and recommendation with optional supporting justification. - */ -@ResourceDef(name="ImmunizationRecommendation", profile="http://hl7.org/fhir/Profile/ImmunizationRecommendation") -public class ImmunizationRecommendation extends DomainResource { - - @Block() - public static class ImmunizationRecommendationRecommendationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The date the immunization recommendation was created. - */ - @Child(name = "date", type = {DateTimeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Date recommendation created", formalDefinition="The date the immunization recommendation was created." ) - protected DateTimeType date; - - /** - * Vaccine that pertains to the recommendation. - */ - @Child(name = "vaccineType", type = {CodeableConcept.class}, order=2, min=1, max=1) - @Description(shortDefinition="Vaccine recommendation applies to", formalDefinition="Vaccine that pertains to the recommendation." ) - protected CodeableConcept vaccineType; - - /** - * This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). - */ - @Child(name = "doseNumber", type = {PositiveIntType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Recommended dose number", formalDefinition="This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose)." ) - protected PositiveIntType doseNumber; - - /** - * Vaccine administration status. - */ - @Child(name = "forecastStatus", type = {CodeableConcept.class}, order=4, min=1, max=1) - @Description(shortDefinition="Vaccine administration status", formalDefinition="Vaccine administration status." ) - protected CodeableConcept forecastStatus; - - /** - * Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc. - */ - @Child(name = "dateCriterion", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Dates governing proposed immunization", formalDefinition="Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc." ) - protected List dateCriterion; - - /** - * Contains information about the protocol under which the vaccine was administered. - */ - @Child(name = "protocol", type = {}, order=6, min=0, max=1) - @Description(shortDefinition="Protocol used by recommendation", formalDefinition="Contains information about the protocol under which the vaccine was administered." ) - protected ImmunizationRecommendationRecommendationProtocolComponent protocol; - - /** - * Immunization event history that supports the status and recommendation. - */ - @Child(name = "supportingImmunization", type = {Immunization.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Past immunizations supporting recommendation", formalDefinition="Immunization event history that supports the status and recommendation." ) - protected List supportingImmunization; - /** - * The actual objects that are the target of the reference (Immunization event history that supports the status and recommendation.) - */ - protected List supportingImmunizationTarget; - - - /** - * Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information. - */ - @Child(name = "supportingPatientInformation", type = {Observation.class, AllergyIntolerance.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Patient observations supporting recommendation", formalDefinition="Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information." ) - protected List supportingPatientInformation; - /** - * The actual objects that are the target of the reference (Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) - */ - protected List supportingPatientInformationTarget; - - - private static final long serialVersionUID = 366360557L; - - /* - * Constructor - */ - public ImmunizationRecommendationRecommendationComponent() { - super(); - } - - /* - * Constructor - */ - public ImmunizationRecommendationRecommendationComponent(DateTimeType date, CodeableConcept vaccineType, CodeableConcept forecastStatus) { - super(); - this.date = date; - this.vaccineType = vaccineType; - this.forecastStatus = forecastStatus; - } - - /** - * @return {@link #date} (The date the immunization recommendation was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date the immunization recommendation was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ImmunizationRecommendationRecommendationComponent setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date the immunization recommendation was created. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date the immunization recommendation was created. - */ - public ImmunizationRecommendationRecommendationComponent setDate(Date value) { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - return this; - } - - /** - * @return {@link #vaccineType} (Vaccine that pertains to the recommendation.) - */ - public CodeableConcept getVaccineType() { - if (this.vaccineType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.vaccineType"); - else if (Configuration.doAutoCreate()) - this.vaccineType = new CodeableConcept(); // cc - return this.vaccineType; - } - - public boolean hasVaccineType() { - return this.vaccineType != null && !this.vaccineType.isEmpty(); - } - - /** - * @param value {@link #vaccineType} (Vaccine that pertains to the recommendation.) - */ - public ImmunizationRecommendationRecommendationComponent setVaccineType(CodeableConcept value) { - this.vaccineType = value; - return this; - } - - /** - * @return {@link #doseNumber} (This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose).). This is the underlying object with id, value and extensions. The accessor "getDoseNumber" gives direct access to the value - */ - public PositiveIntType getDoseNumberElement() { - if (this.doseNumber == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.doseNumber"); - else if (Configuration.doAutoCreate()) - this.doseNumber = new PositiveIntType(); // bb - return this.doseNumber; - } - - public boolean hasDoseNumberElement() { - return this.doseNumber != null && !this.doseNumber.isEmpty(); - } - - public boolean hasDoseNumber() { - return this.doseNumber != null && !this.doseNumber.isEmpty(); - } - - /** - * @param value {@link #doseNumber} (This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose).). This is the underlying object with id, value and extensions. The accessor "getDoseNumber" gives direct access to the value - */ - public ImmunizationRecommendationRecommendationComponent setDoseNumberElement(PositiveIntType value) { - this.doseNumber = value; - return this; - } - - /** - * @return This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). - */ - public int getDoseNumber() { - return this.doseNumber == null || this.doseNumber.isEmpty() ? 0 : this.doseNumber.getValue(); - } - - /** - * @param value This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). - */ - public ImmunizationRecommendationRecommendationComponent setDoseNumber(int value) { - if (this.doseNumber == null) - this.doseNumber = new PositiveIntType(); - this.doseNumber.setValue(value); - return this; - } - - /** - * @return {@link #forecastStatus} (Vaccine administration status.) - */ - public CodeableConcept getForecastStatus() { - if (this.forecastStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.forecastStatus"); - else if (Configuration.doAutoCreate()) - this.forecastStatus = new CodeableConcept(); // cc - return this.forecastStatus; - } - - public boolean hasForecastStatus() { - return this.forecastStatus != null && !this.forecastStatus.isEmpty(); - } - - /** - * @param value {@link #forecastStatus} (Vaccine administration status.) - */ - public ImmunizationRecommendationRecommendationComponent setForecastStatus(CodeableConcept value) { - this.forecastStatus = value; - return this; - } - - /** - * @return {@link #dateCriterion} (Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc.) - */ - public List getDateCriterion() { - if (this.dateCriterion == null) - this.dateCriterion = new ArrayList(); - return this.dateCriterion; - } - - public boolean hasDateCriterion() { - if (this.dateCriterion == null) - return false; - for (ImmunizationRecommendationRecommendationDateCriterionComponent item : this.dateCriterion) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dateCriterion} (Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc.) - */ - // syntactic sugar - public ImmunizationRecommendationRecommendationDateCriterionComponent addDateCriterion() { //3 - ImmunizationRecommendationRecommendationDateCriterionComponent t = new ImmunizationRecommendationRecommendationDateCriterionComponent(); - if (this.dateCriterion == null) - this.dateCriterion = new ArrayList(); - this.dateCriterion.add(t); - return t; - } - - // syntactic sugar - public ImmunizationRecommendationRecommendationComponent addDateCriterion(ImmunizationRecommendationRecommendationDateCriterionComponent t) { //3 - if (t == null) - return this; - if (this.dateCriterion == null) - this.dateCriterion = new ArrayList(); - this.dateCriterion.add(t); - return this; - } - - /** - * @return {@link #protocol} (Contains information about the protocol under which the vaccine was administered.) - */ - public ImmunizationRecommendationRecommendationProtocolComponent getProtocol() { - if (this.protocol == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.protocol"); - else if (Configuration.doAutoCreate()) - this.protocol = new ImmunizationRecommendationRecommendationProtocolComponent(); // cc - return this.protocol; - } - - public boolean hasProtocol() { - return this.protocol != null && !this.protocol.isEmpty(); - } - - /** - * @param value {@link #protocol} (Contains information about the protocol under which the vaccine was administered.) - */ - public ImmunizationRecommendationRecommendationComponent setProtocol(ImmunizationRecommendationRecommendationProtocolComponent value) { - this.protocol = value; - return this; - } - - /** - * @return {@link #supportingImmunization} (Immunization event history that supports the status and recommendation.) - */ - public List getSupportingImmunization() { - if (this.supportingImmunization == null) - this.supportingImmunization = new ArrayList(); - return this.supportingImmunization; - } - - public boolean hasSupportingImmunization() { - if (this.supportingImmunization == null) - return false; - for (Reference item : this.supportingImmunization) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #supportingImmunization} (Immunization event history that supports the status and recommendation.) - */ - // syntactic sugar - public Reference addSupportingImmunization() { //3 - Reference t = new Reference(); - if (this.supportingImmunization == null) - this.supportingImmunization = new ArrayList(); - this.supportingImmunization.add(t); - return t; - } - - // syntactic sugar - public ImmunizationRecommendationRecommendationComponent addSupportingImmunization(Reference t) { //3 - if (t == null) - return this; - if (this.supportingImmunization == null) - this.supportingImmunization = new ArrayList(); - this.supportingImmunization.add(t); - return this; - } - - /** - * @return {@link #supportingImmunization} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Immunization event history that supports the status and recommendation.) - */ - public List getSupportingImmunizationTarget() { - if (this.supportingImmunizationTarget == null) - this.supportingImmunizationTarget = new ArrayList(); - return this.supportingImmunizationTarget; - } - - // syntactic sugar - /** - * @return {@link #supportingImmunization} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Immunization event history that supports the status and recommendation.) - */ - public Immunization addSupportingImmunizationTarget() { - Immunization r = new Immunization(); - if (this.supportingImmunizationTarget == null) - this.supportingImmunizationTarget = new ArrayList(); - this.supportingImmunizationTarget.add(r); - return r; - } - - /** - * @return {@link #supportingPatientInformation} (Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) - */ - public List getSupportingPatientInformation() { - if (this.supportingPatientInformation == null) - this.supportingPatientInformation = new ArrayList(); - return this.supportingPatientInformation; - } - - public boolean hasSupportingPatientInformation() { - if (this.supportingPatientInformation == null) - return false; - for (Reference item : this.supportingPatientInformation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #supportingPatientInformation} (Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) - */ - // syntactic sugar - public Reference addSupportingPatientInformation() { //3 - Reference t = new Reference(); - if (this.supportingPatientInformation == null) - this.supportingPatientInformation = new ArrayList(); - this.supportingPatientInformation.add(t); - return t; - } - - // syntactic sugar - public ImmunizationRecommendationRecommendationComponent addSupportingPatientInformation(Reference t) { //3 - if (t == null) - return this; - if (this.supportingPatientInformation == null) - this.supportingPatientInformation = new ArrayList(); - this.supportingPatientInformation.add(t); - return this; - } - - /** - * @return {@link #supportingPatientInformation} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) - */ - public List getSupportingPatientInformationTarget() { - if (this.supportingPatientInformationTarget == null) - this.supportingPatientInformationTarget = new ArrayList(); - return this.supportingPatientInformationTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("date", "dateTime", "The date the immunization recommendation was created.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("vaccineType", "CodeableConcept", "Vaccine that pertains to the recommendation.", 0, java.lang.Integer.MAX_VALUE, vaccineType)); - childrenList.add(new Property("doseNumber", "positiveInt", "This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose).", 0, java.lang.Integer.MAX_VALUE, doseNumber)); - childrenList.add(new Property("forecastStatus", "CodeableConcept", "Vaccine administration status.", 0, java.lang.Integer.MAX_VALUE, forecastStatus)); - childrenList.add(new Property("dateCriterion", "", "Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc.", 0, java.lang.Integer.MAX_VALUE, dateCriterion)); - childrenList.add(new Property("protocol", "", "Contains information about the protocol under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, protocol)); - childrenList.add(new Property("supportingImmunization", "Reference(Immunization)", "Immunization event history that supports the status and recommendation.", 0, java.lang.Integer.MAX_VALUE, supportingImmunization)); - childrenList.add(new Property("supportingPatientInformation", "Reference(Observation|AllergyIntolerance)", "Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.", 0, java.lang.Integer.MAX_VALUE, supportingPatientInformation)); - } - - public ImmunizationRecommendationRecommendationComponent copy() { - ImmunizationRecommendationRecommendationComponent dst = new ImmunizationRecommendationRecommendationComponent(); - copyValues(dst); - dst.date = date == null ? null : date.copy(); - dst.vaccineType = vaccineType == null ? null : vaccineType.copy(); - dst.doseNumber = doseNumber == null ? null : doseNumber.copy(); - dst.forecastStatus = forecastStatus == null ? null : forecastStatus.copy(); - if (dateCriterion != null) { - dst.dateCriterion = new ArrayList(); - for (ImmunizationRecommendationRecommendationDateCriterionComponent i : dateCriterion) - dst.dateCriterion.add(i.copy()); - }; - dst.protocol = protocol == null ? null : protocol.copy(); - if (supportingImmunization != null) { - dst.supportingImmunization = new ArrayList(); - for (Reference i : supportingImmunization) - dst.supportingImmunization.add(i.copy()); - }; - if (supportingPatientInformation != null) { - dst.supportingPatientInformation = new ArrayList(); - for (Reference i : supportingPatientInformation) - dst.supportingPatientInformation.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImmunizationRecommendationRecommendationComponent)) - return false; - ImmunizationRecommendationRecommendationComponent o = (ImmunizationRecommendationRecommendationComponent) other; - return compareDeep(date, o.date, true) && compareDeep(vaccineType, o.vaccineType, true) && compareDeep(doseNumber, o.doseNumber, true) - && compareDeep(forecastStatus, o.forecastStatus, true) && compareDeep(dateCriterion, o.dateCriterion, true) - && compareDeep(protocol, o.protocol, true) && compareDeep(supportingImmunization, o.supportingImmunization, true) - && compareDeep(supportingPatientInformation, o.supportingPatientInformation, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImmunizationRecommendationRecommendationComponent)) - return false; - ImmunizationRecommendationRecommendationComponent o = (ImmunizationRecommendationRecommendationComponent) other; - return compareValues(date, o.date, true) && compareValues(doseNumber, o.doseNumber, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (date == null || date.isEmpty()) && (vaccineType == null || vaccineType.isEmpty()) - && (doseNumber == null || doseNumber.isEmpty()) && (forecastStatus == null || forecastStatus.isEmpty()) - && (dateCriterion == null || dateCriterion.isEmpty()) && (protocol == null || protocol.isEmpty()) - && (supportingImmunization == null || supportingImmunization.isEmpty()) && (supportingPatientInformation == null || supportingPatientInformation.isEmpty()) - ; - } - - } - - @Block() - public static class ImmunizationRecommendationRecommendationDateCriterionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Date classification of recommendation - e.g. earliest date to give, latest date to give, etc. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Type of date", formalDefinition="Date classification of recommendation - e.g. earliest date to give, latest date to give, etc." ) - protected CodeableConcept code; - - /** - * Date recommendation. - */ - @Child(name = "value", type = {DateTimeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Recommended date", formalDefinition="Date recommendation." ) - protected DateTimeType value; - - private static final long serialVersionUID = 1036994566L; - - /* - * Constructor - */ - public ImmunizationRecommendationRecommendationDateCriterionComponent() { - super(); - } - - /* - * Constructor - */ - public ImmunizationRecommendationRecommendationDateCriterionComponent(CodeableConcept code, DateTimeType value) { - super(); - this.code = code; - this.value = value; - } - - /** - * @return {@link #code} (Date classification of recommendation - e.g. earliest date to give, latest date to give, etc.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationDateCriterionComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Date classification of recommendation - e.g. earliest date to give, latest date to give, etc.) - */ - public ImmunizationRecommendationRecommendationDateCriterionComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #value} (Date recommendation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DateTimeType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationDateCriterionComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DateTimeType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (Date recommendation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public ImmunizationRecommendationRecommendationDateCriterionComponent setValueElement(DateTimeType value) { - this.value = value; - return this; - } - - /** - * @return Date recommendation. - */ - public Date getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value Date recommendation. - */ - public ImmunizationRecommendationRecommendationDateCriterionComponent setValue(Date value) { - if (this.value == null) - this.value = new DateTimeType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "Date classification of recommendation - e.g. earliest date to give, latest date to give, etc.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("value", "dateTime", "Date recommendation.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public ImmunizationRecommendationRecommendationDateCriterionComponent copy() { - ImmunizationRecommendationRecommendationDateCriterionComponent dst = new ImmunizationRecommendationRecommendationDateCriterionComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImmunizationRecommendationRecommendationDateCriterionComponent)) - return false; - ImmunizationRecommendationRecommendationDateCriterionComponent o = (ImmunizationRecommendationRecommendationDateCriterionComponent) other; - return compareDeep(code, o.code, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImmunizationRecommendationRecommendationDateCriterionComponent)) - return false; - ImmunizationRecommendationRecommendationDateCriterionComponent o = (ImmunizationRecommendationRecommendationDateCriterionComponent) other; - return compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - } - - @Block() - public static class ImmunizationRecommendationRecommendationProtocolComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. - */ - @Child(name = "doseSequence", type = {IntegerType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Number of dose within sequence", formalDefinition="Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol." ) - protected IntegerType doseSequence; - - /** - * Contains the description about the protocol under which the vaccine was administered. - */ - @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Protocol details", formalDefinition="Contains the description about the protocol under which the vaccine was administered." ) - protected StringType description; - - /** - * Indicates the authority who published the protocol? E.g. ACIP. - */ - @Child(name = "authority", type = {Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Who is responsible for protocol", formalDefinition="Indicates the authority who published the protocol? E.g. ACIP." ) - protected Reference authority; - - /** - * The actual object that is the target of the reference (Indicates the authority who published the protocol? E.g. ACIP.) - */ - protected Organization authorityTarget; - - /** - * One possible path to achieve presumed immunity against a disease - within the context of an authority. - */ - @Child(name = "series", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Name of vaccination series", formalDefinition="One possible path to achieve presumed immunity against a disease - within the context of an authority." ) - protected StringType series; - - private static final long serialVersionUID = -512702014L; - - /* - * Constructor - */ - public ImmunizationRecommendationRecommendationProtocolComponent() { - super(); - } - - /** - * @return {@link #doseSequence} (Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value - */ - public IntegerType getDoseSequenceElement() { - if (this.doseSequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.doseSequence"); - else if (Configuration.doAutoCreate()) - this.doseSequence = new IntegerType(); // bb - return this.doseSequence; - } - - public boolean hasDoseSequenceElement() { - return this.doseSequence != null && !this.doseSequence.isEmpty(); - } - - public boolean hasDoseSequence() { - return this.doseSequence != null && !this.doseSequence.isEmpty(); - } - - /** - * @param value {@link #doseSequence} (Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value - */ - public ImmunizationRecommendationRecommendationProtocolComponent setDoseSequenceElement(IntegerType value) { - this.doseSequence = value; - return this; - } - - /** - * @return Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. - */ - public int getDoseSequence() { - return this.doseSequence == null || this.doseSequence.isEmpty() ? 0 : this.doseSequence.getValue(); - } - - /** - * @param value Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. - */ - public ImmunizationRecommendationRecommendationProtocolComponent setDoseSequence(int value) { - if (this.doseSequence == null) - this.doseSequence = new IntegerType(); - this.doseSequence.setValue(value); - return this; - } - - /** - * @return {@link #description} (Contains the description about the protocol under which the vaccine was administered.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Contains the description about the protocol under which the vaccine was administered.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ImmunizationRecommendationRecommendationProtocolComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Contains the description about the protocol under which the vaccine was administered. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Contains the description about the protocol under which the vaccine was administered. - */ - public ImmunizationRecommendationRecommendationProtocolComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #authority} (Indicates the authority who published the protocol? E.g. ACIP.) - */ - public Reference getAuthority() { - if (this.authority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.authority"); - else if (Configuration.doAutoCreate()) - this.authority = new Reference(); // cc - return this.authority; - } - - public boolean hasAuthority() { - return this.authority != null && !this.authority.isEmpty(); - } - - /** - * @param value {@link #authority} (Indicates the authority who published the protocol? E.g. ACIP.) - */ - public ImmunizationRecommendationRecommendationProtocolComponent setAuthority(Reference value) { - this.authority = value; - return this; - } - - /** - * @return {@link #authority} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates the authority who published the protocol? E.g. ACIP.) - */ - public Organization getAuthorityTarget() { - if (this.authorityTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.authority"); - else if (Configuration.doAutoCreate()) - this.authorityTarget = new Organization(); // aa - return this.authorityTarget; - } - - /** - * @param value {@link #authority} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates the authority who published the protocol? E.g. ACIP.) - */ - public ImmunizationRecommendationRecommendationProtocolComponent setAuthorityTarget(Organization value) { - this.authorityTarget = value; - return this; - } - - /** - * @return {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value - */ - public StringType getSeriesElement() { - if (this.series == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.series"); - else if (Configuration.doAutoCreate()) - this.series = new StringType(); // bb - return this.series; - } - - public boolean hasSeriesElement() { - return this.series != null && !this.series.isEmpty(); - } - - public boolean hasSeries() { - return this.series != null && !this.series.isEmpty(); - } - - /** - * @param value {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value - */ - public ImmunizationRecommendationRecommendationProtocolComponent setSeriesElement(StringType value) { - this.series = value; - return this; - } - - /** - * @return One possible path to achieve presumed immunity against a disease - within the context of an authority. - */ - public String getSeries() { - return this.series == null ? null : this.series.getValue(); - } - - /** - * @param value One possible path to achieve presumed immunity against a disease - within the context of an authority. - */ - public ImmunizationRecommendationRecommendationProtocolComponent setSeries(String value) { - if (Utilities.noString(value)) - this.series = null; - else { - if (this.series == null) - this.series = new StringType(); - this.series.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("doseSequence", "integer", "Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol.", 0, java.lang.Integer.MAX_VALUE, doseSequence)); - childrenList.add(new Property("description", "string", "Contains the description about the protocol under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("authority", "Reference(Organization)", "Indicates the authority who published the protocol? E.g. ACIP.", 0, java.lang.Integer.MAX_VALUE, authority)); - childrenList.add(new Property("series", "string", "One possible path to achieve presumed immunity against a disease - within the context of an authority.", 0, java.lang.Integer.MAX_VALUE, series)); - } - - public ImmunizationRecommendationRecommendationProtocolComponent copy() { - ImmunizationRecommendationRecommendationProtocolComponent dst = new ImmunizationRecommendationRecommendationProtocolComponent(); - copyValues(dst); - dst.doseSequence = doseSequence == null ? null : doseSequence.copy(); - dst.description = description == null ? null : description.copy(); - dst.authority = authority == null ? null : authority.copy(); - dst.series = series == null ? null : series.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImmunizationRecommendationRecommendationProtocolComponent)) - return false; - ImmunizationRecommendationRecommendationProtocolComponent o = (ImmunizationRecommendationRecommendationProtocolComponent) other; - return compareDeep(doseSequence, o.doseSequence, true) && compareDeep(description, o.description, true) - && compareDeep(authority, o.authority, true) && compareDeep(series, o.series, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImmunizationRecommendationRecommendationProtocolComponent)) - return false; - ImmunizationRecommendationRecommendationProtocolComponent o = (ImmunizationRecommendationRecommendationProtocolComponent) other; - return compareValues(doseSequence, o.doseSequence, true) && compareValues(description, o.description, true) - && compareValues(series, o.series, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (doseSequence == null || doseSequence.isEmpty()) && (description == null || description.isEmpty()) - && (authority == null || authority.isEmpty()) && (series == null || series.isEmpty()); - } - - } - - /** - * A unique identifier assigned to this particular recommendation record. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business identifier", formalDefinition="A unique identifier assigned to this particular recommendation record." ) - protected List identifier; - - /** - * The patient for whom the recommendations are for. - */ - @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1) - @Description(shortDefinition="Who this profile is for", formalDefinition="The patient for whom the recommendations are for." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient for whom the recommendations are for.) - */ - protected Patient patientTarget; - - /** - * Vaccine administration recommendations. - */ - @Child(name = "recommendation", type = {}, order=2, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Vaccine administration recommendations", formalDefinition="Vaccine administration recommendations." ) - protected List recommendation; - - private static final long serialVersionUID = 641058495L; - - /* - * Constructor - */ - public ImmunizationRecommendation() { - super(); - } - - /* - * Constructor - */ - public ImmunizationRecommendation(Reference patient) { - super(); - this.patient = patient; - } - - /** - * @return {@link #identifier} (A unique identifier assigned to this particular recommendation record.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (A unique identifier assigned to this particular recommendation record.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public ImmunizationRecommendation addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #patient} (The patient for whom the recommendations are for.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendation.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The patient for whom the recommendations are for.) - */ - public ImmunizationRecommendation setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient for whom the recommendations are for.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendation.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient for whom the recommendations are for.) - */ - public ImmunizationRecommendation setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #recommendation} (Vaccine administration recommendations.) - */ - public List getRecommendation() { - if (this.recommendation == null) - this.recommendation = new ArrayList(); - return this.recommendation; - } - - public boolean hasRecommendation() { - if (this.recommendation == null) - return false; - for (ImmunizationRecommendationRecommendationComponent item : this.recommendation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #recommendation} (Vaccine administration recommendations.) - */ - // syntactic sugar - public ImmunizationRecommendationRecommendationComponent addRecommendation() { //3 - ImmunizationRecommendationRecommendationComponent t = new ImmunizationRecommendationRecommendationComponent(); - if (this.recommendation == null) - this.recommendation = new ArrayList(); - this.recommendation.add(t); - return t; - } - - // syntactic sugar - public ImmunizationRecommendation addRecommendation(ImmunizationRecommendationRecommendationComponent t) { //3 - if (t == null) - return this; - if (this.recommendation == null) - this.recommendation = new ArrayList(); - this.recommendation.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "A unique identifier assigned to this particular recommendation record.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient for whom the recommendations are for.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("recommendation", "", "Vaccine administration recommendations.", 0, java.lang.Integer.MAX_VALUE, recommendation)); - } - - public ImmunizationRecommendation copy() { - ImmunizationRecommendation dst = new ImmunizationRecommendation(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - if (recommendation != null) { - dst.recommendation = new ArrayList(); - for (ImmunizationRecommendationRecommendationComponent i : recommendation) - dst.recommendation.add(i.copy()); - }; - return dst; - } - - protected ImmunizationRecommendation typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImmunizationRecommendation)) - return false; - ImmunizationRecommendation o = (ImmunizationRecommendation) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(recommendation, o.recommendation, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImmunizationRecommendation)) - return false; - ImmunizationRecommendation o = (ImmunizationRecommendation) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) - && (recommendation == null || recommendation.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ImmunizationRecommendation; - } - - @SearchParamDefinition(name="information", path="ImmunizationRecommendation.recommendation.supportingPatientInformation", description="Patient observations supporting recommendation", type="reference" ) - public static final String SP_INFORMATION = "information"; - @SearchParamDefinition(name="dose-sequence", path="ImmunizationRecommendation.recommendation.protocol.doseSequence", description="Number of dose within sequence", type="token" ) - public static final String SP_DOSESEQUENCE = "dose-sequence"; - @SearchParamDefinition(name="patient", path="ImmunizationRecommendation.patient", description="Who this profile is for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="support", path="ImmunizationRecommendation.recommendation.supportingImmunization", description="Past immunizations supporting recommendation", type="reference" ) - public static final String SP_SUPPORT = "support"; - @SearchParamDefinition(name="vaccine-type", path="ImmunizationRecommendation.recommendation.vaccineType", description="Vaccine recommendation applies to", type="token" ) - public static final String SP_VACCINETYPE = "vaccine-type"; - @SearchParamDefinition(name="status", path="ImmunizationRecommendation.recommendation.forecastStatus", description="Vaccine administration status", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="dose-number", path="ImmunizationRecommendation.recommendation.doseNumber", description="Recommended dose number", type="number" ) - public static final String SP_DOSENUMBER = "dose-number"; - @SearchParamDefinition(name="subject", path="ImmunizationRecommendation.patient", description="Who this profile is for", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="date", path="ImmunizationRecommendation.recommendation.date", description="Date recommendation created", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="identifier", path="ImmunizationRecommendation.identifier", description="Business identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A patient's point-of-time immunization status and recommendation with optional supporting justification. + */ +@ResourceDef(name="ImmunizationRecommendation", profile="http://hl7.org/fhir/Profile/ImmunizationRecommendation") +public class ImmunizationRecommendation extends DomainResource { + + @Block() + public static class ImmunizationRecommendationRecommendationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The date the immunization recommendation was created. + */ + @Child(name = "date", type = {DateTimeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Date recommendation created", formalDefinition="The date the immunization recommendation was created." ) + protected DateTimeType date; + + /** + * Vaccine that pertains to the recommendation. + */ + @Child(name = "vaccineType", type = {CodeableConcept.class}, order=2, min=1, max=1) + @Description(shortDefinition="Vaccine recommendation applies to", formalDefinition="Vaccine that pertains to the recommendation." ) + protected CodeableConcept vaccineType; + + /** + * This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). + */ + @Child(name = "doseNumber", type = {PositiveIntType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Recommended dose number", formalDefinition="This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose)." ) + protected PositiveIntType doseNumber; + + /** + * Vaccine administration status. + */ + @Child(name = "forecastStatus", type = {CodeableConcept.class}, order=4, min=1, max=1) + @Description(shortDefinition="Vaccine administration status", formalDefinition="Vaccine administration status." ) + protected CodeableConcept forecastStatus; + + /** + * Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc. + */ + @Child(name = "dateCriterion", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Dates governing proposed immunization", formalDefinition="Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc." ) + protected List dateCriterion; + + /** + * Contains information about the protocol under which the vaccine was administered. + */ + @Child(name = "protocol", type = {}, order=6, min=0, max=1) + @Description(shortDefinition="Protocol used by recommendation", formalDefinition="Contains information about the protocol under which the vaccine was administered." ) + protected ImmunizationRecommendationRecommendationProtocolComponent protocol; + + /** + * Immunization event history that supports the status and recommendation. + */ + @Child(name = "supportingImmunization", type = {Immunization.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Past immunizations supporting recommendation", formalDefinition="Immunization event history that supports the status and recommendation." ) + protected List supportingImmunization; + /** + * The actual objects that are the target of the reference (Immunization event history that supports the status and recommendation.) + */ + protected List supportingImmunizationTarget; + + + /** + * Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information. + */ + @Child(name = "supportingPatientInformation", type = {Observation.class, AllergyIntolerance.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Patient observations supporting recommendation", formalDefinition="Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information." ) + protected List supportingPatientInformation; + /** + * The actual objects that are the target of the reference (Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) + */ + protected List supportingPatientInformationTarget; + + + private static final long serialVersionUID = 366360557L; + + /* + * Constructor + */ + public ImmunizationRecommendationRecommendationComponent() { + super(); + } + + /* + * Constructor + */ + public ImmunizationRecommendationRecommendationComponent(DateTimeType date, CodeableConcept vaccineType, CodeableConcept forecastStatus) { + super(); + this.date = date; + this.vaccineType = vaccineType; + this.forecastStatus = forecastStatus; + } + + /** + * @return {@link #date} (The date the immunization recommendation was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date the immunization recommendation was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ImmunizationRecommendationRecommendationComponent setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date the immunization recommendation was created. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date the immunization recommendation was created. + */ + public ImmunizationRecommendationRecommendationComponent setDate(Date value) { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + return this; + } + + /** + * @return {@link #vaccineType} (Vaccine that pertains to the recommendation.) + */ + public CodeableConcept getVaccineType() { + if (this.vaccineType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.vaccineType"); + else if (Configuration.doAutoCreate()) + this.vaccineType = new CodeableConcept(); // cc + return this.vaccineType; + } + + public boolean hasVaccineType() { + return this.vaccineType != null && !this.vaccineType.isEmpty(); + } + + /** + * @param value {@link #vaccineType} (Vaccine that pertains to the recommendation.) + */ + public ImmunizationRecommendationRecommendationComponent setVaccineType(CodeableConcept value) { + this.vaccineType = value; + return this; + } + + /** + * @return {@link #doseNumber} (This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose).). This is the underlying object with id, value and extensions. The accessor "getDoseNumber" gives direct access to the value + */ + public PositiveIntType getDoseNumberElement() { + if (this.doseNumber == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.doseNumber"); + else if (Configuration.doAutoCreate()) + this.doseNumber = new PositiveIntType(); // bb + return this.doseNumber; + } + + public boolean hasDoseNumberElement() { + return this.doseNumber != null && !this.doseNumber.isEmpty(); + } + + public boolean hasDoseNumber() { + return this.doseNumber != null && !this.doseNumber.isEmpty(); + } + + /** + * @param value {@link #doseNumber} (This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose).). This is the underlying object with id, value and extensions. The accessor "getDoseNumber" gives direct access to the value + */ + public ImmunizationRecommendationRecommendationComponent setDoseNumberElement(PositiveIntType value) { + this.doseNumber = value; + return this; + } + + /** + * @return This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). + */ + public int getDoseNumber() { + return this.doseNumber == null || this.doseNumber.isEmpty() ? 0 : this.doseNumber.getValue(); + } + + /** + * @param value This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). + */ + public ImmunizationRecommendationRecommendationComponent setDoseNumber(int value) { + if (this.doseNumber == null) + this.doseNumber = new PositiveIntType(); + this.doseNumber.setValue(value); + return this; + } + + /** + * @return {@link #forecastStatus} (Vaccine administration status.) + */ + public CodeableConcept getForecastStatus() { + if (this.forecastStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.forecastStatus"); + else if (Configuration.doAutoCreate()) + this.forecastStatus = new CodeableConcept(); // cc + return this.forecastStatus; + } + + public boolean hasForecastStatus() { + return this.forecastStatus != null && !this.forecastStatus.isEmpty(); + } + + /** + * @param value {@link #forecastStatus} (Vaccine administration status.) + */ + public ImmunizationRecommendationRecommendationComponent setForecastStatus(CodeableConcept value) { + this.forecastStatus = value; + return this; + } + + /** + * @return {@link #dateCriterion} (Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc.) + */ + public List getDateCriterion() { + if (this.dateCriterion == null) + this.dateCriterion = new ArrayList(); + return this.dateCriterion; + } + + public boolean hasDateCriterion() { + if (this.dateCriterion == null) + return false; + for (ImmunizationRecommendationRecommendationDateCriterionComponent item : this.dateCriterion) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dateCriterion} (Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc.) + */ + // syntactic sugar + public ImmunizationRecommendationRecommendationDateCriterionComponent addDateCriterion() { //3 + ImmunizationRecommendationRecommendationDateCriterionComponent t = new ImmunizationRecommendationRecommendationDateCriterionComponent(); + if (this.dateCriterion == null) + this.dateCriterion = new ArrayList(); + this.dateCriterion.add(t); + return t; + } + + // syntactic sugar + public ImmunizationRecommendationRecommendationComponent addDateCriterion(ImmunizationRecommendationRecommendationDateCriterionComponent t) { //3 + if (t == null) + return this; + if (this.dateCriterion == null) + this.dateCriterion = new ArrayList(); + this.dateCriterion.add(t); + return this; + } + + /** + * @return {@link #protocol} (Contains information about the protocol under which the vaccine was administered.) + */ + public ImmunizationRecommendationRecommendationProtocolComponent getProtocol() { + if (this.protocol == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.protocol"); + else if (Configuration.doAutoCreate()) + this.protocol = new ImmunizationRecommendationRecommendationProtocolComponent(); // cc + return this.protocol; + } + + public boolean hasProtocol() { + return this.protocol != null && !this.protocol.isEmpty(); + } + + /** + * @param value {@link #protocol} (Contains information about the protocol under which the vaccine was administered.) + */ + public ImmunizationRecommendationRecommendationComponent setProtocol(ImmunizationRecommendationRecommendationProtocolComponent value) { + this.protocol = value; + return this; + } + + /** + * @return {@link #supportingImmunization} (Immunization event history that supports the status and recommendation.) + */ + public List getSupportingImmunization() { + if (this.supportingImmunization == null) + this.supportingImmunization = new ArrayList(); + return this.supportingImmunization; + } + + public boolean hasSupportingImmunization() { + if (this.supportingImmunization == null) + return false; + for (Reference item : this.supportingImmunization) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #supportingImmunization} (Immunization event history that supports the status and recommendation.) + */ + // syntactic sugar + public Reference addSupportingImmunization() { //3 + Reference t = new Reference(); + if (this.supportingImmunization == null) + this.supportingImmunization = new ArrayList(); + this.supportingImmunization.add(t); + return t; + } + + // syntactic sugar + public ImmunizationRecommendationRecommendationComponent addSupportingImmunization(Reference t) { //3 + if (t == null) + return this; + if (this.supportingImmunization == null) + this.supportingImmunization = new ArrayList(); + this.supportingImmunization.add(t); + return this; + } + + /** + * @return {@link #supportingImmunization} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Immunization event history that supports the status and recommendation.) + */ + public List getSupportingImmunizationTarget() { + if (this.supportingImmunizationTarget == null) + this.supportingImmunizationTarget = new ArrayList(); + return this.supportingImmunizationTarget; + } + + // syntactic sugar + /** + * @return {@link #supportingImmunization} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Immunization event history that supports the status and recommendation.) + */ + public Immunization addSupportingImmunizationTarget() { + Immunization r = new Immunization(); + if (this.supportingImmunizationTarget == null) + this.supportingImmunizationTarget = new ArrayList(); + this.supportingImmunizationTarget.add(r); + return r; + } + + /** + * @return {@link #supportingPatientInformation} (Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) + */ + public List getSupportingPatientInformation() { + if (this.supportingPatientInformation == null) + this.supportingPatientInformation = new ArrayList(); + return this.supportingPatientInformation; + } + + public boolean hasSupportingPatientInformation() { + if (this.supportingPatientInformation == null) + return false; + for (Reference item : this.supportingPatientInformation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #supportingPatientInformation} (Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) + */ + // syntactic sugar + public Reference addSupportingPatientInformation() { //3 + Reference t = new Reference(); + if (this.supportingPatientInformation == null) + this.supportingPatientInformation = new ArrayList(); + this.supportingPatientInformation.add(t); + return t; + } + + // syntactic sugar + public ImmunizationRecommendationRecommendationComponent addSupportingPatientInformation(Reference t) { //3 + if (t == null) + return this; + if (this.supportingPatientInformation == null) + this.supportingPatientInformation = new ArrayList(); + this.supportingPatientInformation.add(t); + return this; + } + + /** + * @return {@link #supportingPatientInformation} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) + */ + public List getSupportingPatientInformationTarget() { + if (this.supportingPatientInformationTarget == null) + this.supportingPatientInformationTarget = new ArrayList(); + return this.supportingPatientInformationTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("date", "dateTime", "The date the immunization recommendation was created.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("vaccineType", "CodeableConcept", "Vaccine that pertains to the recommendation.", 0, java.lang.Integer.MAX_VALUE, vaccineType)); + childrenList.add(new Property("doseNumber", "positiveInt", "This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose).", 0, java.lang.Integer.MAX_VALUE, doseNumber)); + childrenList.add(new Property("forecastStatus", "CodeableConcept", "Vaccine administration status.", 0, java.lang.Integer.MAX_VALUE, forecastStatus)); + childrenList.add(new Property("dateCriterion", "", "Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc.", 0, java.lang.Integer.MAX_VALUE, dateCriterion)); + childrenList.add(new Property("protocol", "", "Contains information about the protocol under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, protocol)); + childrenList.add(new Property("supportingImmunization", "Reference(Immunization)", "Immunization event history that supports the status and recommendation.", 0, java.lang.Integer.MAX_VALUE, supportingImmunization)); + childrenList.add(new Property("supportingPatientInformation", "Reference(Observation|AllergyIntolerance)", "Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.", 0, java.lang.Integer.MAX_VALUE, supportingPatientInformation)); + } + + public ImmunizationRecommendationRecommendationComponent copy() { + ImmunizationRecommendationRecommendationComponent dst = new ImmunizationRecommendationRecommendationComponent(); + copyValues(dst); + dst.date = date == null ? null : date.copy(); + dst.vaccineType = vaccineType == null ? null : vaccineType.copy(); + dst.doseNumber = doseNumber == null ? null : doseNumber.copy(); + dst.forecastStatus = forecastStatus == null ? null : forecastStatus.copy(); + if (dateCriterion != null) { + dst.dateCriterion = new ArrayList(); + for (ImmunizationRecommendationRecommendationDateCriterionComponent i : dateCriterion) + dst.dateCriterion.add(i.copy()); + }; + dst.protocol = protocol == null ? null : protocol.copy(); + if (supportingImmunization != null) { + dst.supportingImmunization = new ArrayList(); + for (Reference i : supportingImmunization) + dst.supportingImmunization.add(i.copy()); + }; + if (supportingPatientInformation != null) { + dst.supportingPatientInformation = new ArrayList(); + for (Reference i : supportingPatientInformation) + dst.supportingPatientInformation.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImmunizationRecommendationRecommendationComponent)) + return false; + ImmunizationRecommendationRecommendationComponent o = (ImmunizationRecommendationRecommendationComponent) other; + return compareDeep(date, o.date, true) && compareDeep(vaccineType, o.vaccineType, true) && compareDeep(doseNumber, o.doseNumber, true) + && compareDeep(forecastStatus, o.forecastStatus, true) && compareDeep(dateCriterion, o.dateCriterion, true) + && compareDeep(protocol, o.protocol, true) && compareDeep(supportingImmunization, o.supportingImmunization, true) + && compareDeep(supportingPatientInformation, o.supportingPatientInformation, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImmunizationRecommendationRecommendationComponent)) + return false; + ImmunizationRecommendationRecommendationComponent o = (ImmunizationRecommendationRecommendationComponent) other; + return compareValues(date, o.date, true) && compareValues(doseNumber, o.doseNumber, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (date == null || date.isEmpty()) && (vaccineType == null || vaccineType.isEmpty()) + && (doseNumber == null || doseNumber.isEmpty()) && (forecastStatus == null || forecastStatus.isEmpty()) + && (dateCriterion == null || dateCriterion.isEmpty()) && (protocol == null || protocol.isEmpty()) + && (supportingImmunization == null || supportingImmunization.isEmpty()) && (supportingPatientInformation == null || supportingPatientInformation.isEmpty()) + ; + } + + } + + @Block() + public static class ImmunizationRecommendationRecommendationDateCriterionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Date classification of recommendation - e.g. earliest date to give, latest date to give, etc. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Type of date", formalDefinition="Date classification of recommendation - e.g. earliest date to give, latest date to give, etc." ) + protected CodeableConcept code; + + /** + * Date recommendation. + */ + @Child(name = "value", type = {DateTimeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Recommended date", formalDefinition="Date recommendation." ) + protected DateTimeType value; + + private static final long serialVersionUID = 1036994566L; + + /* + * Constructor + */ + public ImmunizationRecommendationRecommendationDateCriterionComponent() { + super(); + } + + /* + * Constructor + */ + public ImmunizationRecommendationRecommendationDateCriterionComponent(CodeableConcept code, DateTimeType value) { + super(); + this.code = code; + this.value = value; + } + + /** + * @return {@link #code} (Date classification of recommendation - e.g. earliest date to give, latest date to give, etc.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationDateCriterionComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Date classification of recommendation - e.g. earliest date to give, latest date to give, etc.) + */ + public ImmunizationRecommendationRecommendationDateCriterionComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #value} (Date recommendation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DateTimeType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationDateCriterionComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DateTimeType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (Date recommendation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public ImmunizationRecommendationRecommendationDateCriterionComponent setValueElement(DateTimeType value) { + this.value = value; + return this; + } + + /** + * @return Date recommendation. + */ + public Date getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value Date recommendation. + */ + public ImmunizationRecommendationRecommendationDateCriterionComponent setValue(Date value) { + if (this.value == null) + this.value = new DateTimeType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "Date classification of recommendation - e.g. earliest date to give, latest date to give, etc.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("value", "dateTime", "Date recommendation.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public ImmunizationRecommendationRecommendationDateCriterionComponent copy() { + ImmunizationRecommendationRecommendationDateCriterionComponent dst = new ImmunizationRecommendationRecommendationDateCriterionComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImmunizationRecommendationRecommendationDateCriterionComponent)) + return false; + ImmunizationRecommendationRecommendationDateCriterionComponent o = (ImmunizationRecommendationRecommendationDateCriterionComponent) other; + return compareDeep(code, o.code, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImmunizationRecommendationRecommendationDateCriterionComponent)) + return false; + ImmunizationRecommendationRecommendationDateCriterionComponent o = (ImmunizationRecommendationRecommendationDateCriterionComponent) other; + return compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + } + + @Block() + public static class ImmunizationRecommendationRecommendationProtocolComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. + */ + @Child(name = "doseSequence", type = {IntegerType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Number of dose within sequence", formalDefinition="Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol." ) + protected IntegerType doseSequence; + + /** + * Contains the description about the protocol under which the vaccine was administered. + */ + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Protocol details", formalDefinition="Contains the description about the protocol under which the vaccine was administered." ) + protected StringType description; + + /** + * Indicates the authority who published the protocol? E.g. ACIP. + */ + @Child(name = "authority", type = {Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Who is responsible for protocol", formalDefinition="Indicates the authority who published the protocol? E.g. ACIP." ) + protected Reference authority; + + /** + * The actual object that is the target of the reference (Indicates the authority who published the protocol? E.g. ACIP.) + */ + protected Organization authorityTarget; + + /** + * One possible path to achieve presumed immunity against a disease - within the context of an authority. + */ + @Child(name = "series", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Name of vaccination series", formalDefinition="One possible path to achieve presumed immunity against a disease - within the context of an authority." ) + protected StringType series; + + private static final long serialVersionUID = -512702014L; + + /* + * Constructor + */ + public ImmunizationRecommendationRecommendationProtocolComponent() { + super(); + } + + /** + * @return {@link #doseSequence} (Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value + */ + public IntegerType getDoseSequenceElement() { + if (this.doseSequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.doseSequence"); + else if (Configuration.doAutoCreate()) + this.doseSequence = new IntegerType(); // bb + return this.doseSequence; + } + + public boolean hasDoseSequenceElement() { + return this.doseSequence != null && !this.doseSequence.isEmpty(); + } + + public boolean hasDoseSequence() { + return this.doseSequence != null && !this.doseSequence.isEmpty(); + } + + /** + * @param value {@link #doseSequence} (Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value + */ + public ImmunizationRecommendationRecommendationProtocolComponent setDoseSequenceElement(IntegerType value) { + this.doseSequence = value; + return this; + } + + /** + * @return Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. + */ + public int getDoseSequence() { + return this.doseSequence == null || this.doseSequence.isEmpty() ? 0 : this.doseSequence.getValue(); + } + + /** + * @param value Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. + */ + public ImmunizationRecommendationRecommendationProtocolComponent setDoseSequence(int value) { + if (this.doseSequence == null) + this.doseSequence = new IntegerType(); + this.doseSequence.setValue(value); + return this; + } + + /** + * @return {@link #description} (Contains the description about the protocol under which the vaccine was administered.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Contains the description about the protocol under which the vaccine was administered.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ImmunizationRecommendationRecommendationProtocolComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Contains the description about the protocol under which the vaccine was administered. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Contains the description about the protocol under which the vaccine was administered. + */ + public ImmunizationRecommendationRecommendationProtocolComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #authority} (Indicates the authority who published the protocol? E.g. ACIP.) + */ + public Reference getAuthority() { + if (this.authority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.authority"); + else if (Configuration.doAutoCreate()) + this.authority = new Reference(); // cc + return this.authority; + } + + public boolean hasAuthority() { + return this.authority != null && !this.authority.isEmpty(); + } + + /** + * @param value {@link #authority} (Indicates the authority who published the protocol? E.g. ACIP.) + */ + public ImmunizationRecommendationRecommendationProtocolComponent setAuthority(Reference value) { + this.authority = value; + return this; + } + + /** + * @return {@link #authority} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates the authority who published the protocol? E.g. ACIP.) + */ + public Organization getAuthorityTarget() { + if (this.authorityTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.authority"); + else if (Configuration.doAutoCreate()) + this.authorityTarget = new Organization(); // aa + return this.authorityTarget; + } + + /** + * @param value {@link #authority} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates the authority who published the protocol? E.g. ACIP.) + */ + public ImmunizationRecommendationRecommendationProtocolComponent setAuthorityTarget(Organization value) { + this.authorityTarget = value; + return this; + } + + /** + * @return {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value + */ + public StringType getSeriesElement() { + if (this.series == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.series"); + else if (Configuration.doAutoCreate()) + this.series = new StringType(); // bb + return this.series; + } + + public boolean hasSeriesElement() { + return this.series != null && !this.series.isEmpty(); + } + + public boolean hasSeries() { + return this.series != null && !this.series.isEmpty(); + } + + /** + * @param value {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value + */ + public ImmunizationRecommendationRecommendationProtocolComponent setSeriesElement(StringType value) { + this.series = value; + return this; + } + + /** + * @return One possible path to achieve presumed immunity against a disease - within the context of an authority. + */ + public String getSeries() { + return this.series == null ? null : this.series.getValue(); + } + + /** + * @param value One possible path to achieve presumed immunity against a disease - within the context of an authority. + */ + public ImmunizationRecommendationRecommendationProtocolComponent setSeries(String value) { + if (Utilities.noString(value)) + this.series = null; + else { + if (this.series == null) + this.series = new StringType(); + this.series.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("doseSequence", "integer", "Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol.", 0, java.lang.Integer.MAX_VALUE, doseSequence)); + childrenList.add(new Property("description", "string", "Contains the description about the protocol under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("authority", "Reference(Organization)", "Indicates the authority who published the protocol? E.g. ACIP.", 0, java.lang.Integer.MAX_VALUE, authority)); + childrenList.add(new Property("series", "string", "One possible path to achieve presumed immunity against a disease - within the context of an authority.", 0, java.lang.Integer.MAX_VALUE, series)); + } + + public ImmunizationRecommendationRecommendationProtocolComponent copy() { + ImmunizationRecommendationRecommendationProtocolComponent dst = new ImmunizationRecommendationRecommendationProtocolComponent(); + copyValues(dst); + dst.doseSequence = doseSequence == null ? null : doseSequence.copy(); + dst.description = description == null ? null : description.copy(); + dst.authority = authority == null ? null : authority.copy(); + dst.series = series == null ? null : series.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImmunizationRecommendationRecommendationProtocolComponent)) + return false; + ImmunizationRecommendationRecommendationProtocolComponent o = (ImmunizationRecommendationRecommendationProtocolComponent) other; + return compareDeep(doseSequence, o.doseSequence, true) && compareDeep(description, o.description, true) + && compareDeep(authority, o.authority, true) && compareDeep(series, o.series, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImmunizationRecommendationRecommendationProtocolComponent)) + return false; + ImmunizationRecommendationRecommendationProtocolComponent o = (ImmunizationRecommendationRecommendationProtocolComponent) other; + return compareValues(doseSequence, o.doseSequence, true) && compareValues(description, o.description, true) + && compareValues(series, o.series, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (doseSequence == null || doseSequence.isEmpty()) && (description == null || description.isEmpty()) + && (authority == null || authority.isEmpty()) && (series == null || series.isEmpty()); + } + + } + + /** + * A unique identifier assigned to this particular recommendation record. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business identifier", formalDefinition="A unique identifier assigned to this particular recommendation record." ) + protected List identifier; + + /** + * The patient for whom the recommendations are for. + */ + @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1) + @Description(shortDefinition="Who this profile is for", formalDefinition="The patient for whom the recommendations are for." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient for whom the recommendations are for.) + */ + protected Patient patientTarget; + + /** + * Vaccine administration recommendations. + */ + @Child(name = "recommendation", type = {}, order=2, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Vaccine administration recommendations", formalDefinition="Vaccine administration recommendations." ) + protected List recommendation; + + private static final long serialVersionUID = 641058495L; + + /* + * Constructor + */ + public ImmunizationRecommendation() { + super(); + } + + /* + * Constructor + */ + public ImmunizationRecommendation(Reference patient) { + super(); + this.patient = patient; + } + + /** + * @return {@link #identifier} (A unique identifier assigned to this particular recommendation record.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (A unique identifier assigned to this particular recommendation record.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public ImmunizationRecommendation addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #patient} (The patient for whom the recommendations are for.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendation.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The patient for whom the recommendations are for.) + */ + public ImmunizationRecommendation setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient for whom the recommendations are for.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendation.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient for whom the recommendations are for.) + */ + public ImmunizationRecommendation setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #recommendation} (Vaccine administration recommendations.) + */ + public List getRecommendation() { + if (this.recommendation == null) + this.recommendation = new ArrayList(); + return this.recommendation; + } + + public boolean hasRecommendation() { + if (this.recommendation == null) + return false; + for (ImmunizationRecommendationRecommendationComponent item : this.recommendation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #recommendation} (Vaccine administration recommendations.) + */ + // syntactic sugar + public ImmunizationRecommendationRecommendationComponent addRecommendation() { //3 + ImmunizationRecommendationRecommendationComponent t = new ImmunizationRecommendationRecommendationComponent(); + if (this.recommendation == null) + this.recommendation = new ArrayList(); + this.recommendation.add(t); + return t; + } + + // syntactic sugar + public ImmunizationRecommendation addRecommendation(ImmunizationRecommendationRecommendationComponent t) { //3 + if (t == null) + return this; + if (this.recommendation == null) + this.recommendation = new ArrayList(); + this.recommendation.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "A unique identifier assigned to this particular recommendation record.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient for whom the recommendations are for.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("recommendation", "", "Vaccine administration recommendations.", 0, java.lang.Integer.MAX_VALUE, recommendation)); + } + + public ImmunizationRecommendation copy() { + ImmunizationRecommendation dst = new ImmunizationRecommendation(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + if (recommendation != null) { + dst.recommendation = new ArrayList(); + for (ImmunizationRecommendationRecommendationComponent i : recommendation) + dst.recommendation.add(i.copy()); + }; + return dst; + } + + protected ImmunizationRecommendation typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImmunizationRecommendation)) + return false; + ImmunizationRecommendation o = (ImmunizationRecommendation) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(recommendation, o.recommendation, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImmunizationRecommendation)) + return false; + ImmunizationRecommendation o = (ImmunizationRecommendation) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) + && (recommendation == null || recommendation.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ImmunizationRecommendation; + } + + @SearchParamDefinition(name="date", path="ImmunizationRecommendation.recommendation.date", description="Date recommendation created", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="ImmunizationRecommendation.identifier", description="Business identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="dose-sequence", path="ImmunizationRecommendation.recommendation.protocol.doseSequence", description="Number of dose within sequence", type="token" ) + public static final String SP_DOSESEQUENCE = "dose-sequence"; + @SearchParamDefinition(name="subject", path="ImmunizationRecommendation.patient", description="Who this profile is for", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="patient", path="ImmunizationRecommendation.patient", description="Who this profile is for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="vaccine-type", path="ImmunizationRecommendation.recommendation.vaccineType", description="Vaccine recommendation applies to", type="token" ) + public static final String SP_VACCINETYPE = "vaccine-type"; + @SearchParamDefinition(name="dose-number", path="ImmunizationRecommendation.recommendation.doseNumber", description="Recommended dose number", type="number" ) + public static final String SP_DOSENUMBER = "dose-number"; + @SearchParamDefinition(name="information", path="ImmunizationRecommendation.recommendation.supportingPatientInformation", description="Patient observations supporting recommendation", type="reference" ) + public static final String SP_INFORMATION = "information"; + @SearchParamDefinition(name="support", path="ImmunizationRecommendation.recommendation.supportingImmunization", description="Past immunizations supporting recommendation", type="reference" ) + public static final String SP_SUPPORT = "support"; + @SearchParamDefinition(name="status", path="ImmunizationRecommendation.recommendation.forecastStatus", description="Vaccine administration status", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/InstantType.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/InstantType.java index 802c3f259fb..cad6c0f4a54 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/InstantType.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/InstantType.java @@ -1,241 +1,220 @@ -/* -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; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import java.util.Calendar; -import java.util.Date; -import java.util.TimeZone; -import java.util.zip.DataFormatException; - -import org.hl7.fhir.instance.model.annotations.DatatypeDef; - -/** - * Represents a FHIR instant datatype. Valid precisions values for this type are: - *
    - *
  • {@link TemporalPrecisionEnum#SECOND} - *
  • {@link TemporalPrecisionEnum#MILLI} - *
- */ -@DatatypeDef(name="instant") -public class InstantType extends BaseDateTimeType { - - private static final long serialVersionUID = 3L; - - /** - * The default precision for this type - */ - public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.MILLI; - - /** - * Constructor which creates an InstantDt with no timne value. Note - * that unlike the default constructor for the Java {@link Date} or - * {@link Calendar} objects, this constructor does not initialize the object - * with the current time. - * - * @see #withCurrentTime() to create a new object that has been initialized - * with the current time. - */ - public InstantType() { - super(); - } - - /** - * Create a new DateTimeDt - */ - public InstantType(Calendar theCalendar) { - super(theCalendar.getTime(), DEFAULT_PRECISION, theCalendar.getTimeZone()); - } - - /** - * Create a new instance using the given date, precision level, and time zone - * - * @throws DataFormatException - * If the specified precision is not allowed for this type - */ - public InstantType(Date theDate, TemporalPrecisionEnum thePrecision, TimeZone theTimezone) { - super(theDate, thePrecision, theTimezone); - } - - - /** - * Create a new DateTimeDt using an existing value. Use this constructor with caution, - * as it may create more precision than warranted (since for example it is possible to pass in - * a DateTime with only a year, and this constructor will convert to an InstantDt with - * milliseconds precision). - */ - public InstantType(BaseDateTimeType theDateTime) { - // Do not call super(foo) here, we don't want to trigger a DataFormatException - setValue(theDateTime.getValue()); - setPrecision(DEFAULT_PRECISION); - setTimeZone(theDateTime.getTimeZone()); - } - - /** - * Create a new DateTimeDt with the given date/time and {@link TemporalPrecisionEnum#MILLI} precision - */ - public InstantType(Date theDate) { - super(theDate, DEFAULT_PRECISION, TimeZone.getDefault()); - } - - /** - * Constructor which accepts a date value and a precision value. Valid - * precisions values for this type are: - *
    - *
  • {@link TemporalPrecisionEnum#SECOND} - *
  • {@link TemporalPrecisionEnum#MILLI} - *
- */ - public InstantType(Date theDate, TemporalPrecisionEnum thePrecision) { - setValue(theDate); - setPrecision(thePrecision); - setTimeZone(TimeZone.getDefault()); - } - - /** - * Create a new InstantDt from a string value - * - * @param theString - * The string representation of the string. Must be in a valid - * format according to the FHIR specification - * @throws DataFormatException - */ - public InstantType(String theString) { - super(theString); - } - - /** - * Invokes {@link Date#after(Date)} on the contained Date against the given - * date - * - * @throws NullPointerException - * If the {@link #getValue() contained Date} is null - */ - public boolean after(Date theDate) { - return getValue().after(theDate); - } - - /** - * Invokes {@link Date#before(Date)} on the contained Date against the given - * date - * - * @throws NullPointerException - * If the {@link #getValue() contained Date} is null - */ - public boolean before(Date theDate) { - return getValue().before(theDate); - } - - /** - * Sets the value of this instant to the current time (from the system - * clock) and the local/default timezone (as retrieved using - * {@link TimeZone#getDefault()}. This TimeZone is generally obtained from - * the underlying OS. - */ - public void setToCurrentTimeInLocalTimeZone() { - setValue(new Date()); - setTimeZone(TimeZone.getDefault()); - } - - @Override - boolean isPrecisionAllowed(TemporalPrecisionEnum thePrecision) { - switch (thePrecision) { - case SECOND: - case MILLI: - return true; - default: - return false; - } - } - - /** - * Factory method which creates a new InstantDt with millisecond precision and initializes it with the - * current time and the system local timezone. - */ - public static InstantType withCurrentTime() { - return new InstantType(new Date(), TemporalPrecisionEnum.MILLI, TimeZone.getDefault()); - } - - /** - * Returns the default precision for this datatype - * - * @see #DEFAULT_PRECISION - */ - @Override - protected TemporalPrecisionEnum getDefaultPrecisionForDatatype() { - return DEFAULT_PRECISION; - } - - - @Override - public InstantType copy() { - return new InstantType(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; - } - -} +/* +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; + +import java.util.Calendar; +import java.util.Date; +import java.util.TimeZone; +import java.util.zip.DataFormatException; + +import org.hl7.fhir.instance.model.annotations.DatatypeDef; + +/** + * Represents a FHIR instant datatype. Valid precisions values for this type are: + *
    + *
  • {@link TemporalPrecisionEnum#SECOND} + *
  • {@link TemporalPrecisionEnum#MILLI} + *
+ */ +@DatatypeDef(name="instant") +public class InstantType extends BaseDateTimeType { + + private static final long serialVersionUID = 3L; + + /** + * The default precision for this type + */ + public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.MILLI; + + /** + * Constructor which creates an InstantDt with no timne value. Note + * that unlike the default constructor for the Java {@link Date} or + * {@link Calendar} objects, this constructor does not initialize the object + * with the current time. + * + * @see #withCurrentTime() to create a new object that has been initialized + * with the current time. + */ + public InstantType() { + super(); + } + + /** + * Create a new DateTimeDt + */ + public InstantType(Calendar theCalendar) { + super(theCalendar.getTime(), DEFAULT_PRECISION, theCalendar.getTimeZone()); + } + + /** + * Create a new instance using the given date, precision level, and time zone + * + * @throws DataFormatException + * If the specified precision is not allowed for this type + */ + public InstantType(Date theDate, TemporalPrecisionEnum thePrecision, TimeZone theTimezone) { + super(theDate, thePrecision, theTimezone); + } + + + /** + * Create a new DateTimeDt using an existing value. Use this constructor with caution, + * as it may create more precision than warranted (since for example it is possible to pass in + * a DateTime with only a year, and this constructor will convert to an InstantDt with + * milliseconds precision). + */ + public InstantType(BaseDateTimeType theDateTime) { + // Do not call super(foo) here, we don't want to trigger a DataFormatException + setValue(theDateTime.getValue()); + setPrecision(DEFAULT_PRECISION); + setTimeZone(theDateTime.getTimeZone()); + } + + /** + * Create a new DateTimeDt with the given date/time and {@link TemporalPrecisionEnum#MILLI} precision + */ + public InstantType(Date theDate) { + super(theDate, DEFAULT_PRECISION, TimeZone.getDefault()); + } + + /** + * Constructor which accepts a date value and a precision value. Valid + * precisions values for this type are: + *
    + *
  • {@link TemporalPrecisionEnum#SECOND} + *
  • {@link TemporalPrecisionEnum#MILLI} + *
+ */ + public InstantType(Date theDate, TemporalPrecisionEnum thePrecision) { + setValue(theDate); + setPrecision(thePrecision); + setTimeZone(TimeZone.getDefault()); + } + + /** + * Create a new InstantDt from a string value + * + * @param theString + * The string representation of the string. Must be in a valid + * format according to the FHIR specification + * @throws DataFormatException + */ + public InstantType(String theString) { + super(theString); + } + + /** + * Invokes {@link Date#after(Date)} on the contained Date against the given + * date + * + * @throws NullPointerException + * If the {@link #getValue() contained Date} is null + */ + public boolean after(Date theDate) { + return getValue().after(theDate); + } + + /** + * Invokes {@link Date#before(Date)} on the contained Date against the given + * date + * + * @throws NullPointerException + * If the {@link #getValue() contained Date} is null + */ + public boolean before(Date theDate) { + return getValue().before(theDate); + } + + /** + * Sets the value of this instant to the current time (from the system + * clock) and the local/default timezone (as retrieved using + * {@link TimeZone#getDefault()}. This TimeZone is generally obtained from + * the underlying OS. + */ + public void setToCurrentTimeInLocalTimeZone() { + setValue(new Date()); + setTimeZone(TimeZone.getDefault()); + } + + @Override + boolean isPrecisionAllowed(TemporalPrecisionEnum thePrecision) { + switch (thePrecision) { + case SECOND: + case MILLI: + return true; + default: + return false; + } + } + + /** + * Factory method which creates a new InstantDt with millisecond precision and initializes it with the + * current time and the system local timezone. + */ + public static InstantType withCurrentTime() { + return new InstantType(new Date(), TemporalPrecisionEnum.MILLI, TimeZone.getDefault()); + } + + /** + * Returns the default precision for this datatype + * + * @see #DEFAULT_PRECISION + */ + @Override + protected TemporalPrecisionEnum getDefaultPrecisionForDatatype() { + return DEFAULT_PRECISION; + } + + + @Override + public InstantType copy() { + return new InstantType(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; + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/IntegerType.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/IntegerType.java index 610ab1056e8..8410a0f2fbb 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/IntegerType.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/IntegerType.java @@ -1,127 +1,106 @@ -/* -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; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -import org.hl7.fhir.instance.model.api.IBaseIntegerDatatype; - -/** - * Primitive type "integer" in FHIR: A signed 32-bit integer - */ -@DatatypeDef(name = "integer") -public class IntegerType extends PrimitiveType implements IBaseIntegerDatatype { - - private static final long serialVersionUID = 3L; - - /** - * Constructor - */ - public IntegerType() { - // nothing - } - - /** - * Constructor - */ - public IntegerType(int theInteger) { - setValue(theInteger); - } - - /** - * Constructor - * - * @param theIntegerAsString - * A string representation of an integer - * @throws IllegalArgumentException - * If the string is not a valid integer representation - */ - public IntegerType(String theIntegerAsString) { - setValueAsString(theIntegerAsString); - } - - /** - * Constructor - * - * @param theValue The value - * @throws IllegalArgumentException If the value is too large to fit in a signed integer - */ - public IntegerType(Long theValue) { - if (theValue < java.lang.Integer.MIN_VALUE || theValue > java.lang.Integer.MAX_VALUE) { - throw new IllegalArgumentException - (theValue + " cannot be cast to int without changing its value."); - } - if(theValue!=null) { - setValue((int)theValue.longValue()); - } - } - - @Override - protected Integer parse(String theValue) { - try { - return Integer.parseInt(theValue); - } catch (NumberFormatException e) { - throw new IllegalArgumentException(e); - } - } - - @Override - protected String encode(Integer theValue) { - return Integer.toString(theValue); - } - - @Override - public IntegerType copy() { - return new IntegerType(getValue()); - } - -} +/* +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; + +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +import org.hl7.fhir.instance.model.api.IBaseIntegerDatatype; + +/** + * Primitive type "integer" in FHIR: A signed 32-bit integer + */ +@DatatypeDef(name = "integer") +public class IntegerType extends PrimitiveType implements IBaseIntegerDatatype { + + private static final long serialVersionUID = 3L; + + /** + * Constructor + */ + public IntegerType() { + // nothing + } + + /** + * Constructor + */ + public IntegerType(int theInteger) { + setValue(theInteger); + } + + /** + * Constructor + * + * @param theIntegerAsString + * A string representation of an integer + * @throws IllegalArgumentException + * If the string is not a valid integer representation + */ + public IntegerType(String theIntegerAsString) { + setValueAsString(theIntegerAsString); + } + + /** + * Constructor + * + * @param theValue The value + * @throws IllegalArgumentException If the value is too large to fit in a signed integer + */ + public IntegerType(Long theValue) { + if (theValue < java.lang.Integer.MIN_VALUE || theValue > java.lang.Integer.MAX_VALUE) { + throw new IllegalArgumentException + (theValue + " cannot be cast to int without changing its value."); + } + if(theValue!=null) { + setValue((int)theValue.longValue()); + } + } + + @Override + protected Integer parse(String theValue) { + try { + return Integer.parseInt(theValue); + } catch (NumberFormatException e) { + throw new IllegalArgumentException(e); + } + } + + @Override + protected String encode(Integer theValue) { + return Integer.toString(theValue); + } + + @Override + public IntegerType copy() { + return new IntegerType(getValue()); + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/List_.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/List_.java index c3f7bbc09aa..3ee105299ac 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/List_.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/List_.java @@ -1,1202 +1,1181 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A set of information summarized from a list of other resources. - */ -@ResourceDef(name="List", profile="http://hl7.org/fhir/Profile/List_") -public class List_ extends DomainResource { - - public enum ListStatus { - /** - * The list is considered to be an active part of the patient's record. - */ - CURRENT, - /** - * The list is "old" and should no longer be considered accurate or relevant. - */ - RETIRED, - /** - * The list was never accurate. It is retained for medico-legal purposes only. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static ListStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("current".equals(codeString)) - return CURRENT; - if ("retired".equals(codeString)) - return RETIRED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new Exception("Unknown ListStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CURRENT: return "current"; - case RETIRED: return "retired"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CURRENT: return ""; - case RETIRED: return ""; - case ENTEREDINERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CURRENT: return "The list is considered to be an active part of the patient's record."; - case RETIRED: return "The list is 'old' and should no longer be considered accurate or relevant."; - case ENTEREDINERROR: return "The list was never accurate. It is retained for medico-legal purposes only."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CURRENT: return "Current"; - case RETIRED: return "Retired"; - case ENTEREDINERROR: return "Entered In Error"; - default: return "?"; - } - } - } - - public static class ListStatusEnumFactory implements EnumFactory { - public ListStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("current".equals(codeString)) - return ListStatus.CURRENT; - if ("retired".equals(codeString)) - return ListStatus.RETIRED; - if ("entered-in-error".equals(codeString)) - return ListStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown ListStatus code '"+codeString+"'"); - } - public String toCode(ListStatus code) { - if (code == ListStatus.CURRENT) - return "current"; - if (code == ListStatus.RETIRED) - return "retired"; - if (code == ListStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - } - - public enum ListMode { - /** - * This list is the master list, maintained in an ongoing fashion with regular updates as the real world list it is tracking changes. - */ - WORKING, - /** - * This list was prepared as a snapshot. It should not be assumed to be current. - */ - SNAPSHOT, - /** - * The list is prepared as a statement of changes that have been made or recommended. - */ - CHANGES, - /** - * added to help the parsers - */ - NULL; - public static ListMode fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("working".equals(codeString)) - return WORKING; - if ("snapshot".equals(codeString)) - return SNAPSHOT; - if ("changes".equals(codeString)) - return CHANGES; - throw new Exception("Unknown ListMode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case WORKING: return "working"; - case SNAPSHOT: return "snapshot"; - case CHANGES: return "changes"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case WORKING: return ""; - case SNAPSHOT: return ""; - case CHANGES: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case WORKING: return "This list is the master list, maintained in an ongoing fashion with regular updates as the real world list it is tracking changes."; - case SNAPSHOT: return "This list was prepared as a snapshot. It should not be assumed to be current."; - case CHANGES: return "The list is prepared as a statement of changes that have been made or recommended."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case WORKING: return "Working"; - case SNAPSHOT: return "Snapshot"; - case CHANGES: return "Changes"; - default: return "?"; - } - } - } - - public static class ListModeEnumFactory implements EnumFactory { - public ListMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("working".equals(codeString)) - return ListMode.WORKING; - if ("snapshot".equals(codeString)) - return ListMode.SNAPSHOT; - if ("changes".equals(codeString)) - return ListMode.CHANGES; - throw new IllegalArgumentException("Unknown ListMode code '"+codeString+"'"); - } - public String toCode(ListMode code) { - if (code == ListMode.WORKING) - return "working"; - if (code == ListMode.SNAPSHOT) - return "snapshot"; - if (code == ListMode.CHANGES) - return "changes"; - return "?"; - } - } - - @Block() - public static class ListEntryComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list. - */ - @Child(name = "flag", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Workflow information about this item", formalDefinition="The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list." ) - protected List flag; - - /** - * True if this item is marked as deleted in the list. - */ - @Child(name = "deleted", type = {BooleanType.class}, order=2, min=0, max=1) - @Description(shortDefinition="If this item is actually marked as deleted", formalDefinition="True if this item is marked as deleted in the list." ) - protected BooleanType deleted; - - /** - * When this item was added to the list. - */ - @Child(name = "date", type = {DateTimeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="When item added to list", formalDefinition="When this item was added to the list." ) - protected DateTimeType date; - - /** - * A reference to the actual resource from which data was derived. - */ - @Child(name = "item", type = {}, order=4, min=1, max=1) - @Description(shortDefinition="Actual entry", formalDefinition="A reference to the actual resource from which data was derived." ) - protected Reference item; - - /** - * The actual object that is the target of the reference (A reference to the actual resource from which data was derived.) - */ - protected Resource itemTarget; - - private static final long serialVersionUID = -27973283L; - - /* - * Constructor - */ - public ListEntryComponent() { - super(); - } - - /* - * Constructor - */ - public ListEntryComponent(Reference item) { - super(); - this.item = item; - } - - /** - * @return {@link #flag} (The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list.) - */ - public List getFlag() { - if (this.flag == null) - this.flag = new ArrayList(); - return this.flag; - } - - public boolean hasFlag() { - if (this.flag == null) - return false; - for (CodeableConcept item : this.flag) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #flag} (The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list.) - */ - // syntactic sugar - public CodeableConcept addFlag() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.flag == null) - this.flag = new ArrayList(); - this.flag.add(t); - return t; - } - - // syntactic sugar - public ListEntryComponent addFlag(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.flag == null) - this.flag = new ArrayList(); - this.flag.add(t); - return this; - } - - /** - * @return {@link #deleted} (True if this item is marked as deleted in the list.). This is the underlying object with id, value and extensions. The accessor "getDeleted" gives direct access to the value - */ - public BooleanType getDeletedElement() { - if (this.deleted == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ListEntryComponent.deleted"); - else if (Configuration.doAutoCreate()) - this.deleted = new BooleanType(); // bb - return this.deleted; - } - - public boolean hasDeletedElement() { - return this.deleted != null && !this.deleted.isEmpty(); - } - - public boolean hasDeleted() { - return this.deleted != null && !this.deleted.isEmpty(); - } - - /** - * @param value {@link #deleted} (True if this item is marked as deleted in the list.). This is the underlying object with id, value and extensions. The accessor "getDeleted" gives direct access to the value - */ - public ListEntryComponent setDeletedElement(BooleanType value) { - this.deleted = value; - return this; - } - - /** - * @return True if this item is marked as deleted in the list. - */ - public boolean getDeleted() { - return this.deleted == null || this.deleted.isEmpty() ? false : this.deleted.getValue(); - } - - /** - * @param value True if this item is marked as deleted in the list. - */ - public ListEntryComponent setDeleted(boolean value) { - if (this.deleted == null) - this.deleted = new BooleanType(); - this.deleted.setValue(value); - return this; - } - - /** - * @return {@link #date} (When this item was added to the list.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ListEntryComponent.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (When this item was added to the list.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ListEntryComponent setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return When this item was added to the list. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value When this item was added to the list. - */ - public ListEntryComponent setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #item} (A reference to the actual resource from which data was derived.) - */ - public Reference getItem() { - if (this.item == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ListEntryComponent.item"); - else if (Configuration.doAutoCreate()) - this.item = new Reference(); // cc - return this.item; - } - - public boolean hasItem() { - return this.item != null && !this.item.isEmpty(); - } - - /** - * @param value {@link #item} (A reference to the actual resource from which data was derived.) - */ - public ListEntryComponent setItem(Reference value) { - this.item = value; - return this; - } - - /** - * @return {@link #item} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the actual resource from which data was derived.) - */ - public Resource getItemTarget() { - return this.itemTarget; - } - - /** - * @param value {@link #item} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the actual resource from which data was derived.) - */ - public ListEntryComponent setItemTarget(Resource value) { - this.itemTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("flag", "CodeableConcept", "The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list.", 0, java.lang.Integer.MAX_VALUE, flag)); - childrenList.add(new Property("deleted", "boolean", "True if this item is marked as deleted in the list.", 0, java.lang.Integer.MAX_VALUE, deleted)); - childrenList.add(new Property("date", "dateTime", "When this item was added to the list.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("item", "Reference(Any)", "A reference to the actual resource from which data was derived.", 0, java.lang.Integer.MAX_VALUE, item)); - } - - public ListEntryComponent copy() { - ListEntryComponent dst = new ListEntryComponent(); - copyValues(dst); - if (flag != null) { - dst.flag = new ArrayList(); - for (CodeableConcept i : flag) - dst.flag.add(i.copy()); - }; - dst.deleted = deleted == null ? null : deleted.copy(); - dst.date = date == null ? null : date.copy(); - dst.item = item == null ? null : item.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ListEntryComponent)) - return false; - ListEntryComponent o = (ListEntryComponent) other; - return compareDeep(flag, o.flag, true) && compareDeep(deleted, o.deleted, true) && compareDeep(date, o.date, true) - && compareDeep(item, o.item, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ListEntryComponent)) - return false; - ListEntryComponent o = (ListEntryComponent) other; - return compareValues(deleted, o.deleted, true) && compareValues(date, o.date, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (flag == null || flag.isEmpty()) && (deleted == null || deleted.isEmpty()) - && (date == null || date.isEmpty()) && (item == null || item.isEmpty()); - } - - } - - /** - * Identifier for the List assigned for business purposes outside the context of FHIR. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business identifier", formalDefinition="Identifier for the List assigned for business purposes outside the context of FHIR." ) - protected List identifier; - - /** - * A label for the list assigned by the author. - */ - @Child(name = "title", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Descriptive name for the list", formalDefinition="A label for the list assigned by the author." ) - protected StringType title; - - /** - * This code defines the purpose of the list - why it was created. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="What the purpose of this list is", formalDefinition="This code defines the purpose of the list - why it was created." ) - protected CodeableConcept code; - - /** - * The common subject (or patient) of the resources that are in the list, if there is one. - */ - @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Location.class}, order=3, min=0, max=1) - @Description(shortDefinition="If all resources have the same subject", formalDefinition="The common subject (or patient) of the resources that are in the list, if there is one." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The common subject (or patient) of the resources that are in the list, if there is one.) - */ - protected Resource subjectTarget; - - /** - * The entity responsible for deciding what the contents of the list were. - */ - @Child(name = "source", type = {Practitioner.class, Patient.class, Device.class}, order=4, min=0, max=1) - @Description(shortDefinition="Who and/or what defined the list contents", formalDefinition="The entity responsible for deciding what the contents of the list were." ) - protected Reference source; - - /** - * The actual object that is the target of the reference (The entity responsible for deciding what the contents of the list were.) - */ - protected Resource sourceTarget; - - /** - * Indicates the current state of this list. - */ - @Child(name = "status", type = {CodeType.class}, order=5, min=1, max=1) - @Description(shortDefinition="current | retired | entered-in-error", formalDefinition="Indicates the current state of this list." ) - protected Enumeration status; - - /** - * The date that the list was prepared. - */ - @Child(name = "date", type = {DateTimeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="When the list was prepared", formalDefinition="The date that the list was prepared." ) - protected DateTimeType date; - - /** - * What order applies to the items in the list. - */ - @Child(name = "orderedBy", type = {CodeableConcept.class}, order=7, min=0, max=1) - @Description(shortDefinition="What order the list has", formalDefinition="What order applies to the items in the list." ) - protected CodeableConcept orderedBy; - - /** - * How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. - */ - @Child(name = "mode", type = {CodeType.class}, order=8, min=1, max=1) - @Description(shortDefinition="working | snapshot | changes", formalDefinition="How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted." ) - protected Enumeration mode; - - /** - * Comments that apply to the overall list. - */ - @Child(name = "note", type = {StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Comments about the note", formalDefinition="Comments that apply to the overall list." ) - protected StringType note; - - /** - * Entries in this list. - */ - @Child(name = "entry", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Entries in the list", formalDefinition="Entries in this list." ) - protected List entry; - - /** - * If the list is empty, why the list is empty. - */ - @Child(name = "emptyReason", type = {CodeableConcept.class}, order=11, min=0, max=1) - @Description(shortDefinition="Why list is empty", formalDefinition="If the list is empty, why the list is empty." ) - protected CodeableConcept emptyReason; - - private static final long serialVersionUID = -558571391L; - - /* - * Constructor - */ - public List_() { - super(); - } - - /* - * Constructor - */ - public List_(Enumeration status, Enumeration mode) { - super(); - this.status = status; - this.mode = mode; - } - - /** - * @return {@link #identifier} (Identifier for the List assigned for business purposes outside the context of FHIR.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifier for the List assigned for business purposes outside the context of FHIR.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public List_ addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #title} (A label for the list assigned by the author.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create List_.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); // bb - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (A label for the list assigned by the author.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public List_ setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return A label for the list assigned by the author. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value A label for the list assigned by the author. - */ - public List_ setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (This code defines the purpose of the list - why it was created.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create List_.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (This code defines the purpose of the list - why it was created.) - */ - public List_ setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #subject} (The common subject (or patient) of the resources that are in the list, if there is one.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create List_.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (The common subject (or patient) of the resources that are in the list, if there is one.) - */ - public List_ setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The common subject (or patient) of the resources that are in the list, if there is one.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The common subject (or patient) of the resources that are in the list, if there is one.) - */ - public List_ setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #source} (The entity responsible for deciding what the contents of the list were.) - */ - public Reference getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create List_.source"); - else if (Configuration.doAutoCreate()) - this.source = new Reference(); // cc - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (The entity responsible for deciding what the contents of the list were.) - */ - public List_ setSource(Reference value) { - this.source = value; - return this; - } - - /** - * @return {@link #source} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The entity responsible for deciding what the contents of the list were.) - */ - public Resource getSourceTarget() { - return this.sourceTarget; - } - - /** - * @param value {@link #source} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The entity responsible for deciding what the contents of the list were.) - */ - public List_ setSourceTarget(Resource value) { - this.sourceTarget = value; - return this; - } - - /** - * @return {@link #status} (Indicates the current state of this list.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create List_.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ListStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Indicates the current state of this list.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public List_ setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Indicates the current state of this list. - */ - public ListStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Indicates the current state of this list. - */ - public List_ setStatus(ListStatus value) { - if (this.status == null) - this.status = new Enumeration(new ListStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #date} (The date that the list was prepared.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create List_.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date that the list was prepared.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public List_ setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date that the list was prepared. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date that the list was prepared. - */ - public List_ setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #orderedBy} (What order applies to the items in the list.) - */ - public CodeableConcept getOrderedBy() { - if (this.orderedBy == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create List_.orderedBy"); - else if (Configuration.doAutoCreate()) - this.orderedBy = new CodeableConcept(); // cc - return this.orderedBy; - } - - public boolean hasOrderedBy() { - return this.orderedBy != null && !this.orderedBy.isEmpty(); - } - - /** - * @param value {@link #orderedBy} (What order applies to the items in the list.) - */ - public List_ setOrderedBy(CodeableConcept value) { - this.orderedBy = value; - return this; - } - - /** - * @return {@link #mode} (How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Enumeration getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create List_.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(new ListModeEnumFactory()); // bb - return this.mode; - } - - public boolean hasModeElement() { - return this.mode != null && !this.mode.isEmpty(); - } - - public boolean hasMode() { - return this.mode != null && !this.mode.isEmpty(); - } - - /** - * @param value {@link #mode} (How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public List_ setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. - */ - public ListMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. - */ - public List_ setMode(ListMode value) { - if (this.mode == null) - this.mode = new Enumeration(new ListModeEnumFactory()); - this.mode.setValue(value); - return this; - } - - /** - * @return {@link #note} (Comments that apply to the overall list.). 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 List_.note"); - else if (Configuration.doAutoCreate()) - this.note = new StringType(); // bb - 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} (Comments that apply to the overall list.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value - */ - public List_ setNoteElement(StringType value) { - this.note = value; - return this; - } - - /** - * @return Comments that apply to the overall list. - */ - public String getNote() { - return this.note == null ? null : this.note.getValue(); - } - - /** - * @param value Comments that apply to the overall list. - */ - public List_ setNote(String value) { - if (Utilities.noString(value)) - this.note = null; - else { - if (this.note == null) - this.note = new StringType(); - this.note.setValue(value); - } - return this; - } - - /** - * @return {@link #entry} (Entries in this list.) - */ - public List getEntry() { - if (this.entry == null) - this.entry = new ArrayList(); - return this.entry; - } - - public boolean hasEntry() { - if (this.entry == null) - return false; - for (ListEntryComponent item : this.entry) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #entry} (Entries in this list.) - */ - // syntactic sugar - public ListEntryComponent addEntry() { //3 - ListEntryComponent t = new ListEntryComponent(); - if (this.entry == null) - this.entry = new ArrayList(); - this.entry.add(t); - return t; - } - - // syntactic sugar - public List_ addEntry(ListEntryComponent t) { //3 - if (t == null) - return this; - if (this.entry == null) - this.entry = new ArrayList(); - this.entry.add(t); - return this; - } - - /** - * @return {@link #emptyReason} (If the list is empty, why the list is empty.) - */ - public CodeableConcept getEmptyReason() { - if (this.emptyReason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create List_.emptyReason"); - else if (Configuration.doAutoCreate()) - this.emptyReason = new CodeableConcept(); // cc - return this.emptyReason; - } - - public boolean hasEmptyReason() { - return this.emptyReason != null && !this.emptyReason.isEmpty(); - } - - /** - * @param value {@link #emptyReason} (If the list is empty, why the list is empty.) - */ - public List_ setEmptyReason(CodeableConcept value) { - this.emptyReason = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier for the List assigned for business purposes outside the context of FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("title", "string", "A label for the list assigned by the author.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("code", "CodeableConcept", "This code defines the purpose of the list - why it was created.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "The common subject (or patient) of the resources that are in the list, if there is one.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("source", "Reference(Practitioner|Patient|Device)", "The entity responsible for deciding what the contents of the list were.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("status", "code", "Indicates the current state of this list.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("date", "dateTime", "The date that the list was prepared.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("orderedBy", "CodeableConcept", "What order applies to the items in the list.", 0, java.lang.Integer.MAX_VALUE, orderedBy)); - childrenList.add(new Property("mode", "code", "How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("note", "string", "Comments that apply to the overall list.", 0, java.lang.Integer.MAX_VALUE, note)); - childrenList.add(new Property("entry", "", "Entries in this list.", 0, java.lang.Integer.MAX_VALUE, entry)); - childrenList.add(new Property("emptyReason", "CodeableConcept", "If the list is empty, why the list is empty.", 0, java.lang.Integer.MAX_VALUE, emptyReason)); - } - - public List_ copy() { - List_ dst = new List_(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.title = title == null ? null : title.copy(); - dst.code = code == null ? null : code.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.source = source == null ? null : source.copy(); - dst.status = status == null ? null : status.copy(); - dst.date = date == null ? null : date.copy(); - dst.orderedBy = orderedBy == null ? null : orderedBy.copy(); - dst.mode = mode == null ? null : mode.copy(); - dst.note = note == null ? null : note.copy(); - if (entry != null) { - dst.entry = new ArrayList(); - for (ListEntryComponent i : entry) - dst.entry.add(i.copy()); - }; - dst.emptyReason = emptyReason == null ? null : emptyReason.copy(); - return dst; - } - - protected List_ typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof List_)) - return false; - List_ o = (List_) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(title, o.title, true) && compareDeep(code, o.code, true) - && compareDeep(subject, o.subject, true) && compareDeep(source, o.source, true) && compareDeep(status, o.status, true) - && compareDeep(date, o.date, true) && compareDeep(orderedBy, o.orderedBy, true) && compareDeep(mode, o.mode, true) - && compareDeep(note, o.note, true) && compareDeep(entry, o.entry, true) && compareDeep(emptyReason, o.emptyReason, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof List_)) - return false; - List_ o = (List_) other; - return compareValues(title, o.title, true) && compareValues(status, o.status, true) && compareValues(date, o.date, true) - && compareValues(mode, o.mode, true) && compareValues(note, o.note, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (title == null || title.isEmpty()) - && (code == null || code.isEmpty()) && (subject == null || subject.isEmpty()) && (source == null || source.isEmpty()) - && (status == null || status.isEmpty()) && (date == null || date.isEmpty()) && (orderedBy == null || orderedBy.isEmpty()) - && (mode == null || mode.isEmpty()) && (note == null || note.isEmpty()) && (entry == null || entry.isEmpty()) - && (emptyReason == null || emptyReason.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.List; - } - - @SearchParamDefinition(name="title", path="List.title", description="Descriptive name for the list", type="string" ) - public static final String SP_TITLE = "title"; - @SearchParamDefinition(name="patient", path="List.subject", description="If all resources have the same subject", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="source", path="List.source", description="Who and/or what defined the list contents", type="reference" ) - public static final String SP_SOURCE = "source"; - @SearchParamDefinition(name="status", path="List.status", description="current | retired | entered-in-error", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="subject", path="List.subject", description="If all resources have the same subject", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="item", path="List.entry.item", description="Actual entry", type="reference" ) - public static final String SP_ITEM = "item"; - @SearchParamDefinition(name="code", path="List.code", description="What the purpose of this list is", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="notes", path="List.note", description="Comments about the note", type="string" ) - public static final String SP_NOTES = "notes"; - @SearchParamDefinition(name="date", path="List.date", description="When the list was prepared", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="empty-reason", path="List.emptyReason", description="Why list is empty", type="token" ) - public static final String SP_EMPTYREASON = "empty-reason"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A set of information summarized from a list of other resources. + */ +@ResourceDef(name="List", profile="http://hl7.org/fhir/Profile/List_") +public class List_ extends DomainResource { + + public enum ListStatus { + /** + * The list is considered to be an active part of the patient's record. + */ + CURRENT, + /** + * The list is "old" and should no longer be considered accurate or relevant. + */ + RETIRED, + /** + * The list was never accurate. It is retained for medico-legal purposes only. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static ListStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("current".equals(codeString)) + return CURRENT; + if ("retired".equals(codeString)) + return RETIRED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new Exception("Unknown ListStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CURRENT: return "current"; + case RETIRED: return "retired"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CURRENT: return ""; + case RETIRED: return ""; + case ENTEREDINERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CURRENT: return "The list is considered to be an active part of the patient's record."; + case RETIRED: return "The list is 'old' and should no longer be considered accurate or relevant."; + case ENTEREDINERROR: return "The list was never accurate. It is retained for medico-legal purposes only."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CURRENT: return "Current"; + case RETIRED: return "Retired"; + case ENTEREDINERROR: return "Entered In Error"; + default: return "?"; + } + } + } + + public static class ListStatusEnumFactory implements EnumFactory { + public ListStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("current".equals(codeString)) + return ListStatus.CURRENT; + if ("retired".equals(codeString)) + return ListStatus.RETIRED; + if ("entered-in-error".equals(codeString)) + return ListStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown ListStatus code '"+codeString+"'"); + } + public String toCode(ListStatus code) { + if (code == ListStatus.CURRENT) + return "current"; + if (code == ListStatus.RETIRED) + return "retired"; + if (code == ListStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + } + + public enum ListMode { + /** + * This list is the master list, maintained in an ongoing fashion with regular updates as the real world list it is tracking changes. + */ + WORKING, + /** + * This list was prepared as a snapshot. It should not be assumed to be current. + */ + SNAPSHOT, + /** + * The list is prepared as a statement of changes that have been made or recommended. + */ + CHANGES, + /** + * added to help the parsers + */ + NULL; + public static ListMode fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("working".equals(codeString)) + return WORKING; + if ("snapshot".equals(codeString)) + return SNAPSHOT; + if ("changes".equals(codeString)) + return CHANGES; + throw new Exception("Unknown ListMode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case WORKING: return "working"; + case SNAPSHOT: return "snapshot"; + case CHANGES: return "changes"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case WORKING: return ""; + case SNAPSHOT: return ""; + case CHANGES: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case WORKING: return "This list is the master list, maintained in an ongoing fashion with regular updates as the real world list it is tracking changes."; + case SNAPSHOT: return "This list was prepared as a snapshot. It should not be assumed to be current."; + case CHANGES: return "The list is prepared as a statement of changes that have been made or recommended."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case WORKING: return "Working"; + case SNAPSHOT: return "Snapshot"; + case CHANGES: return "Changes"; + default: return "?"; + } + } + } + + public static class ListModeEnumFactory implements EnumFactory { + public ListMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("working".equals(codeString)) + return ListMode.WORKING; + if ("snapshot".equals(codeString)) + return ListMode.SNAPSHOT; + if ("changes".equals(codeString)) + return ListMode.CHANGES; + throw new IllegalArgumentException("Unknown ListMode code '"+codeString+"'"); + } + public String toCode(ListMode code) { + if (code == ListMode.WORKING) + return "working"; + if (code == ListMode.SNAPSHOT) + return "snapshot"; + if (code == ListMode.CHANGES) + return "changes"; + return "?"; + } + } + + @Block() + public static class ListEntryComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list. + */ + @Child(name = "flag", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Workflow information about this item", formalDefinition="The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list." ) + protected List flag; + + /** + * True if this item is marked as deleted in the list. + */ + @Child(name = "deleted", type = {BooleanType.class}, order=2, min=0, max=1) + @Description(shortDefinition="If this item is actually marked as deleted", formalDefinition="True if this item is marked as deleted in the list." ) + protected BooleanType deleted; + + /** + * When this item was added to the list. + */ + @Child(name = "date", type = {DateTimeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="When item added to list", formalDefinition="When this item was added to the list." ) + protected DateTimeType date; + + /** + * A reference to the actual resource from which data was derived. + */ + @Child(name = "item", type = {}, order=4, min=1, max=1) + @Description(shortDefinition="Actual entry", formalDefinition="A reference to the actual resource from which data was derived." ) + protected Reference item; + + /** + * The actual object that is the target of the reference (A reference to the actual resource from which data was derived.) + */ + protected Resource itemTarget; + + private static final long serialVersionUID = -27973283L; + + /* + * Constructor + */ + public ListEntryComponent() { + super(); + } + + /* + * Constructor + */ + public ListEntryComponent(Reference item) { + super(); + this.item = item; + } + + /** + * @return {@link #flag} (The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list.) + */ + public List getFlag() { + if (this.flag == null) + this.flag = new ArrayList(); + return this.flag; + } + + public boolean hasFlag() { + if (this.flag == null) + return false; + for (CodeableConcept item : this.flag) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #flag} (The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list.) + */ + // syntactic sugar + public CodeableConcept addFlag() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.flag == null) + this.flag = new ArrayList(); + this.flag.add(t); + return t; + } + + // syntactic sugar + public ListEntryComponent addFlag(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.flag == null) + this.flag = new ArrayList(); + this.flag.add(t); + return this; + } + + /** + * @return {@link #deleted} (True if this item is marked as deleted in the list.). This is the underlying object with id, value and extensions. The accessor "getDeleted" gives direct access to the value + */ + public BooleanType getDeletedElement() { + if (this.deleted == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ListEntryComponent.deleted"); + else if (Configuration.doAutoCreate()) + this.deleted = new BooleanType(); // bb + return this.deleted; + } + + public boolean hasDeletedElement() { + return this.deleted != null && !this.deleted.isEmpty(); + } + + public boolean hasDeleted() { + return this.deleted != null && !this.deleted.isEmpty(); + } + + /** + * @param value {@link #deleted} (True if this item is marked as deleted in the list.). This is the underlying object with id, value and extensions. The accessor "getDeleted" gives direct access to the value + */ + public ListEntryComponent setDeletedElement(BooleanType value) { + this.deleted = value; + return this; + } + + /** + * @return True if this item is marked as deleted in the list. + */ + public boolean getDeleted() { + return this.deleted == null || this.deleted.isEmpty() ? false : this.deleted.getValue(); + } + + /** + * @param value True if this item is marked as deleted in the list. + */ + public ListEntryComponent setDeleted(boolean value) { + if (this.deleted == null) + this.deleted = new BooleanType(); + this.deleted.setValue(value); + return this; + } + + /** + * @return {@link #date} (When this item was added to the list.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ListEntryComponent.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (When this item was added to the list.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ListEntryComponent setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return When this item was added to the list. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value When this item was added to the list. + */ + public ListEntryComponent setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #item} (A reference to the actual resource from which data was derived.) + */ + public Reference getItem() { + if (this.item == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ListEntryComponent.item"); + else if (Configuration.doAutoCreate()) + this.item = new Reference(); // cc + return this.item; + } + + public boolean hasItem() { + return this.item != null && !this.item.isEmpty(); + } + + /** + * @param value {@link #item} (A reference to the actual resource from which data was derived.) + */ + public ListEntryComponent setItem(Reference value) { + this.item = value; + return this; + } + + /** + * @return {@link #item} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the actual resource from which data was derived.) + */ + public Resource getItemTarget() { + return this.itemTarget; + } + + /** + * @param value {@link #item} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the actual resource from which data was derived.) + */ + public ListEntryComponent setItemTarget(Resource value) { + this.itemTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("flag", "CodeableConcept", "The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list.", 0, java.lang.Integer.MAX_VALUE, flag)); + childrenList.add(new Property("deleted", "boolean", "True if this item is marked as deleted in the list.", 0, java.lang.Integer.MAX_VALUE, deleted)); + childrenList.add(new Property("date", "dateTime", "When this item was added to the list.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("item", "Reference(Any)", "A reference to the actual resource from which data was derived.", 0, java.lang.Integer.MAX_VALUE, item)); + } + + public ListEntryComponent copy() { + ListEntryComponent dst = new ListEntryComponent(); + copyValues(dst); + if (flag != null) { + dst.flag = new ArrayList(); + for (CodeableConcept i : flag) + dst.flag.add(i.copy()); + }; + dst.deleted = deleted == null ? null : deleted.copy(); + dst.date = date == null ? null : date.copy(); + dst.item = item == null ? null : item.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ListEntryComponent)) + return false; + ListEntryComponent o = (ListEntryComponent) other; + return compareDeep(flag, o.flag, true) && compareDeep(deleted, o.deleted, true) && compareDeep(date, o.date, true) + && compareDeep(item, o.item, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ListEntryComponent)) + return false; + ListEntryComponent o = (ListEntryComponent) other; + return compareValues(deleted, o.deleted, true) && compareValues(date, o.date, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (flag == null || flag.isEmpty()) && (deleted == null || deleted.isEmpty()) + && (date == null || date.isEmpty()) && (item == null || item.isEmpty()); + } + + } + + /** + * Identifier for the List assigned for business purposes outside the context of FHIR. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business identifier", formalDefinition="Identifier for the List assigned for business purposes outside the context of FHIR." ) + protected List identifier; + + /** + * A label for the list assigned by the author. + */ + @Child(name = "title", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Descriptive name for the list", formalDefinition="A label for the list assigned by the author." ) + protected StringType title; + + /** + * This code defines the purpose of the list - why it was created. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="What the purpose of this list is", formalDefinition="This code defines the purpose of the list - why it was created." ) + protected CodeableConcept code; + + /** + * The common subject (or patient) of the resources that are in the list, if there is one. + */ + @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Location.class}, order=3, min=0, max=1) + @Description(shortDefinition="If all resources have the same subject", formalDefinition="The common subject (or patient) of the resources that are in the list, if there is one." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The common subject (or patient) of the resources that are in the list, if there is one.) + */ + protected Resource subjectTarget; + + /** + * The entity responsible for deciding what the contents of the list were. + */ + @Child(name = "source", type = {Practitioner.class, Patient.class, Device.class}, order=4, min=0, max=1) + @Description(shortDefinition="Who and/or what defined the list contents", formalDefinition="The entity responsible for deciding what the contents of the list were." ) + protected Reference source; + + /** + * The actual object that is the target of the reference (The entity responsible for deciding what the contents of the list were.) + */ + protected Resource sourceTarget; + + /** + * Indicates the current state of this list. + */ + @Child(name = "status", type = {CodeType.class}, order=5, min=1, max=1) + @Description(shortDefinition="current | retired | entered-in-error", formalDefinition="Indicates the current state of this list." ) + protected Enumeration status; + + /** + * The date that the list was prepared. + */ + @Child(name = "date", type = {DateTimeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="When the list was prepared", formalDefinition="The date that the list was prepared." ) + protected DateTimeType date; + + /** + * What order applies to the items in the list. + */ + @Child(name = "orderedBy", type = {CodeableConcept.class}, order=7, min=0, max=1) + @Description(shortDefinition="What order the list has", formalDefinition="What order applies to the items in the list." ) + protected CodeableConcept orderedBy; + + /** + * How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. + */ + @Child(name = "mode", type = {CodeType.class}, order=8, min=1, max=1) + @Description(shortDefinition="working | snapshot | changes", formalDefinition="How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted." ) + protected Enumeration mode; + + /** + * Comments that apply to the overall list. + */ + @Child(name = "note", type = {StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Comments about the note", formalDefinition="Comments that apply to the overall list." ) + protected StringType note; + + /** + * Entries in this list. + */ + @Child(name = "entry", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Entries in the list", formalDefinition="Entries in this list." ) + protected List entry; + + /** + * If the list is empty, why the list is empty. + */ + @Child(name = "emptyReason", type = {CodeableConcept.class}, order=11, min=0, max=1) + @Description(shortDefinition="Why list is empty", formalDefinition="If the list is empty, why the list is empty." ) + protected CodeableConcept emptyReason; + + private static final long serialVersionUID = -558571391L; + + /* + * Constructor + */ + public List_() { + super(); + } + + /* + * Constructor + */ + public List_(Enumeration status, Enumeration mode) { + super(); + this.status = status; + this.mode = mode; + } + + /** + * @return {@link #identifier} (Identifier for the List assigned for business purposes outside the context of FHIR.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Identifier for the List assigned for business purposes outside the context of FHIR.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public List_ addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #title} (A label for the list assigned by the author.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create List_.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); // bb + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (A label for the list assigned by the author.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public List_ setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return A label for the list assigned by the author. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value A label for the list assigned by the author. + */ + public List_ setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (This code defines the purpose of the list - why it was created.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create List_.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (This code defines the purpose of the list - why it was created.) + */ + public List_ setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #subject} (The common subject (or patient) of the resources that are in the list, if there is one.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create List_.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The common subject (or patient) of the resources that are in the list, if there is one.) + */ + public List_ setSubject(Reference value) { + this.subject = value; + return this; + } + + /** + * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The common subject (or patient) of the resources that are in the list, if there is one.) + */ + public Resource getSubjectTarget() { + return this.subjectTarget; + } + + /** + * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The common subject (or patient) of the resources that are in the list, if there is one.) + */ + public List_ setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #source} (The entity responsible for deciding what the contents of the list were.) + */ + public Reference getSource() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create List_.source"); + else if (Configuration.doAutoCreate()) + this.source = new Reference(); // cc + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (The entity responsible for deciding what the contents of the list were.) + */ + public List_ setSource(Reference value) { + this.source = value; + return this; + } + + /** + * @return {@link #source} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The entity responsible for deciding what the contents of the list were.) + */ + public Resource getSourceTarget() { + return this.sourceTarget; + } + + /** + * @param value {@link #source} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The entity responsible for deciding what the contents of the list were.) + */ + public List_ setSourceTarget(Resource value) { + this.sourceTarget = value; + return this; + } + + /** + * @return {@link #status} (Indicates the current state of this list.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create List_.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ListStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (Indicates the current state of this list.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public List_ setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Indicates the current state of this list. + */ + public ListStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Indicates the current state of this list. + */ + public List_ setStatus(ListStatus value) { + if (this.status == null) + this.status = new Enumeration(new ListStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #date} (The date that the list was prepared.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create List_.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date that the list was prepared.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public List_ setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date that the list was prepared. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date that the list was prepared. + */ + public List_ setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #orderedBy} (What order applies to the items in the list.) + */ + public CodeableConcept getOrderedBy() { + if (this.orderedBy == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create List_.orderedBy"); + else if (Configuration.doAutoCreate()) + this.orderedBy = new CodeableConcept(); // cc + return this.orderedBy; + } + + public boolean hasOrderedBy() { + return this.orderedBy != null && !this.orderedBy.isEmpty(); + } + + /** + * @param value {@link #orderedBy} (What order applies to the items in the list.) + */ + public List_ setOrderedBy(CodeableConcept value) { + this.orderedBy = value; + return this; + } + + /** + * @return {@link #mode} (How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public Enumeration getModeElement() { + if (this.mode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create List_.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(new ListModeEnumFactory()); // bb + return this.mode; + } + + public boolean hasModeElement() { + return this.mode != null && !this.mode.isEmpty(); + } + + public boolean hasMode() { + return this.mode != null && !this.mode.isEmpty(); + } + + /** + * @param value {@link #mode} (How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public List_ setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. + */ + public ListMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. + */ + public List_ setMode(ListMode value) { + if (this.mode == null) + this.mode = new Enumeration(new ListModeEnumFactory()); + this.mode.setValue(value); + return this; + } + + /** + * @return {@link #note} (Comments that apply to the overall list.). 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 List_.note"); + else if (Configuration.doAutoCreate()) + this.note = new StringType(); // bb + 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} (Comments that apply to the overall list.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value + */ + public List_ setNoteElement(StringType value) { + this.note = value; + return this; + } + + /** + * @return Comments that apply to the overall list. + */ + public String getNote() { + return this.note == null ? null : this.note.getValue(); + } + + /** + * @param value Comments that apply to the overall list. + */ + public List_ setNote(String value) { + if (Utilities.noString(value)) + this.note = null; + else { + if (this.note == null) + this.note = new StringType(); + this.note.setValue(value); + } + return this; + } + + /** + * @return {@link #entry} (Entries in this list.) + */ + public List getEntry() { + if (this.entry == null) + this.entry = new ArrayList(); + return this.entry; + } + + public boolean hasEntry() { + if (this.entry == null) + return false; + for (ListEntryComponent item : this.entry) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #entry} (Entries in this list.) + */ + // syntactic sugar + public ListEntryComponent addEntry() { //3 + ListEntryComponent t = new ListEntryComponent(); + if (this.entry == null) + this.entry = new ArrayList(); + this.entry.add(t); + return t; + } + + // syntactic sugar + public List_ addEntry(ListEntryComponent t) { //3 + if (t == null) + return this; + if (this.entry == null) + this.entry = new ArrayList(); + this.entry.add(t); + return this; + } + + /** + * @return {@link #emptyReason} (If the list is empty, why the list is empty.) + */ + public CodeableConcept getEmptyReason() { + if (this.emptyReason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create List_.emptyReason"); + else if (Configuration.doAutoCreate()) + this.emptyReason = new CodeableConcept(); // cc + return this.emptyReason; + } + + public boolean hasEmptyReason() { + return this.emptyReason != null && !this.emptyReason.isEmpty(); + } + + /** + * @param value {@link #emptyReason} (If the list is empty, why the list is empty.) + */ + public List_ setEmptyReason(CodeableConcept value) { + this.emptyReason = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier for the List assigned for business purposes outside the context of FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("title", "string", "A label for the list assigned by the author.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("code", "CodeableConcept", "This code defines the purpose of the list - why it was created.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "The common subject (or patient) of the resources that are in the list, if there is one.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("source", "Reference(Practitioner|Patient|Device)", "The entity responsible for deciding what the contents of the list were.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("status", "code", "Indicates the current state of this list.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("date", "dateTime", "The date that the list was prepared.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("orderedBy", "CodeableConcept", "What order applies to the items in the list.", 0, java.lang.Integer.MAX_VALUE, orderedBy)); + childrenList.add(new Property("mode", "code", "How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("note", "string", "Comments that apply to the overall list.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("entry", "", "Entries in this list.", 0, java.lang.Integer.MAX_VALUE, entry)); + childrenList.add(new Property("emptyReason", "CodeableConcept", "If the list is empty, why the list is empty.", 0, java.lang.Integer.MAX_VALUE, emptyReason)); + } + + public List_ copy() { + List_ dst = new List_(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.title = title == null ? null : title.copy(); + dst.code = code == null ? null : code.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.source = source == null ? null : source.copy(); + dst.status = status == null ? null : status.copy(); + dst.date = date == null ? null : date.copy(); + dst.orderedBy = orderedBy == null ? null : orderedBy.copy(); + dst.mode = mode == null ? null : mode.copy(); + dst.note = note == null ? null : note.copy(); + if (entry != null) { + dst.entry = new ArrayList(); + for (ListEntryComponent i : entry) + dst.entry.add(i.copy()); + }; + dst.emptyReason = emptyReason == null ? null : emptyReason.copy(); + return dst; + } + + protected List_ typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof List_)) + return false; + List_ o = (List_) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(title, o.title, true) && compareDeep(code, o.code, true) + && compareDeep(subject, o.subject, true) && compareDeep(source, o.source, true) && compareDeep(status, o.status, true) + && compareDeep(date, o.date, true) && compareDeep(orderedBy, o.orderedBy, true) && compareDeep(mode, o.mode, true) + && compareDeep(note, o.note, true) && compareDeep(entry, o.entry, true) && compareDeep(emptyReason, o.emptyReason, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof List_)) + return false; + List_ o = (List_) other; + return compareValues(title, o.title, true) && compareValues(status, o.status, true) && compareValues(date, o.date, true) + && compareValues(mode, o.mode, true) && compareValues(note, o.note, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (title == null || title.isEmpty()) + && (code == null || code.isEmpty()) && (subject == null || subject.isEmpty()) && (source == null || source.isEmpty()) + && (status == null || status.isEmpty()) && (date == null || date.isEmpty()) && (orderedBy == null || orderedBy.isEmpty()) + && (mode == null || mode.isEmpty()) && (note == null || note.isEmpty()) && (entry == null || entry.isEmpty()) + && (emptyReason == null || emptyReason.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.List; + } + + @SearchParamDefinition(name="date", path="List.date", description="When the list was prepared", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="item", path="List.entry.item", description="Actual entry", type="reference" ) + public static final String SP_ITEM = "item"; + @SearchParamDefinition(name="empty-reason", path="List.emptyReason", description="Why list is empty", type="token" ) + public static final String SP_EMPTYREASON = "empty-reason"; + @SearchParamDefinition(name="code", path="List.code", description="What the purpose of this list is", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="notes", path="List.note", description="Comments about the note", type="string" ) + public static final String SP_NOTES = "notes"; + @SearchParamDefinition(name="subject", path="List.subject", description="If all resources have the same subject", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="patient", path="List.subject", description="If all resources have the same subject", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="source", path="List.source", description="Who and/or what defined the list contents", type="reference" ) + public static final String SP_SOURCE = "source"; + @SearchParamDefinition(name="title", path="List.title", description="Descriptive name for the list", type="string" ) + public static final String SP_TITLE = "title"; + @SearchParamDefinition(name="status", path="List.status", description="current | retired | entered-in-error", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Location.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Location.java index add5c682186..f0da1644b50 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Location.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Location.java @@ -1,1121 +1,1100 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import java.util.*; - -import java.math.*; -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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated. - */ -@ResourceDef(name="Location", profile="http://hl7.org/fhir/Profile/Location") -public class Location extends DomainResource { - - public enum LocationMode { - /** - * The Location resource represents a specific instance of a Location (e.g. Operating Theatre 1A). - */ - INSTANCE, - /** - * The Location represents a class of Locations (e.g. Any Operating Theatre). Although this class of locations could be constrained within a specific boundary (such as organization, or parent location, address etc). - */ - KIND, - /** - * added to help the parsers - */ - NULL; - public static LocationMode fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("instance".equals(codeString)) - return INSTANCE; - if ("kind".equals(codeString)) - return KIND; - throw new Exception("Unknown LocationMode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INSTANCE: return "instance"; - case KIND: return "kind"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INSTANCE: return ""; - case KIND: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INSTANCE: return "The Location resource represents a specific instance of a Location (e.g. Operating Theatre 1A)."; - case KIND: return "The Location represents a class of Locations (e.g. Any Operating Theatre). Although this class of locations could be constrained within a specific boundary (such as organization, or parent location, address etc)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INSTANCE: return "Instance"; - case KIND: return "Kind"; - default: return "?"; - } - } - } - - public static class LocationModeEnumFactory implements EnumFactory { - public LocationMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("instance".equals(codeString)) - return LocationMode.INSTANCE; - if ("kind".equals(codeString)) - return LocationMode.KIND; - throw new IllegalArgumentException("Unknown LocationMode code '"+codeString+"'"); - } - public String toCode(LocationMode code) { - if (code == LocationMode.INSTANCE) - return "instance"; - if (code == LocationMode.KIND) - return "kind"; - return "?"; - } - } - - public enum LocationStatus { - /** - * The location is operational. - */ - ACTIVE, - /** - * The location is temporarily closed. - */ - SUSPENDED, - /** - * The location is no longer used. - */ - INACTIVE, - /** - * added to help the parsers - */ - NULL; - public static LocationStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return ACTIVE; - if ("suspended".equals(codeString)) - return SUSPENDED; - if ("inactive".equals(codeString)) - return INACTIVE; - throw new Exception("Unknown LocationStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ACTIVE: return "active"; - case SUSPENDED: return "suspended"; - case INACTIVE: return "inactive"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ACTIVE: return ""; - case SUSPENDED: return ""; - case INACTIVE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ACTIVE: return "The location is operational."; - case SUSPENDED: return "The location is temporarily closed."; - case INACTIVE: return "The location is no longer used."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ACTIVE: return "Active"; - case SUSPENDED: return "Suspended"; - case INACTIVE: return "Inactive"; - default: return "?"; - } - } - } - - public static class LocationStatusEnumFactory implements EnumFactory { - public LocationStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return LocationStatus.ACTIVE; - if ("suspended".equals(codeString)) - return LocationStatus.SUSPENDED; - if ("inactive".equals(codeString)) - return LocationStatus.INACTIVE; - throw new IllegalArgumentException("Unknown LocationStatus code '"+codeString+"'"); - } - public String toCode(LocationStatus code) { - if (code == LocationStatus.ACTIVE) - return "active"; - if (code == LocationStatus.SUSPENDED) - return "suspended"; - if (code == LocationStatus.INACTIVE) - return "inactive"; - return "?"; - } - } - - @Block() - public static class LocationPositionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). - */ - @Child(name = "longitude", type = {DecimalType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Longitude with WGS84 datum", formalDefinition="Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below)." ) - protected DecimalType longitude; - - /** - * Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). - */ - @Child(name = "latitude", type = {DecimalType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Latitude with WGS84 datum", formalDefinition="Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below)." ) - protected DecimalType latitude; - - /** - * Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). - */ - @Child(name = "altitude", type = {DecimalType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Altitude with WGS84 datum", formalDefinition="Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below)." ) - protected DecimalType altitude; - - private static final long serialVersionUID = -74276134L; - - /* - * Constructor - */ - public LocationPositionComponent() { - super(); - } - - /* - * Constructor - */ - public LocationPositionComponent(DecimalType longitude, DecimalType latitude) { - super(); - this.longitude = longitude; - this.latitude = latitude; - } - - /** - * @return {@link #longitude} (Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLongitude" gives direct access to the value - */ - public DecimalType getLongitudeElement() { - if (this.longitude == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LocationPositionComponent.longitude"); - else if (Configuration.doAutoCreate()) - this.longitude = new DecimalType(); // bb - return this.longitude; - } - - public boolean hasLongitudeElement() { - return this.longitude != null && !this.longitude.isEmpty(); - } - - public boolean hasLongitude() { - return this.longitude != null && !this.longitude.isEmpty(); - } - - /** - * @param value {@link #longitude} (Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLongitude" gives direct access to the value - */ - public LocationPositionComponent setLongitudeElement(DecimalType value) { - this.longitude = value; - return this; - } - - /** - * @return Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). - */ - public BigDecimal getLongitude() { - return this.longitude == null ? null : this.longitude.getValue(); - } - - /** - * @param value Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). - */ - public LocationPositionComponent setLongitude(BigDecimal value) { - if (this.longitude == null) - this.longitude = new DecimalType(); - this.longitude.setValue(value); - return this; - } - - /** - * @return {@link #latitude} (Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLatitude" gives direct access to the value - */ - public DecimalType getLatitudeElement() { - if (this.latitude == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LocationPositionComponent.latitude"); - else if (Configuration.doAutoCreate()) - this.latitude = new DecimalType(); // bb - return this.latitude; - } - - public boolean hasLatitudeElement() { - return this.latitude != null && !this.latitude.isEmpty(); - } - - public boolean hasLatitude() { - return this.latitude != null && !this.latitude.isEmpty(); - } - - /** - * @param value {@link #latitude} (Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLatitude" gives direct access to the value - */ - public LocationPositionComponent setLatitudeElement(DecimalType value) { - this.latitude = value; - return this; - } - - /** - * @return Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). - */ - public BigDecimal getLatitude() { - return this.latitude == null ? null : this.latitude.getValue(); - } - - /** - * @param value Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). - */ - public LocationPositionComponent setLatitude(BigDecimal value) { - if (this.latitude == null) - this.latitude = new DecimalType(); - this.latitude.setValue(value); - return this; - } - - /** - * @return {@link #altitude} (Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getAltitude" gives direct access to the value - */ - public DecimalType getAltitudeElement() { - if (this.altitude == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LocationPositionComponent.altitude"); - else if (Configuration.doAutoCreate()) - this.altitude = new DecimalType(); // bb - return this.altitude; - } - - public boolean hasAltitudeElement() { - return this.altitude != null && !this.altitude.isEmpty(); - } - - public boolean hasAltitude() { - return this.altitude != null && !this.altitude.isEmpty(); - } - - /** - * @param value {@link #altitude} (Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getAltitude" gives direct access to the value - */ - public LocationPositionComponent setAltitudeElement(DecimalType value) { - this.altitude = value; - return this; - } - - /** - * @return Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). - */ - public BigDecimal getAltitude() { - return this.altitude == null ? null : this.altitude.getValue(); - } - - /** - * @param value Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). - */ - public LocationPositionComponent setAltitude(BigDecimal value) { - if (value == null) - this.altitude = null; - else { - if (this.altitude == null) - this.altitude = new DecimalType(); - this.altitude.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("longitude", "decimal", "Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).", 0, java.lang.Integer.MAX_VALUE, longitude)); - childrenList.add(new Property("latitude", "decimal", "Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).", 0, java.lang.Integer.MAX_VALUE, latitude)); - childrenList.add(new Property("altitude", "decimal", "Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).", 0, java.lang.Integer.MAX_VALUE, altitude)); - } - - public LocationPositionComponent copy() { - LocationPositionComponent dst = new LocationPositionComponent(); - copyValues(dst); - dst.longitude = longitude == null ? null : longitude.copy(); - dst.latitude = latitude == null ? null : latitude.copy(); - dst.altitude = altitude == null ? null : altitude.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof LocationPositionComponent)) - return false; - LocationPositionComponent o = (LocationPositionComponent) other; - return compareDeep(longitude, o.longitude, true) && compareDeep(latitude, o.latitude, true) && compareDeep(altitude, o.altitude, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof LocationPositionComponent)) - return false; - LocationPositionComponent o = (LocationPositionComponent) other; - return compareValues(longitude, o.longitude, true) && compareValues(latitude, o.latitude, true) && compareValues(altitude, o.altitude, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (longitude == null || longitude.isEmpty()) && (latitude == null || latitude.isEmpty()) - && (altitude == null || altitude.isEmpty()); - } - - } - - /** - * Unique code or number identifying the location to its users. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Unique code or number identifying the location to its users", formalDefinition="Unique code or number identifying the location to its users." ) - protected List identifier; - - /** - * Name of the location as used by humans. Does not need to be unique. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Name of the location as used by humans", formalDefinition="Name of the location as used by humans. Does not need to be unique." ) - protected StringType name; - - /** - * Description of the Location, which helps in finding or referencing the place. - */ - @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Description of the Location, which helps in finding or referencing the place", formalDefinition="Description of the Location, which helps in finding or referencing the place." ) - protected StringType description; - - /** - * Indicates whether a resource instance represents a specific location or a class of locations. - */ - @Child(name = "mode", type = {CodeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="instance | kind", formalDefinition="Indicates whether a resource instance represents a specific location or a class of locations." ) - protected Enumeration mode; - - /** - * Indicates the type of function performed at the location. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=1) - @Description(shortDefinition="Indicates the type of function performed at the location", formalDefinition="Indicates the type of function performed at the location." ) - protected CodeableConcept type; - - /** - * The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details of the location", formalDefinition="The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites." ) - protected List telecom; - - /** - * Physical location. - */ - @Child(name = "address", type = {Address.class}, order=6, min=0, max=1) - @Description(shortDefinition="Physical location", formalDefinition="Physical location." ) - protected Address address; - - /** - * Physical form of the location, e.g. building, room, vehicle, road. - */ - @Child(name = "physicalType", type = {CodeableConcept.class}, order=7, min=0, max=1) - @Description(shortDefinition="Physical form of the location", formalDefinition="Physical form of the location, e.g. building, room, vehicle, road." ) - protected CodeableConcept physicalType; - - /** - * The absolute geographic location of the Location, expressed in with the WGS84 datum (This is the same co-ordinate system used in KML). - */ - @Child(name = "position", type = {}, order=8, min=0, max=1) - @Description(shortDefinition="The absolute geographic location", formalDefinition="The absolute geographic location of the Location, expressed in with the WGS84 datum (This is the same co-ordinate system used in KML)." ) - protected LocationPositionComponent position; - - /** - * The organization that is responsible for the provisioning and upkeep of the location. - */ - @Child(name = "managingOrganization", type = {Organization.class}, order=9, min=0, max=1) - @Description(shortDefinition="The organization that is responsible for the provisioning and upkeep of the location", formalDefinition="The organization that is responsible for the provisioning and upkeep of the location." ) - protected Reference managingOrganization; - - /** - * The actual object that is the target of the reference (The organization that is responsible for the provisioning and upkeep of the location.) - */ - protected Organization managingOrganizationTarget; - - /** - * Another Location which this Location is physically part of. - */ - @Child(name = "partOf", type = {Location.class}, order=10, min=0, max=1) - @Description(shortDefinition="Another Location which this Location is physically part of", formalDefinition="Another Location which this Location is physically part of." ) - protected Reference partOf; - - /** - * The actual object that is the target of the reference (Another Location which this Location is physically part of.) - */ - protected Location partOfTarget; - - /** - * active | suspended | inactive. - */ - @Child(name = "status", type = {CodeType.class}, order=11, min=0, max=1) - @Description(shortDefinition="active | suspended | inactive", formalDefinition="active | suspended | inactive." ) - protected Enumeration status; - - private static final long serialVersionUID = -520735603L; - - /* - * Constructor - */ - public Location() { - super(); - } - - /** - * @return {@link #identifier} (Unique code or number identifying the location to its users.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Unique code or number identifying the location to its users.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Location addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #name} (Name of the location as used by humans. Does not need to be unique.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Name of the location as used by humans. Does not need to be unique.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public Location setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Name of the location as used by humans. Does not need to be unique. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Name of the location as used by humans. Does not need to be unique. - */ - public Location setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (Description of the Location, which helps in finding or referencing the place.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Description of the Location, which helps in finding or referencing the place.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public Location setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Description of the Location, which helps in finding or referencing the place. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Description of the Location, which helps in finding or referencing the place. - */ - public Location setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #mode} (Indicates whether a resource instance represents a specific location or a class of locations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Enumeration getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(new LocationModeEnumFactory()); // bb - return this.mode; - } - - public boolean hasModeElement() { - return this.mode != null && !this.mode.isEmpty(); - } - - public boolean hasMode() { - return this.mode != null && !this.mode.isEmpty(); - } - - /** - * @param value {@link #mode} (Indicates whether a resource instance represents a specific location or a class of locations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Location setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return Indicates whether a resource instance represents a specific location or a class of locations. - */ - public LocationMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value Indicates whether a resource instance represents a specific location or a class of locations. - */ - public Location setMode(LocationMode value) { - if (value == null) - this.mode = null; - else { - if (this.mode == null) - this.mode = new Enumeration(new LocationModeEnumFactory()); - this.mode.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (Indicates the type of function performed at the location.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Indicates the type of function performed at the location.) - */ - public Location setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #telecom} (The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public Location addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #address} (Physical location.) - */ - public Address getAddress() { - if (this.address == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.address"); - else if (Configuration.doAutoCreate()) - this.address = new Address(); // cc - return this.address; - } - - public boolean hasAddress() { - return this.address != null && !this.address.isEmpty(); - } - - /** - * @param value {@link #address} (Physical location.) - */ - public Location setAddress(Address value) { - this.address = value; - return this; - } - - /** - * @return {@link #physicalType} (Physical form of the location, e.g. building, room, vehicle, road.) - */ - public CodeableConcept getPhysicalType() { - if (this.physicalType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.physicalType"); - else if (Configuration.doAutoCreate()) - this.physicalType = new CodeableConcept(); // cc - return this.physicalType; - } - - public boolean hasPhysicalType() { - return this.physicalType != null && !this.physicalType.isEmpty(); - } - - /** - * @param value {@link #physicalType} (Physical form of the location, e.g. building, room, vehicle, road.) - */ - public Location setPhysicalType(CodeableConcept value) { - this.physicalType = value; - return this; - } - - /** - * @return {@link #position} (The absolute geographic location of the Location, expressed in with the WGS84 datum (This is the same co-ordinate system used in KML).) - */ - public LocationPositionComponent getPosition() { - if (this.position == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.position"); - else if (Configuration.doAutoCreate()) - this.position = new LocationPositionComponent(); // cc - return this.position; - } - - public boolean hasPosition() { - return this.position != null && !this.position.isEmpty(); - } - - /** - * @param value {@link #position} (The absolute geographic location of the Location, expressed in with the WGS84 datum (This is the same co-ordinate system used in KML).) - */ - public Location setPosition(LocationPositionComponent value) { - this.position = value; - return this; - } - - /** - * @return {@link #managingOrganization} (The organization that is responsible for the provisioning and upkeep of the location.) - */ - public Reference getManagingOrganization() { - if (this.managingOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganization = new Reference(); // cc - return this.managingOrganization; - } - - public boolean hasManagingOrganization() { - return this.managingOrganization != null && !this.managingOrganization.isEmpty(); - } - - /** - * @param value {@link #managingOrganization} (The organization that is responsible for the provisioning and upkeep of the location.) - */ - public Location setManagingOrganization(Reference value) { - this.managingOrganization = value; - return this; - } - - /** - * @return {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization that is responsible for the provisioning and upkeep of the location.) - */ - public Organization getManagingOrganizationTarget() { - if (this.managingOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganizationTarget = new Organization(); // aa - return this.managingOrganizationTarget; - } - - /** - * @param value {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization that is responsible for the provisioning and upkeep of the location.) - */ - public Location setManagingOrganizationTarget(Organization value) { - this.managingOrganizationTarget = value; - return this; - } - - /** - * @return {@link #partOf} (Another Location which this Location is physically part of.) - */ - public Reference getPartOf() { - if (this.partOf == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.partOf"); - else if (Configuration.doAutoCreate()) - this.partOf = new Reference(); // cc - return this.partOf; - } - - public boolean hasPartOf() { - return this.partOf != null && !this.partOf.isEmpty(); - } - - /** - * @param value {@link #partOf} (Another Location which this Location is physically part of.) - */ - public Location setPartOf(Reference value) { - this.partOf = value; - return this; - } - - /** - * @return {@link #partOf} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Another Location which this Location is physically part of.) - */ - public Location getPartOfTarget() { - if (this.partOfTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.partOf"); - else if (Configuration.doAutoCreate()) - this.partOfTarget = new Location(); // aa - return this.partOfTarget; - } - - /** - * @param value {@link #partOf} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Another Location which this Location is physically part of.) - */ - public Location setPartOfTarget(Location value) { - this.partOfTarget = value; - return this; - } - - /** - * @return {@link #status} (active | suspended | inactive.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new LocationStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (active | suspended | inactive.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Location setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return active | suspended | inactive. - */ - public LocationStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value active | suspended | inactive. - */ - public Location setStatus(LocationStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new LocationStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Unique code or number identifying the location to its users.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("name", "string", "Name of the location as used by humans. Does not need to be unique.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("description", "string", "Description of the Location, which helps in finding or referencing the place.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("mode", "code", "Indicates whether a resource instance represents a specific location or a class of locations.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of function performed at the location.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("telecom", "ContactPoint", "The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("address", "Address", "Physical location.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("physicalType", "CodeableConcept", "Physical form of the location, e.g. building, room, vehicle, road.", 0, java.lang.Integer.MAX_VALUE, physicalType)); - childrenList.add(new Property("position", "", "The absolute geographic location of the Location, expressed in with the WGS84 datum (This is the same co-ordinate system used in KML).", 0, java.lang.Integer.MAX_VALUE, position)); - childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The organization that is responsible for the provisioning and upkeep of the location.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); - childrenList.add(new Property("partOf", "Reference(Location)", "Another Location which this Location is physically part of.", 0, java.lang.Integer.MAX_VALUE, partOf)); - childrenList.add(new Property("status", "code", "active | suspended | inactive.", 0, java.lang.Integer.MAX_VALUE, status)); - } - - public Location copy() { - Location dst = new Location(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.name = name == null ? null : name.copy(); - dst.description = description == null ? null : description.copy(); - dst.mode = mode == null ? null : mode.copy(); - dst.type = type == null ? null : type.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.address = address == null ? null : address.copy(); - dst.physicalType = physicalType == null ? null : physicalType.copy(); - dst.position = position == null ? null : position.copy(); - dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); - dst.partOf = partOf == null ? null : partOf.copy(); - dst.status = status == null ? null : status.copy(); - return dst; - } - - protected Location typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Location)) - return false; - Location o = (Location) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(description, o.description, true) - && compareDeep(mode, o.mode, true) && compareDeep(type, o.type, true) && compareDeep(telecom, o.telecom, true) - && compareDeep(address, o.address, true) && compareDeep(physicalType, o.physicalType, true) && compareDeep(position, o.position, true) - && compareDeep(managingOrganization, o.managingOrganization, true) && compareDeep(partOf, o.partOf, true) - && compareDeep(status, o.status, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Location)) - return false; - Location o = (Location) other; - return compareValues(name, o.name, true) && compareValues(description, o.description, true) && compareValues(mode, o.mode, true) - && compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) - && (description == null || description.isEmpty()) && (mode == null || mode.isEmpty()) && (type == null || type.isEmpty()) - && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) && (physicalType == null || physicalType.isEmpty()) - && (position == null || position.isEmpty()) && (managingOrganization == null || managingOrganization.isEmpty()) - && (partOf == null || partOf.isEmpty()) && (status == null || status.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Location; - } - - @SearchParamDefinition(name="organization", path="Location.managingOrganization", description="Searches for locations that are managed by the provided organization", type="reference" ) - public static final String SP_ORGANIZATION = "organization"; - @SearchParamDefinition(name="near", path="", description="The coordinates expressed as [lat],[long] (using the WGS84 datum, see notes) to find locations near to (servers may search using a square rather than a circle for efficiency)", type="token" ) - public static final String SP_NEAR = "near"; - @SearchParamDefinition(name="partof", path="Location.partOf", description="The location of which this location is a part", type="reference" ) - public static final String SP_PARTOF = "partof"; - @SearchParamDefinition(name="status", path="Location.status", description="Searches for locations with a specific kind of status", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="address", path="Location.address", description="A (part of the) address of the location", type="string" ) - public static final String SP_ADDRESS = "address"; - @SearchParamDefinition(name="name", path="Location.name", description="A (portion of the) name of the location", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="near-distance", path="", description="A distance quantity to limit the near search to locations within a specific distance", type="token" ) - public static final String SP_NEARDISTANCE = "near-distance"; - @SearchParamDefinition(name="type", path="Location.type", description="A code for the type of location", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="identifier", path="Location.identifier", description="Unique code or number identifying the location to its users", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import java.util.*; + +import java.math.*; +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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated. + */ +@ResourceDef(name="Location", profile="http://hl7.org/fhir/Profile/Location") +public class Location extends DomainResource { + + public enum LocationMode { + /** + * The Location resource represents a specific instance of a Location (e.g. Operating Theatre 1A). + */ + INSTANCE, + /** + * The Location represents a class of Locations (e.g. Any Operating Theatre). Although this class of locations could be constrained within a specific boundary (such as organization, or parent location, address etc). + */ + KIND, + /** + * added to help the parsers + */ + NULL; + public static LocationMode fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("instance".equals(codeString)) + return INSTANCE; + if ("kind".equals(codeString)) + return KIND; + throw new Exception("Unknown LocationMode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INSTANCE: return "instance"; + case KIND: return "kind"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INSTANCE: return ""; + case KIND: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INSTANCE: return "The Location resource represents a specific instance of a Location (e.g. Operating Theatre 1A)."; + case KIND: return "The Location represents a class of Locations (e.g. Any Operating Theatre). Although this class of locations could be constrained within a specific boundary (such as organization, or parent location, address etc)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INSTANCE: return "Instance"; + case KIND: return "Kind"; + default: return "?"; + } + } + } + + public static class LocationModeEnumFactory implements EnumFactory { + public LocationMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("instance".equals(codeString)) + return LocationMode.INSTANCE; + if ("kind".equals(codeString)) + return LocationMode.KIND; + throw new IllegalArgumentException("Unknown LocationMode code '"+codeString+"'"); + } + public String toCode(LocationMode code) { + if (code == LocationMode.INSTANCE) + return "instance"; + if (code == LocationMode.KIND) + return "kind"; + return "?"; + } + } + + public enum LocationStatus { + /** + * The location is operational. + */ + ACTIVE, + /** + * The location is temporarily closed. + */ + SUSPENDED, + /** + * The location is no longer used. + */ + INACTIVE, + /** + * added to help the parsers + */ + NULL; + public static LocationStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return ACTIVE; + if ("suspended".equals(codeString)) + return SUSPENDED; + if ("inactive".equals(codeString)) + return INACTIVE; + throw new Exception("Unknown LocationStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ACTIVE: return "active"; + case SUSPENDED: return "suspended"; + case INACTIVE: return "inactive"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACTIVE: return ""; + case SUSPENDED: return ""; + case INACTIVE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACTIVE: return "The location is operational."; + case SUSPENDED: return "The location is temporarily closed."; + case INACTIVE: return "The location is no longer used."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACTIVE: return "Active"; + case SUSPENDED: return "Suspended"; + case INACTIVE: return "Inactive"; + default: return "?"; + } + } + } + + public static class LocationStatusEnumFactory implements EnumFactory { + public LocationStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return LocationStatus.ACTIVE; + if ("suspended".equals(codeString)) + return LocationStatus.SUSPENDED; + if ("inactive".equals(codeString)) + return LocationStatus.INACTIVE; + throw new IllegalArgumentException("Unknown LocationStatus code '"+codeString+"'"); + } + public String toCode(LocationStatus code) { + if (code == LocationStatus.ACTIVE) + return "active"; + if (code == LocationStatus.SUSPENDED) + return "suspended"; + if (code == LocationStatus.INACTIVE) + return "inactive"; + return "?"; + } + } + + @Block() + public static class LocationPositionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). + */ + @Child(name = "longitude", type = {DecimalType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Longitude with WGS84 datum", formalDefinition="Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below)." ) + protected DecimalType longitude; + + /** + * Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). + */ + @Child(name = "latitude", type = {DecimalType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Latitude with WGS84 datum", formalDefinition="Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below)." ) + protected DecimalType latitude; + + /** + * Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). + */ + @Child(name = "altitude", type = {DecimalType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Altitude with WGS84 datum", formalDefinition="Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below)." ) + protected DecimalType altitude; + + private static final long serialVersionUID = -74276134L; + + /* + * Constructor + */ + public LocationPositionComponent() { + super(); + } + + /* + * Constructor + */ + public LocationPositionComponent(DecimalType longitude, DecimalType latitude) { + super(); + this.longitude = longitude; + this.latitude = latitude; + } + + /** + * @return {@link #longitude} (Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLongitude" gives direct access to the value + */ + public DecimalType getLongitudeElement() { + if (this.longitude == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create LocationPositionComponent.longitude"); + else if (Configuration.doAutoCreate()) + this.longitude = new DecimalType(); // bb + return this.longitude; + } + + public boolean hasLongitudeElement() { + return this.longitude != null && !this.longitude.isEmpty(); + } + + public boolean hasLongitude() { + return this.longitude != null && !this.longitude.isEmpty(); + } + + /** + * @param value {@link #longitude} (Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLongitude" gives direct access to the value + */ + public LocationPositionComponent setLongitudeElement(DecimalType value) { + this.longitude = value; + return this; + } + + /** + * @return Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). + */ + public BigDecimal getLongitude() { + return this.longitude == null ? null : this.longitude.getValue(); + } + + /** + * @param value Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). + */ + public LocationPositionComponent setLongitude(BigDecimal value) { + if (this.longitude == null) + this.longitude = new DecimalType(); + this.longitude.setValue(value); + return this; + } + + /** + * @return {@link #latitude} (Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLatitude" gives direct access to the value + */ + public DecimalType getLatitudeElement() { + if (this.latitude == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create LocationPositionComponent.latitude"); + else if (Configuration.doAutoCreate()) + this.latitude = new DecimalType(); // bb + return this.latitude; + } + + public boolean hasLatitudeElement() { + return this.latitude != null && !this.latitude.isEmpty(); + } + + public boolean hasLatitude() { + return this.latitude != null && !this.latitude.isEmpty(); + } + + /** + * @param value {@link #latitude} (Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLatitude" gives direct access to the value + */ + public LocationPositionComponent setLatitudeElement(DecimalType value) { + this.latitude = value; + return this; + } + + /** + * @return Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). + */ + public BigDecimal getLatitude() { + return this.latitude == null ? null : this.latitude.getValue(); + } + + /** + * @param value Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). + */ + public LocationPositionComponent setLatitude(BigDecimal value) { + if (this.latitude == null) + this.latitude = new DecimalType(); + this.latitude.setValue(value); + return this; + } + + /** + * @return {@link #altitude} (Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getAltitude" gives direct access to the value + */ + public DecimalType getAltitudeElement() { + if (this.altitude == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create LocationPositionComponent.altitude"); + else if (Configuration.doAutoCreate()) + this.altitude = new DecimalType(); // bb + return this.altitude; + } + + public boolean hasAltitudeElement() { + return this.altitude != null && !this.altitude.isEmpty(); + } + + public boolean hasAltitude() { + return this.altitude != null && !this.altitude.isEmpty(); + } + + /** + * @param value {@link #altitude} (Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getAltitude" gives direct access to the value + */ + public LocationPositionComponent setAltitudeElement(DecimalType value) { + this.altitude = value; + return this; + } + + /** + * @return Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). + */ + public BigDecimal getAltitude() { + return this.altitude == null ? null : this.altitude.getValue(); + } + + /** + * @param value Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). + */ + public LocationPositionComponent setAltitude(BigDecimal value) { + if (value == null) + this.altitude = null; + else { + if (this.altitude == null) + this.altitude = new DecimalType(); + this.altitude.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("longitude", "decimal", "Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).", 0, java.lang.Integer.MAX_VALUE, longitude)); + childrenList.add(new Property("latitude", "decimal", "Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).", 0, java.lang.Integer.MAX_VALUE, latitude)); + childrenList.add(new Property("altitude", "decimal", "Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).", 0, java.lang.Integer.MAX_VALUE, altitude)); + } + + public LocationPositionComponent copy() { + LocationPositionComponent dst = new LocationPositionComponent(); + copyValues(dst); + dst.longitude = longitude == null ? null : longitude.copy(); + dst.latitude = latitude == null ? null : latitude.copy(); + dst.altitude = altitude == null ? null : altitude.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof LocationPositionComponent)) + return false; + LocationPositionComponent o = (LocationPositionComponent) other; + return compareDeep(longitude, o.longitude, true) && compareDeep(latitude, o.latitude, true) && compareDeep(altitude, o.altitude, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof LocationPositionComponent)) + return false; + LocationPositionComponent o = (LocationPositionComponent) other; + return compareValues(longitude, o.longitude, true) && compareValues(latitude, o.latitude, true) && compareValues(altitude, o.altitude, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (longitude == null || longitude.isEmpty()) && (latitude == null || latitude.isEmpty()) + && (altitude == null || altitude.isEmpty()); + } + + } + + /** + * Unique code or number identifying the location to its users. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Unique code or number identifying the location to its users", formalDefinition="Unique code or number identifying the location to its users." ) + protected List identifier; + + /** + * Name of the location as used by humans. Does not need to be unique. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Name of the location as used by humans", formalDefinition="Name of the location as used by humans. Does not need to be unique." ) + protected StringType name; + + /** + * Description of the Location, which helps in finding or referencing the place. + */ + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Description of the Location, which helps in finding or referencing the place", formalDefinition="Description of the Location, which helps in finding or referencing the place." ) + protected StringType description; + + /** + * Indicates whether a resource instance represents a specific location or a class of locations. + */ + @Child(name = "mode", type = {CodeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="instance | kind", formalDefinition="Indicates whether a resource instance represents a specific location or a class of locations." ) + protected Enumeration mode; + + /** + * Indicates the type of function performed at the location. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=1) + @Description(shortDefinition="Indicates the type of function performed at the location", formalDefinition="Indicates the type of function performed at the location." ) + protected CodeableConcept type; + + /** + * The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details of the location", formalDefinition="The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites." ) + protected List telecom; + + /** + * Physical location. + */ + @Child(name = "address", type = {Address.class}, order=6, min=0, max=1) + @Description(shortDefinition="Physical location", formalDefinition="Physical location." ) + protected Address address; + + /** + * Physical form of the location, e.g. building, room, vehicle, road. + */ + @Child(name = "physicalType", type = {CodeableConcept.class}, order=7, min=0, max=1) + @Description(shortDefinition="Physical form of the location", formalDefinition="Physical form of the location, e.g. building, room, vehicle, road." ) + protected CodeableConcept physicalType; + + /** + * The absolute geographic location of the Location, expressed in with the WGS84 datum (This is the same co-ordinate system used in KML). + */ + @Child(name = "position", type = {}, order=8, min=0, max=1) + @Description(shortDefinition="The absolute geographic location", formalDefinition="The absolute geographic location of the Location, expressed in with the WGS84 datum (This is the same co-ordinate system used in KML)." ) + protected LocationPositionComponent position; + + /** + * The organization that is responsible for the provisioning and upkeep of the location. + */ + @Child(name = "managingOrganization", type = {Organization.class}, order=9, min=0, max=1) + @Description(shortDefinition="The organization that is responsible for the provisioning and upkeep of the location", formalDefinition="The organization that is responsible for the provisioning and upkeep of the location." ) + protected Reference managingOrganization; + + /** + * The actual object that is the target of the reference (The organization that is responsible for the provisioning and upkeep of the location.) + */ + protected Organization managingOrganizationTarget; + + /** + * Another Location which this Location is physically part of. + */ + @Child(name = "partOf", type = {Location.class}, order=10, min=0, max=1) + @Description(shortDefinition="Another Location which this Location is physically part of", formalDefinition="Another Location which this Location is physically part of." ) + protected Reference partOf; + + /** + * The actual object that is the target of the reference (Another Location which this Location is physically part of.) + */ + protected Location partOfTarget; + + /** + * active | suspended | inactive. + */ + @Child(name = "status", type = {CodeType.class}, order=11, min=0, max=1) + @Description(shortDefinition="active | suspended | inactive", formalDefinition="active | suspended | inactive." ) + protected Enumeration status; + + private static final long serialVersionUID = -520735603L; + + /* + * Constructor + */ + public Location() { + super(); + } + + /** + * @return {@link #identifier} (Unique code or number identifying the location to its users.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Unique code or number identifying the location to its users.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Location addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #name} (Name of the location as used by humans. Does not need to be unique.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (Name of the location as used by humans. Does not need to be unique.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public Location setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Name of the location as used by humans. Does not need to be unique. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Name of the location as used by humans. Does not need to be unique. + */ + public Location setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (Description of the Location, which helps in finding or referencing the place.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Description of the Location, which helps in finding or referencing the place.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public Location setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Description of the Location, which helps in finding or referencing the place. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Description of the Location, which helps in finding or referencing the place. + */ + public Location setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #mode} (Indicates whether a resource instance represents a specific location or a class of locations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public Enumeration getModeElement() { + if (this.mode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(new LocationModeEnumFactory()); // bb + return this.mode; + } + + public boolean hasModeElement() { + return this.mode != null && !this.mode.isEmpty(); + } + + public boolean hasMode() { + return this.mode != null && !this.mode.isEmpty(); + } + + /** + * @param value {@link #mode} (Indicates whether a resource instance represents a specific location or a class of locations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public Location setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return Indicates whether a resource instance represents a specific location or a class of locations. + */ + public LocationMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value Indicates whether a resource instance represents a specific location or a class of locations. + */ + public Location setMode(LocationMode value) { + if (value == null) + this.mode = null; + else { + if (this.mode == null) + this.mode = new Enumeration(new LocationModeEnumFactory()); + this.mode.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (Indicates the type of function performed at the location.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Indicates the type of function performed at the location.) + */ + public Location setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #telecom} (The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public Location addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @return {@link #address} (Physical location.) + */ + public Address getAddress() { + if (this.address == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.address"); + else if (Configuration.doAutoCreate()) + this.address = new Address(); // cc + return this.address; + } + + public boolean hasAddress() { + return this.address != null && !this.address.isEmpty(); + } + + /** + * @param value {@link #address} (Physical location.) + */ + public Location setAddress(Address value) { + this.address = value; + return this; + } + + /** + * @return {@link #physicalType} (Physical form of the location, e.g. building, room, vehicle, road.) + */ + public CodeableConcept getPhysicalType() { + if (this.physicalType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.physicalType"); + else if (Configuration.doAutoCreate()) + this.physicalType = new CodeableConcept(); // cc + return this.physicalType; + } + + public boolean hasPhysicalType() { + return this.physicalType != null && !this.physicalType.isEmpty(); + } + + /** + * @param value {@link #physicalType} (Physical form of the location, e.g. building, room, vehicle, road.) + */ + public Location setPhysicalType(CodeableConcept value) { + this.physicalType = value; + return this; + } + + /** + * @return {@link #position} (The absolute geographic location of the Location, expressed in with the WGS84 datum (This is the same co-ordinate system used in KML).) + */ + public LocationPositionComponent getPosition() { + if (this.position == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.position"); + else if (Configuration.doAutoCreate()) + this.position = new LocationPositionComponent(); // cc + return this.position; + } + + public boolean hasPosition() { + return this.position != null && !this.position.isEmpty(); + } + + /** + * @param value {@link #position} (The absolute geographic location of the Location, expressed in with the WGS84 datum (This is the same co-ordinate system used in KML).) + */ + public Location setPosition(LocationPositionComponent value) { + this.position = value; + return this; + } + + /** + * @return {@link #managingOrganization} (The organization that is responsible for the provisioning and upkeep of the location.) + */ + public Reference getManagingOrganization() { + if (this.managingOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganization = new Reference(); // cc + return this.managingOrganization; + } + + public boolean hasManagingOrganization() { + return this.managingOrganization != null && !this.managingOrganization.isEmpty(); + } + + /** + * @param value {@link #managingOrganization} (The organization that is responsible for the provisioning and upkeep of the location.) + */ + public Location setManagingOrganization(Reference value) { + this.managingOrganization = value; + return this; + } + + /** + * @return {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization that is responsible for the provisioning and upkeep of the location.) + */ + public Organization getManagingOrganizationTarget() { + if (this.managingOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganizationTarget = new Organization(); // aa + return this.managingOrganizationTarget; + } + + /** + * @param value {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization that is responsible for the provisioning and upkeep of the location.) + */ + public Location setManagingOrganizationTarget(Organization value) { + this.managingOrganizationTarget = value; + return this; + } + + /** + * @return {@link #partOf} (Another Location which this Location is physically part of.) + */ + public Reference getPartOf() { + if (this.partOf == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.partOf"); + else if (Configuration.doAutoCreate()) + this.partOf = new Reference(); // cc + return this.partOf; + } + + public boolean hasPartOf() { + return this.partOf != null && !this.partOf.isEmpty(); + } + + /** + * @param value {@link #partOf} (Another Location which this Location is physically part of.) + */ + public Location setPartOf(Reference value) { + this.partOf = value; + return this; + } + + /** + * @return {@link #partOf} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Another Location which this Location is physically part of.) + */ + public Location getPartOfTarget() { + if (this.partOfTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.partOf"); + else if (Configuration.doAutoCreate()) + this.partOfTarget = new Location(); // aa + return this.partOfTarget; + } + + /** + * @param value {@link #partOf} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Another Location which this Location is physically part of.) + */ + public Location setPartOfTarget(Location value) { + this.partOfTarget = value; + return this; + } + + /** + * @return {@link #status} (active | suspended | inactive.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new LocationStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (active | suspended | inactive.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Location setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return active | suspended | inactive. + */ + public LocationStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value active | suspended | inactive. + */ + public Location setStatus(LocationStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new LocationStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Unique code or number identifying the location to its users.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("name", "string", "Name of the location as used by humans. Does not need to be unique.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("description", "string", "Description of the Location, which helps in finding or referencing the place.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("mode", "code", "Indicates whether a resource instance represents a specific location or a class of locations.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of function performed at the location.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("telecom", "ContactPoint", "The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("address", "Address", "Physical location.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("physicalType", "CodeableConcept", "Physical form of the location, e.g. building, room, vehicle, road.", 0, java.lang.Integer.MAX_VALUE, physicalType)); + childrenList.add(new Property("position", "", "The absolute geographic location of the Location, expressed in with the WGS84 datum (This is the same co-ordinate system used in KML).", 0, java.lang.Integer.MAX_VALUE, position)); + childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The organization that is responsible for the provisioning and upkeep of the location.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); + childrenList.add(new Property("partOf", "Reference(Location)", "Another Location which this Location is physically part of.", 0, java.lang.Integer.MAX_VALUE, partOf)); + childrenList.add(new Property("status", "code", "active | suspended | inactive.", 0, java.lang.Integer.MAX_VALUE, status)); + } + + public Location copy() { + Location dst = new Location(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.name = name == null ? null : name.copy(); + dst.description = description == null ? null : description.copy(); + dst.mode = mode == null ? null : mode.copy(); + dst.type = type == null ? null : type.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.address = address == null ? null : address.copy(); + dst.physicalType = physicalType == null ? null : physicalType.copy(); + dst.position = position == null ? null : position.copy(); + dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); + dst.partOf = partOf == null ? null : partOf.copy(); + dst.status = status == null ? null : status.copy(); + return dst; + } + + protected Location typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Location)) + return false; + Location o = (Location) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(description, o.description, true) + && compareDeep(mode, o.mode, true) && compareDeep(type, o.type, true) && compareDeep(telecom, o.telecom, true) + && compareDeep(address, o.address, true) && compareDeep(physicalType, o.physicalType, true) && compareDeep(position, o.position, true) + && compareDeep(managingOrganization, o.managingOrganization, true) && compareDeep(partOf, o.partOf, true) + && compareDeep(status, o.status, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Location)) + return false; + Location o = (Location) other; + return compareValues(name, o.name, true) && compareValues(description, o.description, true) && compareValues(mode, o.mode, true) + && compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) + && (description == null || description.isEmpty()) && (mode == null || mode.isEmpty()) && (type == null || type.isEmpty()) + && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) && (physicalType == null || physicalType.isEmpty()) + && (position == null || position.isEmpty()) && (managingOrganization == null || managingOrganization.isEmpty()) + && (partOf == null || partOf.isEmpty()) && (status == null || status.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Location; + } + + @SearchParamDefinition(name="identifier", path="Location.identifier", description="Unique code or number identifying the location to its users", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="partof", path="Location.partOf", description="The location of which this location is a part", type="reference" ) + public static final String SP_PARTOF = "partof"; + @SearchParamDefinition(name="near-distance", path="", description="A distance quantity to limit the near search to locations within a specific distance", type="token" ) + public static final String SP_NEARDISTANCE = "near-distance"; + @SearchParamDefinition(name="address", path="Location.address", description="A (part of the) address of the location", type="string" ) + public static final String SP_ADDRESS = "address"; + @SearchParamDefinition(name="organization", path="Location.managingOrganization", description="Searches for locations that are managed by the provided organization", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + @SearchParamDefinition(name="name", path="Location.name", description="A (portion of the) name of the location", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="near", path="", description="The coordinates expressed as [lat],[long] (using the WGS84 datum, see notes) to find locations near to (servers may search using a square rather than a circle for efficiency)", type="token" ) + public static final String SP_NEAR = "near"; + @SearchParamDefinition(name="type", path="Location.type", description="A code for the type of location", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="status", path="Location.status", description="Searches for locations with a specific kind of status", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Media.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Media.java index 0a01cc80483..a9225e7f82b 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Media.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Media.java @@ -1,836 +1,815 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. - */ -@ResourceDef(name="Media", profile="http://hl7.org/fhir/Profile/Media") -public class Media extends DomainResource { - - public enum DigitalMediaType { - /** - * The media consists of one or more unmoving images, including photographs, computer-generated graphs and charts, and scanned documents. - */ - PHOTO, - /** - * The media consists of a series of frames that capture a moving image. - */ - VIDEO, - /** - * The media consists of a sound recording. - */ - AUDIO, - /** - * added to help the parsers - */ - NULL; - public static DigitalMediaType fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("photo".equals(codeString)) - return PHOTO; - if ("video".equals(codeString)) - return VIDEO; - if ("audio".equals(codeString)) - return AUDIO; - throw new Exception("Unknown DigitalMediaType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PHOTO: return "photo"; - case VIDEO: return "video"; - case AUDIO: return "audio"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PHOTO: return ""; - case VIDEO: return ""; - case AUDIO: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PHOTO: return "The media consists of one or more unmoving images, including photographs, computer-generated graphs and charts, and scanned documents."; - case VIDEO: return "The media consists of a series of frames that capture a moving image."; - case AUDIO: return "The media consists of a sound recording."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PHOTO: return "Photo"; - case VIDEO: return "Video"; - case AUDIO: return "Audio"; - default: return "?"; - } - } - } - - public static class DigitalMediaTypeEnumFactory implements EnumFactory { - public DigitalMediaType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("photo".equals(codeString)) - return DigitalMediaType.PHOTO; - if ("video".equals(codeString)) - return DigitalMediaType.VIDEO; - if ("audio".equals(codeString)) - return DigitalMediaType.AUDIO; - throw new IllegalArgumentException("Unknown DigitalMediaType code '"+codeString+"'"); - } - public String toCode(DigitalMediaType code) { - if (code == DigitalMediaType.PHOTO) - return "photo"; - if (code == DigitalMediaType.VIDEO) - return "video"; - if (code == DigitalMediaType.AUDIO) - return "audio"; - return "?"; - } - } - - /** - * Whether the media is a photo (still image), an audio recording, or a video recording. - */ - @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1) - @Description(shortDefinition="photo | video | audio", formalDefinition="Whether the media is a photo (still image), an audio recording, or a video recording." ) - protected Enumeration type; - - /** - * Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality. - */ - @Child(name = "subtype", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="The type of acquisition equipment/process", formalDefinition="Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality." ) - protected CodeableConcept subtype; - - /** - * Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers. - */ - @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Identifier(s) for the image", formalDefinition="Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers." ) - protected List identifier; - - /** - * Who/What this Media is a record of. - */ - @Child(name = "subject", type = {Patient.class, Practitioner.class, Group.class, Device.class, Specimen.class}, order=3, min=0, max=1) - @Description(shortDefinition="Who/What this Media is a record of", formalDefinition="Who/What this Media is a record of." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Who/What this Media is a record of.) - */ - protected Resource subjectTarget; - - /** - * The person who administered the collection of the image. - */ - @Child(name = "operator", type = {Practitioner.class}, order=4, min=0, max=1) - @Description(shortDefinition="The person who generated the image", formalDefinition="The person who administered the collection of the image." ) - protected Reference operator; - - /** - * The actual object that is the target of the reference (The person who administered the collection of the image.) - */ - protected Practitioner operatorTarget; - - /** - * The name of the imaging view e.g Lateral or Antero-posterior (AP). - */ - @Child(name = "view", type = {CodeableConcept.class}, order=5, min=0, max=1) - @Description(shortDefinition="Imaging view e.g Lateral or Antero-posterior", formalDefinition="The name of the imaging view e.g Lateral or Antero-posterior (AP)." ) - protected CodeableConcept view; - - /** - * The name of the device / manufacturer of the device that was used to make the recording. - */ - @Child(name = "deviceName", type = {StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Name of the device/manufacturer", formalDefinition="The name of the device / manufacturer of the device that was used to make the recording." ) - protected StringType deviceName; - - /** - * Height of the image in pixels(photo/video). - */ - @Child(name = "height", type = {PositiveIntType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Height of the image in pixels(photo/video)", formalDefinition="Height of the image in pixels(photo/video)." ) - protected PositiveIntType height; - - /** - * Width of the image in pixels (photo/video). - */ - @Child(name = "width", type = {PositiveIntType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Width of the image in pixels (photo/video)", formalDefinition="Width of the image in pixels (photo/video)." ) - protected PositiveIntType width; - - /** - * The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required. - */ - @Child(name = "frames", type = {PositiveIntType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Number of frames if > 1 (photo)", formalDefinition="The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required." ) - protected PositiveIntType frames; - - /** - * The duration of the recording in seconds - for audio and video. - */ - @Child(name = "duration", type = {UnsignedIntType.class}, order=10, min=0, max=1) - @Description(shortDefinition="Length in seconds (audio / video)", formalDefinition="The duration of the recording in seconds - for audio and video." ) - protected UnsignedIntType duration; - - /** - * The actual content of the media - inline or by direct reference to the media source file. - */ - @Child(name = "content", type = {Attachment.class}, order=11, min=1, max=1) - @Description(shortDefinition="Actual Media - reference or data", formalDefinition="The actual content of the media - inline or by direct reference to the media source file." ) - protected Attachment content; - - private static final long serialVersionUID = -280764739L; - - /* - * Constructor - */ - public Media() { - super(); - } - - /* - * Constructor - */ - public Media(Enumeration type, Attachment content) { - super(); - this.type = type; - this.content = content; - } - - /** - * @return {@link #type} (Whether the media is a photo (still image), an audio recording, or a video recording.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new DigitalMediaTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Whether the media is a photo (still image), an audio recording, or a video recording.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Media setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Whether the media is a photo (still image), an audio recording, or a video recording. - */ - public DigitalMediaType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Whether the media is a photo (still image), an audio recording, or a video recording. - */ - public Media setType(DigitalMediaType value) { - if (this.type == null) - this.type = new Enumeration(new DigitalMediaTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #subtype} (Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.) - */ - public CodeableConcept getSubtype() { - if (this.subtype == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.subtype"); - else if (Configuration.doAutoCreate()) - this.subtype = new CodeableConcept(); // cc - return this.subtype; - } - - public boolean hasSubtype() { - return this.subtype != null && !this.subtype.isEmpty(); - } - - /** - * @param value {@link #subtype} (Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.) - */ - public Media setSubtype(CodeableConcept value) { - this.subtype = value; - return this; - } - - /** - * @return {@link #identifier} (Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Media addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #subject} (Who/What this Media is a record of.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (Who/What this Media is a record of.) - */ - public Media setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who/What this Media is a record of.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who/What this Media is a record of.) - */ - public Media setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #operator} (The person who administered the collection of the image.) - */ - public Reference getOperator() { - if (this.operator == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.operator"); - else if (Configuration.doAutoCreate()) - this.operator = new Reference(); // cc - return this.operator; - } - - public boolean hasOperator() { - return this.operator != null && !this.operator.isEmpty(); - } - - /** - * @param value {@link #operator} (The person who administered the collection of the image.) - */ - public Media setOperator(Reference value) { - this.operator = value; - return this; - } - - /** - * @return {@link #operator} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person who administered the collection of the image.) - */ - public Practitioner getOperatorTarget() { - if (this.operatorTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.operator"); - else if (Configuration.doAutoCreate()) - this.operatorTarget = new Practitioner(); // aa - return this.operatorTarget; - } - - /** - * @param value {@link #operator} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person who administered the collection of the image.) - */ - public Media setOperatorTarget(Practitioner value) { - this.operatorTarget = value; - return this; - } - - /** - * @return {@link #view} (The name of the imaging view e.g Lateral or Antero-posterior (AP).) - */ - public CodeableConcept getView() { - if (this.view == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.view"); - else if (Configuration.doAutoCreate()) - this.view = new CodeableConcept(); // cc - return this.view; - } - - public boolean hasView() { - return this.view != null && !this.view.isEmpty(); - } - - /** - * @param value {@link #view} (The name of the imaging view e.g Lateral or Antero-posterior (AP).) - */ - public Media setView(CodeableConcept value) { - this.view = value; - return this; - } - - /** - * @return {@link #deviceName} (The name of the device / manufacturer of the device that was used to make the recording.). This is the underlying object with id, value and extensions. The accessor "getDeviceName" gives direct access to the value - */ - public StringType getDeviceNameElement() { - if (this.deviceName == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.deviceName"); - else if (Configuration.doAutoCreate()) - this.deviceName = new StringType(); // bb - return this.deviceName; - } - - public boolean hasDeviceNameElement() { - return this.deviceName != null && !this.deviceName.isEmpty(); - } - - public boolean hasDeviceName() { - return this.deviceName != null && !this.deviceName.isEmpty(); - } - - /** - * @param value {@link #deviceName} (The name of the device / manufacturer of the device that was used to make the recording.). This is the underlying object with id, value and extensions. The accessor "getDeviceName" gives direct access to the value - */ - public Media setDeviceNameElement(StringType value) { - this.deviceName = value; - return this; - } - - /** - * @return The name of the device / manufacturer of the device that was used to make the recording. - */ - public String getDeviceName() { - return this.deviceName == null ? null : this.deviceName.getValue(); - } - - /** - * @param value The name of the device / manufacturer of the device that was used to make the recording. - */ - public Media setDeviceName(String value) { - if (Utilities.noString(value)) - this.deviceName = null; - else { - if (this.deviceName == null) - this.deviceName = new StringType(); - this.deviceName.setValue(value); - } - return this; - } - - /** - * @return {@link #height} (Height of the image in pixels(photo/video).). This is the underlying object with id, value and extensions. The accessor "getHeight" gives direct access to the value - */ - public PositiveIntType getHeightElement() { - if (this.height == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.height"); - else if (Configuration.doAutoCreate()) - this.height = new PositiveIntType(); // bb - return this.height; - } - - public boolean hasHeightElement() { - return this.height != null && !this.height.isEmpty(); - } - - public boolean hasHeight() { - return this.height != null && !this.height.isEmpty(); - } - - /** - * @param value {@link #height} (Height of the image in pixels(photo/video).). This is the underlying object with id, value and extensions. The accessor "getHeight" gives direct access to the value - */ - public Media setHeightElement(PositiveIntType value) { - this.height = value; - return this; - } - - /** - * @return Height of the image in pixels(photo/video). - */ - public int getHeight() { - return this.height == null || this.height.isEmpty() ? 0 : this.height.getValue(); - } - - /** - * @param value Height of the image in pixels(photo/video). - */ - public Media setHeight(int value) { - if (this.height == null) - this.height = new PositiveIntType(); - this.height.setValue(value); - return this; - } - - /** - * @return {@link #width} (Width of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getWidth" gives direct access to the value - */ - public PositiveIntType getWidthElement() { - if (this.width == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.width"); - else if (Configuration.doAutoCreate()) - this.width = new PositiveIntType(); // bb - return this.width; - } - - public boolean hasWidthElement() { - return this.width != null && !this.width.isEmpty(); - } - - public boolean hasWidth() { - return this.width != null && !this.width.isEmpty(); - } - - /** - * @param value {@link #width} (Width of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getWidth" gives direct access to the value - */ - public Media setWidthElement(PositiveIntType value) { - this.width = value; - return this; - } - - /** - * @return Width of the image in pixels (photo/video). - */ - public int getWidth() { - return this.width == null || this.width.isEmpty() ? 0 : this.width.getValue(); - } - - /** - * @param value Width of the image in pixels (photo/video). - */ - public Media setWidth(int value) { - if (this.width == null) - this.width = new PositiveIntType(); - this.width.setValue(value); - return this; - } - - /** - * @return {@link #frames} (The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.). This is the underlying object with id, value and extensions. The accessor "getFrames" gives direct access to the value - */ - public PositiveIntType getFramesElement() { - if (this.frames == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.frames"); - else if (Configuration.doAutoCreate()) - this.frames = new PositiveIntType(); // bb - return this.frames; - } - - public boolean hasFramesElement() { - return this.frames != null && !this.frames.isEmpty(); - } - - public boolean hasFrames() { - return this.frames != null && !this.frames.isEmpty(); - } - - /** - * @param value {@link #frames} (The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.). This is the underlying object with id, value and extensions. The accessor "getFrames" gives direct access to the value - */ - public Media setFramesElement(PositiveIntType value) { - this.frames = value; - return this; - } - - /** - * @return The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required. - */ - public int getFrames() { - return this.frames == null || this.frames.isEmpty() ? 0 : this.frames.getValue(); - } - - /** - * @param value The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required. - */ - public Media setFrames(int value) { - if (this.frames == null) - this.frames = new PositiveIntType(); - this.frames.setValue(value); - return this; - } - - /** - * @return {@link #duration} (The duration of the recording in seconds - for audio and video.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value - */ - public UnsignedIntType getDurationElement() { - if (this.duration == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.duration"); - else if (Configuration.doAutoCreate()) - this.duration = new UnsignedIntType(); // bb - return this.duration; - } - - public boolean hasDurationElement() { - return this.duration != null && !this.duration.isEmpty(); - } - - public boolean hasDuration() { - return this.duration != null && !this.duration.isEmpty(); - } - - /** - * @param value {@link #duration} (The duration of the recording in seconds - for audio and video.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value - */ - public Media setDurationElement(UnsignedIntType value) { - this.duration = value; - return this; - } - - /** - * @return The duration of the recording in seconds - for audio and video. - */ - public int getDuration() { - return this.duration == null || this.duration.isEmpty() ? 0 : this.duration.getValue(); - } - - /** - * @param value The duration of the recording in seconds - for audio and video. - */ - public Media setDuration(int value) { - if (this.duration == null) - this.duration = new UnsignedIntType(); - this.duration.setValue(value); - return this; - } - - /** - * @return {@link #content} (The actual content of the media - inline or by direct reference to the media source file.) - */ - public Attachment getContent() { - if (this.content == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.content"); - else if (Configuration.doAutoCreate()) - this.content = new Attachment(); // cc - return this.content; - } - - public boolean hasContent() { - return this.content != null && !this.content.isEmpty(); - } - - /** - * @param value {@link #content} (The actual content of the media - inline or by direct reference to the media source file.) - */ - public Media setContent(Attachment value) { - this.content = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Whether the media is a photo (still image), an audio recording, or a video recording.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("subtype", "CodeableConcept", "Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.", 0, java.lang.Integer.MAX_VALUE, subtype)); - childrenList.add(new Property("identifier", "Identifier", "Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("subject", "Reference(Patient|Practitioner|Group|Device|Specimen)", "Who/What this Media is a record of.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("operator", "Reference(Practitioner)", "The person who administered the collection of the image.", 0, java.lang.Integer.MAX_VALUE, operator)); - childrenList.add(new Property("view", "CodeableConcept", "The name of the imaging view e.g Lateral or Antero-posterior (AP).", 0, java.lang.Integer.MAX_VALUE, view)); - childrenList.add(new Property("deviceName", "string", "The name of the device / manufacturer of the device that was used to make the recording.", 0, java.lang.Integer.MAX_VALUE, deviceName)); - childrenList.add(new Property("height", "positiveInt", "Height of the image in pixels(photo/video).", 0, java.lang.Integer.MAX_VALUE, height)); - childrenList.add(new Property("width", "positiveInt", "Width of the image in pixels (photo/video).", 0, java.lang.Integer.MAX_VALUE, width)); - childrenList.add(new Property("frames", "positiveInt", "The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.", 0, java.lang.Integer.MAX_VALUE, frames)); - childrenList.add(new Property("duration", "unsignedInt", "The duration of the recording in seconds - for audio and video.", 0, java.lang.Integer.MAX_VALUE, duration)); - childrenList.add(new Property("content", "Attachment", "The actual content of the media - inline or by direct reference to the media source file.", 0, java.lang.Integer.MAX_VALUE, content)); - } - - public Media copy() { - Media dst = new Media(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.subtype = subtype == null ? null : subtype.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.subject = subject == null ? null : subject.copy(); - dst.operator = operator == null ? null : operator.copy(); - dst.view = view == null ? null : view.copy(); - dst.deviceName = deviceName == null ? null : deviceName.copy(); - dst.height = height == null ? null : height.copy(); - dst.width = width == null ? null : width.copy(); - dst.frames = frames == null ? null : frames.copy(); - dst.duration = duration == null ? null : duration.copy(); - dst.content = content == null ? null : content.copy(); - return dst; - } - - protected Media typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Media)) - return false; - Media o = (Media) other; - return compareDeep(type, o.type, true) && compareDeep(subtype, o.subtype, true) && compareDeep(identifier, o.identifier, true) - && compareDeep(subject, o.subject, true) && compareDeep(operator, o.operator, true) && compareDeep(view, o.view, true) - && compareDeep(deviceName, o.deviceName, true) && compareDeep(height, o.height, true) && compareDeep(width, o.width, true) - && compareDeep(frames, o.frames, true) && compareDeep(duration, o.duration, true) && compareDeep(content, o.content, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Media)) - return false; - Media o = (Media) other; - return compareValues(type, o.type, true) && compareValues(deviceName, o.deviceName, true) && compareValues(height, o.height, true) - && compareValues(width, o.width, true) && compareValues(frames, o.frames, true) && compareValues(duration, o.duration, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (subtype == null || subtype.isEmpty()) - && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) - && (operator == null || operator.isEmpty()) && (view == null || view.isEmpty()) && (deviceName == null || deviceName.isEmpty()) - && (height == null || height.isEmpty()) && (width == null || width.isEmpty()) && (frames == null || frames.isEmpty()) - && (duration == null || duration.isEmpty()) && (content == null || content.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Media; - } - - @SearchParamDefinition(name="patient", path="Media.subject", description="Who/What this Media is a record of", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="created", path="Media.content.creation", description="Date attachment was first created", type="date" ) - public static final String SP_CREATED = "created"; - @SearchParamDefinition(name="subject", path="Media.subject", description="Who/What this Media is a record of", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="subtype", path="Media.subtype", description="The type of acquisition equipment/process", type="token" ) - public static final String SP_SUBTYPE = "subtype"; - @SearchParamDefinition(name="view", path="Media.view", description="Imaging view e.g Lateral or Antero-posterior", type="token" ) - public static final String SP_VIEW = "view"; - @SearchParamDefinition(name="type", path="Media.type", description="photo | video | audio", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="identifier", path="Media.identifier", description="Identifier(s) for the image", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="operator", path="Media.operator", description="The person who generated the image", type="reference" ) - public static final String SP_OPERATOR = "operator"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. + */ +@ResourceDef(name="Media", profile="http://hl7.org/fhir/Profile/Media") +public class Media extends DomainResource { + + public enum DigitalMediaType { + /** + * The media consists of one or more unmoving images, including photographs, computer-generated graphs and charts, and scanned documents. + */ + PHOTO, + /** + * The media consists of a series of frames that capture a moving image. + */ + VIDEO, + /** + * The media consists of a sound recording. + */ + AUDIO, + /** + * added to help the parsers + */ + NULL; + public static DigitalMediaType fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("photo".equals(codeString)) + return PHOTO; + if ("video".equals(codeString)) + return VIDEO; + if ("audio".equals(codeString)) + return AUDIO; + throw new Exception("Unknown DigitalMediaType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PHOTO: return "photo"; + case VIDEO: return "video"; + case AUDIO: return "audio"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PHOTO: return ""; + case VIDEO: return ""; + case AUDIO: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PHOTO: return "The media consists of one or more unmoving images, including photographs, computer-generated graphs and charts, and scanned documents."; + case VIDEO: return "The media consists of a series of frames that capture a moving image."; + case AUDIO: return "The media consists of a sound recording."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PHOTO: return "Photo"; + case VIDEO: return "Video"; + case AUDIO: return "Audio"; + default: return "?"; + } + } + } + + public static class DigitalMediaTypeEnumFactory implements EnumFactory { + public DigitalMediaType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("photo".equals(codeString)) + return DigitalMediaType.PHOTO; + if ("video".equals(codeString)) + return DigitalMediaType.VIDEO; + if ("audio".equals(codeString)) + return DigitalMediaType.AUDIO; + throw new IllegalArgumentException("Unknown DigitalMediaType code '"+codeString+"'"); + } + public String toCode(DigitalMediaType code) { + if (code == DigitalMediaType.PHOTO) + return "photo"; + if (code == DigitalMediaType.VIDEO) + return "video"; + if (code == DigitalMediaType.AUDIO) + return "audio"; + return "?"; + } + } + + /** + * Whether the media is a photo (still image), an audio recording, or a video recording. + */ + @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1) + @Description(shortDefinition="photo | video | audio", formalDefinition="Whether the media is a photo (still image), an audio recording, or a video recording." ) + protected Enumeration type; + + /** + * Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality. + */ + @Child(name = "subtype", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="The type of acquisition equipment/process", formalDefinition="Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality." ) + protected CodeableConcept subtype; + + /** + * Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers. + */ + @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Identifier(s) for the image", formalDefinition="Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers." ) + protected List identifier; + + /** + * Who/What this Media is a record of. + */ + @Child(name = "subject", type = {Patient.class, Practitioner.class, Group.class, Device.class, Specimen.class}, order=3, min=0, max=1) + @Description(shortDefinition="Who/What this Media is a record of", formalDefinition="Who/What this Media is a record of." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Who/What this Media is a record of.) + */ + protected Resource subjectTarget; + + /** + * The person who administered the collection of the image. + */ + @Child(name = "operator", type = {Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="The person who generated the image", formalDefinition="The person who administered the collection of the image." ) + protected Reference operator; + + /** + * The actual object that is the target of the reference (The person who administered the collection of the image.) + */ + protected Practitioner operatorTarget; + + /** + * The name of the imaging view e.g Lateral or Antero-posterior (AP). + */ + @Child(name = "view", type = {CodeableConcept.class}, order=5, min=0, max=1) + @Description(shortDefinition="Imaging view e.g Lateral or Antero-posterior", formalDefinition="The name of the imaging view e.g Lateral or Antero-posterior (AP)." ) + protected CodeableConcept view; + + /** + * The name of the device / manufacturer of the device that was used to make the recording. + */ + @Child(name = "deviceName", type = {StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Name of the device/manufacturer", formalDefinition="The name of the device / manufacturer of the device that was used to make the recording." ) + protected StringType deviceName; + + /** + * Height of the image in pixels(photo/video). + */ + @Child(name = "height", type = {PositiveIntType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Height of the image in pixels(photo/video)", formalDefinition="Height of the image in pixels(photo/video)." ) + protected PositiveIntType height; + + /** + * Width of the image in pixels (photo/video). + */ + @Child(name = "width", type = {PositiveIntType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Width of the image in pixels (photo/video)", formalDefinition="Width of the image in pixels (photo/video)." ) + protected PositiveIntType width; + + /** + * The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required. + */ + @Child(name = "frames", type = {PositiveIntType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Number of frames if > 1 (photo)", formalDefinition="The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required." ) + protected PositiveIntType frames; + + /** + * The duration of the recording in seconds - for audio and video. + */ + @Child(name = "duration", type = {UnsignedIntType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Length in seconds (audio / video)", formalDefinition="The duration of the recording in seconds - for audio and video." ) + protected UnsignedIntType duration; + + /** + * The actual content of the media - inline or by direct reference to the media source file. + */ + @Child(name = "content", type = {Attachment.class}, order=11, min=1, max=1) + @Description(shortDefinition="Actual Media - reference or data", formalDefinition="The actual content of the media - inline or by direct reference to the media source file." ) + protected Attachment content; + + private static final long serialVersionUID = -280764739L; + + /* + * Constructor + */ + public Media() { + super(); + } + + /* + * Constructor + */ + public Media(Enumeration type, Attachment content) { + super(); + this.type = type; + this.content = content; + } + + /** + * @return {@link #type} (Whether the media is a photo (still image), an audio recording, or a video recording.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new DigitalMediaTypeEnumFactory()); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Whether the media is a photo (still image), an audio recording, or a video recording.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Media setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Whether the media is a photo (still image), an audio recording, or a video recording. + */ + public DigitalMediaType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Whether the media is a photo (still image), an audio recording, or a video recording. + */ + public Media setType(DigitalMediaType value) { + if (this.type == null) + this.type = new Enumeration(new DigitalMediaTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #subtype} (Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.) + */ + public CodeableConcept getSubtype() { + if (this.subtype == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.subtype"); + else if (Configuration.doAutoCreate()) + this.subtype = new CodeableConcept(); // cc + return this.subtype; + } + + public boolean hasSubtype() { + return this.subtype != null && !this.subtype.isEmpty(); + } + + /** + * @param value {@link #subtype} (Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.) + */ + public Media setSubtype(CodeableConcept value) { + this.subtype = value; + return this; + } + + /** + * @return {@link #identifier} (Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Media addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #subject} (Who/What this Media is a record of.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Who/What this Media is a record of.) + */ + public Media setSubject(Reference value) { + this.subject = value; + return this; + } + + /** + * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who/What this Media is a record of.) + */ + public Resource getSubjectTarget() { + return this.subjectTarget; + } + + /** + * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who/What this Media is a record of.) + */ + public Media setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #operator} (The person who administered the collection of the image.) + */ + public Reference getOperator() { + if (this.operator == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.operator"); + else if (Configuration.doAutoCreate()) + this.operator = new Reference(); // cc + return this.operator; + } + + public boolean hasOperator() { + return this.operator != null && !this.operator.isEmpty(); + } + + /** + * @param value {@link #operator} (The person who administered the collection of the image.) + */ + public Media setOperator(Reference value) { + this.operator = value; + return this; + } + + /** + * @return {@link #operator} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person who administered the collection of the image.) + */ + public Practitioner getOperatorTarget() { + if (this.operatorTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.operator"); + else if (Configuration.doAutoCreate()) + this.operatorTarget = new Practitioner(); // aa + return this.operatorTarget; + } + + /** + * @param value {@link #operator} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person who administered the collection of the image.) + */ + public Media setOperatorTarget(Practitioner value) { + this.operatorTarget = value; + return this; + } + + /** + * @return {@link #view} (The name of the imaging view e.g Lateral or Antero-posterior (AP).) + */ + public CodeableConcept getView() { + if (this.view == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.view"); + else if (Configuration.doAutoCreate()) + this.view = new CodeableConcept(); // cc + return this.view; + } + + public boolean hasView() { + return this.view != null && !this.view.isEmpty(); + } + + /** + * @param value {@link #view} (The name of the imaging view e.g Lateral or Antero-posterior (AP).) + */ + public Media setView(CodeableConcept value) { + this.view = value; + return this; + } + + /** + * @return {@link #deviceName} (The name of the device / manufacturer of the device that was used to make the recording.). This is the underlying object with id, value and extensions. The accessor "getDeviceName" gives direct access to the value + */ + public StringType getDeviceNameElement() { + if (this.deviceName == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.deviceName"); + else if (Configuration.doAutoCreate()) + this.deviceName = new StringType(); // bb + return this.deviceName; + } + + public boolean hasDeviceNameElement() { + return this.deviceName != null && !this.deviceName.isEmpty(); + } + + public boolean hasDeviceName() { + return this.deviceName != null && !this.deviceName.isEmpty(); + } + + /** + * @param value {@link #deviceName} (The name of the device / manufacturer of the device that was used to make the recording.). This is the underlying object with id, value and extensions. The accessor "getDeviceName" gives direct access to the value + */ + public Media setDeviceNameElement(StringType value) { + this.deviceName = value; + return this; + } + + /** + * @return The name of the device / manufacturer of the device that was used to make the recording. + */ + public String getDeviceName() { + return this.deviceName == null ? null : this.deviceName.getValue(); + } + + /** + * @param value The name of the device / manufacturer of the device that was used to make the recording. + */ + public Media setDeviceName(String value) { + if (Utilities.noString(value)) + this.deviceName = null; + else { + if (this.deviceName == null) + this.deviceName = new StringType(); + this.deviceName.setValue(value); + } + return this; + } + + /** + * @return {@link #height} (Height of the image in pixels(photo/video).). This is the underlying object with id, value and extensions. The accessor "getHeight" gives direct access to the value + */ + public PositiveIntType getHeightElement() { + if (this.height == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.height"); + else if (Configuration.doAutoCreate()) + this.height = new PositiveIntType(); // bb + return this.height; + } + + public boolean hasHeightElement() { + return this.height != null && !this.height.isEmpty(); + } + + public boolean hasHeight() { + return this.height != null && !this.height.isEmpty(); + } + + /** + * @param value {@link #height} (Height of the image in pixels(photo/video).). This is the underlying object with id, value and extensions. The accessor "getHeight" gives direct access to the value + */ + public Media setHeightElement(PositiveIntType value) { + this.height = value; + return this; + } + + /** + * @return Height of the image in pixels(photo/video). + */ + public int getHeight() { + return this.height == null || this.height.isEmpty() ? 0 : this.height.getValue(); + } + + /** + * @param value Height of the image in pixels(photo/video). + */ + public Media setHeight(int value) { + if (this.height == null) + this.height = new PositiveIntType(); + this.height.setValue(value); + return this; + } + + /** + * @return {@link #width} (Width of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getWidth" gives direct access to the value + */ + public PositiveIntType getWidthElement() { + if (this.width == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.width"); + else if (Configuration.doAutoCreate()) + this.width = new PositiveIntType(); // bb + return this.width; + } + + public boolean hasWidthElement() { + return this.width != null && !this.width.isEmpty(); + } + + public boolean hasWidth() { + return this.width != null && !this.width.isEmpty(); + } + + /** + * @param value {@link #width} (Width of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getWidth" gives direct access to the value + */ + public Media setWidthElement(PositiveIntType value) { + this.width = value; + return this; + } + + /** + * @return Width of the image in pixels (photo/video). + */ + public int getWidth() { + return this.width == null || this.width.isEmpty() ? 0 : this.width.getValue(); + } + + /** + * @param value Width of the image in pixels (photo/video). + */ + public Media setWidth(int value) { + if (this.width == null) + this.width = new PositiveIntType(); + this.width.setValue(value); + return this; + } + + /** + * @return {@link #frames} (The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.). This is the underlying object with id, value and extensions. The accessor "getFrames" gives direct access to the value + */ + public PositiveIntType getFramesElement() { + if (this.frames == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.frames"); + else if (Configuration.doAutoCreate()) + this.frames = new PositiveIntType(); // bb + return this.frames; + } + + public boolean hasFramesElement() { + return this.frames != null && !this.frames.isEmpty(); + } + + public boolean hasFrames() { + return this.frames != null && !this.frames.isEmpty(); + } + + /** + * @param value {@link #frames} (The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.). This is the underlying object with id, value and extensions. The accessor "getFrames" gives direct access to the value + */ + public Media setFramesElement(PositiveIntType value) { + this.frames = value; + return this; + } + + /** + * @return The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required. + */ + public int getFrames() { + return this.frames == null || this.frames.isEmpty() ? 0 : this.frames.getValue(); + } + + /** + * @param value The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required. + */ + public Media setFrames(int value) { + if (this.frames == null) + this.frames = new PositiveIntType(); + this.frames.setValue(value); + return this; + } + + /** + * @return {@link #duration} (The duration of the recording in seconds - for audio and video.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value + */ + public UnsignedIntType getDurationElement() { + if (this.duration == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.duration"); + else if (Configuration.doAutoCreate()) + this.duration = new UnsignedIntType(); // bb + return this.duration; + } + + public boolean hasDurationElement() { + return this.duration != null && !this.duration.isEmpty(); + } + + public boolean hasDuration() { + return this.duration != null && !this.duration.isEmpty(); + } + + /** + * @param value {@link #duration} (The duration of the recording in seconds - for audio and video.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value + */ + public Media setDurationElement(UnsignedIntType value) { + this.duration = value; + return this; + } + + /** + * @return The duration of the recording in seconds - for audio and video. + */ + public int getDuration() { + return this.duration == null || this.duration.isEmpty() ? 0 : this.duration.getValue(); + } + + /** + * @param value The duration of the recording in seconds - for audio and video. + */ + public Media setDuration(int value) { + if (this.duration == null) + this.duration = new UnsignedIntType(); + this.duration.setValue(value); + return this; + } + + /** + * @return {@link #content} (The actual content of the media - inline or by direct reference to the media source file.) + */ + public Attachment getContent() { + if (this.content == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.content"); + else if (Configuration.doAutoCreate()) + this.content = new Attachment(); // cc + return this.content; + } + + public boolean hasContent() { + return this.content != null && !this.content.isEmpty(); + } + + /** + * @param value {@link #content} (The actual content of the media - inline or by direct reference to the media source file.) + */ + public Media setContent(Attachment value) { + this.content = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Whether the media is a photo (still image), an audio recording, or a video recording.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("subtype", "CodeableConcept", "Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.", 0, java.lang.Integer.MAX_VALUE, subtype)); + childrenList.add(new Property("identifier", "Identifier", "Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("subject", "Reference(Patient|Practitioner|Group|Device|Specimen)", "Who/What this Media is a record of.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("operator", "Reference(Practitioner)", "The person who administered the collection of the image.", 0, java.lang.Integer.MAX_VALUE, operator)); + childrenList.add(new Property("view", "CodeableConcept", "The name of the imaging view e.g Lateral or Antero-posterior (AP).", 0, java.lang.Integer.MAX_VALUE, view)); + childrenList.add(new Property("deviceName", "string", "The name of the device / manufacturer of the device that was used to make the recording.", 0, java.lang.Integer.MAX_VALUE, deviceName)); + childrenList.add(new Property("height", "positiveInt", "Height of the image in pixels(photo/video).", 0, java.lang.Integer.MAX_VALUE, height)); + childrenList.add(new Property("width", "positiveInt", "Width of the image in pixels (photo/video).", 0, java.lang.Integer.MAX_VALUE, width)); + childrenList.add(new Property("frames", "positiveInt", "The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.", 0, java.lang.Integer.MAX_VALUE, frames)); + childrenList.add(new Property("duration", "unsignedInt", "The duration of the recording in seconds - for audio and video.", 0, java.lang.Integer.MAX_VALUE, duration)); + childrenList.add(new Property("content", "Attachment", "The actual content of the media - inline or by direct reference to the media source file.", 0, java.lang.Integer.MAX_VALUE, content)); + } + + public Media copy() { + Media dst = new Media(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.subtype = subtype == null ? null : subtype.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.subject = subject == null ? null : subject.copy(); + dst.operator = operator == null ? null : operator.copy(); + dst.view = view == null ? null : view.copy(); + dst.deviceName = deviceName == null ? null : deviceName.copy(); + dst.height = height == null ? null : height.copy(); + dst.width = width == null ? null : width.copy(); + dst.frames = frames == null ? null : frames.copy(); + dst.duration = duration == null ? null : duration.copy(); + dst.content = content == null ? null : content.copy(); + return dst; + } + + protected Media typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Media)) + return false; + Media o = (Media) other; + return compareDeep(type, o.type, true) && compareDeep(subtype, o.subtype, true) && compareDeep(identifier, o.identifier, true) + && compareDeep(subject, o.subject, true) && compareDeep(operator, o.operator, true) && compareDeep(view, o.view, true) + && compareDeep(deviceName, o.deviceName, true) && compareDeep(height, o.height, true) && compareDeep(width, o.width, true) + && compareDeep(frames, o.frames, true) && compareDeep(duration, o.duration, true) && compareDeep(content, o.content, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Media)) + return false; + Media o = (Media) other; + return compareValues(type, o.type, true) && compareValues(deviceName, o.deviceName, true) && compareValues(height, o.height, true) + && compareValues(width, o.width, true) && compareValues(frames, o.frames, true) && compareValues(duration, o.duration, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (subtype == null || subtype.isEmpty()) + && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) + && (operator == null || operator.isEmpty()) && (view == null || view.isEmpty()) && (deviceName == null || deviceName.isEmpty()) + && (height == null || height.isEmpty()) && (width == null || width.isEmpty()) && (frames == null || frames.isEmpty()) + && (duration == null || duration.isEmpty()) && (content == null || content.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Media; + } + + @SearchParamDefinition(name="identifier", path="Media.identifier", description="Identifier(s) for the image", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="view", path="Media.view", description="Imaging view e.g Lateral or Antero-posterior", type="token" ) + public static final String SP_VIEW = "view"; + @SearchParamDefinition(name="subtype", path="Media.subtype", description="The type of acquisition equipment/process", type="token" ) + public static final String SP_SUBTYPE = "subtype"; + @SearchParamDefinition(name="created", path="Media.content.creation", description="Date attachment was first created", type="date" ) + public static final String SP_CREATED = "created"; + @SearchParamDefinition(name="subject", path="Media.subject", description="Who/What this Media is a record of", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="patient", path="Media.subject", description="Who/What this Media is a record of", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="type", path="Media.type", description="photo | video | audio", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="operator", path="Media.operator", description="The person who generated the image", type="reference" ) + public static final String SP_OPERATOR = "operator"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Medication.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Medication.java index df3e4f5fb1c..fb07aa0d5a7 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Medication.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Medication.java @@ -1,1320 +1,1299 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Primarily used for identification and definition of Medication, but also covers ingredients and packaging. - */ -@ResourceDef(name="Medication", profile="http://hl7.org/fhir/Profile/Medication") -public class Medication extends DomainResource { - - public enum MedicationKind { - /** - * The medication is a product. - */ - PRODUCT, - /** - * The medication is a package - a contained group of one of more products. - */ - PACKAGE, - /** - * added to help the parsers - */ - NULL; - public static MedicationKind fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("product".equals(codeString)) - return PRODUCT; - if ("package".equals(codeString)) - return PACKAGE; - throw new Exception("Unknown MedicationKind code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PRODUCT: return "product"; - case PACKAGE: return "package"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PRODUCT: return ""; - case PACKAGE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PRODUCT: return "The medication is a product."; - case PACKAGE: return "The medication is a package - a contained group of one of more products."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PRODUCT: return "Product"; - case PACKAGE: return "Package"; - default: return "?"; - } - } - } - - public static class MedicationKindEnumFactory implements EnumFactory { - public MedicationKind fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("product".equals(codeString)) - return MedicationKind.PRODUCT; - if ("package".equals(codeString)) - return MedicationKind.PACKAGE; - throw new IllegalArgumentException("Unknown MedicationKind code '"+codeString+"'"); - } - public String toCode(MedicationKind code) { - if (code == MedicationKind.PRODUCT) - return "product"; - if (code == MedicationKind.PACKAGE) - return "package"; - return "?"; - } - } - - @Block() - public static class MedicationProductComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Describes the form of the item. Powder; tables; carton. - */ - @Child(name = "form", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="powder | tablets | carton +", formalDefinition="Describes the form of the item. Powder; tables; carton." ) - protected CodeableConcept form; - - /** - * Identifies a particular constituent of interest in the product. - */ - @Child(name = "ingredient", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Active or inactive ingredient", formalDefinition="Identifies a particular constituent of interest in the product." ) - protected List ingredient; - - /** - * Information about a group of medication produced or packaged from one production run. - */ - @Child(name = "batch", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="", formalDefinition="Information about a group of medication produced or packaged from one production run." ) - protected List batch; - - private static final long serialVersionUID = 1132853671L; - - /* - * Constructor - */ - public MedicationProductComponent() { - super(); - } - - /** - * @return {@link #form} (Describes the form of the item. Powder; tables; carton.) - */ - public CodeableConcept getForm() { - if (this.form == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationProductComponent.form"); - else if (Configuration.doAutoCreate()) - this.form = new CodeableConcept(); // cc - return this.form; - } - - public boolean hasForm() { - return this.form != null && !this.form.isEmpty(); - } - - /** - * @param value {@link #form} (Describes the form of the item. Powder; tables; carton.) - */ - public MedicationProductComponent setForm(CodeableConcept value) { - this.form = value; - return this; - } - - /** - * @return {@link #ingredient} (Identifies a particular constituent of interest in the product.) - */ - public List getIngredient() { - if (this.ingredient == null) - this.ingredient = new ArrayList(); - return this.ingredient; - } - - public boolean hasIngredient() { - if (this.ingredient == null) - return false; - for (MedicationProductIngredientComponent item : this.ingredient) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #ingredient} (Identifies a particular constituent of interest in the product.) - */ - // syntactic sugar - public MedicationProductIngredientComponent addIngredient() { //3 - MedicationProductIngredientComponent t = new MedicationProductIngredientComponent(); - if (this.ingredient == null) - this.ingredient = new ArrayList(); - this.ingredient.add(t); - return t; - } - - // syntactic sugar - public MedicationProductComponent addIngredient(MedicationProductIngredientComponent t) { //3 - if (t == null) - return this; - if (this.ingredient == null) - this.ingredient = new ArrayList(); - this.ingredient.add(t); - return this; - } - - /** - * @return {@link #batch} (Information about a group of medication produced or packaged from one production run.) - */ - public List getBatch() { - if (this.batch == null) - this.batch = new ArrayList(); - return this.batch; - } - - public boolean hasBatch() { - if (this.batch == null) - return false; - for (MedicationProductBatchComponent item : this.batch) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #batch} (Information about a group of medication produced or packaged from one production run.) - */ - // syntactic sugar - public MedicationProductBatchComponent addBatch() { //3 - MedicationProductBatchComponent t = new MedicationProductBatchComponent(); - if (this.batch == null) - this.batch = new ArrayList(); - this.batch.add(t); - return t; - } - - // syntactic sugar - public MedicationProductComponent addBatch(MedicationProductBatchComponent t) { //3 - if (t == null) - return this; - if (this.batch == null) - this.batch = new ArrayList(); - this.batch.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("form", "CodeableConcept", "Describes the form of the item. Powder; tables; carton.", 0, java.lang.Integer.MAX_VALUE, form)); - childrenList.add(new Property("ingredient", "", "Identifies a particular constituent of interest in the product.", 0, java.lang.Integer.MAX_VALUE, ingredient)); - childrenList.add(new Property("batch", "", "Information about a group of medication produced or packaged from one production run.", 0, java.lang.Integer.MAX_VALUE, batch)); - } - - public MedicationProductComponent copy() { - MedicationProductComponent dst = new MedicationProductComponent(); - copyValues(dst); - dst.form = form == null ? null : form.copy(); - if (ingredient != null) { - dst.ingredient = new ArrayList(); - for (MedicationProductIngredientComponent i : ingredient) - dst.ingredient.add(i.copy()); - }; - if (batch != null) { - dst.batch = new ArrayList(); - for (MedicationProductBatchComponent i : batch) - dst.batch.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationProductComponent)) - return false; - MedicationProductComponent o = (MedicationProductComponent) other; - return compareDeep(form, o.form, true) && compareDeep(ingredient, o.ingredient, true) && compareDeep(batch, o.batch, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationProductComponent)) - return false; - MedicationProductComponent o = (MedicationProductComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (form == null || form.isEmpty()) && (ingredient == null || ingredient.isEmpty()) - && (batch == null || batch.isEmpty()); - } - - } - - @Block() - public static class MedicationProductIngredientComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The actual ingredient - either a substance (simple ingredient) or another medication. - */ - @Child(name = "item", type = {Substance.class, Medication.class}, order=1, min=1, max=1) - @Description(shortDefinition="The product contained", formalDefinition="The actual ingredient - either a substance (simple ingredient) or another medication." ) - protected Reference item; - - /** - * The actual object that is the target of the reference (The actual ingredient - either a substance (simple ingredient) or another medication.) - */ - protected Resource itemTarget; - - /** - * Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet. - */ - @Child(name = "amount", type = {Ratio.class}, order=2, min=0, max=1) - @Description(shortDefinition="How much ingredient in product", formalDefinition="Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet." ) - protected Ratio amount; - - private static final long serialVersionUID = -1217232889L; - - /* - * Constructor - */ - public MedicationProductIngredientComponent() { - super(); - } - - /* - * Constructor - */ - public MedicationProductIngredientComponent(Reference item) { - super(); - this.item = item; - } - - /** - * @return {@link #item} (The actual ingredient - either a substance (simple ingredient) or another medication.) - */ - public Reference getItem() { - if (this.item == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationProductIngredientComponent.item"); - else if (Configuration.doAutoCreate()) - this.item = new Reference(); // cc - return this.item; - } - - public boolean hasItem() { - return this.item != null && !this.item.isEmpty(); - } - - /** - * @param value {@link #item} (The actual ingredient - either a substance (simple ingredient) or another medication.) - */ - public MedicationProductIngredientComponent setItem(Reference value) { - this.item = value; - return this; - } - - /** - * @return {@link #item} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The actual ingredient - either a substance (simple ingredient) or another medication.) - */ - public Resource getItemTarget() { - return this.itemTarget; - } - - /** - * @param value {@link #item} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The actual ingredient - either a substance (simple ingredient) or another medication.) - */ - public MedicationProductIngredientComponent setItemTarget(Resource value) { - this.itemTarget = value; - return this; - } - - /** - * @return {@link #amount} (Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet.) - */ - public Ratio getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationProductIngredientComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Ratio(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet.) - */ - public MedicationProductIngredientComponent setAmount(Ratio value) { - this.amount = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("item", "Reference(Substance|Medication)", "The actual ingredient - either a substance (simple ingredient) or another medication.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("amount", "Ratio", "Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet.", 0, java.lang.Integer.MAX_VALUE, amount)); - } - - public MedicationProductIngredientComponent copy() { - MedicationProductIngredientComponent dst = new MedicationProductIngredientComponent(); - copyValues(dst); - dst.item = item == null ? null : item.copy(); - dst.amount = amount == null ? null : amount.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationProductIngredientComponent)) - return false; - MedicationProductIngredientComponent o = (MedicationProductIngredientComponent) other; - return compareDeep(item, o.item, true) && compareDeep(amount, o.amount, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationProductIngredientComponent)) - return false; - MedicationProductIngredientComponent o = (MedicationProductIngredientComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (item == null || item.isEmpty()) && (amount == null || amount.isEmpty()) - ; - } - - } - - @Block() - public static class MedicationProductBatchComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The assigned lot number of a batch of the specified product. - */ - @Child(name = "lotNumber", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="", formalDefinition="The assigned lot number of a batch of the specified product." ) - protected StringType lotNumber; - - /** - * When this specific batch of product will expire. - */ - @Child(name = "expirationDate", type = {DateTimeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="", formalDefinition="When this specific batch of product will expire." ) - protected DateTimeType expirationDate; - - private static final long serialVersionUID = 1982738755L; - - /* - * Constructor - */ - public MedicationProductBatchComponent() { - super(); - } - - /** - * @return {@link #lotNumber} (The assigned lot number of a batch of the specified product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value - */ - public StringType getLotNumberElement() { - if (this.lotNumber == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationProductBatchComponent.lotNumber"); - else if (Configuration.doAutoCreate()) - this.lotNumber = new StringType(); // bb - return this.lotNumber; - } - - public boolean hasLotNumberElement() { - return this.lotNumber != null && !this.lotNumber.isEmpty(); - } - - public boolean hasLotNumber() { - return this.lotNumber != null && !this.lotNumber.isEmpty(); - } - - /** - * @param value {@link #lotNumber} (The assigned lot number of a batch of the specified product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value - */ - public MedicationProductBatchComponent setLotNumberElement(StringType value) { - this.lotNumber = value; - return this; - } - - /** - * @return The assigned lot number of a batch of the specified product. - */ - public String getLotNumber() { - return this.lotNumber == null ? null : this.lotNumber.getValue(); - } - - /** - * @param value The assigned lot number of a batch of the specified product. - */ - public MedicationProductBatchComponent setLotNumber(String value) { - if (Utilities.noString(value)) - this.lotNumber = null; - else { - if (this.lotNumber == null) - this.lotNumber = new StringType(); - this.lotNumber.setValue(value); - } - return this; - } - - /** - * @return {@link #expirationDate} (When this specific batch of product will expire.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value - */ - public DateTimeType getExpirationDateElement() { - if (this.expirationDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationProductBatchComponent.expirationDate"); - else if (Configuration.doAutoCreate()) - this.expirationDate = new DateTimeType(); // bb - return this.expirationDate; - } - - public boolean hasExpirationDateElement() { - return this.expirationDate != null && !this.expirationDate.isEmpty(); - } - - public boolean hasExpirationDate() { - return this.expirationDate != null && !this.expirationDate.isEmpty(); - } - - /** - * @param value {@link #expirationDate} (When this specific batch of product will expire.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value - */ - public MedicationProductBatchComponent setExpirationDateElement(DateTimeType value) { - this.expirationDate = value; - return this; - } - - /** - * @return When this specific batch of product will expire. - */ - public Date getExpirationDate() { - return this.expirationDate == null ? null : this.expirationDate.getValue(); - } - - /** - * @param value When this specific batch of product will expire. - */ - public MedicationProductBatchComponent setExpirationDate(Date value) { - if (value == null) - this.expirationDate = null; - else { - if (this.expirationDate == null) - this.expirationDate = new DateTimeType(); - this.expirationDate.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("lotNumber", "string", "The assigned lot number of a batch of the specified product.", 0, java.lang.Integer.MAX_VALUE, lotNumber)); - childrenList.add(new Property("expirationDate", "dateTime", "When this specific batch of product will expire.", 0, java.lang.Integer.MAX_VALUE, expirationDate)); - } - - public MedicationProductBatchComponent copy() { - MedicationProductBatchComponent dst = new MedicationProductBatchComponent(); - copyValues(dst); - dst.lotNumber = lotNumber == null ? null : lotNumber.copy(); - dst.expirationDate = expirationDate == null ? null : expirationDate.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationProductBatchComponent)) - return false; - MedicationProductBatchComponent o = (MedicationProductBatchComponent) other; - return compareDeep(lotNumber, o.lotNumber, true) && compareDeep(expirationDate, o.expirationDate, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationProductBatchComponent)) - return false; - MedicationProductBatchComponent o = (MedicationProductBatchComponent) other; - return compareValues(lotNumber, o.lotNumber, true) && compareValues(expirationDate, o.expirationDate, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (lotNumber == null || lotNumber.isEmpty()) && (expirationDate == null || expirationDate.isEmpty()) - ; - } - - } - - @Block() - public static class MedicationPackageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The kind of container that this package comes as. - */ - @Child(name = "container", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="E.g. box, vial, blister-pack", formalDefinition="The kind of container that this package comes as." ) - protected CodeableConcept container; - - /** - * A set of components that go to make up the described item. - */ - @Child(name = "content", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="What is in the package?", formalDefinition="A set of components that go to make up the described item." ) - protected List content; - - private static final long serialVersionUID = 503772472L; - - /* - * Constructor - */ - public MedicationPackageComponent() { - super(); - } - - /** - * @return {@link #container} (The kind of container that this package comes as.) - */ - public CodeableConcept getContainer() { - if (this.container == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPackageComponent.container"); - else if (Configuration.doAutoCreate()) - this.container = new CodeableConcept(); // cc - return this.container; - } - - public boolean hasContainer() { - return this.container != null && !this.container.isEmpty(); - } - - /** - * @param value {@link #container} (The kind of container that this package comes as.) - */ - public MedicationPackageComponent setContainer(CodeableConcept value) { - this.container = value; - return this; - } - - /** - * @return {@link #content} (A set of components that go to make up the described item.) - */ - public List getContent() { - if (this.content == null) - this.content = new ArrayList(); - return this.content; - } - - public boolean hasContent() { - if (this.content == null) - return false; - for (MedicationPackageContentComponent item : this.content) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #content} (A set of components that go to make up the described item.) - */ - // syntactic sugar - public MedicationPackageContentComponent addContent() { //3 - MedicationPackageContentComponent t = new MedicationPackageContentComponent(); - if (this.content == null) - this.content = new ArrayList(); - this.content.add(t); - return t; - } - - // syntactic sugar - public MedicationPackageComponent addContent(MedicationPackageContentComponent t) { //3 - if (t == null) - return this; - if (this.content == null) - this.content = new ArrayList(); - this.content.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("container", "CodeableConcept", "The kind of container that this package comes as.", 0, java.lang.Integer.MAX_VALUE, container)); - childrenList.add(new Property("content", "", "A set of components that go to make up the described item.", 0, java.lang.Integer.MAX_VALUE, content)); - } - - public MedicationPackageComponent copy() { - MedicationPackageComponent dst = new MedicationPackageComponent(); - copyValues(dst); - dst.container = container == null ? null : container.copy(); - if (content != null) { - dst.content = new ArrayList(); - for (MedicationPackageContentComponent i : content) - dst.content.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationPackageComponent)) - return false; - MedicationPackageComponent o = (MedicationPackageComponent) other; - return compareDeep(container, o.container, true) && compareDeep(content, o.content, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationPackageComponent)) - return false; - MedicationPackageComponent o = (MedicationPackageComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (container == null || container.isEmpty()) && (content == null || content.isEmpty()) - ; - } - - } - - @Block() - public static class MedicationPackageContentComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifies one of the items in the package. - */ - @Child(name = "item", type = {Medication.class}, order=1, min=1, max=1) - @Description(shortDefinition="A product in the package", formalDefinition="Identifies one of the items in the package." ) - protected Reference item; - - /** - * The actual object that is the target of the reference (Identifies one of the items in the package.) - */ - protected Medication itemTarget; - - /** - * The amount of the product that is in the package. - */ - @Child(name = "amount", type = {Quantity.class}, order=2, min=0, max=1) - @Description(shortDefinition="How many are in the package?", formalDefinition="The amount of the product that is in the package." ) - protected Quantity amount; - - private static final long serialVersionUID = -1385430192L; - - /* - * Constructor - */ - public MedicationPackageContentComponent() { - super(); - } - - /* - * Constructor - */ - public MedicationPackageContentComponent(Reference item) { - super(); - this.item = item; - } - - /** - * @return {@link #item} (Identifies one of the items in the package.) - */ - public Reference getItem() { - if (this.item == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPackageContentComponent.item"); - else if (Configuration.doAutoCreate()) - this.item = new Reference(); // cc - return this.item; - } - - public boolean hasItem() { - return this.item != null && !this.item.isEmpty(); - } - - /** - * @param value {@link #item} (Identifies one of the items in the package.) - */ - public MedicationPackageContentComponent setItem(Reference value) { - this.item = value; - return this; - } - - /** - * @return {@link #item} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies one of the items in the package.) - */ - public Medication getItemTarget() { - if (this.itemTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPackageContentComponent.item"); - else if (Configuration.doAutoCreate()) - this.itemTarget = new Medication(); // aa - return this.itemTarget; - } - - /** - * @param value {@link #item} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies one of the items in the package.) - */ - public MedicationPackageContentComponent setItemTarget(Medication value) { - this.itemTarget = value; - return this; - } - - /** - * @return {@link #amount} (The amount of the product that is in the package.) - */ - public Quantity getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPackageContentComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Quantity(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (The amount of the product that is in the package.) - */ - public MedicationPackageContentComponent setAmount(Quantity value) { - this.amount = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("item", "Reference(Medication)", "Identifies one of the items in the package.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("amount", "Quantity", "The amount of the product that is in the package.", 0, java.lang.Integer.MAX_VALUE, amount)); - } - - public MedicationPackageContentComponent copy() { - MedicationPackageContentComponent dst = new MedicationPackageContentComponent(); - copyValues(dst); - dst.item = item == null ? null : item.copy(); - dst.amount = amount == null ? null : amount.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationPackageContentComponent)) - return false; - MedicationPackageContentComponent o = (MedicationPackageContentComponent) other; - return compareDeep(item, o.item, true) && compareDeep(amount, o.amount, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationPackageContentComponent)) - return false; - MedicationPackageContentComponent o = (MedicationPackageContentComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (item == null || item.isEmpty()) && (amount == null || amount.isEmpty()) - ; - } - - } - - /** - * The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code. - */ - @Child(name = "name", type = {StringType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Common / Commercial name", formalDefinition="The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code." ) - protected StringType name; - - /** - * A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Codes that identify this medication", formalDefinition="A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes." ) - protected CodeableConcept code; - - /** - * Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is). - */ - @Child(name = "isBrand", type = {BooleanType.class}, order=2, min=0, max=1) - @Description(shortDefinition="True if a brand", formalDefinition="Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is)." ) - protected BooleanType isBrand; - - /** - * Describes the details of the manufacturer. - */ - @Child(name = "manufacturer", type = {Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Manufacturer of the item", formalDefinition="Describes the details of the manufacturer." ) - protected Reference manufacturer; - - /** - * The actual object that is the target of the reference (Describes the details of the manufacturer.) - */ - protected Organization manufacturerTarget; - - /** - * Medications are either a single administrable product or a package that contains one or more products. - */ - @Child(name = "kind", type = {CodeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="product | package", formalDefinition="Medications are either a single administrable product or a package that contains one or more products." ) - protected Enumeration kind; - - /** - * Information that only applies to products (not packages). - */ - @Child(name = "product", type = {}, order=5, min=0, max=1) - @Description(shortDefinition="Administrable medication details", formalDefinition="Information that only applies to products (not packages)." ) - protected MedicationProductComponent product; - - /** - * Information that only applies to packages (not products). - */ - @Child(name = "package_", type = {}, order=6, min=0, max=1) - @Description(shortDefinition="Details about packaged medications", formalDefinition="Information that only applies to packages (not products)." ) - protected MedicationPackageComponent package_; - - private static final long serialVersionUID = 385691577L; - - /* - * Constructor - */ - public Medication() { - super(); - } - - /** - * @return {@link #name} (The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public Medication setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code. - */ - public Medication setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes.) - */ - public Medication setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #isBrand} (Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is).). This is the underlying object with id, value and extensions. The accessor "getIsBrand" gives direct access to the value - */ - public BooleanType getIsBrandElement() { - if (this.isBrand == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.isBrand"); - else if (Configuration.doAutoCreate()) - this.isBrand = new BooleanType(); // bb - return this.isBrand; - } - - public boolean hasIsBrandElement() { - return this.isBrand != null && !this.isBrand.isEmpty(); - } - - public boolean hasIsBrand() { - return this.isBrand != null && !this.isBrand.isEmpty(); - } - - /** - * @param value {@link #isBrand} (Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is).). This is the underlying object with id, value and extensions. The accessor "getIsBrand" gives direct access to the value - */ - public Medication setIsBrandElement(BooleanType value) { - this.isBrand = value; - return this; - } - - /** - * @return Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is). - */ - public boolean getIsBrand() { - return this.isBrand == null || this.isBrand.isEmpty() ? false : this.isBrand.getValue(); - } - - /** - * @param value Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is). - */ - public Medication setIsBrand(boolean value) { - if (this.isBrand == null) - this.isBrand = new BooleanType(); - this.isBrand.setValue(value); - return this; - } - - /** - * @return {@link #manufacturer} (Describes the details of the manufacturer.) - */ - public Reference getManufacturer() { - if (this.manufacturer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.manufacturer"); - else if (Configuration.doAutoCreate()) - this.manufacturer = new Reference(); // cc - return this.manufacturer; - } - - public boolean hasManufacturer() { - return this.manufacturer != null && !this.manufacturer.isEmpty(); - } - - /** - * @param value {@link #manufacturer} (Describes the details of the manufacturer.) - */ - public Medication setManufacturer(Reference value) { - this.manufacturer = value; - return this; - } - - /** - * @return {@link #manufacturer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the details of the manufacturer.) - */ - public Organization getManufacturerTarget() { - if (this.manufacturerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.manufacturer"); - else if (Configuration.doAutoCreate()) - this.manufacturerTarget = new Organization(); // aa - return this.manufacturerTarget; - } - - /** - * @param value {@link #manufacturer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the details of the manufacturer.) - */ - public Medication setManufacturerTarget(Organization value) { - this.manufacturerTarget = value; - return this; - } - - /** - * @return {@link #kind} (Medications are either a single administrable product or a package that contains one or more products.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value - */ - public Enumeration getKindElement() { - if (this.kind == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.kind"); - else if (Configuration.doAutoCreate()) - this.kind = new Enumeration(new MedicationKindEnumFactory()); // bb - return this.kind; - } - - public boolean hasKindElement() { - return this.kind != null && !this.kind.isEmpty(); - } - - public boolean hasKind() { - return this.kind != null && !this.kind.isEmpty(); - } - - /** - * @param value {@link #kind} (Medications are either a single administrable product or a package that contains one or more products.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value - */ - public Medication setKindElement(Enumeration value) { - this.kind = value; - return this; - } - - /** - * @return Medications are either a single administrable product or a package that contains one or more products. - */ - public MedicationKind getKind() { - return this.kind == null ? null : this.kind.getValue(); - } - - /** - * @param value Medications are either a single administrable product or a package that contains one or more products. - */ - public Medication setKind(MedicationKind value) { - if (value == null) - this.kind = null; - else { - if (this.kind == null) - this.kind = new Enumeration(new MedicationKindEnumFactory()); - this.kind.setValue(value); - } - return this; - } - - /** - * @return {@link #product} (Information that only applies to products (not packages).) - */ - public MedicationProductComponent getProduct() { - if (this.product == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.product"); - else if (Configuration.doAutoCreate()) - this.product = new MedicationProductComponent(); // cc - return this.product; - } - - public boolean hasProduct() { - return this.product != null && !this.product.isEmpty(); - } - - /** - * @param value {@link #product} (Information that only applies to products (not packages).) - */ - public Medication setProduct(MedicationProductComponent value) { - this.product = value; - return this; - } - - /** - * @return {@link #package_} (Information that only applies to packages (not products).) - */ - public MedicationPackageComponent getPackage() { - if (this.package_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.package_"); - else if (Configuration.doAutoCreate()) - this.package_ = new MedicationPackageComponent(); // cc - return this.package_; - } - - public boolean hasPackage() { - return this.package_ != null && !this.package_.isEmpty(); - } - - /** - * @param value {@link #package_} (Information that only applies to packages (not products).) - */ - public Medication setPackage(MedicationPackageComponent value) { - this.package_ = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("code", "CodeableConcept", "A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("isBrand", "boolean", "Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is).", 0, java.lang.Integer.MAX_VALUE, isBrand)); - childrenList.add(new Property("manufacturer", "Reference(Organization)", "Describes the details of the manufacturer.", 0, java.lang.Integer.MAX_VALUE, manufacturer)); - childrenList.add(new Property("kind", "code", "Medications are either a single administrable product or a package that contains one or more products.", 0, java.lang.Integer.MAX_VALUE, kind)); - childrenList.add(new Property("product", "", "Information that only applies to products (not packages).", 0, java.lang.Integer.MAX_VALUE, product)); - childrenList.add(new Property("package", "", "Information that only applies to packages (not products).", 0, java.lang.Integer.MAX_VALUE, package_)); - } - - public Medication copy() { - Medication dst = new Medication(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.code = code == null ? null : code.copy(); - dst.isBrand = isBrand == null ? null : isBrand.copy(); - dst.manufacturer = manufacturer == null ? null : manufacturer.copy(); - dst.kind = kind == null ? null : kind.copy(); - dst.product = product == null ? null : product.copy(); - dst.package_ = package_ == null ? null : package_.copy(); - return dst; - } - - protected Medication typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Medication)) - return false; - Medication o = (Medication) other; - return compareDeep(name, o.name, true) && compareDeep(code, o.code, true) && compareDeep(isBrand, o.isBrand, true) - && compareDeep(manufacturer, o.manufacturer, true) && compareDeep(kind, o.kind, true) && compareDeep(product, o.product, true) - && compareDeep(package_, o.package_, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Medication)) - return false; - Medication o = (Medication) other; - return compareValues(name, o.name, true) && compareValues(isBrand, o.isBrand, true) && compareValues(kind, o.kind, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (code == null || code.isEmpty()) - && (isBrand == null || isBrand.isEmpty()) && (manufacturer == null || manufacturer.isEmpty()) - && (kind == null || kind.isEmpty()) && (product == null || product.isEmpty()) && (package_ == null || package_.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Medication; - } - - @SearchParamDefinition(name="content", path="Medication.package.content.item", description="A product in the package", type="reference" ) - public static final String SP_CONTENT = "content"; - @SearchParamDefinition(name="form", path="Medication.product.form", description="powder | tablets | carton +", type="token" ) - public static final String SP_FORM = "form"; - @SearchParamDefinition(name="container", path="Medication.package.container", description="E.g. box, vial, blister-pack", type="token" ) - public static final String SP_CONTAINER = "container"; - @SearchParamDefinition(name="manufacturer", path="Medication.manufacturer", description="Manufacturer of the item", type="reference" ) - public static final String SP_MANUFACTURER = "manufacturer"; - @SearchParamDefinition(name="name", path="Medication.name", description="Common / Commercial name", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="ingredient", path="Medication.product.ingredient.item", description="The product contained", type="reference" ) - public static final String SP_INGREDIENT = "ingredient"; - @SearchParamDefinition(name="code", path="Medication.code", description="Codes that identify this medication", type="token" ) - public static final String SP_CODE = "code"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Primarily used for identification and definition of Medication, but also covers ingredients and packaging. + */ +@ResourceDef(name="Medication", profile="http://hl7.org/fhir/Profile/Medication") +public class Medication extends DomainResource { + + public enum MedicationKind { + /** + * The medication is a product. + */ + PRODUCT, + /** + * The medication is a package - a contained group of one of more products. + */ + PACKAGE, + /** + * added to help the parsers + */ + NULL; + public static MedicationKind fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("product".equals(codeString)) + return PRODUCT; + if ("package".equals(codeString)) + return PACKAGE; + throw new Exception("Unknown MedicationKind code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PRODUCT: return "product"; + case PACKAGE: return "package"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PRODUCT: return ""; + case PACKAGE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PRODUCT: return "The medication is a product."; + case PACKAGE: return "The medication is a package - a contained group of one of more products."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PRODUCT: return "Product"; + case PACKAGE: return "Package"; + default: return "?"; + } + } + } + + public static class MedicationKindEnumFactory implements EnumFactory { + public MedicationKind fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("product".equals(codeString)) + return MedicationKind.PRODUCT; + if ("package".equals(codeString)) + return MedicationKind.PACKAGE; + throw new IllegalArgumentException("Unknown MedicationKind code '"+codeString+"'"); + } + public String toCode(MedicationKind code) { + if (code == MedicationKind.PRODUCT) + return "product"; + if (code == MedicationKind.PACKAGE) + return "package"; + return "?"; + } + } + + @Block() + public static class MedicationProductComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Describes the form of the item. Powder; tables; carton. + */ + @Child(name = "form", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="powder | tablets | carton +", formalDefinition="Describes the form of the item. Powder; tables; carton." ) + protected CodeableConcept form; + + /** + * Identifies a particular constituent of interest in the product. + */ + @Child(name = "ingredient", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Active or inactive ingredient", formalDefinition="Identifies a particular constituent of interest in the product." ) + protected List ingredient; + + /** + * Information about a group of medication produced or packaged from one production run. + */ + @Child(name = "batch", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="", formalDefinition="Information about a group of medication produced or packaged from one production run." ) + protected List batch; + + private static final long serialVersionUID = 1132853671L; + + /* + * Constructor + */ + public MedicationProductComponent() { + super(); + } + + /** + * @return {@link #form} (Describes the form of the item. Powder; tables; carton.) + */ + public CodeableConcept getForm() { + if (this.form == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationProductComponent.form"); + else if (Configuration.doAutoCreate()) + this.form = new CodeableConcept(); // cc + return this.form; + } + + public boolean hasForm() { + return this.form != null && !this.form.isEmpty(); + } + + /** + * @param value {@link #form} (Describes the form of the item. Powder; tables; carton.) + */ + public MedicationProductComponent setForm(CodeableConcept value) { + this.form = value; + return this; + } + + /** + * @return {@link #ingredient} (Identifies a particular constituent of interest in the product.) + */ + public List getIngredient() { + if (this.ingredient == null) + this.ingredient = new ArrayList(); + return this.ingredient; + } + + public boolean hasIngredient() { + if (this.ingredient == null) + return false; + for (MedicationProductIngredientComponent item : this.ingredient) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #ingredient} (Identifies a particular constituent of interest in the product.) + */ + // syntactic sugar + public MedicationProductIngredientComponent addIngredient() { //3 + MedicationProductIngredientComponent t = new MedicationProductIngredientComponent(); + if (this.ingredient == null) + this.ingredient = new ArrayList(); + this.ingredient.add(t); + return t; + } + + // syntactic sugar + public MedicationProductComponent addIngredient(MedicationProductIngredientComponent t) { //3 + if (t == null) + return this; + if (this.ingredient == null) + this.ingredient = new ArrayList(); + this.ingredient.add(t); + return this; + } + + /** + * @return {@link #batch} (Information about a group of medication produced or packaged from one production run.) + */ + public List getBatch() { + if (this.batch == null) + this.batch = new ArrayList(); + return this.batch; + } + + public boolean hasBatch() { + if (this.batch == null) + return false; + for (MedicationProductBatchComponent item : this.batch) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #batch} (Information about a group of medication produced or packaged from one production run.) + */ + // syntactic sugar + public MedicationProductBatchComponent addBatch() { //3 + MedicationProductBatchComponent t = new MedicationProductBatchComponent(); + if (this.batch == null) + this.batch = new ArrayList(); + this.batch.add(t); + return t; + } + + // syntactic sugar + public MedicationProductComponent addBatch(MedicationProductBatchComponent t) { //3 + if (t == null) + return this; + if (this.batch == null) + this.batch = new ArrayList(); + this.batch.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("form", "CodeableConcept", "Describes the form of the item. Powder; tables; carton.", 0, java.lang.Integer.MAX_VALUE, form)); + childrenList.add(new Property("ingredient", "", "Identifies a particular constituent of interest in the product.", 0, java.lang.Integer.MAX_VALUE, ingredient)); + childrenList.add(new Property("batch", "", "Information about a group of medication produced or packaged from one production run.", 0, java.lang.Integer.MAX_VALUE, batch)); + } + + public MedicationProductComponent copy() { + MedicationProductComponent dst = new MedicationProductComponent(); + copyValues(dst); + dst.form = form == null ? null : form.copy(); + if (ingredient != null) { + dst.ingredient = new ArrayList(); + for (MedicationProductIngredientComponent i : ingredient) + dst.ingredient.add(i.copy()); + }; + if (batch != null) { + dst.batch = new ArrayList(); + for (MedicationProductBatchComponent i : batch) + dst.batch.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationProductComponent)) + return false; + MedicationProductComponent o = (MedicationProductComponent) other; + return compareDeep(form, o.form, true) && compareDeep(ingredient, o.ingredient, true) && compareDeep(batch, o.batch, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationProductComponent)) + return false; + MedicationProductComponent o = (MedicationProductComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (form == null || form.isEmpty()) && (ingredient == null || ingredient.isEmpty()) + && (batch == null || batch.isEmpty()); + } + + } + + @Block() + public static class MedicationProductIngredientComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The actual ingredient - either a substance (simple ingredient) or another medication. + */ + @Child(name = "item", type = {Substance.class, Medication.class}, order=1, min=1, max=1) + @Description(shortDefinition="The product contained", formalDefinition="The actual ingredient - either a substance (simple ingredient) or another medication." ) + protected Reference item; + + /** + * The actual object that is the target of the reference (The actual ingredient - either a substance (simple ingredient) or another medication.) + */ + protected Resource itemTarget; + + /** + * Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet. + */ + @Child(name = "amount", type = {Ratio.class}, order=2, min=0, max=1) + @Description(shortDefinition="How much ingredient in product", formalDefinition="Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet." ) + protected Ratio amount; + + private static final long serialVersionUID = -1217232889L; + + /* + * Constructor + */ + public MedicationProductIngredientComponent() { + super(); + } + + /* + * Constructor + */ + public MedicationProductIngredientComponent(Reference item) { + super(); + this.item = item; + } + + /** + * @return {@link #item} (The actual ingredient - either a substance (simple ingredient) or another medication.) + */ + public Reference getItem() { + if (this.item == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationProductIngredientComponent.item"); + else if (Configuration.doAutoCreate()) + this.item = new Reference(); // cc + return this.item; + } + + public boolean hasItem() { + return this.item != null && !this.item.isEmpty(); + } + + /** + * @param value {@link #item} (The actual ingredient - either a substance (simple ingredient) or another medication.) + */ + public MedicationProductIngredientComponent setItem(Reference value) { + this.item = value; + return this; + } + + /** + * @return {@link #item} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The actual ingredient - either a substance (simple ingredient) or another medication.) + */ + public Resource getItemTarget() { + return this.itemTarget; + } + + /** + * @param value {@link #item} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The actual ingredient - either a substance (simple ingredient) or another medication.) + */ + public MedicationProductIngredientComponent setItemTarget(Resource value) { + this.itemTarget = value; + return this; + } + + /** + * @return {@link #amount} (Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet.) + */ + public Ratio getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationProductIngredientComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Ratio(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet.) + */ + public MedicationProductIngredientComponent setAmount(Ratio value) { + this.amount = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("item", "Reference(Substance|Medication)", "The actual ingredient - either a substance (simple ingredient) or another medication.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("amount", "Ratio", "Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet.", 0, java.lang.Integer.MAX_VALUE, amount)); + } + + public MedicationProductIngredientComponent copy() { + MedicationProductIngredientComponent dst = new MedicationProductIngredientComponent(); + copyValues(dst); + dst.item = item == null ? null : item.copy(); + dst.amount = amount == null ? null : amount.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationProductIngredientComponent)) + return false; + MedicationProductIngredientComponent o = (MedicationProductIngredientComponent) other; + return compareDeep(item, o.item, true) && compareDeep(amount, o.amount, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationProductIngredientComponent)) + return false; + MedicationProductIngredientComponent o = (MedicationProductIngredientComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (item == null || item.isEmpty()) && (amount == null || amount.isEmpty()) + ; + } + + } + + @Block() + public static class MedicationProductBatchComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The assigned lot number of a batch of the specified product. + */ + @Child(name = "lotNumber", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="", formalDefinition="The assigned lot number of a batch of the specified product." ) + protected StringType lotNumber; + + /** + * When this specific batch of product will expire. + */ + @Child(name = "expirationDate", type = {DateTimeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="", formalDefinition="When this specific batch of product will expire." ) + protected DateTimeType expirationDate; + + private static final long serialVersionUID = 1982738755L; + + /* + * Constructor + */ + public MedicationProductBatchComponent() { + super(); + } + + /** + * @return {@link #lotNumber} (The assigned lot number of a batch of the specified product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value + */ + public StringType getLotNumberElement() { + if (this.lotNumber == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationProductBatchComponent.lotNumber"); + else if (Configuration.doAutoCreate()) + this.lotNumber = new StringType(); // bb + return this.lotNumber; + } + + public boolean hasLotNumberElement() { + return this.lotNumber != null && !this.lotNumber.isEmpty(); + } + + public boolean hasLotNumber() { + return this.lotNumber != null && !this.lotNumber.isEmpty(); + } + + /** + * @param value {@link #lotNumber} (The assigned lot number of a batch of the specified product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value + */ + public MedicationProductBatchComponent setLotNumberElement(StringType value) { + this.lotNumber = value; + return this; + } + + /** + * @return The assigned lot number of a batch of the specified product. + */ + public String getLotNumber() { + return this.lotNumber == null ? null : this.lotNumber.getValue(); + } + + /** + * @param value The assigned lot number of a batch of the specified product. + */ + public MedicationProductBatchComponent setLotNumber(String value) { + if (Utilities.noString(value)) + this.lotNumber = null; + else { + if (this.lotNumber == null) + this.lotNumber = new StringType(); + this.lotNumber.setValue(value); + } + return this; + } + + /** + * @return {@link #expirationDate} (When this specific batch of product will expire.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value + */ + public DateTimeType getExpirationDateElement() { + if (this.expirationDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationProductBatchComponent.expirationDate"); + else if (Configuration.doAutoCreate()) + this.expirationDate = new DateTimeType(); // bb + return this.expirationDate; + } + + public boolean hasExpirationDateElement() { + return this.expirationDate != null && !this.expirationDate.isEmpty(); + } + + public boolean hasExpirationDate() { + return this.expirationDate != null && !this.expirationDate.isEmpty(); + } + + /** + * @param value {@link #expirationDate} (When this specific batch of product will expire.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value + */ + public MedicationProductBatchComponent setExpirationDateElement(DateTimeType value) { + this.expirationDate = value; + return this; + } + + /** + * @return When this specific batch of product will expire. + */ + public Date getExpirationDate() { + return this.expirationDate == null ? null : this.expirationDate.getValue(); + } + + /** + * @param value When this specific batch of product will expire. + */ + public MedicationProductBatchComponent setExpirationDate(Date value) { + if (value == null) + this.expirationDate = null; + else { + if (this.expirationDate == null) + this.expirationDate = new DateTimeType(); + this.expirationDate.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("lotNumber", "string", "The assigned lot number of a batch of the specified product.", 0, java.lang.Integer.MAX_VALUE, lotNumber)); + childrenList.add(new Property("expirationDate", "dateTime", "When this specific batch of product will expire.", 0, java.lang.Integer.MAX_VALUE, expirationDate)); + } + + public MedicationProductBatchComponent copy() { + MedicationProductBatchComponent dst = new MedicationProductBatchComponent(); + copyValues(dst); + dst.lotNumber = lotNumber == null ? null : lotNumber.copy(); + dst.expirationDate = expirationDate == null ? null : expirationDate.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationProductBatchComponent)) + return false; + MedicationProductBatchComponent o = (MedicationProductBatchComponent) other; + return compareDeep(lotNumber, o.lotNumber, true) && compareDeep(expirationDate, o.expirationDate, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationProductBatchComponent)) + return false; + MedicationProductBatchComponent o = (MedicationProductBatchComponent) other; + return compareValues(lotNumber, o.lotNumber, true) && compareValues(expirationDate, o.expirationDate, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (lotNumber == null || lotNumber.isEmpty()) && (expirationDate == null || expirationDate.isEmpty()) + ; + } + + } + + @Block() + public static class MedicationPackageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The kind of container that this package comes as. + */ + @Child(name = "container", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="E.g. box, vial, blister-pack", formalDefinition="The kind of container that this package comes as." ) + protected CodeableConcept container; + + /** + * A set of components that go to make up the described item. + */ + @Child(name = "content", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="What is in the package?", formalDefinition="A set of components that go to make up the described item." ) + protected List content; + + private static final long serialVersionUID = 503772472L; + + /* + * Constructor + */ + public MedicationPackageComponent() { + super(); + } + + /** + * @return {@link #container} (The kind of container that this package comes as.) + */ + public CodeableConcept getContainer() { + if (this.container == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPackageComponent.container"); + else if (Configuration.doAutoCreate()) + this.container = new CodeableConcept(); // cc + return this.container; + } + + public boolean hasContainer() { + return this.container != null && !this.container.isEmpty(); + } + + /** + * @param value {@link #container} (The kind of container that this package comes as.) + */ + public MedicationPackageComponent setContainer(CodeableConcept value) { + this.container = value; + return this; + } + + /** + * @return {@link #content} (A set of components that go to make up the described item.) + */ + public List getContent() { + if (this.content == null) + this.content = new ArrayList(); + return this.content; + } + + public boolean hasContent() { + if (this.content == null) + return false; + for (MedicationPackageContentComponent item : this.content) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #content} (A set of components that go to make up the described item.) + */ + // syntactic sugar + public MedicationPackageContentComponent addContent() { //3 + MedicationPackageContentComponent t = new MedicationPackageContentComponent(); + if (this.content == null) + this.content = new ArrayList(); + this.content.add(t); + return t; + } + + // syntactic sugar + public MedicationPackageComponent addContent(MedicationPackageContentComponent t) { //3 + if (t == null) + return this; + if (this.content == null) + this.content = new ArrayList(); + this.content.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("container", "CodeableConcept", "The kind of container that this package comes as.", 0, java.lang.Integer.MAX_VALUE, container)); + childrenList.add(new Property("content", "", "A set of components that go to make up the described item.", 0, java.lang.Integer.MAX_VALUE, content)); + } + + public MedicationPackageComponent copy() { + MedicationPackageComponent dst = new MedicationPackageComponent(); + copyValues(dst); + dst.container = container == null ? null : container.copy(); + if (content != null) { + dst.content = new ArrayList(); + for (MedicationPackageContentComponent i : content) + dst.content.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationPackageComponent)) + return false; + MedicationPackageComponent o = (MedicationPackageComponent) other; + return compareDeep(container, o.container, true) && compareDeep(content, o.content, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationPackageComponent)) + return false; + MedicationPackageComponent o = (MedicationPackageComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (container == null || container.isEmpty()) && (content == null || content.isEmpty()) + ; + } + + } + + @Block() + public static class MedicationPackageContentComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifies one of the items in the package. + */ + @Child(name = "item", type = {Medication.class}, order=1, min=1, max=1) + @Description(shortDefinition="A product in the package", formalDefinition="Identifies one of the items in the package." ) + protected Reference item; + + /** + * The actual object that is the target of the reference (Identifies one of the items in the package.) + */ + protected Medication itemTarget; + + /** + * The amount of the product that is in the package. + */ + @Child(name = "amount", type = {Quantity.class}, order=2, min=0, max=1) + @Description(shortDefinition="How many are in the package?", formalDefinition="The amount of the product that is in the package." ) + protected Quantity amount; + + private static final long serialVersionUID = -1385430192L; + + /* + * Constructor + */ + public MedicationPackageContentComponent() { + super(); + } + + /* + * Constructor + */ + public MedicationPackageContentComponent(Reference item) { + super(); + this.item = item; + } + + /** + * @return {@link #item} (Identifies one of the items in the package.) + */ + public Reference getItem() { + if (this.item == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPackageContentComponent.item"); + else if (Configuration.doAutoCreate()) + this.item = new Reference(); // cc + return this.item; + } + + public boolean hasItem() { + return this.item != null && !this.item.isEmpty(); + } + + /** + * @param value {@link #item} (Identifies one of the items in the package.) + */ + public MedicationPackageContentComponent setItem(Reference value) { + this.item = value; + return this; + } + + /** + * @return {@link #item} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies one of the items in the package.) + */ + public Medication getItemTarget() { + if (this.itemTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPackageContentComponent.item"); + else if (Configuration.doAutoCreate()) + this.itemTarget = new Medication(); // aa + return this.itemTarget; + } + + /** + * @param value {@link #item} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies one of the items in the package.) + */ + public MedicationPackageContentComponent setItemTarget(Medication value) { + this.itemTarget = value; + return this; + } + + /** + * @return {@link #amount} (The amount of the product that is in the package.) + */ + public Quantity getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPackageContentComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Quantity(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (The amount of the product that is in the package.) + */ + public MedicationPackageContentComponent setAmount(Quantity value) { + this.amount = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("item", "Reference(Medication)", "Identifies one of the items in the package.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("amount", "Quantity", "The amount of the product that is in the package.", 0, java.lang.Integer.MAX_VALUE, amount)); + } + + public MedicationPackageContentComponent copy() { + MedicationPackageContentComponent dst = new MedicationPackageContentComponent(); + copyValues(dst); + dst.item = item == null ? null : item.copy(); + dst.amount = amount == null ? null : amount.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationPackageContentComponent)) + return false; + MedicationPackageContentComponent o = (MedicationPackageContentComponent) other; + return compareDeep(item, o.item, true) && compareDeep(amount, o.amount, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationPackageContentComponent)) + return false; + MedicationPackageContentComponent o = (MedicationPackageContentComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (item == null || item.isEmpty()) && (amount == null || amount.isEmpty()) + ; + } + + } + + /** + * The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code. + */ + @Child(name = "name", type = {StringType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Common / Commercial name", formalDefinition="The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code." ) + protected StringType name; + + /** + * A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Codes that identify this medication", formalDefinition="A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes." ) + protected CodeableConcept code; + + /** + * Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is). + */ + @Child(name = "isBrand", type = {BooleanType.class}, order=2, min=0, max=1) + @Description(shortDefinition="True if a brand", formalDefinition="Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is)." ) + protected BooleanType isBrand; + + /** + * Describes the details of the manufacturer. + */ + @Child(name = "manufacturer", type = {Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Manufacturer of the item", formalDefinition="Describes the details of the manufacturer." ) + protected Reference manufacturer; + + /** + * The actual object that is the target of the reference (Describes the details of the manufacturer.) + */ + protected Organization manufacturerTarget; + + /** + * Medications are either a single administrable product or a package that contains one or more products. + */ + @Child(name = "kind", type = {CodeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="product | package", formalDefinition="Medications are either a single administrable product or a package that contains one or more products." ) + protected Enumeration kind; + + /** + * Information that only applies to products (not packages). + */ + @Child(name = "product", type = {}, order=5, min=0, max=1) + @Description(shortDefinition="Administrable medication details", formalDefinition="Information that only applies to products (not packages)." ) + protected MedicationProductComponent product; + + /** + * Information that only applies to packages (not products). + */ + @Child(name = "package_", type = {}, order=6, min=0, max=1) + @Description(shortDefinition="Details about packaged medications", formalDefinition="Information that only applies to packages (not products)." ) + protected MedicationPackageComponent package_; + + private static final long serialVersionUID = 385691577L; + + /* + * Constructor + */ + public Medication() { + super(); + } + + /** + * @return {@link #name} (The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public Medication setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code. + */ + public Medication setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes.) + */ + public Medication setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #isBrand} (Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is).). This is the underlying object with id, value and extensions. The accessor "getIsBrand" gives direct access to the value + */ + public BooleanType getIsBrandElement() { + if (this.isBrand == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.isBrand"); + else if (Configuration.doAutoCreate()) + this.isBrand = new BooleanType(); // bb + return this.isBrand; + } + + public boolean hasIsBrandElement() { + return this.isBrand != null && !this.isBrand.isEmpty(); + } + + public boolean hasIsBrand() { + return this.isBrand != null && !this.isBrand.isEmpty(); + } + + /** + * @param value {@link #isBrand} (Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is).). This is the underlying object with id, value and extensions. The accessor "getIsBrand" gives direct access to the value + */ + public Medication setIsBrandElement(BooleanType value) { + this.isBrand = value; + return this; + } + + /** + * @return Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is). + */ + public boolean getIsBrand() { + return this.isBrand == null || this.isBrand.isEmpty() ? false : this.isBrand.getValue(); + } + + /** + * @param value Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is). + */ + public Medication setIsBrand(boolean value) { + if (this.isBrand == null) + this.isBrand = new BooleanType(); + this.isBrand.setValue(value); + return this; + } + + /** + * @return {@link #manufacturer} (Describes the details of the manufacturer.) + */ + public Reference getManufacturer() { + if (this.manufacturer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.manufacturer"); + else if (Configuration.doAutoCreate()) + this.manufacturer = new Reference(); // cc + return this.manufacturer; + } + + public boolean hasManufacturer() { + return this.manufacturer != null && !this.manufacturer.isEmpty(); + } + + /** + * @param value {@link #manufacturer} (Describes the details of the manufacturer.) + */ + public Medication setManufacturer(Reference value) { + this.manufacturer = value; + return this; + } + + /** + * @return {@link #manufacturer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the details of the manufacturer.) + */ + public Organization getManufacturerTarget() { + if (this.manufacturerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.manufacturer"); + else if (Configuration.doAutoCreate()) + this.manufacturerTarget = new Organization(); // aa + return this.manufacturerTarget; + } + + /** + * @param value {@link #manufacturer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the details of the manufacturer.) + */ + public Medication setManufacturerTarget(Organization value) { + this.manufacturerTarget = value; + return this; + } + + /** + * @return {@link #kind} (Medications are either a single administrable product or a package that contains one or more products.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public Enumeration getKindElement() { + if (this.kind == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.kind"); + else if (Configuration.doAutoCreate()) + this.kind = new Enumeration(new MedicationKindEnumFactory()); // bb + return this.kind; + } + + public boolean hasKindElement() { + return this.kind != null && !this.kind.isEmpty(); + } + + public boolean hasKind() { + return this.kind != null && !this.kind.isEmpty(); + } + + /** + * @param value {@link #kind} (Medications are either a single administrable product or a package that contains one or more products.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public Medication setKindElement(Enumeration value) { + this.kind = value; + return this; + } + + /** + * @return Medications are either a single administrable product or a package that contains one or more products. + */ + public MedicationKind getKind() { + return this.kind == null ? null : this.kind.getValue(); + } + + /** + * @param value Medications are either a single administrable product or a package that contains one or more products. + */ + public Medication setKind(MedicationKind value) { + if (value == null) + this.kind = null; + else { + if (this.kind == null) + this.kind = new Enumeration(new MedicationKindEnumFactory()); + this.kind.setValue(value); + } + return this; + } + + /** + * @return {@link #product} (Information that only applies to products (not packages).) + */ + public MedicationProductComponent getProduct() { + if (this.product == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.product"); + else if (Configuration.doAutoCreate()) + this.product = new MedicationProductComponent(); // cc + return this.product; + } + + public boolean hasProduct() { + return this.product != null && !this.product.isEmpty(); + } + + /** + * @param value {@link #product} (Information that only applies to products (not packages).) + */ + public Medication setProduct(MedicationProductComponent value) { + this.product = value; + return this; + } + + /** + * @return {@link #package_} (Information that only applies to packages (not products).) + */ + public MedicationPackageComponent getPackage() { + if (this.package_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.package_"); + else if (Configuration.doAutoCreate()) + this.package_ = new MedicationPackageComponent(); // cc + return this.package_; + } + + public boolean hasPackage() { + return this.package_ != null && !this.package_.isEmpty(); + } + + /** + * @param value {@link #package_} (Information that only applies to packages (not products).) + */ + public Medication setPackage(MedicationPackageComponent value) { + this.package_ = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("code", "CodeableConcept", "A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("isBrand", "boolean", "Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is).", 0, java.lang.Integer.MAX_VALUE, isBrand)); + childrenList.add(new Property("manufacturer", "Reference(Organization)", "Describes the details of the manufacturer.", 0, java.lang.Integer.MAX_VALUE, manufacturer)); + childrenList.add(new Property("kind", "code", "Medications are either a single administrable product or a package that contains one or more products.", 0, java.lang.Integer.MAX_VALUE, kind)); + childrenList.add(new Property("product", "", "Information that only applies to products (not packages).", 0, java.lang.Integer.MAX_VALUE, product)); + childrenList.add(new Property("package", "", "Information that only applies to packages (not products).", 0, java.lang.Integer.MAX_VALUE, package_)); + } + + public Medication copy() { + Medication dst = new Medication(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.code = code == null ? null : code.copy(); + dst.isBrand = isBrand == null ? null : isBrand.copy(); + dst.manufacturer = manufacturer == null ? null : manufacturer.copy(); + dst.kind = kind == null ? null : kind.copy(); + dst.product = product == null ? null : product.copy(); + dst.package_ = package_ == null ? null : package_.copy(); + return dst; + } + + protected Medication typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Medication)) + return false; + Medication o = (Medication) other; + return compareDeep(name, o.name, true) && compareDeep(code, o.code, true) && compareDeep(isBrand, o.isBrand, true) + && compareDeep(manufacturer, o.manufacturer, true) && compareDeep(kind, o.kind, true) && compareDeep(product, o.product, true) + && compareDeep(package_, o.package_, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Medication)) + return false; + Medication o = (Medication) other; + return compareValues(name, o.name, true) && compareValues(isBrand, o.isBrand, true) && compareValues(kind, o.kind, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (code == null || code.isEmpty()) + && (isBrand == null || isBrand.isEmpty()) && (manufacturer == null || manufacturer.isEmpty()) + && (kind == null || kind.isEmpty()) && (product == null || product.isEmpty()) && (package_ == null || package_.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Medication; + } + + @SearchParamDefinition(name="container", path="Medication.package.container", description="E.g. box, vial, blister-pack", type="token" ) + public static final String SP_CONTAINER = "container"; + @SearchParamDefinition(name="code", path="Medication.code", description="Codes that identify this medication", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="ingredient", path="Medication.product.ingredient.item", description="The product contained", type="reference" ) + public static final String SP_INGREDIENT = "ingredient"; + @SearchParamDefinition(name="form", path="Medication.product.form", description="powder | tablets | carton +", type="token" ) + public static final String SP_FORM = "form"; + @SearchParamDefinition(name="name", path="Medication.name", description="Common / Commercial name", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="content", path="Medication.package.content.item", description="A product in the package", type="reference" ) + public static final String SP_CONTENT = "content"; + @SearchParamDefinition(name="manufacturer", path="Medication.manufacturer", description="Manufacturer of the item", type="reference" ) + public static final String SP_MANUFACTURER = "manufacturer"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/MedicationAdministration.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/MedicationAdministration.java index 1e36901d998..8a447785453 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/MedicationAdministration.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/MedicationAdministration.java @@ -1,1336 +1,1296 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. - -Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. - */ -@ResourceDef(name="MedicationAdministration", profile="http://hl7.org/fhir/Profile/MedicationAdministration") -public class MedicationAdministration extends DomainResource { - - public enum MedicationAdminStatus { - /** - * The administration has started but has not yet completed. - */ - INPROGRESS, - /** - * Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called "suspended". - */ - ONHOLD, - /** - * All actions that are implied by the administration have occurred. - */ - COMPLETED, - /** - * The administration was entered in error and therefore nullified. - */ - ENTEREDINERROR, - /** - * Actions implied by the administration have been permanently halted, before all of them occurred. - */ - STOPPED, - /** - * added to help the parsers - */ - NULL; - public static MedicationAdminStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("on-hold".equals(codeString)) - return ONHOLD; - if ("completed".equals(codeString)) - return COMPLETED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - if ("stopped".equals(codeString)) - return STOPPED; - throw new Exception("Unknown MedicationAdminStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INPROGRESS: return "in-progress"; - case ONHOLD: return "on-hold"; - case COMPLETED: return "completed"; - case ENTEREDINERROR: return "entered-in-error"; - case STOPPED: return "stopped"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPROGRESS: return ""; - case ONHOLD: return ""; - case COMPLETED: return ""; - case ENTEREDINERROR: return ""; - case STOPPED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPROGRESS: return "The administration has started but has not yet completed."; - case ONHOLD: return "Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called 'suspended'."; - case COMPLETED: return "All actions that are implied by the administration have occurred."; - case ENTEREDINERROR: return "The administration was entered in error and therefore nullified."; - case STOPPED: return "Actions implied by the administration have been permanently halted, before all of them occurred."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPROGRESS: return "In Progress"; - case ONHOLD: return "On Hold"; - case COMPLETED: return "Completed"; - case ENTEREDINERROR: return "Entered In Error"; - case STOPPED: return "Stopped"; - default: return "?"; - } - } - } - - public static class MedicationAdminStatusEnumFactory implements EnumFactory { - public MedicationAdminStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return MedicationAdminStatus.INPROGRESS; - if ("on-hold".equals(codeString)) - return MedicationAdminStatus.ONHOLD; - if ("completed".equals(codeString)) - return MedicationAdminStatus.COMPLETED; - if ("entered-in-error".equals(codeString)) - return MedicationAdminStatus.ENTEREDINERROR; - if ("stopped".equals(codeString)) - return MedicationAdminStatus.STOPPED; - throw new IllegalArgumentException("Unknown MedicationAdminStatus code '"+codeString+"'"); - } - public String toCode(MedicationAdminStatus code) { - if (code == MedicationAdminStatus.INPROGRESS) - return "in-progress"; - if (code == MedicationAdminStatus.ONHOLD) - return "on-hold"; - if (code == MedicationAdminStatus.COMPLETED) - return "completed"; - if (code == MedicationAdminStatus.ENTEREDINERROR) - return "entered-in-error"; - if (code == MedicationAdminStatus.STOPPED) - return "stopped"; - return "?"; - } - } - - @Block() - public static class MedicationAdministrationDosageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. - */ - @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Dosage Instructions", formalDefinition="Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication." ) - protected StringType text; - - /** - * A coded specification of the anatomic site where the medication first entered the body. E.g. "left arm". - */ - @Child(name = "site", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Body site administered to", formalDefinition="A coded specification of the anatomic site where the medication first entered the body. E.g. 'left arm'." ) - protected CodeableConcept site; - - /** - * A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc. - */ - @Child(name = "route", type = {CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Path of substance into body", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc." ) - protected CodeableConcept route; - - /** - * A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. - -Terminologies used often pre-coordinate this term with the route and or form of administration. - */ - @Child(name = "method", type = {CodeableConcept.class}, order=4, min=0, max=1) - @Description(shortDefinition="How drug was administered", formalDefinition="A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\r\rTerminologies used often pre-coordinate this term with the route and or form of administration." ) - protected CodeableConcept method; - - /** - * The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection. - */ - @Child(name = "quantity", type = {Quantity.class}, order=5, min=0, max=1) - @Description(shortDefinition="Amount administered in one dose", formalDefinition="The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection." ) - protected Quantity quantity; - - /** - * Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity. - */ - @Child(name = "rate", type = {Ratio.class}, order=6, min=0, max=1) - @Description(shortDefinition="Dose quantity per unit of time", formalDefinition="Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity." ) - protected Ratio rate; - - private static final long serialVersionUID = -358534919L; - - /* - * Constructor - */ - public MedicationAdministrationDosageComponent() { - super(); - } - - /** - * @return {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public MedicationAdministrationDosageComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. - */ - public MedicationAdministrationDosageComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #site} (A coded specification of the anatomic site where the medication first entered the body. E.g. "left arm".) - */ - public CodeableConcept getSite() { - if (this.site == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.site"); - else if (Configuration.doAutoCreate()) - this.site = new CodeableConcept(); // cc - return this.site; - } - - public boolean hasSite() { - return this.site != null && !this.site.isEmpty(); - } - - /** - * @param value {@link #site} (A coded specification of the anatomic site where the medication first entered the body. E.g. "left arm".) - */ - public MedicationAdministrationDosageComponent setSite(CodeableConcept value) { - this.site = value; - return this; - } - - /** - * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc.) - */ - public CodeableConcept getRoute() { - if (this.route == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.route"); - else if (Configuration.doAutoCreate()) - this.route = new CodeableConcept(); // cc - return this.route; - } - - public boolean hasRoute() { - return this.route != null && !this.route.isEmpty(); - } - - /** - * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc.) - */ - public MedicationAdministrationDosageComponent setRoute(CodeableConcept value) { - this.route = value; - return this; - } - - /** - * @return {@link #method} (A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. - -Terminologies used often pre-coordinate this term with the route and or form of administration.) - */ - public CodeableConcept getMethod() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.method"); - else if (Configuration.doAutoCreate()) - this.method = new CodeableConcept(); // cc - return this.method; - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** - * @param value {@link #method} (A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. - -Terminologies used often pre-coordinate this term with the route and or form of administration.) - */ - public MedicationAdministrationDosageComponent setMethod(CodeableConcept value) { - this.method = value; - return this; - } - - /** - * @return {@link #quantity} (The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.) - */ - public MedicationAdministrationDosageComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #rate} (Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity.) - */ - public Ratio getRate() { - if (this.rate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.rate"); - else if (Configuration.doAutoCreate()) - this.rate = new Ratio(); // cc - return this.rate; - } - - public boolean hasRate() { - return this.rate != null && !this.rate.isEmpty(); - } - - /** - * @param value {@link #rate} (Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity.) - */ - public MedicationAdministrationDosageComponent setRate(Ratio value) { - this.rate = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("text", "string", "Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("site", "CodeableConcept", "A coded specification of the anatomic site where the medication first entered the body. E.g. 'left arm'.", 0, java.lang.Integer.MAX_VALUE, site)); - childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc.", 0, java.lang.Integer.MAX_VALUE, route)); - childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\r\rTerminologies used often pre-coordinate this term with the route and or form of administration.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("quantity", "Quantity", "The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("rate", "Ratio", "Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity.", 0, java.lang.Integer.MAX_VALUE, rate)); - } - - public MedicationAdministrationDosageComponent copy() { - MedicationAdministrationDosageComponent dst = new MedicationAdministrationDosageComponent(); - copyValues(dst); - dst.text = text == null ? null : text.copy(); - dst.site = site == null ? null : site.copy(); - dst.route = route == null ? null : route.copy(); - dst.method = method == null ? null : method.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.rate = rate == null ? null : rate.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationAdministrationDosageComponent)) - return false; - MedicationAdministrationDosageComponent o = (MedicationAdministrationDosageComponent) other; - return compareDeep(text, o.text, true) && compareDeep(site, o.site, true) && compareDeep(route, o.route, true) - && compareDeep(method, o.method, true) && compareDeep(quantity, o.quantity, true) && compareDeep(rate, o.rate, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationAdministrationDosageComponent)) - return false; - MedicationAdministrationDosageComponent o = (MedicationAdministrationDosageComponent) other; - return compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (text == null || text.isEmpty()) && (site == null || site.isEmpty()) - && (route == null || route.isEmpty()) && (method == null || method.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (rate == null || rate.isEmpty()); - } - - } - - /** - * External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External identifier", formalDefinition="External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated." ) - protected List identifier; - - /** - * Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="in-progress | on-hold | completed | entered-in-error | stopped", formalDefinition="Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way." ) - protected Enumeration status; - - /** - * The person or animal to whom the medication was given. - */ - @Child(name = "patient", type = {Patient.class}, order=2, min=1, max=1) - @Description(shortDefinition="Who received medication?", formalDefinition="The person or animal to whom the medication was given." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The person or animal to whom the medication was given.) - */ - protected Patient patientTarget; - - /** - * The individual who was responsible for giving the medication to the patient. - */ - @Child(name = "practitioner", type = {Practitioner.class}, order=3, min=0, max=1) - @Description(shortDefinition="Who administered substance?", formalDefinition="The individual who was responsible for giving the medication to the patient." ) - protected Reference practitioner; - - /** - * The actual object that is the target of the reference (The individual who was responsible for giving the medication to the patient.) - */ - protected Practitioner practitionerTarget; - - /** - * The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of. - */ - @Child(name = "encounter", type = {Encounter.class}, order=4, min=0, max=1) - @Description(shortDefinition="Encounter administered as part of", formalDefinition="The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.) - */ - protected Encounter encounterTarget; - - /** - * The original request, instruction or authority to perform the administration. - */ - @Child(name = "prescription", type = {MedicationPrescription.class}, order=5, min=0, max=1) - @Description(shortDefinition="Order administration performed against", formalDefinition="The original request, instruction or authority to perform the administration." ) - protected Reference prescription; - - /** - * The actual object that is the target of the reference (The original request, instruction or authority to perform the administration.) - */ - protected MedicationPrescription prescriptionTarget; - - /** - * Set this to true if the record is saying that the medication was NOT administered. - */ - @Child(name = "wasNotGiven", type = {BooleanType.class}, order=6, min=0, max=1) - @Description(shortDefinition="True if medication not administered", formalDefinition="Set this to true if the record is saying that the medication was NOT administered." ) - protected BooleanType wasNotGiven; - - /** - * A code indicating why the administration was not performed. - */ - @Child(name = "reasonNotGiven", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Reason administration not performed", formalDefinition="A code indicating why the administration was not performed." ) - protected List reasonNotGiven; - - /** - * A code indicating why the medication was given. - */ - @Child(name = "reasonGiven", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Reason administration performed", formalDefinition="A code indicating why the medication was given." ) - protected List reasonGiven; - - /** - * An interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate. - */ - @Child(name = "effectiveTime", type = {DateTimeType.class, Period.class}, order=9, min=1, max=1) - @Description(shortDefinition="Start and end time of administration", formalDefinition="An interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate." ) - protected Type effectiveTime; - - /** - * Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. - */ - @Child(name = "medication", type = {Medication.class}, order=10, min=0, max=1) - @Description(shortDefinition="What was administered?", formalDefinition="Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." ) - protected Reference medication; - - /** - * The actual object that is the target of the reference (Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - protected Medication medicationTarget; - - /** - * The device used in administering the medication to the patient. E.g. a particular infusion pump. - */ - @Child(name = "device", type = {Device.class}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Device used to administer", formalDefinition="The device used in administering the medication to the patient. E.g. a particular infusion pump." ) - protected List device; - /** - * The actual objects that are the target of the reference (The device used in administering the medication to the patient. E.g. a particular infusion pump.) - */ - protected List deviceTarget; - - - /** - * Extra information about the medication administration that is not conveyed by the other attributes. - */ - @Child(name = "note", type = {StringType.class}, order=12, min=0, max=1) - @Description(shortDefinition="Information about the administration", formalDefinition="Extra information about the medication administration that is not conveyed by the other attributes." ) - protected StringType note; - - /** - * Indicates how the medication is/was used by the patient. - */ - @Child(name = "dosage", type = {}, order=13, min=0, max=1) - @Description(shortDefinition="Details of how medication was taken", formalDefinition="Indicates how the medication is/was used by the patient." ) - protected MedicationAdministrationDosageComponent dosage; - - private static final long serialVersionUID = 1898346148L; - - /* - * Constructor - */ - public MedicationAdministration() { - super(); - } - - /* - * Constructor - */ - public MedicationAdministration(Enumeration status, Reference patient, Type effectiveTime) { - super(); - this.status = status; - this.patient = patient; - this.effectiveTime = effectiveTime; - } - - /** - * @return {@link #identifier} (External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public MedicationAdministration addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #status} (Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new MedicationAdminStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public MedicationAdministration setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way. - */ - public MedicationAdminStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way. - */ - public MedicationAdministration setStatus(MedicationAdminStatus value) { - if (this.status == null) - this.status = new Enumeration(new MedicationAdminStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #patient} (The person or animal to whom the medication was given.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The person or animal to whom the medication was given.) - */ - public MedicationAdministration setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person or animal to whom the medication was given.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person or animal to whom the medication was given.) - */ - public MedicationAdministration setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #practitioner} (The individual who was responsible for giving the medication to the patient.) - */ - public Reference getPractitioner() { - if (this.practitioner == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.practitioner"); - else if (Configuration.doAutoCreate()) - this.practitioner = new Reference(); // cc - return this.practitioner; - } - - public boolean hasPractitioner() { - return this.practitioner != null && !this.practitioner.isEmpty(); - } - - /** - * @param value {@link #practitioner} (The individual who was responsible for giving the medication to the patient.) - */ - public MedicationAdministration setPractitioner(Reference value) { - this.practitioner = value; - return this; - } - - /** - * @return {@link #practitioner} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The individual who was responsible for giving the medication to the patient.) - */ - public Practitioner getPractitionerTarget() { - if (this.practitionerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.practitioner"); - else if (Configuration.doAutoCreate()) - this.practitionerTarget = new Practitioner(); // aa - return this.practitionerTarget; - } - - /** - * @param value {@link #practitioner} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The individual who was responsible for giving the medication to the patient.) - */ - public MedicationAdministration setPractitionerTarget(Practitioner value) { - this.practitionerTarget = value; - return this; - } - - /** - * @return {@link #encounter} (The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.) - */ - public MedicationAdministration setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.) - */ - public MedicationAdministration setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #prescription} (The original request, instruction or authority to perform the administration.) - */ - public Reference getPrescription() { - if (this.prescription == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.prescription"); - else if (Configuration.doAutoCreate()) - this.prescription = new Reference(); // cc - return this.prescription; - } - - public boolean hasPrescription() { - return this.prescription != null && !this.prescription.isEmpty(); - } - - /** - * @param value {@link #prescription} (The original request, instruction or authority to perform the administration.) - */ - public MedicationAdministration setPrescription(Reference value) { - this.prescription = value; - return this; - } - - /** - * @return {@link #prescription} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The original request, instruction or authority to perform the administration.) - */ - public MedicationPrescription getPrescriptionTarget() { - if (this.prescriptionTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.prescription"); - else if (Configuration.doAutoCreate()) - this.prescriptionTarget = new MedicationPrescription(); // aa - return this.prescriptionTarget; - } - - /** - * @param value {@link #prescription} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The original request, instruction or authority to perform the administration.) - */ - public MedicationAdministration setPrescriptionTarget(MedicationPrescription value) { - this.prescriptionTarget = value; - return this; - } - - /** - * @return {@link #wasNotGiven} (Set this to true if the record is saying that the medication was NOT administered.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value - */ - public BooleanType getWasNotGivenElement() { - if (this.wasNotGiven == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.wasNotGiven"); - else if (Configuration.doAutoCreate()) - this.wasNotGiven = new BooleanType(); // bb - return this.wasNotGiven; - } - - public boolean hasWasNotGivenElement() { - return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); - } - - public boolean hasWasNotGiven() { - return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); - } - - /** - * @param value {@link #wasNotGiven} (Set this to true if the record is saying that the medication was NOT administered.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value - */ - public MedicationAdministration setWasNotGivenElement(BooleanType value) { - this.wasNotGiven = value; - return this; - } - - /** - * @return Set this to true if the record is saying that the medication was NOT administered. - */ - public boolean getWasNotGiven() { - return this.wasNotGiven == null || this.wasNotGiven.isEmpty() ? false : this.wasNotGiven.getValue(); - } - - /** - * @param value Set this to true if the record is saying that the medication was NOT administered. - */ - public MedicationAdministration setWasNotGiven(boolean value) { - if (this.wasNotGiven == null) - this.wasNotGiven = new BooleanType(); - this.wasNotGiven.setValue(value); - return this; - } - - /** - * @return {@link #reasonNotGiven} (A code indicating why the administration was not performed.) - */ - public List getReasonNotGiven() { - if (this.reasonNotGiven == null) - this.reasonNotGiven = new ArrayList(); - return this.reasonNotGiven; - } - - public boolean hasReasonNotGiven() { - if (this.reasonNotGiven == null) - return false; - for (CodeableConcept item : this.reasonNotGiven) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reasonNotGiven} (A code indicating why the administration was not performed.) - */ - // syntactic sugar - public CodeableConcept addReasonNotGiven() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reasonNotGiven == null) - this.reasonNotGiven = new ArrayList(); - this.reasonNotGiven.add(t); - return t; - } - - // syntactic sugar - public MedicationAdministration addReasonNotGiven(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reasonNotGiven == null) - this.reasonNotGiven = new ArrayList(); - this.reasonNotGiven.add(t); - return this; - } - - /** - * @return {@link #reasonGiven} (A code indicating why the medication was given.) - */ - public List getReasonGiven() { - if (this.reasonGiven == null) - this.reasonGiven = new ArrayList(); - return this.reasonGiven; - } - - public boolean hasReasonGiven() { - if (this.reasonGiven == null) - return false; - for (CodeableConcept item : this.reasonGiven) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reasonGiven} (A code indicating why the medication was given.) - */ - // syntactic sugar - public CodeableConcept addReasonGiven() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reasonGiven == null) - this.reasonGiven = new ArrayList(); - this.reasonGiven.add(t); - return t; - } - - // syntactic sugar - public MedicationAdministration addReasonGiven(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reasonGiven == null) - this.reasonGiven = new ArrayList(); - this.reasonGiven.add(t); - return this; - } - - /** - * @return {@link #effectiveTime} (An interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) - */ - public Type getEffectiveTime() { - return this.effectiveTime; - } - - /** - * @return {@link #effectiveTime} (An interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) - */ - public DateTimeType getEffectiveTimeDateTimeType() throws Exception { - if (!(this.effectiveTime instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.effectiveTime.getClass().getName()+" was encountered"); - return (DateTimeType) this.effectiveTime; - } - - /** - * @return {@link #effectiveTime} (An interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) - */ - public Period getEffectiveTimePeriod() throws Exception { - if (!(this.effectiveTime instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.effectiveTime.getClass().getName()+" was encountered"); - return (Period) this.effectiveTime; - } - - public boolean hasEffectiveTime() { - return this.effectiveTime != null && !this.effectiveTime.isEmpty(); - } - - /** - * @param value {@link #effectiveTime} (An interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) - */ - public MedicationAdministration setEffectiveTime(Type value) { - this.effectiveTime = value; - return this; - } - - /** - * @return {@link #medication} (Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Reference getMedication() { - if (this.medication == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.medication"); - else if (Configuration.doAutoCreate()) - this.medication = new Reference(); // cc - return this.medication; - } - - public boolean hasMedication() { - return this.medication != null && !this.medication.isEmpty(); - } - - /** - * @param value {@link #medication} (Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationAdministration setMedication(Reference value) { - this.medication = value; - return this; - } - - /** - * @return {@link #medication} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Medication getMedicationTarget() { - if (this.medicationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.medication"); - else if (Configuration.doAutoCreate()) - this.medicationTarget = new Medication(); // aa - return this.medicationTarget; - } - - /** - * @param value {@link #medication} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationAdministration setMedicationTarget(Medication value) { - this.medicationTarget = value; - return this; - } - - /** - * @return {@link #device} (The device used in administering the medication to the patient. E.g. a particular infusion pump.) - */ - public List getDevice() { - if (this.device == null) - this.device = new ArrayList(); - return this.device; - } - - public boolean hasDevice() { - if (this.device == null) - return false; - for (Reference item : this.device) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #device} (The device used in administering the medication to the patient. E.g. a particular infusion pump.) - */ - // syntactic sugar - public Reference addDevice() { //3 - Reference t = new Reference(); - if (this.device == null) - this.device = new ArrayList(); - this.device.add(t); - return t; - } - - // syntactic sugar - public MedicationAdministration addDevice(Reference t) { //3 - if (t == null) - return this; - if (this.device == null) - this.device = new ArrayList(); - this.device.add(t); - return this; - } - - /** - * @return {@link #device} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The device used in administering the medication to the patient. E.g. a particular infusion pump.) - */ - public List getDeviceTarget() { - if (this.deviceTarget == null) - this.deviceTarget = new ArrayList(); - return this.deviceTarget; - } - - // syntactic sugar - /** - * @return {@link #device} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The device used in administering the medication to the patient. E.g. a particular infusion pump.) - */ - public Device addDeviceTarget() { - Device r = new Device(); - if (this.deviceTarget == null) - this.deviceTarget = new ArrayList(); - this.deviceTarget.add(r); - return r; - } - - /** - * @return {@link #note} (Extra information about the medication administration that is not conveyed by the other attributes.). 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 MedicationAdministration.note"); - else if (Configuration.doAutoCreate()) - this.note = new StringType(); // bb - 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} (Extra information about the medication administration that is not conveyed by the other attributes.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value - */ - public MedicationAdministration setNoteElement(StringType value) { - this.note = value; - return this; - } - - /** - * @return Extra information about the medication administration that is not conveyed by the other attributes. - */ - public String getNote() { - return this.note == null ? null : this.note.getValue(); - } - - /** - * @param value Extra information about the medication administration that is not conveyed by the other attributes. - */ - public MedicationAdministration setNote(String value) { - if (Utilities.noString(value)) - this.note = null; - else { - if (this.note == null) - this.note = new StringType(); - this.note.setValue(value); - } - return this; - } - - /** - * @return {@link #dosage} (Indicates how the medication is/was used by the patient.) - */ - public MedicationAdministrationDosageComponent getDosage() { - if (this.dosage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.dosage"); - else if (Configuration.doAutoCreate()) - this.dosage = new MedicationAdministrationDosageComponent(); // cc - return this.dosage; - } - - public boolean hasDosage() { - return this.dosage != null && !this.dosage.isEmpty(); - } - - /** - * @param value {@link #dosage} (Indicates how the medication is/was used by the patient.) - */ - public MedicationAdministration setDosage(MedicationAdministrationDosageComponent value) { - this.dosage = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("patient", "Reference(Patient)", "The person or animal to whom the medication was given.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("practitioner", "Reference(Practitioner)", "The individual who was responsible for giving the medication to the patient.", 0, java.lang.Integer.MAX_VALUE, practitioner)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("prescription", "Reference(MedicationPrescription)", "The original request, instruction or authority to perform the administration.", 0, java.lang.Integer.MAX_VALUE, prescription)); - childrenList.add(new Property("wasNotGiven", "boolean", "Set this to true if the record is saying that the medication was NOT administered.", 0, java.lang.Integer.MAX_VALUE, wasNotGiven)); - childrenList.add(new Property("reasonNotGiven", "CodeableConcept", "A code indicating why the administration was not performed.", 0, java.lang.Integer.MAX_VALUE, reasonNotGiven)); - childrenList.add(new Property("reasonGiven", "CodeableConcept", "A code indicating why the medication was given.", 0, java.lang.Integer.MAX_VALUE, reasonGiven)); - childrenList.add(new Property("effectiveTime[x]", "dateTime|Period", "An interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.", 0, java.lang.Integer.MAX_VALUE, effectiveTime)); - childrenList.add(new Property("medication", "Reference(Medication)", "Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); - childrenList.add(new Property("device", "Reference(Device)", "The device used in administering the medication to the patient. E.g. a particular infusion pump.", 0, java.lang.Integer.MAX_VALUE, device)); - childrenList.add(new Property("note", "string", "Extra information about the medication administration that is not conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note)); - childrenList.add(new Property("dosage", "", "Indicates how the medication is/was used by the patient.", 0, java.lang.Integer.MAX_VALUE, dosage)); - } - - public MedicationAdministration copy() { - MedicationAdministration dst = new MedicationAdministration(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.practitioner = practitioner == null ? null : practitioner.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.prescription = prescription == null ? null : prescription.copy(); - dst.wasNotGiven = wasNotGiven == null ? null : wasNotGiven.copy(); - if (reasonNotGiven != null) { - dst.reasonNotGiven = new ArrayList(); - for (CodeableConcept i : reasonNotGiven) - dst.reasonNotGiven.add(i.copy()); - }; - if (reasonGiven != null) { - dst.reasonGiven = new ArrayList(); - for (CodeableConcept i : reasonGiven) - dst.reasonGiven.add(i.copy()); - }; - dst.effectiveTime = effectiveTime == null ? null : effectiveTime.copy(); - dst.medication = medication == null ? null : medication.copy(); - if (device != null) { - dst.device = new ArrayList(); - for (Reference i : device) - dst.device.add(i.copy()); - }; - dst.note = note == null ? null : note.copy(); - dst.dosage = dosage == null ? null : dosage.copy(); - return dst; - } - - protected MedicationAdministration typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationAdministration)) - return false; - MedicationAdministration o = (MedicationAdministration) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(patient, o.patient, true) - && compareDeep(practitioner, o.practitioner, true) && compareDeep(encounter, o.encounter, true) - && compareDeep(prescription, o.prescription, true) && compareDeep(wasNotGiven, o.wasNotGiven, true) - && compareDeep(reasonNotGiven, o.reasonNotGiven, true) && compareDeep(reasonGiven, o.reasonGiven, true) - && compareDeep(effectiveTime, o.effectiveTime, true) && compareDeep(medication, o.medication, true) - && compareDeep(device, o.device, true) && compareDeep(note, o.note, true) && compareDeep(dosage, o.dosage, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationAdministration)) - return false; - MedicationAdministration o = (MedicationAdministration) other; - return compareValues(status, o.status, true) && compareValues(wasNotGiven, o.wasNotGiven, true) && compareValues(note, o.note, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (patient == null || patient.isEmpty()) && (practitioner == null || practitioner.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (prescription == null || prescription.isEmpty()) - && (wasNotGiven == null || wasNotGiven.isEmpty()) && (reasonNotGiven == null || reasonNotGiven.isEmpty()) - && (reasonGiven == null || reasonGiven.isEmpty()) && (effectiveTime == null || effectiveTime.isEmpty()) - && (medication == null || medication.isEmpty()) && (device == null || device.isEmpty()) && (note == null || note.isEmpty()) - && (dosage == null || dosage.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.MedicationAdministration; - } - - @SearchParamDefinition(name="medication", path="MedicationAdministration.medication", description="Return administrations of this medication", type="reference" ) - public static final String SP_MEDICATION = "medication"; - @SearchParamDefinition(name="effectivetime", path="MedicationAdministration.effectiveTime[x]", description="Date administration happened (or did not happen)", type="date" ) - public static final String SP_EFFECTIVETIME = "effectivetime"; - @SearchParamDefinition(name="patient", path="MedicationAdministration.patient", description="The identity of a patient to list administrations for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="practitioner", path="MedicationAdministration.practitioner", description="Who administered substance?", type="reference" ) - public static final String SP_PRACTITIONER = "practitioner"; - @SearchParamDefinition(name="status", path="MedicationAdministration.status", description="MedicationAdministration event status (for example one of active/paused/completed/nullified)", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="prescription", path="MedicationAdministration.prescription", description="The identity of a prescription to list administrations from", type="reference" ) - public static final String SP_PRESCRIPTION = "prescription"; - @SearchParamDefinition(name="device", path="MedicationAdministration.device", description="Return administrations with this administration device identity", type="reference" ) - public static final String SP_DEVICE = "device"; - @SearchParamDefinition(name="notgiven", path="MedicationAdministration.wasNotGiven", description="Administrations that were not made", type="token" ) - public static final String SP_NOTGIVEN = "notgiven"; - @SearchParamDefinition(name="encounter", path="MedicationAdministration.encounter", description="Return administrations that share this encounter", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - @SearchParamDefinition(name="identifier", path="MedicationAdministration.identifier", description="Return administrations with this external identity", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. + */ +@ResourceDef(name="MedicationAdministration", profile="http://hl7.org/fhir/Profile/MedicationAdministration") +public class MedicationAdministration extends DomainResource { + + public enum MedicationAdminStatus { + /** + * The administration has started but has not yet completed. + */ + INPROGRESS, + /** + * Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called "suspended". + */ + ONHOLD, + /** + * All actions that are implied by the administration have occurred. + */ + COMPLETED, + /** + * The administration was entered in error and therefore nullified. + */ + ENTEREDINERROR, + /** + * Actions implied by the administration have been permanently halted, before all of them occurred. + */ + STOPPED, + /** + * added to help the parsers + */ + NULL; + public static MedicationAdminStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("on-hold".equals(codeString)) + return ONHOLD; + if ("completed".equals(codeString)) + return COMPLETED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + if ("stopped".equals(codeString)) + return STOPPED; + throw new Exception("Unknown MedicationAdminStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INPROGRESS: return "in-progress"; + case ONHOLD: return "on-hold"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered-in-error"; + case STOPPED: return "stopped"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return ""; + case ONHOLD: return ""; + case COMPLETED: return ""; + case ENTEREDINERROR: return ""; + case STOPPED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "The administration has started but has not yet completed."; + case ONHOLD: return "Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called 'suspended'."; + case COMPLETED: return "All actions that are implied by the administration have occurred."; + case ENTEREDINERROR: return "The administration was entered in error and therefore nullified."; + case STOPPED: return "Actions implied by the administration have been permanently halted, before all of them occurred."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "In Progress"; + case ONHOLD: return "On Hold"; + case COMPLETED: return "Completed"; + case ENTEREDINERROR: return "Entered In Error"; + case STOPPED: return "Stopped"; + default: return "?"; + } + } + } + + public static class MedicationAdminStatusEnumFactory implements EnumFactory { + public MedicationAdminStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return MedicationAdminStatus.INPROGRESS; + if ("on-hold".equals(codeString)) + return MedicationAdminStatus.ONHOLD; + if ("completed".equals(codeString)) + return MedicationAdminStatus.COMPLETED; + if ("entered-in-error".equals(codeString)) + return MedicationAdminStatus.ENTEREDINERROR; + if ("stopped".equals(codeString)) + return MedicationAdminStatus.STOPPED; + throw new IllegalArgumentException("Unknown MedicationAdminStatus code '"+codeString+"'"); + } + public String toCode(MedicationAdminStatus code) { + if (code == MedicationAdminStatus.INPROGRESS) + return "in-progress"; + if (code == MedicationAdminStatus.ONHOLD) + return "on-hold"; + if (code == MedicationAdminStatus.COMPLETED) + return "completed"; + if (code == MedicationAdminStatus.ENTEREDINERROR) + return "entered-in-error"; + if (code == MedicationAdminStatus.STOPPED) + return "stopped"; + return "?"; + } + } + + @Block() + public static class MedicationAdministrationDosageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + */ + @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Dosage Instructions", formalDefinition="Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication." ) + protected StringType text; + + /** + * A coded specification of the anatomic site where the medication first entered the body. E.g. "left arm". + */ + @Child(name = "site", type = {CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Body site administered to", formalDefinition="A coded specification of the anatomic site where the medication first entered the body. E.g. 'left arm'." ) + protected CodeableConcept site; + + /** + * A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc. + */ + @Child(name = "route", type = {CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Path of substance into body", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc." ) + protected CodeableConcept route; + + /** + * A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. Terminologies used often pre-coordinate this term with the route and or form of administration. + */ + @Child(name = "method", type = {CodeableConcept.class}, order=4, min=0, max=1) + @Description(shortDefinition="How drug was administered", formalDefinition="A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\r\rTerminologies used often pre-coordinate this term with the route and or form of administration." ) + protected CodeableConcept method; + + /** + * The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection. + */ + @Child(name = "quantity", type = {Quantity.class}, order=5, min=0, max=1) + @Description(shortDefinition="Amount administered in one dose", formalDefinition="The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection." ) + protected Quantity quantity; + + /** + * Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity. + */ + @Child(name = "rate", type = {Ratio.class}, order=6, min=0, max=1) + @Description(shortDefinition="Dose quantity per unit of time", formalDefinition="Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity." ) + protected Ratio rate; + + private static final long serialVersionUID = -358534919L; + + /* + * Constructor + */ + public MedicationAdministrationDosageComponent() { + super(); + } + + /** + * @return {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public MedicationAdministrationDosageComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + */ + public MedicationAdministrationDosageComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #site} (A coded specification of the anatomic site where the medication first entered the body. E.g. "left arm".) + */ + public CodeableConcept getSite() { + if (this.site == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.site"); + else if (Configuration.doAutoCreate()) + this.site = new CodeableConcept(); // cc + return this.site; + } + + public boolean hasSite() { + return this.site != null && !this.site.isEmpty(); + } + + /** + * @param value {@link #site} (A coded specification of the anatomic site where the medication first entered the body. E.g. "left arm".) + */ + public MedicationAdministrationDosageComponent setSite(CodeableConcept value) { + this.site = value; + return this; + } + + /** + * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc.) + */ + public CodeableConcept getRoute() { + if (this.route == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.route"); + else if (Configuration.doAutoCreate()) + this.route = new CodeableConcept(); // cc + return this.route; + } + + public boolean hasRoute() { + return this.route != null && !this.route.isEmpty(); + } + + /** + * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc.) + */ + public MedicationAdministrationDosageComponent setRoute(CodeableConcept value) { + this.route = value; + return this; + } + + /** + * @return {@link #method} (A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. Terminologies used often pre-coordinate this term with the route and or form of administration.) + */ + public CodeableConcept getMethod() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.method"); + else if (Configuration.doAutoCreate()) + this.method = new CodeableConcept(); // cc + return this.method; + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** + * @param value {@link #method} (A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. Terminologies used often pre-coordinate this term with the route and or form of administration.) + */ + public MedicationAdministrationDosageComponent setMethod(CodeableConcept value) { + this.method = value; + return this; + } + + /** + * @return {@link #quantity} (The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.) + */ + public MedicationAdministrationDosageComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #rate} (Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity.) + */ + public Ratio getRate() { + if (this.rate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.rate"); + else if (Configuration.doAutoCreate()) + this.rate = new Ratio(); // cc + return this.rate; + } + + public boolean hasRate() { + return this.rate != null && !this.rate.isEmpty(); + } + + /** + * @param value {@link #rate} (Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity.) + */ + public MedicationAdministrationDosageComponent setRate(Ratio value) { + this.rate = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("text", "string", "Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("site", "CodeableConcept", "A coded specification of the anatomic site where the medication first entered the body. E.g. 'left arm'.", 0, java.lang.Integer.MAX_VALUE, site)); + childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc.", 0, java.lang.Integer.MAX_VALUE, route)); + childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\r\rTerminologies used often pre-coordinate this term with the route and or form of administration.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("quantity", "Quantity", "The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("rate", "Ratio", "Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity.", 0, java.lang.Integer.MAX_VALUE, rate)); + } + + public MedicationAdministrationDosageComponent copy() { + MedicationAdministrationDosageComponent dst = new MedicationAdministrationDosageComponent(); + copyValues(dst); + dst.text = text == null ? null : text.copy(); + dst.site = site == null ? null : site.copy(); + dst.route = route == null ? null : route.copy(); + dst.method = method == null ? null : method.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.rate = rate == null ? null : rate.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationAdministrationDosageComponent)) + return false; + MedicationAdministrationDosageComponent o = (MedicationAdministrationDosageComponent) other; + return compareDeep(text, o.text, true) && compareDeep(site, o.site, true) && compareDeep(route, o.route, true) + && compareDeep(method, o.method, true) && compareDeep(quantity, o.quantity, true) && compareDeep(rate, o.rate, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationAdministrationDosageComponent)) + return false; + MedicationAdministrationDosageComponent o = (MedicationAdministrationDosageComponent) other; + return compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (text == null || text.isEmpty()) && (site == null || site.isEmpty()) + && (route == null || route.isEmpty()) && (method == null || method.isEmpty()) && (quantity == null || quantity.isEmpty()) + && (rate == null || rate.isEmpty()); + } + + } + + /** + * External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External identifier", formalDefinition="External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated." ) + protected List identifier; + + /** + * Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="in-progress | on-hold | completed | entered-in-error | stopped", formalDefinition="Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way." ) + protected Enumeration status; + + /** + * The person or animal to whom the medication was given. + */ + @Child(name = "patient", type = {Patient.class}, order=2, min=1, max=1) + @Description(shortDefinition="Who received medication?", formalDefinition="The person or animal to whom the medication was given." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The person or animal to whom the medication was given.) + */ + protected Patient patientTarget; + + /** + * The individual who was responsible for giving the medication to the patient. + */ + @Child(name = "practitioner", type = {Practitioner.class}, order=3, min=0, max=1) + @Description(shortDefinition="Who administered substance?", formalDefinition="The individual who was responsible for giving the medication to the patient." ) + protected Reference practitioner; + + /** + * The actual object that is the target of the reference (The individual who was responsible for giving the medication to the patient.) + */ + protected Practitioner practitionerTarget; + + /** + * The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of. + */ + @Child(name = "encounter", type = {Encounter.class}, order=4, min=0, max=1) + @Description(shortDefinition="Encounter administered as part of", formalDefinition="The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.) + */ + protected Encounter encounterTarget; + + /** + * The original request, instruction or authority to perform the administration. + */ + @Child(name = "prescription", type = {MedicationPrescription.class}, order=5, min=0, max=1) + @Description(shortDefinition="Order administration performed against", formalDefinition="The original request, instruction or authority to perform the administration." ) + protected Reference prescription; + + /** + * The actual object that is the target of the reference (The original request, instruction or authority to perform the administration.) + */ + protected MedicationPrescription prescriptionTarget; + + /** + * Set this to true if the record is saying that the medication was NOT administered. + */ + @Child(name = "wasNotGiven", type = {BooleanType.class}, order=6, min=0, max=1) + @Description(shortDefinition="True if medication not administered", formalDefinition="Set this to true if the record is saying that the medication was NOT administered." ) + protected BooleanType wasNotGiven; + + /** + * A code indicating why the administration was not performed. + */ + @Child(name = "reasonNotGiven", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Reason administration not performed", formalDefinition="A code indicating why the administration was not performed." ) + protected List reasonNotGiven; + + /** + * A code indicating why the medication was given. + */ + @Child(name = "reasonGiven", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Reason administration performed", formalDefinition="A code indicating why the medication was given." ) + protected List reasonGiven; + + /** + * An interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate. + */ + @Child(name = "effectiveTime", type = {DateTimeType.class, Period.class}, order=9, min=1, max=1) + @Description(shortDefinition="Start and end time of administration", formalDefinition="An interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate." ) + protected Type effectiveTime; + + /** + * Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. + */ + @Child(name = "medication", type = {CodeableConcept.class, Medication.class}, order=10, min=1, max=1) + @Description(shortDefinition="What was administered?", formalDefinition="Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." ) + protected Type medication; + + /** + * The device used in administering the medication to the patient. E.g. a particular infusion pump. + */ + @Child(name = "device", type = {Device.class}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Device used to administer", formalDefinition="The device used in administering the medication to the patient. E.g. a particular infusion pump." ) + protected List device; + /** + * The actual objects that are the target of the reference (The device used in administering the medication to the patient. E.g. a particular infusion pump.) + */ + protected List deviceTarget; + + + /** + * Extra information about the medication administration that is not conveyed by the other attributes. + */ + @Child(name = "note", type = {StringType.class}, order=12, min=0, max=1) + @Description(shortDefinition="Information about the administration", formalDefinition="Extra information about the medication administration that is not conveyed by the other attributes." ) + protected StringType note; + + /** + * Indicates how the medication is/was used by the patient. + */ + @Child(name = "dosage", type = {}, order=13, min=0, max=1) + @Description(shortDefinition="Details of how medication was taken", formalDefinition="Indicates how the medication is/was used by the patient." ) + protected MedicationAdministrationDosageComponent dosage; + + private static final long serialVersionUID = -1612329478L; + + /* + * Constructor + */ + public MedicationAdministration() { + super(); + } + + /* + * Constructor + */ + public MedicationAdministration(Enumeration status, Reference patient, Type effectiveTime, Type medication) { + super(); + this.status = status; + this.patient = patient; + this.effectiveTime = effectiveTime; + this.medication = medication; + } + + /** + * @return {@link #identifier} (External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public MedicationAdministration addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #status} (Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new MedicationAdminStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public MedicationAdministration setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way. + */ + public MedicationAdminStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way. + */ + public MedicationAdministration setStatus(MedicationAdminStatus value) { + if (this.status == null) + this.status = new Enumeration(new MedicationAdminStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #patient} (The person or animal to whom the medication was given.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The person or animal to whom the medication was given.) + */ + public MedicationAdministration setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person or animal to whom the medication was given.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person or animal to whom the medication was given.) + */ + public MedicationAdministration setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #practitioner} (The individual who was responsible for giving the medication to the patient.) + */ + public Reference getPractitioner() { + if (this.practitioner == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.practitioner"); + else if (Configuration.doAutoCreate()) + this.practitioner = new Reference(); // cc + return this.practitioner; + } + + public boolean hasPractitioner() { + return this.practitioner != null && !this.practitioner.isEmpty(); + } + + /** + * @param value {@link #practitioner} (The individual who was responsible for giving the medication to the patient.) + */ + public MedicationAdministration setPractitioner(Reference value) { + this.practitioner = value; + return this; + } + + /** + * @return {@link #practitioner} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The individual who was responsible for giving the medication to the patient.) + */ + public Practitioner getPractitionerTarget() { + if (this.practitionerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.practitioner"); + else if (Configuration.doAutoCreate()) + this.practitionerTarget = new Practitioner(); // aa + return this.practitionerTarget; + } + + /** + * @param value {@link #practitioner} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The individual who was responsible for giving the medication to the patient.) + */ + public MedicationAdministration setPractitionerTarget(Practitioner value) { + this.practitionerTarget = value; + return this; + } + + /** + * @return {@link #encounter} (The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.) + */ + public MedicationAdministration setEncounter(Reference value) { + this.encounter = value; + return this; + } + + /** + * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + return this.encounterTarget; + } + + /** + * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.) + */ + public MedicationAdministration setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #prescription} (The original request, instruction or authority to perform the administration.) + */ + public Reference getPrescription() { + if (this.prescription == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.prescription"); + else if (Configuration.doAutoCreate()) + this.prescription = new Reference(); // cc + return this.prescription; + } + + public boolean hasPrescription() { + return this.prescription != null && !this.prescription.isEmpty(); + } + + /** + * @param value {@link #prescription} (The original request, instruction or authority to perform the administration.) + */ + public MedicationAdministration setPrescription(Reference value) { + this.prescription = value; + return this; + } + + /** + * @return {@link #prescription} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The original request, instruction or authority to perform the administration.) + */ + public MedicationPrescription getPrescriptionTarget() { + if (this.prescriptionTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.prescription"); + else if (Configuration.doAutoCreate()) + this.prescriptionTarget = new MedicationPrescription(); // aa + return this.prescriptionTarget; + } + + /** + * @param value {@link #prescription} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The original request, instruction or authority to perform the administration.) + */ + public MedicationAdministration setPrescriptionTarget(MedicationPrescription value) { + this.prescriptionTarget = value; + return this; + } + + /** + * @return {@link #wasNotGiven} (Set this to true if the record is saying that the medication was NOT administered.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value + */ + public BooleanType getWasNotGivenElement() { + if (this.wasNotGiven == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.wasNotGiven"); + else if (Configuration.doAutoCreate()) + this.wasNotGiven = new BooleanType(); // bb + return this.wasNotGiven; + } + + public boolean hasWasNotGivenElement() { + return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); + } + + public boolean hasWasNotGiven() { + return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); + } + + /** + * @param value {@link #wasNotGiven} (Set this to true if the record is saying that the medication was NOT administered.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value + */ + public MedicationAdministration setWasNotGivenElement(BooleanType value) { + this.wasNotGiven = value; + return this; + } + + /** + * @return Set this to true if the record is saying that the medication was NOT administered. + */ + public boolean getWasNotGiven() { + return this.wasNotGiven == null || this.wasNotGiven.isEmpty() ? false : this.wasNotGiven.getValue(); + } + + /** + * @param value Set this to true if the record is saying that the medication was NOT administered. + */ + public MedicationAdministration setWasNotGiven(boolean value) { + if (this.wasNotGiven == null) + this.wasNotGiven = new BooleanType(); + this.wasNotGiven.setValue(value); + return this; + } + + /** + * @return {@link #reasonNotGiven} (A code indicating why the administration was not performed.) + */ + public List getReasonNotGiven() { + if (this.reasonNotGiven == null) + this.reasonNotGiven = new ArrayList(); + return this.reasonNotGiven; + } + + public boolean hasReasonNotGiven() { + if (this.reasonNotGiven == null) + return false; + for (CodeableConcept item : this.reasonNotGiven) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reasonNotGiven} (A code indicating why the administration was not performed.) + */ + // syntactic sugar + public CodeableConcept addReasonNotGiven() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reasonNotGiven == null) + this.reasonNotGiven = new ArrayList(); + this.reasonNotGiven.add(t); + return t; + } + + // syntactic sugar + public MedicationAdministration addReasonNotGiven(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reasonNotGiven == null) + this.reasonNotGiven = new ArrayList(); + this.reasonNotGiven.add(t); + return this; + } + + /** + * @return {@link #reasonGiven} (A code indicating why the medication was given.) + */ + public List getReasonGiven() { + if (this.reasonGiven == null) + this.reasonGiven = new ArrayList(); + return this.reasonGiven; + } + + public boolean hasReasonGiven() { + if (this.reasonGiven == null) + return false; + for (CodeableConcept item : this.reasonGiven) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reasonGiven} (A code indicating why the medication was given.) + */ + // syntactic sugar + public CodeableConcept addReasonGiven() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reasonGiven == null) + this.reasonGiven = new ArrayList(); + this.reasonGiven.add(t); + return t; + } + + // syntactic sugar + public MedicationAdministration addReasonGiven(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reasonGiven == null) + this.reasonGiven = new ArrayList(); + this.reasonGiven.add(t); + return this; + } + + /** + * @return {@link #effectiveTime} (An interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) + */ + public Type getEffectiveTime() { + return this.effectiveTime; + } + + /** + * @return {@link #effectiveTime} (An interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) + */ + public DateTimeType getEffectiveTimeDateTimeType() throws Exception { + if (!(this.effectiveTime instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.effectiveTime.getClass().getName()+" was encountered"); + return (DateTimeType) this.effectiveTime; + } + + /** + * @return {@link #effectiveTime} (An interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) + */ + public Period getEffectiveTimePeriod() throws Exception { + if (!(this.effectiveTime instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.effectiveTime.getClass().getName()+" was encountered"); + return (Period) this.effectiveTime; + } + + public boolean hasEffectiveTime() { + return this.effectiveTime != null && !this.effectiveTime.isEmpty(); + } + + /** + * @param value {@link #effectiveTime} (An interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) + */ + public MedicationAdministration setEffectiveTime(Type value) { + this.effectiveTime = value; + return this; + } + + /** + * @return {@link #medication} (Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Type getMedication() { + return this.medication; + } + + /** + * @return {@link #medication} (Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public CodeableConcept getMedicationCodeableConcept() throws Exception { + if (!(this.medication instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.medication.getClass().getName()+" was encountered"); + return (CodeableConcept) this.medication; + } + + /** + * @return {@link #medication} (Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Reference getMedicationReference() throws Exception { + if (!(this.medication instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.medication.getClass().getName()+" was encountered"); + return (Reference) this.medication; + } + + public boolean hasMedication() { + return this.medication != null && !this.medication.isEmpty(); + } + + /** + * @param value {@link #medication} (Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public MedicationAdministration setMedication(Type value) { + this.medication = value; + return this; + } + + /** + * @return {@link #device} (The device used in administering the medication to the patient. E.g. a particular infusion pump.) + */ + public List getDevice() { + if (this.device == null) + this.device = new ArrayList(); + return this.device; + } + + public boolean hasDevice() { + if (this.device == null) + return false; + for (Reference item : this.device) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #device} (The device used in administering the medication to the patient. E.g. a particular infusion pump.) + */ + // syntactic sugar + public Reference addDevice() { //3 + Reference t = new Reference(); + if (this.device == null) + this.device = new ArrayList(); + this.device.add(t); + return t; + } + + // syntactic sugar + public MedicationAdministration addDevice(Reference t) { //3 + if (t == null) + return this; + if (this.device == null) + this.device = new ArrayList(); + this.device.add(t); + return this; + } + + /** + * @return {@link #device} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The device used in administering the medication to the patient. E.g. a particular infusion pump.) + */ + public List getDeviceTarget() { + if (this.deviceTarget == null) + this.deviceTarget = new ArrayList(); + return this.deviceTarget; + } + + // syntactic sugar + /** + * @return {@link #device} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The device used in administering the medication to the patient. E.g. a particular infusion pump.) + */ + public Device addDeviceTarget() { + Device r = new Device(); + if (this.deviceTarget == null) + this.deviceTarget = new ArrayList(); + this.deviceTarget.add(r); + return r; + } + + /** + * @return {@link #note} (Extra information about the medication administration that is not conveyed by the other attributes.). 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 MedicationAdministration.note"); + else if (Configuration.doAutoCreate()) + this.note = new StringType(); // bb + 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} (Extra information about the medication administration that is not conveyed by the other attributes.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value + */ + public MedicationAdministration setNoteElement(StringType value) { + this.note = value; + return this; + } + + /** + * @return Extra information about the medication administration that is not conveyed by the other attributes. + */ + public String getNote() { + return this.note == null ? null : this.note.getValue(); + } + + /** + * @param value Extra information about the medication administration that is not conveyed by the other attributes. + */ + public MedicationAdministration setNote(String value) { + if (Utilities.noString(value)) + this.note = null; + else { + if (this.note == null) + this.note = new StringType(); + this.note.setValue(value); + } + return this; + } + + /** + * @return {@link #dosage} (Indicates how the medication is/was used by the patient.) + */ + public MedicationAdministrationDosageComponent getDosage() { + if (this.dosage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.dosage"); + else if (Configuration.doAutoCreate()) + this.dosage = new MedicationAdministrationDosageComponent(); // cc + return this.dosage; + } + + public boolean hasDosage() { + return this.dosage != null && !this.dosage.isEmpty(); + } + + /** + * @param value {@link #dosage} (Indicates how the medication is/was used by the patient.) + */ + public MedicationAdministration setDosage(MedicationAdministrationDosageComponent value) { + this.dosage = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("patient", "Reference(Patient)", "The person or animal to whom the medication was given.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("practitioner", "Reference(Practitioner)", "The individual who was responsible for giving the medication to the patient.", 0, java.lang.Integer.MAX_VALUE, practitioner)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("prescription", "Reference(MedicationPrescription)", "The original request, instruction or authority to perform the administration.", 0, java.lang.Integer.MAX_VALUE, prescription)); + childrenList.add(new Property("wasNotGiven", "boolean", "Set this to true if the record is saying that the medication was NOT administered.", 0, java.lang.Integer.MAX_VALUE, wasNotGiven)); + childrenList.add(new Property("reasonNotGiven", "CodeableConcept", "A code indicating why the administration was not performed.", 0, java.lang.Integer.MAX_VALUE, reasonNotGiven)); + childrenList.add(new Property("reasonGiven", "CodeableConcept", "A code indicating why the medication was given.", 0, java.lang.Integer.MAX_VALUE, reasonGiven)); + childrenList.add(new Property("effectiveTime[x]", "dateTime|Period", "An interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.", 0, java.lang.Integer.MAX_VALUE, effectiveTime)); + childrenList.add(new Property("medication[x]", "CodeableConcept|Reference(Medication)", "Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); + childrenList.add(new Property("device", "Reference(Device)", "The device used in administering the medication to the patient. E.g. a particular infusion pump.", 0, java.lang.Integer.MAX_VALUE, device)); + childrenList.add(new Property("note", "string", "Extra information about the medication administration that is not conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("dosage", "", "Indicates how the medication is/was used by the patient.", 0, java.lang.Integer.MAX_VALUE, dosage)); + } + + public MedicationAdministration copy() { + MedicationAdministration dst = new MedicationAdministration(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.practitioner = practitioner == null ? null : practitioner.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.prescription = prescription == null ? null : prescription.copy(); + dst.wasNotGiven = wasNotGiven == null ? null : wasNotGiven.copy(); + if (reasonNotGiven != null) { + dst.reasonNotGiven = new ArrayList(); + for (CodeableConcept i : reasonNotGiven) + dst.reasonNotGiven.add(i.copy()); + }; + if (reasonGiven != null) { + dst.reasonGiven = new ArrayList(); + for (CodeableConcept i : reasonGiven) + dst.reasonGiven.add(i.copy()); + }; + dst.effectiveTime = effectiveTime == null ? null : effectiveTime.copy(); + dst.medication = medication == null ? null : medication.copy(); + if (device != null) { + dst.device = new ArrayList(); + for (Reference i : device) + dst.device.add(i.copy()); + }; + dst.note = note == null ? null : note.copy(); + dst.dosage = dosage == null ? null : dosage.copy(); + return dst; + } + + protected MedicationAdministration typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationAdministration)) + return false; + MedicationAdministration o = (MedicationAdministration) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(patient, o.patient, true) + && compareDeep(practitioner, o.practitioner, true) && compareDeep(encounter, o.encounter, true) + && compareDeep(prescription, o.prescription, true) && compareDeep(wasNotGiven, o.wasNotGiven, true) + && compareDeep(reasonNotGiven, o.reasonNotGiven, true) && compareDeep(reasonGiven, o.reasonGiven, true) + && compareDeep(effectiveTime, o.effectiveTime, true) && compareDeep(medication, o.medication, true) + && compareDeep(device, o.device, true) && compareDeep(note, o.note, true) && compareDeep(dosage, o.dosage, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationAdministration)) + return false; + MedicationAdministration o = (MedicationAdministration) other; + return compareValues(status, o.status, true) && compareValues(wasNotGiven, o.wasNotGiven, true) && compareValues(note, o.note, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (patient == null || patient.isEmpty()) && (practitioner == null || practitioner.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (prescription == null || prescription.isEmpty()) + && (wasNotGiven == null || wasNotGiven.isEmpty()) && (reasonNotGiven == null || reasonNotGiven.isEmpty()) + && (reasonGiven == null || reasonGiven.isEmpty()) && (effectiveTime == null || effectiveTime.isEmpty()) + && (medication == null || medication.isEmpty()) && (device == null || device.isEmpty()) && (note == null || note.isEmpty()) + && (dosage == null || dosage.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.MedicationAdministration; + } + + @SearchParamDefinition(name="identifier", path="MedicationAdministration.identifier", description="Return administrations with this external identity", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="prescription", path="MedicationAdministration.prescription", description="The identity of a prescription to list administrations from", type="reference" ) + public static final String SP_PRESCRIPTION = "prescription"; + @SearchParamDefinition(name="effectivetime", path="MedicationAdministration.effectiveTime[x]", description="Date administration happened (or did not happen)", type="date" ) + public static final String SP_EFFECTIVETIME = "effectivetime"; + @SearchParamDefinition(name="practitioner", path="MedicationAdministration.practitioner", description="Who administered substance?", type="reference" ) + public static final String SP_PRACTITIONER = "practitioner"; + @SearchParamDefinition(name="patient", path="MedicationAdministration.patient", description="The identity of a patient to list administrations for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="medication", path="MedicationAdministration.medicationReference", description="Return administrations of this medication", type="reference" ) + public static final String SP_MEDICATION = "medication"; + @SearchParamDefinition(name="encounter", path="MedicationAdministration.encounter", description="Return administrations that share this encounter", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + @SearchParamDefinition(name="device", path="MedicationAdministration.device", description="Return administrations with this administration device identity", type="reference" ) + public static final String SP_DEVICE = "device"; + @SearchParamDefinition(name="notgiven", path="MedicationAdministration.wasNotGiven", description="Administrations that were not made", type="token" ) + public static final String SP_NOTGIVEN = "notgiven"; + @SearchParamDefinition(name="status", path="MedicationAdministration.status", description="MedicationAdministration event status (for example one of active/paused/completed/nullified)", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/MedicationDispense.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/MedicationDispense.java index 8b934d7ed48..1fa47cbe05e 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/MedicationDispense.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/MedicationDispense.java @@ -1,1730 +1,1757 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Dispensing a medication to a named patient. This includes a description of the supply provided and the instructions for administering the medication. - */ -@ResourceDef(name="MedicationDispense", profile="http://hl7.org/fhir/Profile/MedicationDispense") -public class MedicationDispense extends DomainResource { - - public enum MedicationDispenseStatus { - /** - * The dispense has started but has not yet completed. - */ - INPROGRESS, - /** - * Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called "suspended". - */ - ONHOLD, - /** - * All actions that are implied by the dispense have occurred. - */ - COMPLETED, - /** - * The dispense was entered in error and therefore nullified. - */ - ENTEREDINERROR, - /** - * Actions implied by the dispense have been permanently halted, before all of them occurred. - */ - STOPPED, - /** - * added to help the parsers - */ - NULL; - public static MedicationDispenseStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("on-hold".equals(codeString)) - return ONHOLD; - if ("completed".equals(codeString)) - return COMPLETED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - if ("stopped".equals(codeString)) - return STOPPED; - throw new Exception("Unknown MedicationDispenseStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INPROGRESS: return "in-progress"; - case ONHOLD: return "on-hold"; - case COMPLETED: return "completed"; - case ENTEREDINERROR: return "entered-in-error"; - case STOPPED: return "stopped"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPROGRESS: return ""; - case ONHOLD: return ""; - case COMPLETED: return ""; - case ENTEREDINERROR: return ""; - case STOPPED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPROGRESS: return "The dispense has started but has not yet completed."; - case ONHOLD: return "Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called 'suspended'."; - case COMPLETED: return "All actions that are implied by the dispense have occurred."; - case ENTEREDINERROR: return "The dispense was entered in error and therefore nullified."; - case STOPPED: return "Actions implied by the dispense have been permanently halted, before all of them occurred."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPROGRESS: return "In Progress"; - case ONHOLD: return "On Hold"; - case COMPLETED: return "Completed"; - case ENTEREDINERROR: return "Entered In Error"; - case STOPPED: return "Stopped"; - default: return "?"; - } - } - } - - public static class MedicationDispenseStatusEnumFactory implements EnumFactory { - public MedicationDispenseStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return MedicationDispenseStatus.INPROGRESS; - if ("on-hold".equals(codeString)) - return MedicationDispenseStatus.ONHOLD; - if ("completed".equals(codeString)) - return MedicationDispenseStatus.COMPLETED; - if ("entered-in-error".equals(codeString)) - return MedicationDispenseStatus.ENTEREDINERROR; - if ("stopped".equals(codeString)) - return MedicationDispenseStatus.STOPPED; - throw new IllegalArgumentException("Unknown MedicationDispenseStatus code '"+codeString+"'"); - } - public String toCode(MedicationDispenseStatus code) { - if (code == MedicationDispenseStatus.INPROGRESS) - return "in-progress"; - if (code == MedicationDispenseStatus.ONHOLD) - return "on-hold"; - if (code == MedicationDispenseStatus.COMPLETED) - return "completed"; - if (code == MedicationDispenseStatus.ENTEREDINERROR) - return "entered-in-error"; - if (code == MedicationDispenseStatus.STOPPED) - return "stopped"; - return "?"; - } - } - - @Block() - public static class MedicationDispenseDosageInstructionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Additional instructions such as "Swallow with plenty of water" which may or may not be coded. - */ - @Child(name = "additionalInstructions", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="E.g. 'Take with food'", formalDefinition="Additional instructions such as 'Swallow with plenty of water' which may or may not be coded." ) - protected CodeableConcept additionalInstructions; - - /** - * The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". - */ - @Child(name = "schedule", type = {DateTimeType.class, Period.class, Timing.class}, order=2, min=0, max=1) - @Description(shortDefinition="When medication should be administered", formalDefinition="The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'." ) - protected Type schedule; - - /** - * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication. - */ - @Child(name = "asNeeded", type = {BooleanType.class, CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Take 'as needed' f(or x)", formalDefinition="If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication." ) - protected Type asNeeded; - - /** - * A coded specification of the anatomic site where the medication first enters the body. - */ - @Child(name = "site", type = {CodeableConcept.class}, order=4, min=0, max=1) - @Description(shortDefinition="Body site to administer to", formalDefinition="A coded specification of the anatomic site where the medication first enters the body." ) - protected CodeableConcept site; - - /** - * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject. - */ - @Child(name = "route", type = {CodeableConcept.class}, order=5, min=0, max=1) - @Description(shortDefinition="How drug should enter body", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject." ) - protected CodeableConcept route; - - /** - * A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. - -Terminologies used often pre-coordinate this term with the route and or form of administration. - */ - @Child(name = "method", type = {CodeableConcept.class}, order=6, min=0, max=1) - @Description(shortDefinition="Technique for administering medication", formalDefinition="A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\r\rTerminologies used often pre-coordinate this term with the route and or form of administration." ) - protected CodeableConcept method; - - /** - * The amount of therapeutic or other substance given at one administration event. - */ - @Child(name = "dose", type = {Range.class, Quantity.class}, order=7, min=0, max=1) - @Description(shortDefinition="Amount of medication per dose", formalDefinition="The amount of therapeutic or other substance given at one administration event." ) - protected Type dose; - - /** - * Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. - */ - @Child(name = "rate", type = {Ratio.class}, order=8, min=0, max=1) - @Description(shortDefinition="Amount of medication per unit of time", formalDefinition="Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours." ) - protected Ratio rate; - - /** - * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours. - */ - @Child(name = "maxDosePerPeriod", type = {Ratio.class}, order=9, min=0, max=1) - @Description(shortDefinition="Upper limit on medication per unit of time", formalDefinition="The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours." ) - protected Ratio maxDosePerPeriod; - - private static final long serialVersionUID = -1523433515L; - - /* - * Constructor - */ - public MedicationDispenseDosageInstructionComponent() { - super(); - } - - /** - * @return {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) - */ - public CodeableConcept getAdditionalInstructions() { - if (this.additionalInstructions == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.additionalInstructions"); - else if (Configuration.doAutoCreate()) - this.additionalInstructions = new CodeableConcept(); // cc - return this.additionalInstructions; - } - - public boolean hasAdditionalInstructions() { - return this.additionalInstructions != null && !this.additionalInstructions.isEmpty(); - } - - /** - * @param value {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) - */ - public MedicationDispenseDosageInstructionComponent setAdditionalInstructions(CodeableConcept value) { - this.additionalInstructions = value; - return this; - } - - /** - * @return {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Type getSchedule() { - return this.schedule; - } - - /** - * @return {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public DateTimeType getScheduleDateTimeType() throws Exception { - if (!(this.schedule instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.schedule.getClass().getName()+" was encountered"); - return (DateTimeType) this.schedule; - } - - /** - * @return {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Period getSchedulePeriod() throws Exception { - if (!(this.schedule instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.schedule.getClass().getName()+" was encountered"); - return (Period) this.schedule; - } - - /** - * @return {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Timing getScheduleTiming() throws Exception { - if (!(this.schedule instanceof Timing)) - throw new Exception("Type mismatch: the type Timing was expected, but "+this.schedule.getClass().getName()+" was encountered"); - return (Timing) this.schedule; - } - - public boolean hasSchedule() { - return this.schedule != null && !this.schedule.isEmpty(); - } - - /** - * @param value {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public MedicationDispenseDosageInstructionComponent setSchedule(Type value) { - this.schedule = value; - return this; - } - - /** - * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public Type getAsNeeded() { - return this.asNeeded; - } - - /** - * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public BooleanType getAsNeededBooleanType() throws Exception { - if (!(this.asNeeded instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (BooleanType) this.asNeeded; - } - - /** - * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public CodeableConcept getAsNeededCodeableConcept() throws Exception { - if (!(this.asNeeded instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (CodeableConcept) this.asNeeded; - } - - public boolean hasAsNeeded() { - return this.asNeeded != null && !this.asNeeded.isEmpty(); - } - - /** - * @param value {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public MedicationDispenseDosageInstructionComponent setAsNeeded(Type value) { - this.asNeeded = value; - return this; - } - - /** - * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) - */ - public CodeableConcept getSite() { - if (this.site == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.site"); - else if (Configuration.doAutoCreate()) - this.site = new CodeableConcept(); // cc - return this.site; - } - - public boolean hasSite() { - return this.site != null && !this.site.isEmpty(); - } - - /** - * @param value {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) - */ - public MedicationDispenseDosageInstructionComponent setSite(CodeableConcept value) { - this.site = value; - return this; - } - - /** - * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) - */ - public CodeableConcept getRoute() { - if (this.route == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.route"); - else if (Configuration.doAutoCreate()) - this.route = new CodeableConcept(); // cc - return this.route; - } - - public boolean hasRoute() { - return this.route != null && !this.route.isEmpty(); - } - - /** - * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) - */ - public MedicationDispenseDosageInstructionComponent setRoute(CodeableConcept value) { - this.route = value; - return this; - } - - /** - * @return {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. - -Terminologies used often pre-coordinate this term with the route and or form of administration.) - */ - public CodeableConcept getMethod() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.method"); - else if (Configuration.doAutoCreate()) - this.method = new CodeableConcept(); // cc - return this.method; - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** - * @param value {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. - -Terminologies used often pre-coordinate this term with the route and or form of administration.) - */ - public MedicationDispenseDosageInstructionComponent setMethod(CodeableConcept value) { - this.method = value; - return this; - } - - /** - * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) - */ - public Type getDose() { - return this.dose; - } - - /** - * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) - */ - public Range getDoseRange() throws Exception { - if (!(this.dose instanceof Range)) - throw new Exception("Type mismatch: the type Range was expected, but "+this.dose.getClass().getName()+" was encountered"); - return (Range) this.dose; - } - - /** - * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) - */ - public Quantity getDoseQuantity() throws Exception { - if (!(this.dose instanceof Quantity)) - throw new Exception("Type mismatch: the type Quantity was expected, but "+this.dose.getClass().getName()+" was encountered"); - return (Quantity) this.dose; - } - - public boolean hasDose() { - return this.dose != null && !this.dose.isEmpty(); - } - - /** - * @param value {@link #dose} (The amount of therapeutic or other substance given at one administration event.) - */ - public MedicationDispenseDosageInstructionComponent setDose(Type value) { - this.dose = value; - return this; - } - - /** - * @return {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) - */ - public Ratio getRate() { - if (this.rate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.rate"); - else if (Configuration.doAutoCreate()) - this.rate = new Ratio(); // cc - return this.rate; - } - - public boolean hasRate() { - return this.rate != null && !this.rate.isEmpty(); - } - - /** - * @param value {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) - */ - public MedicationDispenseDosageInstructionComponent setRate(Ratio value) { - this.rate = value; - return this; - } - - /** - * @return {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours.) - */ - public Ratio getMaxDosePerPeriod() { - if (this.maxDosePerPeriod == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.maxDosePerPeriod"); - else if (Configuration.doAutoCreate()) - this.maxDosePerPeriod = new Ratio(); // cc - return this.maxDosePerPeriod; - } - - public boolean hasMaxDosePerPeriod() { - return this.maxDosePerPeriod != null && !this.maxDosePerPeriod.isEmpty(); - } - - /** - * @param value {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours.) - */ - public MedicationDispenseDosageInstructionComponent setMaxDosePerPeriod(Ratio value) { - this.maxDosePerPeriod = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("additionalInstructions", "CodeableConcept", "Additional instructions such as 'Swallow with plenty of water' which may or may not be coded.", 0, java.lang.Integer.MAX_VALUE, additionalInstructions)); - childrenList.add(new Property("schedule[x]", "dateTime|Period|Timing", "The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'.", 0, java.lang.Integer.MAX_VALUE, schedule)); - childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); - childrenList.add(new Property("site", "CodeableConcept", "A coded specification of the anatomic site where the medication first enters the body.", 0, java.lang.Integer.MAX_VALUE, site)); - childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.", 0, java.lang.Integer.MAX_VALUE, route)); - childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\r\rTerminologies used often pre-coordinate this term with the route and or form of administration.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("dose[x]", "Range|Quantity", "The amount of therapeutic or other substance given at one administration event.", 0, java.lang.Integer.MAX_VALUE, dose)); - childrenList.add(new Property("rate", "Ratio", "Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.", 0, java.lang.Integer.MAX_VALUE, rate)); - childrenList.add(new Property("maxDosePerPeriod", "Ratio", "The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxDosePerPeriod)); - } - - public MedicationDispenseDosageInstructionComponent copy() { - MedicationDispenseDosageInstructionComponent dst = new MedicationDispenseDosageInstructionComponent(); - copyValues(dst); - dst.additionalInstructions = additionalInstructions == null ? null : additionalInstructions.copy(); - dst.schedule = schedule == null ? null : schedule.copy(); - dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); - dst.site = site == null ? null : site.copy(); - dst.route = route == null ? null : route.copy(); - dst.method = method == null ? null : method.copy(); - dst.dose = dose == null ? null : dose.copy(); - dst.rate = rate == null ? null : rate.copy(); - dst.maxDosePerPeriod = maxDosePerPeriod == null ? null : maxDosePerPeriod.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationDispenseDosageInstructionComponent)) - return false; - MedicationDispenseDosageInstructionComponent o = (MedicationDispenseDosageInstructionComponent) other; - return compareDeep(additionalInstructions, o.additionalInstructions, true) && compareDeep(schedule, o.schedule, true) - && compareDeep(asNeeded, o.asNeeded, true) && compareDeep(site, o.site, true) && compareDeep(route, o.route, true) - && compareDeep(method, o.method, true) && compareDeep(dose, o.dose, true) && compareDeep(rate, o.rate, true) - && compareDeep(maxDosePerPeriod, o.maxDosePerPeriod, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationDispenseDosageInstructionComponent)) - return false; - MedicationDispenseDosageInstructionComponent o = (MedicationDispenseDosageInstructionComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (additionalInstructions == null || additionalInstructions.isEmpty()) - && (schedule == null || schedule.isEmpty()) && (asNeeded == null || asNeeded.isEmpty()) && (site == null || site.isEmpty()) - && (route == null || route.isEmpty()) && (method == null || method.isEmpty()) && (dose == null || dose.isEmpty()) - && (rate == null || rate.isEmpty()) && (maxDosePerPeriod == null || maxDosePerPeriod.isEmpty()) - ; - } - - } - - @Block() - public static class MedicationDispenseSubstitutionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A code signifying whether a different drug was dispensed from what was prescribed. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Type of substitiution", formalDefinition="A code signifying whether a different drug was dispensed from what was prescribed." ) - protected CodeableConcept type; - - /** - * Indicates the reason for the substitution of (or lack of substitution) from what was prescribed. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Why was substitution made", formalDefinition="Indicates the reason for the substitution of (or lack of substitution) from what was prescribed." ) - protected List reason; - - /** - * The person or organization that has primary responsibility for the substitution. - */ - @Child(name = "responsibleParty", type = {Practitioner.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who is responsible for the substitution", formalDefinition="The person or organization that has primary responsibility for the substitution." ) - protected List responsibleParty; - /** - * The actual objects that are the target of the reference (The person or organization that has primary responsibility for the substitution.) - */ - protected List responsiblePartyTarget; - - - private static final long serialVersionUID = 1218245830L; - - /* - * Constructor - */ - public MedicationDispenseSubstitutionComponent() { - super(); - } - - /* - * Constructor - */ - public MedicationDispenseSubstitutionComponent(CodeableConcept type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (A code signifying whether a different drug was dispensed from what was prescribed.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseSubstitutionComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (A code signifying whether a different drug was dispensed from what was prescribed.) - */ - public MedicationDispenseSubstitutionComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #reason} (Indicates the reason for the substitution of (or lack of substitution) from what was prescribed.) - */ - public List getReason() { - if (this.reason == null) - this.reason = new ArrayList(); - return this.reason; - } - - public boolean hasReason() { - if (this.reason == null) - return false; - for (CodeableConcept item : this.reason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reason} (Indicates the reason for the substitution of (or lack of substitution) from what was prescribed.) - */ - // syntactic sugar - public CodeableConcept addReason() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return t; - } - - // syntactic sugar - public MedicationDispenseSubstitutionComponent addReason(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return this; - } - - /** - * @return {@link #responsibleParty} (The person or organization that has primary responsibility for the substitution.) - */ - public List getResponsibleParty() { - if (this.responsibleParty == null) - this.responsibleParty = new ArrayList(); - return this.responsibleParty; - } - - public boolean hasResponsibleParty() { - if (this.responsibleParty == null) - return false; - for (Reference item : this.responsibleParty) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #responsibleParty} (The person or organization that has primary responsibility for the substitution.) - */ - // syntactic sugar - public Reference addResponsibleParty() { //3 - Reference t = new Reference(); - if (this.responsibleParty == null) - this.responsibleParty = new ArrayList(); - this.responsibleParty.add(t); - return t; - } - - // syntactic sugar - public MedicationDispenseSubstitutionComponent addResponsibleParty(Reference t) { //3 - if (t == null) - return this; - if (this.responsibleParty == null) - this.responsibleParty = new ArrayList(); - this.responsibleParty.add(t); - return this; - } - - /** - * @return {@link #responsibleParty} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The person or organization that has primary responsibility for the substitution.) - */ - public List getResponsiblePartyTarget() { - if (this.responsiblePartyTarget == null) - this.responsiblePartyTarget = new ArrayList(); - return this.responsiblePartyTarget; - } - - // syntactic sugar - /** - * @return {@link #responsibleParty} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The person or organization that has primary responsibility for the substitution.) - */ - public Practitioner addResponsiblePartyTarget() { - Practitioner r = new Practitioner(); - if (this.responsiblePartyTarget == null) - this.responsiblePartyTarget = new ArrayList(); - this.responsiblePartyTarget.add(r); - return r; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "A code signifying whether a different drug was dispensed from what was prescribed.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("reason", "CodeableConcept", "Indicates the reason for the substitution of (or lack of substitution) from what was prescribed.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("responsibleParty", "Reference(Practitioner)", "The person or organization that has primary responsibility for the substitution.", 0, java.lang.Integer.MAX_VALUE, responsibleParty)); - } - - public MedicationDispenseSubstitutionComponent copy() { - MedicationDispenseSubstitutionComponent dst = new MedicationDispenseSubstitutionComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - if (reason != null) { - dst.reason = new ArrayList(); - for (CodeableConcept i : reason) - dst.reason.add(i.copy()); - }; - if (responsibleParty != null) { - dst.responsibleParty = new ArrayList(); - for (Reference i : responsibleParty) - dst.responsibleParty.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationDispenseSubstitutionComponent)) - return false; - MedicationDispenseSubstitutionComponent o = (MedicationDispenseSubstitutionComponent) other; - return compareDeep(type, o.type, true) && compareDeep(reason, o.reason, true) && compareDeep(responsibleParty, o.responsibleParty, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationDispenseSubstitutionComponent)) - return false; - MedicationDispenseSubstitutionComponent o = (MedicationDispenseSubstitutionComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (reason == null || reason.isEmpty()) - && (responsibleParty == null || responsibleParty.isEmpty()); - } - - } - - /** - * Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1) - @Description(shortDefinition="External identifier", formalDefinition="Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR." ) - protected Identifier identifier; - - /** - * A code specifying the state of the set of dispense events. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="in-progress | on-hold | completed | entered-in-error | stopped", formalDefinition="A code specifying the state of the set of dispense events." ) - protected Enumeration status; - - /** - * A link to a resource representing the person to whom the medication will be given. - */ - @Child(name = "patient", type = {Patient.class}, order=2, min=0, max=1) - @Description(shortDefinition="Who the dispense is for", formalDefinition="A link to a resource representing the person to whom the medication will be given." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (A link to a resource representing the person to whom the medication will be given.) - */ - protected Patient patientTarget; - - /** - * The individual responsible for dispensing the medication. - */ - @Child(name = "dispenser", type = {Practitioner.class}, order=3, min=0, max=1) - @Description(shortDefinition="Practitioner responsible for dispensing medication", formalDefinition="The individual responsible for dispensing the medication." ) - protected Reference dispenser; - - /** - * The actual object that is the target of the reference (The individual responsible for dispensing the medication.) - */ - protected Practitioner dispenserTarget; - - /** - * Indicates the medication order that is being dispensed against. - */ - @Child(name = "authorizingPrescription", type = {MedicationPrescription.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Medication order that authorizes the dispense", formalDefinition="Indicates the medication order that is being dispensed against." ) - protected List authorizingPrescription; - /** - * The actual objects that are the target of the reference (Indicates the medication order that is being dispensed against.) - */ - protected List authorizingPrescriptionTarget; - - - /** - * Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=5, min=0, max=1) - @Description(shortDefinition="Trial fill, partial fill, emergency fill, etc.", formalDefinition="Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc." ) - protected CodeableConcept type; - - /** - * The amount of medication that has been dispensed. Includes unit of measure. - */ - @Child(name = "quantity", type = {Quantity.class}, order=6, min=0, max=1) - @Description(shortDefinition="Amount dispensed", formalDefinition="The amount of medication that has been dispensed. Includes unit of measure." ) - protected Quantity quantity; - - /** - * The amount of medication expressed as a timing amount. - */ - @Child(name = "daysSupply", type = {Quantity.class}, order=7, min=0, max=1) - @Description(shortDefinition="Days Supply", formalDefinition="The amount of medication expressed as a timing amount." ) - protected Quantity daysSupply; - - /** - * Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. - */ - @Child(name = "medication", type = {Medication.class}, order=8, min=0, max=1) - @Description(shortDefinition="What medication was supplied", formalDefinition="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." ) - protected Reference medication; - - /** - * The actual object that is the target of the reference (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - protected Medication medicationTarget; - - /** - * The time when the dispensed product was packaged and reviewed. - */ - @Child(name = "whenPrepared", type = {DateTimeType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Dispense processing time", formalDefinition="The time when the dispensed product was packaged and reviewed." ) - protected DateTimeType whenPrepared; - - /** - * The time the dispensed product was provided to the patient or their representative. - */ - @Child(name = "whenHandedOver", type = {DateTimeType.class}, order=10, min=0, max=1) - @Description(shortDefinition="Handover time", formalDefinition="The time the dispensed product was provided to the patient or their representative." ) - protected DateTimeType whenHandedOver; - - /** - * Identification of the facility/location where the medication was shipped to, as part of the dispense event. - */ - @Child(name = "destination", type = {Location.class}, order=11, min=0, max=1) - @Description(shortDefinition="Where the medication was sent", formalDefinition="Identification of the facility/location where the medication was shipped to, as part of the dispense event." ) - protected Reference destination; - - /** - * The actual object that is the target of the reference (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) - */ - protected Location destinationTarget; - - /** - * Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional. - */ - @Child(name = "receiver", type = {Patient.class, Practitioner.class}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who collected the medication", formalDefinition="Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional." ) - protected List receiver; - /** - * The actual objects that are the target of the reference (Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional.) - */ - protected List receiverTarget; - - - /** - * Extra information about the dispense that could not be conveyed in the other attributes. - */ - @Child(name = "note", type = {StringType.class}, order=13, min=0, max=1) - @Description(shortDefinition="Information about the dispense", formalDefinition="Extra information about the dispense that could not be conveyed in the other attributes." ) - protected StringType note; - - /** - * Indicates how the medication is to be used by the patient. - */ - @Child(name = "dosageInstruction", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Medicine administration instructions to the patient/carer", formalDefinition="Indicates how the medication is to be used by the patient." ) - protected List dosageInstruction; - - /** - * Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why. - */ - @Child(name = "substitution", type = {}, order=15, min=0, max=1) - @Description(shortDefinition="Deals with substitution of one medicine for another", formalDefinition="Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why." ) - protected MedicationDispenseSubstitutionComponent substitution; - - private static final long serialVersionUID = -217601399L; - - /* - * Constructor - */ - public MedicationDispense() { - super(); - } - - /** - * @return {@link #identifier} (Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR.) - */ - public MedicationDispense setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #status} (A code specifying the state of the set of dispense events.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new MedicationDispenseStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (A code specifying the state of the set of dispense events.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public MedicationDispense setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return A code specifying the state of the set of dispense events. - */ - public MedicationDispenseStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value A code specifying the state of the set of dispense events. - */ - public MedicationDispense setStatus(MedicationDispenseStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new MedicationDispenseStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #patient} (A link to a resource representing the person to whom the medication will be given.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (A link to a resource representing the person to whom the medication will be given.) - */ - public MedicationDispense setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person to whom the medication will be given.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person to whom the medication will be given.) - */ - public MedicationDispense setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #dispenser} (The individual responsible for dispensing the medication.) - */ - public Reference getDispenser() { - if (this.dispenser == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.dispenser"); - else if (Configuration.doAutoCreate()) - this.dispenser = new Reference(); // cc - return this.dispenser; - } - - public boolean hasDispenser() { - return this.dispenser != null && !this.dispenser.isEmpty(); - } - - /** - * @param value {@link #dispenser} (The individual responsible for dispensing the medication.) - */ - public MedicationDispense setDispenser(Reference value) { - this.dispenser = value; - return this; - } - - /** - * @return {@link #dispenser} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The individual responsible for dispensing the medication.) - */ - public Practitioner getDispenserTarget() { - if (this.dispenserTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.dispenser"); - else if (Configuration.doAutoCreate()) - this.dispenserTarget = new Practitioner(); // aa - return this.dispenserTarget; - } - - /** - * @param value {@link #dispenser} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The individual responsible for dispensing the medication.) - */ - public MedicationDispense setDispenserTarget(Practitioner value) { - this.dispenserTarget = value; - return this; - } - - /** - * @return {@link #authorizingPrescription} (Indicates the medication order that is being dispensed against.) - */ - public List getAuthorizingPrescription() { - if (this.authorizingPrescription == null) - this.authorizingPrescription = new ArrayList(); - return this.authorizingPrescription; - } - - public boolean hasAuthorizingPrescription() { - if (this.authorizingPrescription == null) - return false; - for (Reference item : this.authorizingPrescription) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #authorizingPrescription} (Indicates the medication order that is being dispensed against.) - */ - // syntactic sugar - public Reference addAuthorizingPrescription() { //3 - Reference t = new Reference(); - if (this.authorizingPrescription == null) - this.authorizingPrescription = new ArrayList(); - this.authorizingPrescription.add(t); - return t; - } - - // syntactic sugar - public MedicationDispense addAuthorizingPrescription(Reference t) { //3 - if (t == null) - return this; - if (this.authorizingPrescription == null) - this.authorizingPrescription = new ArrayList(); - this.authorizingPrescription.add(t); - return this; - } - - /** - * @return {@link #authorizingPrescription} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Indicates the medication order that is being dispensed against.) - */ - public List getAuthorizingPrescriptionTarget() { - if (this.authorizingPrescriptionTarget == null) - this.authorizingPrescriptionTarget = new ArrayList(); - return this.authorizingPrescriptionTarget; - } - - // syntactic sugar - /** - * @return {@link #authorizingPrescription} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Indicates the medication order that is being dispensed against.) - */ - public MedicationPrescription addAuthorizingPrescriptionTarget() { - MedicationPrescription r = new MedicationPrescription(); - if (this.authorizingPrescriptionTarget == null) - this.authorizingPrescriptionTarget = new ArrayList(); - this.authorizingPrescriptionTarget.add(r); - return r; - } - - /** - * @return {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) - */ - public MedicationDispense setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #quantity} (The amount of medication that has been dispensed. Includes unit of measure.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of medication that has been dispensed. Includes unit of measure.) - */ - public MedicationDispense setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #daysSupply} (The amount of medication expressed as a timing amount.) - */ - public Quantity getDaysSupply() { - if (this.daysSupply == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.daysSupply"); - else if (Configuration.doAutoCreate()) - this.daysSupply = new Quantity(); // cc - return this.daysSupply; - } - - public boolean hasDaysSupply() { - return this.daysSupply != null && !this.daysSupply.isEmpty(); - } - - /** - * @param value {@link #daysSupply} (The amount of medication expressed as a timing amount.) - */ - public MedicationDispense setDaysSupply(Quantity value) { - this.daysSupply = value; - return this; - } - - /** - * @return {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Reference getMedication() { - if (this.medication == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.medication"); - else if (Configuration.doAutoCreate()) - this.medication = new Reference(); // cc - return this.medication; - } - - public boolean hasMedication() { - return this.medication != null && !this.medication.isEmpty(); - } - - /** - * @param value {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationDispense setMedication(Reference value) { - this.medication = value; - return this; - } - - /** - * @return {@link #medication} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Medication getMedicationTarget() { - if (this.medicationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.medication"); - else if (Configuration.doAutoCreate()) - this.medicationTarget = new Medication(); // aa - return this.medicationTarget; - } - - /** - * @param value {@link #medication} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationDispense setMedicationTarget(Medication value) { - this.medicationTarget = value; - return this; - } - - /** - * @return {@link #whenPrepared} (The time when the dispensed product was packaged and reviewed.). This is the underlying object with id, value and extensions. The accessor "getWhenPrepared" gives direct access to the value - */ - public DateTimeType getWhenPreparedElement() { - if (this.whenPrepared == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.whenPrepared"); - else if (Configuration.doAutoCreate()) - this.whenPrepared = new DateTimeType(); // bb - return this.whenPrepared; - } - - public boolean hasWhenPreparedElement() { - return this.whenPrepared != null && !this.whenPrepared.isEmpty(); - } - - public boolean hasWhenPrepared() { - return this.whenPrepared != null && !this.whenPrepared.isEmpty(); - } - - /** - * @param value {@link #whenPrepared} (The time when the dispensed product was packaged and reviewed.). This is the underlying object with id, value and extensions. The accessor "getWhenPrepared" gives direct access to the value - */ - public MedicationDispense setWhenPreparedElement(DateTimeType value) { - this.whenPrepared = value; - return this; - } - - /** - * @return The time when the dispensed product was packaged and reviewed. - */ - public Date getWhenPrepared() { - return this.whenPrepared == null ? null : this.whenPrepared.getValue(); - } - - /** - * @param value The time when the dispensed product was packaged and reviewed. - */ - public MedicationDispense setWhenPrepared(Date value) { - if (value == null) - this.whenPrepared = null; - else { - if (this.whenPrepared == null) - this.whenPrepared = new DateTimeType(); - this.whenPrepared.setValue(value); - } - return this; - } - - /** - * @return {@link #whenHandedOver} (The time the dispensed product was provided to the patient or their representative.). This is the underlying object with id, value and extensions. The accessor "getWhenHandedOver" gives direct access to the value - */ - public DateTimeType getWhenHandedOverElement() { - if (this.whenHandedOver == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.whenHandedOver"); - else if (Configuration.doAutoCreate()) - this.whenHandedOver = new DateTimeType(); // bb - return this.whenHandedOver; - } - - public boolean hasWhenHandedOverElement() { - return this.whenHandedOver != null && !this.whenHandedOver.isEmpty(); - } - - public boolean hasWhenHandedOver() { - return this.whenHandedOver != null && !this.whenHandedOver.isEmpty(); - } - - /** - * @param value {@link #whenHandedOver} (The time the dispensed product was provided to the patient or their representative.). This is the underlying object with id, value and extensions. The accessor "getWhenHandedOver" gives direct access to the value - */ - public MedicationDispense setWhenHandedOverElement(DateTimeType value) { - this.whenHandedOver = value; - return this; - } - - /** - * @return The time the dispensed product was provided to the patient or their representative. - */ - public Date getWhenHandedOver() { - return this.whenHandedOver == null ? null : this.whenHandedOver.getValue(); - } - - /** - * @param value The time the dispensed product was provided to the patient or their representative. - */ - public MedicationDispense setWhenHandedOver(Date value) { - if (value == null) - this.whenHandedOver = null; - else { - if (this.whenHandedOver == null) - this.whenHandedOver = new DateTimeType(); - this.whenHandedOver.setValue(value); - } - return this; - } - - /** - * @return {@link #destination} (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) - */ - public Reference getDestination() { - if (this.destination == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.destination"); - else if (Configuration.doAutoCreate()) - this.destination = new Reference(); // cc - return this.destination; - } - - public boolean hasDestination() { - return this.destination != null && !this.destination.isEmpty(); - } - - /** - * @param value {@link #destination} (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) - */ - public MedicationDispense setDestination(Reference value) { - this.destination = value; - return this; - } - - /** - * @return {@link #destination} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) - */ - public Location getDestinationTarget() { - if (this.destinationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.destination"); - else if (Configuration.doAutoCreate()) - this.destinationTarget = new Location(); // aa - return this.destinationTarget; - } - - /** - * @param value {@link #destination} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) - */ - public MedicationDispense setDestinationTarget(Location value) { - this.destinationTarget = value; - return this; - } - - /** - * @return {@link #receiver} (Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional.) - */ - public List getReceiver() { - if (this.receiver == null) - this.receiver = new ArrayList(); - return this.receiver; - } - - public boolean hasReceiver() { - if (this.receiver == null) - return false; - for (Reference item : this.receiver) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #receiver} (Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional.) - */ - // syntactic sugar - public Reference addReceiver() { //3 - Reference t = new Reference(); - if (this.receiver == null) - this.receiver = new ArrayList(); - this.receiver.add(t); - return t; - } - - // syntactic sugar - public MedicationDispense addReceiver(Reference t) { //3 - if (t == null) - return this; - if (this.receiver == null) - this.receiver = new ArrayList(); - this.receiver.add(t); - return this; - } - - /** - * @return {@link #receiver} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional.) - */ - public List getReceiverTarget() { - if (this.receiverTarget == null) - this.receiverTarget = new ArrayList(); - return this.receiverTarget; - } - - /** - * @return {@link #note} (Extra information about the dispense that could not be conveyed in the other attributes.). 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 MedicationDispense.note"); - else if (Configuration.doAutoCreate()) - this.note = new StringType(); // bb - 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} (Extra information about the dispense that could not be conveyed in the other attributes.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value - */ - public MedicationDispense setNoteElement(StringType value) { - this.note = value; - return this; - } - - /** - * @return Extra information about the dispense that could not be conveyed in the other attributes. - */ - public String getNote() { - return this.note == null ? null : this.note.getValue(); - } - - /** - * @param value Extra information about the dispense that could not be conveyed in the other attributes. - */ - public MedicationDispense setNote(String value) { - if (Utilities.noString(value)) - this.note = null; - else { - if (this.note == null) - this.note = new StringType(); - this.note.setValue(value); - } - return this; - } - - /** - * @return {@link #dosageInstruction} (Indicates how the medication is to be used by the patient.) - */ - public List getDosageInstruction() { - if (this.dosageInstruction == null) - this.dosageInstruction = new ArrayList(); - return this.dosageInstruction; - } - - public boolean hasDosageInstruction() { - if (this.dosageInstruction == null) - return false; - for (MedicationDispenseDosageInstructionComponent item : this.dosageInstruction) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dosageInstruction} (Indicates how the medication is to be used by the patient.) - */ - // syntactic sugar - public MedicationDispenseDosageInstructionComponent addDosageInstruction() { //3 - MedicationDispenseDosageInstructionComponent t = new MedicationDispenseDosageInstructionComponent(); - if (this.dosageInstruction == null) - this.dosageInstruction = new ArrayList(); - this.dosageInstruction.add(t); - return t; - } - - // syntactic sugar - public MedicationDispense addDosageInstruction(MedicationDispenseDosageInstructionComponent t) { //3 - if (t == null) - return this; - if (this.dosageInstruction == null) - this.dosageInstruction = new ArrayList(); - this.dosageInstruction.add(t); - return this; - } - - /** - * @return {@link #substitution} (Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why.) - */ - public MedicationDispenseSubstitutionComponent getSubstitution() { - if (this.substitution == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.substitution"); - else if (Configuration.doAutoCreate()) - this.substitution = new MedicationDispenseSubstitutionComponent(); // cc - return this.substitution; - } - - public boolean hasSubstitution() { - return this.substitution != null && !this.substitution.isEmpty(); - } - - /** - * @param value {@link #substitution} (Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why.) - */ - public MedicationDispense setSubstitution(MedicationDispenseSubstitutionComponent value) { - this.substitution = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "A code specifying the state of the set of dispense events.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person to whom the medication will be given.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("dispenser", "Reference(Practitioner)", "The individual responsible for dispensing the medication.", 0, java.lang.Integer.MAX_VALUE, dispenser)); - childrenList.add(new Property("authorizingPrescription", "Reference(MedicationPrescription)", "Indicates the medication order that is being dispensed against.", 0, java.lang.Integer.MAX_VALUE, authorizingPrescription)); - childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("quantity", "Quantity", "The amount of medication that has been dispensed. Includes unit of measure.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("daysSupply", "Quantity", "The amount of medication expressed as a timing amount.", 0, java.lang.Integer.MAX_VALUE, daysSupply)); - childrenList.add(new Property("medication", "Reference(Medication)", "Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); - childrenList.add(new Property("whenPrepared", "dateTime", "The time when the dispensed product was packaged and reviewed.", 0, java.lang.Integer.MAX_VALUE, whenPrepared)); - childrenList.add(new Property("whenHandedOver", "dateTime", "The time the dispensed product was provided to the patient or their representative.", 0, java.lang.Integer.MAX_VALUE, whenHandedOver)); - childrenList.add(new Property("destination", "Reference(Location)", "Identification of the facility/location where the medication was shipped to, as part of the dispense event.", 0, java.lang.Integer.MAX_VALUE, destination)); - childrenList.add(new Property("receiver", "Reference(Patient|Practitioner)", "Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional.", 0, java.lang.Integer.MAX_VALUE, receiver)); - childrenList.add(new Property("note", "string", "Extra information about the dispense that could not be conveyed in the other attributes.", 0, java.lang.Integer.MAX_VALUE, note)); - childrenList.add(new Property("dosageInstruction", "", "Indicates how the medication is to be used by the patient.", 0, java.lang.Integer.MAX_VALUE, dosageInstruction)); - childrenList.add(new Property("substitution", "", "Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why.", 0, java.lang.Integer.MAX_VALUE, substitution)); - } - - public MedicationDispense copy() { - MedicationDispense dst = new MedicationDispense(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.status = status == null ? null : status.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.dispenser = dispenser == null ? null : dispenser.copy(); - if (authorizingPrescription != null) { - dst.authorizingPrescription = new ArrayList(); - for (Reference i : authorizingPrescription) - dst.authorizingPrescription.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.daysSupply = daysSupply == null ? null : daysSupply.copy(); - dst.medication = medication == null ? null : medication.copy(); - dst.whenPrepared = whenPrepared == null ? null : whenPrepared.copy(); - dst.whenHandedOver = whenHandedOver == null ? null : whenHandedOver.copy(); - dst.destination = destination == null ? null : destination.copy(); - if (receiver != null) { - dst.receiver = new ArrayList(); - for (Reference i : receiver) - dst.receiver.add(i.copy()); - }; - dst.note = note == null ? null : note.copy(); - if (dosageInstruction != null) { - dst.dosageInstruction = new ArrayList(); - for (MedicationDispenseDosageInstructionComponent i : dosageInstruction) - dst.dosageInstruction.add(i.copy()); - }; - dst.substitution = substitution == null ? null : substitution.copy(); - return dst; - } - - protected MedicationDispense typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationDispense)) - return false; - MedicationDispense o = (MedicationDispense) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(patient, o.patient, true) - && compareDeep(dispenser, o.dispenser, true) && compareDeep(authorizingPrescription, o.authorizingPrescription, true) - && compareDeep(type, o.type, true) && compareDeep(quantity, o.quantity, true) && compareDeep(daysSupply, o.daysSupply, true) - && compareDeep(medication, o.medication, true) && compareDeep(whenPrepared, o.whenPrepared, true) - && compareDeep(whenHandedOver, o.whenHandedOver, true) && compareDeep(destination, o.destination, true) - && compareDeep(receiver, o.receiver, true) && compareDeep(note, o.note, true) && compareDeep(dosageInstruction, o.dosageInstruction, true) - && compareDeep(substitution, o.substitution, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationDispense)) - return false; - MedicationDispense o = (MedicationDispense) other; - return compareValues(status, o.status, true) && compareValues(whenPrepared, o.whenPrepared, true) && compareValues(whenHandedOver, o.whenHandedOver, true) - && compareValues(note, o.note, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (patient == null || patient.isEmpty()) && (dispenser == null || dispenser.isEmpty()) && (authorizingPrescription == null || authorizingPrescription.isEmpty()) - && (type == null || type.isEmpty()) && (quantity == null || quantity.isEmpty()) && (daysSupply == null || daysSupply.isEmpty()) - && (medication == null || medication.isEmpty()) && (whenPrepared == null || whenPrepared.isEmpty()) - && (whenHandedOver == null || whenHandedOver.isEmpty()) && (destination == null || destination.isEmpty()) - && (receiver == null || receiver.isEmpty()) && (note == null || note.isEmpty()) && (dosageInstruction == null || dosageInstruction.isEmpty()) - && (substitution == null || substitution.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.MedicationDispense; - } - - @SearchParamDefinition(name="medication", path="MedicationDispense.medication", description="Returns dispenses of this medicine", type="reference" ) - public static final String SP_MEDICATION = "medication"; - @SearchParamDefinition(name="patient", path="MedicationDispense.patient", description="The identity of a patient to list dispenses for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="receiver", path="MedicationDispense.receiver", description="Who collected the medication", type="reference" ) - public static final String SP_RECEIVER = "receiver"; - @SearchParamDefinition(name="status", path="MedicationDispense.status", description="Status of the dispense", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="prescription", path="MedicationDispense.authorizingPrescription", description="The identity of a prescription to list dispenses from", type="reference" ) - public static final String SP_PRESCRIPTION = "prescription"; - @SearchParamDefinition(name="responsibleparty", path="MedicationDispense.substitution.responsibleParty", description="Return all dispenses with the specified responsible party", type="reference" ) - public static final String SP_RESPONSIBLEPARTY = "responsibleparty"; - @SearchParamDefinition(name="dispenser", path="MedicationDispense.dispenser", description="Return all dispenses performed by a specific indiividual", type="reference" ) - public static final String SP_DISPENSER = "dispenser"; - @SearchParamDefinition(name="type", path="MedicationDispense.type", description="Return all dispenses of a specific type", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="identifier", path="MedicationDispense.identifier", description="Return dispenses with this external identity", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="whenprepared", path="MedicationDispense.whenPrepared", description="Date when medication prepared", type="date" ) - public static final String SP_WHENPREPARED = "whenprepared"; - @SearchParamDefinition(name="whenhandedover", path="MedicationDispense.whenHandedOver", description="Date when medication handed over to patient (outpatient setting), or supplied to ward or clinic (inpatient setting)", type="date" ) - public static final String SP_WHENHANDEDOVER = "whenhandedover"; - @SearchParamDefinition(name="destination", path="MedicationDispense.destination", description="Return dispenses that should be sent to a secific destination", type="reference" ) - public static final String SP_DESTINATION = "destination"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Dispensing a medication to a named patient. This includes a description of the supply provided and the instructions for administering the medication. + */ +@ResourceDef(name="MedicationDispense", profile="http://hl7.org/fhir/Profile/MedicationDispense") +public class MedicationDispense extends DomainResource { + + public enum MedicationDispenseStatus { + /** + * The dispense has started but has not yet completed. + */ + INPROGRESS, + /** + * Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called "suspended". + */ + ONHOLD, + /** + * All actions that are implied by the dispense have occurred. + */ + COMPLETED, + /** + * The dispense was entered in error and therefore nullified. + */ + ENTEREDINERROR, + /** + * Actions implied by the dispense have been permanently halted, before all of them occurred. + */ + STOPPED, + /** + * added to help the parsers + */ + NULL; + public static MedicationDispenseStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("on-hold".equals(codeString)) + return ONHOLD; + if ("completed".equals(codeString)) + return COMPLETED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + if ("stopped".equals(codeString)) + return STOPPED; + throw new Exception("Unknown MedicationDispenseStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INPROGRESS: return "in-progress"; + case ONHOLD: return "on-hold"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered-in-error"; + case STOPPED: return "stopped"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return ""; + case ONHOLD: return ""; + case COMPLETED: return ""; + case ENTEREDINERROR: return ""; + case STOPPED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "The dispense has started but has not yet completed."; + case ONHOLD: return "Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called 'suspended'."; + case COMPLETED: return "All actions that are implied by the dispense have occurred."; + case ENTEREDINERROR: return "The dispense was entered in error and therefore nullified."; + case STOPPED: return "Actions implied by the dispense have been permanently halted, before all of them occurred."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "In Progress"; + case ONHOLD: return "On Hold"; + case COMPLETED: return "Completed"; + case ENTEREDINERROR: return "Entered In Error"; + case STOPPED: return "Stopped"; + default: return "?"; + } + } + } + + public static class MedicationDispenseStatusEnumFactory implements EnumFactory { + public MedicationDispenseStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return MedicationDispenseStatus.INPROGRESS; + if ("on-hold".equals(codeString)) + return MedicationDispenseStatus.ONHOLD; + if ("completed".equals(codeString)) + return MedicationDispenseStatus.COMPLETED; + if ("entered-in-error".equals(codeString)) + return MedicationDispenseStatus.ENTEREDINERROR; + if ("stopped".equals(codeString)) + return MedicationDispenseStatus.STOPPED; + throw new IllegalArgumentException("Unknown MedicationDispenseStatus code '"+codeString+"'"); + } + public String toCode(MedicationDispenseStatus code) { + if (code == MedicationDispenseStatus.INPROGRESS) + return "in-progress"; + if (code == MedicationDispenseStatus.ONHOLD) + return "on-hold"; + if (code == MedicationDispenseStatus.COMPLETED) + return "completed"; + if (code == MedicationDispenseStatus.ENTEREDINERROR) + return "entered-in-error"; + if (code == MedicationDispenseStatus.STOPPED) + return "stopped"; + return "?"; + } + } + + @Block() + public static class MedicationDispenseDosageInstructionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + */ + @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Dosage Instructions", formalDefinition="Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication." ) + protected StringType text; + + /** + * Additional instructions such as "Swallow with plenty of water" which may or may not be coded. + */ + @Child(name = "additionalInstructions", type = {CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="E.g. 'Take with food'", formalDefinition="Additional instructions such as 'Swallow with plenty of water' which may or may not be coded." ) + protected CodeableConcept additionalInstructions; + + /** + * The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". + */ + @Child(name = "schedule", type = {DateTimeType.class, Period.class, Timing.class}, order=3, min=0, max=1) + @Description(shortDefinition="When medication should be administered", formalDefinition="The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'." ) + protected Type schedule; + + /** + * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication. + */ + @Child(name = "asNeeded", type = {BooleanType.class, CodeableConcept.class}, order=4, min=0, max=1) + @Description(shortDefinition="Take 'as needed' f(or x)", formalDefinition="If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication." ) + protected Type asNeeded; + + /** + * A coded specification of the anatomic site where the medication first enters the body. + */ + @Child(name = "site", type = {CodeableConcept.class}, order=5, min=0, max=1) + @Description(shortDefinition="Body site to administer to", formalDefinition="A coded specification of the anatomic site where the medication first enters the body." ) + protected CodeableConcept site; + + /** + * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject. + */ + @Child(name = "route", type = {CodeableConcept.class}, order=6, min=0, max=1) + @Description(shortDefinition="How drug should enter body", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject." ) + protected CodeableConcept route; + + /** + * A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. Terminologies used often pre-coordinate this term with the route and or form of administration. + */ + @Child(name = "method", type = {CodeableConcept.class}, order=7, min=0, max=1) + @Description(shortDefinition="Technique for administering medication", formalDefinition="A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\r\rTerminologies used often pre-coordinate this term with the route and or form of administration." ) + protected CodeableConcept method; + + /** + * The amount of therapeutic or other substance given at one administration event. + */ + @Child(name = "dose", type = {Range.class, Quantity.class}, order=8, min=0, max=1) + @Description(shortDefinition="Amount of medication per dose", formalDefinition="The amount of therapeutic or other substance given at one administration event." ) + protected Type dose; + + /** + * Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. + */ + @Child(name = "rate", type = {Ratio.class}, order=9, min=0, max=1) + @Description(shortDefinition="Amount of medication per unit of time", formalDefinition="Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours." ) + protected Ratio rate; + + /** + * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours. + */ + @Child(name = "maxDosePerPeriod", type = {Ratio.class}, order=10, min=0, max=1) + @Description(shortDefinition="Upper limit on medication per unit of time", formalDefinition="The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours." ) + protected Ratio maxDosePerPeriod; + + private static final long serialVersionUID = -1409331091L; + + /* + * Constructor + */ + public MedicationDispenseDosageInstructionComponent() { + super(); + } + + /** + * @return {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public MedicationDispenseDosageInstructionComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + */ + public MedicationDispenseDosageInstructionComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) + */ + public CodeableConcept getAdditionalInstructions() { + if (this.additionalInstructions == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.additionalInstructions"); + else if (Configuration.doAutoCreate()) + this.additionalInstructions = new CodeableConcept(); // cc + return this.additionalInstructions; + } + + public boolean hasAdditionalInstructions() { + return this.additionalInstructions != null && !this.additionalInstructions.isEmpty(); + } + + /** + * @param value {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) + */ + public MedicationDispenseDosageInstructionComponent setAdditionalInstructions(CodeableConcept value) { + this.additionalInstructions = value; + return this; + } + + /** + * @return {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Type getSchedule() { + return this.schedule; + } + + /** + * @return {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public DateTimeType getScheduleDateTimeType() throws Exception { + if (!(this.schedule instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.schedule.getClass().getName()+" was encountered"); + return (DateTimeType) this.schedule; + } + + /** + * @return {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Period getSchedulePeriod() throws Exception { + if (!(this.schedule instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.schedule.getClass().getName()+" was encountered"); + return (Period) this.schedule; + } + + /** + * @return {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Timing getScheduleTiming() throws Exception { + if (!(this.schedule instanceof Timing)) + throw new Exception("Type mismatch: the type Timing was expected, but "+this.schedule.getClass().getName()+" was encountered"); + return (Timing) this.schedule; + } + + public boolean hasSchedule() { + return this.schedule != null && !this.schedule.isEmpty(); + } + + /** + * @param value {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public MedicationDispenseDosageInstructionComponent setSchedule(Type value) { + this.schedule = value; + return this; + } + + /** + * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public Type getAsNeeded() { + return this.asNeeded; + } + + /** + * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public BooleanType getAsNeededBooleanType() throws Exception { + if (!(this.asNeeded instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (BooleanType) this.asNeeded; + } + + /** + * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public CodeableConcept getAsNeededCodeableConcept() throws Exception { + if (!(this.asNeeded instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (CodeableConcept) this.asNeeded; + } + + public boolean hasAsNeeded() { + return this.asNeeded != null && !this.asNeeded.isEmpty(); + } + + /** + * @param value {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public MedicationDispenseDosageInstructionComponent setAsNeeded(Type value) { + this.asNeeded = value; + return this; + } + + /** + * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) + */ + public CodeableConcept getSite() { + if (this.site == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.site"); + else if (Configuration.doAutoCreate()) + this.site = new CodeableConcept(); // cc + return this.site; + } + + public boolean hasSite() { + return this.site != null && !this.site.isEmpty(); + } + + /** + * @param value {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) + */ + public MedicationDispenseDosageInstructionComponent setSite(CodeableConcept value) { + this.site = value; + return this; + } + + /** + * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) + */ + public CodeableConcept getRoute() { + if (this.route == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.route"); + else if (Configuration.doAutoCreate()) + this.route = new CodeableConcept(); // cc + return this.route; + } + + public boolean hasRoute() { + return this.route != null && !this.route.isEmpty(); + } + + /** + * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) + */ + public MedicationDispenseDosageInstructionComponent setRoute(CodeableConcept value) { + this.route = value; + return this; + } + + /** + * @return {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. Terminologies used often pre-coordinate this term with the route and or form of administration.) + */ + public CodeableConcept getMethod() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.method"); + else if (Configuration.doAutoCreate()) + this.method = new CodeableConcept(); // cc + return this.method; + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** + * @param value {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. Terminologies used often pre-coordinate this term with the route and or form of administration.) + */ + public MedicationDispenseDosageInstructionComponent setMethod(CodeableConcept value) { + this.method = value; + return this; + } + + /** + * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) + */ + public Type getDose() { + return this.dose; + } + + /** + * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) + */ + public Range getDoseRange() throws Exception { + if (!(this.dose instanceof Range)) + throw new Exception("Type mismatch: the type Range was expected, but "+this.dose.getClass().getName()+" was encountered"); + return (Range) this.dose; + } + + /** + * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) + */ + public Quantity getDoseQuantity() throws Exception { + if (!(this.dose instanceof Quantity)) + throw new Exception("Type mismatch: the type Quantity was expected, but "+this.dose.getClass().getName()+" was encountered"); + return (Quantity) this.dose; + } + + public boolean hasDose() { + return this.dose != null && !this.dose.isEmpty(); + } + + /** + * @param value {@link #dose} (The amount of therapeutic or other substance given at one administration event.) + */ + public MedicationDispenseDosageInstructionComponent setDose(Type value) { + this.dose = value; + return this; + } + + /** + * @return {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) + */ + public Ratio getRate() { + if (this.rate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.rate"); + else if (Configuration.doAutoCreate()) + this.rate = new Ratio(); // cc + return this.rate; + } + + public boolean hasRate() { + return this.rate != null && !this.rate.isEmpty(); + } + + /** + * @param value {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) + */ + public MedicationDispenseDosageInstructionComponent setRate(Ratio value) { + this.rate = value; + return this; + } + + /** + * @return {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours.) + */ + public Ratio getMaxDosePerPeriod() { + if (this.maxDosePerPeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.maxDosePerPeriod"); + else if (Configuration.doAutoCreate()) + this.maxDosePerPeriod = new Ratio(); // cc + return this.maxDosePerPeriod; + } + + public boolean hasMaxDosePerPeriod() { + return this.maxDosePerPeriod != null && !this.maxDosePerPeriod.isEmpty(); + } + + /** + * @param value {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours.) + */ + public MedicationDispenseDosageInstructionComponent setMaxDosePerPeriod(Ratio value) { + this.maxDosePerPeriod = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("text", "string", "Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("additionalInstructions", "CodeableConcept", "Additional instructions such as 'Swallow with plenty of water' which may or may not be coded.", 0, java.lang.Integer.MAX_VALUE, additionalInstructions)); + childrenList.add(new Property("schedule[x]", "dateTime|Period|Timing", "The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'.", 0, java.lang.Integer.MAX_VALUE, schedule)); + childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); + childrenList.add(new Property("site", "CodeableConcept", "A coded specification of the anatomic site where the medication first enters the body.", 0, java.lang.Integer.MAX_VALUE, site)); + childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.", 0, java.lang.Integer.MAX_VALUE, route)); + childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\r\rTerminologies used often pre-coordinate this term with the route and or form of administration.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("dose[x]", "Range|Quantity", "The amount of therapeutic or other substance given at one administration event.", 0, java.lang.Integer.MAX_VALUE, dose)); + childrenList.add(new Property("rate", "Ratio", "Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.", 0, java.lang.Integer.MAX_VALUE, rate)); + childrenList.add(new Property("maxDosePerPeriod", "Ratio", "The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxDosePerPeriod)); + } + + public MedicationDispenseDosageInstructionComponent copy() { + MedicationDispenseDosageInstructionComponent dst = new MedicationDispenseDosageInstructionComponent(); + copyValues(dst); + dst.text = text == null ? null : text.copy(); + dst.additionalInstructions = additionalInstructions == null ? null : additionalInstructions.copy(); + dst.schedule = schedule == null ? null : schedule.copy(); + dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); + dst.site = site == null ? null : site.copy(); + dst.route = route == null ? null : route.copy(); + dst.method = method == null ? null : method.copy(); + dst.dose = dose == null ? null : dose.copy(); + dst.rate = rate == null ? null : rate.copy(); + dst.maxDosePerPeriod = maxDosePerPeriod == null ? null : maxDosePerPeriod.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationDispenseDosageInstructionComponent)) + return false; + MedicationDispenseDosageInstructionComponent o = (MedicationDispenseDosageInstructionComponent) other; + return compareDeep(text, o.text, true) && compareDeep(additionalInstructions, o.additionalInstructions, true) + && compareDeep(schedule, o.schedule, true) && compareDeep(asNeeded, o.asNeeded, true) && compareDeep(site, o.site, true) + && compareDeep(route, o.route, true) && compareDeep(method, o.method, true) && compareDeep(dose, o.dose, true) + && compareDeep(rate, o.rate, true) && compareDeep(maxDosePerPeriod, o.maxDosePerPeriod, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationDispenseDosageInstructionComponent)) + return false; + MedicationDispenseDosageInstructionComponent o = (MedicationDispenseDosageInstructionComponent) other; + return compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (text == null || text.isEmpty()) && (additionalInstructions == null || additionalInstructions.isEmpty()) + && (schedule == null || schedule.isEmpty()) && (asNeeded == null || asNeeded.isEmpty()) && (site == null || site.isEmpty()) + && (route == null || route.isEmpty()) && (method == null || method.isEmpty()) && (dose == null || dose.isEmpty()) + && (rate == null || rate.isEmpty()) && (maxDosePerPeriod == null || maxDosePerPeriod.isEmpty()) + ; + } + + } + + @Block() + public static class MedicationDispenseSubstitutionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A code signifying whether a different drug was dispensed from what was prescribed. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Type of substitiution", formalDefinition="A code signifying whether a different drug was dispensed from what was prescribed." ) + protected CodeableConcept type; + + /** + * Indicates the reason for the substitution of (or lack of substitution) from what was prescribed. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Why was substitution made", formalDefinition="Indicates the reason for the substitution of (or lack of substitution) from what was prescribed." ) + protected List reason; + + /** + * The person or organization that has primary responsibility for the substitution. + */ + @Child(name = "responsibleParty", type = {Practitioner.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who is responsible for the substitution", formalDefinition="The person or organization that has primary responsibility for the substitution." ) + protected List responsibleParty; + /** + * The actual objects that are the target of the reference (The person or organization that has primary responsibility for the substitution.) + */ + protected List responsiblePartyTarget; + + + private static final long serialVersionUID = 1218245830L; + + /* + * Constructor + */ + public MedicationDispenseSubstitutionComponent() { + super(); + } + + /* + * Constructor + */ + public MedicationDispenseSubstitutionComponent(CodeableConcept type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (A code signifying whether a different drug was dispensed from what was prescribed.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseSubstitutionComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (A code signifying whether a different drug was dispensed from what was prescribed.) + */ + public MedicationDispenseSubstitutionComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #reason} (Indicates the reason for the substitution of (or lack of substitution) from what was prescribed.) + */ + public List getReason() { + if (this.reason == null) + this.reason = new ArrayList(); + return this.reason; + } + + public boolean hasReason() { + if (this.reason == null) + return false; + for (CodeableConcept item : this.reason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reason} (Indicates the reason for the substitution of (or lack of substitution) from what was prescribed.) + */ + // syntactic sugar + public CodeableConcept addReason() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return t; + } + + // syntactic sugar + public MedicationDispenseSubstitutionComponent addReason(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return this; + } + + /** + * @return {@link #responsibleParty} (The person or organization that has primary responsibility for the substitution.) + */ + public List getResponsibleParty() { + if (this.responsibleParty == null) + this.responsibleParty = new ArrayList(); + return this.responsibleParty; + } + + public boolean hasResponsibleParty() { + if (this.responsibleParty == null) + return false; + for (Reference item : this.responsibleParty) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #responsibleParty} (The person or organization that has primary responsibility for the substitution.) + */ + // syntactic sugar + public Reference addResponsibleParty() { //3 + Reference t = new Reference(); + if (this.responsibleParty == null) + this.responsibleParty = new ArrayList(); + this.responsibleParty.add(t); + return t; + } + + // syntactic sugar + public MedicationDispenseSubstitutionComponent addResponsibleParty(Reference t) { //3 + if (t == null) + return this; + if (this.responsibleParty == null) + this.responsibleParty = new ArrayList(); + this.responsibleParty.add(t); + return this; + } + + /** + * @return {@link #responsibleParty} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The person or organization that has primary responsibility for the substitution.) + */ + public List getResponsiblePartyTarget() { + if (this.responsiblePartyTarget == null) + this.responsiblePartyTarget = new ArrayList(); + return this.responsiblePartyTarget; + } + + // syntactic sugar + /** + * @return {@link #responsibleParty} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The person or organization that has primary responsibility for the substitution.) + */ + public Practitioner addResponsiblePartyTarget() { + Practitioner r = new Practitioner(); + if (this.responsiblePartyTarget == null) + this.responsiblePartyTarget = new ArrayList(); + this.responsiblePartyTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "A code signifying whether a different drug was dispensed from what was prescribed.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("reason", "CodeableConcept", "Indicates the reason for the substitution of (or lack of substitution) from what was prescribed.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("responsibleParty", "Reference(Practitioner)", "The person or organization that has primary responsibility for the substitution.", 0, java.lang.Integer.MAX_VALUE, responsibleParty)); + } + + public MedicationDispenseSubstitutionComponent copy() { + MedicationDispenseSubstitutionComponent dst = new MedicationDispenseSubstitutionComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + if (reason != null) { + dst.reason = new ArrayList(); + for (CodeableConcept i : reason) + dst.reason.add(i.copy()); + }; + if (responsibleParty != null) { + dst.responsibleParty = new ArrayList(); + for (Reference i : responsibleParty) + dst.responsibleParty.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationDispenseSubstitutionComponent)) + return false; + MedicationDispenseSubstitutionComponent o = (MedicationDispenseSubstitutionComponent) other; + return compareDeep(type, o.type, true) && compareDeep(reason, o.reason, true) && compareDeep(responsibleParty, o.responsibleParty, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationDispenseSubstitutionComponent)) + return false; + MedicationDispenseSubstitutionComponent o = (MedicationDispenseSubstitutionComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (reason == null || reason.isEmpty()) + && (responsibleParty == null || responsibleParty.isEmpty()); + } + + } + + /** + * Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1) + @Description(shortDefinition="External identifier", formalDefinition="Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR." ) + protected Identifier identifier; + + /** + * A code specifying the state of the set of dispense events. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="in-progress | on-hold | completed | entered-in-error | stopped", formalDefinition="A code specifying the state of the set of dispense events." ) + protected Enumeration status; + + /** + * A link to a resource representing the person to whom the medication will be given. + */ + @Child(name = "patient", type = {Patient.class}, order=2, min=0, max=1) + @Description(shortDefinition="Who the dispense is for", formalDefinition="A link to a resource representing the person to whom the medication will be given." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (A link to a resource representing the person to whom the medication will be given.) + */ + protected Patient patientTarget; + + /** + * The individual responsible for dispensing the medication. + */ + @Child(name = "dispenser", type = {Practitioner.class}, order=3, min=0, max=1) + @Description(shortDefinition="Practitioner responsible for dispensing medication", formalDefinition="The individual responsible for dispensing the medication." ) + protected Reference dispenser; + + /** + * The actual object that is the target of the reference (The individual responsible for dispensing the medication.) + */ + protected Practitioner dispenserTarget; + + /** + * Indicates the medication order that is being dispensed against. + */ + @Child(name = "authorizingPrescription", type = {MedicationPrescription.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Medication order that authorizes the dispense", formalDefinition="Indicates the medication order that is being dispensed against." ) + protected List authorizingPrescription; + /** + * The actual objects that are the target of the reference (Indicates the medication order that is being dispensed against.) + */ + protected List authorizingPrescriptionTarget; + + + /** + * Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=5, min=0, max=1) + @Description(shortDefinition="Trial fill, partial fill, emergency fill, etc.", formalDefinition="Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc." ) + protected CodeableConcept type; + + /** + * The amount of medication that has been dispensed. Includes unit of measure. + */ + @Child(name = "quantity", type = {Quantity.class}, order=6, min=0, max=1) + @Description(shortDefinition="Amount dispensed", formalDefinition="The amount of medication that has been dispensed. Includes unit of measure." ) + protected Quantity quantity; + + /** + * The amount of medication expressed as a timing amount. + */ + @Child(name = "daysSupply", type = {Quantity.class}, order=7, min=0, max=1) + @Description(shortDefinition="Days Supply", formalDefinition="The amount of medication expressed as a timing amount." ) + protected Quantity daysSupply; + + /** + * Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. + */ + @Child(name = "medication", type = {CodeableConcept.class, Medication.class}, order=8, min=1, max=1) + @Description(shortDefinition="What medication was supplied", formalDefinition="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." ) + protected Type medication; + + /** + * The time when the dispensed product was packaged and reviewed. + */ + @Child(name = "whenPrepared", type = {DateTimeType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Dispense processing time", formalDefinition="The time when the dispensed product was packaged and reviewed." ) + protected DateTimeType whenPrepared; + + /** + * The time the dispensed product was provided to the patient or their representative. + */ + @Child(name = "whenHandedOver", type = {DateTimeType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Handover time", formalDefinition="The time the dispensed product was provided to the patient or their representative." ) + protected DateTimeType whenHandedOver; + + /** + * Identification of the facility/location where the medication was shipped to, as part of the dispense event. + */ + @Child(name = "destination", type = {Location.class}, order=11, min=0, max=1) + @Description(shortDefinition="Where the medication was sent", formalDefinition="Identification of the facility/location where the medication was shipped to, as part of the dispense event." ) + protected Reference destination; + + /** + * The actual object that is the target of the reference (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) + */ + protected Location destinationTarget; + + /** + * Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional. + */ + @Child(name = "receiver", type = {Patient.class, Practitioner.class}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who collected the medication", formalDefinition="Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional." ) + protected List receiver; + /** + * The actual objects that are the target of the reference (Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional.) + */ + protected List receiverTarget; + + + /** + * Extra information about the dispense that could not be conveyed in the other attributes. + */ + @Child(name = "note", type = {StringType.class}, order=13, min=0, max=1) + @Description(shortDefinition="Information about the dispense", formalDefinition="Extra information about the dispense that could not be conveyed in the other attributes." ) + protected StringType note; + + /** + * Indicates how the medication is to be used by the patient. + */ + @Child(name = "dosageInstruction", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Medicine administration instructions to the patient/carer", formalDefinition="Indicates how the medication is to be used by the patient." ) + protected List dosageInstruction; + + /** + * Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why. + */ + @Child(name = "substitution", type = {}, order=15, min=0, max=1) + @Description(shortDefinition="Deals with substitution of one medicine for another", formalDefinition="Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why." ) + protected MedicationDispenseSubstitutionComponent substitution; + + private static final long serialVersionUID = -1930133151L; + + /* + * Constructor + */ + public MedicationDispense() { + super(); + } + + /* + * Constructor + */ + public MedicationDispense(Type medication) { + super(); + this.medication = medication; + } + + /** + * @return {@link #identifier} (Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR.) + */ + public MedicationDispense setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #status} (A code specifying the state of the set of dispense events.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new MedicationDispenseStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (A code specifying the state of the set of dispense events.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public MedicationDispense setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return A code specifying the state of the set of dispense events. + */ + public MedicationDispenseStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value A code specifying the state of the set of dispense events. + */ + public MedicationDispense setStatus(MedicationDispenseStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new MedicationDispenseStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #patient} (A link to a resource representing the person to whom the medication will be given.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (A link to a resource representing the person to whom the medication will be given.) + */ + public MedicationDispense setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person to whom the medication will be given.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person to whom the medication will be given.) + */ + public MedicationDispense setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #dispenser} (The individual responsible for dispensing the medication.) + */ + public Reference getDispenser() { + if (this.dispenser == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.dispenser"); + else if (Configuration.doAutoCreate()) + this.dispenser = new Reference(); // cc + return this.dispenser; + } + + public boolean hasDispenser() { + return this.dispenser != null && !this.dispenser.isEmpty(); + } + + /** + * @param value {@link #dispenser} (The individual responsible for dispensing the medication.) + */ + public MedicationDispense setDispenser(Reference value) { + this.dispenser = value; + return this; + } + + /** + * @return {@link #dispenser} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The individual responsible for dispensing the medication.) + */ + public Practitioner getDispenserTarget() { + if (this.dispenserTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.dispenser"); + else if (Configuration.doAutoCreate()) + this.dispenserTarget = new Practitioner(); // aa + return this.dispenserTarget; + } + + /** + * @param value {@link #dispenser} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The individual responsible for dispensing the medication.) + */ + public MedicationDispense setDispenserTarget(Practitioner value) { + this.dispenserTarget = value; + return this; + } + + /** + * @return {@link #authorizingPrescription} (Indicates the medication order that is being dispensed against.) + */ + public List getAuthorizingPrescription() { + if (this.authorizingPrescription == null) + this.authorizingPrescription = new ArrayList(); + return this.authorizingPrescription; + } + + public boolean hasAuthorizingPrescription() { + if (this.authorizingPrescription == null) + return false; + for (Reference item : this.authorizingPrescription) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #authorizingPrescription} (Indicates the medication order that is being dispensed against.) + */ + // syntactic sugar + public Reference addAuthorizingPrescription() { //3 + Reference t = new Reference(); + if (this.authorizingPrescription == null) + this.authorizingPrescription = new ArrayList(); + this.authorizingPrescription.add(t); + return t; + } + + // syntactic sugar + public MedicationDispense addAuthorizingPrescription(Reference t) { //3 + if (t == null) + return this; + if (this.authorizingPrescription == null) + this.authorizingPrescription = new ArrayList(); + this.authorizingPrescription.add(t); + return this; + } + + /** + * @return {@link #authorizingPrescription} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Indicates the medication order that is being dispensed against.) + */ + public List getAuthorizingPrescriptionTarget() { + if (this.authorizingPrescriptionTarget == null) + this.authorizingPrescriptionTarget = new ArrayList(); + return this.authorizingPrescriptionTarget; + } + + // syntactic sugar + /** + * @return {@link #authorizingPrescription} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Indicates the medication order that is being dispensed against.) + */ + public MedicationPrescription addAuthorizingPrescriptionTarget() { + MedicationPrescription r = new MedicationPrescription(); + if (this.authorizingPrescriptionTarget == null) + this.authorizingPrescriptionTarget = new ArrayList(); + this.authorizingPrescriptionTarget.add(r); + return r; + } + + /** + * @return {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) + */ + public MedicationDispense setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #quantity} (The amount of medication that has been dispensed. Includes unit of measure.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of medication that has been dispensed. Includes unit of measure.) + */ + public MedicationDispense setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #daysSupply} (The amount of medication expressed as a timing amount.) + */ + public Quantity getDaysSupply() { + if (this.daysSupply == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.daysSupply"); + else if (Configuration.doAutoCreate()) + this.daysSupply = new Quantity(); // cc + return this.daysSupply; + } + + public boolean hasDaysSupply() { + return this.daysSupply != null && !this.daysSupply.isEmpty(); + } + + /** + * @param value {@link #daysSupply} (The amount of medication expressed as a timing amount.) + */ + public MedicationDispense setDaysSupply(Quantity value) { + this.daysSupply = value; + return this; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Type getMedication() { + return this.medication; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public CodeableConcept getMedicationCodeableConcept() throws Exception { + if (!(this.medication instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.medication.getClass().getName()+" was encountered"); + return (CodeableConcept) this.medication; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Reference getMedicationReference() throws Exception { + if (!(this.medication instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.medication.getClass().getName()+" was encountered"); + return (Reference) this.medication; + } + + public boolean hasMedication() { + return this.medication != null && !this.medication.isEmpty(); + } + + /** + * @param value {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public MedicationDispense setMedication(Type value) { + this.medication = value; + return this; + } + + /** + * @return {@link #whenPrepared} (The time when the dispensed product was packaged and reviewed.). This is the underlying object with id, value and extensions. The accessor "getWhenPrepared" gives direct access to the value + */ + public DateTimeType getWhenPreparedElement() { + if (this.whenPrepared == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.whenPrepared"); + else if (Configuration.doAutoCreate()) + this.whenPrepared = new DateTimeType(); // bb + return this.whenPrepared; + } + + public boolean hasWhenPreparedElement() { + return this.whenPrepared != null && !this.whenPrepared.isEmpty(); + } + + public boolean hasWhenPrepared() { + return this.whenPrepared != null && !this.whenPrepared.isEmpty(); + } + + /** + * @param value {@link #whenPrepared} (The time when the dispensed product was packaged and reviewed.). This is the underlying object with id, value and extensions. The accessor "getWhenPrepared" gives direct access to the value + */ + public MedicationDispense setWhenPreparedElement(DateTimeType value) { + this.whenPrepared = value; + return this; + } + + /** + * @return The time when the dispensed product was packaged and reviewed. + */ + public Date getWhenPrepared() { + return this.whenPrepared == null ? null : this.whenPrepared.getValue(); + } + + /** + * @param value The time when the dispensed product was packaged and reviewed. + */ + public MedicationDispense setWhenPrepared(Date value) { + if (value == null) + this.whenPrepared = null; + else { + if (this.whenPrepared == null) + this.whenPrepared = new DateTimeType(); + this.whenPrepared.setValue(value); + } + return this; + } + + /** + * @return {@link #whenHandedOver} (The time the dispensed product was provided to the patient or their representative.). This is the underlying object with id, value and extensions. The accessor "getWhenHandedOver" gives direct access to the value + */ + public DateTimeType getWhenHandedOverElement() { + if (this.whenHandedOver == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.whenHandedOver"); + else if (Configuration.doAutoCreate()) + this.whenHandedOver = new DateTimeType(); // bb + return this.whenHandedOver; + } + + public boolean hasWhenHandedOverElement() { + return this.whenHandedOver != null && !this.whenHandedOver.isEmpty(); + } + + public boolean hasWhenHandedOver() { + return this.whenHandedOver != null && !this.whenHandedOver.isEmpty(); + } + + /** + * @param value {@link #whenHandedOver} (The time the dispensed product was provided to the patient or their representative.). This is the underlying object with id, value and extensions. The accessor "getWhenHandedOver" gives direct access to the value + */ + public MedicationDispense setWhenHandedOverElement(DateTimeType value) { + this.whenHandedOver = value; + return this; + } + + /** + * @return The time the dispensed product was provided to the patient or their representative. + */ + public Date getWhenHandedOver() { + return this.whenHandedOver == null ? null : this.whenHandedOver.getValue(); + } + + /** + * @param value The time the dispensed product was provided to the patient or their representative. + */ + public MedicationDispense setWhenHandedOver(Date value) { + if (value == null) + this.whenHandedOver = null; + else { + if (this.whenHandedOver == null) + this.whenHandedOver = new DateTimeType(); + this.whenHandedOver.setValue(value); + } + return this; + } + + /** + * @return {@link #destination} (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) + */ + public Reference getDestination() { + if (this.destination == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.destination"); + else if (Configuration.doAutoCreate()) + this.destination = new Reference(); // cc + return this.destination; + } + + public boolean hasDestination() { + return this.destination != null && !this.destination.isEmpty(); + } + + /** + * @param value {@link #destination} (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) + */ + public MedicationDispense setDestination(Reference value) { + this.destination = value; + return this; + } + + /** + * @return {@link #destination} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) + */ + public Location getDestinationTarget() { + if (this.destinationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.destination"); + else if (Configuration.doAutoCreate()) + this.destinationTarget = new Location(); // aa + return this.destinationTarget; + } + + /** + * @param value {@link #destination} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) + */ + public MedicationDispense setDestinationTarget(Location value) { + this.destinationTarget = value; + return this; + } + + /** + * @return {@link #receiver} (Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional.) + */ + public List getReceiver() { + if (this.receiver == null) + this.receiver = new ArrayList(); + return this.receiver; + } + + public boolean hasReceiver() { + if (this.receiver == null) + return false; + for (Reference item : this.receiver) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #receiver} (Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional.) + */ + // syntactic sugar + public Reference addReceiver() { //3 + Reference t = new Reference(); + if (this.receiver == null) + this.receiver = new ArrayList(); + this.receiver.add(t); + return t; + } + + // syntactic sugar + public MedicationDispense addReceiver(Reference t) { //3 + if (t == null) + return this; + if (this.receiver == null) + this.receiver = new ArrayList(); + this.receiver.add(t); + return this; + } + + /** + * @return {@link #receiver} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional.) + */ + public List getReceiverTarget() { + if (this.receiverTarget == null) + this.receiverTarget = new ArrayList(); + return this.receiverTarget; + } + + /** + * @return {@link #note} (Extra information about the dispense that could not be conveyed in the other attributes.). 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 MedicationDispense.note"); + else if (Configuration.doAutoCreate()) + this.note = new StringType(); // bb + 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} (Extra information about the dispense that could not be conveyed in the other attributes.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value + */ + public MedicationDispense setNoteElement(StringType value) { + this.note = value; + return this; + } + + /** + * @return Extra information about the dispense that could not be conveyed in the other attributes. + */ + public String getNote() { + return this.note == null ? null : this.note.getValue(); + } + + /** + * @param value Extra information about the dispense that could not be conveyed in the other attributes. + */ + public MedicationDispense setNote(String value) { + if (Utilities.noString(value)) + this.note = null; + else { + if (this.note == null) + this.note = new StringType(); + this.note.setValue(value); + } + return this; + } + + /** + * @return {@link #dosageInstruction} (Indicates how the medication is to be used by the patient.) + */ + public List getDosageInstruction() { + if (this.dosageInstruction == null) + this.dosageInstruction = new ArrayList(); + return this.dosageInstruction; + } + + public boolean hasDosageInstruction() { + if (this.dosageInstruction == null) + return false; + for (MedicationDispenseDosageInstructionComponent item : this.dosageInstruction) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dosageInstruction} (Indicates how the medication is to be used by the patient.) + */ + // syntactic sugar + public MedicationDispenseDosageInstructionComponent addDosageInstruction() { //3 + MedicationDispenseDosageInstructionComponent t = new MedicationDispenseDosageInstructionComponent(); + if (this.dosageInstruction == null) + this.dosageInstruction = new ArrayList(); + this.dosageInstruction.add(t); + return t; + } + + // syntactic sugar + public MedicationDispense addDosageInstruction(MedicationDispenseDosageInstructionComponent t) { //3 + if (t == null) + return this; + if (this.dosageInstruction == null) + this.dosageInstruction = new ArrayList(); + this.dosageInstruction.add(t); + return this; + } + + /** + * @return {@link #substitution} (Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why.) + */ + public MedicationDispenseSubstitutionComponent getSubstitution() { + if (this.substitution == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.substitution"); + else if (Configuration.doAutoCreate()) + this.substitution = new MedicationDispenseSubstitutionComponent(); // cc + return this.substitution; + } + + public boolean hasSubstitution() { + return this.substitution != null && !this.substitution.isEmpty(); + } + + /** + * @param value {@link #substitution} (Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why.) + */ + public MedicationDispense setSubstitution(MedicationDispenseSubstitutionComponent value) { + this.substitution = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "A code specifying the state of the set of dispense events.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person to whom the medication will be given.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("dispenser", "Reference(Practitioner)", "The individual responsible for dispensing the medication.", 0, java.lang.Integer.MAX_VALUE, dispenser)); + childrenList.add(new Property("authorizingPrescription", "Reference(MedicationPrescription)", "Indicates the medication order that is being dispensed against.", 0, java.lang.Integer.MAX_VALUE, authorizingPrescription)); + childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("quantity", "Quantity", "The amount of medication that has been dispensed. Includes unit of measure.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("daysSupply", "Quantity", "The amount of medication expressed as a timing amount.", 0, java.lang.Integer.MAX_VALUE, daysSupply)); + childrenList.add(new Property("medication[x]", "CodeableConcept|Reference(Medication)", "Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); + childrenList.add(new Property("whenPrepared", "dateTime", "The time when the dispensed product was packaged and reviewed.", 0, java.lang.Integer.MAX_VALUE, whenPrepared)); + childrenList.add(new Property("whenHandedOver", "dateTime", "The time the dispensed product was provided to the patient or their representative.", 0, java.lang.Integer.MAX_VALUE, whenHandedOver)); + childrenList.add(new Property("destination", "Reference(Location)", "Identification of the facility/location where the medication was shipped to, as part of the dispense event.", 0, java.lang.Integer.MAX_VALUE, destination)); + childrenList.add(new Property("receiver", "Reference(Patient|Practitioner)", "Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional.", 0, java.lang.Integer.MAX_VALUE, receiver)); + childrenList.add(new Property("note", "string", "Extra information about the dispense that could not be conveyed in the other attributes.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("dosageInstruction", "", "Indicates how the medication is to be used by the patient.", 0, java.lang.Integer.MAX_VALUE, dosageInstruction)); + childrenList.add(new Property("substitution", "", "Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why.", 0, java.lang.Integer.MAX_VALUE, substitution)); + } + + public MedicationDispense copy() { + MedicationDispense dst = new MedicationDispense(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.status = status == null ? null : status.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.dispenser = dispenser == null ? null : dispenser.copy(); + if (authorizingPrescription != null) { + dst.authorizingPrescription = new ArrayList(); + for (Reference i : authorizingPrescription) + dst.authorizingPrescription.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.daysSupply = daysSupply == null ? null : daysSupply.copy(); + dst.medication = medication == null ? null : medication.copy(); + dst.whenPrepared = whenPrepared == null ? null : whenPrepared.copy(); + dst.whenHandedOver = whenHandedOver == null ? null : whenHandedOver.copy(); + dst.destination = destination == null ? null : destination.copy(); + if (receiver != null) { + dst.receiver = new ArrayList(); + for (Reference i : receiver) + dst.receiver.add(i.copy()); + }; + dst.note = note == null ? null : note.copy(); + if (dosageInstruction != null) { + dst.dosageInstruction = new ArrayList(); + for (MedicationDispenseDosageInstructionComponent i : dosageInstruction) + dst.dosageInstruction.add(i.copy()); + }; + dst.substitution = substitution == null ? null : substitution.copy(); + return dst; + } + + protected MedicationDispense typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationDispense)) + return false; + MedicationDispense o = (MedicationDispense) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(patient, o.patient, true) + && compareDeep(dispenser, o.dispenser, true) && compareDeep(authorizingPrescription, o.authorizingPrescription, true) + && compareDeep(type, o.type, true) && compareDeep(quantity, o.quantity, true) && compareDeep(daysSupply, o.daysSupply, true) + && compareDeep(medication, o.medication, true) && compareDeep(whenPrepared, o.whenPrepared, true) + && compareDeep(whenHandedOver, o.whenHandedOver, true) && compareDeep(destination, o.destination, true) + && compareDeep(receiver, o.receiver, true) && compareDeep(note, o.note, true) && compareDeep(dosageInstruction, o.dosageInstruction, true) + && compareDeep(substitution, o.substitution, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationDispense)) + return false; + MedicationDispense o = (MedicationDispense) other; + return compareValues(status, o.status, true) && compareValues(whenPrepared, o.whenPrepared, true) && compareValues(whenHandedOver, o.whenHandedOver, true) + && compareValues(note, o.note, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (patient == null || patient.isEmpty()) && (dispenser == null || dispenser.isEmpty()) && (authorizingPrescription == null || authorizingPrescription.isEmpty()) + && (type == null || type.isEmpty()) && (quantity == null || quantity.isEmpty()) && (daysSupply == null || daysSupply.isEmpty()) + && (medication == null || medication.isEmpty()) && (whenPrepared == null || whenPrepared.isEmpty()) + && (whenHandedOver == null || whenHandedOver.isEmpty()) && (destination == null || destination.isEmpty()) + && (receiver == null || receiver.isEmpty()) && (note == null || note.isEmpty()) && (dosageInstruction == null || dosageInstruction.isEmpty()) + && (substitution == null || substitution.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.MedicationDispense; + } + + @SearchParamDefinition(name="dispenser", path="MedicationDispense.dispenser", description="Return all dispenses performed by a specific indiividual", type="reference" ) + public static final String SP_DISPENSER = "dispenser"; + @SearchParamDefinition(name="identifier", path="MedicationDispense.identifier", description="Return dispenses with this external identity", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="receiver", path="MedicationDispense.receiver", description="Who collected the medication", type="reference" ) + public static final String SP_RECEIVER = "receiver"; + @SearchParamDefinition(name="prescription", path="MedicationDispense.authorizingPrescription", description="The identity of a prescription to list dispenses from", type="reference" ) + public static final String SP_PRESCRIPTION = "prescription"; + @SearchParamDefinition(name="patient", path="MedicationDispense.patient", description="The identity of a patient to list dispenses for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="destination", path="MedicationDispense.destination", description="Return dispenses that should be sent to a secific destination", type="reference" ) + public static final String SP_DESTINATION = "destination"; + @SearchParamDefinition(name="medication", path="MedicationDispense.medicationReference", description="Returns dispenses of this medicine", type="reference" ) + public static final String SP_MEDICATION = "medication"; + @SearchParamDefinition(name="responsibleparty", path="MedicationDispense.substitution.responsibleParty", description="Return all dispenses with the specified responsible party", type="reference" ) + public static final String SP_RESPONSIBLEPARTY = "responsibleparty"; + @SearchParamDefinition(name="type", path="MedicationDispense.type", description="Return all dispenses of a specific type", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="whenhandedover", path="MedicationDispense.whenHandedOver", description="Date when medication handed over to patient (outpatient setting), or supplied to ward or clinic (inpatient setting)", type="date" ) + public static final String SP_WHENHANDEDOVER = "whenhandedover"; + @SearchParamDefinition(name="whenprepared", path="MedicationDispense.whenPrepared", description="Date when medication prepared", type="date" ) + public static final String SP_WHENPREPARED = "whenprepared"; + @SearchParamDefinition(name="status", path="MedicationDispense.status", description="Status of the dispense", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/MedicationPrescription.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/MedicationPrescription.java index 062b26e6b20..534e71a1ecf 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/MedicationPrescription.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/MedicationPrescription.java @@ -1,1775 +1,1718 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * An order for both supply of the medication and the instructions for administration of the medicine to a patient. - */ -@ResourceDef(name="MedicationPrescription", profile="http://hl7.org/fhir/Profile/MedicationPrescription") -public class MedicationPrescription extends DomainResource { - - public enum MedicationPrescriptionStatus { - /** - * The prescription is 'actionable', but not all actions that are implied by it have occurred yet. - */ - ACTIVE, - /** - * Actions implied by the prescription have been temporarily halted, but are expected to continue later. May also be called "suspended". - */ - ONHOLD, - /** - * All actions that are implied by the prescription have occurred (this will rarely be made explicit). - */ - COMPLETED, - /** - * The prescription was entered in error and therefore nullified. - */ - ENTEREDINERROR, - /** - * Actions implied by the prescription have been permanently halted, before all of them occurred. - */ - STOPPED, - /** - * The prescription was replaced by a newer one, which encompasses all the information in the previous one. - */ - SUPERCEDED, - /** - * The prescription is not yet 'actionable', i.e. it is a work in progress, required sign-off, need to be run through decision support. - */ - DRAFT, - /** - * added to help the parsers - */ - NULL; - public static MedicationPrescriptionStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return ACTIVE; - if ("on-hold".equals(codeString)) - return ONHOLD; - if ("completed".equals(codeString)) - return COMPLETED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - if ("stopped".equals(codeString)) - return STOPPED; - if ("superceded".equals(codeString)) - return SUPERCEDED; - if ("draft".equals(codeString)) - return DRAFT; - throw new Exception("Unknown MedicationPrescriptionStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ACTIVE: return "active"; - case ONHOLD: return "on-hold"; - case COMPLETED: return "completed"; - case ENTEREDINERROR: return "entered-in-error"; - case STOPPED: return "stopped"; - case SUPERCEDED: return "superceded"; - case DRAFT: return "draft"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ACTIVE: return ""; - case ONHOLD: return ""; - case COMPLETED: return ""; - case ENTEREDINERROR: return ""; - case STOPPED: return ""; - case SUPERCEDED: return ""; - case DRAFT: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ACTIVE: return "The prescription is 'actionable', but not all actions that are implied by it have occurred yet."; - case ONHOLD: return "Actions implied by the prescription have been temporarily halted, but are expected to continue later. May also be called 'suspended'."; - case COMPLETED: return "All actions that are implied by the prescription have occurred (this will rarely be made explicit)."; - case ENTEREDINERROR: return "The prescription was entered in error and therefore nullified."; - case STOPPED: return "Actions implied by the prescription have been permanently halted, before all of them occurred."; - case SUPERCEDED: return "The prescription was replaced by a newer one, which encompasses all the information in the previous one."; - case DRAFT: return "The prescription is not yet 'actionable', i.e. it is a work in progress, required sign-off, need to be run through decision support."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ACTIVE: return "Active"; - case ONHOLD: return "On Hold"; - case COMPLETED: return "Completed"; - case ENTEREDINERROR: return "Entered In Error"; - case STOPPED: return "Stopped"; - case SUPERCEDED: return "Superceded"; - case DRAFT: return "Draft"; - default: return "?"; - } - } - } - - public static class MedicationPrescriptionStatusEnumFactory implements EnumFactory { - public MedicationPrescriptionStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return MedicationPrescriptionStatus.ACTIVE; - if ("on-hold".equals(codeString)) - return MedicationPrescriptionStatus.ONHOLD; - if ("completed".equals(codeString)) - return MedicationPrescriptionStatus.COMPLETED; - if ("entered-in-error".equals(codeString)) - return MedicationPrescriptionStatus.ENTEREDINERROR; - if ("stopped".equals(codeString)) - return MedicationPrescriptionStatus.STOPPED; - if ("superceded".equals(codeString)) - return MedicationPrescriptionStatus.SUPERCEDED; - if ("draft".equals(codeString)) - return MedicationPrescriptionStatus.DRAFT; - throw new IllegalArgumentException("Unknown MedicationPrescriptionStatus code '"+codeString+"'"); - } - public String toCode(MedicationPrescriptionStatus code) { - if (code == MedicationPrescriptionStatus.ACTIVE) - return "active"; - if (code == MedicationPrescriptionStatus.ONHOLD) - return "on-hold"; - if (code == MedicationPrescriptionStatus.COMPLETED) - return "completed"; - if (code == MedicationPrescriptionStatus.ENTEREDINERROR) - return "entered-in-error"; - if (code == MedicationPrescriptionStatus.STOPPED) - return "stopped"; - if (code == MedicationPrescriptionStatus.SUPERCEDED) - return "superceded"; - if (code == MedicationPrescriptionStatus.DRAFT) - return "draft"; - return "?"; - } - } - - @Block() - public static class MedicationPrescriptionDosageInstructionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. - */ - @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Dosage instructions expressed as text", formalDefinition="Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication." ) - protected StringType text; - - /** - * Additional instructions such as "Swallow with plenty of water" which may or may not be coded. - */ - @Child(name = "additionalInstructions", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Supplemental instructions - e.g. 'with meals'", formalDefinition="Additional instructions such as 'Swallow with plenty of water' which may or may not be coded." ) - protected CodeableConcept additionalInstructions; - - /** - * The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". - */ - @Child(name = "scheduled", type = {DateTimeType.class, Period.class, Timing.class}, order=3, min=0, max=1) - @Description(shortDefinition="When medication should be administered", formalDefinition="The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'." ) - protected Type scheduled; - - /** - * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication. - */ - @Child(name = "asNeeded", type = {BooleanType.class, CodeableConcept.class}, order=4, min=0, max=1) - @Description(shortDefinition="Take 'as needed' f(or x)", formalDefinition="If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication." ) - protected Type asNeeded; - - /** - * A coded specification of the anatomic site where the medication first enters the body. - */ - @Child(name = "site", type = {CodeableConcept.class}, order=5, min=0, max=1) - @Description(shortDefinition="Body site to administer to", formalDefinition="A coded specification of the anatomic site where the medication first enters the body." ) - protected CodeableConcept site; - - /** - * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient. - */ - @Child(name = "route", type = {CodeableConcept.class}, order=6, min=0, max=1) - @Description(shortDefinition="How drug should enter body", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient." ) - protected CodeableConcept route; - - /** - * A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. - -Terminologies used often pre-coordinate this term with the route and or form of administration. - */ - @Child(name = "method", type = {CodeableConcept.class}, order=7, min=0, max=1) - @Description(shortDefinition="Technique for administering medication", formalDefinition="A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\r\rTerminologies used often pre-coordinate this term with the route and or form of administration." ) - protected CodeableConcept method; - - /** - * The amount of therapeutic or other substance given at one administration event. - */ - @Child(name = "dose", type = {Range.class, Quantity.class}, order=8, min=0, max=1) - @Description(shortDefinition="Amount of medication per dose", formalDefinition="The amount of therapeutic or other substance given at one administration event." ) - protected Type dose; - - /** - * Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. - */ - @Child(name = "rate", type = {Ratio.class}, order=9, min=0, max=1) - @Description(shortDefinition="Amount of medication per unit of time", formalDefinition="Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours." ) - protected Ratio rate; - - /** - * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours. - */ - @Child(name = "maxDosePerPeriod", type = {Ratio.class}, order=10, min=0, max=1) - @Description(shortDefinition="Upper limit on medication per unit of time", formalDefinition="The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours." ) - protected Ratio maxDosePerPeriod; - - private static final long serialVersionUID = -1144367815L; - - /* - * Constructor - */ - public MedicationPrescriptionDosageInstructionComponent() { - super(); - } - - /** - * @return {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public MedicationPrescriptionDosageInstructionComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. - */ - public MedicationPrescriptionDosageInstructionComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) - */ - public CodeableConcept getAdditionalInstructions() { - if (this.additionalInstructions == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.additionalInstructions"); - else if (Configuration.doAutoCreate()) - this.additionalInstructions = new CodeableConcept(); // cc - return this.additionalInstructions; - } - - public boolean hasAdditionalInstructions() { - return this.additionalInstructions != null && !this.additionalInstructions.isEmpty(); - } - - /** - * @param value {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) - */ - public MedicationPrescriptionDosageInstructionComponent setAdditionalInstructions(CodeableConcept value) { - this.additionalInstructions = value; - return this; - } - - /** - * @return {@link #scheduled} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Type getScheduled() { - return this.scheduled; - } - - /** - * @return {@link #scheduled} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public DateTimeType getScheduledDateTimeType() throws Exception { - if (!(this.scheduled instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (DateTimeType) this.scheduled; - } - - /** - * @return {@link #scheduled} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Period getScheduledPeriod() throws Exception { - if (!(this.scheduled instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (Period) this.scheduled; - } - - /** - * @return {@link #scheduled} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Timing getScheduledTiming() throws Exception { - if (!(this.scheduled instanceof Timing)) - throw new Exception("Type mismatch: the type Timing was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (Timing) this.scheduled; - } - - public boolean hasScheduled() { - return this.scheduled != null && !this.scheduled.isEmpty(); - } - - /** - * @param value {@link #scheduled} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public MedicationPrescriptionDosageInstructionComponent setScheduled(Type value) { - this.scheduled = value; - return this; - } - - /** - * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public Type getAsNeeded() { - return this.asNeeded; - } - - /** - * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public BooleanType getAsNeededBooleanType() throws Exception { - if (!(this.asNeeded instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (BooleanType) this.asNeeded; - } - - /** - * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public CodeableConcept getAsNeededCodeableConcept() throws Exception { - if (!(this.asNeeded instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (CodeableConcept) this.asNeeded; - } - - public boolean hasAsNeeded() { - return this.asNeeded != null && !this.asNeeded.isEmpty(); - } - - /** - * @param value {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public MedicationPrescriptionDosageInstructionComponent setAsNeeded(Type value) { - this.asNeeded = value; - return this; - } - - /** - * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) - */ - public CodeableConcept getSite() { - if (this.site == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.site"); - else if (Configuration.doAutoCreate()) - this.site = new CodeableConcept(); // cc - return this.site; - } - - public boolean hasSite() { - return this.site != null && !this.site.isEmpty(); - } - - /** - * @param value {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) - */ - public MedicationPrescriptionDosageInstructionComponent setSite(CodeableConcept value) { - this.site = value; - return this; - } - - /** - * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient.) - */ - public CodeableConcept getRoute() { - if (this.route == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.route"); - else if (Configuration.doAutoCreate()) - this.route = new CodeableConcept(); // cc - return this.route; - } - - public boolean hasRoute() { - return this.route != null && !this.route.isEmpty(); - } - - /** - * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient.) - */ - public MedicationPrescriptionDosageInstructionComponent setRoute(CodeableConcept value) { - this.route = value; - return this; - } - - /** - * @return {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. - -Terminologies used often pre-coordinate this term with the route and or form of administration.) - */ - public CodeableConcept getMethod() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.method"); - else if (Configuration.doAutoCreate()) - this.method = new CodeableConcept(); // cc - return this.method; - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** - * @param value {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. - -Terminologies used often pre-coordinate this term with the route and or form of administration.) - */ - public MedicationPrescriptionDosageInstructionComponent setMethod(CodeableConcept value) { - this.method = value; - return this; - } - - /** - * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) - */ - public Type getDose() { - return this.dose; - } - - /** - * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) - */ - public Range getDoseRange() throws Exception { - if (!(this.dose instanceof Range)) - throw new Exception("Type mismatch: the type Range was expected, but "+this.dose.getClass().getName()+" was encountered"); - return (Range) this.dose; - } - - /** - * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) - */ - public Quantity getDoseQuantity() throws Exception { - if (!(this.dose instanceof Quantity)) - throw new Exception("Type mismatch: the type Quantity was expected, but "+this.dose.getClass().getName()+" was encountered"); - return (Quantity) this.dose; - } - - public boolean hasDose() { - return this.dose != null && !this.dose.isEmpty(); - } - - /** - * @param value {@link #dose} (The amount of therapeutic or other substance given at one administration event.) - */ - public MedicationPrescriptionDosageInstructionComponent setDose(Type value) { - this.dose = value; - return this; - } - - /** - * @return {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) - */ - public Ratio getRate() { - if (this.rate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.rate"); - else if (Configuration.doAutoCreate()) - this.rate = new Ratio(); // cc - return this.rate; - } - - public boolean hasRate() { - return this.rate != null && !this.rate.isEmpty(); - } - - /** - * @param value {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) - */ - public MedicationPrescriptionDosageInstructionComponent setRate(Ratio value) { - this.rate = value; - return this; - } - - /** - * @return {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.) - */ - public Ratio getMaxDosePerPeriod() { - if (this.maxDosePerPeriod == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.maxDosePerPeriod"); - else if (Configuration.doAutoCreate()) - this.maxDosePerPeriod = new Ratio(); // cc - return this.maxDosePerPeriod; - } - - public boolean hasMaxDosePerPeriod() { - return this.maxDosePerPeriod != null && !this.maxDosePerPeriod.isEmpty(); - } - - /** - * @param value {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.) - */ - public MedicationPrescriptionDosageInstructionComponent setMaxDosePerPeriod(Ratio value) { - this.maxDosePerPeriod = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("text", "string", "Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("additionalInstructions", "CodeableConcept", "Additional instructions such as 'Swallow with plenty of water' which may or may not be coded.", 0, java.lang.Integer.MAX_VALUE, additionalInstructions)); - childrenList.add(new Property("scheduled[x]", "dateTime|Period|Timing", "The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'.", 0, java.lang.Integer.MAX_VALUE, scheduled)); - childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); - childrenList.add(new Property("site", "CodeableConcept", "A coded specification of the anatomic site where the medication first enters the body.", 0, java.lang.Integer.MAX_VALUE, site)); - childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient.", 0, java.lang.Integer.MAX_VALUE, route)); - childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\r\rTerminologies used often pre-coordinate this term with the route and or form of administration.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("dose[x]", "Range|Quantity", "The amount of therapeutic or other substance given at one administration event.", 0, java.lang.Integer.MAX_VALUE, dose)); - childrenList.add(new Property("rate", "Ratio", "Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.", 0, java.lang.Integer.MAX_VALUE, rate)); - childrenList.add(new Property("maxDosePerPeriod", "Ratio", "The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxDosePerPeriod)); - } - - public MedicationPrescriptionDosageInstructionComponent copy() { - MedicationPrescriptionDosageInstructionComponent dst = new MedicationPrescriptionDosageInstructionComponent(); - copyValues(dst); - dst.text = text == null ? null : text.copy(); - dst.additionalInstructions = additionalInstructions == null ? null : additionalInstructions.copy(); - dst.scheduled = scheduled == null ? null : scheduled.copy(); - dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); - dst.site = site == null ? null : site.copy(); - dst.route = route == null ? null : route.copy(); - dst.method = method == null ? null : method.copy(); - dst.dose = dose == null ? null : dose.copy(); - dst.rate = rate == null ? null : rate.copy(); - dst.maxDosePerPeriod = maxDosePerPeriod == null ? null : maxDosePerPeriod.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationPrescriptionDosageInstructionComponent)) - return false; - MedicationPrescriptionDosageInstructionComponent o = (MedicationPrescriptionDosageInstructionComponent) other; - return compareDeep(text, o.text, true) && compareDeep(additionalInstructions, o.additionalInstructions, true) - && compareDeep(scheduled, o.scheduled, true) && compareDeep(asNeeded, o.asNeeded, true) && compareDeep(site, o.site, true) - && compareDeep(route, o.route, true) && compareDeep(method, o.method, true) && compareDeep(dose, o.dose, true) - && compareDeep(rate, o.rate, true) && compareDeep(maxDosePerPeriod, o.maxDosePerPeriod, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationPrescriptionDosageInstructionComponent)) - return false; - MedicationPrescriptionDosageInstructionComponent o = (MedicationPrescriptionDosageInstructionComponent) other; - return compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (text == null || text.isEmpty()) && (additionalInstructions == null || additionalInstructions.isEmpty()) - && (scheduled == null || scheduled.isEmpty()) && (asNeeded == null || asNeeded.isEmpty()) - && (site == null || site.isEmpty()) && (route == null || route.isEmpty()) && (method == null || method.isEmpty()) - && (dose == null || dose.isEmpty()) && (rate == null || rate.isEmpty()) && (maxDosePerPeriod == null || maxDosePerPeriod.isEmpty()) - ; - } - - } - - @Block() - public static class MedicationPrescriptionDispenseComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications. - */ - @Child(name = "medication", type = {Medication.class}, order=1, min=0, max=1) - @Description(shortDefinition="Product to be supplied", formalDefinition="Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications." ) - protected Reference medication; - - /** - * The actual object that is the target of the reference (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) - */ - protected Medication medicationTarget; - - /** - * Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) -It reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. -Rationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription. - */ - @Child(name = "validityPeriod", type = {Period.class}, order=2, min=0, max=1) - @Description(shortDefinition="Time period supply is authorized for", formalDefinition="Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) \rIt reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. \rRationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription." ) - protected Period validityPeriod; - - /** - * An integer indicating the number of repeats of the Dispense. -UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill. - */ - @Child(name = "numberOfRepeatsAllowed", type = {PositiveIntType.class}, order=3, min=0, max=1) - @Description(shortDefinition="# of refills authorized", formalDefinition="An integer indicating the number of repeats of the Dispense. \rUsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill." ) - protected PositiveIntType numberOfRepeatsAllowed; - - /** - * The amount that is to be dispensed for one fill. - */ - @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1) - @Description(shortDefinition="Amount of medication to supply per dispense", formalDefinition="The amount that is to be dispensed for one fill." ) - protected Quantity quantity; - - /** - * Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. -In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors. - */ - @Child(name = "expectedSupplyDuration", type = {Duration.class}, order=5, min=0, max=1) - @Description(shortDefinition="Days supply per dispense", formalDefinition="Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. \rIn some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors." ) - protected Duration expectedSupplyDuration; - - private static final long serialVersionUID = -44233312L; - - /* - * Constructor - */ - public MedicationPrescriptionDispenseComponent() { - super(); - } - - /** - * @return {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Reference getMedication() { - if (this.medication == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.medication"); - else if (Configuration.doAutoCreate()) - this.medication = new Reference(); // cc - return this.medication; - } - - public boolean hasMedication() { - return this.medication != null && !this.medication.isEmpty(); - } - - /** - * @param value {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationPrescriptionDispenseComponent setMedication(Reference value) { - this.medication = value; - return this; - } - - /** - * @return {@link #medication} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Medication getMedicationTarget() { - if (this.medicationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.medication"); - else if (Configuration.doAutoCreate()) - this.medicationTarget = new Medication(); // aa - return this.medicationTarget; - } - - /** - * @param value {@link #medication} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationPrescriptionDispenseComponent setMedicationTarget(Medication value) { - this.medicationTarget = value; - return this; - } - - /** - * @return {@link #validityPeriod} (Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) -It reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. -Rationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription.) - */ - public Period getValidityPeriod() { - if (this.validityPeriod == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.validityPeriod"); - else if (Configuration.doAutoCreate()) - this.validityPeriod = new Period(); // cc - return this.validityPeriod; - } - - public boolean hasValidityPeriod() { - return this.validityPeriod != null && !this.validityPeriod.isEmpty(); - } - - /** - * @param value {@link #validityPeriod} (Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) -It reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. -Rationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription.) - */ - public MedicationPrescriptionDispenseComponent setValidityPeriod(Period value) { - this.validityPeriod = value; - return this; - } - - /** - * @return {@link #numberOfRepeatsAllowed} (An integer indicating the number of repeats of the Dispense. -UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill.). This is the underlying object with id, value and extensions. The accessor "getNumberOfRepeatsAllowed" gives direct access to the value - */ - public PositiveIntType getNumberOfRepeatsAllowedElement() { - if (this.numberOfRepeatsAllowed == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.numberOfRepeatsAllowed"); - else if (Configuration.doAutoCreate()) - this.numberOfRepeatsAllowed = new PositiveIntType(); // bb - return this.numberOfRepeatsAllowed; - } - - public boolean hasNumberOfRepeatsAllowedElement() { - return this.numberOfRepeatsAllowed != null && !this.numberOfRepeatsAllowed.isEmpty(); - } - - public boolean hasNumberOfRepeatsAllowed() { - return this.numberOfRepeatsAllowed != null && !this.numberOfRepeatsAllowed.isEmpty(); - } - - /** - * @param value {@link #numberOfRepeatsAllowed} (An integer indicating the number of repeats of the Dispense. -UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill.). This is the underlying object with id, value and extensions. The accessor "getNumberOfRepeatsAllowed" gives direct access to the value - */ - public MedicationPrescriptionDispenseComponent setNumberOfRepeatsAllowedElement(PositiveIntType value) { - this.numberOfRepeatsAllowed = value; - return this; - } - - /** - * @return An integer indicating the number of repeats of the Dispense. -UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill. - */ - public int getNumberOfRepeatsAllowed() { - return this.numberOfRepeatsAllowed == null || this.numberOfRepeatsAllowed.isEmpty() ? 0 : this.numberOfRepeatsAllowed.getValue(); - } - - /** - * @param value An integer indicating the number of repeats of the Dispense. -UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill. - */ - public MedicationPrescriptionDispenseComponent setNumberOfRepeatsAllowed(int value) { - if (this.numberOfRepeatsAllowed == null) - this.numberOfRepeatsAllowed = new PositiveIntType(); - this.numberOfRepeatsAllowed.setValue(value); - return this; - } - - /** - * @return {@link #quantity} (The amount that is to be dispensed for one fill.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount that is to be dispensed for one fill.) - */ - public MedicationPrescriptionDispenseComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #expectedSupplyDuration} (Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. -In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors.) - */ - public Duration getExpectedSupplyDuration() { - if (this.expectedSupplyDuration == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.expectedSupplyDuration"); - else if (Configuration.doAutoCreate()) - this.expectedSupplyDuration = new Duration(); // cc - return this.expectedSupplyDuration; - } - - public boolean hasExpectedSupplyDuration() { - return this.expectedSupplyDuration != null && !this.expectedSupplyDuration.isEmpty(); - } - - /** - * @param value {@link #expectedSupplyDuration} (Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. -In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors.) - */ - public MedicationPrescriptionDispenseComponent setExpectedSupplyDuration(Duration value) { - this.expectedSupplyDuration = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("medication", "Reference(Medication)", "Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); - childrenList.add(new Property("validityPeriod", "Period", "Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) \rIt reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. \rRationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription.", 0, java.lang.Integer.MAX_VALUE, validityPeriod)); - childrenList.add(new Property("numberOfRepeatsAllowed", "positiveInt", "An integer indicating the number of repeats of the Dispense. \rUsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill.", 0, java.lang.Integer.MAX_VALUE, numberOfRepeatsAllowed)); - childrenList.add(new Property("quantity", "Quantity", "The amount that is to be dispensed for one fill.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("expectedSupplyDuration", "Duration", "Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. \rIn some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors.", 0, java.lang.Integer.MAX_VALUE, expectedSupplyDuration)); - } - - public MedicationPrescriptionDispenseComponent copy() { - MedicationPrescriptionDispenseComponent dst = new MedicationPrescriptionDispenseComponent(); - copyValues(dst); - dst.medication = medication == null ? null : medication.copy(); - dst.validityPeriod = validityPeriod == null ? null : validityPeriod.copy(); - dst.numberOfRepeatsAllowed = numberOfRepeatsAllowed == null ? null : numberOfRepeatsAllowed.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.expectedSupplyDuration = expectedSupplyDuration == null ? null : expectedSupplyDuration.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationPrescriptionDispenseComponent)) - return false; - MedicationPrescriptionDispenseComponent o = (MedicationPrescriptionDispenseComponent) other; - return compareDeep(medication, o.medication, true) && compareDeep(validityPeriod, o.validityPeriod, true) - && compareDeep(numberOfRepeatsAllowed, o.numberOfRepeatsAllowed, true) && compareDeep(quantity, o.quantity, true) - && compareDeep(expectedSupplyDuration, o.expectedSupplyDuration, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationPrescriptionDispenseComponent)) - return false; - MedicationPrescriptionDispenseComponent o = (MedicationPrescriptionDispenseComponent) other; - return compareValues(numberOfRepeatsAllowed, o.numberOfRepeatsAllowed, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (medication == null || medication.isEmpty()) && (validityPeriod == null || validityPeriod.isEmpty()) - && (numberOfRepeatsAllowed == null || numberOfRepeatsAllowed.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (expectedSupplyDuration == null || expectedSupplyDuration.isEmpty()); - } - - } - - @Block() - public static class MedicationPrescriptionSubstitutionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A code signifying whether a different drug should be dispensed from what was prescribed. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="generic | formulary +", formalDefinition="A code signifying whether a different drug should be dispensed from what was prescribed." ) - protected CodeableConcept type; - - /** - * Indicates the reason for the substitution, or why substitution must or must not be performed. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Why should substitution (not) be made", formalDefinition="Indicates the reason for the substitution, or why substitution must or must not be performed." ) - protected CodeableConcept reason; - - private static final long serialVersionUID = 1693602518L; - - /* - * Constructor - */ - public MedicationPrescriptionSubstitutionComponent() { - super(); - } - - /* - * Constructor - */ - public MedicationPrescriptionSubstitutionComponent(CodeableConcept type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (A code signifying whether a different drug should be dispensed from what was prescribed.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionSubstitutionComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (A code signifying whether a different drug should be dispensed from what was prescribed.) - */ - public MedicationPrescriptionSubstitutionComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #reason} (Indicates the reason for the substitution, or why substitution must or must not be performed.) - */ - public CodeableConcept getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionSubstitutionComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new CodeableConcept(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Indicates the reason for the substitution, or why substitution must or must not be performed.) - */ - public MedicationPrescriptionSubstitutionComponent setReason(CodeableConcept value) { - this.reason = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "A code signifying whether a different drug should be dispensed from what was prescribed.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("reason", "CodeableConcept", "Indicates the reason for the substitution, or why substitution must or must not be performed.", 0, java.lang.Integer.MAX_VALUE, reason)); - } - - public MedicationPrescriptionSubstitutionComponent copy() { - MedicationPrescriptionSubstitutionComponent dst = new MedicationPrescriptionSubstitutionComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.reason = reason == null ? null : reason.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationPrescriptionSubstitutionComponent)) - return false; - MedicationPrescriptionSubstitutionComponent o = (MedicationPrescriptionSubstitutionComponent) other; - return compareDeep(type, o.type, true) && compareDeep(reason, o.reason, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationPrescriptionSubstitutionComponent)) - return false; - MedicationPrescriptionSubstitutionComponent o = (MedicationPrescriptionSubstitutionComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (reason == null || reason.isEmpty()) - ; - } - - } - - /** - * External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External identifier", formalDefinition="External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system." ) - protected List identifier; - - /** - * The date (and perhaps time) when the prescription was written. - */ - @Child(name = "dateWritten", type = {DateTimeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="When prescription was authorized", formalDefinition="The date (and perhaps time) when the prescription was written." ) - protected DateTimeType dateWritten; - - /** - * A code specifying the state of the order. Generally this will be active or completed state. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="active | on-hold | completed | entered-in-error | stopped | superceded | draft", formalDefinition="A code specifying the state of the order. Generally this will be active or completed state." ) - protected Enumeration status; - - /** - * A link to a resource representing the person to whom the medication will be given. - */ - @Child(name = "patient", type = {Patient.class}, order=3, min=0, max=1) - @Description(shortDefinition="Who prescription is for", formalDefinition="A link to a resource representing the person to whom the medication will be given." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (A link to a resource representing the person to whom the medication will be given.) - */ - protected Patient patientTarget; - - /** - * The healthcare professional responsible for authorizing the prescription. - */ - @Child(name = "prescriber", type = {Practitioner.class}, order=4, min=0, max=1) - @Description(shortDefinition="Who ordered the medication(s)", formalDefinition="The healthcare professional responsible for authorizing the prescription." ) - protected Reference prescriber; - - /** - * The actual object that is the target of the reference (The healthcare professional responsible for authorizing the prescription.) - */ - protected Practitioner prescriberTarget; - - /** - * A link to a resource that identifies the particular occurrence of contact between patient and health care provider. - */ - @Child(name = "encounter", type = {Encounter.class}, order=5, min=0, max=1) - @Description(shortDefinition="Created during encounter / admission / stay", formalDefinition="A link to a resource that identifies the particular occurrence of contact between patient and health care provider." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - protected Encounter encounterTarget; - - /** - * Can be the reason or the indication for writing the prescription. - */ - @Child(name = "reason", type = {CodeableConcept.class, Condition.class}, order=6, min=0, max=1) - @Description(shortDefinition="Reason or indication for writing the prescription", formalDefinition="Can be the reason or the indication for writing the prescription." ) - protected Type reason; - - /** - * Extra information about the prescription that could not be conveyed by the other attributes. - */ - @Child(name = "note", type = {StringType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Information about the prescription", formalDefinition="Extra information about the prescription that could not be conveyed by the other attributes." ) - protected StringType note; - - /** - * Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications. - */ - @Child(name = "medication", type = {Medication.class}, order=8, min=0, max=1) - @Description(shortDefinition="Medication to be taken", formalDefinition="Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications." ) - protected Reference medication; - - /** - * The actual object that is the target of the reference (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) - */ - protected Medication medicationTarget; - - /** - * Indicates how the medication is to be used by the patient. - */ - @Child(name = "dosageInstruction", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="How medication should be taken", formalDefinition="Indicates how the medication is to be used by the patient." ) - protected List dosageInstruction; - - /** - * Deals with details of the dispense part of the order. - */ - @Child(name = "dispense", type = {}, order=10, min=0, max=1) - @Description(shortDefinition="Medication supply authorization", formalDefinition="Deals with details of the dispense part of the order." ) - protected MedicationPrescriptionDispenseComponent dispense; - - /** - * Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done. - */ - @Child(name = "substitution", type = {}, order=11, min=0, max=1) - @Description(shortDefinition="Any restrictions on medication substitution?", formalDefinition="Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done." ) - protected MedicationPrescriptionSubstitutionComponent substitution; - - private static final long serialVersionUID = 277504612L; - - /* - * Constructor - */ - public MedicationPrescription() { - super(); - } - - /** - * @return {@link #identifier} (External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public MedicationPrescription addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value - */ - public DateTimeType getDateWrittenElement() { - if (this.dateWritten == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.dateWritten"); - else if (Configuration.doAutoCreate()) - this.dateWritten = new DateTimeType(); // bb - return this.dateWritten; - } - - public boolean hasDateWrittenElement() { - return this.dateWritten != null && !this.dateWritten.isEmpty(); - } - - public boolean hasDateWritten() { - return this.dateWritten != null && !this.dateWritten.isEmpty(); - } - - /** - * @param value {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value - */ - public MedicationPrescription setDateWrittenElement(DateTimeType value) { - this.dateWritten = value; - return this; - } - - /** - * @return The date (and perhaps time) when the prescription was written. - */ - public Date getDateWritten() { - return this.dateWritten == null ? null : this.dateWritten.getValue(); - } - - /** - * @param value The date (and perhaps time) when the prescription was written. - */ - public MedicationPrescription setDateWritten(Date value) { - if (value == null) - this.dateWritten = null; - else { - if (this.dateWritten == null) - this.dateWritten = new DateTimeType(); - this.dateWritten.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (A code specifying the state of the order. Generally this will be active or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new MedicationPrescriptionStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (A code specifying the state of the order. Generally this will be active or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public MedicationPrescription setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return A code specifying the state of the order. Generally this will be active or completed state. - */ - public MedicationPrescriptionStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value A code specifying the state of the order. Generally this will be active or completed state. - */ - public MedicationPrescription setStatus(MedicationPrescriptionStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new MedicationPrescriptionStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #patient} (A link to a resource representing the person to whom the medication will be given.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (A link to a resource representing the person to whom the medication will be given.) - */ - public MedicationPrescription setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person to whom the medication will be given.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person to whom the medication will be given.) - */ - public MedicationPrescription setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.) - */ - public Reference getPrescriber() { - if (this.prescriber == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.prescriber"); - else if (Configuration.doAutoCreate()) - this.prescriber = new Reference(); // cc - return this.prescriber; - } - - public boolean hasPrescriber() { - return this.prescriber != null && !this.prescriber.isEmpty(); - } - - /** - * @param value {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.) - */ - public MedicationPrescription setPrescriber(Reference value) { - this.prescriber = value; - return this; - } - - /** - * @return {@link #prescriber} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The healthcare professional responsible for authorizing the prescription.) - */ - public Practitioner getPrescriberTarget() { - if (this.prescriberTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.prescriber"); - else if (Configuration.doAutoCreate()) - this.prescriberTarget = new Practitioner(); // aa - return this.prescriberTarget; - } - - /** - * @param value {@link #prescriber} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The healthcare professional responsible for authorizing the prescription.) - */ - public MedicationPrescription setPrescriberTarget(Practitioner value) { - this.prescriberTarget = value; - return this; - } - - /** - * @return {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public MedicationPrescription setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public MedicationPrescription setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) - */ - public Type getReason() { - return this.reason; - } - - /** - * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) - */ - public CodeableConcept getReasonCodeableConcept() throws Exception { - if (!(this.reason instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (CodeableConcept) this.reason; - } - - /** - * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) - */ - public Reference getReasonReference() throws Exception { - if (!(this.reason instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (Reference) this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Can be the reason or the indication for writing the prescription.) - */ - public MedicationPrescription setReason(Type value) { - this.reason = value; - return this; - } - - /** - * @return {@link #note} (Extra information about the prescription that could not be conveyed by the other attributes.). 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 MedicationPrescription.note"); - else if (Configuration.doAutoCreate()) - this.note = new StringType(); // bb - 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} (Extra information about the prescription that could not be conveyed by the other attributes.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value - */ - public MedicationPrescription setNoteElement(StringType value) { - this.note = value; - return this; - } - - /** - * @return Extra information about the prescription that could not be conveyed by the other attributes. - */ - public String getNote() { - return this.note == null ? null : this.note.getValue(); - } - - /** - * @param value Extra information about the prescription that could not be conveyed by the other attributes. - */ - public MedicationPrescription setNote(String value) { - if (Utilities.noString(value)) - this.note = null; - else { - if (this.note == null) - this.note = new StringType(); - this.note.setValue(value); - } - return this; - } - - /** - * @return {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Reference getMedication() { - if (this.medication == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.medication"); - else if (Configuration.doAutoCreate()) - this.medication = new Reference(); // cc - return this.medication; - } - - public boolean hasMedication() { - return this.medication != null && !this.medication.isEmpty(); - } - - /** - * @param value {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationPrescription setMedication(Reference value) { - this.medication = value; - return this; - } - - /** - * @return {@link #medication} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Medication getMedicationTarget() { - if (this.medicationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.medication"); - else if (Configuration.doAutoCreate()) - this.medicationTarget = new Medication(); // aa - return this.medicationTarget; - } - - /** - * @param value {@link #medication} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationPrescription setMedicationTarget(Medication value) { - this.medicationTarget = value; - return this; - } - - /** - * @return {@link #dosageInstruction} (Indicates how the medication is to be used by the patient.) - */ - public List getDosageInstruction() { - if (this.dosageInstruction == null) - this.dosageInstruction = new ArrayList(); - return this.dosageInstruction; - } - - public boolean hasDosageInstruction() { - if (this.dosageInstruction == null) - return false; - for (MedicationPrescriptionDosageInstructionComponent item : this.dosageInstruction) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dosageInstruction} (Indicates how the medication is to be used by the patient.) - */ - // syntactic sugar - public MedicationPrescriptionDosageInstructionComponent addDosageInstruction() { //3 - MedicationPrescriptionDosageInstructionComponent t = new MedicationPrescriptionDosageInstructionComponent(); - if (this.dosageInstruction == null) - this.dosageInstruction = new ArrayList(); - this.dosageInstruction.add(t); - return t; - } - - // syntactic sugar - public MedicationPrescription addDosageInstruction(MedicationPrescriptionDosageInstructionComponent t) { //3 - if (t == null) - return this; - if (this.dosageInstruction == null) - this.dosageInstruction = new ArrayList(); - this.dosageInstruction.add(t); - return this; - } - - /** - * @return {@link #dispense} (Deals with details of the dispense part of the order.) - */ - public MedicationPrescriptionDispenseComponent getDispense() { - if (this.dispense == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.dispense"); - else if (Configuration.doAutoCreate()) - this.dispense = new MedicationPrescriptionDispenseComponent(); // cc - return this.dispense; - } - - public boolean hasDispense() { - return this.dispense != null && !this.dispense.isEmpty(); - } - - /** - * @param value {@link #dispense} (Deals with details of the dispense part of the order.) - */ - public MedicationPrescription setDispense(MedicationPrescriptionDispenseComponent value) { - this.dispense = value; - return this; - } - - /** - * @return {@link #substitution} (Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done.) - */ - public MedicationPrescriptionSubstitutionComponent getSubstitution() { - if (this.substitution == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.substitution"); - else if (Configuration.doAutoCreate()) - this.substitution = new MedicationPrescriptionSubstitutionComponent(); // cc - return this.substitution; - } - - public boolean hasSubstitution() { - return this.substitution != null && !this.substitution.isEmpty(); - } - - /** - * @param value {@link #substitution} (Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done.) - */ - public MedicationPrescription setSubstitution(MedicationPrescriptionSubstitutionComponent value) { - this.substitution = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("dateWritten", "dateTime", "The date (and perhaps time) when the prescription was written.", 0, java.lang.Integer.MAX_VALUE, dateWritten)); - childrenList.add(new Property("status", "code", "A code specifying the state of the order. Generally this will be active or completed state.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person to whom the medication will be given.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("prescriber", "Reference(Practitioner)", "The healthcare professional responsible for authorizing the prescription.", 0, java.lang.Integer.MAX_VALUE, prescriber)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "A link to a resource that identifies the particular occurrence of contact between patient and health care provider.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Condition)", "Can be the reason or the indication for writing the prescription.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("note", "string", "Extra information about the prescription that could not be conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note)); - childrenList.add(new Property("medication", "Reference(Medication)", "Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); - childrenList.add(new Property("dosageInstruction", "", "Indicates how the medication is to be used by the patient.", 0, java.lang.Integer.MAX_VALUE, dosageInstruction)); - childrenList.add(new Property("dispense", "", "Deals with details of the dispense part of the order.", 0, java.lang.Integer.MAX_VALUE, dispense)); - childrenList.add(new Property("substitution", "", "Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done.", 0, java.lang.Integer.MAX_VALUE, substitution)); - } - - public MedicationPrescription copy() { - MedicationPrescription dst = new MedicationPrescription(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.dateWritten = dateWritten == null ? null : dateWritten.copy(); - dst.status = status == null ? null : status.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.prescriber = prescriber == null ? null : prescriber.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.note = note == null ? null : note.copy(); - dst.medication = medication == null ? null : medication.copy(); - if (dosageInstruction != null) { - dst.dosageInstruction = new ArrayList(); - for (MedicationPrescriptionDosageInstructionComponent i : dosageInstruction) - dst.dosageInstruction.add(i.copy()); - }; - dst.dispense = dispense == null ? null : dispense.copy(); - dst.substitution = substitution == null ? null : substitution.copy(); - return dst; - } - - protected MedicationPrescription typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationPrescription)) - return false; - MedicationPrescription o = (MedicationPrescription) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(dateWritten, o.dateWritten, true) - && compareDeep(status, o.status, true) && compareDeep(patient, o.patient, true) && compareDeep(prescriber, o.prescriber, true) - && compareDeep(encounter, o.encounter, true) && compareDeep(reason, o.reason, true) && compareDeep(note, o.note, true) - && compareDeep(medication, o.medication, true) && compareDeep(dosageInstruction, o.dosageInstruction, true) - && compareDeep(dispense, o.dispense, true) && compareDeep(substitution, o.substitution, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationPrescription)) - return false; - MedicationPrescription o = (MedicationPrescription) other; - return compareValues(dateWritten, o.dateWritten, true) && compareValues(status, o.status, true) && compareValues(note, o.note, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (dateWritten == null || dateWritten.isEmpty()) - && (status == null || status.isEmpty()) && (patient == null || patient.isEmpty()) && (prescriber == null || prescriber.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (reason == null || reason.isEmpty()) && (note == null || note.isEmpty()) - && (medication == null || medication.isEmpty()) && (dosageInstruction == null || dosageInstruction.isEmpty()) - && (dispense == null || dispense.isEmpty()) && (substitution == null || substitution.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.MedicationPrescription; - } - - @SearchParamDefinition(name="medication", path="MedicationPrescription.medication", description="Code for medicine or text in medicine name", type="reference" ) - public static final String SP_MEDICATION = "medication"; - @SearchParamDefinition(name="datewritten", path="MedicationPrescription.dateWritten", description="Return prescriptions written on this date", type="date" ) - public static final String SP_DATEWRITTEN = "datewritten"; - @SearchParamDefinition(name="patient", path="MedicationPrescription.patient", description="The identity of a patient to list dispenses for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="status", path="MedicationPrescription.status", description="Status of the prescription", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="prescriber", path="MedicationPrescription.prescriber", description="Who ordered the medication(s)", type="reference" ) - public static final String SP_PRESCRIBER = "prescriber"; - @SearchParamDefinition(name="encounter", path="MedicationPrescription.encounter", description="Return prescriptions with this encounter identity", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - @SearchParamDefinition(name="identifier", path="MedicationPrescription.identifier", description="Return prescriptions with this external identity", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * An order for both supply of the medication and the instructions for administration of the medicine to a patient. + */ +@ResourceDef(name="MedicationPrescription", profile="http://hl7.org/fhir/Profile/MedicationPrescription") +public class MedicationPrescription extends DomainResource { + + public enum MedicationPrescriptionStatus { + /** + * The prescription is 'actionable', but not all actions that are implied by it have occurred yet. + */ + ACTIVE, + /** + * Actions implied by the prescription have been temporarily halted, but are expected to continue later. May also be called "suspended". + */ + ONHOLD, + /** + * All actions that are implied by the prescription have occurred (this will rarely be made explicit). + */ + COMPLETED, + /** + * The prescription was entered in error and therefore nullified. + */ + ENTEREDINERROR, + /** + * Actions implied by the prescription have been permanently halted, before all of them occurred. + */ + STOPPED, + /** + * The prescription was replaced by a newer one, which encompasses all the information in the previous one. + */ + SUPERCEDED, + /** + * The prescription is not yet 'actionable', i.e. it is a work in progress, required sign-off, need to be run through decision support. + */ + DRAFT, + /** + * added to help the parsers + */ + NULL; + public static MedicationPrescriptionStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return ACTIVE; + if ("on-hold".equals(codeString)) + return ONHOLD; + if ("completed".equals(codeString)) + return COMPLETED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + if ("stopped".equals(codeString)) + return STOPPED; + if ("superceded".equals(codeString)) + return SUPERCEDED; + if ("draft".equals(codeString)) + return DRAFT; + throw new Exception("Unknown MedicationPrescriptionStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ACTIVE: return "active"; + case ONHOLD: return "on-hold"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered-in-error"; + case STOPPED: return "stopped"; + case SUPERCEDED: return "superceded"; + case DRAFT: return "draft"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACTIVE: return ""; + case ONHOLD: return ""; + case COMPLETED: return ""; + case ENTEREDINERROR: return ""; + case STOPPED: return ""; + case SUPERCEDED: return ""; + case DRAFT: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACTIVE: return "The prescription is 'actionable', but not all actions that are implied by it have occurred yet."; + case ONHOLD: return "Actions implied by the prescription have been temporarily halted, but are expected to continue later. May also be called 'suspended'."; + case COMPLETED: return "All actions that are implied by the prescription have occurred (this will rarely be made explicit)."; + case ENTEREDINERROR: return "The prescription was entered in error and therefore nullified."; + case STOPPED: return "Actions implied by the prescription have been permanently halted, before all of them occurred."; + case SUPERCEDED: return "The prescription was replaced by a newer one, which encompasses all the information in the previous one."; + case DRAFT: return "The prescription is not yet 'actionable', i.e. it is a work in progress, required sign-off, need to be run through decision support."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACTIVE: return "Active"; + case ONHOLD: return "On Hold"; + case COMPLETED: return "Completed"; + case ENTEREDINERROR: return "Entered In Error"; + case STOPPED: return "Stopped"; + case SUPERCEDED: return "Superceded"; + case DRAFT: return "Draft"; + default: return "?"; + } + } + } + + public static class MedicationPrescriptionStatusEnumFactory implements EnumFactory { + public MedicationPrescriptionStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return MedicationPrescriptionStatus.ACTIVE; + if ("on-hold".equals(codeString)) + return MedicationPrescriptionStatus.ONHOLD; + if ("completed".equals(codeString)) + return MedicationPrescriptionStatus.COMPLETED; + if ("entered-in-error".equals(codeString)) + return MedicationPrescriptionStatus.ENTEREDINERROR; + if ("stopped".equals(codeString)) + return MedicationPrescriptionStatus.STOPPED; + if ("superceded".equals(codeString)) + return MedicationPrescriptionStatus.SUPERCEDED; + if ("draft".equals(codeString)) + return MedicationPrescriptionStatus.DRAFT; + throw new IllegalArgumentException("Unknown MedicationPrescriptionStatus code '"+codeString+"'"); + } + public String toCode(MedicationPrescriptionStatus code) { + if (code == MedicationPrescriptionStatus.ACTIVE) + return "active"; + if (code == MedicationPrescriptionStatus.ONHOLD) + return "on-hold"; + if (code == MedicationPrescriptionStatus.COMPLETED) + return "completed"; + if (code == MedicationPrescriptionStatus.ENTEREDINERROR) + return "entered-in-error"; + if (code == MedicationPrescriptionStatus.STOPPED) + return "stopped"; + if (code == MedicationPrescriptionStatus.SUPERCEDED) + return "superceded"; + if (code == MedicationPrescriptionStatus.DRAFT) + return "draft"; + return "?"; + } + } + + @Block() + public static class MedicationPrescriptionDosageInstructionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + */ + @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Dosage instructions expressed as text", formalDefinition="Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication." ) + protected StringType text; + + /** + * Additional instructions such as "Swallow with plenty of water" which may or may not be coded. + */ + @Child(name = "additionalInstructions", type = {CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Supplemental instructions - e.g. 'with meals'", formalDefinition="Additional instructions such as 'Swallow with plenty of water' which may or may not be coded." ) + protected CodeableConcept additionalInstructions; + + /** + * The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". + */ + @Child(name = "scheduled", type = {DateTimeType.class, Period.class, Timing.class}, order=3, min=0, max=1) + @Description(shortDefinition="When medication should be administered", formalDefinition="The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'." ) + protected Type scheduled; + + /** + * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication. + */ + @Child(name = "asNeeded", type = {BooleanType.class, CodeableConcept.class}, order=4, min=0, max=1) + @Description(shortDefinition="Take 'as needed' f(or x)", formalDefinition="If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication." ) + protected Type asNeeded; + + /** + * A coded specification of the anatomic site where the medication first enters the body. + */ + @Child(name = "site", type = {CodeableConcept.class}, order=5, min=0, max=1) + @Description(shortDefinition="Body site to administer to", formalDefinition="A coded specification of the anatomic site where the medication first enters the body." ) + protected CodeableConcept site; + + /** + * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient. + */ + @Child(name = "route", type = {CodeableConcept.class}, order=6, min=0, max=1) + @Description(shortDefinition="How drug should enter body", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient." ) + protected CodeableConcept route; + + /** + * A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. Terminologies used often pre-coordinate this term with the route and or form of administration. + */ + @Child(name = "method", type = {CodeableConcept.class}, order=7, min=0, max=1) + @Description(shortDefinition="Technique for administering medication", formalDefinition="A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\r\rTerminologies used often pre-coordinate this term with the route and or form of administration." ) + protected CodeableConcept method; + + /** + * The amount of therapeutic or other substance given at one administration event. + */ + @Child(name = "dose", type = {Range.class, Quantity.class}, order=8, min=0, max=1) + @Description(shortDefinition="Amount of medication per dose", formalDefinition="The amount of therapeutic or other substance given at one administration event." ) + protected Type dose; + + /** + * Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. + */ + @Child(name = "rate", type = {Ratio.class}, order=9, min=0, max=1) + @Description(shortDefinition="Amount of medication per unit of time", formalDefinition="Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours." ) + protected Ratio rate; + + /** + * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours. + */ + @Child(name = "maxDosePerPeriod", type = {Ratio.class}, order=10, min=0, max=1) + @Description(shortDefinition="Upper limit on medication per unit of time", formalDefinition="The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours." ) + protected Ratio maxDosePerPeriod; + + private static final long serialVersionUID = -1144367815L; + + /* + * Constructor + */ + public MedicationPrescriptionDosageInstructionComponent() { + super(); + } + + /** + * @return {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public MedicationPrescriptionDosageInstructionComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + */ + public MedicationPrescriptionDosageInstructionComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) + */ + public CodeableConcept getAdditionalInstructions() { + if (this.additionalInstructions == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.additionalInstructions"); + else if (Configuration.doAutoCreate()) + this.additionalInstructions = new CodeableConcept(); // cc + return this.additionalInstructions; + } + + public boolean hasAdditionalInstructions() { + return this.additionalInstructions != null && !this.additionalInstructions.isEmpty(); + } + + /** + * @param value {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) + */ + public MedicationPrescriptionDosageInstructionComponent setAdditionalInstructions(CodeableConcept value) { + this.additionalInstructions = value; + return this; + } + + /** + * @return {@link #scheduled} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Type getScheduled() { + return this.scheduled; + } + + /** + * @return {@link #scheduled} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public DateTimeType getScheduledDateTimeType() throws Exception { + if (!(this.scheduled instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (DateTimeType) this.scheduled; + } + + /** + * @return {@link #scheduled} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Period getScheduledPeriod() throws Exception { + if (!(this.scheduled instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (Period) this.scheduled; + } + + /** + * @return {@link #scheduled} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Timing getScheduledTiming() throws Exception { + if (!(this.scheduled instanceof Timing)) + throw new Exception("Type mismatch: the type Timing was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (Timing) this.scheduled; + } + + public boolean hasScheduled() { + return this.scheduled != null && !this.scheduled.isEmpty(); + } + + /** + * @param value {@link #scheduled} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public MedicationPrescriptionDosageInstructionComponent setScheduled(Type value) { + this.scheduled = value; + return this; + } + + /** + * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public Type getAsNeeded() { + return this.asNeeded; + } + + /** + * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public BooleanType getAsNeededBooleanType() throws Exception { + if (!(this.asNeeded instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (BooleanType) this.asNeeded; + } + + /** + * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public CodeableConcept getAsNeededCodeableConcept() throws Exception { + if (!(this.asNeeded instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (CodeableConcept) this.asNeeded; + } + + public boolean hasAsNeeded() { + return this.asNeeded != null && !this.asNeeded.isEmpty(); + } + + /** + * @param value {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public MedicationPrescriptionDosageInstructionComponent setAsNeeded(Type value) { + this.asNeeded = value; + return this; + } + + /** + * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) + */ + public CodeableConcept getSite() { + if (this.site == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.site"); + else if (Configuration.doAutoCreate()) + this.site = new CodeableConcept(); // cc + return this.site; + } + + public boolean hasSite() { + return this.site != null && !this.site.isEmpty(); + } + + /** + * @param value {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) + */ + public MedicationPrescriptionDosageInstructionComponent setSite(CodeableConcept value) { + this.site = value; + return this; + } + + /** + * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient.) + */ + public CodeableConcept getRoute() { + if (this.route == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.route"); + else if (Configuration.doAutoCreate()) + this.route = new CodeableConcept(); // cc + return this.route; + } + + public boolean hasRoute() { + return this.route != null && !this.route.isEmpty(); + } + + /** + * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient.) + */ + public MedicationPrescriptionDosageInstructionComponent setRoute(CodeableConcept value) { + this.route = value; + return this; + } + + /** + * @return {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. Terminologies used often pre-coordinate this term with the route and or form of administration.) + */ + public CodeableConcept getMethod() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.method"); + else if (Configuration.doAutoCreate()) + this.method = new CodeableConcept(); // cc + return this.method; + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** + * @param value {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. Terminologies used often pre-coordinate this term with the route and or form of administration.) + */ + public MedicationPrescriptionDosageInstructionComponent setMethod(CodeableConcept value) { + this.method = value; + return this; + } + + /** + * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) + */ + public Type getDose() { + return this.dose; + } + + /** + * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) + */ + public Range getDoseRange() throws Exception { + if (!(this.dose instanceof Range)) + throw new Exception("Type mismatch: the type Range was expected, but "+this.dose.getClass().getName()+" was encountered"); + return (Range) this.dose; + } + + /** + * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) + */ + public Quantity getDoseQuantity() throws Exception { + if (!(this.dose instanceof Quantity)) + throw new Exception("Type mismatch: the type Quantity was expected, but "+this.dose.getClass().getName()+" was encountered"); + return (Quantity) this.dose; + } + + public boolean hasDose() { + return this.dose != null && !this.dose.isEmpty(); + } + + /** + * @param value {@link #dose} (The amount of therapeutic or other substance given at one administration event.) + */ + public MedicationPrescriptionDosageInstructionComponent setDose(Type value) { + this.dose = value; + return this; + } + + /** + * @return {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) + */ + public Ratio getRate() { + if (this.rate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.rate"); + else if (Configuration.doAutoCreate()) + this.rate = new Ratio(); // cc + return this.rate; + } + + public boolean hasRate() { + return this.rate != null && !this.rate.isEmpty(); + } + + /** + * @param value {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) + */ + public MedicationPrescriptionDosageInstructionComponent setRate(Ratio value) { + this.rate = value; + return this; + } + + /** + * @return {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.) + */ + public Ratio getMaxDosePerPeriod() { + if (this.maxDosePerPeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.maxDosePerPeriod"); + else if (Configuration.doAutoCreate()) + this.maxDosePerPeriod = new Ratio(); // cc + return this.maxDosePerPeriod; + } + + public boolean hasMaxDosePerPeriod() { + return this.maxDosePerPeriod != null && !this.maxDosePerPeriod.isEmpty(); + } + + /** + * @param value {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.) + */ + public MedicationPrescriptionDosageInstructionComponent setMaxDosePerPeriod(Ratio value) { + this.maxDosePerPeriod = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("text", "string", "Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("additionalInstructions", "CodeableConcept", "Additional instructions such as 'Swallow with plenty of water' which may or may not be coded.", 0, java.lang.Integer.MAX_VALUE, additionalInstructions)); + childrenList.add(new Property("scheduled[x]", "dateTime|Period|Timing", "The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'.", 0, java.lang.Integer.MAX_VALUE, scheduled)); + childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); + childrenList.add(new Property("site", "CodeableConcept", "A coded specification of the anatomic site where the medication first enters the body.", 0, java.lang.Integer.MAX_VALUE, site)); + childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient.", 0, java.lang.Integer.MAX_VALUE, route)); + childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\r\rTerminologies used often pre-coordinate this term with the route and or form of administration.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("dose[x]", "Range|Quantity", "The amount of therapeutic or other substance given at one administration event.", 0, java.lang.Integer.MAX_VALUE, dose)); + childrenList.add(new Property("rate", "Ratio", "Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.", 0, java.lang.Integer.MAX_VALUE, rate)); + childrenList.add(new Property("maxDosePerPeriod", "Ratio", "The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxDosePerPeriod)); + } + + public MedicationPrescriptionDosageInstructionComponent copy() { + MedicationPrescriptionDosageInstructionComponent dst = new MedicationPrescriptionDosageInstructionComponent(); + copyValues(dst); + dst.text = text == null ? null : text.copy(); + dst.additionalInstructions = additionalInstructions == null ? null : additionalInstructions.copy(); + dst.scheduled = scheduled == null ? null : scheduled.copy(); + dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); + dst.site = site == null ? null : site.copy(); + dst.route = route == null ? null : route.copy(); + dst.method = method == null ? null : method.copy(); + dst.dose = dose == null ? null : dose.copy(); + dst.rate = rate == null ? null : rate.copy(); + dst.maxDosePerPeriod = maxDosePerPeriod == null ? null : maxDosePerPeriod.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationPrescriptionDosageInstructionComponent)) + return false; + MedicationPrescriptionDosageInstructionComponent o = (MedicationPrescriptionDosageInstructionComponent) other; + return compareDeep(text, o.text, true) && compareDeep(additionalInstructions, o.additionalInstructions, true) + && compareDeep(scheduled, o.scheduled, true) && compareDeep(asNeeded, o.asNeeded, true) && compareDeep(site, o.site, true) + && compareDeep(route, o.route, true) && compareDeep(method, o.method, true) && compareDeep(dose, o.dose, true) + && compareDeep(rate, o.rate, true) && compareDeep(maxDosePerPeriod, o.maxDosePerPeriod, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationPrescriptionDosageInstructionComponent)) + return false; + MedicationPrescriptionDosageInstructionComponent o = (MedicationPrescriptionDosageInstructionComponent) other; + return compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (text == null || text.isEmpty()) && (additionalInstructions == null || additionalInstructions.isEmpty()) + && (scheduled == null || scheduled.isEmpty()) && (asNeeded == null || asNeeded.isEmpty()) + && (site == null || site.isEmpty()) && (route == null || route.isEmpty()) && (method == null || method.isEmpty()) + && (dose == null || dose.isEmpty()) && (rate == null || rate.isEmpty()) && (maxDosePerPeriod == null || maxDosePerPeriod.isEmpty()) + ; + } + + } + + @Block() + public static class MedicationPrescriptionDispenseComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications. + */ + @Child(name = "medication", type = {CodeableConcept.class, Medication.class}, order=1, min=0, max=1) + @Description(shortDefinition="Product to be supplied", formalDefinition="Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications." ) + protected Type medication; + + /** + * Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) It reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. Rationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription. + */ + @Child(name = "validityPeriod", type = {Period.class}, order=2, min=0, max=1) + @Description(shortDefinition="Time period supply is authorized for", formalDefinition="Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) \rIt reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. \rRationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription." ) + protected Period validityPeriod; + + /** + * An integer indicating the number of repeats of the Dispense. UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill. + */ + @Child(name = "numberOfRepeatsAllowed", type = {PositiveIntType.class}, order=3, min=0, max=1) + @Description(shortDefinition="# of refills authorized", formalDefinition="An integer indicating the number of repeats of the Dispense. \rUsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill." ) + protected PositiveIntType numberOfRepeatsAllowed; + + /** + * The amount that is to be dispensed for one fill. + */ + @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Amount of medication to supply per dispense", formalDefinition="The amount that is to be dispensed for one fill." ) + protected Quantity quantity; + + /** + * Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors. + */ + @Child(name = "expectedSupplyDuration", type = {Duration.class}, order=5, min=0, max=1) + @Description(shortDefinition="Days supply per dispense", formalDefinition="Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. \rIn some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors." ) + protected Duration expectedSupplyDuration; + + private static final long serialVersionUID = 312252966L; + + /* + * Constructor + */ + public MedicationPrescriptionDispenseComponent() { + super(); + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Type getMedication() { + return this.medication; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) + */ + public CodeableConcept getMedicationCodeableConcept() throws Exception { + if (!(this.medication instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.medication.getClass().getName()+" was encountered"); + return (CodeableConcept) this.medication; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Reference getMedicationReference() throws Exception { + if (!(this.medication instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.medication.getClass().getName()+" was encountered"); + return (Reference) this.medication; + } + + public boolean hasMedication() { + return this.medication != null && !this.medication.isEmpty(); + } + + /** + * @param value {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) + */ + public MedicationPrescriptionDispenseComponent setMedication(Type value) { + this.medication = value; + return this; + } + + /** + * @return {@link #validityPeriod} (Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) It reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. Rationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription.) + */ + public Period getValidityPeriod() { + if (this.validityPeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.validityPeriod"); + else if (Configuration.doAutoCreate()) + this.validityPeriod = new Period(); // cc + return this.validityPeriod; + } + + public boolean hasValidityPeriod() { + return this.validityPeriod != null && !this.validityPeriod.isEmpty(); + } + + /** + * @param value {@link #validityPeriod} (Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) It reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. Rationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription.) + */ + public MedicationPrescriptionDispenseComponent setValidityPeriod(Period value) { + this.validityPeriod = value; + return this; + } + + /** + * @return {@link #numberOfRepeatsAllowed} (An integer indicating the number of repeats of the Dispense. UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill.). This is the underlying object with id, value and extensions. The accessor "getNumberOfRepeatsAllowed" gives direct access to the value + */ + public PositiveIntType getNumberOfRepeatsAllowedElement() { + if (this.numberOfRepeatsAllowed == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.numberOfRepeatsAllowed"); + else if (Configuration.doAutoCreate()) + this.numberOfRepeatsAllowed = new PositiveIntType(); // bb + return this.numberOfRepeatsAllowed; + } + + public boolean hasNumberOfRepeatsAllowedElement() { + return this.numberOfRepeatsAllowed != null && !this.numberOfRepeatsAllowed.isEmpty(); + } + + public boolean hasNumberOfRepeatsAllowed() { + return this.numberOfRepeatsAllowed != null && !this.numberOfRepeatsAllowed.isEmpty(); + } + + /** + * @param value {@link #numberOfRepeatsAllowed} (An integer indicating the number of repeats of the Dispense. UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill.). This is the underlying object with id, value and extensions. The accessor "getNumberOfRepeatsAllowed" gives direct access to the value + */ + public MedicationPrescriptionDispenseComponent setNumberOfRepeatsAllowedElement(PositiveIntType value) { + this.numberOfRepeatsAllowed = value; + return this; + } + + /** + * @return An integer indicating the number of repeats of the Dispense. UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill. + */ + public int getNumberOfRepeatsAllowed() { + return this.numberOfRepeatsAllowed == null || this.numberOfRepeatsAllowed.isEmpty() ? 0 : this.numberOfRepeatsAllowed.getValue(); + } + + /** + * @param value An integer indicating the number of repeats of the Dispense. UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill. + */ + public MedicationPrescriptionDispenseComponent setNumberOfRepeatsAllowed(int value) { + if (this.numberOfRepeatsAllowed == null) + this.numberOfRepeatsAllowed = new PositiveIntType(); + this.numberOfRepeatsAllowed.setValue(value); + return this; + } + + /** + * @return {@link #quantity} (The amount that is to be dispensed for one fill.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount that is to be dispensed for one fill.) + */ + public MedicationPrescriptionDispenseComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #expectedSupplyDuration} (Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors.) + */ + public Duration getExpectedSupplyDuration() { + if (this.expectedSupplyDuration == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.expectedSupplyDuration"); + else if (Configuration.doAutoCreate()) + this.expectedSupplyDuration = new Duration(); // cc + return this.expectedSupplyDuration; + } + + public boolean hasExpectedSupplyDuration() { + return this.expectedSupplyDuration != null && !this.expectedSupplyDuration.isEmpty(); + } + + /** + * @param value {@link #expectedSupplyDuration} (Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors.) + */ + public MedicationPrescriptionDispenseComponent setExpectedSupplyDuration(Duration value) { + this.expectedSupplyDuration = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("medication[x]", "CodeableConcept|Reference(Medication)", "Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); + childrenList.add(new Property("validityPeriod", "Period", "Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) \rIt reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. \rRationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription.", 0, java.lang.Integer.MAX_VALUE, validityPeriod)); + childrenList.add(new Property("numberOfRepeatsAllowed", "positiveInt", "An integer indicating the number of repeats of the Dispense. \rUsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill.", 0, java.lang.Integer.MAX_VALUE, numberOfRepeatsAllowed)); + childrenList.add(new Property("quantity", "Quantity", "The amount that is to be dispensed for one fill.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("expectedSupplyDuration", "Duration", "Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. \rIn some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors.", 0, java.lang.Integer.MAX_VALUE, expectedSupplyDuration)); + } + + public MedicationPrescriptionDispenseComponent copy() { + MedicationPrescriptionDispenseComponent dst = new MedicationPrescriptionDispenseComponent(); + copyValues(dst); + dst.medication = medication == null ? null : medication.copy(); + dst.validityPeriod = validityPeriod == null ? null : validityPeriod.copy(); + dst.numberOfRepeatsAllowed = numberOfRepeatsAllowed == null ? null : numberOfRepeatsAllowed.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.expectedSupplyDuration = expectedSupplyDuration == null ? null : expectedSupplyDuration.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationPrescriptionDispenseComponent)) + return false; + MedicationPrescriptionDispenseComponent o = (MedicationPrescriptionDispenseComponent) other; + return compareDeep(medication, o.medication, true) && compareDeep(validityPeriod, o.validityPeriod, true) + && compareDeep(numberOfRepeatsAllowed, o.numberOfRepeatsAllowed, true) && compareDeep(quantity, o.quantity, true) + && compareDeep(expectedSupplyDuration, o.expectedSupplyDuration, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationPrescriptionDispenseComponent)) + return false; + MedicationPrescriptionDispenseComponent o = (MedicationPrescriptionDispenseComponent) other; + return compareValues(numberOfRepeatsAllowed, o.numberOfRepeatsAllowed, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (medication == null || medication.isEmpty()) && (validityPeriod == null || validityPeriod.isEmpty()) + && (numberOfRepeatsAllowed == null || numberOfRepeatsAllowed.isEmpty()) && (quantity == null || quantity.isEmpty()) + && (expectedSupplyDuration == null || expectedSupplyDuration.isEmpty()); + } + + } + + @Block() + public static class MedicationPrescriptionSubstitutionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A code signifying whether a different drug should be dispensed from what was prescribed. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="generic | formulary +", formalDefinition="A code signifying whether a different drug should be dispensed from what was prescribed." ) + protected CodeableConcept type; + + /** + * Indicates the reason for the substitution, or why substitution must or must not be performed. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Why should substitution (not) be made", formalDefinition="Indicates the reason for the substitution, or why substitution must or must not be performed." ) + protected CodeableConcept reason; + + private static final long serialVersionUID = 1693602518L; + + /* + * Constructor + */ + public MedicationPrescriptionSubstitutionComponent() { + super(); + } + + /* + * Constructor + */ + public MedicationPrescriptionSubstitutionComponent(CodeableConcept type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (A code signifying whether a different drug should be dispensed from what was prescribed.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionSubstitutionComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (A code signifying whether a different drug should be dispensed from what was prescribed.) + */ + public MedicationPrescriptionSubstitutionComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #reason} (Indicates the reason for the substitution, or why substitution must or must not be performed.) + */ + public CodeableConcept getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionSubstitutionComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new CodeableConcept(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Indicates the reason for the substitution, or why substitution must or must not be performed.) + */ + public MedicationPrescriptionSubstitutionComponent setReason(CodeableConcept value) { + this.reason = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "A code signifying whether a different drug should be dispensed from what was prescribed.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("reason", "CodeableConcept", "Indicates the reason for the substitution, or why substitution must or must not be performed.", 0, java.lang.Integer.MAX_VALUE, reason)); + } + + public MedicationPrescriptionSubstitutionComponent copy() { + MedicationPrescriptionSubstitutionComponent dst = new MedicationPrescriptionSubstitutionComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.reason = reason == null ? null : reason.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationPrescriptionSubstitutionComponent)) + return false; + MedicationPrescriptionSubstitutionComponent o = (MedicationPrescriptionSubstitutionComponent) other; + return compareDeep(type, o.type, true) && compareDeep(reason, o.reason, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationPrescriptionSubstitutionComponent)) + return false; + MedicationPrescriptionSubstitutionComponent o = (MedicationPrescriptionSubstitutionComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (reason == null || reason.isEmpty()) + ; + } + + } + + /** + * External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External identifier", formalDefinition="External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system." ) + protected List identifier; + + /** + * The date (and perhaps time) when the prescription was written. + */ + @Child(name = "dateWritten", type = {DateTimeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="When prescription was authorized", formalDefinition="The date (and perhaps time) when the prescription was written." ) + protected DateTimeType dateWritten; + + /** + * A code specifying the state of the order. Generally this will be active or completed state. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="active | on-hold | completed | entered-in-error | stopped | superceded | draft", formalDefinition="A code specifying the state of the order. Generally this will be active or completed state." ) + protected Enumeration status; + + /** + * A link to a resource representing the person to whom the medication will be given. + */ + @Child(name = "patient", type = {Patient.class}, order=3, min=0, max=1) + @Description(shortDefinition="Who prescription is for", formalDefinition="A link to a resource representing the person to whom the medication will be given." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (A link to a resource representing the person to whom the medication will be given.) + */ + protected Patient patientTarget; + + /** + * The healthcare professional responsible for authorizing the prescription. + */ + @Child(name = "prescriber", type = {Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="Who ordered the medication(s)", formalDefinition="The healthcare professional responsible for authorizing the prescription." ) + protected Reference prescriber; + + /** + * The actual object that is the target of the reference (The healthcare professional responsible for authorizing the prescription.) + */ + protected Practitioner prescriberTarget; + + /** + * A link to a resource that identifies the particular occurrence of contact between patient and health care provider. + */ + @Child(name = "encounter", type = {Encounter.class}, order=5, min=0, max=1) + @Description(shortDefinition="Created during encounter / admission / stay", formalDefinition="A link to a resource that identifies the particular occurrence of contact between patient and health care provider." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + protected Encounter encounterTarget; + + /** + * Can be the reason or the indication for writing the prescription. + */ + @Child(name = "reason", type = {CodeableConcept.class, Condition.class}, order=6, min=0, max=1) + @Description(shortDefinition="Reason or indication for writing the prescription", formalDefinition="Can be the reason or the indication for writing the prescription." ) + protected Type reason; + + /** + * Extra information about the prescription that could not be conveyed by the other attributes. + */ + @Child(name = "note", type = {StringType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Information about the prescription", formalDefinition="Extra information about the prescription that could not be conveyed by the other attributes." ) + protected StringType note; + + /** + * Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications. + */ + @Child(name = "medication", type = {CodeableConcept.class, Medication.class}, order=8, min=1, max=1) + @Description(shortDefinition="Medication to be taken", formalDefinition="Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications." ) + protected Type medication; + + /** + * Indicates how the medication is to be used by the patient. + */ + @Child(name = "dosageInstruction", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="How medication should be taken", formalDefinition="Indicates how the medication is to be used by the patient." ) + protected List dosageInstruction; + + /** + * Deals with details of the dispense part of the order. + */ + @Child(name = "dispense", type = {}, order=10, min=0, max=1) + @Description(shortDefinition="Medication supply authorization", formalDefinition="Deals with details of the dispense part of the order." ) + protected MedicationPrescriptionDispenseComponent dispense; + + /** + * Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done. + */ + @Child(name = "substitution", type = {}, order=11, min=0, max=1) + @Description(shortDefinition="Any restrictions on medication substitution?", formalDefinition="Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done." ) + protected MedicationPrescriptionSubstitutionComponent substitution; + + private static final long serialVersionUID = 1219917448L; + + /* + * Constructor + */ + public MedicationPrescription() { + super(); + } + + /* + * Constructor + */ + public MedicationPrescription(Type medication) { + super(); + this.medication = medication; + } + + /** + * @return {@link #identifier} (External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public MedicationPrescription addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value + */ + public DateTimeType getDateWrittenElement() { + if (this.dateWritten == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.dateWritten"); + else if (Configuration.doAutoCreate()) + this.dateWritten = new DateTimeType(); // bb + return this.dateWritten; + } + + public boolean hasDateWrittenElement() { + return this.dateWritten != null && !this.dateWritten.isEmpty(); + } + + public boolean hasDateWritten() { + return this.dateWritten != null && !this.dateWritten.isEmpty(); + } + + /** + * @param value {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value + */ + public MedicationPrescription setDateWrittenElement(DateTimeType value) { + this.dateWritten = value; + return this; + } + + /** + * @return The date (and perhaps time) when the prescription was written. + */ + public Date getDateWritten() { + return this.dateWritten == null ? null : this.dateWritten.getValue(); + } + + /** + * @param value The date (and perhaps time) when the prescription was written. + */ + public MedicationPrescription setDateWritten(Date value) { + if (value == null) + this.dateWritten = null; + else { + if (this.dateWritten == null) + this.dateWritten = new DateTimeType(); + this.dateWritten.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (A code specifying the state of the order. Generally this will be active or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new MedicationPrescriptionStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (A code specifying the state of the order. Generally this will be active or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public MedicationPrescription setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return A code specifying the state of the order. Generally this will be active or completed state. + */ + public MedicationPrescriptionStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value A code specifying the state of the order. Generally this will be active or completed state. + */ + public MedicationPrescription setStatus(MedicationPrescriptionStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new MedicationPrescriptionStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #patient} (A link to a resource representing the person to whom the medication will be given.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (A link to a resource representing the person to whom the medication will be given.) + */ + public MedicationPrescription setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person to whom the medication will be given.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person to whom the medication will be given.) + */ + public MedicationPrescription setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.) + */ + public Reference getPrescriber() { + if (this.prescriber == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.prescriber"); + else if (Configuration.doAutoCreate()) + this.prescriber = new Reference(); // cc + return this.prescriber; + } + + public boolean hasPrescriber() { + return this.prescriber != null && !this.prescriber.isEmpty(); + } + + /** + * @param value {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.) + */ + public MedicationPrescription setPrescriber(Reference value) { + this.prescriber = value; + return this; + } + + /** + * @return {@link #prescriber} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The healthcare professional responsible for authorizing the prescription.) + */ + public Practitioner getPrescriberTarget() { + if (this.prescriberTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.prescriber"); + else if (Configuration.doAutoCreate()) + this.prescriberTarget = new Practitioner(); // aa + return this.prescriberTarget; + } + + /** + * @param value {@link #prescriber} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The healthcare professional responsible for authorizing the prescription.) + */ + public MedicationPrescription setPrescriberTarget(Practitioner value) { + this.prescriberTarget = value; + return this; + } + + /** + * @return {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public MedicationPrescription setEncounter(Reference value) { + this.encounter = value; + return this; + } + + /** + * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + return this.encounterTarget; + } + + /** + * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public MedicationPrescription setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) + */ + public Type getReason() { + return this.reason; + } + + /** + * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) + */ + public CodeableConcept getReasonCodeableConcept() throws Exception { + if (!(this.reason instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (CodeableConcept) this.reason; + } + + /** + * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) + */ + public Reference getReasonReference() throws Exception { + if (!(this.reason instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (Reference) this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Can be the reason or the indication for writing the prescription.) + */ + public MedicationPrescription setReason(Type value) { + this.reason = value; + return this; + } + + /** + * @return {@link #note} (Extra information about the prescription that could not be conveyed by the other attributes.). 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 MedicationPrescription.note"); + else if (Configuration.doAutoCreate()) + this.note = new StringType(); // bb + 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} (Extra information about the prescription that could not be conveyed by the other attributes.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value + */ + public MedicationPrescription setNoteElement(StringType value) { + this.note = value; + return this; + } + + /** + * @return Extra information about the prescription that could not be conveyed by the other attributes. + */ + public String getNote() { + return this.note == null ? null : this.note.getValue(); + } + + /** + * @param value Extra information about the prescription that could not be conveyed by the other attributes. + */ + public MedicationPrescription setNote(String value) { + if (Utilities.noString(value)) + this.note = null; + else { + if (this.note == null) + this.note = new StringType(); + this.note.setValue(value); + } + return this; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Type getMedication() { + return this.medication; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) + */ + public CodeableConcept getMedicationCodeableConcept() throws Exception { + if (!(this.medication instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.medication.getClass().getName()+" was encountered"); + return (CodeableConcept) this.medication; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Reference getMedicationReference() throws Exception { + if (!(this.medication instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.medication.getClass().getName()+" was encountered"); + return (Reference) this.medication; + } + + public boolean hasMedication() { + return this.medication != null && !this.medication.isEmpty(); + } + + /** + * @param value {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) + */ + public MedicationPrescription setMedication(Type value) { + this.medication = value; + return this; + } + + /** + * @return {@link #dosageInstruction} (Indicates how the medication is to be used by the patient.) + */ + public List getDosageInstruction() { + if (this.dosageInstruction == null) + this.dosageInstruction = new ArrayList(); + return this.dosageInstruction; + } + + public boolean hasDosageInstruction() { + if (this.dosageInstruction == null) + return false; + for (MedicationPrescriptionDosageInstructionComponent item : this.dosageInstruction) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dosageInstruction} (Indicates how the medication is to be used by the patient.) + */ + // syntactic sugar + public MedicationPrescriptionDosageInstructionComponent addDosageInstruction() { //3 + MedicationPrescriptionDosageInstructionComponent t = new MedicationPrescriptionDosageInstructionComponent(); + if (this.dosageInstruction == null) + this.dosageInstruction = new ArrayList(); + this.dosageInstruction.add(t); + return t; + } + + // syntactic sugar + public MedicationPrescription addDosageInstruction(MedicationPrescriptionDosageInstructionComponent t) { //3 + if (t == null) + return this; + if (this.dosageInstruction == null) + this.dosageInstruction = new ArrayList(); + this.dosageInstruction.add(t); + return this; + } + + /** + * @return {@link #dispense} (Deals with details of the dispense part of the order.) + */ + public MedicationPrescriptionDispenseComponent getDispense() { + if (this.dispense == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.dispense"); + else if (Configuration.doAutoCreate()) + this.dispense = new MedicationPrescriptionDispenseComponent(); // cc + return this.dispense; + } + + public boolean hasDispense() { + return this.dispense != null && !this.dispense.isEmpty(); + } + + /** + * @param value {@link #dispense} (Deals with details of the dispense part of the order.) + */ + public MedicationPrescription setDispense(MedicationPrescriptionDispenseComponent value) { + this.dispense = value; + return this; + } + + /** + * @return {@link #substitution} (Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done.) + */ + public MedicationPrescriptionSubstitutionComponent getSubstitution() { + if (this.substitution == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.substitution"); + else if (Configuration.doAutoCreate()) + this.substitution = new MedicationPrescriptionSubstitutionComponent(); // cc + return this.substitution; + } + + public boolean hasSubstitution() { + return this.substitution != null && !this.substitution.isEmpty(); + } + + /** + * @param value {@link #substitution} (Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done.) + */ + public MedicationPrescription setSubstitution(MedicationPrescriptionSubstitutionComponent value) { + this.substitution = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("dateWritten", "dateTime", "The date (and perhaps time) when the prescription was written.", 0, java.lang.Integer.MAX_VALUE, dateWritten)); + childrenList.add(new Property("status", "code", "A code specifying the state of the order. Generally this will be active or completed state.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person to whom the medication will be given.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("prescriber", "Reference(Practitioner)", "The healthcare professional responsible for authorizing the prescription.", 0, java.lang.Integer.MAX_VALUE, prescriber)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "A link to a resource that identifies the particular occurrence of contact between patient and health care provider.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Condition)", "Can be the reason or the indication for writing the prescription.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("note", "string", "Extra information about the prescription that could not be conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("medication[x]", "CodeableConcept|Reference(Medication)", "Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); + childrenList.add(new Property("dosageInstruction", "", "Indicates how the medication is to be used by the patient.", 0, java.lang.Integer.MAX_VALUE, dosageInstruction)); + childrenList.add(new Property("dispense", "", "Deals with details of the dispense part of the order.", 0, java.lang.Integer.MAX_VALUE, dispense)); + childrenList.add(new Property("substitution", "", "Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done.", 0, java.lang.Integer.MAX_VALUE, substitution)); + } + + public MedicationPrescription copy() { + MedicationPrescription dst = new MedicationPrescription(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.dateWritten = dateWritten == null ? null : dateWritten.copy(); + dst.status = status == null ? null : status.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.prescriber = prescriber == null ? null : prescriber.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.note = note == null ? null : note.copy(); + dst.medication = medication == null ? null : medication.copy(); + if (dosageInstruction != null) { + dst.dosageInstruction = new ArrayList(); + for (MedicationPrescriptionDosageInstructionComponent i : dosageInstruction) + dst.dosageInstruction.add(i.copy()); + }; + dst.dispense = dispense == null ? null : dispense.copy(); + dst.substitution = substitution == null ? null : substitution.copy(); + return dst; + } + + protected MedicationPrescription typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationPrescription)) + return false; + MedicationPrescription o = (MedicationPrescription) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(dateWritten, o.dateWritten, true) + && compareDeep(status, o.status, true) && compareDeep(patient, o.patient, true) && compareDeep(prescriber, o.prescriber, true) + && compareDeep(encounter, o.encounter, true) && compareDeep(reason, o.reason, true) && compareDeep(note, o.note, true) + && compareDeep(medication, o.medication, true) && compareDeep(dosageInstruction, o.dosageInstruction, true) + && compareDeep(dispense, o.dispense, true) && compareDeep(substitution, o.substitution, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationPrescription)) + return false; + MedicationPrescription o = (MedicationPrescription) other; + return compareValues(dateWritten, o.dateWritten, true) && compareValues(status, o.status, true) && compareValues(note, o.note, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (dateWritten == null || dateWritten.isEmpty()) + && (status == null || status.isEmpty()) && (patient == null || patient.isEmpty()) && (prescriber == null || prescriber.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (reason == null || reason.isEmpty()) && (note == null || note.isEmpty()) + && (medication == null || medication.isEmpty()) && (dosageInstruction == null || dosageInstruction.isEmpty()) + && (dispense == null || dispense.isEmpty()) && (substitution == null || substitution.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.MedicationPrescription; + } + + @SearchParamDefinition(name="prescriber", path="MedicationPrescription.prescriber", description="Who ordered the medication(s)", type="reference" ) + public static final String SP_PRESCRIBER = "prescriber"; + @SearchParamDefinition(name="identifier", path="MedicationPrescription.identifier", description="Return prescriptions with this external identity", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="patient", path="MedicationPrescription.patient", description="The identity of a patient to list dispenses for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="datewritten", path="MedicationPrescription.dateWritten", description="Return prescriptions written on this date", type="date" ) + public static final String SP_DATEWRITTEN = "datewritten"; + @SearchParamDefinition(name="medication", path="MedicationPrescription.medicationReference", description="Code for medicine or text in medicine name", type="reference" ) + public static final String SP_MEDICATION = "medication"; + @SearchParamDefinition(name="encounter", path="MedicationPrescription.encounter", description="Return prescriptions with this encounter identity", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + @SearchParamDefinition(name="status", path="MedicationPrescription.status", description="Status of the prescription", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/MedicationStatement.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/MedicationStatement.java index 68035089443..02715895f21 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/MedicationStatement.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/MedicationStatement.java @@ -1,1278 +1,1240 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A record of medication being taken by a patient, or that the medication has been given to a patient where the record is the result of a report from the patient or another clinician. - */ -@ResourceDef(name="MedicationStatement", profile="http://hl7.org/fhir/Profile/MedicationStatement") -public class MedicationStatement extends DomainResource { - - public enum MedicationStatementStatus { - /** - * The medication is still being taken. - */ - INPROGRESS, - /** - * All actions that are implied by the statement have occurred. - */ - COMPLETED, - /** - * The statement was entered in error and therefore nullified. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static MedicationStatementStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("completed".equals(codeString)) - return COMPLETED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new Exception("Unknown MedicationStatementStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INPROGRESS: return "in-progress"; - case COMPLETED: return "completed"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPROGRESS: return ""; - case COMPLETED: return ""; - case ENTEREDINERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPROGRESS: return "The medication is still being taken."; - case COMPLETED: return "All actions that are implied by the statement have occurred."; - case ENTEREDINERROR: return "The statement was entered in error and therefore nullified."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPROGRESS: return "In Progress"; - case COMPLETED: return "Completed"; - case ENTEREDINERROR: return "Entered In Error"; - default: return "?"; - } - } - } - - public static class MedicationStatementStatusEnumFactory implements EnumFactory { - public MedicationStatementStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return MedicationStatementStatus.INPROGRESS; - if ("completed".equals(codeString)) - return MedicationStatementStatus.COMPLETED; - if ("entered-in-error".equals(codeString)) - return MedicationStatementStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown MedicationStatementStatus code '"+codeString+"'"); - } - public String toCode(MedicationStatementStatus code) { - if (code == MedicationStatementStatus.INPROGRESS) - return "in-progress"; - if (code == MedicationStatementStatus.COMPLETED) - return "completed"; - if (code == MedicationStatementStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - } - - @Block() - public static class MedicationStatementDosageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. - */ - @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Dosage Instructions", formalDefinition="Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication." ) - protected StringType text; - - /** - * The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". - */ - @Child(name = "schedule", type = {Timing.class}, order=2, min=0, max=1) - @Description(shortDefinition="When/how often was medication taken?", formalDefinition="The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'." ) - protected Timing schedule; - - /** - * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication. - */ - @Child(name = "asNeeded", type = {BooleanType.class, CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Take 'as needed' f(or x)", formalDefinition="If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication." ) - protected Type asNeeded; - - /** - * A coded specification of the anatomic site where the medication first enters the body. - */ - @Child(name = "site", type = {CodeableConcept.class}, order=4, min=0, max=1) - @Description(shortDefinition="Where on body was medication administered?", formalDefinition="A coded specification of the anatomic site where the medication first enters the body." ) - protected CodeableConcept site; - - /** - * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject. - */ - @Child(name = "route", type = {CodeableConcept.class}, order=5, min=0, max=1) - @Description(shortDefinition="How did the medication enter the body?", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject." ) - protected CodeableConcept route; - - /** - * A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. - -Terminologies used often pre-coordinate this term with the route and or form of administration. - */ - @Child(name = "method", type = {CodeableConcept.class}, order=6, min=0, max=1) - @Description(shortDefinition="Technique used to administer medication", formalDefinition="A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\r\rTerminologies used often pre-coordinate this term with the route and or form of administration." ) - protected CodeableConcept method; - - /** - * The amount of therapeutic or other substance given at one administration event. - */ - @Child(name = "quantity", type = {Quantity.class}, order=7, min=0, max=1) - @Description(shortDefinition="Amount administered in one dose", formalDefinition="The amount of therapeutic or other substance given at one administration event." ) - protected Quantity quantity; - - /** - * Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. - */ - @Child(name = "rate", type = {Ratio.class}, order=8, min=0, max=1) - @Description(shortDefinition="Dose quantity per unit of time", formalDefinition="Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours." ) - protected Ratio rate; - - /** - * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours. - */ - @Child(name = "maxDosePerPeriod", type = {Ratio.class}, order=9, min=0, max=1) - @Description(shortDefinition="Maximum dose that was consumed per unit of time", formalDefinition="The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours." ) - protected Ratio maxDosePerPeriod; - - private static final long serialVersionUID = 1729854997L; - - /* - * Constructor - */ - public MedicationStatementDosageComponent() { - super(); - } - - /** - * @return {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatementDosageComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public MedicationStatementDosageComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. - */ - public MedicationStatementDosageComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Timing getSchedule() { - if (this.schedule == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatementDosageComponent.schedule"); - else if (Configuration.doAutoCreate()) - this.schedule = new Timing(); // cc - return this.schedule; - } - - public boolean hasSchedule() { - return this.schedule != null && !this.schedule.isEmpty(); - } - - /** - * @param value {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public MedicationStatementDosageComponent setSchedule(Timing value) { - this.schedule = value; - return this; - } - - /** - * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public Type getAsNeeded() { - return this.asNeeded; - } - - /** - * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public BooleanType getAsNeededBooleanType() throws Exception { - if (!(this.asNeeded instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (BooleanType) this.asNeeded; - } - - /** - * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public CodeableConcept getAsNeededCodeableConcept() throws Exception { - if (!(this.asNeeded instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (CodeableConcept) this.asNeeded; - } - - public boolean hasAsNeeded() { - return this.asNeeded != null && !this.asNeeded.isEmpty(); - } - - /** - * @param value {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public MedicationStatementDosageComponent setAsNeeded(Type value) { - this.asNeeded = value; - return this; - } - - /** - * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) - */ - public CodeableConcept getSite() { - if (this.site == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatementDosageComponent.site"); - else if (Configuration.doAutoCreate()) - this.site = new CodeableConcept(); // cc - return this.site; - } - - public boolean hasSite() { - return this.site != null && !this.site.isEmpty(); - } - - /** - * @param value {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) - */ - public MedicationStatementDosageComponent setSite(CodeableConcept value) { - this.site = value; - return this; - } - - /** - * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) - */ - public CodeableConcept getRoute() { - if (this.route == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatementDosageComponent.route"); - else if (Configuration.doAutoCreate()) - this.route = new CodeableConcept(); // cc - return this.route; - } - - public boolean hasRoute() { - return this.route != null && !this.route.isEmpty(); - } - - /** - * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) - */ - public MedicationStatementDosageComponent setRoute(CodeableConcept value) { - this.route = value; - return this; - } - - /** - * @return {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. - -Terminologies used often pre-coordinate this term with the route and or form of administration.) - */ - public CodeableConcept getMethod() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatementDosageComponent.method"); - else if (Configuration.doAutoCreate()) - this.method = new CodeableConcept(); // cc - return this.method; - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** - * @param value {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. - -Terminologies used often pre-coordinate this term with the route and or form of administration.) - */ - public MedicationStatementDosageComponent setMethod(CodeableConcept value) { - this.method = value; - return this; - } - - /** - * @return {@link #quantity} (The amount of therapeutic or other substance given at one administration event.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatementDosageComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of therapeutic or other substance given at one administration event.) - */ - public MedicationStatementDosageComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) - */ - public Ratio getRate() { - if (this.rate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatementDosageComponent.rate"); - else if (Configuration.doAutoCreate()) - this.rate = new Ratio(); // cc - return this.rate; - } - - public boolean hasRate() { - return this.rate != null && !this.rate.isEmpty(); - } - - /** - * @param value {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) - */ - public MedicationStatementDosageComponent setRate(Ratio value) { - this.rate = value; - return this; - } - - /** - * @return {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.) - */ - public Ratio getMaxDosePerPeriod() { - if (this.maxDosePerPeriod == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatementDosageComponent.maxDosePerPeriod"); - else if (Configuration.doAutoCreate()) - this.maxDosePerPeriod = new Ratio(); // cc - return this.maxDosePerPeriod; - } - - public boolean hasMaxDosePerPeriod() { - return this.maxDosePerPeriod != null && !this.maxDosePerPeriod.isEmpty(); - } - - /** - * @param value {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.) - */ - public MedicationStatementDosageComponent setMaxDosePerPeriod(Ratio value) { - this.maxDosePerPeriod = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("text", "string", "Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("schedule", "Timing", "The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'.", 0, java.lang.Integer.MAX_VALUE, schedule)); - childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); - childrenList.add(new Property("site", "CodeableConcept", "A coded specification of the anatomic site where the medication first enters the body.", 0, java.lang.Integer.MAX_VALUE, site)); - childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.", 0, java.lang.Integer.MAX_VALUE, route)); - childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\r\rTerminologies used often pre-coordinate this term with the route and or form of administration.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("quantity", "Quantity", "The amount of therapeutic or other substance given at one administration event.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("rate", "Ratio", "Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.", 0, java.lang.Integer.MAX_VALUE, rate)); - childrenList.add(new Property("maxDosePerPeriod", "Ratio", "The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxDosePerPeriod)); - } - - public MedicationStatementDosageComponent copy() { - MedicationStatementDosageComponent dst = new MedicationStatementDosageComponent(); - copyValues(dst); - dst.text = text == null ? null : text.copy(); - dst.schedule = schedule == null ? null : schedule.copy(); - dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); - dst.site = site == null ? null : site.copy(); - dst.route = route == null ? null : route.copy(); - dst.method = method == null ? null : method.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.rate = rate == null ? null : rate.copy(); - dst.maxDosePerPeriod = maxDosePerPeriod == null ? null : maxDosePerPeriod.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationStatementDosageComponent)) - return false; - MedicationStatementDosageComponent o = (MedicationStatementDosageComponent) other; - return compareDeep(text, o.text, true) && compareDeep(schedule, o.schedule, true) && compareDeep(asNeeded, o.asNeeded, true) - && compareDeep(site, o.site, true) && compareDeep(route, o.route, true) && compareDeep(method, o.method, true) - && compareDeep(quantity, o.quantity, true) && compareDeep(rate, o.rate, true) && compareDeep(maxDosePerPeriod, o.maxDosePerPeriod, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationStatementDosageComponent)) - return false; - MedicationStatementDosageComponent o = (MedicationStatementDosageComponent) other; - return compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (text == null || text.isEmpty()) && (schedule == null || schedule.isEmpty()) - && (asNeeded == null || asNeeded.isEmpty()) && (site == null || site.isEmpty()) && (route == null || route.isEmpty()) - && (method == null || method.isEmpty()) && (quantity == null || quantity.isEmpty()) && (rate == null || rate.isEmpty()) - && (maxDosePerPeriod == null || maxDosePerPeriod.isEmpty()); - } - - } - - /** - * External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External Identifier", formalDefinition="External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated." ) - protected List identifier; - - /** - * The person or animal who is /was taking the medication. - */ - @Child(name = "patient", type = {Patient.class}, order=1, min=0, max=1) - @Description(shortDefinition="Who was/is taking medication", formalDefinition="The person or animal who is /was taking the medication." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The person or animal who is /was taking the medication.) - */ - protected Patient patientTarget; - - /** - * The person who provided the information about the taking of this medication. - */ - @Child(name = "informationSource", type = {Patient.class, Practitioner.class, RelatedPerson.class}, order=2, min=0, max=1) - @Description(shortDefinition="", formalDefinition="The person who provided the information about the taking of this medication." ) - protected Reference informationSource; - - /** - * The actual object that is the target of the reference (The person who provided the information about the taking of this medication.) - */ - protected Resource informationSourceTarget; - - /** - * The date when the medication statement was asserted by the information source. - */ - @Child(name = "dateAsserted", type = {DateTimeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="When the statement was asserted?", formalDefinition="The date when the medication statement was asserted by the information source." ) - protected DateTimeType dateAsserted; - - /** - * A code specifying the state of the statement. Generally this will be in-progress or completed state. - */ - @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1) - @Description(shortDefinition="in-progress | completed | entered-in-error", formalDefinition="A code specifying the state of the statement. Generally this will be in-progress or completed state." ) - protected Enumeration status; - - /** - * Set this to true if the record is saying that the medication was NOT taken. - */ - @Child(name = "wasNotGiven", type = {BooleanType.class}, order=5, min=0, max=1) - @Description(shortDefinition="True if medication is/was not being taken", formalDefinition="Set this to true if the record is saying that the medication was NOT taken." ) - protected BooleanType wasNotGiven; - - /** - * A code indicating why the medication was not taken. - */ - @Child(name = "reasonNotGiven", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="True if asserting medication was not given", formalDefinition="A code indicating why the medication was not taken." ) - protected List reasonNotGiven; - - /** - * A reason for why the medication is being/was taken. - */ - @Child(name = "reasonForUse", type = {CodeableConcept.class, Condition.class}, order=7, min=0, max=1) - @Description(shortDefinition="", formalDefinition="A reason for why the medication is being/was taken." ) - protected Type reasonForUse; - - /** - * The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the 'wasNotGiven' attribute is true). - */ - @Child(name = "effective", type = {DateTimeType.class, Period.class}, order=8, min=0, max=1) - @Description(shortDefinition="Over what period was medication consumed?", formalDefinition="The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the 'wasNotGiven' attribute is true)." ) - protected Type effective; - - /** - * Provides extra information about the medication statement that is not conveyed by the other attributes. - */ - @Child(name = "note", type = {StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Further information about the statement", formalDefinition="Provides extra information about the medication statement that is not conveyed by the other attributes." ) - protected StringType note; - - /** - * Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. - */ - @Child(name = "medication", type = {Medication.class}, order=10, min=0, max=1) - @Description(shortDefinition="What medication was taken?", formalDefinition="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." ) - protected Reference medication; - - /** - * The actual object that is the target of the reference (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - protected Medication medicationTarget; - - /** - * Indicates how the medication is/was used by the patient. - */ - @Child(name = "dosage", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Details of how medication was taken", formalDefinition="Indicates how the medication is/was used by the patient." ) - protected List dosage; - - private static final long serialVersionUID = -1525633004L; - - /* - * Constructor - */ - public MedicationStatement() { - super(); - } - - /* - * Constructor - */ - public MedicationStatement(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #identifier} (External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public MedicationStatement addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #patient} (The person or animal who is /was taking the medication.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The person or animal who is /was taking the medication.) - */ - public MedicationStatement setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person or animal who is /was taking the medication.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person or animal who is /was taking the medication.) - */ - public MedicationStatement setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #informationSource} (The person who provided the information about the taking of this medication.) - */ - public Reference getInformationSource() { - if (this.informationSource == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.informationSource"); - else if (Configuration.doAutoCreate()) - this.informationSource = new Reference(); // cc - return this.informationSource; - } - - public boolean hasInformationSource() { - return this.informationSource != null && !this.informationSource.isEmpty(); - } - - /** - * @param value {@link #informationSource} (The person who provided the information about the taking of this medication.) - */ - public MedicationStatement setInformationSource(Reference value) { - this.informationSource = value; - return this; - } - - /** - * @return {@link #informationSource} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person who provided the information about the taking of this medication.) - */ - public Resource getInformationSourceTarget() { - return this.informationSourceTarget; - } - - /** - * @param value {@link #informationSource} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person who provided the information about the taking of this medication.) - */ - public MedicationStatement setInformationSourceTarget(Resource value) { - this.informationSourceTarget = value; - return this; - } - - /** - * @return {@link #dateAsserted} (The date when the medication statement was asserted by the information source.). This is the underlying object with id, value and extensions. The accessor "getDateAsserted" gives direct access to the value - */ - public DateTimeType getDateAssertedElement() { - if (this.dateAsserted == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.dateAsserted"); - else if (Configuration.doAutoCreate()) - this.dateAsserted = new DateTimeType(); // bb - return this.dateAsserted; - } - - public boolean hasDateAssertedElement() { - return this.dateAsserted != null && !this.dateAsserted.isEmpty(); - } - - public boolean hasDateAsserted() { - return this.dateAsserted != null && !this.dateAsserted.isEmpty(); - } - - /** - * @param value {@link #dateAsserted} (The date when the medication statement was asserted by the information source.). This is the underlying object with id, value and extensions. The accessor "getDateAsserted" gives direct access to the value - */ - public MedicationStatement setDateAssertedElement(DateTimeType value) { - this.dateAsserted = value; - return this; - } - - /** - * @return The date when the medication statement was asserted by the information source. - */ - public Date getDateAsserted() { - return this.dateAsserted == null ? null : this.dateAsserted.getValue(); - } - - /** - * @param value The date when the medication statement was asserted by the information source. - */ - public MedicationStatement setDateAsserted(Date value) { - if (value == null) - this.dateAsserted = null; - else { - if (this.dateAsserted == null) - this.dateAsserted = new DateTimeType(); - this.dateAsserted.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (A code specifying the state of the statement. Generally this will be in-progress or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new MedicationStatementStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (A code specifying the state of the statement. Generally this will be in-progress or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public MedicationStatement setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return A code specifying the state of the statement. Generally this will be in-progress or completed state. - */ - public MedicationStatementStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value A code specifying the state of the statement. Generally this will be in-progress or completed state. - */ - public MedicationStatement setStatus(MedicationStatementStatus value) { - if (this.status == null) - this.status = new Enumeration(new MedicationStatementStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #wasNotGiven} (Set this to true if the record is saying that the medication was NOT taken.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value - */ - public BooleanType getWasNotGivenElement() { - if (this.wasNotGiven == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.wasNotGiven"); - else if (Configuration.doAutoCreate()) - this.wasNotGiven = new BooleanType(); // bb - return this.wasNotGiven; - } - - public boolean hasWasNotGivenElement() { - return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); - } - - public boolean hasWasNotGiven() { - return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); - } - - /** - * @param value {@link #wasNotGiven} (Set this to true if the record is saying that the medication was NOT taken.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value - */ - public MedicationStatement setWasNotGivenElement(BooleanType value) { - this.wasNotGiven = value; - return this; - } - - /** - * @return Set this to true if the record is saying that the medication was NOT taken. - */ - public boolean getWasNotGiven() { - return this.wasNotGiven == null || this.wasNotGiven.isEmpty() ? false : this.wasNotGiven.getValue(); - } - - /** - * @param value Set this to true if the record is saying that the medication was NOT taken. - */ - public MedicationStatement setWasNotGiven(boolean value) { - if (this.wasNotGiven == null) - this.wasNotGiven = new BooleanType(); - this.wasNotGiven.setValue(value); - return this; - } - - /** - * @return {@link #reasonNotGiven} (A code indicating why the medication was not taken.) - */ - public List getReasonNotGiven() { - if (this.reasonNotGiven == null) - this.reasonNotGiven = new ArrayList(); - return this.reasonNotGiven; - } - - public boolean hasReasonNotGiven() { - if (this.reasonNotGiven == null) - return false; - for (CodeableConcept item : this.reasonNotGiven) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reasonNotGiven} (A code indicating why the medication was not taken.) - */ - // syntactic sugar - public CodeableConcept addReasonNotGiven() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reasonNotGiven == null) - this.reasonNotGiven = new ArrayList(); - this.reasonNotGiven.add(t); - return t; - } - - // syntactic sugar - public MedicationStatement addReasonNotGiven(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reasonNotGiven == null) - this.reasonNotGiven = new ArrayList(); - this.reasonNotGiven.add(t); - return this; - } - - /** - * @return {@link #reasonForUse} (A reason for why the medication is being/was taken.) - */ - public Type getReasonForUse() { - return this.reasonForUse; - } - - /** - * @return {@link #reasonForUse} (A reason for why the medication is being/was taken.) - */ - public CodeableConcept getReasonForUseCodeableConcept() throws Exception { - if (!(this.reasonForUse instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.reasonForUse.getClass().getName()+" was encountered"); - return (CodeableConcept) this.reasonForUse; - } - - /** - * @return {@link #reasonForUse} (A reason for why the medication is being/was taken.) - */ - public Reference getReasonForUseReference() throws Exception { - if (!(this.reasonForUse instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.reasonForUse.getClass().getName()+" was encountered"); - return (Reference) this.reasonForUse; - } - - public boolean hasReasonForUse() { - return this.reasonForUse != null && !this.reasonForUse.isEmpty(); - } - - /** - * @param value {@link #reasonForUse} (A reason for why the medication is being/was taken.) - */ - public MedicationStatement setReasonForUse(Type value) { - this.reasonForUse = value; - return this; - } - - /** - * @return {@link #effective} (The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the 'wasNotGiven' attribute is true).) - */ - public Type getEffective() { - return this.effective; - } - - /** - * @return {@link #effective} (The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the 'wasNotGiven' attribute is true).) - */ - public DateTimeType getEffectiveDateTimeType() throws Exception { - if (!(this.effective instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.effective.getClass().getName()+" was encountered"); - return (DateTimeType) this.effective; - } - - /** - * @return {@link #effective} (The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the 'wasNotGiven' attribute is true).) - */ - public Period getEffectivePeriod() throws Exception { - if (!(this.effective instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.effective.getClass().getName()+" was encountered"); - return (Period) this.effective; - } - - public boolean hasEffective() { - return this.effective != null && !this.effective.isEmpty(); - } - - /** - * @param value {@link #effective} (The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the 'wasNotGiven' attribute is true).) - */ - public MedicationStatement setEffective(Type value) { - this.effective = value; - return this; - } - - /** - * @return {@link #note} (Provides extra information about the medication statement that is not conveyed by the other attributes.). 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 MedicationStatement.note"); - else if (Configuration.doAutoCreate()) - this.note = new StringType(); // bb - 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} (Provides extra information about the medication statement that is not conveyed by the other attributes.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value - */ - public MedicationStatement setNoteElement(StringType value) { - this.note = value; - return this; - } - - /** - * @return Provides extra information about the medication statement that is not conveyed by the other attributes. - */ - public String getNote() { - return this.note == null ? null : this.note.getValue(); - } - - /** - * @param value Provides extra information about the medication statement that is not conveyed by the other attributes. - */ - public MedicationStatement setNote(String value) { - if (Utilities.noString(value)) - this.note = null; - else { - if (this.note == null) - this.note = new StringType(); - this.note.setValue(value); - } - return this; - } - - /** - * @return {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Reference getMedication() { - if (this.medication == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.medication"); - else if (Configuration.doAutoCreate()) - this.medication = new Reference(); // cc - return this.medication; - } - - public boolean hasMedication() { - return this.medication != null && !this.medication.isEmpty(); - } - - /** - * @param value {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationStatement setMedication(Reference value) { - this.medication = value; - return this; - } - - /** - * @return {@link #medication} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Medication getMedicationTarget() { - if (this.medicationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.medication"); - else if (Configuration.doAutoCreate()) - this.medicationTarget = new Medication(); // aa - return this.medicationTarget; - } - - /** - * @param value {@link #medication} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationStatement setMedicationTarget(Medication value) { - this.medicationTarget = value; - return this; - } - - /** - * @return {@link #dosage} (Indicates how the medication is/was used by the patient.) - */ - public List getDosage() { - if (this.dosage == null) - this.dosage = new ArrayList(); - return this.dosage; - } - - public boolean hasDosage() { - if (this.dosage == null) - return false; - for (MedicationStatementDosageComponent item : this.dosage) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dosage} (Indicates how the medication is/was used by the patient.) - */ - // syntactic sugar - public MedicationStatementDosageComponent addDosage() { //3 - MedicationStatementDosageComponent t = new MedicationStatementDosageComponent(); - if (this.dosage == null) - this.dosage = new ArrayList(); - this.dosage.add(t); - return t; - } - - // syntactic sugar - public MedicationStatement addDosage(MedicationStatementDosageComponent t) { //3 - if (t == null) - return this; - if (this.dosage == null) - this.dosage = new ArrayList(); - this.dosage.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("patient", "Reference(Patient)", "The person or animal who is /was taking the medication.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("informationSource", "Reference(Patient|Practitioner|RelatedPerson)", "The person who provided the information about the taking of this medication.", 0, java.lang.Integer.MAX_VALUE, informationSource)); - childrenList.add(new Property("dateAsserted", "dateTime", "The date when the medication statement was asserted by the information source.", 0, java.lang.Integer.MAX_VALUE, dateAsserted)); - childrenList.add(new Property("status", "code", "A code specifying the state of the statement. Generally this will be in-progress or completed state.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("wasNotGiven", "boolean", "Set this to true if the record is saying that the medication was NOT taken.", 0, java.lang.Integer.MAX_VALUE, wasNotGiven)); - childrenList.add(new Property("reasonNotGiven", "CodeableConcept", "A code indicating why the medication was not taken.", 0, java.lang.Integer.MAX_VALUE, reasonNotGiven)); - childrenList.add(new Property("reasonForUse[x]", "CodeableConcept|Reference(Condition)", "A reason for why the medication is being/was taken.", 0, java.lang.Integer.MAX_VALUE, reasonForUse)); - childrenList.add(new Property("effective[x]", "dateTime|Period", "The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the 'wasNotGiven' attribute is true).", 0, java.lang.Integer.MAX_VALUE, effective)); - childrenList.add(new Property("note", "string", "Provides extra information about the medication statement that is not conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note)); - childrenList.add(new Property("medication", "Reference(Medication)", "Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); - childrenList.add(new Property("dosage", "", "Indicates how the medication is/was used by the patient.", 0, java.lang.Integer.MAX_VALUE, dosage)); - } - - public MedicationStatement copy() { - MedicationStatement dst = new MedicationStatement(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - dst.informationSource = informationSource == null ? null : informationSource.copy(); - dst.dateAsserted = dateAsserted == null ? null : dateAsserted.copy(); - dst.status = status == null ? null : status.copy(); - dst.wasNotGiven = wasNotGiven == null ? null : wasNotGiven.copy(); - if (reasonNotGiven != null) { - dst.reasonNotGiven = new ArrayList(); - for (CodeableConcept i : reasonNotGiven) - dst.reasonNotGiven.add(i.copy()); - }; - dst.reasonForUse = reasonForUse == null ? null : reasonForUse.copy(); - dst.effective = effective == null ? null : effective.copy(); - dst.note = note == null ? null : note.copy(); - dst.medication = medication == null ? null : medication.copy(); - if (dosage != null) { - dst.dosage = new ArrayList(); - for (MedicationStatementDosageComponent i : dosage) - dst.dosage.add(i.copy()); - }; - return dst; - } - - protected MedicationStatement typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationStatement)) - return false; - MedicationStatement o = (MedicationStatement) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(informationSource, o.informationSource, true) - && compareDeep(dateAsserted, o.dateAsserted, true) && compareDeep(status, o.status, true) && compareDeep(wasNotGiven, o.wasNotGiven, true) - && compareDeep(reasonNotGiven, o.reasonNotGiven, true) && compareDeep(reasonForUse, o.reasonForUse, true) - && compareDeep(effective, o.effective, true) && compareDeep(note, o.note, true) && compareDeep(medication, o.medication, true) - && compareDeep(dosage, o.dosage, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationStatement)) - return false; - MedicationStatement o = (MedicationStatement) other; - return compareValues(dateAsserted, o.dateAsserted, true) && compareValues(status, o.status, true) && compareValues(wasNotGiven, o.wasNotGiven, true) - && compareValues(note, o.note, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) - && (informationSource == null || informationSource.isEmpty()) && (dateAsserted == null || dateAsserted.isEmpty()) - && (status == null || status.isEmpty()) && (wasNotGiven == null || wasNotGiven.isEmpty()) - && (reasonNotGiven == null || reasonNotGiven.isEmpty()) && (reasonForUse == null || reasonForUse.isEmpty()) - && (effective == null || effective.isEmpty()) && (note == null || note.isEmpty()) && (medication == null || medication.isEmpty()) - && (dosage == null || dosage.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.MedicationStatement; - } - - @SearchParamDefinition(name="medication", path="MedicationStatement.medication", description="Code for medicine or text in medicine name", type="reference" ) - public static final String SP_MEDICATION = "medication"; - @SearchParamDefinition(name="patient", path="MedicationStatement.patient", description="The identity of a patient to list statements for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="source", path="MedicationStatement.informationSource", description="Who the information in the statement came from", type="reference" ) - public static final String SP_SOURCE = "source"; - @SearchParamDefinition(name="status", path="MedicationStatement.status", description="Return statements that match the given status", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="identifier", path="MedicationStatement.identifier", description="Return statements with this external identity", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="effectivedate", path="MedicationStatement.effective[x]", description="Date when patient was taking (or not taking) the medication", type="date" ) - public static final String SP_EFFECTIVEDATE = "effectivedate"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A record of medication being taken by a patient, or that the medication has been given to a patient where the record is the result of a report from the patient or another clinician. + */ +@ResourceDef(name="MedicationStatement", profile="http://hl7.org/fhir/Profile/MedicationStatement") +public class MedicationStatement extends DomainResource { + + public enum MedicationStatementStatus { + /** + * The medication is still being taken. + */ + INPROGRESS, + /** + * All actions that are implied by the statement have occurred. + */ + COMPLETED, + /** + * The statement was entered in error and therefore nullified. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static MedicationStatementStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("completed".equals(codeString)) + return COMPLETED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new Exception("Unknown MedicationStatementStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INPROGRESS: return "in-progress"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return ""; + case COMPLETED: return ""; + case ENTEREDINERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "The medication is still being taken."; + case COMPLETED: return "All actions that are implied by the statement have occurred."; + case ENTEREDINERROR: return "The statement was entered in error and therefore nullified."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "In Progress"; + case COMPLETED: return "Completed"; + case ENTEREDINERROR: return "Entered In Error"; + default: return "?"; + } + } + } + + public static class MedicationStatementStatusEnumFactory implements EnumFactory { + public MedicationStatementStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return MedicationStatementStatus.INPROGRESS; + if ("completed".equals(codeString)) + return MedicationStatementStatus.COMPLETED; + if ("entered-in-error".equals(codeString)) + return MedicationStatementStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown MedicationStatementStatus code '"+codeString+"'"); + } + public String toCode(MedicationStatementStatus code) { + if (code == MedicationStatementStatus.INPROGRESS) + return "in-progress"; + if (code == MedicationStatementStatus.COMPLETED) + return "completed"; + if (code == MedicationStatementStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + } + + @Block() + public static class MedicationStatementDosageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + */ + @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Dosage Instructions", formalDefinition="Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication." ) + protected StringType text; + + /** + * The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". + */ + @Child(name = "schedule", type = {Timing.class}, order=2, min=0, max=1) + @Description(shortDefinition="When/how often was medication taken?", formalDefinition="The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'." ) + protected Timing schedule; + + /** + * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the precondition for taking the Medication. + */ + @Child(name = "asNeeded", type = {BooleanType.class, CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Take 'as needed' f(or x)", formalDefinition="If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the precondition for taking the Medication." ) + protected Type asNeeded; + + /** + * A coded specification of the anatomic site where the medication first enters the body. + */ + @Child(name = "site", type = {CodeableConcept.class}, order=4, min=0, max=1) + @Description(shortDefinition="Where on body was medication administered?", formalDefinition="A coded specification of the anatomic site where the medication first enters the body." ) + protected CodeableConcept site; + + /** + * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject. + */ + @Child(name = "route", type = {CodeableConcept.class}, order=5, min=0, max=1) + @Description(shortDefinition="How did the medication enter the body?", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject." ) + protected CodeableConcept route; + + /** + * A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. Terminologies used often pre-coordinate this term with the route and or form of administration. + */ + @Child(name = "method", type = {CodeableConcept.class}, order=6, min=0, max=1) + @Description(shortDefinition="Technique used to administer medication", formalDefinition="A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\r\rTerminologies used often pre-coordinate this term with the route and or form of administration." ) + protected CodeableConcept method; + + /** + * The amount of therapeutic or other substance given at one administration event. + */ + @Child(name = "quantity", type = {Quantity.class}, order=7, min=0, max=1) + @Description(shortDefinition="Amount administered in one dose", formalDefinition="The amount of therapeutic or other substance given at one administration event." ) + protected Quantity quantity; + + /** + * Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. + */ + @Child(name = "rate", type = {Ratio.class}, order=8, min=0, max=1) + @Description(shortDefinition="Dose quantity per unit of time", formalDefinition="Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours." ) + protected Ratio rate; + + /** + * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours. + */ + @Child(name = "maxDosePerPeriod", type = {Ratio.class}, order=9, min=0, max=1) + @Description(shortDefinition="Maximum dose that was consumed per unit of time", formalDefinition="The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours." ) + protected Ratio maxDosePerPeriod; + + private static final long serialVersionUID = 1729854997L; + + /* + * Constructor + */ + public MedicationStatementDosageComponent() { + super(); + } + + /** + * @return {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatementDosageComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public MedicationStatementDosageComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + */ + public MedicationStatementDosageComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Timing getSchedule() { + if (this.schedule == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatementDosageComponent.schedule"); + else if (Configuration.doAutoCreate()) + this.schedule = new Timing(); // cc + return this.schedule; + } + + public boolean hasSchedule() { + return this.schedule != null && !this.schedule.isEmpty(); + } + + /** + * @param value {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public MedicationStatementDosageComponent setSchedule(Timing value) { + this.schedule = value; + return this; + } + + /** + * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the precondition for taking the Medication.) + */ + public Type getAsNeeded() { + return this.asNeeded; + } + + /** + * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the precondition for taking the Medication.) + */ + public BooleanType getAsNeededBooleanType() throws Exception { + if (!(this.asNeeded instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (BooleanType) this.asNeeded; + } + + /** + * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the precondition for taking the Medication.) + */ + public CodeableConcept getAsNeededCodeableConcept() throws Exception { + if (!(this.asNeeded instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (CodeableConcept) this.asNeeded; + } + + public boolean hasAsNeeded() { + return this.asNeeded != null && !this.asNeeded.isEmpty(); + } + + /** + * @param value {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the precondition for taking the Medication.) + */ + public MedicationStatementDosageComponent setAsNeeded(Type value) { + this.asNeeded = value; + return this; + } + + /** + * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) + */ + public CodeableConcept getSite() { + if (this.site == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatementDosageComponent.site"); + else if (Configuration.doAutoCreate()) + this.site = new CodeableConcept(); // cc + return this.site; + } + + public boolean hasSite() { + return this.site != null && !this.site.isEmpty(); + } + + /** + * @param value {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) + */ + public MedicationStatementDosageComponent setSite(CodeableConcept value) { + this.site = value; + return this; + } + + /** + * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) + */ + public CodeableConcept getRoute() { + if (this.route == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatementDosageComponent.route"); + else if (Configuration.doAutoCreate()) + this.route = new CodeableConcept(); // cc + return this.route; + } + + public boolean hasRoute() { + return this.route != null && !this.route.isEmpty(); + } + + /** + * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) + */ + public MedicationStatementDosageComponent setRoute(CodeableConcept value) { + this.route = value; + return this; + } + + /** + * @return {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. Terminologies used often pre-coordinate this term with the route and or form of administration.) + */ + public CodeableConcept getMethod() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatementDosageComponent.method"); + else if (Configuration.doAutoCreate()) + this.method = new CodeableConcept(); // cc + return this.method; + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** + * @param value {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. Terminologies used often pre-coordinate this term with the route and or form of administration.) + */ + public MedicationStatementDosageComponent setMethod(CodeableConcept value) { + this.method = value; + return this; + } + + /** + * @return {@link #quantity} (The amount of therapeutic or other substance given at one administration event.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatementDosageComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of therapeutic or other substance given at one administration event.) + */ + public MedicationStatementDosageComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) + */ + public Ratio getRate() { + if (this.rate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatementDosageComponent.rate"); + else if (Configuration.doAutoCreate()) + this.rate = new Ratio(); // cc + return this.rate; + } + + public boolean hasRate() { + return this.rate != null && !this.rate.isEmpty(); + } + + /** + * @param value {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) + */ + public MedicationStatementDosageComponent setRate(Ratio value) { + this.rate = value; + return this; + } + + /** + * @return {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.) + */ + public Ratio getMaxDosePerPeriod() { + if (this.maxDosePerPeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatementDosageComponent.maxDosePerPeriod"); + else if (Configuration.doAutoCreate()) + this.maxDosePerPeriod = new Ratio(); // cc + return this.maxDosePerPeriod; + } + + public boolean hasMaxDosePerPeriod() { + return this.maxDosePerPeriod != null && !this.maxDosePerPeriod.isEmpty(); + } + + /** + * @param value {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.) + */ + public MedicationStatementDosageComponent setMaxDosePerPeriod(Ratio value) { + this.maxDosePerPeriod = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("text", "string", "Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("schedule", "Timing", "The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'.", 0, java.lang.Integer.MAX_VALUE, schedule)); + childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the precondition for taking the Medication.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); + childrenList.add(new Property("site", "CodeableConcept", "A coded specification of the anatomic site where the medication first enters the body.", 0, java.lang.Integer.MAX_VALUE, site)); + childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.", 0, java.lang.Integer.MAX_VALUE, route)); + childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\r\rTerminologies used often pre-coordinate this term with the route and or form of administration.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("quantity", "Quantity", "The amount of therapeutic or other substance given at one administration event.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("rate", "Ratio", "Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.", 0, java.lang.Integer.MAX_VALUE, rate)); + childrenList.add(new Property("maxDosePerPeriod", "Ratio", "The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxDosePerPeriod)); + } + + public MedicationStatementDosageComponent copy() { + MedicationStatementDosageComponent dst = new MedicationStatementDosageComponent(); + copyValues(dst); + dst.text = text == null ? null : text.copy(); + dst.schedule = schedule == null ? null : schedule.copy(); + dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); + dst.site = site == null ? null : site.copy(); + dst.route = route == null ? null : route.copy(); + dst.method = method == null ? null : method.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.rate = rate == null ? null : rate.copy(); + dst.maxDosePerPeriod = maxDosePerPeriod == null ? null : maxDosePerPeriod.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationStatementDosageComponent)) + return false; + MedicationStatementDosageComponent o = (MedicationStatementDosageComponent) other; + return compareDeep(text, o.text, true) && compareDeep(schedule, o.schedule, true) && compareDeep(asNeeded, o.asNeeded, true) + && compareDeep(site, o.site, true) && compareDeep(route, o.route, true) && compareDeep(method, o.method, true) + && compareDeep(quantity, o.quantity, true) && compareDeep(rate, o.rate, true) && compareDeep(maxDosePerPeriod, o.maxDosePerPeriod, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationStatementDosageComponent)) + return false; + MedicationStatementDosageComponent o = (MedicationStatementDosageComponent) other; + return compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (text == null || text.isEmpty()) && (schedule == null || schedule.isEmpty()) + && (asNeeded == null || asNeeded.isEmpty()) && (site == null || site.isEmpty()) && (route == null || route.isEmpty()) + && (method == null || method.isEmpty()) && (quantity == null || quantity.isEmpty()) && (rate == null || rate.isEmpty()) + && (maxDosePerPeriod == null || maxDosePerPeriod.isEmpty()); + } + + } + + /** + * External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Identifier", formalDefinition="External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated." ) + protected List identifier; + + /** + * The person or animal who is /was taking the medication. + */ + @Child(name = "patient", type = {Patient.class}, order=1, min=0, max=1) + @Description(shortDefinition="Who was/is taking medication", formalDefinition="The person or animal who is /was taking the medication." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The person or animal who is /was taking the medication.) + */ + protected Patient patientTarget; + + /** + * The person who provided the information about the taking of this medication. + */ + @Child(name = "informationSource", type = {Patient.class, Practitioner.class, RelatedPerson.class}, order=2, min=0, max=1) + @Description(shortDefinition="", formalDefinition="The person who provided the information about the taking of this medication." ) + protected Reference informationSource; + + /** + * The actual object that is the target of the reference (The person who provided the information about the taking of this medication.) + */ + protected Resource informationSourceTarget; + + /** + * The date when the medication statement was asserted by the information source. + */ + @Child(name = "dateAsserted", type = {DateTimeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="When the statement was asserted?", formalDefinition="The date when the medication statement was asserted by the information source." ) + protected DateTimeType dateAsserted; + + /** + * A code specifying the state of the statement. Generally this will be in-progress or completed state. + */ + @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1) + @Description(shortDefinition="in-progress | completed | entered-in-error", formalDefinition="A code specifying the state of the statement. Generally this will be in-progress or completed state." ) + protected Enumeration status; + + /** + * Set this to true if the record is saying that the medication was NOT taken. + */ + @Child(name = "wasNotTaken", type = {BooleanType.class}, order=5, min=0, max=1) + @Description(shortDefinition="True if medication is/was not being taken", formalDefinition="Set this to true if the record is saying that the medication was NOT taken." ) + protected BooleanType wasNotTaken; + + /** + * A code indicating why the medication was not taken. + */ + @Child(name = "reasonNotTaken", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="True if asserting medication was not given", formalDefinition="A code indicating why the medication was not taken." ) + protected List reasonNotTaken; + + /** + * A reason for why the medication is being/was taken. + */ + @Child(name = "reasonForUse", type = {CodeableConcept.class, Condition.class}, order=7, min=0, max=1) + @Description(shortDefinition="", formalDefinition="A reason for why the medication is being/was taken." ) + protected Type reasonForUse; + + /** + * The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the 'wasNotGiven' attribute is true). + */ + @Child(name = "effective", type = {DateTimeType.class, Period.class}, order=8, min=0, max=1) + @Description(shortDefinition="Over what period was medication consumed?", formalDefinition="The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the 'wasNotGiven' attribute is true)." ) + protected Type effective; + + /** + * Provides extra information about the medication statement that is not conveyed by the other attributes. + */ + @Child(name = "note", type = {StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Further information about the statement", formalDefinition="Provides extra information about the medication statement that is not conveyed by the other attributes." ) + protected StringType note; + + /** + * Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. + */ + @Child(name = "medication", type = {CodeableConcept.class, Medication.class}, order=10, min=1, max=1) + @Description(shortDefinition="What medication was taken?", formalDefinition="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." ) + protected Type medication; + + /** + * Indicates how the medication is/was used by the patient. + */ + @Child(name = "dosage", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Details of how medication was taken", formalDefinition="Indicates how the medication is/was used by the patient." ) + protected List dosage; + + private static final long serialVersionUID = 2101849334L; + + /* + * Constructor + */ + public MedicationStatement() { + super(); + } + + /* + * Constructor + */ + public MedicationStatement(Enumeration status, Type medication) { + super(); + this.status = status; + this.medication = medication; + } + + /** + * @return {@link #identifier} (External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public MedicationStatement addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #patient} (The person or animal who is /was taking the medication.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatement.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The person or animal who is /was taking the medication.) + */ + public MedicationStatement setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person or animal who is /was taking the medication.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatement.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person or animal who is /was taking the medication.) + */ + public MedicationStatement setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #informationSource} (The person who provided the information about the taking of this medication.) + */ + public Reference getInformationSource() { + if (this.informationSource == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatement.informationSource"); + else if (Configuration.doAutoCreate()) + this.informationSource = new Reference(); // cc + return this.informationSource; + } + + public boolean hasInformationSource() { + return this.informationSource != null && !this.informationSource.isEmpty(); + } + + /** + * @param value {@link #informationSource} (The person who provided the information about the taking of this medication.) + */ + public MedicationStatement setInformationSource(Reference value) { + this.informationSource = value; + return this; + } + + /** + * @return {@link #informationSource} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person who provided the information about the taking of this medication.) + */ + public Resource getInformationSourceTarget() { + return this.informationSourceTarget; + } + + /** + * @param value {@link #informationSource} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person who provided the information about the taking of this medication.) + */ + public MedicationStatement setInformationSourceTarget(Resource value) { + this.informationSourceTarget = value; + return this; + } + + /** + * @return {@link #dateAsserted} (The date when the medication statement was asserted by the information source.). This is the underlying object with id, value and extensions. The accessor "getDateAsserted" gives direct access to the value + */ + public DateTimeType getDateAssertedElement() { + if (this.dateAsserted == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatement.dateAsserted"); + else if (Configuration.doAutoCreate()) + this.dateAsserted = new DateTimeType(); // bb + return this.dateAsserted; + } + + public boolean hasDateAssertedElement() { + return this.dateAsserted != null && !this.dateAsserted.isEmpty(); + } + + public boolean hasDateAsserted() { + return this.dateAsserted != null && !this.dateAsserted.isEmpty(); + } + + /** + * @param value {@link #dateAsserted} (The date when the medication statement was asserted by the information source.). This is the underlying object with id, value and extensions. The accessor "getDateAsserted" gives direct access to the value + */ + public MedicationStatement setDateAssertedElement(DateTimeType value) { + this.dateAsserted = value; + return this; + } + + /** + * @return The date when the medication statement was asserted by the information source. + */ + public Date getDateAsserted() { + return this.dateAsserted == null ? null : this.dateAsserted.getValue(); + } + + /** + * @param value The date when the medication statement was asserted by the information source. + */ + public MedicationStatement setDateAsserted(Date value) { + if (value == null) + this.dateAsserted = null; + else { + if (this.dateAsserted == null) + this.dateAsserted = new DateTimeType(); + this.dateAsserted.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (A code specifying the state of the statement. Generally this will be in-progress or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatement.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new MedicationStatementStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (A code specifying the state of the statement. Generally this will be in-progress or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public MedicationStatement setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return A code specifying the state of the statement. Generally this will be in-progress or completed state. + */ + public MedicationStatementStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value A code specifying the state of the statement. Generally this will be in-progress or completed state. + */ + public MedicationStatement setStatus(MedicationStatementStatus value) { + if (this.status == null) + this.status = new Enumeration(new MedicationStatementStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #wasNotTaken} (Set this to true if the record is saying that the medication was NOT taken.). This is the underlying object with id, value and extensions. The accessor "getWasNotTaken" gives direct access to the value + */ + public BooleanType getWasNotTakenElement() { + if (this.wasNotTaken == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatement.wasNotTaken"); + else if (Configuration.doAutoCreate()) + this.wasNotTaken = new BooleanType(); // bb + return this.wasNotTaken; + } + + public boolean hasWasNotTakenElement() { + return this.wasNotTaken != null && !this.wasNotTaken.isEmpty(); + } + + public boolean hasWasNotTaken() { + return this.wasNotTaken != null && !this.wasNotTaken.isEmpty(); + } + + /** + * @param value {@link #wasNotTaken} (Set this to true if the record is saying that the medication was NOT taken.). This is the underlying object with id, value and extensions. The accessor "getWasNotTaken" gives direct access to the value + */ + public MedicationStatement setWasNotTakenElement(BooleanType value) { + this.wasNotTaken = value; + return this; + } + + /** + * @return Set this to true if the record is saying that the medication was NOT taken. + */ + public boolean getWasNotTaken() { + return this.wasNotTaken == null || this.wasNotTaken.isEmpty() ? false : this.wasNotTaken.getValue(); + } + + /** + * @param value Set this to true if the record is saying that the medication was NOT taken. + */ + public MedicationStatement setWasNotTaken(boolean value) { + if (this.wasNotTaken == null) + this.wasNotTaken = new BooleanType(); + this.wasNotTaken.setValue(value); + return this; + } + + /** + * @return {@link #reasonNotTaken} (A code indicating why the medication was not taken.) + */ + public List getReasonNotTaken() { + if (this.reasonNotTaken == null) + this.reasonNotTaken = new ArrayList(); + return this.reasonNotTaken; + } + + public boolean hasReasonNotTaken() { + if (this.reasonNotTaken == null) + return false; + for (CodeableConcept item : this.reasonNotTaken) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reasonNotTaken} (A code indicating why the medication was not taken.) + */ + // syntactic sugar + public CodeableConcept addReasonNotTaken() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reasonNotTaken == null) + this.reasonNotTaken = new ArrayList(); + this.reasonNotTaken.add(t); + return t; + } + + // syntactic sugar + public MedicationStatement addReasonNotTaken(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reasonNotTaken == null) + this.reasonNotTaken = new ArrayList(); + this.reasonNotTaken.add(t); + return this; + } + + /** + * @return {@link #reasonForUse} (A reason for why the medication is being/was taken.) + */ + public Type getReasonForUse() { + return this.reasonForUse; + } + + /** + * @return {@link #reasonForUse} (A reason for why the medication is being/was taken.) + */ + public CodeableConcept getReasonForUseCodeableConcept() throws Exception { + if (!(this.reasonForUse instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.reasonForUse.getClass().getName()+" was encountered"); + return (CodeableConcept) this.reasonForUse; + } + + /** + * @return {@link #reasonForUse} (A reason for why the medication is being/was taken.) + */ + public Reference getReasonForUseReference() throws Exception { + if (!(this.reasonForUse instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.reasonForUse.getClass().getName()+" was encountered"); + return (Reference) this.reasonForUse; + } + + public boolean hasReasonForUse() { + return this.reasonForUse != null && !this.reasonForUse.isEmpty(); + } + + /** + * @param value {@link #reasonForUse} (A reason for why the medication is being/was taken.) + */ + public MedicationStatement setReasonForUse(Type value) { + this.reasonForUse = value; + return this; + } + + /** + * @return {@link #effective} (The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the 'wasNotGiven' attribute is true).) + */ + public Type getEffective() { + return this.effective; + } + + /** + * @return {@link #effective} (The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the 'wasNotGiven' attribute is true).) + */ + public DateTimeType getEffectiveDateTimeType() throws Exception { + if (!(this.effective instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.effective.getClass().getName()+" was encountered"); + return (DateTimeType) this.effective; + } + + /** + * @return {@link #effective} (The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the 'wasNotGiven' attribute is true).) + */ + public Period getEffectivePeriod() throws Exception { + if (!(this.effective instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.effective.getClass().getName()+" was encountered"); + return (Period) this.effective; + } + + public boolean hasEffective() { + return this.effective != null && !this.effective.isEmpty(); + } + + /** + * @param value {@link #effective} (The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the 'wasNotGiven' attribute is true).) + */ + public MedicationStatement setEffective(Type value) { + this.effective = value; + return this; + } + + /** + * @return {@link #note} (Provides extra information about the medication statement that is not conveyed by the other attributes.). 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 MedicationStatement.note"); + else if (Configuration.doAutoCreate()) + this.note = new StringType(); // bb + 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} (Provides extra information about the medication statement that is not conveyed by the other attributes.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value + */ + public MedicationStatement setNoteElement(StringType value) { + this.note = value; + return this; + } + + /** + * @return Provides extra information about the medication statement that is not conveyed by the other attributes. + */ + public String getNote() { + return this.note == null ? null : this.note.getValue(); + } + + /** + * @param value Provides extra information about the medication statement that is not conveyed by the other attributes. + */ + public MedicationStatement setNote(String value) { + if (Utilities.noString(value)) + this.note = null; + else { + if (this.note == null) + this.note = new StringType(); + this.note.setValue(value); + } + return this; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Type getMedication() { + return this.medication; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public CodeableConcept getMedicationCodeableConcept() throws Exception { + if (!(this.medication instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.medication.getClass().getName()+" was encountered"); + return (CodeableConcept) this.medication; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Reference getMedicationReference() throws Exception { + if (!(this.medication instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.medication.getClass().getName()+" was encountered"); + return (Reference) this.medication; + } + + public boolean hasMedication() { + return this.medication != null && !this.medication.isEmpty(); + } + + /** + * @param value {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public MedicationStatement setMedication(Type value) { + this.medication = value; + return this; + } + + /** + * @return {@link #dosage} (Indicates how the medication is/was used by the patient.) + */ + public List getDosage() { + if (this.dosage == null) + this.dosage = new ArrayList(); + return this.dosage; + } + + public boolean hasDosage() { + if (this.dosage == null) + return false; + for (MedicationStatementDosageComponent item : this.dosage) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dosage} (Indicates how the medication is/was used by the patient.) + */ + // syntactic sugar + public MedicationStatementDosageComponent addDosage() { //3 + MedicationStatementDosageComponent t = new MedicationStatementDosageComponent(); + if (this.dosage == null) + this.dosage = new ArrayList(); + this.dosage.add(t); + return t; + } + + // syntactic sugar + public MedicationStatement addDosage(MedicationStatementDosageComponent t) { //3 + if (t == null) + return this; + if (this.dosage == null) + this.dosage = new ArrayList(); + this.dosage.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("patient", "Reference(Patient)", "The person or animal who is /was taking the medication.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("informationSource", "Reference(Patient|Practitioner|RelatedPerson)", "The person who provided the information about the taking of this medication.", 0, java.lang.Integer.MAX_VALUE, informationSource)); + childrenList.add(new Property("dateAsserted", "dateTime", "The date when the medication statement was asserted by the information source.", 0, java.lang.Integer.MAX_VALUE, dateAsserted)); + childrenList.add(new Property("status", "code", "A code specifying the state of the statement. Generally this will be in-progress or completed state.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("wasNotTaken", "boolean", "Set this to true if the record is saying that the medication was NOT taken.", 0, java.lang.Integer.MAX_VALUE, wasNotTaken)); + childrenList.add(new Property("reasonNotTaken", "CodeableConcept", "A code indicating why the medication was not taken.", 0, java.lang.Integer.MAX_VALUE, reasonNotTaken)); + childrenList.add(new Property("reasonForUse[x]", "CodeableConcept|Reference(Condition)", "A reason for why the medication is being/was taken.", 0, java.lang.Integer.MAX_VALUE, reasonForUse)); + childrenList.add(new Property("effective[x]", "dateTime|Period", "The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the 'wasNotGiven' attribute is true).", 0, java.lang.Integer.MAX_VALUE, effective)); + childrenList.add(new Property("note", "string", "Provides extra information about the medication statement that is not conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("medication[x]", "CodeableConcept|Reference(Medication)", "Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); + childrenList.add(new Property("dosage", "", "Indicates how the medication is/was used by the patient.", 0, java.lang.Integer.MAX_VALUE, dosage)); + } + + public MedicationStatement copy() { + MedicationStatement dst = new MedicationStatement(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + dst.informationSource = informationSource == null ? null : informationSource.copy(); + dst.dateAsserted = dateAsserted == null ? null : dateAsserted.copy(); + dst.status = status == null ? null : status.copy(); + dst.wasNotTaken = wasNotTaken == null ? null : wasNotTaken.copy(); + if (reasonNotTaken != null) { + dst.reasonNotTaken = new ArrayList(); + for (CodeableConcept i : reasonNotTaken) + dst.reasonNotTaken.add(i.copy()); + }; + dst.reasonForUse = reasonForUse == null ? null : reasonForUse.copy(); + dst.effective = effective == null ? null : effective.copy(); + dst.note = note == null ? null : note.copy(); + dst.medication = medication == null ? null : medication.copy(); + if (dosage != null) { + dst.dosage = new ArrayList(); + for (MedicationStatementDosageComponent i : dosage) + dst.dosage.add(i.copy()); + }; + return dst; + } + + protected MedicationStatement typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationStatement)) + return false; + MedicationStatement o = (MedicationStatement) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(informationSource, o.informationSource, true) + && compareDeep(dateAsserted, o.dateAsserted, true) && compareDeep(status, o.status, true) && compareDeep(wasNotTaken, o.wasNotTaken, true) + && compareDeep(reasonNotTaken, o.reasonNotTaken, true) && compareDeep(reasonForUse, o.reasonForUse, true) + && compareDeep(effective, o.effective, true) && compareDeep(note, o.note, true) && compareDeep(medication, o.medication, true) + && compareDeep(dosage, o.dosage, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationStatement)) + return false; + MedicationStatement o = (MedicationStatement) other; + return compareValues(dateAsserted, o.dateAsserted, true) && compareValues(status, o.status, true) && compareValues(wasNotTaken, o.wasNotTaken, true) + && compareValues(note, o.note, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) + && (informationSource == null || informationSource.isEmpty()) && (dateAsserted == null || dateAsserted.isEmpty()) + && (status == null || status.isEmpty()) && (wasNotTaken == null || wasNotTaken.isEmpty()) + && (reasonNotTaken == null || reasonNotTaken.isEmpty()) && (reasonForUse == null || reasonForUse.isEmpty()) + && (effective == null || effective.isEmpty()) && (note == null || note.isEmpty()) && (medication == null || medication.isEmpty()) + && (dosage == null || dosage.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.MedicationStatement; + } + + @SearchParamDefinition(name="identifier", path="MedicationStatement.identifier", description="Return statements with this external identity", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="patient", path="MedicationStatement.patient", description="The identity of a patient to list statements for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="medication", path="MedicationStatement.medicationReference", description="Code for medicine or text in medicine name", type="reference" ) + public static final String SP_MEDICATION = "medication"; + @SearchParamDefinition(name="source", path="MedicationStatement.informationSource", description="Who the information in the statement came from", type="reference" ) + public static final String SP_SOURCE = "source"; + @SearchParamDefinition(name="effectivedate", path="MedicationStatement.effective[x]", description="Date when patient was taking (or not taking) the medication", type="date" ) + public static final String SP_EFFECTIVEDATE = "effectivedate"; + @SearchParamDefinition(name="status", path="MedicationStatement.status", description="Return statements that match the given status", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/MessageHeader.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/MessageHeader.java index e4cfa0601b4..385967ec934 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/MessageHeader.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/MessageHeader.java @@ -1,1613 +1,1592 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * The header for a message exchange that is either requesting or responding to an action. The Reference(s) that are the subject of the action as well as other Information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. - */ -@ResourceDef(name="MessageHeader", profile="http://hl7.org/fhir/Profile/MessageHeader") -public class MessageHeader extends DomainResource { - - public enum ResponseCode { - /** - * The message was accepted and processed without error. - */ - OK, - /** - * Some internal unexpected error occurred - wait and try again. Note - this is usually used for things like database unavailable, which may be expected to resolve, though human intervention may be required. - */ - TRANSIENTERROR, - /** - * The message was rejected because of some content in it. There is no point in re-sending without change. The response narrative SHALL describe what the issue is. - */ - FATALERROR, - /** - * added to help the parsers - */ - NULL; - public static ResponseCode fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("ok".equals(codeString)) - return OK; - if ("transient-error".equals(codeString)) - return TRANSIENTERROR; - if ("fatal-error".equals(codeString)) - return FATALERROR; - throw new Exception("Unknown ResponseCode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case OK: return "ok"; - case TRANSIENTERROR: return "transient-error"; - case FATALERROR: return "fatal-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case OK: return ""; - case TRANSIENTERROR: return ""; - case FATALERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case OK: return "The message was accepted and processed without error."; - case TRANSIENTERROR: return "Some internal unexpected error occurred - wait and try again. Note - this is usually used for things like database unavailable, which may be expected to resolve, though human intervention may be required."; - case FATALERROR: return "The message was rejected because of some content in it. There is no point in re-sending without change. The response narrative SHALL describe what the issue is."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case OK: return "Ok"; - case TRANSIENTERROR: return "Transient Error"; - case FATALERROR: return "Fatal Error"; - default: return "?"; - } - } - } - - public static class ResponseCodeEnumFactory implements EnumFactory { - public ResponseCode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("ok".equals(codeString)) - return ResponseCode.OK; - if ("transient-error".equals(codeString)) - return ResponseCode.TRANSIENTERROR; - if ("fatal-error".equals(codeString)) - return ResponseCode.FATALERROR; - throw new IllegalArgumentException("Unknown ResponseCode code '"+codeString+"'"); - } - public String toCode(ResponseCode code) { - if (code == ResponseCode.OK) - return "ok"; - if (code == ResponseCode.TRANSIENTERROR) - return "transient-error"; - if (code == ResponseCode.FATALERROR) - return "fatal-error"; - return "?"; - } - } - - @Block() - public static class MessageHeaderResponseComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The id of the message that this message is a response to. - */ - @Child(name = "identifier", type = {IdType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Id of original message", formalDefinition="The id of the message that this message is a response to." ) - protected IdType identifier; - - /** - * Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not. - */ - @Child(name = "code", type = {CodeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="ok | transient-error | fatal-error", formalDefinition="Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not." ) - protected Enumeration code; - - /** - * Full details of any issues found in the message. - */ - @Child(name = "details", type = {OperationOutcome.class}, order=3, min=0, max=1) - @Description(shortDefinition="Specific list of hints/warnings/errors", formalDefinition="Full details of any issues found in the message." ) - protected Reference details; - - /** - * The actual object that is the target of the reference (Full details of any issues found in the message.) - */ - protected OperationOutcome detailsTarget; - - private static final long serialVersionUID = 1419103693L; - - /* - * Constructor - */ - public MessageHeaderResponseComponent() { - super(); - } - - /* - * Constructor - */ - public MessageHeaderResponseComponent(IdType identifier, Enumeration code) { - super(); - this.identifier = identifier; - this.code = code; - } - - /** - * @return {@link #identifier} (The id of the message that this message is a response to.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public IdType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeaderResponseComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new IdType(); // bb - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The id of the message that this message is a response to.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public MessageHeaderResponseComponent setIdentifierElement(IdType value) { - this.identifier = value; - return this; - } - - /** - * @return The id of the message that this message is a response to. - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value The id of the message that this message is a response to. - */ - public MessageHeaderResponseComponent setIdentifier(String value) { - if (this.identifier == null) - this.identifier = new IdType(); - this.identifier.setValue(value); - return this; - } - - /** - * @return {@link #code} (Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Enumeration getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeaderResponseComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Enumeration(new ResponseCodeEnumFactory()); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public MessageHeaderResponseComponent setCodeElement(Enumeration value) { - this.code = value; - return this; - } - - /** - * @return Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not. - */ - public ResponseCode getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not. - */ - public MessageHeaderResponseComponent setCode(ResponseCode value) { - if (this.code == null) - this.code = new Enumeration(new ResponseCodeEnumFactory()); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #details} (Full details of any issues found in the message.) - */ - public Reference getDetails() { - if (this.details == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeaderResponseComponent.details"); - else if (Configuration.doAutoCreate()) - this.details = new Reference(); // cc - return this.details; - } - - public boolean hasDetails() { - return this.details != null && !this.details.isEmpty(); - } - - /** - * @param value {@link #details} (Full details of any issues found in the message.) - */ - public MessageHeaderResponseComponent setDetails(Reference value) { - this.details = value; - return this; - } - - /** - * @return {@link #details} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Full details of any issues found in the message.) - */ - public OperationOutcome getDetailsTarget() { - if (this.detailsTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeaderResponseComponent.details"); - else if (Configuration.doAutoCreate()) - this.detailsTarget = new OperationOutcome(); // aa - return this.detailsTarget; - } - - /** - * @param value {@link #details} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Full details of any issues found in the message.) - */ - public MessageHeaderResponseComponent setDetailsTarget(OperationOutcome value) { - this.detailsTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "id", "The id of the message that this message is a response to.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("code", "code", "Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("details", "Reference(OperationOutcome)", "Full details of any issues found in the message.", 0, java.lang.Integer.MAX_VALUE, details)); - } - - public MessageHeaderResponseComponent copy() { - MessageHeaderResponseComponent dst = new MessageHeaderResponseComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.code = code == null ? null : code.copy(); - dst.details = details == null ? null : details.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MessageHeaderResponseComponent)) - return false; - MessageHeaderResponseComponent o = (MessageHeaderResponseComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(code, o.code, true) && compareDeep(details, o.details, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MessageHeaderResponseComponent)) - return false; - MessageHeaderResponseComponent o = (MessageHeaderResponseComponent) other; - return compareValues(identifier, o.identifier, true) && compareValues(code, o.code, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) - && (details == null || details.isEmpty()); - } - - } - - @Block() - public static class MessageSourceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Human-readable name for the source system. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Name of system", formalDefinition="Human-readable name for the source system." ) - protected StringType name; - - /** - * May include configuration or other information useful in debugging. - */ - @Child(name = "software", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Name of software running the system", formalDefinition="May include configuration or other information useful in debugging." ) - protected StringType software; - - /** - * Can convey versions of multiple systems in situations where a message passes through multiple hands. - */ - @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Version of software running", formalDefinition="Can convey versions of multiple systems in situations where a message passes through multiple hands." ) - protected StringType version; - - /** - * An e-mail, phone, website or other contact point to use to resolve issues with message communications. - */ - @Child(name = "contact", type = {ContactPoint.class}, order=4, min=0, max=1) - @Description(shortDefinition="Human contact for problems", formalDefinition="An e-mail, phone, website or other contact point to use to resolve issues with message communications." ) - protected ContactPoint contact; - - /** - * Identifies the routing target to send acknowledgements to. - */ - @Child(name = "endpoint", type = {UriType.class}, order=5, min=1, max=1) - @Description(shortDefinition="Actual message source address or id", formalDefinition="Identifies the routing target to send acknowledgements to." ) - protected UriType endpoint; - - private static final long serialVersionUID = -115878196L; - - /* - * Constructor - */ - public MessageSourceComponent() { - super(); - } - - /* - * Constructor - */ - public MessageSourceComponent(UriType endpoint) { - super(); - this.endpoint = endpoint; - } - - /** - * @return {@link #name} (Human-readable name for the source system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageSourceComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Human-readable name for the source system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public MessageSourceComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Human-readable name for the source system. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Human-readable name for the source system. - */ - public MessageSourceComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #software} (May include configuration or other information useful in debugging.). This is the underlying object with id, value and extensions. The accessor "getSoftware" gives direct access to the value - */ - public StringType getSoftwareElement() { - if (this.software == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageSourceComponent.software"); - else if (Configuration.doAutoCreate()) - this.software = new StringType(); // bb - return this.software; - } - - public boolean hasSoftwareElement() { - return this.software != null && !this.software.isEmpty(); - } - - public boolean hasSoftware() { - return this.software != null && !this.software.isEmpty(); - } - - /** - * @param value {@link #software} (May include configuration or other information useful in debugging.). This is the underlying object with id, value and extensions. The accessor "getSoftware" gives direct access to the value - */ - public MessageSourceComponent setSoftwareElement(StringType value) { - this.software = value; - return this; - } - - /** - * @return May include configuration or other information useful in debugging. - */ - public String getSoftware() { - return this.software == null ? null : this.software.getValue(); - } - - /** - * @param value May include configuration or other information useful in debugging. - */ - public MessageSourceComponent setSoftware(String value) { - if (Utilities.noString(value)) - this.software = null; - else { - if (this.software == null) - this.software = new StringType(); - this.software.setValue(value); - } - return this; - } - - /** - * @return {@link #version} (Can convey versions of multiple systems in situations where a message passes through multiple hands.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageSourceComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (Can convey versions of multiple systems in situations where a message passes through multiple hands.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public MessageSourceComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return Can convey versions of multiple systems in situations where a message passes through multiple hands. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value Can convey versions of multiple systems in situations where a message passes through multiple hands. - */ - public MessageSourceComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (An e-mail, phone, website or other contact point to use to resolve issues with message communications.) - */ - public ContactPoint getContact() { - if (this.contact == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageSourceComponent.contact"); - else if (Configuration.doAutoCreate()) - this.contact = new ContactPoint(); // cc - return this.contact; - } - - public boolean hasContact() { - return this.contact != null && !this.contact.isEmpty(); - } - - /** - * @param value {@link #contact} (An e-mail, phone, website or other contact point to use to resolve issues with message communications.) - */ - public MessageSourceComponent setContact(ContactPoint value) { - this.contact = value; - return this; - } - - /** - * @return {@link #endpoint} (Identifies the routing target to send acknowledgements to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value - */ - public UriType getEndpointElement() { - if (this.endpoint == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageSourceComponent.endpoint"); - else if (Configuration.doAutoCreate()) - this.endpoint = new UriType(); // bb - return this.endpoint; - } - - public boolean hasEndpointElement() { - return this.endpoint != null && !this.endpoint.isEmpty(); - } - - public boolean hasEndpoint() { - return this.endpoint != null && !this.endpoint.isEmpty(); - } - - /** - * @param value {@link #endpoint} (Identifies the routing target to send acknowledgements to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value - */ - public MessageSourceComponent setEndpointElement(UriType value) { - this.endpoint = value; - return this; - } - - /** - * @return Identifies the routing target to send acknowledgements to. - */ - public String getEndpoint() { - return this.endpoint == null ? null : this.endpoint.getValue(); - } - - /** - * @param value Identifies the routing target to send acknowledgements to. - */ - public MessageSourceComponent setEndpoint(String value) { - if (this.endpoint == null) - this.endpoint = new UriType(); - this.endpoint.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "Human-readable name for the source system.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("software", "string", "May include configuration or other information useful in debugging.", 0, java.lang.Integer.MAX_VALUE, software)); - childrenList.add(new Property("version", "string", "Can convey versions of multiple systems in situations where a message passes through multiple hands.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("contact", "ContactPoint", "An e-mail, phone, website or other contact point to use to resolve issues with message communications.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("endpoint", "uri", "Identifies the routing target to send acknowledgements to.", 0, java.lang.Integer.MAX_VALUE, endpoint)); - } - - public MessageSourceComponent copy() { - MessageSourceComponent dst = new MessageSourceComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.software = software == null ? null : software.copy(); - dst.version = version == null ? null : version.copy(); - dst.contact = contact == null ? null : contact.copy(); - dst.endpoint = endpoint == null ? null : endpoint.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MessageSourceComponent)) - return false; - MessageSourceComponent o = (MessageSourceComponent) other; - return compareDeep(name, o.name, true) && compareDeep(software, o.software, true) && compareDeep(version, o.version, true) - && compareDeep(contact, o.contact, true) && compareDeep(endpoint, o.endpoint, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MessageSourceComponent)) - return false; - MessageSourceComponent o = (MessageSourceComponent) other; - return compareValues(name, o.name, true) && compareValues(software, o.software, true) && compareValues(version, o.version, true) - && compareValues(endpoint, o.endpoint, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (software == null || software.isEmpty()) - && (version == null || version.isEmpty()) && (contact == null || contact.isEmpty()) && (endpoint == null || endpoint.isEmpty()) - ; - } - - } - - @Block() - public static class MessageDestinationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Human-readable name for the target system. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Name of system", formalDefinition="Human-readable name for the target system." ) - protected StringType name; - - /** - * Identifies the target end system in situations where the initial message transmission is to an intermediary system. - */ - @Child(name = "target", type = {Device.class}, order=2, min=0, max=1) - @Description(shortDefinition="Particular delivery destination within the destination", formalDefinition="Identifies the target end system in situations where the initial message transmission is to an intermediary system." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) - */ - protected Device targetTarget; - - /** - * Indicates where the message should be routed to. - */ - @Child(name = "endpoint", type = {UriType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Actual destination address or id", formalDefinition="Indicates where the message should be routed to." ) - protected UriType endpoint; - - private static final long serialVersionUID = -2097633309L; - - /* - * Constructor - */ - public MessageDestinationComponent() { - super(); - } - - /* - * Constructor - */ - public MessageDestinationComponent(UriType endpoint) { - super(); - this.endpoint = endpoint; - } - - /** - * @return {@link #name} (Human-readable name for the target system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageDestinationComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Human-readable name for the target system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public MessageDestinationComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Human-readable name for the target system. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Human-readable name for the target system. - */ - public MessageDestinationComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageDestinationComponent.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); // cc - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) - */ - public MessageDestinationComponent setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) - */ - public Device getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageDestinationComponent.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Device(); // aa - return this.targetTarget; - } - - /** - * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) - */ - public MessageDestinationComponent setTargetTarget(Device value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #endpoint} (Indicates where the message should be routed to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value - */ - public UriType getEndpointElement() { - if (this.endpoint == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageDestinationComponent.endpoint"); - else if (Configuration.doAutoCreate()) - this.endpoint = new UriType(); // bb - return this.endpoint; - } - - public boolean hasEndpointElement() { - return this.endpoint != null && !this.endpoint.isEmpty(); - } - - public boolean hasEndpoint() { - return this.endpoint != null && !this.endpoint.isEmpty(); - } - - /** - * @param value {@link #endpoint} (Indicates where the message should be routed to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value - */ - public MessageDestinationComponent setEndpointElement(UriType value) { - this.endpoint = value; - return this; - } - - /** - * @return Indicates where the message should be routed to. - */ - public String getEndpoint() { - return this.endpoint == null ? null : this.endpoint.getValue(); - } - - /** - * @param value Indicates where the message should be routed to. - */ - public MessageDestinationComponent setEndpoint(String value) { - if (this.endpoint == null) - this.endpoint = new UriType(); - this.endpoint.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "Human-readable name for the target system.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("target", "Reference(Device)", "Identifies the target end system in situations where the initial message transmission is to an intermediary system.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("endpoint", "uri", "Indicates where the message should be routed to.", 0, java.lang.Integer.MAX_VALUE, endpoint)); - } - - public MessageDestinationComponent copy() { - MessageDestinationComponent dst = new MessageDestinationComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.target = target == null ? null : target.copy(); - dst.endpoint = endpoint == null ? null : endpoint.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MessageDestinationComponent)) - return false; - MessageDestinationComponent o = (MessageDestinationComponent) other; - return compareDeep(name, o.name, true) && compareDeep(target, o.target, true) && compareDeep(endpoint, o.endpoint, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MessageDestinationComponent)) - return false; - MessageDestinationComponent o = (MessageDestinationComponent) other; - return compareValues(name, o.name, true) && compareValues(endpoint, o.endpoint, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (target == null || target.isEmpty()) - && (endpoint == null || endpoint.isEmpty()); - } - - } - - /** - * The identifier of this message. - */ - @Child(name = "identifier", type = {IdType.class}, order=0, min=1, max=1) - @Description(shortDefinition="Id of this message", formalDefinition="The identifier of this message." ) - protected IdType identifier; - - /** - * The time that the message was sent. - */ - @Child(name = "timestamp", type = {InstantType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Time that the message was sent", formalDefinition="The time that the message was sent." ) - protected InstantType timestamp; - - /** - * Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://hl7.org/fhir/message-type". - */ - @Child(name = "event", type = {Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Code for the event this message represents", formalDefinition="Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value 'http://hl7.org/fhir/message-type'." ) - protected Coding event; - - /** - * Information about the message that this message is a response to. Only present if this message is a response. - */ - @Child(name = "response", type = {}, order=3, min=0, max=1) - @Description(shortDefinition="If this is a reply to prior message", formalDefinition="Information about the message that this message is a response to. Only present if this message is a response." ) - protected MessageHeaderResponseComponent response; - - /** - * The source application from which this message originated. - */ - @Child(name = "source", type = {}, order=4, min=1, max=1) - @Description(shortDefinition="Message Source Application", formalDefinition="The source application from which this message originated." ) - protected MessageSourceComponent source; - - /** - * The destination application which the message is intended for. - */ - @Child(name = "destination", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Message Destination Application(s)", formalDefinition="The destination application which the message is intended for." ) - protected List destination; - - /** - * The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions. - */ - @Child(name = "enterer", type = {Practitioner.class}, order=6, min=0, max=1) - @Description(shortDefinition="The source of the data entry", formalDefinition="The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions." ) - protected Reference enterer; - - /** - * The actual object that is the target of the reference (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) - */ - protected Practitioner entererTarget; - - /** - * The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions. - */ - @Child(name = "author", type = {Practitioner.class}, order=7, min=0, max=1) - @Description(shortDefinition="The source of the decision", formalDefinition="The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) - */ - protected Practitioner authorTarget; - - /** - * Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient. - */ - @Child(name = "receiver", type = {Practitioner.class, Organization.class}, order=8, min=0, max=1) - @Description(shortDefinition="Intended 'real-world' recipient for the data", formalDefinition="Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient." ) - protected Reference receiver; - - /** - * The actual object that is the target of the reference (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) - */ - protected Resource receiverTarget; - - /** - * The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party. - */ - @Child(name = "responsible", type = {Practitioner.class, Organization.class}, order=9, min=0, max=1) - @Description(shortDefinition="Final responsibility for event", formalDefinition="The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party." ) - protected Reference responsible; - - /** - * The actual object that is the target of the reference (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) - */ - protected Resource responsibleTarget; - - /** - * Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=10, min=0, max=1) - @Description(shortDefinition="Cause of event", formalDefinition="Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message." ) - protected CodeableConcept reason; - - /** - * The actual data of the message - a reference to the root/focus class of the event. - */ - @Child(name = "data", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The actual content of the message", formalDefinition="The actual data of the message - a reference to the root/focus class of the event." ) - protected List data; - /** - * The actual objects that are the target of the reference (The actual data of the message - a reference to the root/focus class of the event.) - */ - protected List dataTarget; - - - private static final long serialVersionUID = 1866986127L; - - /* - * Constructor - */ - public MessageHeader() { - super(); - } - - /* - * Constructor - */ - public MessageHeader(IdType identifier, InstantType timestamp, Coding event, MessageSourceComponent source) { - super(); - this.identifier = identifier; - this.timestamp = timestamp; - this.event = event; - this.source = source; - } - - /** - * @return {@link #identifier} (The identifier of this message.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public IdType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new IdType(); // bb - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The identifier of this message.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public MessageHeader setIdentifierElement(IdType value) { - this.identifier = value; - return this; - } - - /** - * @return The identifier of this message. - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value The identifier of this message. - */ - public MessageHeader setIdentifier(String value) { - if (this.identifier == null) - this.identifier = new IdType(); - this.identifier.setValue(value); - return this; - } - - /** - * @return {@link #timestamp} (The time that the message was sent.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value - */ - public InstantType getTimestampElement() { - if (this.timestamp == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.timestamp"); - else if (Configuration.doAutoCreate()) - this.timestamp = new InstantType(); // bb - return this.timestamp; - } - - public boolean hasTimestampElement() { - return this.timestamp != null && !this.timestamp.isEmpty(); - } - - public boolean hasTimestamp() { - return this.timestamp != null && !this.timestamp.isEmpty(); - } - - /** - * @param value {@link #timestamp} (The time that the message was sent.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value - */ - public MessageHeader setTimestampElement(InstantType value) { - this.timestamp = value; - return this; - } - - /** - * @return The time that the message was sent. - */ - public Date getTimestamp() { - return this.timestamp == null ? null : this.timestamp.getValue(); - } - - /** - * @param value The time that the message was sent. - */ - public MessageHeader setTimestamp(Date value) { - if (this.timestamp == null) - this.timestamp = new InstantType(); - this.timestamp.setValue(value); - return this; - } - - /** - * @return {@link #event} (Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://hl7.org/fhir/message-type".) - */ - public Coding getEvent() { - if (this.event == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.event"); - else if (Configuration.doAutoCreate()) - this.event = new Coding(); // cc - return this.event; - } - - public boolean hasEvent() { - return this.event != null && !this.event.isEmpty(); - } - - /** - * @param value {@link #event} (Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://hl7.org/fhir/message-type".) - */ - public MessageHeader setEvent(Coding value) { - this.event = value; - return this; - } - - /** - * @return {@link #response} (Information about the message that this message is a response to. Only present if this message is a response.) - */ - public MessageHeaderResponseComponent getResponse() { - if (this.response == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.response"); - else if (Configuration.doAutoCreate()) - this.response = new MessageHeaderResponseComponent(); // cc - return this.response; - } - - public boolean hasResponse() { - return this.response != null && !this.response.isEmpty(); - } - - /** - * @param value {@link #response} (Information about the message that this message is a response to. Only present if this message is a response.) - */ - public MessageHeader setResponse(MessageHeaderResponseComponent value) { - this.response = value; - return this; - } - - /** - * @return {@link #source} (The source application from which this message originated.) - */ - public MessageSourceComponent getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.source"); - else if (Configuration.doAutoCreate()) - this.source = new MessageSourceComponent(); // cc - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (The source application from which this message originated.) - */ - public MessageHeader setSource(MessageSourceComponent value) { - this.source = value; - return this; - } - - /** - * @return {@link #destination} (The destination application which the message is intended for.) - */ - public List getDestination() { - if (this.destination == null) - this.destination = new ArrayList(); - return this.destination; - } - - public boolean hasDestination() { - if (this.destination == null) - return false; - for (MessageDestinationComponent item : this.destination) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #destination} (The destination application which the message is intended for.) - */ - // syntactic sugar - public MessageDestinationComponent addDestination() { //3 - MessageDestinationComponent t = new MessageDestinationComponent(); - if (this.destination == null) - this.destination = new ArrayList(); - this.destination.add(t); - return t; - } - - // syntactic sugar - public MessageHeader addDestination(MessageDestinationComponent t) { //3 - if (t == null) - return this; - if (this.destination == null) - this.destination = new ArrayList(); - this.destination.add(t); - return this; - } - - /** - * @return {@link #enterer} (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) - */ - public Reference getEnterer() { - if (this.enterer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.enterer"); - else if (Configuration.doAutoCreate()) - this.enterer = new Reference(); // cc - return this.enterer; - } - - public boolean hasEnterer() { - return this.enterer != null && !this.enterer.isEmpty(); - } - - /** - * @param value {@link #enterer} (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) - */ - public MessageHeader setEnterer(Reference value) { - this.enterer = value; - return this; - } - - /** - * @return {@link #enterer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) - */ - public Practitioner getEntererTarget() { - if (this.entererTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.enterer"); - else if (Configuration.doAutoCreate()) - this.entererTarget = new Practitioner(); // aa - return this.entererTarget; - } - - /** - * @param value {@link #enterer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) - */ - public MessageHeader setEntererTarget(Practitioner value) { - this.entererTarget = value; - return this; - } - - /** - * @return {@link #author} (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); // cc - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) - */ - public MessageHeader setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) - */ - public Practitioner getAuthorTarget() { - if (this.authorTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.author"); - else if (Configuration.doAutoCreate()) - this.authorTarget = new Practitioner(); // aa - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) - */ - public MessageHeader setAuthorTarget(Practitioner value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #receiver} (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) - */ - public Reference getReceiver() { - if (this.receiver == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.receiver"); - else if (Configuration.doAutoCreate()) - this.receiver = new Reference(); // cc - return this.receiver; - } - - public boolean hasReceiver() { - return this.receiver != null && !this.receiver.isEmpty(); - } - - /** - * @param value {@link #receiver} (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) - */ - public MessageHeader setReceiver(Reference value) { - this.receiver = value; - return this; - } - - /** - * @return {@link #receiver} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) - */ - public Resource getReceiverTarget() { - return this.receiverTarget; - } - - /** - * @param value {@link #receiver} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) - */ - public MessageHeader setReceiverTarget(Resource value) { - this.receiverTarget = value; - return this; - } - - /** - * @return {@link #responsible} (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) - */ - public Reference getResponsible() { - if (this.responsible == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.responsible"); - else if (Configuration.doAutoCreate()) - this.responsible = new Reference(); // cc - return this.responsible; - } - - public boolean hasResponsible() { - return this.responsible != null && !this.responsible.isEmpty(); - } - - /** - * @param value {@link #responsible} (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) - */ - public MessageHeader setResponsible(Reference value) { - this.responsible = value; - return this; - } - - /** - * @return {@link #responsible} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) - */ - public Resource getResponsibleTarget() { - return this.responsibleTarget; - } - - /** - * @param value {@link #responsible} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) - */ - public MessageHeader setResponsibleTarget(Resource value) { - this.responsibleTarget = value; - return this; - } - - /** - * @return {@link #reason} (Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message.) - */ - public CodeableConcept getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new CodeableConcept(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message.) - */ - public MessageHeader setReason(CodeableConcept value) { - this.reason = value; - return this; - } - - /** - * @return {@link #data} (The actual data of the message - a reference to the root/focus class of the event.) - */ - public List getData() { - if (this.data == null) - this.data = new ArrayList(); - return this.data; - } - - public boolean hasData() { - if (this.data == null) - return false; - for (Reference item : this.data) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #data} (The actual data of the message - a reference to the root/focus class of the event.) - */ - // syntactic sugar - public Reference addData() { //3 - Reference t = new Reference(); - if (this.data == null) - this.data = new ArrayList(); - this.data.add(t); - return t; - } - - // syntactic sugar - public MessageHeader addData(Reference t) { //3 - if (t == null) - return this; - if (this.data == null) - this.data = new ArrayList(); - this.data.add(t); - return this; - } - - /** - * @return {@link #data} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The actual data of the message - a reference to the root/focus class of the event.) - */ - public List getDataTarget() { - if (this.dataTarget == null) - this.dataTarget = new ArrayList(); - return this.dataTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "id", "The identifier of this message.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("timestamp", "instant", "The time that the message was sent.", 0, java.lang.Integer.MAX_VALUE, timestamp)); - childrenList.add(new Property("event", "Coding", "Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value 'http://hl7.org/fhir/message-type'.", 0, java.lang.Integer.MAX_VALUE, event)); - childrenList.add(new Property("response", "", "Information about the message that this message is a response to. Only present if this message is a response.", 0, java.lang.Integer.MAX_VALUE, response)); - childrenList.add(new Property("source", "", "The source application from which this message originated.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("destination", "", "The destination application which the message is intended for.", 0, java.lang.Integer.MAX_VALUE, destination)); - childrenList.add(new Property("enterer", "Reference(Practitioner)", "The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.", 0, java.lang.Integer.MAX_VALUE, enterer)); - childrenList.add(new Property("author", "Reference(Practitioner)", "The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("receiver", "Reference(Practitioner|Organization)", "Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.", 0, java.lang.Integer.MAX_VALUE, receiver)); - childrenList.add(new Property("responsible", "Reference(Practitioner|Organization)", "The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.", 0, java.lang.Integer.MAX_VALUE, responsible)); - childrenList.add(new Property("reason", "CodeableConcept", "Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("data", "Reference(Any)", "The actual data of the message - a reference to the root/focus class of the event.", 0, java.lang.Integer.MAX_VALUE, data)); - } - - public MessageHeader copy() { - MessageHeader dst = new MessageHeader(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.timestamp = timestamp == null ? null : timestamp.copy(); - dst.event = event == null ? null : event.copy(); - dst.response = response == null ? null : response.copy(); - dst.source = source == null ? null : source.copy(); - if (destination != null) { - dst.destination = new ArrayList(); - for (MessageDestinationComponent i : destination) - dst.destination.add(i.copy()); - }; - dst.enterer = enterer == null ? null : enterer.copy(); - dst.author = author == null ? null : author.copy(); - dst.receiver = receiver == null ? null : receiver.copy(); - dst.responsible = responsible == null ? null : responsible.copy(); - dst.reason = reason == null ? null : reason.copy(); - if (data != null) { - dst.data = new ArrayList(); - for (Reference i : data) - dst.data.add(i.copy()); - }; - return dst; - } - - protected MessageHeader typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MessageHeader)) - return false; - MessageHeader o = (MessageHeader) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(timestamp, o.timestamp, true) - && compareDeep(event, o.event, true) && compareDeep(response, o.response, true) && compareDeep(source, o.source, true) - && compareDeep(destination, o.destination, true) && compareDeep(enterer, o.enterer, true) && compareDeep(author, o.author, true) - && compareDeep(receiver, o.receiver, true) && compareDeep(responsible, o.responsible, true) && compareDeep(reason, o.reason, true) - && compareDeep(data, o.data, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MessageHeader)) - return false; - MessageHeader o = (MessageHeader) other; - return compareValues(identifier, o.identifier, true) && compareValues(timestamp, o.timestamp, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (timestamp == null || timestamp.isEmpty()) - && (event == null || event.isEmpty()) && (response == null || response.isEmpty()) && (source == null || source.isEmpty()) - && (destination == null || destination.isEmpty()) && (enterer == null || enterer.isEmpty()) - && (author == null || author.isEmpty()) && (receiver == null || receiver.isEmpty()) && (responsible == null || responsible.isEmpty()) - && (reason == null || reason.isEmpty()) && (data == null || data.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.MessageHeader; - } - - @SearchParamDefinition(name="destination-uri", path="MessageHeader.destination.endpoint", description="Actual destination address or id", type="uri" ) - public static final String SP_DESTINATIONURI = "destination-uri"; - @SearchParamDefinition(name="responsible", path="MessageHeader.responsible", description="Final responsibility for event", type="reference" ) - public static final String SP_RESPONSIBLE = "responsible"; - @SearchParamDefinition(name="receiver", path="MessageHeader.receiver", description="Intended 'real-world' recipient for the data", type="reference" ) - public static final String SP_RECEIVER = "receiver"; - @SearchParamDefinition(name="data", path="MessageHeader.data", description="The actual content of the message", type="reference" ) - public static final String SP_DATA = "data"; - @SearchParamDefinition(name="code", path="MessageHeader.response.code", description="ok | transient-error | fatal-error", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="response-id", path="MessageHeader.response.identifier", description="Id of original message", type="token" ) - public static final String SP_RESPONSEID = "response-id"; - @SearchParamDefinition(name="src-id", path="MessageHeader.identifier", description="Id of this message", type="token" ) - public static final String SP_SRCID = "src-id"; - @SearchParamDefinition(name="destination", path="MessageHeader.destination.name", description="Name of system", type="string" ) - public static final String SP_DESTINATION = "destination"; - @SearchParamDefinition(name="timestamp", path="MessageHeader.timestamp", description="Time that the message was sent", type="date" ) - public static final String SP_TIMESTAMP = "timestamp"; - @SearchParamDefinition(name="author", path="MessageHeader.author", description="The source of the decision", type="reference" ) - public static final String SP_AUTHOR = "author"; - @SearchParamDefinition(name="source-uri", path="MessageHeader.source.endpoint", description="Actual message source address or id", type="uri" ) - public static final String SP_SOURCEURI = "source-uri"; - @SearchParamDefinition(name="source", path="MessageHeader.source.name", description="Name of system", type="string" ) - public static final String SP_SOURCE = "source"; - @SearchParamDefinition(name="enterer", path="MessageHeader.enterer", description="The source of the data entry", type="reference" ) - public static final String SP_ENTERER = "enterer"; - @SearchParamDefinition(name="event", path="MessageHeader.event", description="Code for the event this message represents", type="token" ) - public static final String SP_EVENT = "event"; - @SearchParamDefinition(name="target", path="MessageHeader.destination.target", description="Particular delivery destination within the destination", type="reference" ) - public static final String SP_TARGET = "target"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * The header for a message exchange that is either requesting or responding to an action. The Reference(s) that are the subject of the action as well as other Information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. + */ +@ResourceDef(name="MessageHeader", profile="http://hl7.org/fhir/Profile/MessageHeader") +public class MessageHeader extends DomainResource { + + public enum ResponseCode { + /** + * The message was accepted and processed without error. + */ + OK, + /** + * Some internal unexpected error occurred - wait and try again. Note - this is usually used for things like database unavailable, which may be expected to resolve, though human intervention may be required. + */ + TRANSIENTERROR, + /** + * The message was rejected because of some content in it. There is no point in re-sending without change. The response narrative SHALL describe what the issue is. + */ + FATALERROR, + /** + * added to help the parsers + */ + NULL; + public static ResponseCode fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("ok".equals(codeString)) + return OK; + if ("transient-error".equals(codeString)) + return TRANSIENTERROR; + if ("fatal-error".equals(codeString)) + return FATALERROR; + throw new Exception("Unknown ResponseCode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case OK: return "ok"; + case TRANSIENTERROR: return "transient-error"; + case FATALERROR: return "fatal-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case OK: return ""; + case TRANSIENTERROR: return ""; + case FATALERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case OK: return "The message was accepted and processed without error."; + case TRANSIENTERROR: return "Some internal unexpected error occurred - wait and try again. Note - this is usually used for things like database unavailable, which may be expected to resolve, though human intervention may be required."; + case FATALERROR: return "The message was rejected because of some content in it. There is no point in re-sending without change. The response narrative SHALL describe what the issue is."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case OK: return "Ok"; + case TRANSIENTERROR: return "Transient Error"; + case FATALERROR: return "Fatal Error"; + default: return "?"; + } + } + } + + public static class ResponseCodeEnumFactory implements EnumFactory { + public ResponseCode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("ok".equals(codeString)) + return ResponseCode.OK; + if ("transient-error".equals(codeString)) + return ResponseCode.TRANSIENTERROR; + if ("fatal-error".equals(codeString)) + return ResponseCode.FATALERROR; + throw new IllegalArgumentException("Unknown ResponseCode code '"+codeString+"'"); + } + public String toCode(ResponseCode code) { + if (code == ResponseCode.OK) + return "ok"; + if (code == ResponseCode.TRANSIENTERROR) + return "transient-error"; + if (code == ResponseCode.FATALERROR) + return "fatal-error"; + return "?"; + } + } + + @Block() + public static class MessageHeaderResponseComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The id of the message that this message is a response to. + */ + @Child(name = "identifier", type = {IdType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Id of original message", formalDefinition="The id of the message that this message is a response to." ) + protected IdType identifier; + + /** + * Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not. + */ + @Child(name = "code", type = {CodeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="ok | transient-error | fatal-error", formalDefinition="Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not." ) + protected Enumeration code; + + /** + * Full details of any issues found in the message. + */ + @Child(name = "details", type = {OperationOutcome.class}, order=3, min=0, max=1) + @Description(shortDefinition="Specific list of hints/warnings/errors", formalDefinition="Full details of any issues found in the message." ) + protected Reference details; + + /** + * The actual object that is the target of the reference (Full details of any issues found in the message.) + */ + protected OperationOutcome detailsTarget; + + private static final long serialVersionUID = 1419103693L; + + /* + * Constructor + */ + public MessageHeaderResponseComponent() { + super(); + } + + /* + * Constructor + */ + public MessageHeaderResponseComponent(IdType identifier, Enumeration code) { + super(); + this.identifier = identifier; + this.code = code; + } + + /** + * @return {@link #identifier} (The id of the message that this message is a response to.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public IdType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeaderResponseComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new IdType(); // bb + return this.identifier; + } + + public boolean hasIdentifierElement() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (The id of the message that this message is a response to.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public MessageHeaderResponseComponent setIdentifierElement(IdType value) { + this.identifier = value; + return this; + } + + /** + * @return The id of the message that this message is a response to. + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value The id of the message that this message is a response to. + */ + public MessageHeaderResponseComponent setIdentifier(String value) { + if (this.identifier == null) + this.identifier = new IdType(); + this.identifier.setValue(value); + return this; + } + + /** + * @return {@link #code} (Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Enumeration getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeaderResponseComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Enumeration(new ResponseCodeEnumFactory()); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public MessageHeaderResponseComponent setCodeElement(Enumeration value) { + this.code = value; + return this; + } + + /** + * @return Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not. + */ + public ResponseCode getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not. + */ + public MessageHeaderResponseComponent setCode(ResponseCode value) { + if (this.code == null) + this.code = new Enumeration(new ResponseCodeEnumFactory()); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #details} (Full details of any issues found in the message.) + */ + public Reference getDetails() { + if (this.details == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeaderResponseComponent.details"); + else if (Configuration.doAutoCreate()) + this.details = new Reference(); // cc + return this.details; + } + + public boolean hasDetails() { + return this.details != null && !this.details.isEmpty(); + } + + /** + * @param value {@link #details} (Full details of any issues found in the message.) + */ + public MessageHeaderResponseComponent setDetails(Reference value) { + this.details = value; + return this; + } + + /** + * @return {@link #details} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Full details of any issues found in the message.) + */ + public OperationOutcome getDetailsTarget() { + if (this.detailsTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeaderResponseComponent.details"); + else if (Configuration.doAutoCreate()) + this.detailsTarget = new OperationOutcome(); // aa + return this.detailsTarget; + } + + /** + * @param value {@link #details} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Full details of any issues found in the message.) + */ + public MessageHeaderResponseComponent setDetailsTarget(OperationOutcome value) { + this.detailsTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "id", "The id of the message that this message is a response to.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("code", "code", "Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("details", "Reference(OperationOutcome)", "Full details of any issues found in the message.", 0, java.lang.Integer.MAX_VALUE, details)); + } + + public MessageHeaderResponseComponent copy() { + MessageHeaderResponseComponent dst = new MessageHeaderResponseComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.code = code == null ? null : code.copy(); + dst.details = details == null ? null : details.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MessageHeaderResponseComponent)) + return false; + MessageHeaderResponseComponent o = (MessageHeaderResponseComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(code, o.code, true) && compareDeep(details, o.details, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MessageHeaderResponseComponent)) + return false; + MessageHeaderResponseComponent o = (MessageHeaderResponseComponent) other; + return compareValues(identifier, o.identifier, true) && compareValues(code, o.code, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) + && (details == null || details.isEmpty()); + } + + } + + @Block() + public static class MessageSourceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Human-readable name for the source system. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Name of system", formalDefinition="Human-readable name for the source system." ) + protected StringType name; + + /** + * May include configuration or other information useful in debugging. + */ + @Child(name = "software", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Name of software running the system", formalDefinition="May include configuration or other information useful in debugging." ) + protected StringType software; + + /** + * Can convey versions of multiple systems in situations where a message passes through multiple hands. + */ + @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Version of software running", formalDefinition="Can convey versions of multiple systems in situations where a message passes through multiple hands." ) + protected StringType version; + + /** + * An e-mail, phone, website or other contact point to use to resolve issues with message communications. + */ + @Child(name = "contact", type = {ContactPoint.class}, order=4, min=0, max=1) + @Description(shortDefinition="Human contact for problems", formalDefinition="An e-mail, phone, website or other contact point to use to resolve issues with message communications." ) + protected ContactPoint contact; + + /** + * Identifies the routing target to send acknowledgements to. + */ + @Child(name = "endpoint", type = {UriType.class}, order=5, min=1, max=1) + @Description(shortDefinition="Actual message source address or id", formalDefinition="Identifies the routing target to send acknowledgements to." ) + protected UriType endpoint; + + private static final long serialVersionUID = -115878196L; + + /* + * Constructor + */ + public MessageSourceComponent() { + super(); + } + + /* + * Constructor + */ + public MessageSourceComponent(UriType endpoint) { + super(); + this.endpoint = endpoint; + } + + /** + * @return {@link #name} (Human-readable name for the source system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageSourceComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (Human-readable name for the source system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public MessageSourceComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Human-readable name for the source system. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Human-readable name for the source system. + */ + public MessageSourceComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #software} (May include configuration or other information useful in debugging.). This is the underlying object with id, value and extensions. The accessor "getSoftware" gives direct access to the value + */ + public StringType getSoftwareElement() { + if (this.software == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageSourceComponent.software"); + else if (Configuration.doAutoCreate()) + this.software = new StringType(); // bb + return this.software; + } + + public boolean hasSoftwareElement() { + return this.software != null && !this.software.isEmpty(); + } + + public boolean hasSoftware() { + return this.software != null && !this.software.isEmpty(); + } + + /** + * @param value {@link #software} (May include configuration or other information useful in debugging.). This is the underlying object with id, value and extensions. The accessor "getSoftware" gives direct access to the value + */ + public MessageSourceComponent setSoftwareElement(StringType value) { + this.software = value; + return this; + } + + /** + * @return May include configuration or other information useful in debugging. + */ + public String getSoftware() { + return this.software == null ? null : this.software.getValue(); + } + + /** + * @param value May include configuration or other information useful in debugging. + */ + public MessageSourceComponent setSoftware(String value) { + if (Utilities.noString(value)) + this.software = null; + else { + if (this.software == null) + this.software = new StringType(); + this.software.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (Can convey versions of multiple systems in situations where a message passes through multiple hands.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageSourceComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (Can convey versions of multiple systems in situations where a message passes through multiple hands.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public MessageSourceComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return Can convey versions of multiple systems in situations where a message passes through multiple hands. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value Can convey versions of multiple systems in situations where a message passes through multiple hands. + */ + public MessageSourceComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (An e-mail, phone, website or other contact point to use to resolve issues with message communications.) + */ + public ContactPoint getContact() { + if (this.contact == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageSourceComponent.contact"); + else if (Configuration.doAutoCreate()) + this.contact = new ContactPoint(); // cc + return this.contact; + } + + public boolean hasContact() { + return this.contact != null && !this.contact.isEmpty(); + } + + /** + * @param value {@link #contact} (An e-mail, phone, website or other contact point to use to resolve issues with message communications.) + */ + public MessageSourceComponent setContact(ContactPoint value) { + this.contact = value; + return this; + } + + /** + * @return {@link #endpoint} (Identifies the routing target to send acknowledgements to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value + */ + public UriType getEndpointElement() { + if (this.endpoint == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageSourceComponent.endpoint"); + else if (Configuration.doAutoCreate()) + this.endpoint = new UriType(); // bb + return this.endpoint; + } + + public boolean hasEndpointElement() { + return this.endpoint != null && !this.endpoint.isEmpty(); + } + + public boolean hasEndpoint() { + return this.endpoint != null && !this.endpoint.isEmpty(); + } + + /** + * @param value {@link #endpoint} (Identifies the routing target to send acknowledgements to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value + */ + public MessageSourceComponent setEndpointElement(UriType value) { + this.endpoint = value; + return this; + } + + /** + * @return Identifies the routing target to send acknowledgements to. + */ + public String getEndpoint() { + return this.endpoint == null ? null : this.endpoint.getValue(); + } + + /** + * @param value Identifies the routing target to send acknowledgements to. + */ + public MessageSourceComponent setEndpoint(String value) { + if (this.endpoint == null) + this.endpoint = new UriType(); + this.endpoint.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "Human-readable name for the source system.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("software", "string", "May include configuration or other information useful in debugging.", 0, java.lang.Integer.MAX_VALUE, software)); + childrenList.add(new Property("version", "string", "Can convey versions of multiple systems in situations where a message passes through multiple hands.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("contact", "ContactPoint", "An e-mail, phone, website or other contact point to use to resolve issues with message communications.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("endpoint", "uri", "Identifies the routing target to send acknowledgements to.", 0, java.lang.Integer.MAX_VALUE, endpoint)); + } + + public MessageSourceComponent copy() { + MessageSourceComponent dst = new MessageSourceComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.software = software == null ? null : software.copy(); + dst.version = version == null ? null : version.copy(); + dst.contact = contact == null ? null : contact.copy(); + dst.endpoint = endpoint == null ? null : endpoint.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MessageSourceComponent)) + return false; + MessageSourceComponent o = (MessageSourceComponent) other; + return compareDeep(name, o.name, true) && compareDeep(software, o.software, true) && compareDeep(version, o.version, true) + && compareDeep(contact, o.contact, true) && compareDeep(endpoint, o.endpoint, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MessageSourceComponent)) + return false; + MessageSourceComponent o = (MessageSourceComponent) other; + return compareValues(name, o.name, true) && compareValues(software, o.software, true) && compareValues(version, o.version, true) + && compareValues(endpoint, o.endpoint, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (software == null || software.isEmpty()) + && (version == null || version.isEmpty()) && (contact == null || contact.isEmpty()) && (endpoint == null || endpoint.isEmpty()) + ; + } + + } + + @Block() + public static class MessageDestinationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Human-readable name for the target system. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Name of system", formalDefinition="Human-readable name for the target system." ) + protected StringType name; + + /** + * Identifies the target end system in situations where the initial message transmission is to an intermediary system. + */ + @Child(name = "target", type = {Device.class}, order=2, min=0, max=1) + @Description(shortDefinition="Particular delivery destination within the destination", formalDefinition="Identifies the target end system in situations where the initial message transmission is to an intermediary system." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) + */ + protected Device targetTarget; + + /** + * Indicates where the message should be routed to. + */ + @Child(name = "endpoint", type = {UriType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Actual destination address or id", formalDefinition="Indicates where the message should be routed to." ) + protected UriType endpoint; + + private static final long serialVersionUID = -2097633309L; + + /* + * Constructor + */ + public MessageDestinationComponent() { + super(); + } + + /* + * Constructor + */ + public MessageDestinationComponent(UriType endpoint) { + super(); + this.endpoint = endpoint; + } + + /** + * @return {@link #name} (Human-readable name for the target system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDestinationComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (Human-readable name for the target system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public MessageDestinationComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Human-readable name for the target system. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Human-readable name for the target system. + */ + public MessageDestinationComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDestinationComponent.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); // cc + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) + */ + public MessageDestinationComponent setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) + */ + public Device getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDestinationComponent.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Device(); // aa + return this.targetTarget; + } + + /** + * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) + */ + public MessageDestinationComponent setTargetTarget(Device value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #endpoint} (Indicates where the message should be routed to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value + */ + public UriType getEndpointElement() { + if (this.endpoint == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDestinationComponent.endpoint"); + else if (Configuration.doAutoCreate()) + this.endpoint = new UriType(); // bb + return this.endpoint; + } + + public boolean hasEndpointElement() { + return this.endpoint != null && !this.endpoint.isEmpty(); + } + + public boolean hasEndpoint() { + return this.endpoint != null && !this.endpoint.isEmpty(); + } + + /** + * @param value {@link #endpoint} (Indicates where the message should be routed to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value + */ + public MessageDestinationComponent setEndpointElement(UriType value) { + this.endpoint = value; + return this; + } + + /** + * @return Indicates where the message should be routed to. + */ + public String getEndpoint() { + return this.endpoint == null ? null : this.endpoint.getValue(); + } + + /** + * @param value Indicates where the message should be routed to. + */ + public MessageDestinationComponent setEndpoint(String value) { + if (this.endpoint == null) + this.endpoint = new UriType(); + this.endpoint.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "Human-readable name for the target system.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("target", "Reference(Device)", "Identifies the target end system in situations where the initial message transmission is to an intermediary system.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("endpoint", "uri", "Indicates where the message should be routed to.", 0, java.lang.Integer.MAX_VALUE, endpoint)); + } + + public MessageDestinationComponent copy() { + MessageDestinationComponent dst = new MessageDestinationComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.target = target == null ? null : target.copy(); + dst.endpoint = endpoint == null ? null : endpoint.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MessageDestinationComponent)) + return false; + MessageDestinationComponent o = (MessageDestinationComponent) other; + return compareDeep(name, o.name, true) && compareDeep(target, o.target, true) && compareDeep(endpoint, o.endpoint, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MessageDestinationComponent)) + return false; + MessageDestinationComponent o = (MessageDestinationComponent) other; + return compareValues(name, o.name, true) && compareValues(endpoint, o.endpoint, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (target == null || target.isEmpty()) + && (endpoint == null || endpoint.isEmpty()); + } + + } + + /** + * The identifier of this message. + */ + @Child(name = "identifier", type = {IdType.class}, order=0, min=1, max=1) + @Description(shortDefinition="Id of this message", formalDefinition="The identifier of this message." ) + protected IdType identifier; + + /** + * The time that the message was sent. + */ + @Child(name = "timestamp", type = {InstantType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Time that the message was sent", formalDefinition="The time that the message was sent." ) + protected InstantType timestamp; + + /** + * Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://hl7.org/fhir/message-type". + */ + @Child(name = "event", type = {Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Code for the event this message represents", formalDefinition="Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value 'http://hl7.org/fhir/message-type'." ) + protected Coding event; + + /** + * Information about the message that this message is a response to. Only present if this message is a response. + */ + @Child(name = "response", type = {}, order=3, min=0, max=1) + @Description(shortDefinition="If this is a reply to prior message", formalDefinition="Information about the message that this message is a response to. Only present if this message is a response." ) + protected MessageHeaderResponseComponent response; + + /** + * The source application from which this message originated. + */ + @Child(name = "source", type = {}, order=4, min=1, max=1) + @Description(shortDefinition="Message Source Application", formalDefinition="The source application from which this message originated." ) + protected MessageSourceComponent source; + + /** + * The destination application which the message is intended for. + */ + @Child(name = "destination", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Message Destination Application(s)", formalDefinition="The destination application which the message is intended for." ) + protected List destination; + + /** + * The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions. + */ + @Child(name = "enterer", type = {Practitioner.class}, order=6, min=0, max=1) + @Description(shortDefinition="The source of the data entry", formalDefinition="The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions." ) + protected Reference enterer; + + /** + * The actual object that is the target of the reference (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) + */ + protected Practitioner entererTarget; + + /** + * The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions. + */ + @Child(name = "author", type = {Practitioner.class}, order=7, min=0, max=1) + @Description(shortDefinition="The source of the decision", formalDefinition="The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) + */ + protected Practitioner authorTarget; + + /** + * Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient. + */ + @Child(name = "receiver", type = {Practitioner.class, Organization.class}, order=8, min=0, max=1) + @Description(shortDefinition="Intended 'real-world' recipient for the data", formalDefinition="Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient." ) + protected Reference receiver; + + /** + * The actual object that is the target of the reference (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) + */ + protected Resource receiverTarget; + + /** + * The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party. + */ + @Child(name = "responsible", type = {Practitioner.class, Organization.class}, order=9, min=0, max=1) + @Description(shortDefinition="Final responsibility for event", formalDefinition="The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party." ) + protected Reference responsible; + + /** + * The actual object that is the target of the reference (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) + */ + protected Resource responsibleTarget; + + /** + * Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=10, min=0, max=1) + @Description(shortDefinition="Cause of event", formalDefinition="Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message." ) + protected CodeableConcept reason; + + /** + * The actual data of the message - a reference to the root/focus class of the event. + */ + @Child(name = "data", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The actual content of the message", formalDefinition="The actual data of the message - a reference to the root/focus class of the event." ) + protected List data; + /** + * The actual objects that are the target of the reference (The actual data of the message - a reference to the root/focus class of the event.) + */ + protected List dataTarget; + + + private static final long serialVersionUID = 1866986127L; + + /* + * Constructor + */ + public MessageHeader() { + super(); + } + + /* + * Constructor + */ + public MessageHeader(IdType identifier, InstantType timestamp, Coding event, MessageSourceComponent source) { + super(); + this.identifier = identifier; + this.timestamp = timestamp; + this.event = event; + this.source = source; + } + + /** + * @return {@link #identifier} (The identifier of this message.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public IdType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new IdType(); // bb + return this.identifier; + } + + public boolean hasIdentifierElement() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (The identifier of this message.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public MessageHeader setIdentifierElement(IdType value) { + this.identifier = value; + return this; + } + + /** + * @return The identifier of this message. + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value The identifier of this message. + */ + public MessageHeader setIdentifier(String value) { + if (this.identifier == null) + this.identifier = new IdType(); + this.identifier.setValue(value); + return this; + } + + /** + * @return {@link #timestamp} (The time that the message was sent.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value + */ + public InstantType getTimestampElement() { + if (this.timestamp == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.timestamp"); + else if (Configuration.doAutoCreate()) + this.timestamp = new InstantType(); // bb + return this.timestamp; + } + + public boolean hasTimestampElement() { + return this.timestamp != null && !this.timestamp.isEmpty(); + } + + public boolean hasTimestamp() { + return this.timestamp != null && !this.timestamp.isEmpty(); + } + + /** + * @param value {@link #timestamp} (The time that the message was sent.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value + */ + public MessageHeader setTimestampElement(InstantType value) { + this.timestamp = value; + return this; + } + + /** + * @return The time that the message was sent. + */ + public Date getTimestamp() { + return this.timestamp == null ? null : this.timestamp.getValue(); + } + + /** + * @param value The time that the message was sent. + */ + public MessageHeader setTimestamp(Date value) { + if (this.timestamp == null) + this.timestamp = new InstantType(); + this.timestamp.setValue(value); + return this; + } + + /** + * @return {@link #event} (Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://hl7.org/fhir/message-type".) + */ + public Coding getEvent() { + if (this.event == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.event"); + else if (Configuration.doAutoCreate()) + this.event = new Coding(); // cc + return this.event; + } + + public boolean hasEvent() { + return this.event != null && !this.event.isEmpty(); + } + + /** + * @param value {@link #event} (Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://hl7.org/fhir/message-type".) + */ + public MessageHeader setEvent(Coding value) { + this.event = value; + return this; + } + + /** + * @return {@link #response} (Information about the message that this message is a response to. Only present if this message is a response.) + */ + public MessageHeaderResponseComponent getResponse() { + if (this.response == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.response"); + else if (Configuration.doAutoCreate()) + this.response = new MessageHeaderResponseComponent(); // cc + return this.response; + } + + public boolean hasResponse() { + return this.response != null && !this.response.isEmpty(); + } + + /** + * @param value {@link #response} (Information about the message that this message is a response to. Only present if this message is a response.) + */ + public MessageHeader setResponse(MessageHeaderResponseComponent value) { + this.response = value; + return this; + } + + /** + * @return {@link #source} (The source application from which this message originated.) + */ + public MessageSourceComponent getSource() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.source"); + else if (Configuration.doAutoCreate()) + this.source = new MessageSourceComponent(); // cc + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (The source application from which this message originated.) + */ + public MessageHeader setSource(MessageSourceComponent value) { + this.source = value; + return this; + } + + /** + * @return {@link #destination} (The destination application which the message is intended for.) + */ + public List getDestination() { + if (this.destination == null) + this.destination = new ArrayList(); + return this.destination; + } + + public boolean hasDestination() { + if (this.destination == null) + return false; + for (MessageDestinationComponent item : this.destination) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #destination} (The destination application which the message is intended for.) + */ + // syntactic sugar + public MessageDestinationComponent addDestination() { //3 + MessageDestinationComponent t = new MessageDestinationComponent(); + if (this.destination == null) + this.destination = new ArrayList(); + this.destination.add(t); + return t; + } + + // syntactic sugar + public MessageHeader addDestination(MessageDestinationComponent t) { //3 + if (t == null) + return this; + if (this.destination == null) + this.destination = new ArrayList(); + this.destination.add(t); + return this; + } + + /** + * @return {@link #enterer} (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) + */ + public Reference getEnterer() { + if (this.enterer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.enterer"); + else if (Configuration.doAutoCreate()) + this.enterer = new Reference(); // cc + return this.enterer; + } + + public boolean hasEnterer() { + return this.enterer != null && !this.enterer.isEmpty(); + } + + /** + * @param value {@link #enterer} (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) + */ + public MessageHeader setEnterer(Reference value) { + this.enterer = value; + return this; + } + + /** + * @return {@link #enterer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) + */ + public Practitioner getEntererTarget() { + if (this.entererTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.enterer"); + else if (Configuration.doAutoCreate()) + this.entererTarget = new Practitioner(); // aa + return this.entererTarget; + } + + /** + * @param value {@link #enterer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) + */ + public MessageHeader setEntererTarget(Practitioner value) { + this.entererTarget = value; + return this; + } + + /** + * @return {@link #author} (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); // cc + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) + */ + public MessageHeader setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) + */ + public Practitioner getAuthorTarget() { + if (this.authorTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.author"); + else if (Configuration.doAutoCreate()) + this.authorTarget = new Practitioner(); // aa + return this.authorTarget; + } + + /** + * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) + */ + public MessageHeader setAuthorTarget(Practitioner value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #receiver} (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) + */ + public Reference getReceiver() { + if (this.receiver == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.receiver"); + else if (Configuration.doAutoCreate()) + this.receiver = new Reference(); // cc + return this.receiver; + } + + public boolean hasReceiver() { + return this.receiver != null && !this.receiver.isEmpty(); + } + + /** + * @param value {@link #receiver} (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) + */ + public MessageHeader setReceiver(Reference value) { + this.receiver = value; + return this; + } + + /** + * @return {@link #receiver} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) + */ + public Resource getReceiverTarget() { + return this.receiverTarget; + } + + /** + * @param value {@link #receiver} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) + */ + public MessageHeader setReceiverTarget(Resource value) { + this.receiverTarget = value; + return this; + } + + /** + * @return {@link #responsible} (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) + */ + public Reference getResponsible() { + if (this.responsible == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.responsible"); + else if (Configuration.doAutoCreate()) + this.responsible = new Reference(); // cc + return this.responsible; + } + + public boolean hasResponsible() { + return this.responsible != null && !this.responsible.isEmpty(); + } + + /** + * @param value {@link #responsible} (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) + */ + public MessageHeader setResponsible(Reference value) { + this.responsible = value; + return this; + } + + /** + * @return {@link #responsible} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) + */ + public Resource getResponsibleTarget() { + return this.responsibleTarget; + } + + /** + * @param value {@link #responsible} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) + */ + public MessageHeader setResponsibleTarget(Resource value) { + this.responsibleTarget = value; + return this; + } + + /** + * @return {@link #reason} (Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message.) + */ + public CodeableConcept getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new CodeableConcept(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message.) + */ + public MessageHeader setReason(CodeableConcept value) { + this.reason = value; + return this; + } + + /** + * @return {@link #data} (The actual data of the message - a reference to the root/focus class of the event.) + */ + public List getData() { + if (this.data == null) + this.data = new ArrayList(); + return this.data; + } + + public boolean hasData() { + if (this.data == null) + return false; + for (Reference item : this.data) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #data} (The actual data of the message - a reference to the root/focus class of the event.) + */ + // syntactic sugar + public Reference addData() { //3 + Reference t = new Reference(); + if (this.data == null) + this.data = new ArrayList(); + this.data.add(t); + return t; + } + + // syntactic sugar + public MessageHeader addData(Reference t) { //3 + if (t == null) + return this; + if (this.data == null) + this.data = new ArrayList(); + this.data.add(t); + return this; + } + + /** + * @return {@link #data} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The actual data of the message - a reference to the root/focus class of the event.) + */ + public List getDataTarget() { + if (this.dataTarget == null) + this.dataTarget = new ArrayList(); + return this.dataTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "id", "The identifier of this message.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("timestamp", "instant", "The time that the message was sent.", 0, java.lang.Integer.MAX_VALUE, timestamp)); + childrenList.add(new Property("event", "Coding", "Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value 'http://hl7.org/fhir/message-type'.", 0, java.lang.Integer.MAX_VALUE, event)); + childrenList.add(new Property("response", "", "Information about the message that this message is a response to. Only present if this message is a response.", 0, java.lang.Integer.MAX_VALUE, response)); + childrenList.add(new Property("source", "", "The source application from which this message originated.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("destination", "", "The destination application which the message is intended for.", 0, java.lang.Integer.MAX_VALUE, destination)); + childrenList.add(new Property("enterer", "Reference(Practitioner)", "The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.", 0, java.lang.Integer.MAX_VALUE, enterer)); + childrenList.add(new Property("author", "Reference(Practitioner)", "The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("receiver", "Reference(Practitioner|Organization)", "Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.", 0, java.lang.Integer.MAX_VALUE, receiver)); + childrenList.add(new Property("responsible", "Reference(Practitioner|Organization)", "The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.", 0, java.lang.Integer.MAX_VALUE, responsible)); + childrenList.add(new Property("reason", "CodeableConcept", "Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("data", "Reference(Any)", "The actual data of the message - a reference to the root/focus class of the event.", 0, java.lang.Integer.MAX_VALUE, data)); + } + + public MessageHeader copy() { + MessageHeader dst = new MessageHeader(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.timestamp = timestamp == null ? null : timestamp.copy(); + dst.event = event == null ? null : event.copy(); + dst.response = response == null ? null : response.copy(); + dst.source = source == null ? null : source.copy(); + if (destination != null) { + dst.destination = new ArrayList(); + for (MessageDestinationComponent i : destination) + dst.destination.add(i.copy()); + }; + dst.enterer = enterer == null ? null : enterer.copy(); + dst.author = author == null ? null : author.copy(); + dst.receiver = receiver == null ? null : receiver.copy(); + dst.responsible = responsible == null ? null : responsible.copy(); + dst.reason = reason == null ? null : reason.copy(); + if (data != null) { + dst.data = new ArrayList(); + for (Reference i : data) + dst.data.add(i.copy()); + }; + return dst; + } + + protected MessageHeader typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MessageHeader)) + return false; + MessageHeader o = (MessageHeader) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(timestamp, o.timestamp, true) + && compareDeep(event, o.event, true) && compareDeep(response, o.response, true) && compareDeep(source, o.source, true) + && compareDeep(destination, o.destination, true) && compareDeep(enterer, o.enterer, true) && compareDeep(author, o.author, true) + && compareDeep(receiver, o.receiver, true) && compareDeep(responsible, o.responsible, true) && compareDeep(reason, o.reason, true) + && compareDeep(data, o.data, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MessageHeader)) + return false; + MessageHeader o = (MessageHeader) other; + return compareValues(identifier, o.identifier, true) && compareValues(timestamp, o.timestamp, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (timestamp == null || timestamp.isEmpty()) + && (event == null || event.isEmpty()) && (response == null || response.isEmpty()) && (source == null || source.isEmpty()) + && (destination == null || destination.isEmpty()) && (enterer == null || enterer.isEmpty()) + && (author == null || author.isEmpty()) && (receiver == null || receiver.isEmpty()) && (responsible == null || responsible.isEmpty()) + && (reason == null || reason.isEmpty()) && (data == null || data.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.MessageHeader; + } + + @SearchParamDefinition(name="code", path="MessageHeader.response.code", description="ok | transient-error | fatal-error", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="data", path="MessageHeader.data", description="The actual content of the message", type="reference" ) + public static final String SP_DATA = "data"; + @SearchParamDefinition(name="receiver", path="MessageHeader.receiver", description="Intended 'real-world' recipient for the data", type="reference" ) + public static final String SP_RECEIVER = "receiver"; + @SearchParamDefinition(name="author", path="MessageHeader.author", description="The source of the decision", type="reference" ) + public static final String SP_AUTHOR = "author"; + @SearchParamDefinition(name="destination", path="MessageHeader.destination.name", description="Name of system", type="string" ) + public static final String SP_DESTINATION = "destination"; + @SearchParamDefinition(name="source", path="MessageHeader.source.name", description="Name of system", type="string" ) + public static final String SP_SOURCE = "source"; + @SearchParamDefinition(name="target", path="MessageHeader.destination.target", description="Particular delivery destination within the destination", type="reference" ) + public static final String SP_TARGET = "target"; + @SearchParamDefinition(name="destination-uri", path="MessageHeader.destination.endpoint", description="Actual destination address or id", type="uri" ) + public static final String SP_DESTINATIONURI = "destination-uri"; + @SearchParamDefinition(name="src-id", path="MessageHeader.identifier", description="Id of this message", type="token" ) + public static final String SP_SRCID = "src-id"; + @SearchParamDefinition(name="source-uri", path="MessageHeader.source.endpoint", description="Actual message source address or id", type="uri" ) + public static final String SP_SOURCEURI = "source-uri"; + @SearchParamDefinition(name="responsible", path="MessageHeader.responsible", description="Final responsibility for event", type="reference" ) + public static final String SP_RESPONSIBLE = "responsible"; + @SearchParamDefinition(name="response-id", path="MessageHeader.response.identifier", description="Id of original message", type="token" ) + public static final String SP_RESPONSEID = "response-id"; + @SearchParamDefinition(name="enterer", path="MessageHeader.enterer", description="The source of the data entry", type="reference" ) + public static final String SP_ENTERER = "enterer"; + @SearchParamDefinition(name="event", path="MessageHeader.event", description="Code for the event this message represents", type="token" ) + public static final String SP_EVENT = "event"; + @SearchParamDefinition(name="timestamp", path="MessageHeader.timestamp", description="Time that the message was sent", type="date" ) + public static final String SP_TIMESTAMP = "timestamp"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Meta.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Meta.java index f1261c4b5dc..f86ebf34fd4 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Meta.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Meta.java @@ -1,412 +1,391 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource. - */ -@DatatypeDef(name="Meta") -public class Meta extends Type implements IBaseMetaType { - - /** - * The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted. - */ - @Child(name = "versionId", type = {IdType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Version specific identifier", formalDefinition="The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted." ) - protected IdType versionId; - - /** - * When the resource last changed - e.g. when the version changed. - */ - @Child(name = "lastUpdated", type = {InstantType.class}, order=1, min=0, max=1) - @Description(shortDefinition="When the resource version last changed", formalDefinition="When the resource last changed - e.g. when the version changed." ) - protected InstantType lastUpdated; - - /** - * A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]]. - */ - @Child(name = "profile", type = {UriType.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Profiles this resource claims to conform to", formalDefinition="A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]]." ) - protected List profile; - - /** - * Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure. - */ - @Child(name = "security", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Security Labels applied to this resource", formalDefinition="Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure." ) - protected List security; - - /** - * Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource. - */ - @Child(name = "tag", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Tags applied", formalDefinition="Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource." ) - protected List tag; - - private static final long serialVersionUID = 867134915L; - - /* - * Constructor - */ - public Meta() { - super(); - } - - /** - * @return {@link #versionId} (The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted.). This is the underlying object with id, value and extensions. The accessor "getVersionId" gives direct access to the value - */ - public IdType getVersionIdElement() { - if (this.versionId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Meta.versionId"); - else if (Configuration.doAutoCreate()) - this.versionId = new IdType(); // bb - return this.versionId; - } - - public boolean hasVersionIdElement() { - return this.versionId != null && !this.versionId.isEmpty(); - } - - public boolean hasVersionId() { - return this.versionId != null && !this.versionId.isEmpty(); - } - - /** - * @param value {@link #versionId} (The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted.). This is the underlying object with id, value and extensions. The accessor "getVersionId" gives direct access to the value - */ - public Meta setVersionIdElement(IdType value) { - this.versionId = value; - return this; - } - - /** - * @return The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted. - */ - public String getVersionId() { - return this.versionId == null ? null : this.versionId.getValue(); - } - - /** - * @param value The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted. - */ - public Meta setVersionId(String value) { - if (Utilities.noString(value)) - this.versionId = null; - else { - if (this.versionId == null) - this.versionId = new IdType(); - this.versionId.setValue(value); - } - return this; - } - - /** - * @return {@link #lastUpdated} (When the resource last changed - e.g. when the version changed.). This is the underlying object with id, value and extensions. The accessor "getLastUpdated" gives direct access to the value - */ - public InstantType getLastUpdatedElement() { - if (this.lastUpdated == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Meta.lastUpdated"); - else if (Configuration.doAutoCreate()) - this.lastUpdated = new InstantType(); // bb - return this.lastUpdated; - } - - public boolean hasLastUpdatedElement() { - return this.lastUpdated != null && !this.lastUpdated.isEmpty(); - } - - public boolean hasLastUpdated() { - return this.lastUpdated != null && !this.lastUpdated.isEmpty(); - } - - /** - * @param value {@link #lastUpdated} (When the resource last changed - e.g. when the version changed.). This is the underlying object with id, value and extensions. The accessor "getLastUpdated" gives direct access to the value - */ - public Meta setLastUpdatedElement(InstantType value) { - this.lastUpdated = value; - return this; - } - - /** - * @return When the resource last changed - e.g. when the version changed. - */ - public Date getLastUpdated() { - return this.lastUpdated == null ? null : this.lastUpdated.getValue(); - } - - /** - * @param value When the resource last changed - e.g. when the version changed. - */ - public Meta setLastUpdated(Date value) { - if (value == null) - this.lastUpdated = null; - else { - if (this.lastUpdated == null) - this.lastUpdated = new InstantType(); - this.lastUpdated.setValue(value); - } - return this; - } - - /** - * @return {@link #profile} (A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) - */ - public List getProfile() { - if (this.profile == null) - this.profile = new ArrayList(); - return this.profile; - } - - public boolean hasProfile() { - if (this.profile == null) - return false; - for (UriType item : this.profile) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #profile} (A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) - */ - // syntactic sugar - public UriType addProfileElement() {//2 - UriType t = new UriType(); - if (this.profile == null) - this.profile = new ArrayList(); - this.profile.add(t); - return t; - } - - /** - * @param value {@link #profile} (A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) - */ - public Meta addProfile(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.profile == null) - this.profile = new ArrayList(); - this.profile.add(t); - return this; - } - - /** - * @param value {@link #profile} (A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) - */ - public boolean hasProfile(String value) { - if (this.profile == null) - return false; - for (UriType v : this.profile) - if (v.equals(value)) // uri - return true; - return false; - } - - /** - * @return {@link #security} (Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.) - */ - public List getSecurity() { - if (this.security == null) - this.security = new ArrayList(); - return this.security; - } - - public boolean hasSecurity() { - if (this.security == null) - return false; - for (Coding item : this.security) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #security} (Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.) - */ - // syntactic sugar - public Coding addSecurity() { //3 - Coding t = new Coding(); - if (this.security == null) - this.security = new ArrayList(); - this.security.add(t); - return t; - } - - // syntactic sugar - public Meta addSecurity(Coding t) { //3 - if (t == null) - return this; - if (this.security == null) - this.security = new ArrayList(); - this.security.add(t); - return this; - } - - /** - * @return {@link #tag} (Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.) - */ - public List getTag() { - if (this.tag == null) - this.tag = new ArrayList(); - return this.tag; - } - - public boolean hasTag() { - if (this.tag == null) - return false; - for (Coding item : this.tag) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #tag} (Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.) - */ - // syntactic sugar - public Coding addTag() { //3 - Coding t = new Coding(); - if (this.tag == null) - this.tag = new ArrayList(); - this.tag.add(t); - return t; - } - - // syntactic sugar - public Meta addTag(Coding t) { //3 - if (t == null) - return this; - if (this.tag == null) - this.tag = new ArrayList(); - this.tag.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("versionId", "id", "The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted.", 0, java.lang.Integer.MAX_VALUE, versionId)); - childrenList.add(new Property("lastUpdated", "instant", "When the resource last changed - e.g. when the version changed.", 0, java.lang.Integer.MAX_VALUE, lastUpdated)); - childrenList.add(new Property("profile", "uri", "A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].", 0, java.lang.Integer.MAX_VALUE, profile)); - childrenList.add(new Property("security", "Coding", "Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.", 0, java.lang.Integer.MAX_VALUE, security)); - childrenList.add(new Property("tag", "Coding", "Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.", 0, java.lang.Integer.MAX_VALUE, tag)); - } - - public Meta copy() { - Meta dst = new Meta(); - copyValues(dst); - dst.versionId = versionId == null ? null : versionId.copy(); - dst.lastUpdated = lastUpdated == null ? null : lastUpdated.copy(); - if (profile != null) { - dst.profile = new ArrayList(); - for (UriType i : profile) - dst.profile.add(i.copy()); - }; - if (security != null) { - dst.security = new ArrayList(); - for (Coding i : security) - dst.security.add(i.copy()); - }; - if (tag != null) { - dst.tag = new ArrayList(); - for (Coding i : tag) - dst.tag.add(i.copy()); - }; - return dst; - } - - protected Meta typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Meta)) - return false; - Meta o = (Meta) other; - return compareDeep(versionId, o.versionId, true) && compareDeep(lastUpdated, o.lastUpdated, true) - && compareDeep(profile, o.profile, true) && compareDeep(security, o.security, true) && compareDeep(tag, o.tag, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Meta)) - return false; - Meta o = (Meta) other; - return compareValues(versionId, o.versionId, true) && compareValues(lastUpdated, o.lastUpdated, true) - && compareValues(profile, o.profile, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (versionId == null || versionId.isEmpty()) && (lastUpdated == null || lastUpdated.isEmpty()) - && (profile == null || profile.isEmpty()) && (security == null || security.isEmpty()) && (tag == null || tag.isEmpty()) - ; - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource. + */ +@DatatypeDef(name="Meta") +public class Meta extends Type implements IBaseMetaType { + + /** + * The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted. + */ + @Child(name = "versionId", type = {IdType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Version specific identifier", formalDefinition="The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted." ) + protected IdType versionId; + + /** + * When the resource last changed - e.g. when the version changed. + */ + @Child(name = "lastUpdated", type = {InstantType.class}, order=1, min=0, max=1) + @Description(shortDefinition="When the resource version last changed", formalDefinition="When the resource last changed - e.g. when the version changed." ) + protected InstantType lastUpdated; + + /** + * A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]]. + */ + @Child(name = "profile", type = {UriType.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Profiles this resource claims to conform to", formalDefinition="A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]]." ) + protected List profile; + + /** + * Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure. + */ + @Child(name = "security", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Security Labels applied to this resource", formalDefinition="Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure." ) + protected List security; + + /** + * Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource. + */ + @Child(name = "tag", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Tags applied", formalDefinition="Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource." ) + protected List tag; + + private static final long serialVersionUID = 867134915L; + + /* + * Constructor + */ + public Meta() { + super(); + } + + /** + * @return {@link #versionId} (The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted.). This is the underlying object with id, value and extensions. The accessor "getVersionId" gives direct access to the value + */ + public IdType getVersionIdElement() { + if (this.versionId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Meta.versionId"); + else if (Configuration.doAutoCreate()) + this.versionId = new IdType(); // bb + return this.versionId; + } + + public boolean hasVersionIdElement() { + return this.versionId != null && !this.versionId.isEmpty(); + } + + public boolean hasVersionId() { + return this.versionId != null && !this.versionId.isEmpty(); + } + + /** + * @param value {@link #versionId} (The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted.). This is the underlying object with id, value and extensions. The accessor "getVersionId" gives direct access to the value + */ + public Meta setVersionIdElement(IdType value) { + this.versionId = value; + return this; + } + + /** + * @return The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted. + */ + public String getVersionId() { + return this.versionId == null ? null : this.versionId.getValue(); + } + + /** + * @param value The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted. + */ + public Meta setVersionId(String value) { + if (Utilities.noString(value)) + this.versionId = null; + else { + if (this.versionId == null) + this.versionId = new IdType(); + this.versionId.setValue(value); + } + return this; + } + + /** + * @return {@link #lastUpdated} (When the resource last changed - e.g. when the version changed.). This is the underlying object with id, value and extensions. The accessor "getLastUpdated" gives direct access to the value + */ + public InstantType getLastUpdatedElement() { + if (this.lastUpdated == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Meta.lastUpdated"); + else if (Configuration.doAutoCreate()) + this.lastUpdated = new InstantType(); // bb + return this.lastUpdated; + } + + public boolean hasLastUpdatedElement() { + return this.lastUpdated != null && !this.lastUpdated.isEmpty(); + } + + public boolean hasLastUpdated() { + return this.lastUpdated != null && !this.lastUpdated.isEmpty(); + } + + /** + * @param value {@link #lastUpdated} (When the resource last changed - e.g. when the version changed.). This is the underlying object with id, value and extensions. The accessor "getLastUpdated" gives direct access to the value + */ + public Meta setLastUpdatedElement(InstantType value) { + this.lastUpdated = value; + return this; + } + + /** + * @return When the resource last changed - e.g. when the version changed. + */ + public Date getLastUpdated() { + return this.lastUpdated == null ? null : this.lastUpdated.getValue(); + } + + /** + * @param value When the resource last changed - e.g. when the version changed. + */ + public Meta setLastUpdated(Date value) { + if (value == null) + this.lastUpdated = null; + else { + if (this.lastUpdated == null) + this.lastUpdated = new InstantType(); + this.lastUpdated.setValue(value); + } + return this; + } + + /** + * @return {@link #profile} (A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) + */ + public List getProfile() { + if (this.profile == null) + this.profile = new ArrayList(); + return this.profile; + } + + public boolean hasProfile() { + if (this.profile == null) + return false; + for (UriType item : this.profile) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #profile} (A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) + */ + // syntactic sugar + public UriType addProfileElement() {//2 + UriType t = new UriType(); + if (this.profile == null) + this.profile = new ArrayList(); + this.profile.add(t); + return t; + } + + /** + * @param value {@link #profile} (A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) + */ + public Meta addProfile(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.profile == null) + this.profile = new ArrayList(); + this.profile.add(t); + return this; + } + + /** + * @param value {@link #profile} (A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) + */ + public boolean hasProfile(String value) { + if (this.profile == null) + return false; + for (UriType v : this.profile) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #security} (Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.) + */ + public List getSecurity() { + if (this.security == null) + this.security = new ArrayList(); + return this.security; + } + + public boolean hasSecurity() { + if (this.security == null) + return false; + for (Coding item : this.security) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #security} (Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.) + */ + // syntactic sugar + public Coding addSecurity() { //3 + Coding t = new Coding(); + if (this.security == null) + this.security = new ArrayList(); + this.security.add(t); + return t; + } + + // syntactic sugar + public Meta addSecurity(Coding t) { //3 + if (t == null) + return this; + if (this.security == null) + this.security = new ArrayList(); + this.security.add(t); + return this; + } + + /** + * @return {@link #tag} (Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.) + */ + public List getTag() { + if (this.tag == null) + this.tag = new ArrayList(); + return this.tag; + } + + public boolean hasTag() { + if (this.tag == null) + return false; + for (Coding item : this.tag) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #tag} (Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.) + */ + // syntactic sugar + public Coding addTag() { //3 + Coding t = new Coding(); + if (this.tag == null) + this.tag = new ArrayList(); + this.tag.add(t); + return t; + } + + // syntactic sugar + public Meta addTag(Coding t) { //3 + if (t == null) + return this; + if (this.tag == null) + this.tag = new ArrayList(); + this.tag.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("versionId", "id", "The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted.", 0, java.lang.Integer.MAX_VALUE, versionId)); + childrenList.add(new Property("lastUpdated", "instant", "When the resource last changed - e.g. when the version changed.", 0, java.lang.Integer.MAX_VALUE, lastUpdated)); + childrenList.add(new Property("profile", "uri", "A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("security", "Coding", "Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.", 0, java.lang.Integer.MAX_VALUE, security)); + childrenList.add(new Property("tag", "Coding", "Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.", 0, java.lang.Integer.MAX_VALUE, tag)); + } + + public Meta copy() { + Meta dst = new Meta(); + copyValues(dst); + dst.versionId = versionId == null ? null : versionId.copy(); + dst.lastUpdated = lastUpdated == null ? null : lastUpdated.copy(); + if (profile != null) { + dst.profile = new ArrayList(); + for (UriType i : profile) + dst.profile.add(i.copy()); + }; + if (security != null) { + dst.security = new ArrayList(); + for (Coding i : security) + dst.security.add(i.copy()); + }; + if (tag != null) { + dst.tag = new ArrayList(); + for (Coding i : tag) + dst.tag.add(i.copy()); + }; + return dst; + } + + protected Meta typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Meta)) + return false; + Meta o = (Meta) other; + return compareDeep(versionId, o.versionId, true) && compareDeep(lastUpdated, o.lastUpdated, true) + && compareDeep(profile, o.profile, true) && compareDeep(security, o.security, true) && compareDeep(tag, o.tag, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Meta)) + return false; + Meta o = (Meta) other; + return compareValues(versionId, o.versionId, true) && compareValues(lastUpdated, o.lastUpdated, true) + && compareValues(profile, o.profile, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (versionId == null || versionId.isEmpty()) && (lastUpdated == null || lastUpdated.isEmpty()) + && (profile == null || profile.isEmpty()) && (security == null || security.isEmpty()) && (tag == null || tag.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Money.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Money.java index 0c85e729122..c345b175446 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Money.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Money.java @@ -1,111 +1,90 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * 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(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Money)) - return false; - Money o = (Money) other; - return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(units, o.units, true) - && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Money)) - return false; - Money o = (Money) other; - return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(units, o.units, true) - && compareValues(system, o.system, true) && compareValues(code, o.code, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) - && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * 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(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Money)) + return false; + Money o = (Money) other; + return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(units, o.units, true) + && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Money)) + return false; + Money o = (Money) other; + return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(units, o.units, true) + && compareValues(system, o.system, true) && compareValues(code, o.code, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) + && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/NamingSystem.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/NamingSystem.java index 4379f289c93..da9b560b288 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/NamingSystem.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/NamingSystem.java @@ -1,1478 +1,1457 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import java.util.*; - -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.instance.model.Enumerations.*; -import org.hl7.fhir.instance.model.annotations.ResourceDef; -import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; -import org.hl7.fhir.instance.model.annotations.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. - */ -@ResourceDef(name="NamingSystem", profile="http://hl7.org/fhir/Profile/NamingSystem") -public class NamingSystem extends DomainResource { - - public enum NamingsystemType { - /** - * The namingsystem is used to define concepts and symbols to represent those concepts. E.g. UCUM, LOINC, NDC code, local lab codes, etc. - */ - CODESYSTEM, - /** - * The namingsystem is used to manage identifiers (e.g. license numbers, order numbers, etc.). - */ - IDENTIFIER, - /** - * The namingsystem is used as the root for other identifiers and namingsystems. - */ - ROOT, - /** - * added to help the parsers - */ - NULL; - public static NamingsystemType fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("codesystem".equals(codeString)) - return CODESYSTEM; - if ("identifier".equals(codeString)) - return IDENTIFIER; - if ("root".equals(codeString)) - return ROOT; - throw new Exception("Unknown NamingsystemType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CODESYSTEM: return "codesystem"; - case IDENTIFIER: return "identifier"; - case ROOT: return "root"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CODESYSTEM: return ""; - case IDENTIFIER: return ""; - case ROOT: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CODESYSTEM: return "The namingsystem is used to define concepts and symbols to represent those concepts. E.g. UCUM, LOINC, NDC code, local lab codes, etc."; - case IDENTIFIER: return "The namingsystem is used to manage identifiers (e.g. license numbers, order numbers, etc.)."; - case ROOT: return "The namingsystem is used as the root for other identifiers and namingsystems."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CODESYSTEM: return "Codesystem"; - case IDENTIFIER: return "Identifier"; - case ROOT: return "Root"; - default: return "?"; - } - } - } - - public static class NamingsystemTypeEnumFactory implements EnumFactory { - public NamingsystemType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("codesystem".equals(codeString)) - return NamingsystemType.CODESYSTEM; - if ("identifier".equals(codeString)) - return NamingsystemType.IDENTIFIER; - if ("root".equals(codeString)) - return NamingsystemType.ROOT; - throw new IllegalArgumentException("Unknown NamingsystemType code '"+codeString+"'"); - } - public String toCode(NamingsystemType code) { - if (code == NamingsystemType.CODESYSTEM) - return "codesystem"; - if (code == NamingsystemType.IDENTIFIER) - return "identifier"; - if (code == NamingsystemType.ROOT) - return "root"; - return "?"; - } - } - - public enum NamingsystemIdentifierType { - /** - * An ISO object identifier. E.g. 1.2.3.4.5. - */ - OID, - /** - * A universally unique identifier of the form a5afddf4-e880-459b-876e-e4591b0acc11. - */ - UUID, - /** - * A uniform resource identifier (ideally a URL - uniform resource locator). E.g. http://unitsofmeasure.org. - */ - URI, - /** - * Some other type of unique identifier. E.g HL7-assigned reserved string such as LN for LOINC. - */ - OTHER, - /** - * added to help the parsers - */ - NULL; - public static NamingsystemIdentifierType fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("oid".equals(codeString)) - return OID; - if ("uuid".equals(codeString)) - return UUID; - if ("uri".equals(codeString)) - return URI; - if ("other".equals(codeString)) - return OTHER; - throw new Exception("Unknown NamingsystemIdentifierType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case OID: return "oid"; - case UUID: return "uuid"; - case URI: return "uri"; - case OTHER: return "other"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case OID: return ""; - case UUID: return ""; - case URI: return ""; - case OTHER: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case OID: return "An ISO object identifier. E.g. 1.2.3.4.5."; - case UUID: return "A universally unique identifier of the form a5afddf4-e880-459b-876e-e4591b0acc11."; - case URI: return "A uniform resource identifier (ideally a URL - uniform resource locator). E.g. http://unitsofmeasure.org."; - case OTHER: return "Some other type of unique identifier. E.g HL7-assigned reserved string such as LN for LOINC."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case OID: return "Oid"; - case UUID: return "Uuid"; - case URI: return "Uri"; - case OTHER: return "Other"; - default: return "?"; - } - } - } - - public static class NamingsystemIdentifierTypeEnumFactory implements EnumFactory { - public NamingsystemIdentifierType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("oid".equals(codeString)) - return NamingsystemIdentifierType.OID; - if ("uuid".equals(codeString)) - return NamingsystemIdentifierType.UUID; - if ("uri".equals(codeString)) - return NamingsystemIdentifierType.URI; - if ("other".equals(codeString)) - return NamingsystemIdentifierType.OTHER; - throw new IllegalArgumentException("Unknown NamingsystemIdentifierType code '"+codeString+"'"); - } - public String toCode(NamingsystemIdentifierType code) { - if (code == NamingsystemIdentifierType.OID) - return "oid"; - if (code == NamingsystemIdentifierType.UUID) - return "uuid"; - if (code == NamingsystemIdentifierType.URI) - return "uri"; - if (code == NamingsystemIdentifierType.OTHER) - return "other"; - return "?"; - } - } - - @Block() - public static class NamingSystemUniqueIdComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifies the unique identifier scheme used for this particular identifier. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="oid | uuid | uri | other", formalDefinition="Identifies the unique identifier scheme used for this particular identifier." ) - protected Enumeration type; - - /** - * The string that should be sent over the wire to identify the code system or identifier system. - */ - @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1) - @Description(shortDefinition="The unique identifier", formalDefinition="The string that should be sent over the wire to identify the code system or identifier system." ) - protected StringType value; - - /** - * Indicates whether this identifier is the "preferred" identifier of this type. - */ - @Child(name = "preferred", type = {BooleanType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Is this the id that should be used for this type", formalDefinition="Indicates whether this identifier is the 'preferred' identifier of this type." ) - protected BooleanType preferred; - - /** - * Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem. Outside of this window, the identifier might be non-deterministic. - */ - @Child(name = "period", type = {Period.class}, order=4, min=0, max=1) - @Description(shortDefinition="When is identifier valid?", formalDefinition="Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem. Outside of this window, the identifier might be non-deterministic." ) - protected Period period; - - private static final long serialVersionUID = -250649344L; - - /* - * Constructor - */ - public NamingSystemUniqueIdComponent() { - super(); - } - - /* - * Constructor - */ - public NamingSystemUniqueIdComponent(Enumeration type, StringType value) { - super(); - this.type = type; - this.value = value; - } - - /** - * @return {@link #type} (Identifies the unique identifier scheme used for this particular identifier.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new NamingsystemIdentifierTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Identifies the unique identifier scheme used for this particular identifier.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public NamingSystemUniqueIdComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Identifies the unique identifier scheme used for this particular identifier. - */ - public NamingsystemIdentifierType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Identifies the unique identifier scheme used for this particular identifier. - */ - public NamingSystemUniqueIdComponent setType(NamingsystemIdentifierType value) { - if (this.type == null) - this.type = new Enumeration(new NamingsystemIdentifierTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #value} (The string that should be sent over the wire to identify the code system or identifier system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The string that should be sent over the wire to identify the code system or identifier system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public NamingSystemUniqueIdComponent setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The string that should be sent over the wire to identify the code system or identifier system. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The string that should be sent over the wire to identify the code system or identifier system. - */ - public NamingSystemUniqueIdComponent setValue(String value) { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - return this; - } - - /** - * @return {@link #preferred} (Indicates whether this identifier is the "preferred" identifier of this type.). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value - */ - public BooleanType getPreferredElement() { - if (this.preferred == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.preferred"); - else if (Configuration.doAutoCreate()) - this.preferred = new BooleanType(); // bb - return this.preferred; - } - - public boolean hasPreferredElement() { - return this.preferred != null && !this.preferred.isEmpty(); - } - - public boolean hasPreferred() { - return this.preferred != null && !this.preferred.isEmpty(); - } - - /** - * @param value {@link #preferred} (Indicates whether this identifier is the "preferred" identifier of this type.). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value - */ - public NamingSystemUniqueIdComponent setPreferredElement(BooleanType value) { - this.preferred = value; - return this; - } - - /** - * @return Indicates whether this identifier is the "preferred" identifier of this type. - */ - public boolean getPreferred() { - return this.preferred == null || this.preferred.isEmpty() ? false : this.preferred.getValue(); - } - - /** - * @param value Indicates whether this identifier is the "preferred" identifier of this type. - */ - public NamingSystemUniqueIdComponent setPreferred(boolean value) { - if (this.preferred == null) - this.preferred = new BooleanType(); - this.preferred.setValue(value); - return this; - } - - /** - * @return {@link #period} (Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem. Outside of this window, the identifier might be non-deterministic.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem. Outside of this window, the identifier might be non-deterministic.) - */ - public NamingSystemUniqueIdComponent setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Identifies the unique identifier scheme used for this particular identifier.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("value", "string", "The string that should be sent over the wire to identify the code system or identifier system.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("preferred", "boolean", "Indicates whether this identifier is the 'preferred' identifier of this type.", 0, java.lang.Integer.MAX_VALUE, preferred)); - childrenList.add(new Property("period", "Period", "Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem. Outside of this window, the identifier might be non-deterministic.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - public NamingSystemUniqueIdComponent copy() { - NamingSystemUniqueIdComponent dst = new NamingSystemUniqueIdComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.value = value == null ? null : value.copy(); - dst.preferred = preferred == null ? null : preferred.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NamingSystemUniqueIdComponent)) - return false; - NamingSystemUniqueIdComponent o = (NamingSystemUniqueIdComponent) other; - return compareDeep(type, o.type, true) && compareDeep(value, o.value, true) && compareDeep(preferred, o.preferred, true) - && compareDeep(period, o.period, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NamingSystemUniqueIdComponent)) - return false; - NamingSystemUniqueIdComponent o = (NamingSystemUniqueIdComponent) other; - return compareValues(type, o.type, true) && compareValues(value, o.value, true) && compareValues(preferred, o.preferred, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (value == null || value.isEmpty()) - && (preferred == null || preferred.isEmpty()) && (period == null || period.isEmpty()); - } - - } - - @Block() - public static class NamingSystemContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the naming system. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Name of a individual to contact", formalDefinition="The name of an individual to contact regarding the naming system." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /* - * Constructor - */ - public NamingSystemContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the naming system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystemContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the naming system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public NamingSystemContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the naming system. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the naming system. - */ - public NamingSystemContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public NamingSystemContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the naming system.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - public NamingSystemContactComponent copy() { - NamingSystemContactComponent dst = new NamingSystemContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NamingSystemContactComponent)) - return false; - NamingSystemContactComponent o = (NamingSystemContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NamingSystemContactComponent)) - return false; - NamingSystemContactComponent o = (NamingSystemContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - } - - /** - * Indicates the purpose for the namingsystem - what kinds of things does it make unique? - */ - @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1) - @Description(shortDefinition="codesystem | identifier | root", formalDefinition="Indicates the purpose for the namingsystem - what kinds of things does it make unique?" ) - protected Enumeration type; - - /** - * The descriptive name of this particular identifier type or code system. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Human-readable label", formalDefinition="The descriptive name of this particular identifier type or code system." ) - protected StringType name; - - /** - * The date (and optionally time) when the system was registered or published. - */ - @Child(name = "date", type = {DateTimeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Publication Date(/time)", formalDefinition="The date (and optionally time) when the system was registered or published." ) - protected DateTimeType date; - - /** - * Indicates whether the namingsystem is "ready for use" or not. - */ - @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1) - @Description(shortDefinition="draft | active | retired", formalDefinition="Indicates whether the namingsystem is 'ready for use' or not." ) - protected Enumeration status; - - /** - * If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system. - */ - @Child(name = "country", type = {CodeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="ISO 3-char country code", formalDefinition="If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system." ) - protected CodeType country; - - /** - * Categorizes a namingsystem for easier search by grouping related namingsystems. - */ - @Child(name = "category", type = {CodeableConcept.class}, order=5, min=0, max=1) - @Description(shortDefinition="e.g. driver, provider, patient, bank etc", formalDefinition="Categorizes a namingsystem for easier search by grouping related namingsystems." ) - protected CodeableConcept category; - - /** - * The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision. - */ - @Child(name = "responsible", type = {StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Who maintains system namespace?", formalDefinition="The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision." ) - protected StringType responsible; - - /** - * Details about what the namespace identifies including scope, granularity, version labeling, etc. - */ - @Child(name = "description", type = {StringType.class}, order=7, min=0, max=1) - @Description(shortDefinition="What does namingsystem identify?", formalDefinition="Details about what the namespace identifies including scope, granularity, version labeling, etc." ) - protected StringType description; - - /** - * Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc. - */ - @Child(name = "usage", type = {StringType.class}, order=8, min=0, max=1) - @Description(shortDefinition="How/where is it used", formalDefinition="Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc." ) - protected StringType usage; - - /** - * Indicates how the system may be identified when referenced in electronic exchange. - */ - @Child(name = "uniqueId", type = {}, order=9, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Unique identifiers used for system", formalDefinition="Indicates how the system may be identified when referenced in electronic exchange." ) - protected List uniqueId; - - /** - * The name of the individual or organization that published the naming system. - */ - @Child(name = "publisher", type = {StringType.class}, order=10, min=0, max=1) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the naming system." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any). - */ - @Child(name = "replacedBy", type = {NamingSystem.class}, order=12, min=0, max=1) - @Description(shortDefinition="Use this instead", formalDefinition="For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any)." ) - protected Reference replacedBy; - - /** - * The actual object that is the target of the reference (For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).) - */ - protected NamingSystem replacedByTarget; - - private static final long serialVersionUID = -241224889L; - - /* - * Constructor - */ - public NamingSystem() { - super(); - } - - /* - * Constructor - */ - public NamingSystem(Enumeration type, StringType name, DateTimeType date, Enumeration status) { - super(); - this.type = type; - this.name = name; - this.date = date; - this.status = status; - } - - /** - * @return {@link #type} (Indicates the purpose for the namingsystem - what kinds of things does it make unique?). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new NamingsystemTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Indicates the purpose for the namingsystem - what kinds of things does it make unique?). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public NamingSystem setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Indicates the purpose for the namingsystem - what kinds of things does it make unique? - */ - public NamingsystemType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Indicates the purpose for the namingsystem - what kinds of things does it make unique? - */ - public NamingSystem setType(NamingsystemType value) { - if (this.type == null) - this.type = new Enumeration(new NamingsystemTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #name} (The descriptive name of this particular identifier type or code system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The descriptive name of this particular identifier type or code system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public NamingSystem setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The descriptive name of this particular identifier type or code system. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The descriptive name of this particular identifier type or code system. - */ - public NamingSystem setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #date} (The date (and optionally time) when the system was registered or published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date (and optionally time) when the system was registered or published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public NamingSystem setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date (and optionally time) when the system was registered or published. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date (and optionally time) when the system was registered or published. - */ - public NamingSystem setDate(Date value) { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - return this; - } - - /** - * @return {@link #status} (Indicates whether the namingsystem is "ready for use" or not.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Indicates whether the namingsystem is "ready for use" or not.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public NamingSystem setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Indicates whether the namingsystem is "ready for use" or not. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Indicates whether the namingsystem is "ready for use" or not. - */ - public NamingSystem setStatus(ConformanceResourceStatus value) { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #country} (If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system.). This is the underlying object with id, value and extensions. The accessor "getCountry" gives direct access to the value - */ - public CodeType getCountryElement() { - if (this.country == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.country"); - else if (Configuration.doAutoCreate()) - this.country = new CodeType(); // bb - return this.country; - } - - public boolean hasCountryElement() { - return this.country != null && !this.country.isEmpty(); - } - - public boolean hasCountry() { - return this.country != null && !this.country.isEmpty(); - } - - /** - * @param value {@link #country} (If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system.). This is the underlying object with id, value and extensions. The accessor "getCountry" gives direct access to the value - */ - public NamingSystem setCountryElement(CodeType value) { - this.country = value; - return this; - } - - /** - * @return If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system. - */ - public String getCountry() { - return this.country == null ? null : this.country.getValue(); - } - - /** - * @param value If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system. - */ - public NamingSystem setCountry(String value) { - if (Utilities.noString(value)) - this.country = null; - else { - if (this.country == null) - this.country = new CodeType(); - this.country.setValue(value); - } - return this; - } - - /** - * @return {@link #category} (Categorizes a namingsystem for easier search by grouping related namingsystems.) - */ - public CodeableConcept getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.category"); - else if (Configuration.doAutoCreate()) - this.category = new CodeableConcept(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Categorizes a namingsystem for easier search by grouping related namingsystems.) - */ - public NamingSystem setCategory(CodeableConcept value) { - this.category = value; - return this; - } - - /** - * @return {@link #responsible} (The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value - */ - public StringType getResponsibleElement() { - if (this.responsible == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.responsible"); - else if (Configuration.doAutoCreate()) - this.responsible = new StringType(); // bb - return this.responsible; - } - - public boolean hasResponsibleElement() { - return this.responsible != null && !this.responsible.isEmpty(); - } - - public boolean hasResponsible() { - return this.responsible != null && !this.responsible.isEmpty(); - } - - /** - * @param value {@link #responsible} (The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value - */ - public NamingSystem setResponsibleElement(StringType value) { - this.responsible = value; - return this; - } - - /** - * @return The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision. - */ - public String getResponsible() { - return this.responsible == null ? null : this.responsible.getValue(); - } - - /** - * @param value The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision. - */ - public NamingSystem setResponsible(String value) { - if (Utilities.noString(value)) - this.responsible = null; - else { - if (this.responsible == null) - this.responsible = new StringType(); - this.responsible.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (Details about what the namespace identifies including scope, granularity, version labeling, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Details about what the namespace identifies including scope, granularity, version labeling, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public NamingSystem setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Details about what the namespace identifies including scope, granularity, version labeling, etc. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Details about what the namespace identifies including scope, granularity, version labeling, etc. - */ - public NamingSystem setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #usage} (Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value - */ - public StringType getUsageElement() { - if (this.usage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.usage"); - else if (Configuration.doAutoCreate()) - this.usage = new StringType(); // bb - return this.usage; - } - - public boolean hasUsageElement() { - return this.usage != null && !this.usage.isEmpty(); - } - - public boolean hasUsage() { - return this.usage != null && !this.usage.isEmpty(); - } - - /** - * @param value {@link #usage} (Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value - */ - public NamingSystem setUsageElement(StringType value) { - this.usage = value; - return this; - } - - /** - * @return Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc. - */ - public String getUsage() { - return this.usage == null ? null : this.usage.getValue(); - } - - /** - * @param value Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc. - */ - public NamingSystem setUsage(String value) { - if (Utilities.noString(value)) - this.usage = null; - else { - if (this.usage == null) - this.usage = new StringType(); - this.usage.setValue(value); - } - return this; - } - - /** - * @return {@link #uniqueId} (Indicates how the system may be identified when referenced in electronic exchange.) - */ - public List getUniqueId() { - if (this.uniqueId == null) - this.uniqueId = new ArrayList(); - return this.uniqueId; - } - - public boolean hasUniqueId() { - if (this.uniqueId == null) - return false; - for (NamingSystemUniqueIdComponent item : this.uniqueId) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #uniqueId} (Indicates how the system may be identified when referenced in electronic exchange.) - */ - // syntactic sugar - public NamingSystemUniqueIdComponent addUniqueId() { //3 - NamingSystemUniqueIdComponent t = new NamingSystemUniqueIdComponent(); - if (this.uniqueId == null) - this.uniqueId = new ArrayList(); - this.uniqueId.add(t); - return t; - } - - // syntactic sugar - public NamingSystem addUniqueId(NamingSystemUniqueIdComponent t) { //3 - if (t == null) - return this; - if (this.uniqueId == null) - this.uniqueId = new ArrayList(); - this.uniqueId.add(t); - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the naming system.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the naming system.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public NamingSystem setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the naming system. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the naming system. - */ - public NamingSystem setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (NamingSystemContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public NamingSystemContactComponent addContact() { //3 - NamingSystemContactComponent t = new NamingSystemContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public NamingSystem addContact(NamingSystemContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #replacedBy} (For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).) - */ - public Reference getReplacedBy() { - if (this.replacedBy == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.replacedBy"); - else if (Configuration.doAutoCreate()) - this.replacedBy = new Reference(); // cc - return this.replacedBy; - } - - public boolean hasReplacedBy() { - return this.replacedBy != null && !this.replacedBy.isEmpty(); - } - - /** - * @param value {@link #replacedBy} (For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).) - */ - public NamingSystem setReplacedBy(Reference value) { - this.replacedBy = value; - return this; - } - - /** - * @return {@link #replacedBy} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).) - */ - public NamingSystem getReplacedByTarget() { - if (this.replacedByTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.replacedBy"); - else if (Configuration.doAutoCreate()) - this.replacedByTarget = new NamingSystem(); // aa - return this.replacedByTarget; - } - - /** - * @param value {@link #replacedBy} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).) - */ - public NamingSystem setReplacedByTarget(NamingSystem value) { - this.replacedByTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Indicates the purpose for the namingsystem - what kinds of things does it make unique?", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("name", "string", "The descriptive name of this particular identifier type or code system.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("date", "dateTime", "The date (and optionally time) when the system was registered or published.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("status", "code", "Indicates whether the namingsystem is 'ready for use' or not.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("country", "code", "If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system.", 0, java.lang.Integer.MAX_VALUE, country)); - childrenList.add(new Property("category", "CodeableConcept", "Categorizes a namingsystem for easier search by grouping related namingsystems.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("responsible", "string", "The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.", 0, java.lang.Integer.MAX_VALUE, responsible)); - childrenList.add(new Property("description", "string", "Details about what the namespace identifies including scope, granularity, version labeling, etc.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("usage", "string", "Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.", 0, java.lang.Integer.MAX_VALUE, usage)); - childrenList.add(new Property("uniqueId", "", "Indicates how the system may be identified when referenced in electronic exchange.", 0, java.lang.Integer.MAX_VALUE, uniqueId)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the naming system.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("replacedBy", "Reference(NamingSystem)", "For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).", 0, java.lang.Integer.MAX_VALUE, replacedBy)); - } - - public NamingSystem copy() { - NamingSystem dst = new NamingSystem(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.name = name == null ? null : name.copy(); - dst.date = date == null ? null : date.copy(); - dst.status = status == null ? null : status.copy(); - dst.country = country == null ? null : country.copy(); - dst.category = category == null ? null : category.copy(); - dst.responsible = responsible == null ? null : responsible.copy(); - dst.description = description == null ? null : description.copy(); - dst.usage = usage == null ? null : usage.copy(); - if (uniqueId != null) { - dst.uniqueId = new ArrayList(); - for (NamingSystemUniqueIdComponent i : uniqueId) - dst.uniqueId.add(i.copy()); - }; - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (NamingSystemContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.replacedBy = replacedBy == null ? null : replacedBy.copy(); - return dst; - } - - protected NamingSystem typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NamingSystem)) - return false; - NamingSystem o = (NamingSystem) other; - return compareDeep(type, o.type, true) && compareDeep(name, o.name, true) && compareDeep(date, o.date, true) - && compareDeep(status, o.status, true) && compareDeep(country, o.country, true) && compareDeep(category, o.category, true) - && compareDeep(responsible, o.responsible, true) && compareDeep(description, o.description, true) - && compareDeep(usage, o.usage, true) && compareDeep(uniqueId, o.uniqueId, true) && compareDeep(publisher, o.publisher, true) - && compareDeep(contact, o.contact, true) && compareDeep(replacedBy, o.replacedBy, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NamingSystem)) - return false; - NamingSystem o = (NamingSystem) other; - return compareValues(type, o.type, true) && compareValues(name, o.name, true) && compareValues(date, o.date, true) - && compareValues(status, o.status, true) && compareValues(country, o.country, true) && compareValues(responsible, o.responsible, true) - && compareValues(description, o.description, true) && compareValues(usage, o.usage, true) && compareValues(publisher, o.publisher, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (name == null || name.isEmpty()) - && (date == null || date.isEmpty()) && (status == null || status.isEmpty()) && (country == null || country.isEmpty()) - && (category == null || category.isEmpty()) && (responsible == null || responsible.isEmpty()) - && (description == null || description.isEmpty()) && (usage == null || usage.isEmpty()) && (uniqueId == null || uniqueId.isEmpty()) - && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) && (replacedBy == null || replacedBy.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.NamingSystem; - } - - @SearchParamDefinition(name="responsible", path="NamingSystem.responsible", description="Who maintains system namespace?", type="string" ) - public static final String SP_RESPONSIBLE = "responsible"; - @SearchParamDefinition(name="status", path="NamingSystem.status", description="draft | active | retired", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="idtype", path="NamingSystem.uniqueId.type", description="oid | uuid | uri | other", type="token" ) - public static final String SP_IDTYPE = "idtype"; - @SearchParamDefinition(name="replacedby", path="NamingSystem.replacedBy", description="Use this instead", type="reference" ) - public static final String SP_REPLACEDBY = "replacedby"; - @SearchParamDefinition(name="type", path="NamingSystem.type", description="codesystem | identifier | root", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="date", path="NamingSystem.date", description="Publication Date(/time)", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="period", path="NamingSystem.uniqueId.period", description="When is identifier valid?", type="date" ) - public static final String SP_PERIOD = "period"; - @SearchParamDefinition(name="contact", path="NamingSystem.contact.name", description="Name of a individual to contact", type="string" ) - public static final String SP_CONTACT = "contact"; - @SearchParamDefinition(name="country", path="NamingSystem.country", description="ISO 3-char country code", type="token" ) - public static final String SP_COUNTRY = "country"; - @SearchParamDefinition(name="publisher", path="NamingSystem.publisher", description="Name of the publisher (Organization or individual)", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - @SearchParamDefinition(name="category", path="NamingSystem.category", description="e.g. driver, provider, patient, bank etc", type="token" ) - public static final String SP_CATEGORY = "category"; - @SearchParamDefinition(name="name", path="NamingSystem.name", description="Human-readable label", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="telecom", path="NamingSystem.contact.telecom", description="Contact details for individual or publisher", type="token" ) - public static final String SP_TELECOM = "telecom"; - @SearchParamDefinition(name="value", path="NamingSystem.uniqueId.value", description="The unique identifier", type="string" ) - public static final String SP_VALUE = "value"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import java.util.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.Enumerations.*; +import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. + */ +@ResourceDef(name="NamingSystem", profile="http://hl7.org/fhir/Profile/NamingSystem") +public class NamingSystem extends DomainResource { + + public enum NamingsystemType { + /** + * The namingsystem is used to define concepts and symbols to represent those concepts. E.g. UCUM, LOINC, NDC code, local lab codes, etc. + */ + CODESYSTEM, + /** + * The namingsystem is used to manage identifiers (e.g. license numbers, order numbers, etc.). + */ + IDENTIFIER, + /** + * The namingsystem is used as the root for other identifiers and namingsystems. + */ + ROOT, + /** + * added to help the parsers + */ + NULL; + public static NamingsystemType fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("codesystem".equals(codeString)) + return CODESYSTEM; + if ("identifier".equals(codeString)) + return IDENTIFIER; + if ("root".equals(codeString)) + return ROOT; + throw new Exception("Unknown NamingsystemType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CODESYSTEM: return "codesystem"; + case IDENTIFIER: return "identifier"; + case ROOT: return "root"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CODESYSTEM: return ""; + case IDENTIFIER: return ""; + case ROOT: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CODESYSTEM: return "The namingsystem is used to define concepts and symbols to represent those concepts. E.g. UCUM, LOINC, NDC code, local lab codes, etc."; + case IDENTIFIER: return "The namingsystem is used to manage identifiers (e.g. license numbers, order numbers, etc.)."; + case ROOT: return "The namingsystem is used as the root for other identifiers and namingsystems."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CODESYSTEM: return "Codesystem"; + case IDENTIFIER: return "Identifier"; + case ROOT: return "Root"; + default: return "?"; + } + } + } + + public static class NamingsystemTypeEnumFactory implements EnumFactory { + public NamingsystemType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("codesystem".equals(codeString)) + return NamingsystemType.CODESYSTEM; + if ("identifier".equals(codeString)) + return NamingsystemType.IDENTIFIER; + if ("root".equals(codeString)) + return NamingsystemType.ROOT; + throw new IllegalArgumentException("Unknown NamingsystemType code '"+codeString+"'"); + } + public String toCode(NamingsystemType code) { + if (code == NamingsystemType.CODESYSTEM) + return "codesystem"; + if (code == NamingsystemType.IDENTIFIER) + return "identifier"; + if (code == NamingsystemType.ROOT) + return "root"; + return "?"; + } + } + + public enum NamingsystemIdentifierType { + /** + * An ISO object identifier. E.g. 1.2.3.4.5. + */ + OID, + /** + * A universally unique identifier of the form a5afddf4-e880-459b-876e-e4591b0acc11. + */ + UUID, + /** + * A uniform resource identifier (ideally a URL - uniform resource locator). E.g. http://unitsofmeasure.org. + */ + URI, + /** + * Some other type of unique identifier. E.g HL7-assigned reserved string such as LN for LOINC. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + public static NamingsystemIdentifierType fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("oid".equals(codeString)) + return OID; + if ("uuid".equals(codeString)) + return UUID; + if ("uri".equals(codeString)) + return URI; + if ("other".equals(codeString)) + return OTHER; + throw new Exception("Unknown NamingsystemIdentifierType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case OID: return "oid"; + case UUID: return "uuid"; + case URI: return "uri"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case OID: return ""; + case UUID: return ""; + case URI: return ""; + case OTHER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case OID: return "An ISO object identifier. E.g. 1.2.3.4.5."; + case UUID: return "A universally unique identifier of the form a5afddf4-e880-459b-876e-e4591b0acc11."; + case URI: return "A uniform resource identifier (ideally a URL - uniform resource locator). E.g. http://unitsofmeasure.org."; + case OTHER: return "Some other type of unique identifier. E.g HL7-assigned reserved string such as LN for LOINC."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case OID: return "Oid"; + case UUID: return "Uuid"; + case URI: return "Uri"; + case OTHER: return "Other"; + default: return "?"; + } + } + } + + public static class NamingsystemIdentifierTypeEnumFactory implements EnumFactory { + public NamingsystemIdentifierType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("oid".equals(codeString)) + return NamingsystemIdentifierType.OID; + if ("uuid".equals(codeString)) + return NamingsystemIdentifierType.UUID; + if ("uri".equals(codeString)) + return NamingsystemIdentifierType.URI; + if ("other".equals(codeString)) + return NamingsystemIdentifierType.OTHER; + throw new IllegalArgumentException("Unknown NamingsystemIdentifierType code '"+codeString+"'"); + } + public String toCode(NamingsystemIdentifierType code) { + if (code == NamingsystemIdentifierType.OID) + return "oid"; + if (code == NamingsystemIdentifierType.UUID) + return "uuid"; + if (code == NamingsystemIdentifierType.URI) + return "uri"; + if (code == NamingsystemIdentifierType.OTHER) + return "other"; + return "?"; + } + } + + @Block() + public static class NamingSystemUniqueIdComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifies the unique identifier scheme used for this particular identifier. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="oid | uuid | uri | other", formalDefinition="Identifies the unique identifier scheme used for this particular identifier." ) + protected Enumeration type; + + /** + * The string that should be sent over the wire to identify the code system or identifier system. + */ + @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1) + @Description(shortDefinition="The unique identifier", formalDefinition="The string that should be sent over the wire to identify the code system or identifier system." ) + protected StringType value; + + /** + * Indicates whether this identifier is the "preferred" identifier of this type. + */ + @Child(name = "preferred", type = {BooleanType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Is this the id that should be used for this type", formalDefinition="Indicates whether this identifier is the 'preferred' identifier of this type." ) + protected BooleanType preferred; + + /** + * Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem. Outside of this window, the identifier might be non-deterministic. + */ + @Child(name = "period", type = {Period.class}, order=4, min=0, max=1) + @Description(shortDefinition="When is identifier valid?", formalDefinition="Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem. Outside of this window, the identifier might be non-deterministic." ) + protected Period period; + + private static final long serialVersionUID = -250649344L; + + /* + * Constructor + */ + public NamingSystemUniqueIdComponent() { + super(); + } + + /* + * Constructor + */ + public NamingSystemUniqueIdComponent(Enumeration type, StringType value) { + super(); + this.type = type; + this.value = value; + } + + /** + * @return {@link #type} (Identifies the unique identifier scheme used for this particular identifier.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new NamingsystemIdentifierTypeEnumFactory()); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Identifies the unique identifier scheme used for this particular identifier.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public NamingSystemUniqueIdComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Identifies the unique identifier scheme used for this particular identifier. + */ + public NamingsystemIdentifierType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Identifies the unique identifier scheme used for this particular identifier. + */ + public NamingSystemUniqueIdComponent setType(NamingsystemIdentifierType value) { + if (this.type == null) + this.type = new Enumeration(new NamingsystemIdentifierTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #value} (The string that should be sent over the wire to identify the code system or identifier system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The string that should be sent over the wire to identify the code system or identifier system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public NamingSystemUniqueIdComponent setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The string that should be sent over the wire to identify the code system or identifier system. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The string that should be sent over the wire to identify the code system or identifier system. + */ + public NamingSystemUniqueIdComponent setValue(String value) { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + return this; + } + + /** + * @return {@link #preferred} (Indicates whether this identifier is the "preferred" identifier of this type.). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value + */ + public BooleanType getPreferredElement() { + if (this.preferred == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.preferred"); + else if (Configuration.doAutoCreate()) + this.preferred = new BooleanType(); // bb + return this.preferred; + } + + public boolean hasPreferredElement() { + return this.preferred != null && !this.preferred.isEmpty(); + } + + public boolean hasPreferred() { + return this.preferred != null && !this.preferred.isEmpty(); + } + + /** + * @param value {@link #preferred} (Indicates whether this identifier is the "preferred" identifier of this type.). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value + */ + public NamingSystemUniqueIdComponent setPreferredElement(BooleanType value) { + this.preferred = value; + return this; + } + + /** + * @return Indicates whether this identifier is the "preferred" identifier of this type. + */ + public boolean getPreferred() { + return this.preferred == null || this.preferred.isEmpty() ? false : this.preferred.getValue(); + } + + /** + * @param value Indicates whether this identifier is the "preferred" identifier of this type. + */ + public NamingSystemUniqueIdComponent setPreferred(boolean value) { + if (this.preferred == null) + this.preferred = new BooleanType(); + this.preferred.setValue(value); + return this; + } + + /** + * @return {@link #period} (Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem. Outside of this window, the identifier might be non-deterministic.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem. Outside of this window, the identifier might be non-deterministic.) + */ + public NamingSystemUniqueIdComponent setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Identifies the unique identifier scheme used for this particular identifier.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("value", "string", "The string that should be sent over the wire to identify the code system or identifier system.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("preferred", "boolean", "Indicates whether this identifier is the 'preferred' identifier of this type.", 0, java.lang.Integer.MAX_VALUE, preferred)); + childrenList.add(new Property("period", "Period", "Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem. Outside of this window, the identifier might be non-deterministic.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + public NamingSystemUniqueIdComponent copy() { + NamingSystemUniqueIdComponent dst = new NamingSystemUniqueIdComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.value = value == null ? null : value.copy(); + dst.preferred = preferred == null ? null : preferred.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NamingSystemUniqueIdComponent)) + return false; + NamingSystemUniqueIdComponent o = (NamingSystemUniqueIdComponent) other; + return compareDeep(type, o.type, true) && compareDeep(value, o.value, true) && compareDeep(preferred, o.preferred, true) + && compareDeep(period, o.period, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NamingSystemUniqueIdComponent)) + return false; + NamingSystemUniqueIdComponent o = (NamingSystemUniqueIdComponent) other; + return compareValues(type, o.type, true) && compareValues(value, o.value, true) && compareValues(preferred, o.preferred, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (value == null || value.isEmpty()) + && (preferred == null || preferred.isEmpty()) && (period == null || period.isEmpty()); + } + + } + + @Block() + public static class NamingSystemContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the naming system. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Name of a individual to contact", formalDefinition="The name of an individual to contact regarding the naming system." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /* + * Constructor + */ + public NamingSystemContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the naming system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystemContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The name of an individual to contact regarding the naming system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public NamingSystemContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the naming system. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the naming system. + */ + public NamingSystemContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public NamingSystemContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the naming system.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + public NamingSystemContactComponent copy() { + NamingSystemContactComponent dst = new NamingSystemContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NamingSystemContactComponent)) + return false; + NamingSystemContactComponent o = (NamingSystemContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NamingSystemContactComponent)) + return false; + NamingSystemContactComponent o = (NamingSystemContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + } + + /** + * Indicates the purpose for the namingsystem - what kinds of things does it make unique? + */ + @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1) + @Description(shortDefinition="codesystem | identifier | root", formalDefinition="Indicates the purpose for the namingsystem - what kinds of things does it make unique?" ) + protected Enumeration type; + + /** + * The descriptive name of this particular identifier type or code system. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Human-readable label", formalDefinition="The descriptive name of this particular identifier type or code system." ) + protected StringType name; + + /** + * The date (and optionally time) when the system was registered or published. + */ + @Child(name = "date", type = {DateTimeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Publication Date(/time)", formalDefinition="The date (and optionally time) when the system was registered or published." ) + protected DateTimeType date; + + /** + * Indicates whether the namingsystem is "ready for use" or not. + */ + @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1) + @Description(shortDefinition="draft | active | retired", formalDefinition="Indicates whether the namingsystem is 'ready for use' or not." ) + protected Enumeration status; + + /** + * If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system. + */ + @Child(name = "country", type = {CodeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="ISO 3-char country code", formalDefinition="If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system." ) + protected CodeType country; + + /** + * Categorizes a namingsystem for easier search by grouping related namingsystems. + */ + @Child(name = "category", type = {CodeableConcept.class}, order=5, min=0, max=1) + @Description(shortDefinition="e.g. driver, provider, patient, bank etc", formalDefinition="Categorizes a namingsystem for easier search by grouping related namingsystems." ) + protected CodeableConcept category; + + /** + * The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision. + */ + @Child(name = "responsible", type = {StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Who maintains system namespace?", formalDefinition="The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision." ) + protected StringType responsible; + + /** + * Details about what the namespace identifies including scope, granularity, version labeling, etc. + */ + @Child(name = "description", type = {StringType.class}, order=7, min=0, max=1) + @Description(shortDefinition="What does namingsystem identify?", formalDefinition="Details about what the namespace identifies including scope, granularity, version labeling, etc." ) + protected StringType description; + + /** + * Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc. + */ + @Child(name = "usage", type = {StringType.class}, order=8, min=0, max=1) + @Description(shortDefinition="How/where is it used", formalDefinition="Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc." ) + protected StringType usage; + + /** + * Indicates how the system may be identified when referenced in electronic exchange. + */ + @Child(name = "uniqueId", type = {}, order=9, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Unique identifiers used for system", formalDefinition="Indicates how the system may be identified when referenced in electronic exchange." ) + protected List uniqueId; + + /** + * The name of the individual or organization that published the naming system. + */ + @Child(name = "publisher", type = {StringType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the naming system." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any). + */ + @Child(name = "replacedBy", type = {NamingSystem.class}, order=12, min=0, max=1) + @Description(shortDefinition="Use this instead", formalDefinition="For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any)." ) + protected Reference replacedBy; + + /** + * The actual object that is the target of the reference (For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).) + */ + protected NamingSystem replacedByTarget; + + private static final long serialVersionUID = -241224889L; + + /* + * Constructor + */ + public NamingSystem() { + super(); + } + + /* + * Constructor + */ + public NamingSystem(Enumeration type, StringType name, DateTimeType date, Enumeration status) { + super(); + this.type = type; + this.name = name; + this.date = date; + this.status = status; + } + + /** + * @return {@link #type} (Indicates the purpose for the namingsystem - what kinds of things does it make unique?). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new NamingsystemTypeEnumFactory()); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Indicates the purpose for the namingsystem - what kinds of things does it make unique?). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public NamingSystem setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Indicates the purpose for the namingsystem - what kinds of things does it make unique? + */ + public NamingsystemType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Indicates the purpose for the namingsystem - what kinds of things does it make unique? + */ + public NamingSystem setType(NamingsystemType value) { + if (this.type == null) + this.type = new Enumeration(new NamingsystemTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #name} (The descriptive name of this particular identifier type or code system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The descriptive name of this particular identifier type or code system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public NamingSystem setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The descriptive name of this particular identifier type or code system. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The descriptive name of this particular identifier type or code system. + */ + public NamingSystem setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #date} (The date (and optionally time) when the system was registered or published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date (and optionally time) when the system was registered or published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public NamingSystem setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date (and optionally time) when the system was registered or published. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date (and optionally time) when the system was registered or published. + */ + public NamingSystem setDate(Date value) { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + return this; + } + + /** + * @return {@link #status} (Indicates whether the namingsystem is "ready for use" or not.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (Indicates whether the namingsystem is "ready for use" or not.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public NamingSystem setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Indicates whether the namingsystem is "ready for use" or not. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Indicates whether the namingsystem is "ready for use" or not. + */ + public NamingSystem setStatus(ConformanceResourceStatus value) { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #country} (If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system.). This is the underlying object with id, value and extensions. The accessor "getCountry" gives direct access to the value + */ + public CodeType getCountryElement() { + if (this.country == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.country"); + else if (Configuration.doAutoCreate()) + this.country = new CodeType(); // bb + return this.country; + } + + public boolean hasCountryElement() { + return this.country != null && !this.country.isEmpty(); + } + + public boolean hasCountry() { + return this.country != null && !this.country.isEmpty(); + } + + /** + * @param value {@link #country} (If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system.). This is the underlying object with id, value and extensions. The accessor "getCountry" gives direct access to the value + */ + public NamingSystem setCountryElement(CodeType value) { + this.country = value; + return this; + } + + /** + * @return If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system. + */ + public String getCountry() { + return this.country == null ? null : this.country.getValue(); + } + + /** + * @param value If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system. + */ + public NamingSystem setCountry(String value) { + if (Utilities.noString(value)) + this.country = null; + else { + if (this.country == null) + this.country = new CodeType(); + this.country.setValue(value); + } + return this; + } + + /** + * @return {@link #category} (Categorizes a namingsystem for easier search by grouping related namingsystems.) + */ + public CodeableConcept getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.category"); + else if (Configuration.doAutoCreate()) + this.category = new CodeableConcept(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Categorizes a namingsystem for easier search by grouping related namingsystems.) + */ + public NamingSystem setCategory(CodeableConcept value) { + this.category = value; + return this; + } + + /** + * @return {@link #responsible} (The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value + */ + public StringType getResponsibleElement() { + if (this.responsible == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.responsible"); + else if (Configuration.doAutoCreate()) + this.responsible = new StringType(); // bb + return this.responsible; + } + + public boolean hasResponsibleElement() { + return this.responsible != null && !this.responsible.isEmpty(); + } + + public boolean hasResponsible() { + return this.responsible != null && !this.responsible.isEmpty(); + } + + /** + * @param value {@link #responsible} (The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value + */ + public NamingSystem setResponsibleElement(StringType value) { + this.responsible = value; + return this; + } + + /** + * @return The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision. + */ + public String getResponsible() { + return this.responsible == null ? null : this.responsible.getValue(); + } + + /** + * @param value The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision. + */ + public NamingSystem setResponsible(String value) { + if (Utilities.noString(value)) + this.responsible = null; + else { + if (this.responsible == null) + this.responsible = new StringType(); + this.responsible.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (Details about what the namespace identifies including scope, granularity, version labeling, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Details about what the namespace identifies including scope, granularity, version labeling, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public NamingSystem setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Details about what the namespace identifies including scope, granularity, version labeling, etc. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Details about what the namespace identifies including scope, granularity, version labeling, etc. + */ + public NamingSystem setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #usage} (Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value + */ + public StringType getUsageElement() { + if (this.usage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.usage"); + else if (Configuration.doAutoCreate()) + this.usage = new StringType(); // bb + return this.usage; + } + + public boolean hasUsageElement() { + return this.usage != null && !this.usage.isEmpty(); + } + + public boolean hasUsage() { + return this.usage != null && !this.usage.isEmpty(); + } + + /** + * @param value {@link #usage} (Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value + */ + public NamingSystem setUsageElement(StringType value) { + this.usage = value; + return this; + } + + /** + * @return Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc. + */ + public String getUsage() { + return this.usage == null ? null : this.usage.getValue(); + } + + /** + * @param value Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc. + */ + public NamingSystem setUsage(String value) { + if (Utilities.noString(value)) + this.usage = null; + else { + if (this.usage == null) + this.usage = new StringType(); + this.usage.setValue(value); + } + return this; + } + + /** + * @return {@link #uniqueId} (Indicates how the system may be identified when referenced in electronic exchange.) + */ + public List getUniqueId() { + if (this.uniqueId == null) + this.uniqueId = new ArrayList(); + return this.uniqueId; + } + + public boolean hasUniqueId() { + if (this.uniqueId == null) + return false; + for (NamingSystemUniqueIdComponent item : this.uniqueId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #uniqueId} (Indicates how the system may be identified when referenced in electronic exchange.) + */ + // syntactic sugar + public NamingSystemUniqueIdComponent addUniqueId() { //3 + NamingSystemUniqueIdComponent t = new NamingSystemUniqueIdComponent(); + if (this.uniqueId == null) + this.uniqueId = new ArrayList(); + this.uniqueId.add(t); + return t; + } + + // syntactic sugar + public NamingSystem addUniqueId(NamingSystemUniqueIdComponent t) { //3 + if (t == null) + return this; + if (this.uniqueId == null) + this.uniqueId = new ArrayList(); + this.uniqueId.add(t); + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the naming system.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the naming system.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public NamingSystem setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the naming system. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the naming system. + */ + public NamingSystem setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (NamingSystemContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public NamingSystemContactComponent addContact() { //3 + NamingSystemContactComponent t = new NamingSystemContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public NamingSystem addContact(NamingSystemContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #replacedBy} (For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).) + */ + public Reference getReplacedBy() { + if (this.replacedBy == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.replacedBy"); + else if (Configuration.doAutoCreate()) + this.replacedBy = new Reference(); // cc + return this.replacedBy; + } + + public boolean hasReplacedBy() { + return this.replacedBy != null && !this.replacedBy.isEmpty(); + } + + /** + * @param value {@link #replacedBy} (For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).) + */ + public NamingSystem setReplacedBy(Reference value) { + this.replacedBy = value; + return this; + } + + /** + * @return {@link #replacedBy} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).) + */ + public NamingSystem getReplacedByTarget() { + if (this.replacedByTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.replacedBy"); + else if (Configuration.doAutoCreate()) + this.replacedByTarget = new NamingSystem(); // aa + return this.replacedByTarget; + } + + /** + * @param value {@link #replacedBy} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).) + */ + public NamingSystem setReplacedByTarget(NamingSystem value) { + this.replacedByTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Indicates the purpose for the namingsystem - what kinds of things does it make unique?", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("name", "string", "The descriptive name of this particular identifier type or code system.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("date", "dateTime", "The date (and optionally time) when the system was registered or published.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("status", "code", "Indicates whether the namingsystem is 'ready for use' or not.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("country", "code", "If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system.", 0, java.lang.Integer.MAX_VALUE, country)); + childrenList.add(new Property("category", "CodeableConcept", "Categorizes a namingsystem for easier search by grouping related namingsystems.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("responsible", "string", "The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.", 0, java.lang.Integer.MAX_VALUE, responsible)); + childrenList.add(new Property("description", "string", "Details about what the namespace identifies including scope, granularity, version labeling, etc.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("usage", "string", "Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.", 0, java.lang.Integer.MAX_VALUE, usage)); + childrenList.add(new Property("uniqueId", "", "Indicates how the system may be identified when referenced in electronic exchange.", 0, java.lang.Integer.MAX_VALUE, uniqueId)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the naming system.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("replacedBy", "Reference(NamingSystem)", "For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).", 0, java.lang.Integer.MAX_VALUE, replacedBy)); + } + + public NamingSystem copy() { + NamingSystem dst = new NamingSystem(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.name = name == null ? null : name.copy(); + dst.date = date == null ? null : date.copy(); + dst.status = status == null ? null : status.copy(); + dst.country = country == null ? null : country.copy(); + dst.category = category == null ? null : category.copy(); + dst.responsible = responsible == null ? null : responsible.copy(); + dst.description = description == null ? null : description.copy(); + dst.usage = usage == null ? null : usage.copy(); + if (uniqueId != null) { + dst.uniqueId = new ArrayList(); + for (NamingSystemUniqueIdComponent i : uniqueId) + dst.uniqueId.add(i.copy()); + }; + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (NamingSystemContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.replacedBy = replacedBy == null ? null : replacedBy.copy(); + return dst; + } + + protected NamingSystem typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NamingSystem)) + return false; + NamingSystem o = (NamingSystem) other; + return compareDeep(type, o.type, true) && compareDeep(name, o.name, true) && compareDeep(date, o.date, true) + && compareDeep(status, o.status, true) && compareDeep(country, o.country, true) && compareDeep(category, o.category, true) + && compareDeep(responsible, o.responsible, true) && compareDeep(description, o.description, true) + && compareDeep(usage, o.usage, true) && compareDeep(uniqueId, o.uniqueId, true) && compareDeep(publisher, o.publisher, true) + && compareDeep(contact, o.contact, true) && compareDeep(replacedBy, o.replacedBy, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NamingSystem)) + return false; + NamingSystem o = (NamingSystem) other; + return compareValues(type, o.type, true) && compareValues(name, o.name, true) && compareValues(date, o.date, true) + && compareValues(status, o.status, true) && compareValues(country, o.country, true) && compareValues(responsible, o.responsible, true) + && compareValues(description, o.description, true) && compareValues(usage, o.usage, true) && compareValues(publisher, o.publisher, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (name == null || name.isEmpty()) + && (date == null || date.isEmpty()) && (status == null || status.isEmpty()) && (country == null || country.isEmpty()) + && (category == null || category.isEmpty()) && (responsible == null || responsible.isEmpty()) + && (description == null || description.isEmpty()) && (usage == null || usage.isEmpty()) && (uniqueId == null || uniqueId.isEmpty()) + && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) && (replacedBy == null || replacedBy.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.NamingSystem; + } + + @SearchParamDefinition(name="date", path="NamingSystem.date", description="Publication Date(/time)", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="country", path="NamingSystem.country", description="ISO 3-char country code", type="token" ) + public static final String SP_COUNTRY = "country"; + @SearchParamDefinition(name="period", path="NamingSystem.uniqueId.period", description="When is identifier valid?", type="date" ) + public static final String SP_PERIOD = "period"; + @SearchParamDefinition(name="replacedby", path="NamingSystem.replacedBy", description="Use this instead", type="reference" ) + public static final String SP_REPLACEDBY = "replacedby"; + @SearchParamDefinition(name="type", path="NamingSystem.type", description="codesystem | identifier | root", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="idtype", path="NamingSystem.uniqueId.type", description="oid | uuid | uri | other", type="token" ) + public static final String SP_IDTYPE = "idtype"; + @SearchParamDefinition(name="responsible", path="NamingSystem.responsible", description="Who maintains system namespace?", type="string" ) + public static final String SP_RESPONSIBLE = "responsible"; + @SearchParamDefinition(name="contact", path="NamingSystem.contact.name", description="Name of a individual to contact", type="string" ) + public static final String SP_CONTACT = "contact"; + @SearchParamDefinition(name="name", path="NamingSystem.name", description="Human-readable label", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="publisher", path="NamingSystem.publisher", description="Name of the publisher (Organization or individual)", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + @SearchParamDefinition(name="telecom", path="NamingSystem.contact.telecom", description="Contact details for individual or publisher", type="token" ) + public static final String SP_TELECOM = "telecom"; + @SearchParamDefinition(name="category", path="NamingSystem.category", description="e.g. driver, provider, patient, bank etc", type="token" ) + public static final String SP_CATEGORY = "category"; + @SearchParamDefinition(name="value", path="NamingSystem.uniqueId.value", description="The unique identifier", type="string" ) + public static final String SP_VALUE = "value"; + @SearchParamDefinition(name="status", path="NamingSystem.status", description="draft | active | retired", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Narrative.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Narrative.java index 28eb799a74f..b77eaf98634 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Narrative.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Narrative.java @@ -1,315 +1,294 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A human-readable formatted text, including images. - */ -@DatatypeDef(name="Narrative") -public class Narrative extends BaseNarrative implements INarrative { - - public enum NarrativeStatus { - /** - * The contents of the narrative are entirely generated from the structured data in the 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 NarrativeStatus fromCode(String codeString) throws Exception { - 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 Exception("Unknown NarrativeStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case GENERATED: return "generated"; - case EXTENSIONS: return "extensions"; - case ADDITIONAL: return "additional"; - case EMPTY: return "empty"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case GENERATED: return ""; - 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 { - 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) { - 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=0, min=1, max=1) - @Description(shortDefinition="generated | extensions | additional | empty", formalDefinition="The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data." ) - protected Enumeration status; - - /** - * The actual narrative content, a stripped down version of XHTML. - */ - @Child(name = "div", type = {}, order=1, min=1, max=1) - @Description(shortDefinition="Limited xhtml content", formalDefinition="The actual narrative content, a stripped down version of XHTML." ) - protected XhtmlNode div; - - private static final long serialVersionUID = 1463852859L; - - /* - * Constructor - */ - public Narrative() { - super(); - } - - /* - * Constructor - */ - public Narrative(Enumeration status, XhtmlNode div) { - super(); - this.status = status; - this.div = div; - } - - /** - * @return {@link #status} (The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Narrative.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new NarrativeStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Narrative setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data. - */ - public NarrativeStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data. - */ - public Narrative setStatus(NarrativeStatus value) { - if (this.status == null) - this.status = new Enumeration(new NarrativeStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #div} (The actual narrative content, a stripped down version of XHTML.) - */ - public XhtmlNode getDiv() { - if (this.div == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Narrative.div"); - else if (Configuration.doAutoCreate()) - this.div = new XhtmlNode(); // cc - return this.div; - } - - public boolean hasDiv() { - return this.div != null && !this.div.isEmpty(); - } - - /** - * @param value {@link #div} (The actual narrative content, a stripped down version of XHTML.) - */ - public Narrative setDiv(XhtmlNode value) { - this.div = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("status", "code", "The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.", 0, java.lang.Integer.MAX_VALUE, status)); - } - - public Narrative copy() { - Narrative dst = new Narrative(); - copyValues(dst); - dst.status = status == null ? null : status.copy(); - dst.div = div == null ? null : div.copy(); - return dst; - } - - protected Narrative typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Narrative)) - return false; - Narrative o = (Narrative) other; - return compareDeep(status, o.status, true) && compareDeep(div, o.div, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Narrative)) - return false; - Narrative o = (Narrative) other; - return compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (status == null || status.isEmpty()) && (div == null || div.isEmpty()) - ; - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A human-readable formatted text, including images. + */ +@DatatypeDef(name="Narrative") +public class Narrative extends BaseNarrative implements INarrative { + + public enum NarrativeStatus { + /** + * The contents of the narrative are entirely generated from the structured data in the 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 NarrativeStatus fromCode(String codeString) throws Exception { + 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 Exception("Unknown NarrativeStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case GENERATED: return "generated"; + case EXTENSIONS: return "extensions"; + case ADDITIONAL: return "additional"; + case EMPTY: return "empty"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case GENERATED: return ""; + 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 { + 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) { + 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=0, min=1, max=1) + @Description(shortDefinition="generated | extensions | additional | empty", formalDefinition="The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data." ) + protected Enumeration status; + + /** + * The actual narrative content, a stripped down version of XHTML. + */ + @Child(name = "div", type = {}, order=1, min=1, max=1) + @Description(shortDefinition="Limited xhtml content", formalDefinition="The actual narrative content, a stripped down version of XHTML." ) + protected XhtmlNode div; + + private static final long serialVersionUID = 1463852859L; + + /* + * Constructor + */ + public Narrative() { + super(); + } + + /* + * Constructor + */ + public Narrative(Enumeration status, XhtmlNode div) { + super(); + this.status = status; + this.div = div; + } + + /** + * @return {@link #status} (The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Narrative.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new NarrativeStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Narrative setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data. + */ + public NarrativeStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data. + */ + public Narrative setStatus(NarrativeStatus value) { + if (this.status == null) + this.status = new Enumeration(new NarrativeStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #div} (The actual narrative content, a stripped down version of XHTML.) + */ + public XhtmlNode getDiv() { + if (this.div == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Narrative.div"); + else if (Configuration.doAutoCreate()) + this.div = new XhtmlNode(); // cc + return this.div; + } + + public boolean hasDiv() { + return this.div != null && !this.div.isEmpty(); + } + + /** + * @param value {@link #div} (The actual narrative content, a stripped down version of XHTML.) + */ + public Narrative setDiv(XhtmlNode value) { + this.div = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("status", "code", "The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.", 0, java.lang.Integer.MAX_VALUE, status)); + } + + public Narrative copy() { + Narrative dst = new Narrative(); + copyValues(dst); + dst.status = status == null ? null : status.copy(); + dst.div = div == null ? null : div.copy(); + return dst; + } + + protected Narrative typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Narrative)) + return false; + Narrative o = (Narrative) other; + return compareDeep(status, o.status, true) && compareDeep(div, o.div, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Narrative)) + return false; + Narrative o = (Narrative) other; + return compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (status == null || status.isEmpty()) && (div == null || div.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/NutritionOrder.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/NutritionOrder.java index b450c67a75e..9576166028e 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/NutritionOrder.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/NutritionOrder.java @@ -1,2340 +1,2438 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. - */ -@ResourceDef(name="NutritionOrder", profile="http://hl7.org/fhir/Profile/NutritionOrder") -public class NutritionOrder extends DomainResource { - - public enum NutritionOrderStatus { - /** - * The request has been proposed. - */ - PROPOSED, - /** - * The request is in preliminary form prior to being sent. - */ - DRAFT, - /** - * The request has been planned. - */ - PLANNED, - /** - * The request has been placed. - */ - REQUESTED, - /** - * The request is 'actionable', but not all actions that are implied by it have occurred yet. - */ - ACTIVE, - /** - * Actions implied by the request have been temporarily halted, but are expected to continue later. May also be called "suspended". - */ - ONHOLD, - /** - * All actions that are implied by the order have occurred and no continuation is planned (this will rarely be made explicit). - */ - COMPLETED, - /** - * The request has been withdrawn and is no longer actionable. - */ - CANCELLED, - /** - * added to help the parsers - */ - NULL; - public static NutritionOrderStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("draft".equals(codeString)) - return DRAFT; - if ("planned".equals(codeString)) - return PLANNED; - if ("requested".equals(codeString)) - return REQUESTED; - if ("active".equals(codeString)) - return ACTIVE; - if ("on-hold".equals(codeString)) - return ONHOLD; - if ("completed".equals(codeString)) - return COMPLETED; - if ("cancelled".equals(codeString)) - return CANCELLED; - throw new Exception("Unknown NutritionOrderStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PROPOSED: return "proposed"; - case DRAFT: return "draft"; - case PLANNED: return "planned"; - case REQUESTED: return "requested"; - case ACTIVE: return "active"; - case ONHOLD: return "on-hold"; - case COMPLETED: return "completed"; - case CANCELLED: return "cancelled"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PROPOSED: return ""; - case DRAFT: return ""; - case PLANNED: return ""; - case REQUESTED: return ""; - case ACTIVE: return ""; - case ONHOLD: return ""; - case COMPLETED: return ""; - case CANCELLED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PROPOSED: return "The request has been proposed."; - case DRAFT: return "The request is in preliminary form prior to being sent."; - case PLANNED: return "The request has been planned."; - case REQUESTED: return "The request has been placed."; - case ACTIVE: return "The request is 'actionable', but not all actions that are implied by it have occurred yet."; - case ONHOLD: return "Actions implied by the request have been temporarily halted, but are expected to continue later. May also be called 'suspended'."; - case COMPLETED: return "All actions that are implied by the order have occurred and no continuation is planned (this will rarely be made explicit)."; - case CANCELLED: return "The request has been withdrawn and is no longer actionable."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PROPOSED: return "Proposed"; - case DRAFT: return "Draft"; - case PLANNED: return "Planned"; - case REQUESTED: return "Requested"; - case ACTIVE: return "Active"; - case ONHOLD: return "On-Hold"; - case COMPLETED: return "Completed"; - case CANCELLED: return "Cancelled"; - default: return "?"; - } - } - } - - public static class NutritionOrderStatusEnumFactory implements EnumFactory { - public NutritionOrderStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return NutritionOrderStatus.PROPOSED; - if ("draft".equals(codeString)) - return NutritionOrderStatus.DRAFT; - if ("planned".equals(codeString)) - return NutritionOrderStatus.PLANNED; - if ("requested".equals(codeString)) - return NutritionOrderStatus.REQUESTED; - if ("active".equals(codeString)) - return NutritionOrderStatus.ACTIVE; - if ("on-hold".equals(codeString)) - return NutritionOrderStatus.ONHOLD; - if ("completed".equals(codeString)) - return NutritionOrderStatus.COMPLETED; - if ("cancelled".equals(codeString)) - return NutritionOrderStatus.CANCELLED; - throw new IllegalArgumentException("Unknown NutritionOrderStatus code '"+codeString+"'"); - } - public String toCode(NutritionOrderStatus code) { - if (code == NutritionOrderStatus.PROPOSED) - return "proposed"; - if (code == NutritionOrderStatus.DRAFT) - return "draft"; - if (code == NutritionOrderStatus.PLANNED) - return "planned"; - if (code == NutritionOrderStatus.REQUESTED) - return "requested"; - if (code == NutritionOrderStatus.ACTIVE) - return "active"; - if (code == NutritionOrderStatus.ONHOLD) - return "on-hold"; - if (code == NutritionOrderStatus.COMPLETED) - return "completed"; - if (code == NutritionOrderStatus.CANCELLED) - return "cancelled"; - return "?"; - } - } - - @Block() - public static class NutritionOrderOralDietComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Type of oral diet or diet restrictions that describe what can be consumed orally", formalDefinition="The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet." ) - protected List type; - - /** - * The time period and frequency at which the diet should be given. - */ - @Child(name = "scheduled", type = {Timing.class}, order=2, min=0, max=1) - @Description(shortDefinition="Scheduled frequency of diet", formalDefinition="The time period and frequency at which the diet should be given." ) - protected Timing scheduled; - - /** - * Class that defines the quantity and type of nutrient modifications required for the oral diet. - */ - @Child(name = "nutrient", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Required nutrient modifications", formalDefinition="Class that defines the quantity and type of nutrient modifications required for the oral diet." ) - protected List nutrient; - - /** - * Class that describes any texture modifications required for the patient to safely consume various types of solid foods. - */ - @Child(name = "texture", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Required texture modifications", formalDefinition="Class that describes any texture modifications required for the patient to safely consume various types of solid foods." ) - protected List texture; - - /** - * The required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient. - */ - @Child(name = "fluidConsistencyType", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The required consistency of fluids and liquids provided to the patient", formalDefinition="The required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient." ) - protected List fluidConsistencyType; - - /** - * Free text or additional instructions or information pertaining to the oral diet. - */ - @Child(name = "instruction", type = {StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Instructions or additional information about the oral diet", formalDefinition="Free text or additional instructions or information pertaining to the oral diet." ) - protected StringType instruction; - - private static final long serialVersionUID = -1101476668L; - - /* - * Constructor - */ - public NutritionOrderOralDietComponent() { - super(); - } - - /** - * @return {@link #type} (The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (CodeableConcept item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet.) - */ - // syntactic sugar - public CodeableConcept addType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - // syntactic sugar - public NutritionOrderOralDietComponent addType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - /** - * @return {@link #scheduled} (The time period and frequency at which the diet should be given.) - */ - public Timing getScheduled() { - if (this.scheduled == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderOralDietComponent.scheduled"); - else if (Configuration.doAutoCreate()) - this.scheduled = new Timing(); // cc - return this.scheduled; - } - - public boolean hasScheduled() { - return this.scheduled != null && !this.scheduled.isEmpty(); - } - - /** - * @param value {@link #scheduled} (The time period and frequency at which the diet should be given.) - */ - public NutritionOrderOralDietComponent setScheduled(Timing value) { - this.scheduled = value; - return this; - } - - /** - * @return {@link #nutrient} (Class that defines the quantity and type of nutrient modifications required for the oral diet.) - */ - public List getNutrient() { - if (this.nutrient == null) - this.nutrient = new ArrayList(); - return this.nutrient; - } - - public boolean hasNutrient() { - if (this.nutrient == null) - return false; - for (NutritionOrderOralDietNutrientComponent item : this.nutrient) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #nutrient} (Class that defines the quantity and type of nutrient modifications required for the oral diet.) - */ - // syntactic sugar - public NutritionOrderOralDietNutrientComponent addNutrient() { //3 - NutritionOrderOralDietNutrientComponent t = new NutritionOrderOralDietNutrientComponent(); - if (this.nutrient == null) - this.nutrient = new ArrayList(); - this.nutrient.add(t); - return t; - } - - // syntactic sugar - public NutritionOrderOralDietComponent addNutrient(NutritionOrderOralDietNutrientComponent t) { //3 - if (t == null) - return this; - if (this.nutrient == null) - this.nutrient = new ArrayList(); - this.nutrient.add(t); - return this; - } - - /** - * @return {@link #texture} (Class that describes any texture modifications required for the patient to safely consume various types of solid foods.) - */ - public List getTexture() { - if (this.texture == null) - this.texture = new ArrayList(); - return this.texture; - } - - public boolean hasTexture() { - if (this.texture == null) - return false; - for (NutritionOrderOralDietTextureComponent item : this.texture) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #texture} (Class that describes any texture modifications required for the patient to safely consume various types of solid foods.) - */ - // syntactic sugar - public NutritionOrderOralDietTextureComponent addTexture() { //3 - NutritionOrderOralDietTextureComponent t = new NutritionOrderOralDietTextureComponent(); - if (this.texture == null) - this.texture = new ArrayList(); - this.texture.add(t); - return t; - } - - // syntactic sugar - public NutritionOrderOralDietComponent addTexture(NutritionOrderOralDietTextureComponent t) { //3 - if (t == null) - return this; - if (this.texture == null) - this.texture = new ArrayList(); - this.texture.add(t); - return this; - } - - /** - * @return {@link #fluidConsistencyType} (The required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.) - */ - public List getFluidConsistencyType() { - if (this.fluidConsistencyType == null) - this.fluidConsistencyType = new ArrayList(); - return this.fluidConsistencyType; - } - - public boolean hasFluidConsistencyType() { - if (this.fluidConsistencyType == null) - return false; - for (CodeableConcept item : this.fluidConsistencyType) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #fluidConsistencyType} (The required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.) - */ - // syntactic sugar - public CodeableConcept addFluidConsistencyType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.fluidConsistencyType == null) - this.fluidConsistencyType = new ArrayList(); - this.fluidConsistencyType.add(t); - return t; - } - - // syntactic sugar - public NutritionOrderOralDietComponent addFluidConsistencyType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.fluidConsistencyType == null) - this.fluidConsistencyType = new ArrayList(); - this.fluidConsistencyType.add(t); - return this; - } - - /** - * @return {@link #instruction} (Free text or additional instructions or information pertaining to the oral diet.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value - */ - public StringType getInstructionElement() { - if (this.instruction == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderOralDietComponent.instruction"); - else if (Configuration.doAutoCreate()) - this.instruction = new StringType(); // bb - return this.instruction; - } - - public boolean hasInstructionElement() { - return this.instruction != null && !this.instruction.isEmpty(); - } - - public boolean hasInstruction() { - return this.instruction != null && !this.instruction.isEmpty(); - } - - /** - * @param value {@link #instruction} (Free text or additional instructions or information pertaining to the oral diet.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value - */ - public NutritionOrderOralDietComponent setInstructionElement(StringType value) { - this.instruction = value; - return this; - } - - /** - * @return Free text or additional instructions or information pertaining to the oral diet. - */ - public String getInstruction() { - return this.instruction == null ? null : this.instruction.getValue(); - } - - /** - * @param value Free text or additional instructions or information pertaining to the oral diet. - */ - public NutritionOrderOralDietComponent setInstruction(String value) { - if (Utilities.noString(value)) - this.instruction = null; - else { - if (this.instruction == null) - this.instruction = new StringType(); - this.instruction.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("scheduled", "Timing", "The time period and frequency at which the diet should be given.", 0, java.lang.Integer.MAX_VALUE, scheduled)); - childrenList.add(new Property("nutrient", "", "Class that defines the quantity and type of nutrient modifications required for the oral diet.", 0, java.lang.Integer.MAX_VALUE, nutrient)); - childrenList.add(new Property("texture", "", "Class that describes any texture modifications required for the patient to safely consume various types of solid foods.", 0, java.lang.Integer.MAX_VALUE, texture)); - childrenList.add(new Property("fluidConsistencyType", "CodeableConcept", "The required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.", 0, java.lang.Integer.MAX_VALUE, fluidConsistencyType)); - childrenList.add(new Property("instruction", "string", "Free text or additional instructions or information pertaining to the oral diet.", 0, java.lang.Integer.MAX_VALUE, instruction)); - } - - public NutritionOrderOralDietComponent copy() { - NutritionOrderOralDietComponent dst = new NutritionOrderOralDietComponent(); - copyValues(dst); - if (type != null) { - dst.type = new ArrayList(); - for (CodeableConcept i : type) - dst.type.add(i.copy()); - }; - dst.scheduled = scheduled == null ? null : scheduled.copy(); - if (nutrient != null) { - dst.nutrient = new ArrayList(); - for (NutritionOrderOralDietNutrientComponent i : nutrient) - dst.nutrient.add(i.copy()); - }; - if (texture != null) { - dst.texture = new ArrayList(); - for (NutritionOrderOralDietTextureComponent i : texture) - dst.texture.add(i.copy()); - }; - if (fluidConsistencyType != null) { - dst.fluidConsistencyType = new ArrayList(); - for (CodeableConcept i : fluidConsistencyType) - dst.fluidConsistencyType.add(i.copy()); - }; - dst.instruction = instruction == null ? null : instruction.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NutritionOrderOralDietComponent)) - return false; - NutritionOrderOralDietComponent o = (NutritionOrderOralDietComponent) other; - return compareDeep(type, o.type, true) && compareDeep(scheduled, o.scheduled, true) && compareDeep(nutrient, o.nutrient, true) - && compareDeep(texture, o.texture, true) && compareDeep(fluidConsistencyType, o.fluidConsistencyType, true) - && compareDeep(instruction, o.instruction, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NutritionOrderOralDietComponent)) - return false; - NutritionOrderOralDietComponent o = (NutritionOrderOralDietComponent) other; - return compareValues(instruction, o.instruction, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (scheduled == null || scheduled.isEmpty()) - && (nutrient == null || nutrient.isEmpty()) && (texture == null || texture.isEmpty()) && (fluidConsistencyType == null || fluidConsistencyType.isEmpty()) - && (instruction == null || instruction.isEmpty()); - } - - } - - @Block() - public static class NutritionOrderOralDietNutrientComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The nutrient that is being modified such as carbohydrate or sodium. - */ - @Child(name = "modifier", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Type of nutrient that is being modified", formalDefinition="The nutrient that is being modified such as carbohydrate or sodium." ) - protected CodeableConcept modifier; - - /** - * The quantity of the specified nutrient to include in diet. - */ - @Child(name = "amount", type = {Quantity.class}, order=2, min=0, max=1) - @Description(shortDefinition="Quantity of the specified nutrient", formalDefinition="The quantity of the specified nutrient to include in diet." ) - protected Quantity amount; - - private static final long serialVersionUID = 1042462093L; - - /* - * Constructor - */ - public NutritionOrderOralDietNutrientComponent() { - super(); - } - - /** - * @return {@link #modifier} (The nutrient that is being modified such as carbohydrate or sodium.) - */ - public CodeableConcept getModifier() { - if (this.modifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderOralDietNutrientComponent.modifier"); - else if (Configuration.doAutoCreate()) - this.modifier = new CodeableConcept(); // cc - return this.modifier; - } - - public boolean hasModifier() { - return this.modifier != null && !this.modifier.isEmpty(); - } - - /** - * @param value {@link #modifier} (The nutrient that is being modified such as carbohydrate or sodium.) - */ - public NutritionOrderOralDietNutrientComponent setModifier(CodeableConcept value) { - this.modifier = value; - return this; - } - - /** - * @return {@link #amount} (The quantity of the specified nutrient to include in diet.) - */ - public Quantity getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderOralDietNutrientComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Quantity(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (The quantity of the specified nutrient to include in diet.) - */ - public NutritionOrderOralDietNutrientComponent setAmount(Quantity value) { - this.amount = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("modifier", "CodeableConcept", "The nutrient that is being modified such as carbohydrate or sodium.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("amount", "Quantity", "The quantity of the specified nutrient to include in diet.", 0, java.lang.Integer.MAX_VALUE, amount)); - } - - public NutritionOrderOralDietNutrientComponent copy() { - NutritionOrderOralDietNutrientComponent dst = new NutritionOrderOralDietNutrientComponent(); - copyValues(dst); - dst.modifier = modifier == null ? null : modifier.copy(); - dst.amount = amount == null ? null : amount.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NutritionOrderOralDietNutrientComponent)) - return false; - NutritionOrderOralDietNutrientComponent o = (NutritionOrderOralDietNutrientComponent) other; - return compareDeep(modifier, o.modifier, true) && compareDeep(amount, o.amount, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NutritionOrderOralDietNutrientComponent)) - return false; - NutritionOrderOralDietNutrientComponent o = (NutritionOrderOralDietNutrientComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (modifier == null || modifier.isEmpty()) && (amount == null || amount.isEmpty()) - ; - } - - } - - @Block() - public static class NutritionOrderOralDietTextureComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed. - */ - @Child(name = "modifier", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Code to indicate how to alter the texture of the foods, e.g., pureed", formalDefinition="Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed." ) - protected CodeableConcept modifier; - - /** - * The food type(s) (e.g., meats, all foods) that the texture modification applies to. This could be all foods types. - */ - @Child(name = "foodType", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Concepts that are used to identify an entity that is ingested for nutritional purposes", formalDefinition="The food type(s) (e.g., meats, all foods) that the texture modification applies to. This could be all foods types." ) - protected CodeableConcept foodType; - - private static final long serialVersionUID = -56402817L; - - /* - * Constructor - */ - public NutritionOrderOralDietTextureComponent() { - super(); - } - - /** - * @return {@link #modifier} (Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed.) - */ - public CodeableConcept getModifier() { - if (this.modifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderOralDietTextureComponent.modifier"); - else if (Configuration.doAutoCreate()) - this.modifier = new CodeableConcept(); // cc - return this.modifier; - } - - public boolean hasModifier() { - return this.modifier != null && !this.modifier.isEmpty(); - } - - /** - * @param value {@link #modifier} (Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed.) - */ - public NutritionOrderOralDietTextureComponent setModifier(CodeableConcept value) { - this.modifier = value; - return this; - } - - /** - * @return {@link #foodType} (The food type(s) (e.g., meats, all foods) that the texture modification applies to. This could be all foods types.) - */ - public CodeableConcept getFoodType() { - if (this.foodType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderOralDietTextureComponent.foodType"); - else if (Configuration.doAutoCreate()) - this.foodType = new CodeableConcept(); // cc - return this.foodType; - } - - public boolean hasFoodType() { - return this.foodType != null && !this.foodType.isEmpty(); - } - - /** - * @param value {@link #foodType} (The food type(s) (e.g., meats, all foods) that the texture modification applies to. This could be all foods types.) - */ - public NutritionOrderOralDietTextureComponent setFoodType(CodeableConcept value) { - this.foodType = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("modifier", "CodeableConcept", "Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("foodType", "CodeableConcept", "The food type(s) (e.g., meats, all foods) that the texture modification applies to. This could be all foods types.", 0, java.lang.Integer.MAX_VALUE, foodType)); - } - - public NutritionOrderOralDietTextureComponent copy() { - NutritionOrderOralDietTextureComponent dst = new NutritionOrderOralDietTextureComponent(); - copyValues(dst); - dst.modifier = modifier == null ? null : modifier.copy(); - dst.foodType = foodType == null ? null : foodType.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NutritionOrderOralDietTextureComponent)) - return false; - NutritionOrderOralDietTextureComponent o = (NutritionOrderOralDietTextureComponent) other; - return compareDeep(modifier, o.modifier, true) && compareDeep(foodType, o.foodType, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NutritionOrderOralDietTextureComponent)) - return false; - NutritionOrderOralDietTextureComponent o = (NutritionOrderOralDietTextureComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (modifier == null || modifier.isEmpty()) && (foodType == null || foodType.isEmpty()) - ; - } - - } - - @Block() - public static class NutritionOrderSupplementComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Type of supplement product requested", formalDefinition="The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement." ) - protected CodeableConcept type; - - /** - * The product or brand name of the nutritional supplement such as "Acme Protein Shake". - */ - @Child(name = "productName", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Product or brand name of the nutritional supplement", formalDefinition="The product or brand name of the nutritional supplement such as 'Acme Protein Shake'." ) - protected StringType productName; - - /** - * The time period and frequency at which the supplement(s) should be given. - */ - @Child(name = "scheduled", type = {Timing.class}, order=3, min=0, max=1) - @Description(shortDefinition="Scheduled frequency of supplement", formalDefinition="The time period and frequency at which the supplement(s) should be given." ) - protected Timing scheduled; - - /** - * The amount of the nutritional supplement to be given. - */ - @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1) - @Description(shortDefinition="Amount of the nutritional supplement", formalDefinition="The amount of the nutritional supplement to be given." ) - protected Quantity quantity; - - /** - * Free text or additional instructions or information pertaining to the oral supplement. - */ - @Child(name = "instruction", type = {StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Instructions or additional information about the oral supplement", formalDefinition="Free text or additional instructions or information pertaining to the oral supplement." ) - protected StringType instruction; - - private static final long serialVersionUID = 952780616L; - - /* - * Constructor - */ - public NutritionOrderSupplementComponent() { - super(); - } - - /** - * @return {@link #type} (The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderSupplementComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement.) - */ - public NutritionOrderSupplementComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #productName} (The product or brand name of the nutritional supplement such as "Acme Protein Shake".). This is the underlying object with id, value and extensions. The accessor "getProductName" gives direct access to the value - */ - public StringType getProductNameElement() { - if (this.productName == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderSupplementComponent.productName"); - else if (Configuration.doAutoCreate()) - this.productName = new StringType(); // bb - return this.productName; - } - - public boolean hasProductNameElement() { - return this.productName != null && !this.productName.isEmpty(); - } - - public boolean hasProductName() { - return this.productName != null && !this.productName.isEmpty(); - } - - /** - * @param value {@link #productName} (The product or brand name of the nutritional supplement such as "Acme Protein Shake".). This is the underlying object with id, value and extensions. The accessor "getProductName" gives direct access to the value - */ - public NutritionOrderSupplementComponent setProductNameElement(StringType value) { - this.productName = value; - return this; - } - - /** - * @return The product or brand name of the nutritional supplement such as "Acme Protein Shake". - */ - public String getProductName() { - return this.productName == null ? null : this.productName.getValue(); - } - - /** - * @param value The product or brand name of the nutritional supplement such as "Acme Protein Shake". - */ - public NutritionOrderSupplementComponent setProductName(String value) { - if (Utilities.noString(value)) - this.productName = null; - else { - if (this.productName == null) - this.productName = new StringType(); - this.productName.setValue(value); - } - return this; - } - - /** - * @return {@link #scheduled} (The time period and frequency at which the supplement(s) should be given.) - */ - public Timing getScheduled() { - if (this.scheduled == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderSupplementComponent.scheduled"); - else if (Configuration.doAutoCreate()) - this.scheduled = new Timing(); // cc - return this.scheduled; - } - - public boolean hasScheduled() { - return this.scheduled != null && !this.scheduled.isEmpty(); - } - - /** - * @param value {@link #scheduled} (The time period and frequency at which the supplement(s) should be given.) - */ - public NutritionOrderSupplementComponent setScheduled(Timing value) { - this.scheduled = value; - return this; - } - - /** - * @return {@link #quantity} (The amount of the nutritional supplement to be given.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderSupplementComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of the nutritional supplement to be given.) - */ - public NutritionOrderSupplementComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #instruction} (Free text or additional instructions or information pertaining to the oral supplement.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value - */ - public StringType getInstructionElement() { - if (this.instruction == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderSupplementComponent.instruction"); - else if (Configuration.doAutoCreate()) - this.instruction = new StringType(); // bb - return this.instruction; - } - - public boolean hasInstructionElement() { - return this.instruction != null && !this.instruction.isEmpty(); - } - - public boolean hasInstruction() { - return this.instruction != null && !this.instruction.isEmpty(); - } - - /** - * @param value {@link #instruction} (Free text or additional instructions or information pertaining to the oral supplement.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value - */ - public NutritionOrderSupplementComponent setInstructionElement(StringType value) { - this.instruction = value; - return this; - } - - /** - * @return Free text or additional instructions or information pertaining to the oral supplement. - */ - public String getInstruction() { - return this.instruction == null ? null : this.instruction.getValue(); - } - - /** - * @param value Free text or additional instructions or information pertaining to the oral supplement. - */ - public NutritionOrderSupplementComponent setInstruction(String value) { - if (Utilities.noString(value)) - this.instruction = null; - else { - if (this.instruction == null) - this.instruction = new StringType(); - this.instruction.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("productName", "string", "The product or brand name of the nutritional supplement such as 'Acme Protein Shake'.", 0, java.lang.Integer.MAX_VALUE, productName)); - childrenList.add(new Property("scheduled", "Timing", "The time period and frequency at which the supplement(s) should be given.", 0, java.lang.Integer.MAX_VALUE, scheduled)); - childrenList.add(new Property("quantity", "Quantity", "The amount of the nutritional supplement to be given.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("instruction", "string", "Free text or additional instructions or information pertaining to the oral supplement.", 0, java.lang.Integer.MAX_VALUE, instruction)); - } - - public NutritionOrderSupplementComponent copy() { - NutritionOrderSupplementComponent dst = new NutritionOrderSupplementComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.productName = productName == null ? null : productName.copy(); - dst.scheduled = scheduled == null ? null : scheduled.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.instruction = instruction == null ? null : instruction.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NutritionOrderSupplementComponent)) - return false; - NutritionOrderSupplementComponent o = (NutritionOrderSupplementComponent) other; - return compareDeep(type, o.type, true) && compareDeep(productName, o.productName, true) && compareDeep(scheduled, o.scheduled, true) - && compareDeep(quantity, o.quantity, true) && compareDeep(instruction, o.instruction, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NutritionOrderSupplementComponent)) - return false; - NutritionOrderSupplementComponent o = (NutritionOrderSupplementComponent) other; - return compareValues(productName, o.productName, true) && compareValues(instruction, o.instruction, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (productName == null || productName.isEmpty()) - && (scheduled == null || scheduled.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (instruction == null || instruction.isEmpty()); - } - - } - - @Block() - public static class NutritionOrderEnteralFormulaComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Free text formula administration, feeding instructions or additional instructions or information. - */ - @Child(name = "administrationInstructions", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Formula feeding instructions expressed as text", formalDefinition="Free text formula administration, feeding instructions or additional instructions or information." ) - protected StringType administrationInstructions; - - /** - * The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula. - */ - @Child(name = "baseFormulaType", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Type of enteral or infant formula", formalDefinition="The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula." ) - protected CodeableConcept baseFormulaType; - - /** - * The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula". - */ - @Child(name = "baseFormulaProductName", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Product or brand name of the enteral or infant formula", formalDefinition="The product or brand name of the enteral or infant formula product such as 'ACME Adult Standard Formula'." ) - protected StringType baseFormulaProductName; - - /** - * The time period and frequency at which the enteral formula should be delivered to the patient. - */ - @Child(name = "scheduled", type = {Timing.class}, order=4, min=0, max=1) - @Description(shortDefinition="Scheduled frequency of enteral feeding", formalDefinition="The time period and frequency at which the enteral formula should be delivered to the patient." ) - protected Timing scheduled; - - /** - * Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula. - */ - @Child(name = "additiveType", type = {CodeableConcept.class}, order=5, min=0, max=1) - @Description(shortDefinition="Type of modular component to add to the feeding", formalDefinition="Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula." ) - protected CodeableConcept additiveType; - - /** - * The product or brand name of the type of modular component to be added to the formula. - */ - @Child(name = "additiveProductName", type = {StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Product or brand name of the modular additive", formalDefinition="The product or brand name of the type of modular component to be added to the formula." ) - protected StringType additiveProductName; - - /** - * The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL. - */ - @Child(name = "caloricDensity", type = {Quantity.class}, order=7, min=0, max=1) - @Description(shortDefinition="Amount of energy per specified volume that is required", formalDefinition="The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL." ) - protected Quantity caloricDensity; - - /** - * The route or physiological path of administration into the patient 's gastrointestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube. - */ - @Child(name = "routeofAdministration", type = {CodeableConcept.class}, order=8, min=0, max=1) - @Description(shortDefinition="How the formula should enter the patient's gastrointestinal tract", formalDefinition="The route or physiological path of administration into the patient 's gastrointestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube." ) - protected CodeableConcept routeofAdministration; - - /** - * The volume of formula to provide to the patient per the specified administration schedule. - */ - @Child(name = "quantity", type = {Quantity.class}, order=9, min=0, max=1) - @Description(shortDefinition="The volume of formula to provide", formalDefinition="The volume of formula to provide to the patient per the specified administration schedule." ) - protected Quantity quantity; - - /** - * The rate of administration of formula via a feeding pump, e.g., 60 mL per hour, according to the specified schedule. - */ - @Child(name = "rate", type = {Ratio.class}, order=10, min=0, max=1) - @Description(shortDefinition="Speed with which the formula is provided per period of time", formalDefinition="The rate of administration of formula via a feeding pump, e.g., 60 mL per hour, according to the specified schedule." ) - protected Ratio rate; - - /** - * The change in the rate of administration over a given time, e.g. increase by 10 mL/hour every 4 hours. - */ - @Child(name = "rateAdjustment", type = {Quantity.class}, order=11, min=0, max=1) - @Description(shortDefinition="Change in the rate of administration over a given time", formalDefinition="The change in the rate of administration over a given time, e.g. increase by 10 mL/hour every 4 hours." ) - protected Quantity rateAdjustment; - - /** - * The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours. - */ - @Child(name = "maxVolumeToDeliver", type = {Quantity.class}, order=12, min=0, max=1) - @Description(shortDefinition="Upper limit on formula volume per unit of time", formalDefinition="The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours." ) - protected Quantity maxVolumeToDeliver; - - private static final long serialVersionUID = -1342980650L; - - /* - * Constructor - */ - public NutritionOrderEnteralFormulaComponent() { - super(); - } - - /** - * @return {@link #administrationInstructions} (Free text formula administration, feeding instructions or additional instructions or information.). This is the underlying object with id, value and extensions. The accessor "getAdministrationInstructions" gives direct access to the value - */ - public StringType getAdministrationInstructionsElement() { - if (this.administrationInstructions == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.administrationInstructions"); - else if (Configuration.doAutoCreate()) - this.administrationInstructions = new StringType(); // bb - return this.administrationInstructions; - } - - public boolean hasAdministrationInstructionsElement() { - return this.administrationInstructions != null && !this.administrationInstructions.isEmpty(); - } - - public boolean hasAdministrationInstructions() { - return this.administrationInstructions != null && !this.administrationInstructions.isEmpty(); - } - - /** - * @param value {@link #administrationInstructions} (Free text formula administration, feeding instructions or additional instructions or information.). This is the underlying object with id, value and extensions. The accessor "getAdministrationInstructions" gives direct access to the value - */ - public NutritionOrderEnteralFormulaComponent setAdministrationInstructionsElement(StringType value) { - this.administrationInstructions = value; - return this; - } - - /** - * @return Free text formula administration, feeding instructions or additional instructions or information. - */ - public String getAdministrationInstructions() { - return this.administrationInstructions == null ? null : this.administrationInstructions.getValue(); - } - - /** - * @param value Free text formula administration, feeding instructions or additional instructions or information. - */ - public NutritionOrderEnteralFormulaComponent setAdministrationInstructions(String value) { - if (Utilities.noString(value)) - this.administrationInstructions = null; - else { - if (this.administrationInstructions == null) - this.administrationInstructions = new StringType(); - this.administrationInstructions.setValue(value); - } - return this; - } - - /** - * @return {@link #baseFormulaType} (The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula.) - */ - public CodeableConcept getBaseFormulaType() { - if (this.baseFormulaType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.baseFormulaType"); - else if (Configuration.doAutoCreate()) - this.baseFormulaType = new CodeableConcept(); // cc - return this.baseFormulaType; - } - - public boolean hasBaseFormulaType() { - return this.baseFormulaType != null && !this.baseFormulaType.isEmpty(); - } - - /** - * @param value {@link #baseFormulaType} (The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula.) - */ - public NutritionOrderEnteralFormulaComponent setBaseFormulaType(CodeableConcept value) { - this.baseFormulaType = value; - return this; - } - - /** - * @return {@link #baseFormulaProductName} (The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula".). This is the underlying object with id, value and extensions. The accessor "getBaseFormulaProductName" gives direct access to the value - */ - public StringType getBaseFormulaProductNameElement() { - if (this.baseFormulaProductName == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.baseFormulaProductName"); - else if (Configuration.doAutoCreate()) - this.baseFormulaProductName = new StringType(); // bb - return this.baseFormulaProductName; - } - - public boolean hasBaseFormulaProductNameElement() { - return this.baseFormulaProductName != null && !this.baseFormulaProductName.isEmpty(); - } - - public boolean hasBaseFormulaProductName() { - return this.baseFormulaProductName != null && !this.baseFormulaProductName.isEmpty(); - } - - /** - * @param value {@link #baseFormulaProductName} (The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula".). This is the underlying object with id, value and extensions. The accessor "getBaseFormulaProductName" gives direct access to the value - */ - public NutritionOrderEnteralFormulaComponent setBaseFormulaProductNameElement(StringType value) { - this.baseFormulaProductName = value; - return this; - } - - /** - * @return The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula". - */ - public String getBaseFormulaProductName() { - return this.baseFormulaProductName == null ? null : this.baseFormulaProductName.getValue(); - } - - /** - * @param value The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula". - */ - public NutritionOrderEnteralFormulaComponent setBaseFormulaProductName(String value) { - if (Utilities.noString(value)) - this.baseFormulaProductName = null; - else { - if (this.baseFormulaProductName == null) - this.baseFormulaProductName = new StringType(); - this.baseFormulaProductName.setValue(value); - } - return this; - } - - /** - * @return {@link #scheduled} (The time period and frequency at which the enteral formula should be delivered to the patient.) - */ - public Timing getScheduled() { - if (this.scheduled == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.scheduled"); - else if (Configuration.doAutoCreate()) - this.scheduled = new Timing(); // cc - return this.scheduled; - } - - public boolean hasScheduled() { - return this.scheduled != null && !this.scheduled.isEmpty(); - } - - /** - * @param value {@link #scheduled} (The time period and frequency at which the enteral formula should be delivered to the patient.) - */ - public NutritionOrderEnteralFormulaComponent setScheduled(Timing value) { - this.scheduled = value; - return this; - } - - /** - * @return {@link #additiveType} (Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.) - */ - public CodeableConcept getAdditiveType() { - if (this.additiveType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.additiveType"); - else if (Configuration.doAutoCreate()) - this.additiveType = new CodeableConcept(); // cc - return this.additiveType; - } - - public boolean hasAdditiveType() { - return this.additiveType != null && !this.additiveType.isEmpty(); - } - - /** - * @param value {@link #additiveType} (Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.) - */ - public NutritionOrderEnteralFormulaComponent setAdditiveType(CodeableConcept value) { - this.additiveType = value; - return this; - } - - /** - * @return {@link #additiveProductName} (The product or brand name of the type of modular component to be added to the formula.). This is the underlying object with id, value and extensions. The accessor "getAdditiveProductName" gives direct access to the value - */ - public StringType getAdditiveProductNameElement() { - if (this.additiveProductName == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.additiveProductName"); - else if (Configuration.doAutoCreate()) - this.additiveProductName = new StringType(); // bb - return this.additiveProductName; - } - - public boolean hasAdditiveProductNameElement() { - return this.additiveProductName != null && !this.additiveProductName.isEmpty(); - } - - public boolean hasAdditiveProductName() { - return this.additiveProductName != null && !this.additiveProductName.isEmpty(); - } - - /** - * @param value {@link #additiveProductName} (The product or brand name of the type of modular component to be added to the formula.). This is the underlying object with id, value and extensions. The accessor "getAdditiveProductName" gives direct access to the value - */ - public NutritionOrderEnteralFormulaComponent setAdditiveProductNameElement(StringType value) { - this.additiveProductName = value; - return this; - } - - /** - * @return The product or brand name of the type of modular component to be added to the formula. - */ - public String getAdditiveProductName() { - return this.additiveProductName == null ? null : this.additiveProductName.getValue(); - } - - /** - * @param value The product or brand name of the type of modular component to be added to the formula. - */ - public NutritionOrderEnteralFormulaComponent setAdditiveProductName(String value) { - if (Utilities.noString(value)) - this.additiveProductName = null; - else { - if (this.additiveProductName == null) - this.additiveProductName = new StringType(); - this.additiveProductName.setValue(value); - } - return this; - } - - /** - * @return {@link #caloricDensity} (The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL.) - */ - public Quantity getCaloricDensity() { - if (this.caloricDensity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.caloricDensity"); - else if (Configuration.doAutoCreate()) - this.caloricDensity = new Quantity(); // cc - return this.caloricDensity; - } - - public boolean hasCaloricDensity() { - return this.caloricDensity != null && !this.caloricDensity.isEmpty(); - } - - /** - * @param value {@link #caloricDensity} (The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL.) - */ - public NutritionOrderEnteralFormulaComponent setCaloricDensity(Quantity value) { - this.caloricDensity = value; - return this; - } - - /** - * @return {@link #routeofAdministration} (The route or physiological path of administration into the patient 's gastrointestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube.) - */ - public CodeableConcept getRouteofAdministration() { - if (this.routeofAdministration == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.routeofAdministration"); - else if (Configuration.doAutoCreate()) - this.routeofAdministration = new CodeableConcept(); // cc - return this.routeofAdministration; - } - - public boolean hasRouteofAdministration() { - return this.routeofAdministration != null && !this.routeofAdministration.isEmpty(); - } - - /** - * @param value {@link #routeofAdministration} (The route or physiological path of administration into the patient 's gastrointestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube.) - */ - public NutritionOrderEnteralFormulaComponent setRouteofAdministration(CodeableConcept value) { - this.routeofAdministration = value; - return this; - } - - /** - * @return {@link #quantity} (The volume of formula to provide to the patient per the specified administration schedule.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The volume of formula to provide to the patient per the specified administration schedule.) - */ - public NutritionOrderEnteralFormulaComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #rate} (The rate of administration of formula via a feeding pump, e.g., 60 mL per hour, according to the specified schedule.) - */ - public Ratio getRate() { - if (this.rate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.rate"); - else if (Configuration.doAutoCreate()) - this.rate = new Ratio(); // cc - return this.rate; - } - - public boolean hasRate() { - return this.rate != null && !this.rate.isEmpty(); - } - - /** - * @param value {@link #rate} (The rate of administration of formula via a feeding pump, e.g., 60 mL per hour, according to the specified schedule.) - */ - public NutritionOrderEnteralFormulaComponent setRate(Ratio value) { - this.rate = value; - return this; - } - - /** - * @return {@link #rateAdjustment} (The change in the rate of administration over a given time, e.g. increase by 10 mL/hour every 4 hours.) - */ - public Quantity getRateAdjustment() { - if (this.rateAdjustment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.rateAdjustment"); - else if (Configuration.doAutoCreate()) - this.rateAdjustment = new Quantity(); // cc - return this.rateAdjustment; - } - - public boolean hasRateAdjustment() { - return this.rateAdjustment != null && !this.rateAdjustment.isEmpty(); - } - - /** - * @param value {@link #rateAdjustment} (The change in the rate of administration over a given time, e.g. increase by 10 mL/hour every 4 hours.) - */ - public NutritionOrderEnteralFormulaComponent setRateAdjustment(Quantity value) { - this.rateAdjustment = value; - return this; - } - - /** - * @return {@link #maxVolumeToDeliver} (The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours.) - */ - public Quantity getMaxVolumeToDeliver() { - if (this.maxVolumeToDeliver == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.maxVolumeToDeliver"); - else if (Configuration.doAutoCreate()) - this.maxVolumeToDeliver = new Quantity(); // cc - return this.maxVolumeToDeliver; - } - - public boolean hasMaxVolumeToDeliver() { - return this.maxVolumeToDeliver != null && !this.maxVolumeToDeliver.isEmpty(); - } - - /** - * @param value {@link #maxVolumeToDeliver} (The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours.) - */ - public NutritionOrderEnteralFormulaComponent setMaxVolumeToDeliver(Quantity value) { - this.maxVolumeToDeliver = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("administrationInstructions", "string", "Free text formula administration, feeding instructions or additional instructions or information.", 0, java.lang.Integer.MAX_VALUE, administrationInstructions)); - childrenList.add(new Property("baseFormulaType", "CodeableConcept", "The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula.", 0, java.lang.Integer.MAX_VALUE, baseFormulaType)); - childrenList.add(new Property("baseFormulaProductName", "string", "The product or brand name of the enteral or infant formula product such as 'ACME Adult Standard Formula'.", 0, java.lang.Integer.MAX_VALUE, baseFormulaProductName)); - childrenList.add(new Property("scheduled", "Timing", "The time period and frequency at which the enteral formula should be delivered to the patient.", 0, java.lang.Integer.MAX_VALUE, scheduled)); - childrenList.add(new Property("additiveType", "CodeableConcept", "Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.", 0, java.lang.Integer.MAX_VALUE, additiveType)); - childrenList.add(new Property("additiveProductName", "string", "The product or brand name of the type of modular component to be added to the formula.", 0, java.lang.Integer.MAX_VALUE, additiveProductName)); - childrenList.add(new Property("caloricDensity", "Quantity", "The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL.", 0, java.lang.Integer.MAX_VALUE, caloricDensity)); - childrenList.add(new Property("routeofAdministration", "CodeableConcept", "The route or physiological path of administration into the patient 's gastrointestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube.", 0, java.lang.Integer.MAX_VALUE, routeofAdministration)); - childrenList.add(new Property("quantity", "Quantity", "The volume of formula to provide to the patient per the specified administration schedule.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("rate", "Ratio", "The rate of administration of formula via a feeding pump, e.g., 60 mL per hour, according to the specified schedule.", 0, java.lang.Integer.MAX_VALUE, rate)); - childrenList.add(new Property("rateAdjustment", "Quantity", "The change in the rate of administration over a given time, e.g. increase by 10 mL/hour every 4 hours.", 0, java.lang.Integer.MAX_VALUE, rateAdjustment)); - childrenList.add(new Property("maxVolumeToDeliver", "Quantity", "The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxVolumeToDeliver)); - } - - public NutritionOrderEnteralFormulaComponent copy() { - NutritionOrderEnteralFormulaComponent dst = new NutritionOrderEnteralFormulaComponent(); - copyValues(dst); - dst.administrationInstructions = administrationInstructions == null ? null : administrationInstructions.copy(); - dst.baseFormulaType = baseFormulaType == null ? null : baseFormulaType.copy(); - dst.baseFormulaProductName = baseFormulaProductName == null ? null : baseFormulaProductName.copy(); - dst.scheduled = scheduled == null ? null : scheduled.copy(); - dst.additiveType = additiveType == null ? null : additiveType.copy(); - dst.additiveProductName = additiveProductName == null ? null : additiveProductName.copy(); - dst.caloricDensity = caloricDensity == null ? null : caloricDensity.copy(); - dst.routeofAdministration = routeofAdministration == null ? null : routeofAdministration.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.rate = rate == null ? null : rate.copy(); - dst.rateAdjustment = rateAdjustment == null ? null : rateAdjustment.copy(); - dst.maxVolumeToDeliver = maxVolumeToDeliver == null ? null : maxVolumeToDeliver.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NutritionOrderEnteralFormulaComponent)) - return false; - NutritionOrderEnteralFormulaComponent o = (NutritionOrderEnteralFormulaComponent) other; - return compareDeep(administrationInstructions, o.administrationInstructions, true) && compareDeep(baseFormulaType, o.baseFormulaType, true) - && compareDeep(baseFormulaProductName, o.baseFormulaProductName, true) && compareDeep(scheduled, o.scheduled, true) - && compareDeep(additiveType, o.additiveType, true) && compareDeep(additiveProductName, o.additiveProductName, true) - && compareDeep(caloricDensity, o.caloricDensity, true) && compareDeep(routeofAdministration, o.routeofAdministration, true) - && compareDeep(quantity, o.quantity, true) && compareDeep(rate, o.rate, true) && compareDeep(rateAdjustment, o.rateAdjustment, true) - && compareDeep(maxVolumeToDeliver, o.maxVolumeToDeliver, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NutritionOrderEnteralFormulaComponent)) - return false; - NutritionOrderEnteralFormulaComponent o = (NutritionOrderEnteralFormulaComponent) other; - return compareValues(administrationInstructions, o.administrationInstructions, true) && compareValues(baseFormulaProductName, o.baseFormulaProductName, true) - && compareValues(additiveProductName, o.additiveProductName, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (administrationInstructions == null || administrationInstructions.isEmpty()) - && (baseFormulaType == null || baseFormulaType.isEmpty()) && (baseFormulaProductName == null || baseFormulaProductName.isEmpty()) - && (scheduled == null || scheduled.isEmpty()) && (additiveType == null || additiveType.isEmpty()) - && (additiveProductName == null || additiveProductName.isEmpty()) && (caloricDensity == null || caloricDensity.isEmpty()) - && (routeofAdministration == null || routeofAdministration.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (rate == null || rate.isEmpty()) && (rateAdjustment == null || rateAdjustment.isEmpty()) - && (maxVolumeToDeliver == null || maxVolumeToDeliver.isEmpty()); - } - - } - - /** - * The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding. - */ - @Child(name = "patient", type = {Patient.class}, order=0, min=1, max=1) - @Description(shortDefinition="The person who requires the diet, formula or nutritional supplement", formalDefinition="The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) - */ - protected Patient patientTarget; - - /** - * The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings. - */ - @Child(name = "orderer", type = {Practitioner.class}, order=1, min=0, max=1) - @Description(shortDefinition="Who ordered the diet, formula or nutritional supplement", formalDefinition="The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings." ) - protected Reference orderer; - - /** - * The actual object that is the target of the reference (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) - */ - protected Practitioner ordererTarget; - - /** - * Identifiers assigned to this order by the order sender or by the order receiver. - */ - @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Identifiers assigned to this order", formalDefinition="Identifiers assigned to this order by the order sender or by the order receiver." ) - protected List identifier; - - /** - * An encounter that provides additional information about the healthcare context in which this request is made. - */ - @Child(name = "encounter", type = {Encounter.class}, order=3, min=0, max=1) - @Description(shortDefinition="The encounter associated with that this nutrition order", formalDefinition="An encounter that provides additional information about the healthcare context in which this request is made." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - protected Encounter encounterTarget; - - /** - * The date and time that this nutrition order was requested. - */ - @Child(name = "dateTime", type = {DateTimeType.class}, order=4, min=1, max=1) - @Description(shortDefinition="Date and time the nutrition order was requested", formalDefinition="The date and time that this nutrition order was requested." ) - protected DateTimeType dateTime; - - /** - * The workflow status of the nutrition order/request. - */ - @Child(name = "status", type = {CodeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="proposed | draft | planned | requested | active | on-hold | completed | cancelled", formalDefinition="The workflow status of the nutrition order/request." ) - protected Enumeration status; - - /** - * A link to a record of allergies or Intolerances which should be included in the nutrition order. - */ - @Child(name = "allergyIntolerance", type = {AllergyIntolerance.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of the patient's food and nutrition-related allergies and intolerances", formalDefinition="A link to a record of allergies or Intolerances which should be included in the nutrition order." ) - protected List allergyIntolerance; - /** - * The actual objects that are the target of the reference (A link to a record of allergies or Intolerances which should be included in the nutrition order.) - */ - protected List allergyIntoleranceTarget; - - - /** - * This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings. - */ - @Child(name = "foodPreferenceModifier", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Order-specific modifier about the type of food that should be given", formalDefinition="This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings." ) - protected List foodPreferenceModifier; - - /** - * This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings. - */ - @Child(name = "excludeFoodModifier", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Order-specific modifier about the type of food that should not be given", formalDefinition="This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings." ) - protected List excludeFoodModifier; - - /** - * Diet given orally in contrast to enteral (tube) feeding. - */ - @Child(name = "oralDiet", type = {}, order=9, min=0, max=1) - @Description(shortDefinition="Oral diet components", formalDefinition="Diet given orally in contrast to enteral (tube) feeding." ) - protected NutritionOrderOralDietComponent oralDiet; - - /** - * Oral nutritional products given in order to add further nutritional value to the patient's diet. - */ - @Child(name = "supplement", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Supplement components", formalDefinition="Oral nutritional products given in order to add further nutritional value to the patient's diet." ) - protected List supplement; - - /** - * Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity. - */ - @Child(name = "enteralFormula", type = {}, order=11, min=0, max=1) - @Description(shortDefinition="Enteral formula components", formalDefinition="Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity." ) - protected NutritionOrderEnteralFormulaComponent enteralFormula; - - private static final long serialVersionUID = 1139624085L; - - /* - * Constructor - */ - public NutritionOrder() { - super(); - } - - /* - * Constructor - */ - public NutritionOrder(Reference patient, DateTimeType dateTime) { - super(); - this.patient = patient; - this.dateTime = dateTime; - } - - /** - * @return {@link #patient} (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) - */ - public NutritionOrder setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) - */ - public NutritionOrder setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #orderer} (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) - */ - public Reference getOrderer() { - if (this.orderer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.orderer"); - else if (Configuration.doAutoCreate()) - this.orderer = new Reference(); // cc - return this.orderer; - } - - public boolean hasOrderer() { - return this.orderer != null && !this.orderer.isEmpty(); - } - - /** - * @param value {@link #orderer} (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) - */ - public NutritionOrder setOrderer(Reference value) { - this.orderer = value; - return this; - } - - /** - * @return {@link #orderer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) - */ - public Practitioner getOrdererTarget() { - if (this.ordererTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.orderer"); - else if (Configuration.doAutoCreate()) - this.ordererTarget = new Practitioner(); // aa - return this.ordererTarget; - } - - /** - * @param value {@link #orderer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) - */ - public NutritionOrder setOrdererTarget(Practitioner value) { - this.ordererTarget = value; - return this; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the order sender or by the order receiver.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the order sender or by the order receiver.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public NutritionOrder addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - public NutritionOrder setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - public NutritionOrder setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #dateTime} (The date and time that this nutrition order was requested.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public DateTimeType getDateTimeElement() { - if (this.dateTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.dateTime"); - else if (Configuration.doAutoCreate()) - this.dateTime = new DateTimeType(); // bb - return this.dateTime; - } - - public boolean hasDateTimeElement() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - public boolean hasDateTime() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - /** - * @param value {@link #dateTime} (The date and time that this nutrition order was requested.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public NutritionOrder setDateTimeElement(DateTimeType value) { - this.dateTime = value; - return this; - } - - /** - * @return The date and time that this nutrition order was requested. - */ - public Date getDateTime() { - return this.dateTime == null ? null : this.dateTime.getValue(); - } - - /** - * @param value The date and time that this nutrition order was requested. - */ - public NutritionOrder setDateTime(Date value) { - if (this.dateTime == null) - this.dateTime = new DateTimeType(); - this.dateTime.setValue(value); - return this; - } - - /** - * @return {@link #status} (The workflow status of the nutrition order/request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new NutritionOrderStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The workflow status of the nutrition order/request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public NutritionOrder setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The workflow status of the nutrition order/request. - */ - public NutritionOrderStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The workflow status of the nutrition order/request. - */ - public NutritionOrder setStatus(NutritionOrderStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new NutritionOrderStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #allergyIntolerance} (A link to a record of allergies or Intolerances which should be included in the nutrition order.) - */ - public List getAllergyIntolerance() { - if (this.allergyIntolerance == null) - this.allergyIntolerance = new ArrayList(); - return this.allergyIntolerance; - } - - public boolean hasAllergyIntolerance() { - if (this.allergyIntolerance == null) - return false; - for (Reference item : this.allergyIntolerance) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #allergyIntolerance} (A link to a record of allergies or Intolerances which should be included in the nutrition order.) - */ - // syntactic sugar - public Reference addAllergyIntolerance() { //3 - Reference t = new Reference(); - if (this.allergyIntolerance == null) - this.allergyIntolerance = new ArrayList(); - this.allergyIntolerance.add(t); - return t; - } - - // syntactic sugar - public NutritionOrder addAllergyIntolerance(Reference t) { //3 - if (t == null) - return this; - if (this.allergyIntolerance == null) - this.allergyIntolerance = new ArrayList(); - this.allergyIntolerance.add(t); - return this; - } - - /** - * @return {@link #allergyIntolerance} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A link to a record of allergies or Intolerances which should be included in the nutrition order.) - */ - public List getAllergyIntoleranceTarget() { - if (this.allergyIntoleranceTarget == null) - this.allergyIntoleranceTarget = new ArrayList(); - return this.allergyIntoleranceTarget; - } - - // syntactic sugar - /** - * @return {@link #allergyIntolerance} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. A link to a record of allergies or Intolerances which should be included in the nutrition order.) - */ - public AllergyIntolerance addAllergyIntoleranceTarget() { - AllergyIntolerance r = new AllergyIntolerance(); - if (this.allergyIntoleranceTarget == null) - this.allergyIntoleranceTarget = new ArrayList(); - this.allergyIntoleranceTarget.add(r); - return r; - } - - /** - * @return {@link #foodPreferenceModifier} (This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) - */ - public List getFoodPreferenceModifier() { - if (this.foodPreferenceModifier == null) - this.foodPreferenceModifier = new ArrayList(); - return this.foodPreferenceModifier; - } - - public boolean hasFoodPreferenceModifier() { - if (this.foodPreferenceModifier == null) - return false; - for (CodeableConcept item : this.foodPreferenceModifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #foodPreferenceModifier} (This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) - */ - // syntactic sugar - public CodeableConcept addFoodPreferenceModifier() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.foodPreferenceModifier == null) - this.foodPreferenceModifier = new ArrayList(); - this.foodPreferenceModifier.add(t); - return t; - } - - // syntactic sugar - public NutritionOrder addFoodPreferenceModifier(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.foodPreferenceModifier == null) - this.foodPreferenceModifier = new ArrayList(); - this.foodPreferenceModifier.add(t); - return this; - } - - /** - * @return {@link #excludeFoodModifier} (This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) - */ - public List getExcludeFoodModifier() { - if (this.excludeFoodModifier == null) - this.excludeFoodModifier = new ArrayList(); - return this.excludeFoodModifier; - } - - public boolean hasExcludeFoodModifier() { - if (this.excludeFoodModifier == null) - return false; - for (CodeableConcept item : this.excludeFoodModifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #excludeFoodModifier} (This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) - */ - // syntactic sugar - public CodeableConcept addExcludeFoodModifier() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.excludeFoodModifier == null) - this.excludeFoodModifier = new ArrayList(); - this.excludeFoodModifier.add(t); - return t; - } - - // syntactic sugar - public NutritionOrder addExcludeFoodModifier(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.excludeFoodModifier == null) - this.excludeFoodModifier = new ArrayList(); - this.excludeFoodModifier.add(t); - return this; - } - - /** - * @return {@link #oralDiet} (Diet given orally in contrast to enteral (tube) feeding.) - */ - public NutritionOrderOralDietComponent getOralDiet() { - if (this.oralDiet == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.oralDiet"); - else if (Configuration.doAutoCreate()) - this.oralDiet = new NutritionOrderOralDietComponent(); // cc - return this.oralDiet; - } - - public boolean hasOralDiet() { - return this.oralDiet != null && !this.oralDiet.isEmpty(); - } - - /** - * @param value {@link #oralDiet} (Diet given orally in contrast to enteral (tube) feeding.) - */ - public NutritionOrder setOralDiet(NutritionOrderOralDietComponent value) { - this.oralDiet = value; - return this; - } - - /** - * @return {@link #supplement} (Oral nutritional products given in order to add further nutritional value to the patient's diet.) - */ - public List getSupplement() { - if (this.supplement == null) - this.supplement = new ArrayList(); - return this.supplement; - } - - public boolean hasSupplement() { - if (this.supplement == null) - return false; - for (NutritionOrderSupplementComponent item : this.supplement) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #supplement} (Oral nutritional products given in order to add further nutritional value to the patient's diet.) - */ - // syntactic sugar - public NutritionOrderSupplementComponent addSupplement() { //3 - NutritionOrderSupplementComponent t = new NutritionOrderSupplementComponent(); - if (this.supplement == null) - this.supplement = new ArrayList(); - this.supplement.add(t); - return t; - } - - // syntactic sugar - public NutritionOrder addSupplement(NutritionOrderSupplementComponent t) { //3 - if (t == null) - return this; - if (this.supplement == null) - this.supplement = new ArrayList(); - this.supplement.add(t); - return this; - } - - /** - * @return {@link #enteralFormula} (Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity.) - */ - public NutritionOrderEnteralFormulaComponent getEnteralFormula() { - if (this.enteralFormula == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.enteralFormula"); - else if (Configuration.doAutoCreate()) - this.enteralFormula = new NutritionOrderEnteralFormulaComponent(); // cc - return this.enteralFormula; - } - - public boolean hasEnteralFormula() { - return this.enteralFormula != null && !this.enteralFormula.isEmpty(); - } - - /** - * @param value {@link #enteralFormula} (Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity.) - */ - public NutritionOrder setEnteralFormula(NutritionOrderEnteralFormulaComponent value) { - this.enteralFormula = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("patient", "Reference(Patient)", "The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("orderer", "Reference(Practitioner)", "The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.", 0, java.lang.Integer.MAX_VALUE, orderer)); - childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the order sender or by the order receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional information about the healthcare context in which this request is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("dateTime", "dateTime", "The date and time that this nutrition order was requested.", 0, java.lang.Integer.MAX_VALUE, dateTime)); - childrenList.add(new Property("status", "code", "The workflow status of the nutrition order/request.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("allergyIntolerance", "Reference(AllergyIntolerance)", "A link to a record of allergies or Intolerances which should be included in the nutrition order.", 0, java.lang.Integer.MAX_VALUE, allergyIntolerance)); - childrenList.add(new Property("foodPreferenceModifier", "CodeableConcept", "This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.", 0, java.lang.Integer.MAX_VALUE, foodPreferenceModifier)); - childrenList.add(new Property("excludeFoodModifier", "CodeableConcept", "This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.", 0, java.lang.Integer.MAX_VALUE, excludeFoodModifier)); - childrenList.add(new Property("oralDiet", "", "Diet given orally in contrast to enteral (tube) feeding.", 0, java.lang.Integer.MAX_VALUE, oralDiet)); - childrenList.add(new Property("supplement", "", "Oral nutritional products given in order to add further nutritional value to the patient's diet.", 0, java.lang.Integer.MAX_VALUE, supplement)); - childrenList.add(new Property("enteralFormula", "", "Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity.", 0, java.lang.Integer.MAX_VALUE, enteralFormula)); - } - - public NutritionOrder copy() { - NutritionOrder dst = new NutritionOrder(); - copyValues(dst); - dst.patient = patient == null ? null : patient.copy(); - dst.orderer = orderer == null ? null : orderer.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.encounter = encounter == null ? null : encounter.copy(); - dst.dateTime = dateTime == null ? null : dateTime.copy(); - dst.status = status == null ? null : status.copy(); - if (allergyIntolerance != null) { - dst.allergyIntolerance = new ArrayList(); - for (Reference i : allergyIntolerance) - dst.allergyIntolerance.add(i.copy()); - }; - if (foodPreferenceModifier != null) { - dst.foodPreferenceModifier = new ArrayList(); - for (CodeableConcept i : foodPreferenceModifier) - dst.foodPreferenceModifier.add(i.copy()); - }; - if (excludeFoodModifier != null) { - dst.excludeFoodModifier = new ArrayList(); - for (CodeableConcept i : excludeFoodModifier) - dst.excludeFoodModifier.add(i.copy()); - }; - dst.oralDiet = oralDiet == null ? null : oralDiet.copy(); - if (supplement != null) { - dst.supplement = new ArrayList(); - for (NutritionOrderSupplementComponent i : supplement) - dst.supplement.add(i.copy()); - }; - dst.enteralFormula = enteralFormula == null ? null : enteralFormula.copy(); - return dst; - } - - protected NutritionOrder typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NutritionOrder)) - return false; - NutritionOrder o = (NutritionOrder) other; - return compareDeep(patient, o.patient, true) && compareDeep(orderer, o.orderer, true) && compareDeep(identifier, o.identifier, true) - && compareDeep(encounter, o.encounter, true) && compareDeep(dateTime, o.dateTime, true) && compareDeep(status, o.status, true) - && compareDeep(allergyIntolerance, o.allergyIntolerance, true) && compareDeep(foodPreferenceModifier, o.foodPreferenceModifier, true) - && compareDeep(excludeFoodModifier, o.excludeFoodModifier, true) && compareDeep(oralDiet, o.oralDiet, true) - && compareDeep(supplement, o.supplement, true) && compareDeep(enteralFormula, o.enteralFormula, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NutritionOrder)) - return false; - NutritionOrder o = (NutritionOrder) other; - return compareValues(dateTime, o.dateTime, true) && compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (patient == null || patient.isEmpty()) && (orderer == null || orderer.isEmpty()) - && (identifier == null || identifier.isEmpty()) && (encounter == null || encounter.isEmpty()) - && (dateTime == null || dateTime.isEmpty()) && (status == null || status.isEmpty()) && (allergyIntolerance == null || allergyIntolerance.isEmpty()) - && (foodPreferenceModifier == null || foodPreferenceModifier.isEmpty()) && (excludeFoodModifier == null || excludeFoodModifier.isEmpty()) - && (oralDiet == null || oralDiet.isEmpty()) && (supplement == null || supplement.isEmpty()) - && (enteralFormula == null || enteralFormula.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.NutritionOrder; - } - - @SearchParamDefinition(name="patient", path="NutritionOrder.patient", description="The identity of the person who requires the diet, formula or nutritional supplement", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="status", path="NutritionOrder.status", description="Status of the nutrition order.", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="supplement", path="NutritionOrder.supplement.type", description="Type of supplement product requested", type="token" ) - public static final String SP_SUPPLEMENT = "supplement"; - @SearchParamDefinition(name="oraldiet", path="NutritionOrder.oralDiet.type", description="Type of diet that can be consumed orally (i.e., take via the mouth).", type="token" ) - public static final String SP_ORALDIET = "oraldiet"; - @SearchParamDefinition(name="provider", path="NutritionOrder.orderer", description="The identify of the provider who placed the nutrition order", type="reference" ) - public static final String SP_PROVIDER = "provider"; - @SearchParamDefinition(name="encounter", path="NutritionOrder.encounter", description="Return nutrition orders with this encounter identity", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - @SearchParamDefinition(name="datetime", path="NutritionOrder.dateTime", description="Return nutrition orders requested on this date", type="date" ) - public static final String SP_DATETIME = "datetime"; - @SearchParamDefinition(name="additive", path="NutritionOrder.enteralFormula.additiveType", description="Type of module component to add to the feeding", type="token" ) - public static final String SP_ADDITIVE = "additive"; - @SearchParamDefinition(name="identifier", path="NutritionOrder.identifier", description="Return nutrition orders with this external identity", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="formula", path="NutritionOrder.enteralFormula.baseFormulaType", description="Type of enteral or infant formula", type="token" ) - public static final String SP_FORMULA = "formula"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. + */ +@ResourceDef(name="NutritionOrder", profile="http://hl7.org/fhir/Profile/NutritionOrder") +public class NutritionOrder extends DomainResource { + + public enum NutritionOrderStatus { + /** + * The request has been proposed. + */ + PROPOSED, + /** + * The request is in preliminary form prior to being sent. + */ + DRAFT, + /** + * The request has been planned. + */ + PLANNED, + /** + * The request has been placed. + */ + REQUESTED, + /** + * The request is 'actionable', but not all actions that are implied by it have occurred yet. + */ + ACTIVE, + /** + * Actions implied by the request have been temporarily halted, but are expected to continue later. May also be called "suspended". + */ + ONHOLD, + /** + * All actions that are implied by the order have occurred and no continuation is planned (this will rarely be made explicit). + */ + COMPLETED, + /** + * The request has been withdrawn and is no longer actionable. + */ + CANCELLED, + /** + * added to help the parsers + */ + NULL; + public static NutritionOrderStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("draft".equals(codeString)) + return DRAFT; + if ("planned".equals(codeString)) + return PLANNED; + if ("requested".equals(codeString)) + return REQUESTED; + if ("active".equals(codeString)) + return ACTIVE; + if ("on-hold".equals(codeString)) + return ONHOLD; + if ("completed".equals(codeString)) + return COMPLETED; + if ("cancelled".equals(codeString)) + return CANCELLED; + throw new Exception("Unknown NutritionOrderStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROPOSED: return "proposed"; + case DRAFT: return "draft"; + case PLANNED: return "planned"; + case REQUESTED: return "requested"; + case ACTIVE: return "active"; + case ONHOLD: return "on-hold"; + case COMPLETED: return "completed"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROPOSED: return ""; + case DRAFT: return ""; + case PLANNED: return ""; + case REQUESTED: return ""; + case ACTIVE: return ""; + case ONHOLD: return ""; + case COMPLETED: return ""; + case CANCELLED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROPOSED: return "The request has been proposed."; + case DRAFT: return "The request is in preliminary form prior to being sent."; + case PLANNED: return "The request has been planned."; + case REQUESTED: return "The request has been placed."; + case ACTIVE: return "The request is 'actionable', but not all actions that are implied by it have occurred yet."; + case ONHOLD: return "Actions implied by the request have been temporarily halted, but are expected to continue later. May also be called 'suspended'."; + case COMPLETED: return "All actions that are implied by the order have occurred and no continuation is planned (this will rarely be made explicit)."; + case CANCELLED: return "The request has been withdrawn and is no longer actionable."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROPOSED: return "Proposed"; + case DRAFT: return "Draft"; + case PLANNED: return "Planned"; + case REQUESTED: return "Requested"; + case ACTIVE: return "Active"; + case ONHOLD: return "On-Hold"; + case COMPLETED: return "Completed"; + case CANCELLED: return "Cancelled"; + default: return "?"; + } + } + } + + public static class NutritionOrderStatusEnumFactory implements EnumFactory { + public NutritionOrderStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return NutritionOrderStatus.PROPOSED; + if ("draft".equals(codeString)) + return NutritionOrderStatus.DRAFT; + if ("planned".equals(codeString)) + return NutritionOrderStatus.PLANNED; + if ("requested".equals(codeString)) + return NutritionOrderStatus.REQUESTED; + if ("active".equals(codeString)) + return NutritionOrderStatus.ACTIVE; + if ("on-hold".equals(codeString)) + return NutritionOrderStatus.ONHOLD; + if ("completed".equals(codeString)) + return NutritionOrderStatus.COMPLETED; + if ("cancelled".equals(codeString)) + return NutritionOrderStatus.CANCELLED; + throw new IllegalArgumentException("Unknown NutritionOrderStatus code '"+codeString+"'"); + } + public String toCode(NutritionOrderStatus code) { + if (code == NutritionOrderStatus.PROPOSED) + return "proposed"; + if (code == NutritionOrderStatus.DRAFT) + return "draft"; + if (code == NutritionOrderStatus.PLANNED) + return "planned"; + if (code == NutritionOrderStatus.REQUESTED) + return "requested"; + if (code == NutritionOrderStatus.ACTIVE) + return "active"; + if (code == NutritionOrderStatus.ONHOLD) + return "on-hold"; + if (code == NutritionOrderStatus.COMPLETED) + return "completed"; + if (code == NutritionOrderStatus.CANCELLED) + return "cancelled"; + return "?"; + } + } + + @Block() + public static class NutritionOrderOralDietComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Type of oral diet or diet restrictions that describe what can be consumed orally", formalDefinition="The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet." ) + protected List type; + + /** + * The time period and frequency at which the diet should be given. + */ + @Child(name = "schedule", type = {Timing.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Scheduled frequency of diet", formalDefinition="The time period and frequency at which the diet should be given." ) + protected List schedule; + + /** + * Class that defines the quantity and type of nutrient modifications required for the oral diet. + */ + @Child(name = "nutrient", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Required nutrient modifications", formalDefinition="Class that defines the quantity and type of nutrient modifications required for the oral diet." ) + protected List nutrient; + + /** + * Class that describes any texture modifications required for the patient to safely consume various types of solid foods. + */ + @Child(name = "texture", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Required texture modifications", formalDefinition="Class that describes any texture modifications required for the patient to safely consume various types of solid foods." ) + protected List texture; + + /** + * The required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient. + */ + @Child(name = "fluidConsistencyType", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The required consistency of fluids and liquids provided to the patient", formalDefinition="The required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient." ) + protected List fluidConsistencyType; + + /** + * Free text or additional instructions or information pertaining to the oral diet. + */ + @Child(name = "instruction", type = {StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Instructions or additional information about the oral diet", formalDefinition="Free text or additional instructions or information pertaining to the oral diet." ) + protected StringType instruction; + + private static final long serialVersionUID = 973058412L; + + /* + * Constructor + */ + public NutritionOrderOralDietComponent() { + super(); + } + + /** + * @return {@link #type} (The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (CodeableConcept item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet.) + */ + // syntactic sugar + public CodeableConcept addType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + // syntactic sugar + public NutritionOrderOralDietComponent addType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + /** + * @return {@link #schedule} (The time period and frequency at which the diet should be given.) + */ + public List getSchedule() { + if (this.schedule == null) + this.schedule = new ArrayList(); + return this.schedule; + } + + public boolean hasSchedule() { + if (this.schedule == null) + return false; + for (Timing item : this.schedule) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #schedule} (The time period and frequency at which the diet should be given.) + */ + // syntactic sugar + public Timing addSchedule() { //3 + Timing t = new Timing(); + if (this.schedule == null) + this.schedule = new ArrayList(); + this.schedule.add(t); + return t; + } + + // syntactic sugar + public NutritionOrderOralDietComponent addSchedule(Timing t) { //3 + if (t == null) + return this; + if (this.schedule == null) + this.schedule = new ArrayList(); + this.schedule.add(t); + return this; + } + + /** + * @return {@link #nutrient} (Class that defines the quantity and type of nutrient modifications required for the oral diet.) + */ + public List getNutrient() { + if (this.nutrient == null) + this.nutrient = new ArrayList(); + return this.nutrient; + } + + public boolean hasNutrient() { + if (this.nutrient == null) + return false; + for (NutritionOrderOralDietNutrientComponent item : this.nutrient) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #nutrient} (Class that defines the quantity and type of nutrient modifications required for the oral diet.) + */ + // syntactic sugar + public NutritionOrderOralDietNutrientComponent addNutrient() { //3 + NutritionOrderOralDietNutrientComponent t = new NutritionOrderOralDietNutrientComponent(); + if (this.nutrient == null) + this.nutrient = new ArrayList(); + this.nutrient.add(t); + return t; + } + + // syntactic sugar + public NutritionOrderOralDietComponent addNutrient(NutritionOrderOralDietNutrientComponent t) { //3 + if (t == null) + return this; + if (this.nutrient == null) + this.nutrient = new ArrayList(); + this.nutrient.add(t); + return this; + } + + /** + * @return {@link #texture} (Class that describes any texture modifications required for the patient to safely consume various types of solid foods.) + */ + public List getTexture() { + if (this.texture == null) + this.texture = new ArrayList(); + return this.texture; + } + + public boolean hasTexture() { + if (this.texture == null) + return false; + for (NutritionOrderOralDietTextureComponent item : this.texture) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #texture} (Class that describes any texture modifications required for the patient to safely consume various types of solid foods.) + */ + // syntactic sugar + public NutritionOrderOralDietTextureComponent addTexture() { //3 + NutritionOrderOralDietTextureComponent t = new NutritionOrderOralDietTextureComponent(); + if (this.texture == null) + this.texture = new ArrayList(); + this.texture.add(t); + return t; + } + + // syntactic sugar + public NutritionOrderOralDietComponent addTexture(NutritionOrderOralDietTextureComponent t) { //3 + if (t == null) + return this; + if (this.texture == null) + this.texture = new ArrayList(); + this.texture.add(t); + return this; + } + + /** + * @return {@link #fluidConsistencyType} (The required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.) + */ + public List getFluidConsistencyType() { + if (this.fluidConsistencyType == null) + this.fluidConsistencyType = new ArrayList(); + return this.fluidConsistencyType; + } + + public boolean hasFluidConsistencyType() { + if (this.fluidConsistencyType == null) + return false; + for (CodeableConcept item : this.fluidConsistencyType) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #fluidConsistencyType} (The required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.) + */ + // syntactic sugar + public CodeableConcept addFluidConsistencyType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.fluidConsistencyType == null) + this.fluidConsistencyType = new ArrayList(); + this.fluidConsistencyType.add(t); + return t; + } + + // syntactic sugar + public NutritionOrderOralDietComponent addFluidConsistencyType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.fluidConsistencyType == null) + this.fluidConsistencyType = new ArrayList(); + this.fluidConsistencyType.add(t); + return this; + } + + /** + * @return {@link #instruction} (Free text or additional instructions or information pertaining to the oral diet.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value + */ + public StringType getInstructionElement() { + if (this.instruction == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderOralDietComponent.instruction"); + else if (Configuration.doAutoCreate()) + this.instruction = new StringType(); // bb + return this.instruction; + } + + public boolean hasInstructionElement() { + return this.instruction != null && !this.instruction.isEmpty(); + } + + public boolean hasInstruction() { + return this.instruction != null && !this.instruction.isEmpty(); + } + + /** + * @param value {@link #instruction} (Free text or additional instructions or information pertaining to the oral diet.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value + */ + public NutritionOrderOralDietComponent setInstructionElement(StringType value) { + this.instruction = value; + return this; + } + + /** + * @return Free text or additional instructions or information pertaining to the oral diet. + */ + public String getInstruction() { + return this.instruction == null ? null : this.instruction.getValue(); + } + + /** + * @param value Free text or additional instructions or information pertaining to the oral diet. + */ + public NutritionOrderOralDietComponent setInstruction(String value) { + if (Utilities.noString(value)) + this.instruction = null; + else { + if (this.instruction == null) + this.instruction = new StringType(); + this.instruction.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("schedule", "Timing", "The time period and frequency at which the diet should be given.", 0, java.lang.Integer.MAX_VALUE, schedule)); + childrenList.add(new Property("nutrient", "", "Class that defines the quantity and type of nutrient modifications required for the oral diet.", 0, java.lang.Integer.MAX_VALUE, nutrient)); + childrenList.add(new Property("texture", "", "Class that describes any texture modifications required for the patient to safely consume various types of solid foods.", 0, java.lang.Integer.MAX_VALUE, texture)); + childrenList.add(new Property("fluidConsistencyType", "CodeableConcept", "The required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.", 0, java.lang.Integer.MAX_VALUE, fluidConsistencyType)); + childrenList.add(new Property("instruction", "string", "Free text or additional instructions or information pertaining to the oral diet.", 0, java.lang.Integer.MAX_VALUE, instruction)); + } + + public NutritionOrderOralDietComponent copy() { + NutritionOrderOralDietComponent dst = new NutritionOrderOralDietComponent(); + copyValues(dst); + if (type != null) { + dst.type = new ArrayList(); + for (CodeableConcept i : type) + dst.type.add(i.copy()); + }; + if (schedule != null) { + dst.schedule = new ArrayList(); + for (Timing i : schedule) + dst.schedule.add(i.copy()); + }; + if (nutrient != null) { + dst.nutrient = new ArrayList(); + for (NutritionOrderOralDietNutrientComponent i : nutrient) + dst.nutrient.add(i.copy()); + }; + if (texture != null) { + dst.texture = new ArrayList(); + for (NutritionOrderOralDietTextureComponent i : texture) + dst.texture.add(i.copy()); + }; + if (fluidConsistencyType != null) { + dst.fluidConsistencyType = new ArrayList(); + for (CodeableConcept i : fluidConsistencyType) + dst.fluidConsistencyType.add(i.copy()); + }; + dst.instruction = instruction == null ? null : instruction.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NutritionOrderOralDietComponent)) + return false; + NutritionOrderOralDietComponent o = (NutritionOrderOralDietComponent) other; + return compareDeep(type, o.type, true) && compareDeep(schedule, o.schedule, true) && compareDeep(nutrient, o.nutrient, true) + && compareDeep(texture, o.texture, true) && compareDeep(fluidConsistencyType, o.fluidConsistencyType, true) + && compareDeep(instruction, o.instruction, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NutritionOrderOralDietComponent)) + return false; + NutritionOrderOralDietComponent o = (NutritionOrderOralDietComponent) other; + return compareValues(instruction, o.instruction, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (schedule == null || schedule.isEmpty()) + && (nutrient == null || nutrient.isEmpty()) && (texture == null || texture.isEmpty()) && (fluidConsistencyType == null || fluidConsistencyType.isEmpty()) + && (instruction == null || instruction.isEmpty()); + } + + } + + @Block() + public static class NutritionOrderOralDietNutrientComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The nutrient that is being modified such as carbohydrate or sodium. + */ + @Child(name = "modifier", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Type of nutrient that is being modified", formalDefinition="The nutrient that is being modified such as carbohydrate or sodium." ) + protected CodeableConcept modifier; + + /** + * The quantity of the specified nutrient to include in diet. + */ + @Child(name = "amount", type = {Quantity.class}, order=2, min=0, max=1) + @Description(shortDefinition="Quantity of the specified nutrient", formalDefinition="The quantity of the specified nutrient to include in diet." ) + protected Quantity amount; + + private static final long serialVersionUID = 1042462093L; + + /* + * Constructor + */ + public NutritionOrderOralDietNutrientComponent() { + super(); + } + + /** + * @return {@link #modifier} (The nutrient that is being modified such as carbohydrate or sodium.) + */ + public CodeableConcept getModifier() { + if (this.modifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderOralDietNutrientComponent.modifier"); + else if (Configuration.doAutoCreate()) + this.modifier = new CodeableConcept(); // cc + return this.modifier; + } + + public boolean hasModifier() { + return this.modifier != null && !this.modifier.isEmpty(); + } + + /** + * @param value {@link #modifier} (The nutrient that is being modified such as carbohydrate or sodium.) + */ + public NutritionOrderOralDietNutrientComponent setModifier(CodeableConcept value) { + this.modifier = value; + return this; + } + + /** + * @return {@link #amount} (The quantity of the specified nutrient to include in diet.) + */ + public Quantity getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderOralDietNutrientComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Quantity(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (The quantity of the specified nutrient to include in diet.) + */ + public NutritionOrderOralDietNutrientComponent setAmount(Quantity value) { + this.amount = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("modifier", "CodeableConcept", "The nutrient that is being modified such as carbohydrate or sodium.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("amount", "Quantity", "The quantity of the specified nutrient to include in diet.", 0, java.lang.Integer.MAX_VALUE, amount)); + } + + public NutritionOrderOralDietNutrientComponent copy() { + NutritionOrderOralDietNutrientComponent dst = new NutritionOrderOralDietNutrientComponent(); + copyValues(dst); + dst.modifier = modifier == null ? null : modifier.copy(); + dst.amount = amount == null ? null : amount.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NutritionOrderOralDietNutrientComponent)) + return false; + NutritionOrderOralDietNutrientComponent o = (NutritionOrderOralDietNutrientComponent) other; + return compareDeep(modifier, o.modifier, true) && compareDeep(amount, o.amount, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NutritionOrderOralDietNutrientComponent)) + return false; + NutritionOrderOralDietNutrientComponent o = (NutritionOrderOralDietNutrientComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (modifier == null || modifier.isEmpty()) && (amount == null || amount.isEmpty()) + ; + } + + } + + @Block() + public static class NutritionOrderOralDietTextureComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed. + */ + @Child(name = "modifier", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Code to indicate how to alter the texture of the foods, e.g., pureed", formalDefinition="Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed." ) + protected CodeableConcept modifier; + + /** + * The food type(s) (e.g., meats, all foods) that the texture modification applies to. This could be all foods types. + */ + @Child(name = "foodType", type = {CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Concepts that are used to identify an entity that is ingested for nutritional purposes", formalDefinition="The food type(s) (e.g., meats, all foods) that the texture modification applies to. This could be all foods types." ) + protected CodeableConcept foodType; + + private static final long serialVersionUID = -56402817L; + + /* + * Constructor + */ + public NutritionOrderOralDietTextureComponent() { + super(); + } + + /** + * @return {@link #modifier} (Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed.) + */ + public CodeableConcept getModifier() { + if (this.modifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderOralDietTextureComponent.modifier"); + else if (Configuration.doAutoCreate()) + this.modifier = new CodeableConcept(); // cc + return this.modifier; + } + + public boolean hasModifier() { + return this.modifier != null && !this.modifier.isEmpty(); + } + + /** + * @param value {@link #modifier} (Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed.) + */ + public NutritionOrderOralDietTextureComponent setModifier(CodeableConcept value) { + this.modifier = value; + return this; + } + + /** + * @return {@link #foodType} (The food type(s) (e.g., meats, all foods) that the texture modification applies to. This could be all foods types.) + */ + public CodeableConcept getFoodType() { + if (this.foodType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderOralDietTextureComponent.foodType"); + else if (Configuration.doAutoCreate()) + this.foodType = new CodeableConcept(); // cc + return this.foodType; + } + + public boolean hasFoodType() { + return this.foodType != null && !this.foodType.isEmpty(); + } + + /** + * @param value {@link #foodType} (The food type(s) (e.g., meats, all foods) that the texture modification applies to. This could be all foods types.) + */ + public NutritionOrderOralDietTextureComponent setFoodType(CodeableConcept value) { + this.foodType = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("modifier", "CodeableConcept", "Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("foodType", "CodeableConcept", "The food type(s) (e.g., meats, all foods) that the texture modification applies to. This could be all foods types.", 0, java.lang.Integer.MAX_VALUE, foodType)); + } + + public NutritionOrderOralDietTextureComponent copy() { + NutritionOrderOralDietTextureComponent dst = new NutritionOrderOralDietTextureComponent(); + copyValues(dst); + dst.modifier = modifier == null ? null : modifier.copy(); + dst.foodType = foodType == null ? null : foodType.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NutritionOrderOralDietTextureComponent)) + return false; + NutritionOrderOralDietTextureComponent o = (NutritionOrderOralDietTextureComponent) other; + return compareDeep(modifier, o.modifier, true) && compareDeep(foodType, o.foodType, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NutritionOrderOralDietTextureComponent)) + return false; + NutritionOrderOralDietTextureComponent o = (NutritionOrderOralDietTextureComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (modifier == null || modifier.isEmpty()) && (foodType == null || foodType.isEmpty()) + ; + } + + } + + @Block() + public static class NutritionOrderSupplementComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Type of supplement product requested", formalDefinition="The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement." ) + protected CodeableConcept type; + + /** + * The product or brand name of the nutritional supplement such as "Acme Protein Shake". + */ + @Child(name = "productName", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Product or brand name of the nutritional supplement", formalDefinition="The product or brand name of the nutritional supplement such as 'Acme Protein Shake'." ) + protected StringType productName; + + /** + * The time period and frequency at which the supplement(s) should be given. + */ + @Child(name = "schedule", type = {Timing.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Scheduled frequency of supplement", formalDefinition="The time period and frequency at which the supplement(s) should be given." ) + protected List schedule; + + /** + * The amount of the nutritional supplement to be given. + */ + @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Amount of the nutritional supplement", formalDefinition="The amount of the nutritional supplement to be given." ) + protected Quantity quantity; + + /** + * Free text or additional instructions or information pertaining to the oral supplement. + */ + @Child(name = "instruction", type = {StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Instructions or additional information about the oral supplement", formalDefinition="Free text or additional instructions or information pertaining to the oral supplement." ) + protected StringType instruction; + + private static final long serialVersionUID = -37646618L; + + /* + * Constructor + */ + public NutritionOrderSupplementComponent() { + super(); + } + + /** + * @return {@link #type} (The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderSupplementComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement.) + */ + public NutritionOrderSupplementComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #productName} (The product or brand name of the nutritional supplement such as "Acme Protein Shake".). This is the underlying object with id, value and extensions. The accessor "getProductName" gives direct access to the value + */ + public StringType getProductNameElement() { + if (this.productName == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderSupplementComponent.productName"); + else if (Configuration.doAutoCreate()) + this.productName = new StringType(); // bb + return this.productName; + } + + public boolean hasProductNameElement() { + return this.productName != null && !this.productName.isEmpty(); + } + + public boolean hasProductName() { + return this.productName != null && !this.productName.isEmpty(); + } + + /** + * @param value {@link #productName} (The product or brand name of the nutritional supplement such as "Acme Protein Shake".). This is the underlying object with id, value and extensions. The accessor "getProductName" gives direct access to the value + */ + public NutritionOrderSupplementComponent setProductNameElement(StringType value) { + this.productName = value; + return this; + } + + /** + * @return The product or brand name of the nutritional supplement such as "Acme Protein Shake". + */ + public String getProductName() { + return this.productName == null ? null : this.productName.getValue(); + } + + /** + * @param value The product or brand name of the nutritional supplement such as "Acme Protein Shake". + */ + public NutritionOrderSupplementComponent setProductName(String value) { + if (Utilities.noString(value)) + this.productName = null; + else { + if (this.productName == null) + this.productName = new StringType(); + this.productName.setValue(value); + } + return this; + } + + /** + * @return {@link #schedule} (The time period and frequency at which the supplement(s) should be given.) + */ + public List getSchedule() { + if (this.schedule == null) + this.schedule = new ArrayList(); + return this.schedule; + } + + public boolean hasSchedule() { + if (this.schedule == null) + return false; + for (Timing item : this.schedule) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #schedule} (The time period and frequency at which the supplement(s) should be given.) + */ + // syntactic sugar + public Timing addSchedule() { //3 + Timing t = new Timing(); + if (this.schedule == null) + this.schedule = new ArrayList(); + this.schedule.add(t); + return t; + } + + // syntactic sugar + public NutritionOrderSupplementComponent addSchedule(Timing t) { //3 + if (t == null) + return this; + if (this.schedule == null) + this.schedule = new ArrayList(); + this.schedule.add(t); + return this; + } + + /** + * @return {@link #quantity} (The amount of the nutritional supplement to be given.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderSupplementComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of the nutritional supplement to be given.) + */ + public NutritionOrderSupplementComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #instruction} (Free text or additional instructions or information pertaining to the oral supplement.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value + */ + public StringType getInstructionElement() { + if (this.instruction == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderSupplementComponent.instruction"); + else if (Configuration.doAutoCreate()) + this.instruction = new StringType(); // bb + return this.instruction; + } + + public boolean hasInstructionElement() { + return this.instruction != null && !this.instruction.isEmpty(); + } + + public boolean hasInstruction() { + return this.instruction != null && !this.instruction.isEmpty(); + } + + /** + * @param value {@link #instruction} (Free text or additional instructions or information pertaining to the oral supplement.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value + */ + public NutritionOrderSupplementComponent setInstructionElement(StringType value) { + this.instruction = value; + return this; + } + + /** + * @return Free text or additional instructions or information pertaining to the oral supplement. + */ + public String getInstruction() { + return this.instruction == null ? null : this.instruction.getValue(); + } + + /** + * @param value Free text or additional instructions or information pertaining to the oral supplement. + */ + public NutritionOrderSupplementComponent setInstruction(String value) { + if (Utilities.noString(value)) + this.instruction = null; + else { + if (this.instruction == null) + this.instruction = new StringType(); + this.instruction.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("productName", "string", "The product or brand name of the nutritional supplement such as 'Acme Protein Shake'.", 0, java.lang.Integer.MAX_VALUE, productName)); + childrenList.add(new Property("schedule", "Timing", "The time period and frequency at which the supplement(s) should be given.", 0, java.lang.Integer.MAX_VALUE, schedule)); + childrenList.add(new Property("quantity", "Quantity", "The amount of the nutritional supplement to be given.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("instruction", "string", "Free text or additional instructions or information pertaining to the oral supplement.", 0, java.lang.Integer.MAX_VALUE, instruction)); + } + + public NutritionOrderSupplementComponent copy() { + NutritionOrderSupplementComponent dst = new NutritionOrderSupplementComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.productName = productName == null ? null : productName.copy(); + if (schedule != null) { + dst.schedule = new ArrayList(); + for (Timing i : schedule) + dst.schedule.add(i.copy()); + }; + dst.quantity = quantity == null ? null : quantity.copy(); + dst.instruction = instruction == null ? null : instruction.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NutritionOrderSupplementComponent)) + return false; + NutritionOrderSupplementComponent o = (NutritionOrderSupplementComponent) other; + return compareDeep(type, o.type, true) && compareDeep(productName, o.productName, true) && compareDeep(schedule, o.schedule, true) + && compareDeep(quantity, o.quantity, true) && compareDeep(instruction, o.instruction, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NutritionOrderSupplementComponent)) + return false; + NutritionOrderSupplementComponent o = (NutritionOrderSupplementComponent) other; + return compareValues(productName, o.productName, true) && compareValues(instruction, o.instruction, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (productName == null || productName.isEmpty()) + && (schedule == null || schedule.isEmpty()) && (quantity == null || quantity.isEmpty()) && (instruction == null || instruction.isEmpty()) + ; + } + + } + + @Block() + public static class NutritionOrderEnteralFormulaComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula. + */ + @Child(name = "baseFormulaType", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Type of enteral or infant formula", formalDefinition="The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula." ) + protected CodeableConcept baseFormulaType; + + /** + * The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula". + */ + @Child(name = "baseFormulaProductName", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Product or brand name of the enteral or infant formula", formalDefinition="The product or brand name of the enteral or infant formula product such as 'ACME Adult Standard Formula'." ) + protected StringType baseFormulaProductName; + + /** + * Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula. + */ + @Child(name = "additiveType", type = {CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Type of modular component to add to the feeding", formalDefinition="Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula." ) + protected CodeableConcept additiveType; + + /** + * The product or brand name of the type of modular component to be added to the formula. + */ + @Child(name = "additiveProductName", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Product or brand name of the modular additive", formalDefinition="The product or brand name of the type of modular component to be added to the formula." ) + protected StringType additiveProductName; + + /** + * The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL. + */ + @Child(name = "caloricDensity", type = {Quantity.class}, order=5, min=0, max=1) + @Description(shortDefinition="Amount of energy per specified volume that is required", formalDefinition="The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL." ) + protected Quantity caloricDensity; + + /** + * The route or physiological path of administration into the patient 's gastrointestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube. + */ + @Child(name = "routeofAdministration", type = {CodeableConcept.class}, order=6, min=0, max=1) + @Description(shortDefinition="How the formula should enter the patient's gastrointestinal tract", formalDefinition="The route or physiological path of administration into the patient 's gastrointestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube." ) + protected CodeableConcept routeofAdministration; + + /** + * Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding every 2 hours. + */ + @Child(name = "administration", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Formula feeding instruction as structured data", formalDefinition="Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding every 2 hours." ) + protected List administration; + + /** + * The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours. + */ + @Child(name = "maxVolumeToDeliver", type = {Quantity.class}, order=8, min=0, max=1) + @Description(shortDefinition="Upper limit on formula volume per unit of time", formalDefinition="The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours." ) + protected Quantity maxVolumeToDeliver; + + /** + * Free text formula administration, feeding instructions or additional instructions or information. + */ + @Child(name = "administrationInstruction", type = {StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Formula feeding instructions expressed as text", formalDefinition="Free text formula administration, feeding instructions or additional instructions or information." ) + protected StringType administrationInstruction; + + private static final long serialVersionUID = -124511395L; + + /* + * Constructor + */ + public NutritionOrderEnteralFormulaComponent() { + super(); + } + + /** + * @return {@link #baseFormulaType} (The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula.) + */ + public CodeableConcept getBaseFormulaType() { + if (this.baseFormulaType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.baseFormulaType"); + else if (Configuration.doAutoCreate()) + this.baseFormulaType = new CodeableConcept(); // cc + return this.baseFormulaType; + } + + public boolean hasBaseFormulaType() { + return this.baseFormulaType != null && !this.baseFormulaType.isEmpty(); + } + + /** + * @param value {@link #baseFormulaType} (The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula.) + */ + public NutritionOrderEnteralFormulaComponent setBaseFormulaType(CodeableConcept value) { + this.baseFormulaType = value; + return this; + } + + /** + * @return {@link #baseFormulaProductName} (The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula".). This is the underlying object with id, value and extensions. The accessor "getBaseFormulaProductName" gives direct access to the value + */ + public StringType getBaseFormulaProductNameElement() { + if (this.baseFormulaProductName == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.baseFormulaProductName"); + else if (Configuration.doAutoCreate()) + this.baseFormulaProductName = new StringType(); // bb + return this.baseFormulaProductName; + } + + public boolean hasBaseFormulaProductNameElement() { + return this.baseFormulaProductName != null && !this.baseFormulaProductName.isEmpty(); + } + + public boolean hasBaseFormulaProductName() { + return this.baseFormulaProductName != null && !this.baseFormulaProductName.isEmpty(); + } + + /** + * @param value {@link #baseFormulaProductName} (The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula".). This is the underlying object with id, value and extensions. The accessor "getBaseFormulaProductName" gives direct access to the value + */ + public NutritionOrderEnteralFormulaComponent setBaseFormulaProductNameElement(StringType value) { + this.baseFormulaProductName = value; + return this; + } + + /** + * @return The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula". + */ + public String getBaseFormulaProductName() { + return this.baseFormulaProductName == null ? null : this.baseFormulaProductName.getValue(); + } + + /** + * @param value The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula". + */ + public NutritionOrderEnteralFormulaComponent setBaseFormulaProductName(String value) { + if (Utilities.noString(value)) + this.baseFormulaProductName = null; + else { + if (this.baseFormulaProductName == null) + this.baseFormulaProductName = new StringType(); + this.baseFormulaProductName.setValue(value); + } + return this; + } + + /** + * @return {@link #additiveType} (Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.) + */ + public CodeableConcept getAdditiveType() { + if (this.additiveType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.additiveType"); + else if (Configuration.doAutoCreate()) + this.additiveType = new CodeableConcept(); // cc + return this.additiveType; + } + + public boolean hasAdditiveType() { + return this.additiveType != null && !this.additiveType.isEmpty(); + } + + /** + * @param value {@link #additiveType} (Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.) + */ + public NutritionOrderEnteralFormulaComponent setAdditiveType(CodeableConcept value) { + this.additiveType = value; + return this; + } + + /** + * @return {@link #additiveProductName} (The product or brand name of the type of modular component to be added to the formula.). This is the underlying object with id, value and extensions. The accessor "getAdditiveProductName" gives direct access to the value + */ + public StringType getAdditiveProductNameElement() { + if (this.additiveProductName == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.additiveProductName"); + else if (Configuration.doAutoCreate()) + this.additiveProductName = new StringType(); // bb + return this.additiveProductName; + } + + public boolean hasAdditiveProductNameElement() { + return this.additiveProductName != null && !this.additiveProductName.isEmpty(); + } + + public boolean hasAdditiveProductName() { + return this.additiveProductName != null && !this.additiveProductName.isEmpty(); + } + + /** + * @param value {@link #additiveProductName} (The product or brand name of the type of modular component to be added to the formula.). This is the underlying object with id, value and extensions. The accessor "getAdditiveProductName" gives direct access to the value + */ + public NutritionOrderEnteralFormulaComponent setAdditiveProductNameElement(StringType value) { + this.additiveProductName = value; + return this; + } + + /** + * @return The product or brand name of the type of modular component to be added to the formula. + */ + public String getAdditiveProductName() { + return this.additiveProductName == null ? null : this.additiveProductName.getValue(); + } + + /** + * @param value The product or brand name of the type of modular component to be added to the formula. + */ + public NutritionOrderEnteralFormulaComponent setAdditiveProductName(String value) { + if (Utilities.noString(value)) + this.additiveProductName = null; + else { + if (this.additiveProductName == null) + this.additiveProductName = new StringType(); + this.additiveProductName.setValue(value); + } + return this; + } + + /** + * @return {@link #caloricDensity} (The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL.) + */ + public Quantity getCaloricDensity() { + if (this.caloricDensity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.caloricDensity"); + else if (Configuration.doAutoCreate()) + this.caloricDensity = new Quantity(); // cc + return this.caloricDensity; + } + + public boolean hasCaloricDensity() { + return this.caloricDensity != null && !this.caloricDensity.isEmpty(); + } + + /** + * @param value {@link #caloricDensity} (The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL.) + */ + public NutritionOrderEnteralFormulaComponent setCaloricDensity(Quantity value) { + this.caloricDensity = value; + return this; + } + + /** + * @return {@link #routeofAdministration} (The route or physiological path of administration into the patient 's gastrointestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube.) + */ + public CodeableConcept getRouteofAdministration() { + if (this.routeofAdministration == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.routeofAdministration"); + else if (Configuration.doAutoCreate()) + this.routeofAdministration = new CodeableConcept(); // cc + return this.routeofAdministration; + } + + public boolean hasRouteofAdministration() { + return this.routeofAdministration != null && !this.routeofAdministration.isEmpty(); + } + + /** + * @param value {@link #routeofAdministration} (The route or physiological path of administration into the patient 's gastrointestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube.) + */ + public NutritionOrderEnteralFormulaComponent setRouteofAdministration(CodeableConcept value) { + this.routeofAdministration = value; + return this; + } + + /** + * @return {@link #administration} (Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding every 2 hours.) + */ + public List getAdministration() { + if (this.administration == null) + this.administration = new ArrayList(); + return this.administration; + } + + public boolean hasAdministration() { + if (this.administration == null) + return false; + for (NutritionOrderEnteralFormulaAdministrationComponent item : this.administration) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #administration} (Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding every 2 hours.) + */ + // syntactic sugar + public NutritionOrderEnteralFormulaAdministrationComponent addAdministration() { //3 + NutritionOrderEnteralFormulaAdministrationComponent t = new NutritionOrderEnteralFormulaAdministrationComponent(); + if (this.administration == null) + this.administration = new ArrayList(); + this.administration.add(t); + return t; + } + + // syntactic sugar + public NutritionOrderEnteralFormulaComponent addAdministration(NutritionOrderEnteralFormulaAdministrationComponent t) { //3 + if (t == null) + return this; + if (this.administration == null) + this.administration = new ArrayList(); + this.administration.add(t); + return this; + } + + /** + * @return {@link #maxVolumeToDeliver} (The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours.) + */ + public Quantity getMaxVolumeToDeliver() { + if (this.maxVolumeToDeliver == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.maxVolumeToDeliver"); + else if (Configuration.doAutoCreate()) + this.maxVolumeToDeliver = new Quantity(); // cc + return this.maxVolumeToDeliver; + } + + public boolean hasMaxVolumeToDeliver() { + return this.maxVolumeToDeliver != null && !this.maxVolumeToDeliver.isEmpty(); + } + + /** + * @param value {@link #maxVolumeToDeliver} (The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours.) + */ + public NutritionOrderEnteralFormulaComponent setMaxVolumeToDeliver(Quantity value) { + this.maxVolumeToDeliver = value; + return this; + } + + /** + * @return {@link #administrationInstruction} (Free text formula administration, feeding instructions or additional instructions or information.). This is the underlying object with id, value and extensions. The accessor "getAdministrationInstruction" gives direct access to the value + */ + public StringType getAdministrationInstructionElement() { + if (this.administrationInstruction == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.administrationInstruction"); + else if (Configuration.doAutoCreate()) + this.administrationInstruction = new StringType(); // bb + return this.administrationInstruction; + } + + public boolean hasAdministrationInstructionElement() { + return this.administrationInstruction != null && !this.administrationInstruction.isEmpty(); + } + + public boolean hasAdministrationInstruction() { + return this.administrationInstruction != null && !this.administrationInstruction.isEmpty(); + } + + /** + * @param value {@link #administrationInstruction} (Free text formula administration, feeding instructions or additional instructions or information.). This is the underlying object with id, value and extensions. The accessor "getAdministrationInstruction" gives direct access to the value + */ + public NutritionOrderEnteralFormulaComponent setAdministrationInstructionElement(StringType value) { + this.administrationInstruction = value; + return this; + } + + /** + * @return Free text formula administration, feeding instructions or additional instructions or information. + */ + public String getAdministrationInstruction() { + return this.administrationInstruction == null ? null : this.administrationInstruction.getValue(); + } + + /** + * @param value Free text formula administration, feeding instructions or additional instructions or information. + */ + public NutritionOrderEnteralFormulaComponent setAdministrationInstruction(String value) { + if (Utilities.noString(value)) + this.administrationInstruction = null; + else { + if (this.administrationInstruction == null) + this.administrationInstruction = new StringType(); + this.administrationInstruction.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("baseFormulaType", "CodeableConcept", "The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula.", 0, java.lang.Integer.MAX_VALUE, baseFormulaType)); + childrenList.add(new Property("baseFormulaProductName", "string", "The product or brand name of the enteral or infant formula product such as 'ACME Adult Standard Formula'.", 0, java.lang.Integer.MAX_VALUE, baseFormulaProductName)); + childrenList.add(new Property("additiveType", "CodeableConcept", "Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.", 0, java.lang.Integer.MAX_VALUE, additiveType)); + childrenList.add(new Property("additiveProductName", "string", "The product or brand name of the type of modular component to be added to the formula.", 0, java.lang.Integer.MAX_VALUE, additiveProductName)); + childrenList.add(new Property("caloricDensity", "Quantity", "The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL.", 0, java.lang.Integer.MAX_VALUE, caloricDensity)); + childrenList.add(new Property("routeofAdministration", "CodeableConcept", "The route or physiological path of administration into the patient 's gastrointestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube.", 0, java.lang.Integer.MAX_VALUE, routeofAdministration)); + childrenList.add(new Property("administration", "", "Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding every 2 hours.", 0, java.lang.Integer.MAX_VALUE, administration)); + childrenList.add(new Property("maxVolumeToDeliver", "Quantity", "The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxVolumeToDeliver)); + childrenList.add(new Property("administrationInstruction", "string", "Free text formula administration, feeding instructions or additional instructions or information.", 0, java.lang.Integer.MAX_VALUE, administrationInstruction)); + } + + public NutritionOrderEnteralFormulaComponent copy() { + NutritionOrderEnteralFormulaComponent dst = new NutritionOrderEnteralFormulaComponent(); + copyValues(dst); + dst.baseFormulaType = baseFormulaType == null ? null : baseFormulaType.copy(); + dst.baseFormulaProductName = baseFormulaProductName == null ? null : baseFormulaProductName.copy(); + dst.additiveType = additiveType == null ? null : additiveType.copy(); + dst.additiveProductName = additiveProductName == null ? null : additiveProductName.copy(); + dst.caloricDensity = caloricDensity == null ? null : caloricDensity.copy(); + dst.routeofAdministration = routeofAdministration == null ? null : routeofAdministration.copy(); + if (administration != null) { + dst.administration = new ArrayList(); + for (NutritionOrderEnteralFormulaAdministrationComponent i : administration) + dst.administration.add(i.copy()); + }; + dst.maxVolumeToDeliver = maxVolumeToDeliver == null ? null : maxVolumeToDeliver.copy(); + dst.administrationInstruction = administrationInstruction == null ? null : administrationInstruction.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NutritionOrderEnteralFormulaComponent)) + return false; + NutritionOrderEnteralFormulaComponent o = (NutritionOrderEnteralFormulaComponent) other; + return compareDeep(baseFormulaType, o.baseFormulaType, true) && compareDeep(baseFormulaProductName, o.baseFormulaProductName, true) + && compareDeep(additiveType, o.additiveType, true) && compareDeep(additiveProductName, o.additiveProductName, true) + && compareDeep(caloricDensity, o.caloricDensity, true) && compareDeep(routeofAdministration, o.routeofAdministration, true) + && compareDeep(administration, o.administration, true) && compareDeep(maxVolumeToDeliver, o.maxVolumeToDeliver, true) + && compareDeep(administrationInstruction, o.administrationInstruction, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NutritionOrderEnteralFormulaComponent)) + return false; + NutritionOrderEnteralFormulaComponent o = (NutritionOrderEnteralFormulaComponent) other; + return compareValues(baseFormulaProductName, o.baseFormulaProductName, true) && compareValues(additiveProductName, o.additiveProductName, true) + && compareValues(administrationInstruction, o.administrationInstruction, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (baseFormulaType == null || baseFormulaType.isEmpty()) && (baseFormulaProductName == null || baseFormulaProductName.isEmpty()) + && (additiveType == null || additiveType.isEmpty()) && (additiveProductName == null || additiveProductName.isEmpty()) + && (caloricDensity == null || caloricDensity.isEmpty()) && (routeofAdministration == null || routeofAdministration.isEmpty()) + && (administration == null || administration.isEmpty()) && (maxVolumeToDeliver == null || maxVolumeToDeliver.isEmpty()) + && (administrationInstruction == null || administrationInstruction.isEmpty()); + } + + } + + @Block() + public static class NutritionOrderEnteralFormulaAdministrationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The time period and frequency at which the enteral formula should be delivered to the patient. + */ + @Child(name = "schedule", type = {Timing.class}, order=1, min=0, max=1) + @Description(shortDefinition="Scheduled frequency of enteral feeding", formalDefinition="The time period and frequency at which the enteral formula should be delivered to the patient." ) + protected Timing schedule; + + /** + * The volume of formula to provide to the patient per the specified administration schedule. + */ + @Child(name = "quantity", type = {Quantity.class}, order=2, min=0, max=1) + @Description(shortDefinition="The volume of formula to provide", formalDefinition="The volume of formula to provide to the patient per the specified administration schedule." ) + protected Quantity quantity; + + /** + * The rate of administration of formula via a feeding pump, e.g., 60 mL per hour, according to the specified schedule. + */ + @Child(name = "rate", type = {Quantity.class, Ratio.class}, order=3, min=0, max=1) + @Description(shortDefinition="Speed with which the formula is provided per period of time", formalDefinition="The rate of administration of formula via a feeding pump, e.g., 60 mL per hour, according to the specified schedule." ) + protected Type rate; + + private static final long serialVersionUID = 673093291L; + + /* + * Constructor + */ + public NutritionOrderEnteralFormulaAdministrationComponent() { + super(); + } + + /** + * @return {@link #schedule} (The time period and frequency at which the enteral formula should be delivered to the patient.) + */ + public Timing getSchedule() { + if (this.schedule == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaAdministrationComponent.schedule"); + else if (Configuration.doAutoCreate()) + this.schedule = new Timing(); // cc + return this.schedule; + } + + public boolean hasSchedule() { + return this.schedule != null && !this.schedule.isEmpty(); + } + + /** + * @param value {@link #schedule} (The time period and frequency at which the enteral formula should be delivered to the patient.) + */ + public NutritionOrderEnteralFormulaAdministrationComponent setSchedule(Timing value) { + this.schedule = value; + return this; + } + + /** + * @return {@link #quantity} (The volume of formula to provide to the patient per the specified administration schedule.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaAdministrationComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The volume of formula to provide to the patient per the specified administration schedule.) + */ + public NutritionOrderEnteralFormulaAdministrationComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #rate} (The rate of administration of formula via a feeding pump, e.g., 60 mL per hour, according to the specified schedule.) + */ + public Type getRate() { + return this.rate; + } + + /** + * @return {@link #rate} (The rate of administration of formula via a feeding pump, e.g., 60 mL per hour, according to the specified schedule.) + */ + public Quantity getRateQuantity() throws Exception { + if (!(this.rate instanceof Quantity)) + throw new Exception("Type mismatch: the type Quantity was expected, but "+this.rate.getClass().getName()+" was encountered"); + return (Quantity) this.rate; + } + + /** + * @return {@link #rate} (The rate of administration of formula via a feeding pump, e.g., 60 mL per hour, according to the specified schedule.) + */ + public Ratio getRateRatio() throws Exception { + if (!(this.rate instanceof Ratio)) + throw new Exception("Type mismatch: the type Ratio was expected, but "+this.rate.getClass().getName()+" was encountered"); + return (Ratio) this.rate; + } + + public boolean hasRate() { + return this.rate != null && !this.rate.isEmpty(); + } + + /** + * @param value {@link #rate} (The rate of administration of formula via a feeding pump, e.g., 60 mL per hour, according to the specified schedule.) + */ + public NutritionOrderEnteralFormulaAdministrationComponent setRate(Type value) { + this.rate = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("schedule", "Timing", "The time period and frequency at which the enteral formula should be delivered to the patient.", 0, java.lang.Integer.MAX_VALUE, schedule)); + childrenList.add(new Property("quantity", "Quantity", "The volume of formula to provide to the patient per the specified administration schedule.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("rate[x]", "Quantity|Ratio", "The rate of administration of formula via a feeding pump, e.g., 60 mL per hour, according to the specified schedule.", 0, java.lang.Integer.MAX_VALUE, rate)); + } + + public NutritionOrderEnteralFormulaAdministrationComponent copy() { + NutritionOrderEnteralFormulaAdministrationComponent dst = new NutritionOrderEnteralFormulaAdministrationComponent(); + copyValues(dst); + dst.schedule = schedule == null ? null : schedule.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.rate = rate == null ? null : rate.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NutritionOrderEnteralFormulaAdministrationComponent)) + return false; + NutritionOrderEnteralFormulaAdministrationComponent o = (NutritionOrderEnteralFormulaAdministrationComponent) other; + return compareDeep(schedule, o.schedule, true) && compareDeep(quantity, o.quantity, true) && compareDeep(rate, o.rate, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NutritionOrderEnteralFormulaAdministrationComponent)) + return false; + NutritionOrderEnteralFormulaAdministrationComponent o = (NutritionOrderEnteralFormulaAdministrationComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (schedule == null || schedule.isEmpty()) && (quantity == null || quantity.isEmpty()) + && (rate == null || rate.isEmpty()); + } + + } + + /** + * The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding. + */ + @Child(name = "patient", type = {Patient.class}, order=0, min=1, max=1) + @Description(shortDefinition="The person who requires the diet, formula or nutritional supplement", formalDefinition="The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) + */ + protected Patient patientTarget; + + /** + * The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings. + */ + @Child(name = "orderer", type = {Practitioner.class}, order=1, min=0, max=1) + @Description(shortDefinition="Who ordered the diet, formula or nutritional supplement", formalDefinition="The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings." ) + protected Reference orderer; + + /** + * The actual object that is the target of the reference (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) + */ + protected Practitioner ordererTarget; + + /** + * Identifiers assigned to this order by the order sender or by the order receiver. + */ + @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Identifiers assigned to this order", formalDefinition="Identifiers assigned to this order by the order sender or by the order receiver." ) + protected List identifier; + + /** + * An encounter that provides additional information about the healthcare context in which this request is made. + */ + @Child(name = "encounter", type = {Encounter.class}, order=3, min=0, max=1) + @Description(shortDefinition="The encounter associated with that this nutrition order", formalDefinition="An encounter that provides additional information about the healthcare context in which this request is made." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + protected Encounter encounterTarget; + + /** + * The date and time that this nutrition order was requested. + */ + @Child(name = "dateTime", type = {DateTimeType.class}, order=4, min=1, max=1) + @Description(shortDefinition="Date and time the nutrition order was requested", formalDefinition="The date and time that this nutrition order was requested." ) + protected DateTimeType dateTime; + + /** + * The workflow status of the nutrition order/request. + */ + @Child(name = "status", type = {CodeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="proposed | draft | planned | requested | active | on-hold | completed | cancelled", formalDefinition="The workflow status of the nutrition order/request." ) + protected Enumeration status; + + /** + * A link to a record of allergies or Intolerances which should be included in the nutrition order. + */ + @Child(name = "allergyIntolerance", type = {AllergyIntolerance.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of the patient's food and nutrition-related allergies and intolerances", formalDefinition="A link to a record of allergies or Intolerances which should be included in the nutrition order." ) + protected List allergyIntolerance; + /** + * The actual objects that are the target of the reference (A link to a record of allergies or Intolerances which should be included in the nutrition order.) + */ + protected List allergyIntoleranceTarget; + + + /** + * This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings. + */ + @Child(name = "foodPreferenceModifier", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Order-specific modifier about the type of food that should be given", formalDefinition="This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings." ) + protected List foodPreferenceModifier; + + /** + * This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings. + */ + @Child(name = "excludeFoodModifier", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Order-specific modifier about the type of food that should not be given", formalDefinition="This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings." ) + protected List excludeFoodModifier; + + /** + * Diet given orally in contrast to enteral (tube) feeding. + */ + @Child(name = "oralDiet", type = {}, order=9, min=0, max=1) + @Description(shortDefinition="Oral diet components", formalDefinition="Diet given orally in contrast to enteral (tube) feeding." ) + protected NutritionOrderOralDietComponent oralDiet; + + /** + * Oral nutritional products given in order to add further nutritional value to the patient's diet. + */ + @Child(name = "supplement", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Supplement components", formalDefinition="Oral nutritional products given in order to add further nutritional value to the patient's diet." ) + protected List supplement; + + /** + * Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity. + */ + @Child(name = "enteralFormula", type = {}, order=11, min=0, max=1) + @Description(shortDefinition="Enteral formula components", formalDefinition="Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity." ) + protected NutritionOrderEnteralFormulaComponent enteralFormula; + + private static final long serialVersionUID = 1139624085L; + + /* + * Constructor + */ + public NutritionOrder() { + super(); + } + + /* + * Constructor + */ + public NutritionOrder(Reference patient, DateTimeType dateTime) { + super(); + this.patient = patient; + this.dateTime = dateTime; + } + + /** + * @return {@link #patient} (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) + */ + public NutritionOrder setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) + */ + public NutritionOrder setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #orderer} (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) + */ + public Reference getOrderer() { + if (this.orderer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.orderer"); + else if (Configuration.doAutoCreate()) + this.orderer = new Reference(); // cc + return this.orderer; + } + + public boolean hasOrderer() { + return this.orderer != null && !this.orderer.isEmpty(); + } + + /** + * @param value {@link #orderer} (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) + */ + public NutritionOrder setOrderer(Reference value) { + this.orderer = value; + return this; + } + + /** + * @return {@link #orderer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) + */ + public Practitioner getOrdererTarget() { + if (this.ordererTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.orderer"); + else if (Configuration.doAutoCreate()) + this.ordererTarget = new Practitioner(); // aa + return this.ordererTarget; + } + + /** + * @param value {@link #orderer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) + */ + public NutritionOrder setOrdererTarget(Practitioner value) { + this.ordererTarget = value; + return this; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order by the order sender or by the order receiver.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order by the order sender or by the order receiver.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public NutritionOrder addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + public NutritionOrder setEncounter(Reference value) { + this.encounter = value; + return this; + } + + /** + * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + return this.encounterTarget; + } + + /** + * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + public NutritionOrder setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #dateTime} (The date and time that this nutrition order was requested.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public DateTimeType getDateTimeElement() { + if (this.dateTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.dateTime"); + else if (Configuration.doAutoCreate()) + this.dateTime = new DateTimeType(); // bb + return this.dateTime; + } + + public boolean hasDateTimeElement() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + public boolean hasDateTime() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + /** + * @param value {@link #dateTime} (The date and time that this nutrition order was requested.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public NutritionOrder setDateTimeElement(DateTimeType value) { + this.dateTime = value; + return this; + } + + /** + * @return The date and time that this nutrition order was requested. + */ + public Date getDateTime() { + return this.dateTime == null ? null : this.dateTime.getValue(); + } + + /** + * @param value The date and time that this nutrition order was requested. + */ + public NutritionOrder setDateTime(Date value) { + if (this.dateTime == null) + this.dateTime = new DateTimeType(); + this.dateTime.setValue(value); + return this; + } + + /** + * @return {@link #status} (The workflow status of the nutrition order/request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new NutritionOrderStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The workflow status of the nutrition order/request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public NutritionOrder setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The workflow status of the nutrition order/request. + */ + public NutritionOrderStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The workflow status of the nutrition order/request. + */ + public NutritionOrder setStatus(NutritionOrderStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new NutritionOrderStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #allergyIntolerance} (A link to a record of allergies or Intolerances which should be included in the nutrition order.) + */ + public List getAllergyIntolerance() { + if (this.allergyIntolerance == null) + this.allergyIntolerance = new ArrayList(); + return this.allergyIntolerance; + } + + public boolean hasAllergyIntolerance() { + if (this.allergyIntolerance == null) + return false; + for (Reference item : this.allergyIntolerance) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #allergyIntolerance} (A link to a record of allergies or Intolerances which should be included in the nutrition order.) + */ + // syntactic sugar + public Reference addAllergyIntolerance() { //3 + Reference t = new Reference(); + if (this.allergyIntolerance == null) + this.allergyIntolerance = new ArrayList(); + this.allergyIntolerance.add(t); + return t; + } + + // syntactic sugar + public NutritionOrder addAllergyIntolerance(Reference t) { //3 + if (t == null) + return this; + if (this.allergyIntolerance == null) + this.allergyIntolerance = new ArrayList(); + this.allergyIntolerance.add(t); + return this; + } + + /** + * @return {@link #allergyIntolerance} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A link to a record of allergies or Intolerances which should be included in the nutrition order.) + */ + public List getAllergyIntoleranceTarget() { + if (this.allergyIntoleranceTarget == null) + this.allergyIntoleranceTarget = new ArrayList(); + return this.allergyIntoleranceTarget; + } + + // syntactic sugar + /** + * @return {@link #allergyIntolerance} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. A link to a record of allergies or Intolerances which should be included in the nutrition order.) + */ + public AllergyIntolerance addAllergyIntoleranceTarget() { + AllergyIntolerance r = new AllergyIntolerance(); + if (this.allergyIntoleranceTarget == null) + this.allergyIntoleranceTarget = new ArrayList(); + this.allergyIntoleranceTarget.add(r); + return r; + } + + /** + * @return {@link #foodPreferenceModifier} (This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) + */ + public List getFoodPreferenceModifier() { + if (this.foodPreferenceModifier == null) + this.foodPreferenceModifier = new ArrayList(); + return this.foodPreferenceModifier; + } + + public boolean hasFoodPreferenceModifier() { + if (this.foodPreferenceModifier == null) + return false; + for (CodeableConcept item : this.foodPreferenceModifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #foodPreferenceModifier} (This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) + */ + // syntactic sugar + public CodeableConcept addFoodPreferenceModifier() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.foodPreferenceModifier == null) + this.foodPreferenceModifier = new ArrayList(); + this.foodPreferenceModifier.add(t); + return t; + } + + // syntactic sugar + public NutritionOrder addFoodPreferenceModifier(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.foodPreferenceModifier == null) + this.foodPreferenceModifier = new ArrayList(); + this.foodPreferenceModifier.add(t); + return this; + } + + /** + * @return {@link #excludeFoodModifier} (This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) + */ + public List getExcludeFoodModifier() { + if (this.excludeFoodModifier == null) + this.excludeFoodModifier = new ArrayList(); + return this.excludeFoodModifier; + } + + public boolean hasExcludeFoodModifier() { + if (this.excludeFoodModifier == null) + return false; + for (CodeableConcept item : this.excludeFoodModifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #excludeFoodModifier} (This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) + */ + // syntactic sugar + public CodeableConcept addExcludeFoodModifier() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.excludeFoodModifier == null) + this.excludeFoodModifier = new ArrayList(); + this.excludeFoodModifier.add(t); + return t; + } + + // syntactic sugar + public NutritionOrder addExcludeFoodModifier(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.excludeFoodModifier == null) + this.excludeFoodModifier = new ArrayList(); + this.excludeFoodModifier.add(t); + return this; + } + + /** + * @return {@link #oralDiet} (Diet given orally in contrast to enteral (tube) feeding.) + */ + public NutritionOrderOralDietComponent getOralDiet() { + if (this.oralDiet == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.oralDiet"); + else if (Configuration.doAutoCreate()) + this.oralDiet = new NutritionOrderOralDietComponent(); // cc + return this.oralDiet; + } + + public boolean hasOralDiet() { + return this.oralDiet != null && !this.oralDiet.isEmpty(); + } + + /** + * @param value {@link #oralDiet} (Diet given orally in contrast to enteral (tube) feeding.) + */ + public NutritionOrder setOralDiet(NutritionOrderOralDietComponent value) { + this.oralDiet = value; + return this; + } + + /** + * @return {@link #supplement} (Oral nutritional products given in order to add further nutritional value to the patient's diet.) + */ + public List getSupplement() { + if (this.supplement == null) + this.supplement = new ArrayList(); + return this.supplement; + } + + public boolean hasSupplement() { + if (this.supplement == null) + return false; + for (NutritionOrderSupplementComponent item : this.supplement) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #supplement} (Oral nutritional products given in order to add further nutritional value to the patient's diet.) + */ + // syntactic sugar + public NutritionOrderSupplementComponent addSupplement() { //3 + NutritionOrderSupplementComponent t = new NutritionOrderSupplementComponent(); + if (this.supplement == null) + this.supplement = new ArrayList(); + this.supplement.add(t); + return t; + } + + // syntactic sugar + public NutritionOrder addSupplement(NutritionOrderSupplementComponent t) { //3 + if (t == null) + return this; + if (this.supplement == null) + this.supplement = new ArrayList(); + this.supplement.add(t); + return this; + } + + /** + * @return {@link #enteralFormula} (Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity.) + */ + public NutritionOrderEnteralFormulaComponent getEnteralFormula() { + if (this.enteralFormula == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.enteralFormula"); + else if (Configuration.doAutoCreate()) + this.enteralFormula = new NutritionOrderEnteralFormulaComponent(); // cc + return this.enteralFormula; + } + + public boolean hasEnteralFormula() { + return this.enteralFormula != null && !this.enteralFormula.isEmpty(); + } + + /** + * @param value {@link #enteralFormula} (Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity.) + */ + public NutritionOrder setEnteralFormula(NutritionOrderEnteralFormulaComponent value) { + this.enteralFormula = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("patient", "Reference(Patient)", "The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("orderer", "Reference(Practitioner)", "The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.", 0, java.lang.Integer.MAX_VALUE, orderer)); + childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the order sender or by the order receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional information about the healthcare context in which this request is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("dateTime", "dateTime", "The date and time that this nutrition order was requested.", 0, java.lang.Integer.MAX_VALUE, dateTime)); + childrenList.add(new Property("status", "code", "The workflow status of the nutrition order/request.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("allergyIntolerance", "Reference(AllergyIntolerance)", "A link to a record of allergies or Intolerances which should be included in the nutrition order.", 0, java.lang.Integer.MAX_VALUE, allergyIntolerance)); + childrenList.add(new Property("foodPreferenceModifier", "CodeableConcept", "This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.", 0, java.lang.Integer.MAX_VALUE, foodPreferenceModifier)); + childrenList.add(new Property("excludeFoodModifier", "CodeableConcept", "This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.", 0, java.lang.Integer.MAX_VALUE, excludeFoodModifier)); + childrenList.add(new Property("oralDiet", "", "Diet given orally in contrast to enteral (tube) feeding.", 0, java.lang.Integer.MAX_VALUE, oralDiet)); + childrenList.add(new Property("supplement", "", "Oral nutritional products given in order to add further nutritional value to the patient's diet.", 0, java.lang.Integer.MAX_VALUE, supplement)); + childrenList.add(new Property("enteralFormula", "", "Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity.", 0, java.lang.Integer.MAX_VALUE, enteralFormula)); + } + + public NutritionOrder copy() { + NutritionOrder dst = new NutritionOrder(); + copyValues(dst); + dst.patient = patient == null ? null : patient.copy(); + dst.orderer = orderer == null ? null : orderer.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.encounter = encounter == null ? null : encounter.copy(); + dst.dateTime = dateTime == null ? null : dateTime.copy(); + dst.status = status == null ? null : status.copy(); + if (allergyIntolerance != null) { + dst.allergyIntolerance = new ArrayList(); + for (Reference i : allergyIntolerance) + dst.allergyIntolerance.add(i.copy()); + }; + if (foodPreferenceModifier != null) { + dst.foodPreferenceModifier = new ArrayList(); + for (CodeableConcept i : foodPreferenceModifier) + dst.foodPreferenceModifier.add(i.copy()); + }; + if (excludeFoodModifier != null) { + dst.excludeFoodModifier = new ArrayList(); + for (CodeableConcept i : excludeFoodModifier) + dst.excludeFoodModifier.add(i.copy()); + }; + dst.oralDiet = oralDiet == null ? null : oralDiet.copy(); + if (supplement != null) { + dst.supplement = new ArrayList(); + for (NutritionOrderSupplementComponent i : supplement) + dst.supplement.add(i.copy()); + }; + dst.enteralFormula = enteralFormula == null ? null : enteralFormula.copy(); + return dst; + } + + protected NutritionOrder typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NutritionOrder)) + return false; + NutritionOrder o = (NutritionOrder) other; + return compareDeep(patient, o.patient, true) && compareDeep(orderer, o.orderer, true) && compareDeep(identifier, o.identifier, true) + && compareDeep(encounter, o.encounter, true) && compareDeep(dateTime, o.dateTime, true) && compareDeep(status, o.status, true) + && compareDeep(allergyIntolerance, o.allergyIntolerance, true) && compareDeep(foodPreferenceModifier, o.foodPreferenceModifier, true) + && compareDeep(excludeFoodModifier, o.excludeFoodModifier, true) && compareDeep(oralDiet, o.oralDiet, true) + && compareDeep(supplement, o.supplement, true) && compareDeep(enteralFormula, o.enteralFormula, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NutritionOrder)) + return false; + NutritionOrder o = (NutritionOrder) other; + return compareValues(dateTime, o.dateTime, true) && compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (patient == null || patient.isEmpty()) && (orderer == null || orderer.isEmpty()) + && (identifier == null || identifier.isEmpty()) && (encounter == null || encounter.isEmpty()) + && (dateTime == null || dateTime.isEmpty()) && (status == null || status.isEmpty()) && (allergyIntolerance == null || allergyIntolerance.isEmpty()) + && (foodPreferenceModifier == null || foodPreferenceModifier.isEmpty()) && (excludeFoodModifier == null || excludeFoodModifier.isEmpty()) + && (oralDiet == null || oralDiet.isEmpty()) && (supplement == null || supplement.isEmpty()) + && (enteralFormula == null || enteralFormula.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.NutritionOrder; + } + + @SearchParamDefinition(name="identifier", path="NutritionOrder.identifier", description="Return nutrition orders with this external identity", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="datetime", path="NutritionOrder.dateTime", description="Return nutrition orders requested on this date", type="date" ) + public static final String SP_DATETIME = "datetime"; + @SearchParamDefinition(name="provider", path="NutritionOrder.orderer", description="The identify of the provider who placed the nutrition order", type="reference" ) + public static final String SP_PROVIDER = "provider"; + @SearchParamDefinition(name="patient", path="NutritionOrder.patient", description="The identity of the person who requires the diet, formula or nutritional supplement", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="supplement", path="NutritionOrder.supplement.type", description="Type of supplement product requested", type="token" ) + public static final String SP_SUPPLEMENT = "supplement"; + @SearchParamDefinition(name="formula", path="NutritionOrder.enteralFormula.baseFormulaType", description="Type of enteral or infant formula", type="token" ) + public static final String SP_FORMULA = "formula"; + @SearchParamDefinition(name="encounter", path="NutritionOrder.encounter", description="Return nutrition orders with this encounter identity", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + @SearchParamDefinition(name="oraldiet", path="NutritionOrder.oralDiet.type", description="Type of diet that can be consumed orally (i.e., take via the mouth).", type="token" ) + public static final String SP_ORALDIET = "oraldiet"; + @SearchParamDefinition(name="status", path="NutritionOrder.status", description="Status of the nutrition order.", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="additive", path="NutritionOrder.enteralFormula.additiveType", description="Type of module component to add to the feeding", type="token" ) + public static final String SP_ADDITIVE = "additive"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Observation.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Observation.java index f056ab60187..ee228134c13 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Observation.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Observation.java @@ -1,2050 +1,2466 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Measurements and simple assertions made about a patient, device or other subject. - */ -@ResourceDef(name="Observation", profile="http://hl7.org/fhir/Profile/Observation") -public class Observation extends DomainResource { - - public enum ObservationStatus { - /** - * The existence of the observation is registered, but there is no result yet available. - */ - REGISTERED, - /** - * This is an initial or interim observation: data may be incomplete or unverified. - */ - PRELIMINARY, - /** - * The observation is complete and verified by an authorized person. - */ - FINAL, - /** - * The observation has been modified subsequent to being Final, and is complete and verified by an authorized person. - */ - AMENDED, - /** - * The observation is unavailable because the measurement was not started or not completed (also sometimes called "aborted"). - */ - CANCELLED, - /** - * The observation has been withdrawn following previous Final release. - */ - ENTEREDINERROR, - /** - * The observation status is unknown. Note that "unknown" is a value of last resort and every attempt should be made to provide a meaningful value other than "unknown". - */ - UNKNOWN, - /** - * added to help the parsers - */ - NULL; - public static ObservationStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("registered".equals(codeString)) - return REGISTERED; - if ("preliminary".equals(codeString)) - return PRELIMINARY; - if ("final".equals(codeString)) - return FINAL; - if ("amended".equals(codeString)) - return AMENDED; - if ("cancelled".equals(codeString)) - return CANCELLED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - if ("unknown".equals(codeString)) - return UNKNOWN; - throw new Exception("Unknown ObservationStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case REGISTERED: return "registered"; - case PRELIMINARY: return "preliminary"; - case FINAL: return "final"; - case AMENDED: return "amended"; - case CANCELLED: return "cancelled"; - case ENTEREDINERROR: return "entered-in-error"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REGISTERED: return ""; - case PRELIMINARY: return ""; - case FINAL: return ""; - case AMENDED: return ""; - case CANCELLED: return ""; - case ENTEREDINERROR: return ""; - case UNKNOWN: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REGISTERED: return "The existence of the observation is registered, but there is no result yet available."; - case PRELIMINARY: return "This is an initial or interim observation: data may be incomplete or unverified."; - case FINAL: return "The observation is complete and verified by an authorized person."; - case AMENDED: return "The observation has been modified subsequent to being Final, and is complete and verified by an authorized person."; - case CANCELLED: return "The observation is unavailable because the measurement was not started or not completed (also sometimes called 'aborted')."; - case ENTEREDINERROR: return "The observation has been withdrawn following previous Final release."; - case UNKNOWN: return "The observation status is unknown. Note that 'unknown' is a value of last resort and every attempt should be made to provide a meaningful value other than 'unknown'."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REGISTERED: return "Registered"; - case PRELIMINARY: return "Preliminary"; - case FINAL: return "Final"; - case AMENDED: return "Amended"; - case CANCELLED: return "Cancelled"; - case ENTEREDINERROR: return "Entered In Error"; - case UNKNOWN: return "Unknown"; - default: return "?"; - } - } - } - - public static class ObservationStatusEnumFactory implements EnumFactory { - public ObservationStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("registered".equals(codeString)) - return ObservationStatus.REGISTERED; - if ("preliminary".equals(codeString)) - return ObservationStatus.PRELIMINARY; - if ("final".equals(codeString)) - return ObservationStatus.FINAL; - if ("amended".equals(codeString)) - return ObservationStatus.AMENDED; - if ("cancelled".equals(codeString)) - return ObservationStatus.CANCELLED; - if ("entered-in-error".equals(codeString)) - return ObservationStatus.ENTEREDINERROR; - if ("unknown".equals(codeString)) - return ObservationStatus.UNKNOWN; - throw new IllegalArgumentException("Unknown ObservationStatus code '"+codeString+"'"); - } - public String toCode(ObservationStatus code) { - if (code == ObservationStatus.REGISTERED) - return "registered"; - if (code == ObservationStatus.PRELIMINARY) - return "preliminary"; - if (code == ObservationStatus.FINAL) - return "final"; - if (code == ObservationStatus.AMENDED) - return "amended"; - if (code == ObservationStatus.CANCELLED) - return "cancelled"; - if (code == ObservationStatus.ENTEREDINERROR) - return "entered-in-error"; - if (code == ObservationStatus.UNKNOWN) - return "unknown"; - return "?"; - } - } - - public enum ObservationReliability { - /** - * The result has no reliability concerns. - */ - OK, - /** - * An early estimate of value; measurement is still occurring. - */ - ONGOING, - /** - * An early estimate of value; processing is still occurring. - */ - EARLY, - /** - * The observation value should be treated with care. - */ - QUESTIONABLE, - /** - * The result has been generated while calibration is occurring. - */ - CALIBRATING, - /** - * The observation could not be completed because of an error. - */ - ERROR, - /** - * No observation reliability value was available. - */ - UNKNOWN, - /** - * added to help the parsers - */ - NULL; - public static ObservationReliability fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("ok".equals(codeString)) - return OK; - if ("ongoing".equals(codeString)) - return ONGOING; - if ("early".equals(codeString)) - return EARLY; - if ("questionable".equals(codeString)) - return QUESTIONABLE; - if ("calibrating".equals(codeString)) - return CALIBRATING; - if ("error".equals(codeString)) - return ERROR; - if ("unknown".equals(codeString)) - return UNKNOWN; - throw new Exception("Unknown ObservationReliability code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case OK: return "ok"; - case ONGOING: return "ongoing"; - case EARLY: return "early"; - case QUESTIONABLE: return "questionable"; - case CALIBRATING: return "calibrating"; - case ERROR: return "error"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case OK: return ""; - case ONGOING: return ""; - case EARLY: return ""; - case QUESTIONABLE: return ""; - case CALIBRATING: return ""; - case ERROR: return ""; - case UNKNOWN: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case OK: return "The result has no reliability concerns."; - case ONGOING: return "An early estimate of value; measurement is still occurring."; - case EARLY: return "An early estimate of value; processing is still occurring."; - case QUESTIONABLE: return "The observation value should be treated with care."; - case CALIBRATING: return "The result has been generated while calibration is occurring."; - case ERROR: return "The observation could not be completed because of an error."; - case UNKNOWN: return "No observation reliability value was available."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case OK: return "Ok"; - case ONGOING: return "Ongoing"; - case EARLY: return "Early"; - case QUESTIONABLE: return "Questionable"; - case CALIBRATING: return "Calibrating"; - case ERROR: return "Error"; - case UNKNOWN: return "Unknown"; - default: return "?"; - } - } - } - - public static class ObservationReliabilityEnumFactory implements EnumFactory { - public ObservationReliability fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("ok".equals(codeString)) - return ObservationReliability.OK; - if ("ongoing".equals(codeString)) - return ObservationReliability.ONGOING; - if ("early".equals(codeString)) - return ObservationReliability.EARLY; - if ("questionable".equals(codeString)) - return ObservationReliability.QUESTIONABLE; - if ("calibrating".equals(codeString)) - return ObservationReliability.CALIBRATING; - if ("error".equals(codeString)) - return ObservationReliability.ERROR; - if ("unknown".equals(codeString)) - return ObservationReliability.UNKNOWN; - throw new IllegalArgumentException("Unknown ObservationReliability code '"+codeString+"'"); - } - public String toCode(ObservationReliability code) { - if (code == ObservationReliability.OK) - return "ok"; - if (code == ObservationReliability.ONGOING) - return "ongoing"; - if (code == ObservationReliability.EARLY) - return "early"; - if (code == ObservationReliability.QUESTIONABLE) - return "questionable"; - if (code == ObservationReliability.CALIBRATING) - return "calibrating"; - if (code == ObservationReliability.ERROR) - return "error"; - if (code == ObservationReliability.UNKNOWN) - return "unknown"; - return "?"; - } - } - - public enum ObservationRelationshiptypes { - /** - * The target observation is a component of this observation (e.g. Systolic and Diastolic Blood Pressure). - */ - HASCOMPONENT, - /** - * This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group. - */ - HASMEMBER, - /** - * The target observation is part of the information from which this observation value is derived (e.g. calculated anion gap, Apgar score). - */ - DERIVEDFROM, - /** - * This observation follows the target observation (e.g. timed tests such as Glucose Tolerance Test). - */ - SEQUELTO, - /** - * This observation replaces a previous observation (i.e. a revised value). The target observation is now obsolete. - */ - REPLACES, - /** - * The value of the target observation qualifies (refines) the semantics of the source observation (e.g. a lipaemia measure target from a plasma measure). - */ - QUALIFIEDBY, - /** - * The value of the target observation interferes (degardes quality, or prevents valid observation) with the semantics of the source observation (e.g. a hemolysis measure target from a plasma potassium measure which has no value). - */ - INTERFEREDBY, - /** - * added to help the parsers - */ - NULL; - public static ObservationRelationshiptypes fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("has-component".equals(codeString)) - return HASCOMPONENT; - if ("has-member".equals(codeString)) - return HASMEMBER; - if ("derived-from".equals(codeString)) - return DERIVEDFROM; - if ("sequel-to".equals(codeString)) - return SEQUELTO; - if ("replaces".equals(codeString)) - return REPLACES; - if ("qualified-by".equals(codeString)) - return QUALIFIEDBY; - if ("interfered-by".equals(codeString)) - return INTERFEREDBY; - throw new Exception("Unknown ObservationRelationshiptypes code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case HASCOMPONENT: return "has-component"; - case HASMEMBER: return "has-member"; - case DERIVEDFROM: return "derived-from"; - case SEQUELTO: return "sequel-to"; - case REPLACES: return "replaces"; - case QUALIFIEDBY: return "qualified-by"; - case INTERFEREDBY: return "interfered-by"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case HASCOMPONENT: return ""; - case HASMEMBER: return ""; - case DERIVEDFROM: return ""; - case SEQUELTO: return ""; - case REPLACES: return ""; - case QUALIFIEDBY: return ""; - case INTERFEREDBY: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case HASCOMPONENT: return "The target observation is a component of this observation (e.g. Systolic and Diastolic Blood Pressure)."; - case HASMEMBER: return "This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group."; - case DERIVEDFROM: return "The target observation is part of the information from which this observation value is derived (e.g. calculated anion gap, Apgar score)."; - case SEQUELTO: return "This observation follows the target observation (e.g. timed tests such as Glucose Tolerance Test)."; - case REPLACES: return "This observation replaces a previous observation (i.e. a revised value). The target observation is now obsolete."; - case QUALIFIEDBY: return "The value of the target observation qualifies (refines) the semantics of the source observation (e.g. a lipaemia measure target from a plasma measure)."; - case INTERFEREDBY: return "The value of the target observation interferes (degardes quality, or prevents valid observation) with the semantics of the source observation (e.g. a hemolysis measure target from a plasma potassium measure which has no value)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case HASCOMPONENT: return "Has Component"; - case HASMEMBER: return "Has Member"; - case DERIVEDFROM: return "Derived From"; - case SEQUELTO: return "Sequel To"; - case REPLACES: return "Replaces"; - case QUALIFIEDBY: return "Qualified By"; - case INTERFEREDBY: return "Interfered By"; - default: return "?"; - } - } - } - - public static class ObservationRelationshiptypesEnumFactory implements EnumFactory { - public ObservationRelationshiptypes fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("has-component".equals(codeString)) - return ObservationRelationshiptypes.HASCOMPONENT; - if ("has-member".equals(codeString)) - return ObservationRelationshiptypes.HASMEMBER; - if ("derived-from".equals(codeString)) - return ObservationRelationshiptypes.DERIVEDFROM; - if ("sequel-to".equals(codeString)) - return ObservationRelationshiptypes.SEQUELTO; - if ("replaces".equals(codeString)) - return ObservationRelationshiptypes.REPLACES; - if ("qualified-by".equals(codeString)) - return ObservationRelationshiptypes.QUALIFIEDBY; - if ("interfered-by".equals(codeString)) - return ObservationRelationshiptypes.INTERFEREDBY; - throw new IllegalArgumentException("Unknown ObservationRelationshiptypes code '"+codeString+"'"); - } - public String toCode(ObservationRelationshiptypes code) { - if (code == ObservationRelationshiptypes.HASCOMPONENT) - return "has-component"; - if (code == ObservationRelationshiptypes.HASMEMBER) - return "has-member"; - if (code == ObservationRelationshiptypes.DERIVEDFROM) - return "derived-from"; - if (code == ObservationRelationshiptypes.SEQUELTO) - return "sequel-to"; - if (code == ObservationRelationshiptypes.REPLACES) - return "replaces"; - if (code == ObservationRelationshiptypes.QUALIFIEDBY) - return "qualified-by"; - if (code == ObservationRelationshiptypes.INTERFEREDBY) - return "interfered-by"; - return "?"; - } - } - - @Block() - public static class ObservationReferenceRangeComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The value of the low bound of the reference range. If this element is omitted, the low bound of the reference range is assumed to be meaningless. (e.g. reference range is <2.3) If the low.comparator element is missing, it is assumed to be '>'. - */ - @Child(name = "low", type = {Quantity.class}, order=1, min=0, max=1) - @Description(shortDefinition="Low Range, if relevant", formalDefinition="The value of the low bound of the reference range. If this element is omitted, the low bound of the reference range is assumed to be meaningless. (e.g. reference range is <2.3) If the low.comparator element is missing, it is assumed to be '>'." ) - protected Quantity low; - - /** - * The value of the high bound of the reference range. If this element is omitted, the high bound of the reference range is assumed to be meaningless. (e.g. reference range is > 5) If the low.comparator element is missing , it is assumed to be '<'. - */ - @Child(name = "high", type = {Quantity.class}, order=2, min=0, max=1) - @Description(shortDefinition="High Range, if relevant", formalDefinition="The value of the high bound of the reference range. If this element is omitted, the high bound of the reference range is assumed to be meaningless. (e.g. reference range is > 5) If the low.comparator element is missing , it is assumed to be '<'." ) - protected Quantity high; - - /** - * Code for the meaning of the reference range. - */ - @Child(name = "meaning", type = {CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Indicates the meaning/use of this range of this range", formalDefinition="Code for the meaning of the reference range." ) - protected CodeableConcept meaning; - - /** - * The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so. - */ - @Child(name = "age", type = {Range.class}, order=4, min=0, max=1) - @Description(shortDefinition="Applicable age range, if relevant", formalDefinition="The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so." ) - protected Range age; - - /** - * Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'. - */ - @Child(name = "text", type = {StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Text based reference range in an observation", formalDefinition="Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of 'Negative' or a list or table of 'normals'." ) - protected StringType text; - - private static final long serialVersionUID = 230621180L; - - /* - * Constructor - */ - public ObservationReferenceRangeComponent() { - super(); - } - - /** - * @return {@link #low} (The value of the low bound of the reference range. If this element is omitted, the low bound of the reference range is assumed to be meaningless. (e.g. reference range is <2.3) If the low.comparator element is missing, it is assumed to be '>'.) - */ - public Quantity getLow() { - if (this.low == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.low"); - else if (Configuration.doAutoCreate()) - this.low = new Quantity(); // cc - return this.low; - } - - public boolean hasLow() { - return this.low != null && !this.low.isEmpty(); - } - - /** - * @param value {@link #low} (The value of the low bound of the reference range. If this element is omitted, the low bound of the reference range is assumed to be meaningless. (e.g. reference range is <2.3) If the low.comparator element is missing, it is assumed to be '>'.) - */ - public ObservationReferenceRangeComponent setLow(Quantity value) { - this.low = value; - return this; - } - - /** - * @return {@link #high} (The value of the high bound of the reference range. If this element is omitted, the high bound of the reference range is assumed to be meaningless. (e.g. reference range is > 5) If the low.comparator element is missing , it is assumed to be '<'.) - */ - public Quantity getHigh() { - if (this.high == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.high"); - else if (Configuration.doAutoCreate()) - this.high = new Quantity(); // cc - return this.high; - } - - public boolean hasHigh() { - return this.high != null && !this.high.isEmpty(); - } - - /** - * @param value {@link #high} (The value of the high bound of the reference range. If this element is omitted, the high bound of the reference range is assumed to be meaningless. (e.g. reference range is > 5) If the low.comparator element is missing , it is assumed to be '<'.) - */ - public ObservationReferenceRangeComponent setHigh(Quantity value) { - this.high = value; - return this; - } - - /** - * @return {@link #meaning} (Code for the meaning of the reference range.) - */ - public CodeableConcept getMeaning() { - if (this.meaning == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.meaning"); - else if (Configuration.doAutoCreate()) - this.meaning = new CodeableConcept(); // cc - return this.meaning; - } - - public boolean hasMeaning() { - return this.meaning != null && !this.meaning.isEmpty(); - } - - /** - * @param value {@link #meaning} (Code for the meaning of the reference range.) - */ - public ObservationReferenceRangeComponent setMeaning(CodeableConcept value) { - this.meaning = value; - return this; - } - - /** - * @return {@link #age} (The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.) - */ - public Range getAge() { - if (this.age == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.age"); - else if (Configuration.doAutoCreate()) - this.age = new Range(); // cc - return this.age; - } - - public boolean hasAge() { - return this.age != null && !this.age.isEmpty(); - } - - /** - * @param value {@link #age} (The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.) - */ - public ObservationReferenceRangeComponent setAge(Range value) { - this.age = value; - return this; - } - - /** - * @return {@link #text} (Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public ObservationReferenceRangeComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'. - */ - public ObservationReferenceRangeComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("low", "Quantity", "The value of the low bound of the reference range. If this element is omitted, the low bound of the reference range is assumed to be meaningless. (e.g. reference range is <2.3) If the low.comparator element is missing, it is assumed to be '>'.", 0, java.lang.Integer.MAX_VALUE, low)); - childrenList.add(new Property("high", "Quantity", "The value of the high bound of the reference range. If this element is omitted, the high bound of the reference range is assumed to be meaningless. (e.g. reference range is > 5) If the low.comparator element is missing , it is assumed to be '<'.", 0, java.lang.Integer.MAX_VALUE, high)); - childrenList.add(new Property("meaning", "CodeableConcept", "Code for the meaning of the reference range.", 0, java.lang.Integer.MAX_VALUE, meaning)); - childrenList.add(new Property("age", "Range", "The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.", 0, java.lang.Integer.MAX_VALUE, age)); - childrenList.add(new Property("text", "string", "Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of 'Negative' or a list or table of 'normals'.", 0, java.lang.Integer.MAX_VALUE, text)); - } - - public ObservationReferenceRangeComponent copy() { - ObservationReferenceRangeComponent dst = new ObservationReferenceRangeComponent(); - copyValues(dst); - dst.low = low == null ? null : low.copy(); - dst.high = high == null ? null : high.copy(); - dst.meaning = meaning == null ? null : meaning.copy(); - dst.age = age == null ? null : age.copy(); - dst.text = text == null ? null : text.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ObservationReferenceRangeComponent)) - return false; - ObservationReferenceRangeComponent o = (ObservationReferenceRangeComponent) other; - return compareDeep(low, o.low, true) && compareDeep(high, o.high, true) && compareDeep(meaning, o.meaning, true) - && compareDeep(age, o.age, true) && compareDeep(text, o.text, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ObservationReferenceRangeComponent)) - return false; - ObservationReferenceRangeComponent o = (ObservationReferenceRangeComponent) other; - return compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (low == null || low.isEmpty()) && (high == null || high.isEmpty()) - && (meaning == null || meaning.isEmpty()) && (age == null || age.isEmpty()) && (text == null || text.isEmpty()) - ; - } - - } - - @Block() - public static class ObservationRelatedComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A code specifying the kind of relationship that exists with the target observation. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="has-component | has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by", formalDefinition="A code specifying the kind of relationship that exists with the target observation." ) - protected Enumeration type; - - /** - * A reference to the observation that is related to this observation. - */ - @Child(name = "target", type = {Observation.class}, order=2, min=1, max=1) - @Description(shortDefinition="Observation that is related to this one", formalDefinition="A reference to the observation that is related to this observation." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (A reference to the observation that is related to this observation.) - */ - protected Observation targetTarget; - - private static final long serialVersionUID = 1078793488L; - - /* - * Constructor - */ - public ObservationRelatedComponent() { - super(); - } - - /* - * Constructor - */ - public ObservationRelatedComponent(Reference target) { - super(); - this.target = target; - } - - /** - * @return {@link #type} (A code specifying the kind of relationship that exists with the target observation.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationRelatedComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new ObservationRelationshiptypesEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (A code specifying the kind of relationship that exists with the target observation.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ObservationRelatedComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return A code specifying the kind of relationship that exists with the target observation. - */ - public ObservationRelationshiptypes getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value A code specifying the kind of relationship that exists with the target observation. - */ - public ObservationRelatedComponent setType(ObservationRelationshiptypes value) { - if (value == null) - this.type = null; - else { - if (this.type == null) - this.type = new Enumeration(new ObservationRelationshiptypesEnumFactory()); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (A reference to the observation that is related to this observation.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationRelatedComponent.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); // cc - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (A reference to the observation that is related to this observation.) - */ - public ObservationRelatedComponent setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the observation that is related to this observation.) - */ - public Observation getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationRelatedComponent.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Observation(); // aa - return this.targetTarget; - } - - /** - * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the observation that is related to this observation.) - */ - public ObservationRelatedComponent setTargetTarget(Observation value) { - this.targetTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "A code specifying the kind of relationship that exists with the target observation.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("target", "Reference(Observation)", "A reference to the observation that is related to this observation.", 0, java.lang.Integer.MAX_VALUE, target)); - } - - public ObservationRelatedComponent copy() { - ObservationRelatedComponent dst = new ObservationRelatedComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.target = target == null ? null : target.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ObservationRelatedComponent)) - return false; - ObservationRelatedComponent o = (ObservationRelatedComponent) other; - return compareDeep(type, o.type, true) && compareDeep(target, o.target, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ObservationRelatedComponent)) - return false; - ObservationRelatedComponent o = (ObservationRelatedComponent) other; - return compareValues(type, o.type, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (target == null || target.isEmpty()) - ; - } - - } - - /** - * Describes what was observed. Sometimes this is called the observation "code". - */ - @Child(name = "code", type = {CodeableConcept.class}, order=0, min=1, max=1) - @Description(shortDefinition="Type of observation (code / type)", formalDefinition="Describes what was observed. Sometimes this is called the observation 'code'." ) - protected CodeableConcept code; - - /** - * The information determined as a result of making the observation, if the information has a simple value. - */ - @Child(name = "value", type = {Quantity.class, CodeableConcept.class, StringType.class, Range.class, Ratio.class, SampledData.class, Attachment.class, TimeType.class, DateTimeType.class, Period.class}, order=1, min=0, max=1) - @Description(shortDefinition="Actual result", formalDefinition="The information determined as a result of making the observation, if the information has a simple value." ) - protected Type value; - - /** - * Provides a reason why the expected value in the element Observation.value[x] is missing. - */ - @Child(name = "dataAbsentReason", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Why the result is missing", formalDefinition="Provides a reason why the expected value in the element Observation.value[x] is missing." ) - protected CodeableConcept dataAbsentReason; - - /** - * The assessment made based on the result of the observation. - */ - @Child(name = "interpretation", type = {CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="High, low, normal, etc.", formalDefinition="The assessment made based on the result of the observation." ) - protected CodeableConcept interpretation; - - /** - * May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result. - */ - @Child(name = "comments", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Comments about result", formalDefinition="May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result." ) - protected StringType comments; - - /** - * The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself. - */ - @Child(name = "applies", type = {DateTimeType.class, Period.class}, order=5, min=0, max=1) - @Description(shortDefinition="Physiologically Relevant time/time-period for observation", formalDefinition="The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the 'physiologically relevant time'. This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself." ) - protected Type applies; - - /** - * The date and time this observation was made available. - */ - @Child(name = "issued", type = {InstantType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Date/Time this was made available", formalDefinition="The date and time this observation was made available." ) - protected InstantType issued; - - /** - * The status of the result value. - */ - @Child(name = "status", type = {CodeType.class}, order=7, min=1, max=1) - @Description(shortDefinition="registered | preliminary | final | amended +", formalDefinition="The status of the result value." ) - protected Enumeration status; - - /** - * An estimate of the degree to which quality issues have impacted on the value reported. - */ - @Child(name = "reliability", type = {CodeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="ok | ongoing | early | questionable | calibrating | error +", formalDefinition="An estimate of the degree to which quality issues have impacted on the value reported." ) - protected Enumeration reliability; - - /** - * Indicates the site on the subject's body where the observation was made ( i.e. the target site). - */ - @Child(name = "bodySite", type = {CodeableConcept.class, BodySite.class}, order=9, min=0, max=1) - @Description(shortDefinition="Observed body part", formalDefinition="Indicates the site on the subject's body where the observation was made ( i.e. the target site)." ) - protected Type bodySite; - - /** - * Indicates the mechanism used to perform the observation. - */ - @Child(name = "method", type = {CodeableConcept.class}, order=10, min=0, max=1) - @Description(shortDefinition="How it was done", formalDefinition="Indicates the mechanism used to perform the observation." ) - protected CodeableConcept method; - - /** - * A unique identifier for the simple observation. - */ - @Child(name = "identifier", type = {Identifier.class}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Unique Id for this particular observation", formalDefinition="A unique identifier for the simple observation." ) - protected List identifier; - - /** +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Measurements and simple assertions made about a patient, device or other subject. + */ +@ResourceDef(name="Observation", profile="http://hl7.org/fhir/Profile/Observation") +public class Observation extends DomainResource { + + public enum ObservationStatus { + /** + * The existence of the observation is registered, but there is no result yet available. + */ + REGISTERED, + /** + * This is an initial or interim observation: data may be incomplete or unverified. + */ + PRELIMINARY, + /** + * The observation is complete and verified by an authorized person. + */ + FINAL, + /** + * The observation has been modified subsequent to being Final, and is complete and verified by an authorized person. + */ + AMENDED, + /** + * The observation is unavailable because the measurement was not started or not completed (also sometimes called "aborted"). + */ + CANCELLED, + /** + * The observation has been withdrawn following previous Final release. + */ + ENTEREDINERROR, + /** + * The observation status is unknown. Note that "unknown" is a value of last resort and every attempt should be made to provide a meaningful value other than "unknown". + */ + UNKNOWN, + /** + * added to help the parsers + */ + NULL; + public static ObservationStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("registered".equals(codeString)) + return REGISTERED; + if ("preliminary".equals(codeString)) + return PRELIMINARY; + if ("final".equals(codeString)) + return FINAL; + if ("amended".equals(codeString)) + return AMENDED; + if ("cancelled".equals(codeString)) + return CANCELLED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + if ("unknown".equals(codeString)) + return UNKNOWN; + throw new Exception("Unknown ObservationStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case REGISTERED: return "registered"; + case PRELIMINARY: return "preliminary"; + case FINAL: return "final"; + case AMENDED: return "amended"; + case CANCELLED: return "cancelled"; + case ENTEREDINERROR: return "entered-in-error"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REGISTERED: return ""; + case PRELIMINARY: return ""; + case FINAL: return ""; + case AMENDED: return ""; + case CANCELLED: return ""; + case ENTEREDINERROR: return ""; + case UNKNOWN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REGISTERED: return "The existence of the observation is registered, but there is no result yet available."; + case PRELIMINARY: return "This is an initial or interim observation: data may be incomplete or unverified."; + case FINAL: return "The observation is complete and verified by an authorized person."; + case AMENDED: return "The observation has been modified subsequent to being Final, and is complete and verified by an authorized person."; + case CANCELLED: return "The observation is unavailable because the measurement was not started or not completed (also sometimes called 'aborted')."; + case ENTEREDINERROR: return "The observation has been withdrawn following previous Final release."; + case UNKNOWN: return "The observation status is unknown. Note that 'unknown' is a value of last resort and every attempt should be made to provide a meaningful value other than 'unknown'."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REGISTERED: return "Registered"; + case PRELIMINARY: return "Preliminary"; + case FINAL: return "Final"; + case AMENDED: return "Amended"; + case CANCELLED: return "Cancelled"; + case ENTEREDINERROR: return "Entered In Error"; + case UNKNOWN: return "Unknown"; + default: return "?"; + } + } + } + + public static class ObservationStatusEnumFactory implements EnumFactory { + public ObservationStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("registered".equals(codeString)) + return ObservationStatus.REGISTERED; + if ("preliminary".equals(codeString)) + return ObservationStatus.PRELIMINARY; + if ("final".equals(codeString)) + return ObservationStatus.FINAL; + if ("amended".equals(codeString)) + return ObservationStatus.AMENDED; + if ("cancelled".equals(codeString)) + return ObservationStatus.CANCELLED; + if ("entered-in-error".equals(codeString)) + return ObservationStatus.ENTEREDINERROR; + if ("unknown".equals(codeString)) + return ObservationStatus.UNKNOWN; + throw new IllegalArgumentException("Unknown ObservationStatus code '"+codeString+"'"); + } + public String toCode(ObservationStatus code) { + if (code == ObservationStatus.REGISTERED) + return "registered"; + if (code == ObservationStatus.PRELIMINARY) + return "preliminary"; + if (code == ObservationStatus.FINAL) + return "final"; + if (code == ObservationStatus.AMENDED) + return "amended"; + if (code == ObservationStatus.CANCELLED) + return "cancelled"; + if (code == ObservationStatus.ENTEREDINERROR) + return "entered-in-error"; + if (code == ObservationStatus.UNKNOWN) + return "unknown"; + return "?"; + } + } + + public enum ObservationReliability { + /** + * The result has no reliability concerns. + */ + OK, + /** + * An early estimate of value; measurement is still occurring. + */ + ONGOING, + /** + * An early estimate of value; processing is still occurring. + */ + EARLY, + /** + * The observation value should be treated with care. + */ + QUESTIONABLE, + /** + * The result has been generated while calibration is occurring. + */ + CALIBRATING, + /** + * The observation could not be completed because of an error. + */ + ERROR, + /** + * No observation reliability value was available. + */ + UNKNOWN, + /** + * added to help the parsers + */ + NULL; + public static ObservationReliability fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("ok".equals(codeString)) + return OK; + if ("ongoing".equals(codeString)) + return ONGOING; + if ("early".equals(codeString)) + return EARLY; + if ("questionable".equals(codeString)) + return QUESTIONABLE; + if ("calibrating".equals(codeString)) + return CALIBRATING; + if ("error".equals(codeString)) + return ERROR; + if ("unknown".equals(codeString)) + return UNKNOWN; + throw new Exception("Unknown ObservationReliability code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case OK: return "ok"; + case ONGOING: return "ongoing"; + case EARLY: return "early"; + case QUESTIONABLE: return "questionable"; + case CALIBRATING: return "calibrating"; + case ERROR: return "error"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case OK: return ""; + case ONGOING: return ""; + case EARLY: return ""; + case QUESTIONABLE: return ""; + case CALIBRATING: return ""; + case ERROR: return ""; + case UNKNOWN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case OK: return "The result has no reliability concerns."; + case ONGOING: return "An early estimate of value; measurement is still occurring."; + case EARLY: return "An early estimate of value; processing is still occurring."; + case QUESTIONABLE: return "The observation value should be treated with care."; + case CALIBRATING: return "The result has been generated while calibration is occurring."; + case ERROR: return "The observation could not be completed because of an error."; + case UNKNOWN: return "No observation reliability value was available."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case OK: return "Ok"; + case ONGOING: return "Ongoing"; + case EARLY: return "Early"; + case QUESTIONABLE: return "Questionable"; + case CALIBRATING: return "Calibrating"; + case ERROR: return "Error"; + case UNKNOWN: return "Unknown"; + default: return "?"; + } + } + } + + public static class ObservationReliabilityEnumFactory implements EnumFactory { + public ObservationReliability fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("ok".equals(codeString)) + return ObservationReliability.OK; + if ("ongoing".equals(codeString)) + return ObservationReliability.ONGOING; + if ("early".equals(codeString)) + return ObservationReliability.EARLY; + if ("questionable".equals(codeString)) + return ObservationReliability.QUESTIONABLE; + if ("calibrating".equals(codeString)) + return ObservationReliability.CALIBRATING; + if ("error".equals(codeString)) + return ObservationReliability.ERROR; + if ("unknown".equals(codeString)) + return ObservationReliability.UNKNOWN; + throw new IllegalArgumentException("Unknown ObservationReliability code '"+codeString+"'"); + } + public String toCode(ObservationReliability code) { + if (code == ObservationReliability.OK) + return "ok"; + if (code == ObservationReliability.ONGOING) + return "ongoing"; + if (code == ObservationReliability.EARLY) + return "early"; + if (code == ObservationReliability.QUESTIONABLE) + return "questionable"; + if (code == ObservationReliability.CALIBRATING) + return "calibrating"; + if (code == ObservationReliability.ERROR) + return "error"; + if (code == ObservationReliability.UNKNOWN) + return "unknown"; + return "?"; + } + } + + public enum ObservationRelationshiptypes { + /** + * This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group. + */ + HASMEMBER, + /** + * This observation follows the target observation (e.g. timed tests such as Glucose Tolerance Test). + */ + SEQUELTO, + /** + * This observation replaces a previous observation (i.e. a revised value). The target observation is now obsolete. + */ + REPLACES, + /** + * The value of the target observation qualifies (refines) the semantics of the source observation (e.g. a lipaemia measure target from a plasma measure). + */ + QUALIFIEDBY, + /** + * The value of the target observation interferes (degardes quality, or prevents valid observation) with the semantics of the source observation (e.g. a hemolysis measure target from a plasma potassium measure which has no value). + */ + INTERFEREDBY, + /** + * added to help the parsers + */ + NULL; + public static ObservationRelationshiptypes fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("has-member".equals(codeString)) + return HASMEMBER; + if ("sequel-to".equals(codeString)) + return SEQUELTO; + if ("replaces".equals(codeString)) + return REPLACES; + if ("qualified-by".equals(codeString)) + return QUALIFIEDBY; + if ("interfered-by".equals(codeString)) + return INTERFEREDBY; + throw new Exception("Unknown ObservationRelationshiptypes code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case HASMEMBER: return "has-member"; + case SEQUELTO: return "sequel-to"; + case REPLACES: return "replaces"; + case QUALIFIEDBY: return "qualified-by"; + case INTERFEREDBY: return "interfered-by"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case HASMEMBER: return ""; + case SEQUELTO: return ""; + case REPLACES: return ""; + case QUALIFIEDBY: return ""; + case INTERFEREDBY: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case HASMEMBER: return "This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group."; + case SEQUELTO: return "This observation follows the target observation (e.g. timed tests such as Glucose Tolerance Test)."; + case REPLACES: return "This observation replaces a previous observation (i.e. a revised value). The target observation is now obsolete."; + case QUALIFIEDBY: return "The value of the target observation qualifies (refines) the semantics of the source observation (e.g. a lipaemia measure target from a plasma measure)."; + case INTERFEREDBY: return "The value of the target observation interferes (degardes quality, or prevents valid observation) with the semantics of the source observation (e.g. a hemolysis measure target from a plasma potassium measure which has no value)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case HASMEMBER: return "Has Member"; + case SEQUELTO: return "Sequel To"; + case REPLACES: return "Replaces"; + case QUALIFIEDBY: return "Qualified By"; + case INTERFEREDBY: return "Interfered By"; + default: return "?"; + } + } + } + + public static class ObservationRelationshiptypesEnumFactory implements EnumFactory { + public ObservationRelationshiptypes fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("has-member".equals(codeString)) + return ObservationRelationshiptypes.HASMEMBER; + if ("sequel-to".equals(codeString)) + return ObservationRelationshiptypes.SEQUELTO; + if ("replaces".equals(codeString)) + return ObservationRelationshiptypes.REPLACES; + if ("qualified-by".equals(codeString)) + return ObservationRelationshiptypes.QUALIFIEDBY; + if ("interfered-by".equals(codeString)) + return ObservationRelationshiptypes.INTERFEREDBY; + throw new IllegalArgumentException("Unknown ObservationRelationshiptypes code '"+codeString+"'"); + } + public String toCode(ObservationRelationshiptypes code) { + if (code == ObservationRelationshiptypes.HASMEMBER) + return "has-member"; + if (code == ObservationRelationshiptypes.SEQUELTO) + return "sequel-to"; + if (code == ObservationRelationshiptypes.REPLACES) + return "replaces"; + if (code == ObservationRelationshiptypes.QUALIFIEDBY) + return "qualified-by"; + if (code == ObservationRelationshiptypes.INTERFEREDBY) + return "interfered-by"; + return "?"; + } + } + + @Block() + public static class ObservationReferenceRangeComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The value of the low bound of the reference range. If this element is omitted, the low bound of the reference range is assumed to be meaningless. (e.g. reference range is <2.3) If the low.comparator element is missing, it is assumed to be '>'. + */ + @Child(name = "low", type = {Quantity.class}, order=1, min=0, max=1) + @Description(shortDefinition="Low Range, if relevant", formalDefinition="The value of the low bound of the reference range. If this element is omitted, the low bound of the reference range is assumed to be meaningless. (e.g. reference range is <2.3) If the low.comparator element is missing, it is assumed to be '>'." ) + protected Quantity low; + + /** + * The value of the high bound of the reference range. If this element is omitted, the high bound of the reference range is assumed to be meaningless. (e.g. reference range is > 5) If the low.comparator element is missing , it is assumed to be '<'. + */ + @Child(name = "high", type = {Quantity.class}, order=2, min=0, max=1) + @Description(shortDefinition="High Range, if relevant", formalDefinition="The value of the high bound of the reference range. If this element is omitted, the high bound of the reference range is assumed to be meaningless. (e.g. reference range is > 5) If the low.comparator element is missing , it is assumed to be '<'." ) + protected Quantity high; + + /** + * Code for the meaning of the reference range. + */ + @Child(name = "meaning", type = {CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Indicates the meaning/use of this range of this range", formalDefinition="Code for the meaning of the reference range." ) + protected CodeableConcept meaning; + + /** + * The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so. + */ + @Child(name = "age", type = {Range.class}, order=4, min=0, max=1) + @Description(shortDefinition="Applicable age range, if relevant", formalDefinition="The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so." ) + protected Range age; + + /** + * Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'. + */ + @Child(name = "text", type = {StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Text based reference range in an observation", formalDefinition="Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of 'Negative' or a list or table of 'normals'." ) + protected StringType text; + + private static final long serialVersionUID = 230621180L; + + /* + * Constructor + */ + public ObservationReferenceRangeComponent() { + super(); + } + + /** + * @return {@link #low} (The value of the low bound of the reference range. If this element is omitted, the low bound of the reference range is assumed to be meaningless. (e.g. reference range is <2.3) If the low.comparator element is missing, it is assumed to be '>'.) + */ + public Quantity getLow() { + if (this.low == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.low"); + else if (Configuration.doAutoCreate()) + this.low = new Quantity(); // cc + return this.low; + } + + public boolean hasLow() { + return this.low != null && !this.low.isEmpty(); + } + + /** + * @param value {@link #low} (The value of the low bound of the reference range. If this element is omitted, the low bound of the reference range is assumed to be meaningless. (e.g. reference range is <2.3) If the low.comparator element is missing, it is assumed to be '>'.) + */ + public ObservationReferenceRangeComponent setLow(Quantity value) { + this.low = value; + return this; + } + + /** + * @return {@link #high} (The value of the high bound of the reference range. If this element is omitted, the high bound of the reference range is assumed to be meaningless. (e.g. reference range is > 5) If the low.comparator element is missing , it is assumed to be '<'.) + */ + public Quantity getHigh() { + if (this.high == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.high"); + else if (Configuration.doAutoCreate()) + this.high = new Quantity(); // cc + return this.high; + } + + public boolean hasHigh() { + return this.high != null && !this.high.isEmpty(); + } + + /** + * @param value {@link #high} (The value of the high bound of the reference range. If this element is omitted, the high bound of the reference range is assumed to be meaningless. (e.g. reference range is > 5) If the low.comparator element is missing , it is assumed to be '<'.) + */ + public ObservationReferenceRangeComponent setHigh(Quantity value) { + this.high = value; + return this; + } + + /** + * @return {@link #meaning} (Code for the meaning of the reference range.) + */ + public CodeableConcept getMeaning() { + if (this.meaning == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.meaning"); + else if (Configuration.doAutoCreate()) + this.meaning = new CodeableConcept(); // cc + return this.meaning; + } + + public boolean hasMeaning() { + return this.meaning != null && !this.meaning.isEmpty(); + } + + /** + * @param value {@link #meaning} (Code for the meaning of the reference range.) + */ + public ObservationReferenceRangeComponent setMeaning(CodeableConcept value) { + this.meaning = value; + return this; + } + + /** + * @return {@link #age} (The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.) + */ + public Range getAge() { + if (this.age == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.age"); + else if (Configuration.doAutoCreate()) + this.age = new Range(); // cc + return this.age; + } + + public boolean hasAge() { + return this.age != null && !this.age.isEmpty(); + } + + /** + * @param value {@link #age} (The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.) + */ + public ObservationReferenceRangeComponent setAge(Range value) { + this.age = value; + return this; + } + + /** + * @return {@link #text} (Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public ObservationReferenceRangeComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'. + */ + public ObservationReferenceRangeComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("low", "Quantity", "The value of the low bound of the reference range. If this element is omitted, the low bound of the reference range is assumed to be meaningless. (e.g. reference range is <2.3) If the low.comparator element is missing, it is assumed to be '>'.", 0, java.lang.Integer.MAX_VALUE, low)); + childrenList.add(new Property("high", "Quantity", "The value of the high bound of the reference range. If this element is omitted, the high bound of the reference range is assumed to be meaningless. (e.g. reference range is > 5) If the low.comparator element is missing , it is assumed to be '<'.", 0, java.lang.Integer.MAX_VALUE, high)); + childrenList.add(new Property("meaning", "CodeableConcept", "Code for the meaning of the reference range.", 0, java.lang.Integer.MAX_VALUE, meaning)); + childrenList.add(new Property("age", "Range", "The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.", 0, java.lang.Integer.MAX_VALUE, age)); + childrenList.add(new Property("text", "string", "Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of 'Negative' or a list or table of 'normals'.", 0, java.lang.Integer.MAX_VALUE, text)); + } + + public ObservationReferenceRangeComponent copy() { + ObservationReferenceRangeComponent dst = new ObservationReferenceRangeComponent(); + copyValues(dst); + dst.low = low == null ? null : low.copy(); + dst.high = high == null ? null : high.copy(); + dst.meaning = meaning == null ? null : meaning.copy(); + dst.age = age == null ? null : age.copy(); + dst.text = text == null ? null : text.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ObservationReferenceRangeComponent)) + return false; + ObservationReferenceRangeComponent o = (ObservationReferenceRangeComponent) other; + return compareDeep(low, o.low, true) && compareDeep(high, o.high, true) && compareDeep(meaning, o.meaning, true) + && compareDeep(age, o.age, true) && compareDeep(text, o.text, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ObservationReferenceRangeComponent)) + return false; + ObservationReferenceRangeComponent o = (ObservationReferenceRangeComponent) other; + return compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (low == null || low.isEmpty()) && (high == null || high.isEmpty()) + && (meaning == null || meaning.isEmpty()) && (age == null || age.isEmpty()) && (text == null || text.isEmpty()) + ; + } + + } + + @Block() + public static class ObservationRelatedComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A code specifying the kind of relationship that exists with the target observation. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="has-member | sequel-to | replaces | qualified-by | interfered-by", formalDefinition="A code specifying the kind of relationship that exists with the target observation." ) + protected Enumeration type; + + /** + * A reference to the observation that is related to this observation. + */ + @Child(name = "target", type = {Observation.class}, order=2, min=1, max=1) + @Description(shortDefinition="Observation that is related to this one", formalDefinition="A reference to the observation that is related to this observation." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (A reference to the observation that is related to this observation.) + */ + protected Observation targetTarget; + + private static final long serialVersionUID = 1078793488L; + + /* + * Constructor + */ + public ObservationRelatedComponent() { + super(); + } + + /* + * Constructor + */ + public ObservationRelatedComponent(Reference target) { + super(); + this.target = target; + } + + /** + * @return {@link #type} (A code specifying the kind of relationship that exists with the target observation.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationRelatedComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new ObservationRelationshiptypesEnumFactory()); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (A code specifying the kind of relationship that exists with the target observation.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ObservationRelatedComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return A code specifying the kind of relationship that exists with the target observation. + */ + public ObservationRelationshiptypes getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value A code specifying the kind of relationship that exists with the target observation. + */ + public ObservationRelatedComponent setType(ObservationRelationshiptypes value) { + if (value == null) + this.type = null; + else { + if (this.type == null) + this.type = new Enumeration(new ObservationRelationshiptypesEnumFactory()); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (A reference to the observation that is related to this observation.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationRelatedComponent.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); // cc + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (A reference to the observation that is related to this observation.) + */ + public ObservationRelatedComponent setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the observation that is related to this observation.) + */ + public Observation getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationRelatedComponent.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Observation(); // aa + return this.targetTarget; + } + + /** + * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the observation that is related to this observation.) + */ + public ObservationRelatedComponent setTargetTarget(Observation value) { + this.targetTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "A code specifying the kind of relationship that exists with the target observation.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("target", "Reference(Observation)", "A reference to the observation that is related to this observation.", 0, java.lang.Integer.MAX_VALUE, target)); + } + + public ObservationRelatedComponent copy() { + ObservationRelatedComponent dst = new ObservationRelatedComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.target = target == null ? null : target.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ObservationRelatedComponent)) + return false; + ObservationRelatedComponent o = (ObservationRelatedComponent) other; + return compareDeep(type, o.type, true) && compareDeep(target, o.target, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ObservationRelatedComponent)) + return false; + ObservationRelatedComponent o = (ObservationRelatedComponent) other; + return compareValues(type, o.type, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (target == null || target.isEmpty()) + ; + } + + } + + @Block() + public static class ObservationComponentComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Describes what was observed. Sometimes this is called the observation "code". + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Type of component observation (code / type)", formalDefinition="Describes what was observed. Sometimes this is called the observation 'code'." ) + protected CodeableConcept code; + + /** + * The information determined as a result of making the observation, if the information has a simple value. + */ + @Child(name = "value", type = {Quantity.class, CodeableConcept.class, StringType.class, Range.class, Ratio.class, SampledData.class, Attachment.class, TimeType.class, DateTimeType.class, Period.class}, order=2, min=0, max=1) + @Description(shortDefinition="Actual component result", formalDefinition="The information determined as a result of making the observation, if the information has a simple value." ) + protected Type value; + + /** + * Provides a reason why the expected value in the element Observation.value[x] is missing. + */ + @Child(name = "dataAbsentReason", type = {CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Why the component result is missing", formalDefinition="Provides a reason why the expected value in the element Observation.value[x] is missing." ) + protected CodeableConcept dataAbsentReason; + + /** + * Guidance on how to interpret the value by comparison to a normal or recommended range. + */ + @Child(name = "referenceRange", type = {ObservationReferenceRangeComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Provides guide for interpretation ofcomponent result", formalDefinition="Guidance on how to interpret the value by comparison to a normal or recommended range." ) + protected List referenceRange; + + private static final long serialVersionUID = 946602904L; + + /* + * Constructor + */ + public ObservationComponentComponent() { + super(); + } + + /* + * Constructor + */ + public ObservationComponentComponent(CodeableConcept code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Describes what was observed. Sometimes this is called the observation "code".) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationComponentComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Describes what was observed. Sometimes this is called the observation "code".) + */ + public ObservationComponentComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Type getValue() { + return this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Quantity getValueQuantity() throws Exception { + if (!(this.value instanceof Quantity)) + throw new Exception("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Quantity) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public CodeableConcept getValueCodeableConcept() throws Exception { + if (!(this.value instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered"); + return (CodeableConcept) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public StringType getValueStringType() throws Exception { + if (!(this.value instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (StringType) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Range getValueRange() throws Exception { + if (!(this.value instanceof Range)) + throw new Exception("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Range) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Ratio getValueRatio() throws Exception { + if (!(this.value instanceof Ratio)) + throw new Exception("Type mismatch: the type Ratio was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Ratio) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public SampledData getValueSampledData() throws Exception { + if (!(this.value instanceof SampledData)) + throw new Exception("Type mismatch: the type SampledData was expected, but "+this.value.getClass().getName()+" was encountered"); + return (SampledData) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Attachment getValueAttachment() throws Exception { + if (!(this.value instanceof Attachment)) + throw new Exception("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Attachment) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public TimeType getValueTimeType() throws Exception { + if (!(this.value instanceof TimeType)) + throw new Exception("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (TimeType) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public DateTimeType getValueDateTimeType() throws Exception { + if (!(this.value instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (DateTimeType) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Period getValuePeriod() throws Exception { + if (!(this.value instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Period) this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public ObservationComponentComponent setValue(Type value) { + this.value = value; + return this; + } + + /** + * @return {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.value[x] is missing.) + */ + public CodeableConcept getDataAbsentReason() { + if (this.dataAbsentReason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationComponentComponent.dataAbsentReason"); + else if (Configuration.doAutoCreate()) + this.dataAbsentReason = new CodeableConcept(); // cc + return this.dataAbsentReason; + } + + public boolean hasDataAbsentReason() { + return this.dataAbsentReason != null && !this.dataAbsentReason.isEmpty(); + } + + /** + * @param value {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.value[x] is missing.) + */ + public ObservationComponentComponent setDataAbsentReason(CodeableConcept value) { + this.dataAbsentReason = value; + return this; + } + + /** + * @return {@link #referenceRange} (Guidance on how to interpret the value by comparison to a normal or recommended range.) + */ + public List getReferenceRange() { + if (this.referenceRange == null) + this.referenceRange = new ArrayList(); + return this.referenceRange; + } + + public boolean hasReferenceRange() { + if (this.referenceRange == null) + return false; + for (ObservationReferenceRangeComponent item : this.referenceRange) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #referenceRange} (Guidance on how to interpret the value by comparison to a normal or recommended range.) + */ + // syntactic sugar + public ObservationReferenceRangeComponent addReferenceRange() { //3 + ObservationReferenceRangeComponent t = new ObservationReferenceRangeComponent(); + if (this.referenceRange == null) + this.referenceRange = new ArrayList(); + this.referenceRange.add(t); + return t; + } + + // syntactic sugar + public ObservationComponentComponent addReferenceRange(ObservationReferenceRangeComponent t) { //3 + if (t == null) + return this; + if (this.referenceRange == null) + this.referenceRange = new ArrayList(); + this.referenceRange.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "Describes what was observed. Sometimes this is called the observation 'code'.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("value[x]", "Quantity|CodeableConcept|string|Range|Ratio|SampledData|Attachment|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("dataAbsentReason", "CodeableConcept", "Provides a reason why the expected value in the element Observation.value[x] is missing.", 0, java.lang.Integer.MAX_VALUE, dataAbsentReason)); + childrenList.add(new Property("referenceRange", "@Observation.referenceRange", "Guidance on how to interpret the value by comparison to a normal or recommended range.", 0, java.lang.Integer.MAX_VALUE, referenceRange)); + } + + public ObservationComponentComponent copy() { + ObservationComponentComponent dst = new ObservationComponentComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.value = value == null ? null : value.copy(); + dst.dataAbsentReason = dataAbsentReason == null ? null : dataAbsentReason.copy(); + if (referenceRange != null) { + dst.referenceRange = new ArrayList(); + for (ObservationReferenceRangeComponent i : referenceRange) + dst.referenceRange.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ObservationComponentComponent)) + return false; + ObservationComponentComponent o = (ObservationComponentComponent) other; + return compareDeep(code, o.code, true) && compareDeep(value, o.value, true) && compareDeep(dataAbsentReason, o.dataAbsentReason, true) + && compareDeep(referenceRange, o.referenceRange, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ObservationComponentComponent)) + return false; + ObservationComponentComponent o = (ObservationComponentComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (value == null || value.isEmpty()) + && (dataAbsentReason == null || dataAbsentReason.isEmpty()) && (referenceRange == null || referenceRange.isEmpty()) + ; + } + + } + + /** + * Describes what was observed. Sometimes this is called the observation "name". + */ + @Child(name = "code", type = {CodeableConcept.class}, order=0, min=1, max=1) + @Description(shortDefinition="Type of observation (code / type)", formalDefinition="Describes what was observed. Sometimes this is called the observation 'name'." ) + protected CodeableConcept code; + + /** + * Describes the general type of observation being made and is used to group or limit searching of observations. + */ + @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Classification of type of observation", formalDefinition="Describes the general type of observation being made and is used to group or limit searching of observations." ) + protected CodeableConcept category; + + /** + * The information determined as a result of making the observation, if the information has a simple value. + */ + @Child(name = "value", type = {Quantity.class, CodeableConcept.class, StringType.class, Range.class, Ratio.class, SampledData.class, Attachment.class, TimeType.class, DateTimeType.class, Period.class}, order=2, min=0, max=1) + @Description(shortDefinition="Actual result", formalDefinition="The information determined as a result of making the observation, if the information has a simple value." ) + protected Type value; + + /** + * Provides a reason why the expected value in the element Observation.value[x] is missing. + */ + @Child(name = "dataAbsentReason", type = {CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Why the result is missing", formalDefinition="Provides a reason why the expected value in the element Observation.value[x] is missing." ) + protected CodeableConcept dataAbsentReason; + + /** + * The assessment made based on the result of the observation. + */ + @Child(name = "interpretation", type = {CodeableConcept.class}, order=4, min=0, max=1) + @Description(shortDefinition="High, low, normal, etc.", formalDefinition="The assessment made based on the result of the observation." ) + protected CodeableConcept interpretation; + + /** + * May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result. + */ + @Child(name = "comments", type = {StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Comments about result", formalDefinition="May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result." ) + protected StringType comments; + + /** + * The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself. + */ + @Child(name = "applies", type = {DateTimeType.class, Period.class}, order=6, min=0, max=1) + @Description(shortDefinition="Physiologically Relevant time/time-period for observation", formalDefinition="The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the 'physiologically relevant time'. This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself." ) + protected Type applies; + + /** + * The date and time this observation was made available. + */ + @Child(name = "issued", type = {InstantType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Date/Time this was made available", formalDefinition="The date and time this observation was made available." ) + protected InstantType issued; + + /** + * The status of the result value. + */ + @Child(name = "status", type = {CodeType.class}, order=8, min=1, max=1) + @Description(shortDefinition="registered | preliminary | final | amended +", formalDefinition="The status of the result value." ) + protected Enumeration status; + + /** + * An estimate of the degree to which quality issues have impacted on the value reported. + */ + @Child(name = "reliability", type = {CodeType.class}, order=9, min=0, max=1) + @Description(shortDefinition="ok | ongoing | early | questionable | calibrating | error +", formalDefinition="An estimate of the degree to which quality issues have impacted on the value reported." ) + protected Enumeration reliability; + + /** + * Indicates the site on the subject's body where the observation was made ( i.e. the target site). + */ + @Child(name = "bodySite", type = {CodeableConcept.class, BodySite.class}, order=10, min=0, max=1) + @Description(shortDefinition="Observed body part", formalDefinition="Indicates the site on the subject's body where the observation was made ( i.e. the target site)." ) + protected Type bodySite; + + /** + * Indicates the mechanism used to perform the observation. + */ + @Child(name = "method", type = {CodeableConcept.class}, order=11, min=0, max=1) + @Description(shortDefinition="How it was done", formalDefinition="Indicates the mechanism used to perform the observation." ) + protected CodeableConcept method; + + /** + * A unique identifier for the simple observation. + */ + @Child(name = "identifier", type = {Identifier.class}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Unique Id for this particular observation", formalDefinition="A unique identifier for the simple observation." ) + protected List identifier; + + /** * The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, -other observer (for example a relative or EMT), or any observation made about the subject. - */ - @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Location.class}, order=12, min=0, max=1) - @Description(shortDefinition="Who and/or what this is about", formalDefinition="The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus,\nother observer (for example a relative or EMT), or any observation made about the subject." ) - protected Reference subject; - - /** +other observer (for example a relative or EMT), or any observation made about the subject. + */ + @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Location.class}, order=13, min=0, max=1) + @Description(shortDefinition="Who and/or what this is about", formalDefinition="The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus,\nother observer (for example a relative or EMT), or any observation made about the subject." ) + protected Reference subject; + + /** * The actual object that is the target of the reference (The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, -other observer (for example a relative or EMT), or any observation made about the subject.) - */ - protected Resource subjectTarget; - - /** - * The specimen that was used when this observation was made. - */ - @Child(name = "specimen", type = {Specimen.class}, order=13, min=0, max=1) - @Description(shortDefinition="Specimen used for this observation", formalDefinition="The specimen that was used when this observation was made." ) - protected Reference specimen; - - /** - * The actual object that is the target of the reference (The specimen that was used when this observation was made.) - */ - protected Specimen specimenTarget; - - /** - * Who was responsible for asserting the observed value as "true". - */ - @Child(name = "performer", type = {Practitioner.class, Organization.class, Patient.class, RelatedPerson.class}, order=14, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who did the observation", formalDefinition="Who was responsible for asserting the observed value as 'true'." ) - protected List performer; - /** - * The actual objects that are the target of the reference (Who was responsible for asserting the observed value as "true".) - */ - protected List performerTarget; - - - /** - * The device used to generate the observation data. - */ - @Child(name = "device", type = {Device.class, DeviceMetric.class}, order=15, min=0, max=1) - @Description(shortDefinition="(Measurement) Device", formalDefinition="The device used to generate the observation data." ) - protected Reference device; - - /** - * The actual object that is the target of the reference (The device used to generate the observation data.) - */ - protected Resource deviceTarget; - - /** - * The healthcare event ( e.g. a patient and healthcare provider interaction ) during which this observation is made. - */ - @Child(name = "encounter", type = {Encounter.class}, order=16, min=0, max=1) - @Description(shortDefinition="Healthcare event during which this observation is made", formalDefinition="The healthcare event ( e.g. a patient and healthcare provider interaction ) during which this observation is made." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The healthcare event ( e.g. a patient and healthcare provider interaction ) during which this observation is made.) - */ - protected Encounter encounterTarget; - - /** - * Guidance on how to interpret the value by comparison to a normal or recommended range. - */ - @Child(name = "referenceRange", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Provides guide for interpretation", formalDefinition="Guidance on how to interpret the value by comparison to a normal or recommended range." ) - protected List referenceRange; - - /** - * Related observations - either components, or previous observations, or statements of derivation. - */ - @Child(name = "related", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Observations related to this observation", formalDefinition="Related observations - either components, or previous observations, or statements of derivation." ) - protected List related; - - private static final long serialVersionUID = 1157047775L; - - /* - * Constructor - */ - public Observation() { - super(); - } - - /* - * Constructor - */ - public Observation(CodeableConcept code, Enumeration status) { - super(); - this.code = code; - this.status = status; - } - - /** - * @return {@link #code} (Describes what was observed. Sometimes this is called the observation "code".) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Describes what was observed. Sometimes this is called the observation "code".) - */ - public Observation setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Type getValue() { - return this.value; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Quantity getValueQuantity() throws Exception { - if (!(this.value instanceof Quantity)) - throw new Exception("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Quantity) this.value; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public CodeableConcept getValueCodeableConcept() throws Exception { - if (!(this.value instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered"); - return (CodeableConcept) this.value; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public StringType getValueStringType() throws Exception { - if (!(this.value instanceof StringType)) - throw new Exception("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (StringType) this.value; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Range getValueRange() throws Exception { - if (!(this.value instanceof Range)) - throw new Exception("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Range) this.value; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Ratio getValueRatio() throws Exception { - if (!(this.value instanceof Ratio)) - throw new Exception("Type mismatch: the type Ratio was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Ratio) this.value; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public SampledData getValueSampledData() throws Exception { - if (!(this.value instanceof SampledData)) - throw new Exception("Type mismatch: the type SampledData was expected, but "+this.value.getClass().getName()+" was encountered"); - return (SampledData) this.value; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Attachment getValueAttachment() throws Exception { - if (!(this.value instanceof Attachment)) - throw new Exception("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Attachment) this.value; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public TimeType getValueTimeType() throws Exception { - if (!(this.value instanceof TimeType)) - throw new Exception("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (TimeType) this.value; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public DateTimeType getValueDateTimeType() throws Exception { - if (!(this.value instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (DateTimeType) this.value; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Period getValuePeriod() throws Exception { - if (!(this.value instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Period) this.value; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Observation setValue(Type value) { - this.value = value; - return this; - } - - /** - * @return {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.value[x] is missing.) - */ - public CodeableConcept getDataAbsentReason() { - if (this.dataAbsentReason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.dataAbsentReason"); - else if (Configuration.doAutoCreate()) - this.dataAbsentReason = new CodeableConcept(); // cc - return this.dataAbsentReason; - } - - public boolean hasDataAbsentReason() { - return this.dataAbsentReason != null && !this.dataAbsentReason.isEmpty(); - } - - /** - * @param value {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.value[x] is missing.) - */ - public Observation setDataAbsentReason(CodeableConcept value) { - this.dataAbsentReason = value; - return this; - } - - /** - * @return {@link #interpretation} (The assessment made based on the result of the observation.) - */ - public CodeableConcept getInterpretation() { - if (this.interpretation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.interpretation"); - else if (Configuration.doAutoCreate()) - this.interpretation = new CodeableConcept(); // cc - return this.interpretation; - } - - public boolean hasInterpretation() { - return this.interpretation != null && !this.interpretation.isEmpty(); - } - - /** - * @param value {@link #interpretation} (The assessment made based on the result of the observation.) - */ - public Observation setInterpretation(CodeableConcept value) { - this.interpretation = value; - return this; - } - - /** - * @return {@link #comments} (May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public StringType getCommentsElement() { - if (this.comments == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.comments"); - else if (Configuration.doAutoCreate()) - this.comments = new StringType(); // bb - return this.comments; - } - - public boolean hasCommentsElement() { - return this.comments != null && !this.comments.isEmpty(); - } - - public boolean hasComments() { - return this.comments != null && !this.comments.isEmpty(); - } - - /** - * @param value {@link #comments} (May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public Observation setCommentsElement(StringType value) { - this.comments = value; - return this; - } - - /** - * @return May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result. - */ - public String getComments() { - return this.comments == null ? null : this.comments.getValue(); - } - - /** - * @param value May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result. - */ - public Observation setComments(String value) { - if (Utilities.noString(value)) - this.comments = null; - else { - if (this.comments == null) - this.comments = new StringType(); - this.comments.setValue(value); - } - return this; - } - - /** - * @return {@link #applies} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.) - */ - public Type getApplies() { - return this.applies; - } - - /** - * @return {@link #applies} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.) - */ - public DateTimeType getAppliesDateTimeType() throws Exception { - if (!(this.applies instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.applies.getClass().getName()+" was encountered"); - return (DateTimeType) this.applies; - } - - /** - * @return {@link #applies} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.) - */ - public Period getAppliesPeriod() throws Exception { - if (!(this.applies instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.applies.getClass().getName()+" was encountered"); - return (Period) this.applies; - } - - public boolean hasApplies() { - return this.applies != null && !this.applies.isEmpty(); - } - - /** - * @param value {@link #applies} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.) - */ - public Observation setApplies(Type value) { - this.applies = value; - return this; - } - - /** - * @return {@link #issued} (The date and time this observation was made available.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public InstantType getIssuedElement() { - if (this.issued == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.issued"); - else if (Configuration.doAutoCreate()) - this.issued = new InstantType(); // bb - return this.issued; - } - - public boolean hasIssuedElement() { - return this.issued != null && !this.issued.isEmpty(); - } - - public boolean hasIssued() { - return this.issued != null && !this.issued.isEmpty(); - } - - /** - * @param value {@link #issued} (The date and time this observation was made available.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public Observation setIssuedElement(InstantType value) { - this.issued = value; - return this; - } - - /** - * @return The date and time this observation was made available. - */ - public Date getIssued() { - return this.issued == null ? null : this.issued.getValue(); - } - - /** - * @param value The date and time this observation was made available. - */ - public Observation setIssued(Date value) { - if (value == null) - this.issued = null; - else { - if (this.issued == null) - this.issued = new InstantType(); - this.issued.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of the result value.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ObservationStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the result value.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Observation setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the result value. - */ - public ObservationStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the result value. - */ - public Observation setStatus(ObservationStatus value) { - if (this.status == null) - this.status = new Enumeration(new ObservationStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #reliability} (An estimate of the degree to which quality issues have impacted on the value reported.). This is the underlying object with id, value and extensions. The accessor "getReliability" gives direct access to the value - */ - public Enumeration getReliabilityElement() { - if (this.reliability == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.reliability"); - else if (Configuration.doAutoCreate()) - this.reliability = new Enumeration(new ObservationReliabilityEnumFactory()); // bb - return this.reliability; - } - - public boolean hasReliabilityElement() { - return this.reliability != null && !this.reliability.isEmpty(); - } - - public boolean hasReliability() { - return this.reliability != null && !this.reliability.isEmpty(); - } - - /** - * @param value {@link #reliability} (An estimate of the degree to which quality issues have impacted on the value reported.). This is the underlying object with id, value and extensions. The accessor "getReliability" gives direct access to the value - */ - public Observation setReliabilityElement(Enumeration value) { - this.reliability = value; - return this; - } - - /** - * @return An estimate of the degree to which quality issues have impacted on the value reported. - */ - public ObservationReliability getReliability() { - return this.reliability == null ? null : this.reliability.getValue(); - } - - /** - * @param value An estimate of the degree to which quality issues have impacted on the value reported. - */ - public Observation setReliability(ObservationReliability value) { - if (value == null) - this.reliability = null; - else { - if (this.reliability == null) - this.reliability = new Enumeration(new ObservationReliabilityEnumFactory()); - this.reliability.setValue(value); - } - return this; - } - - /** - * @return {@link #bodySite} (Indicates the site on the subject's body where the observation was made ( i.e. the target site).) - */ - public Type getBodySite() { - return this.bodySite; - } - - /** - * @return {@link #bodySite} (Indicates the site on the subject's body where the observation was made ( i.e. the target site).) - */ - public CodeableConcept getBodySiteCodeableConcept() throws Exception { - if (!(this.bodySite instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.bodySite.getClass().getName()+" was encountered"); - return (CodeableConcept) this.bodySite; - } - - /** - * @return {@link #bodySite} (Indicates the site on the subject's body where the observation was made ( i.e. the target site).) - */ - public Reference getBodySiteReference() throws Exception { - if (!(this.bodySite instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.bodySite.getClass().getName()+" was encountered"); - return (Reference) this.bodySite; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Indicates the site on the subject's body where the observation was made ( i.e. the target site).) - */ - public Observation setBodySite(Type value) { - this.bodySite = value; - return this; - } - - /** - * @return {@link #method} (Indicates the mechanism used to perform the observation.) - */ - public CodeableConcept getMethod() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.method"); - else if (Configuration.doAutoCreate()) - this.method = new CodeableConcept(); // cc - return this.method; - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** - * @param value {@link #method} (Indicates the mechanism used to perform the observation.) - */ - public Observation setMethod(CodeableConcept value) { - this.method = value; - return this; - } - - /** - * @return {@link #identifier} (A unique identifier for the simple observation.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (A unique identifier for the simple observation.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Observation addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** +other observer (for example a relative or EMT), or any observation made about the subject.) + */ + protected Resource subjectTarget; + + /** + * The specimen that was used when this observation was made. + */ + @Child(name = "specimen", type = {Specimen.class}, order=14, min=0, max=1) + @Description(shortDefinition="Specimen used for this observation", formalDefinition="The specimen that was used when this observation was made." ) + protected Reference specimen; + + /** + * The actual object that is the target of the reference (The specimen that was used when this observation was made.) + */ + protected Specimen specimenTarget; + + /** + * Who was responsible for asserting the observed value as "true". + */ + @Child(name = "performer", type = {Practitioner.class, Organization.class, Patient.class, RelatedPerson.class}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who is responsible for the observation", formalDefinition="Who was responsible for asserting the observed value as 'true'." ) + protected List performer; + /** + * The actual objects that are the target of the reference (Who was responsible for asserting the observed value as "true".) + */ + protected List performerTarget; + + + /** + * The device used to generate the observation data. + */ + @Child(name = "device", type = {Device.class, DeviceMetric.class}, order=16, min=0, max=1) + @Description(shortDefinition="(Measurement) Device", formalDefinition="The device used to generate the observation data." ) + protected Reference device; + + /** + * The actual object that is the target of the reference (The device used to generate the observation data.) + */ + protected Resource deviceTarget; + + /** + * The healthcare event ( e.g. a patient and healthcare provider interaction ) during which this observation is made. + */ + @Child(name = "encounter", type = {Encounter.class}, order=17, min=0, max=1) + @Description(shortDefinition="Healthcare event during which this observation is made", formalDefinition="The healthcare event ( e.g. a patient and healthcare provider interaction ) during which this observation is made." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The healthcare event ( e.g. a patient and healthcare provider interaction ) during which this observation is made.) + */ + protected Encounter encounterTarget; + + /** + * Guidance on how to interpret the value by comparison to a normal or recommended range. + */ + @Child(name = "referenceRange", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Provides guide for interpretation", formalDefinition="Guidance on how to interpret the value by comparison to a normal or recommended range." ) + protected List referenceRange; + + /** + * A reference to a resource from which this observation value is derived. For example an Observation resource for a calculated anion gap or Apgar score Observation or a QuestionnaireAnswer resource for an Assessment Tool Observation.( 5/18/2015 EH: TODO need to get a specific example /use cases for example using something other than Observtion). + */ + @Child(name = "derivedFrom", type = {AllergyIntolerance.class, Condition.class, FamilyMemberHistory.class, ImagingStudy.class, Immunization.class, MedicationStatement.class, Procedure.class, QuestionnaireAnswers.class, Observation.class}, order=19, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The resource from which an observation is derived", formalDefinition="A reference to a resource from which this observation value is derived. For example an Observation resource for a calculated anion gap or Apgar score Observation or a QuestionnaireAnswer resource for an Assessment Tool Observation.( 5/18/2015 EH: TODO need to get a specific example /use cases for example using something other than Observtion)." ) + protected List derivedFrom; + /** + * The actual objects that are the target of the reference (A reference to a resource from which this observation value is derived. For example an Observation resource for a calculated anion gap or Apgar score Observation or a QuestionnaireAnswer resource for an Assessment Tool Observation.( 5/18/2015 EH: TODO need to get a specific example /use cases for example using something other than Observtion).) + */ + protected List derivedFromTarget; + + + /** + * A reference to another observations whose relationship is defined by the relationship type code. + */ + @Child(name = "related", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Observations related to this observation", formalDefinition="A reference to another observations whose relationship is defined by the relationship type code." ) + protected List related; + + /** + * Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same metadata. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for for genetics observations. + */ + @Child(name = "component", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Component results", formalDefinition="Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same metadata. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for for genetics observations." ) + protected List component; + + private static final long serialVersionUID = -1610317643L; + + /* + * Constructor + */ + public Observation() { + super(); + } + + /* + * Constructor + */ + public Observation(CodeableConcept code, Enumeration status) { + super(); + this.code = code; + this.status = status; + } + + /** + * @return {@link #code} (Describes what was observed. Sometimes this is called the observation "name".) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Describes what was observed. Sometimes this is called the observation "name".) + */ + public Observation setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #category} (Describes the general type of observation being made and is used to group or limit searching of observations.) + */ + public CodeableConcept getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.category"); + else if (Configuration.doAutoCreate()) + this.category = new CodeableConcept(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Describes the general type of observation being made and is used to group or limit searching of observations.) + */ + public Observation setCategory(CodeableConcept value) { + this.category = value; + return this; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Type getValue() { + return this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Quantity getValueQuantity() throws Exception { + if (!(this.value instanceof Quantity)) + throw new Exception("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Quantity) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public CodeableConcept getValueCodeableConcept() throws Exception { + if (!(this.value instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered"); + return (CodeableConcept) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public StringType getValueStringType() throws Exception { + if (!(this.value instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (StringType) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Range getValueRange() throws Exception { + if (!(this.value instanceof Range)) + throw new Exception("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Range) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Ratio getValueRatio() throws Exception { + if (!(this.value instanceof Ratio)) + throw new Exception("Type mismatch: the type Ratio was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Ratio) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public SampledData getValueSampledData() throws Exception { + if (!(this.value instanceof SampledData)) + throw new Exception("Type mismatch: the type SampledData was expected, but "+this.value.getClass().getName()+" was encountered"); + return (SampledData) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Attachment getValueAttachment() throws Exception { + if (!(this.value instanceof Attachment)) + throw new Exception("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Attachment) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public TimeType getValueTimeType() throws Exception { + if (!(this.value instanceof TimeType)) + throw new Exception("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (TimeType) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public DateTimeType getValueDateTimeType() throws Exception { + if (!(this.value instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (DateTimeType) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Period getValuePeriod() throws Exception { + if (!(this.value instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Period) this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Observation setValue(Type value) { + this.value = value; + return this; + } + + /** + * @return {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.value[x] is missing.) + */ + public CodeableConcept getDataAbsentReason() { + if (this.dataAbsentReason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.dataAbsentReason"); + else if (Configuration.doAutoCreate()) + this.dataAbsentReason = new CodeableConcept(); // cc + return this.dataAbsentReason; + } + + public boolean hasDataAbsentReason() { + return this.dataAbsentReason != null && !this.dataAbsentReason.isEmpty(); + } + + /** + * @param value {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.value[x] is missing.) + */ + public Observation setDataAbsentReason(CodeableConcept value) { + this.dataAbsentReason = value; + return this; + } + + /** + * @return {@link #interpretation} (The assessment made based on the result of the observation.) + */ + public CodeableConcept getInterpretation() { + if (this.interpretation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.interpretation"); + else if (Configuration.doAutoCreate()) + this.interpretation = new CodeableConcept(); // cc + return this.interpretation; + } + + public boolean hasInterpretation() { + return this.interpretation != null && !this.interpretation.isEmpty(); + } + + /** + * @param value {@link #interpretation} (The assessment made based on the result of the observation.) + */ + public Observation setInterpretation(CodeableConcept value) { + this.interpretation = value; + return this; + } + + /** + * @return {@link #comments} (May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public StringType getCommentsElement() { + if (this.comments == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.comments"); + else if (Configuration.doAutoCreate()) + this.comments = new StringType(); // bb + return this.comments; + } + + public boolean hasCommentsElement() { + return this.comments != null && !this.comments.isEmpty(); + } + + public boolean hasComments() { + return this.comments != null && !this.comments.isEmpty(); + } + + /** + * @param value {@link #comments} (May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public Observation setCommentsElement(StringType value) { + this.comments = value; + return this; + } + + /** + * @return May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result. + */ + public String getComments() { + return this.comments == null ? null : this.comments.getValue(); + } + + /** + * @param value May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result. + */ + public Observation setComments(String value) { + if (Utilities.noString(value)) + this.comments = null; + else { + if (this.comments == null) + this.comments = new StringType(); + this.comments.setValue(value); + } + return this; + } + + /** + * @return {@link #applies} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.) + */ + public Type getApplies() { + return this.applies; + } + + /** + * @return {@link #applies} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.) + */ + public DateTimeType getAppliesDateTimeType() throws Exception { + if (!(this.applies instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.applies.getClass().getName()+" was encountered"); + return (DateTimeType) this.applies; + } + + /** + * @return {@link #applies} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.) + */ + public Period getAppliesPeriod() throws Exception { + if (!(this.applies instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.applies.getClass().getName()+" was encountered"); + return (Period) this.applies; + } + + public boolean hasApplies() { + return this.applies != null && !this.applies.isEmpty(); + } + + /** + * @param value {@link #applies} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.) + */ + public Observation setApplies(Type value) { + this.applies = value; + return this; + } + + /** + * @return {@link #issued} (The date and time this observation was made available.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public InstantType getIssuedElement() { + if (this.issued == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.issued"); + else if (Configuration.doAutoCreate()) + this.issued = new InstantType(); // bb + return this.issued; + } + + public boolean hasIssuedElement() { + return this.issued != null && !this.issued.isEmpty(); + } + + public boolean hasIssued() { + return this.issued != null && !this.issued.isEmpty(); + } + + /** + * @param value {@link #issued} (The date and time this observation was made available.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public Observation setIssuedElement(InstantType value) { + this.issued = value; + return this; + } + + /** + * @return The date and time this observation was made available. + */ + public Date getIssued() { + return this.issued == null ? null : this.issued.getValue(); + } + + /** + * @param value The date and time this observation was made available. + */ + public Observation setIssued(Date value) { + if (value == null) + this.issued = null; + else { + if (this.issued == null) + this.issued = new InstantType(); + this.issued.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of the result value.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ObservationStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status of the result value.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Observation setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the result value. + */ + public ObservationStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the result value. + */ + public Observation setStatus(ObservationStatus value) { + if (this.status == null) + this.status = new Enumeration(new ObservationStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #reliability} (An estimate of the degree to which quality issues have impacted on the value reported.). This is the underlying object with id, value and extensions. The accessor "getReliability" gives direct access to the value + */ + public Enumeration getReliabilityElement() { + if (this.reliability == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.reliability"); + else if (Configuration.doAutoCreate()) + this.reliability = new Enumeration(new ObservationReliabilityEnumFactory()); // bb + return this.reliability; + } + + public boolean hasReliabilityElement() { + return this.reliability != null && !this.reliability.isEmpty(); + } + + public boolean hasReliability() { + return this.reliability != null && !this.reliability.isEmpty(); + } + + /** + * @param value {@link #reliability} (An estimate of the degree to which quality issues have impacted on the value reported.). This is the underlying object with id, value and extensions. The accessor "getReliability" gives direct access to the value + */ + public Observation setReliabilityElement(Enumeration value) { + this.reliability = value; + return this; + } + + /** + * @return An estimate of the degree to which quality issues have impacted on the value reported. + */ + public ObservationReliability getReliability() { + return this.reliability == null ? null : this.reliability.getValue(); + } + + /** + * @param value An estimate of the degree to which quality issues have impacted on the value reported. + */ + public Observation setReliability(ObservationReliability value) { + if (value == null) + this.reliability = null; + else { + if (this.reliability == null) + this.reliability = new Enumeration(new ObservationReliabilityEnumFactory()); + this.reliability.setValue(value); + } + return this; + } + + /** + * @return {@link #bodySite} (Indicates the site on the subject's body where the observation was made ( i.e. the target site).) + */ + public Type getBodySite() { + return this.bodySite; + } + + /** + * @return {@link #bodySite} (Indicates the site on the subject's body where the observation was made ( i.e. the target site).) + */ + public CodeableConcept getBodySiteCodeableConcept() throws Exception { + if (!(this.bodySite instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.bodySite.getClass().getName()+" was encountered"); + return (CodeableConcept) this.bodySite; + } + + /** + * @return {@link #bodySite} (Indicates the site on the subject's body where the observation was made ( i.e. the target site).) + */ + public Reference getBodySiteReference() throws Exception { + if (!(this.bodySite instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.bodySite.getClass().getName()+" was encountered"); + return (Reference) this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Indicates the site on the subject's body where the observation was made ( i.e. the target site).) + */ + public Observation setBodySite(Type value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #method} (Indicates the mechanism used to perform the observation.) + */ + public CodeableConcept getMethod() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.method"); + else if (Configuration.doAutoCreate()) + this.method = new CodeableConcept(); // cc + return this.method; + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** + * @param value {@link #method} (Indicates the mechanism used to perform the observation.) + */ + public Observation setMethod(CodeableConcept value) { + this.method = value; + return this; + } + + /** + * @return {@link #identifier} (A unique identifier for the simple observation.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (A unique identifier for the simple observation.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Observation addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** * @return {@link #subject} (The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, -other observer (for example a relative or EMT), or any observation made about the subject.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** +other observer (for example a relative or EMT), or any observation made about the subject.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** * @param value {@link #subject} (The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, -other observer (for example a relative or EMT), or any observation made about the subject.) - */ - public Observation setSubject(Reference value) { - this.subject = value; - return this; - } - - /** +other observer (for example a relative or EMT), or any observation made about the subject.) + */ + public Observation setSubject(Reference value) { + this.subject = value; + return this; + } + + /** * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, -other observer (for example a relative or EMT), or any observation made about the subject.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** +other observer (for example a relative or EMT), or any observation made about the subject.) + */ + public Resource getSubjectTarget() { + return this.subjectTarget; + } + + /** * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, -other observer (for example a relative or EMT), or any observation made about the subject.) - */ - public Observation setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #specimen} (The specimen that was used when this observation was made.) - */ - public Reference getSpecimen() { - if (this.specimen == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.specimen"); - else if (Configuration.doAutoCreate()) - this.specimen = new Reference(); // cc - return this.specimen; - } - - public boolean hasSpecimen() { - return this.specimen != null && !this.specimen.isEmpty(); - } - - /** - * @param value {@link #specimen} (The specimen that was used when this observation was made.) - */ - public Observation setSpecimen(Reference value) { - this.specimen = value; - return this; - } - - /** - * @return {@link #specimen} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The specimen that was used when this observation was made.) - */ - public Specimen getSpecimenTarget() { - if (this.specimenTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.specimen"); - else if (Configuration.doAutoCreate()) - this.specimenTarget = new Specimen(); // aa - return this.specimenTarget; - } - - /** - * @param value {@link #specimen} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The specimen that was used when this observation was made.) - */ - public Observation setSpecimenTarget(Specimen value) { - this.specimenTarget = value; - return this; - } - - /** - * @return {@link #performer} (Who was responsible for asserting the observed value as "true".) - */ - public List getPerformer() { - if (this.performer == null) - this.performer = new ArrayList(); - return this.performer; - } - - public boolean hasPerformer() { - if (this.performer == null) - return false; - for (Reference item : this.performer) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #performer} (Who was responsible for asserting the observed value as "true".) - */ - // syntactic sugar - public Reference addPerformer() { //3 - Reference t = new Reference(); - if (this.performer == null) - this.performer = new ArrayList(); - this.performer.add(t); - return t; - } - - // syntactic sugar - public Observation addPerformer(Reference t) { //3 - if (t == null) - return this; - if (this.performer == null) - this.performer = new ArrayList(); - this.performer.add(t); - return this; - } - - /** - * @return {@link #performer} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Who was responsible for asserting the observed value as "true".) - */ - public List getPerformerTarget() { - if (this.performerTarget == null) - this.performerTarget = new ArrayList(); - return this.performerTarget; - } - - /** - * @return {@link #device} (The device used to generate the observation data.) - */ - public Reference getDevice() { - if (this.device == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.device"); - else if (Configuration.doAutoCreate()) - this.device = new Reference(); // cc - return this.device; - } - - public boolean hasDevice() { - return this.device != null && !this.device.isEmpty(); - } - - /** - * @param value {@link #device} (The device used to generate the observation data.) - */ - public Observation setDevice(Reference value) { - this.device = value; - return this; - } - - /** - * @return {@link #device} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The device used to generate the observation data.) - */ - public Resource getDeviceTarget() { - return this.deviceTarget; - } - - /** - * @param value {@link #device} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The device used to generate the observation data.) - */ - public Observation setDeviceTarget(Resource value) { - this.deviceTarget = value; - return this; - } - - /** - * @return {@link #encounter} (The healthcare event ( e.g. a patient and healthcare provider interaction ) during which this observation is made.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (The healthcare event ( e.g. a patient and healthcare provider interaction ) during which this observation is made.) - */ - public Observation setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The healthcare event ( e.g. a patient and healthcare provider interaction ) during which this observation is made.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The healthcare event ( e.g. a patient and healthcare provider interaction ) during which this observation is made.) - */ - public Observation setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #referenceRange} (Guidance on how to interpret the value by comparison to a normal or recommended range.) - */ - public List getReferenceRange() { - if (this.referenceRange == null) - this.referenceRange = new ArrayList(); - return this.referenceRange; - } - - public boolean hasReferenceRange() { - if (this.referenceRange == null) - return false; - for (ObservationReferenceRangeComponent item : this.referenceRange) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #referenceRange} (Guidance on how to interpret the value by comparison to a normal or recommended range.) - */ - // syntactic sugar - public ObservationReferenceRangeComponent addReferenceRange() { //3 - ObservationReferenceRangeComponent t = new ObservationReferenceRangeComponent(); - if (this.referenceRange == null) - this.referenceRange = new ArrayList(); - this.referenceRange.add(t); - return t; - } - - // syntactic sugar - public Observation addReferenceRange(ObservationReferenceRangeComponent t) { //3 - if (t == null) - return this; - if (this.referenceRange == null) - this.referenceRange = new ArrayList(); - this.referenceRange.add(t); - return this; - } - - /** - * @return {@link #related} (Related observations - either components, or previous observations, or statements of derivation.) - */ - public List getRelated() { - if (this.related == null) - this.related = new ArrayList(); - return this.related; - } - - public boolean hasRelated() { - if (this.related == null) - return false; - for (ObservationRelatedComponent item : this.related) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #related} (Related observations - either components, or previous observations, or statements of derivation.) - */ - // syntactic sugar - public ObservationRelatedComponent addRelated() { //3 - ObservationRelatedComponent t = new ObservationRelatedComponent(); - if (this.related == null) - this.related = new ArrayList(); - this.related.add(t); - return t; - } - - // syntactic sugar - public Observation addRelated(ObservationRelatedComponent t) { //3 - if (t == null) - return this; - if (this.related == null) - this.related = new ArrayList(); - this.related.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "Describes what was observed. Sometimes this is called the observation 'code'.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("value[x]", "Quantity|CodeableConcept|string|Range|Ratio|SampledData|Attachment|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("dataAbsentReason", "CodeableConcept", "Provides a reason why the expected value in the element Observation.value[x] is missing.", 0, java.lang.Integer.MAX_VALUE, dataAbsentReason)); - childrenList.add(new Property("interpretation", "CodeableConcept", "The assessment made based on the result of the observation.", 0, java.lang.Integer.MAX_VALUE, interpretation)); - childrenList.add(new Property("comments", "string", "May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.", 0, java.lang.Integer.MAX_VALUE, comments)); - childrenList.add(new Property("applies[x]", "dateTime|Period", "The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the 'physiologically relevant time'. This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.", 0, java.lang.Integer.MAX_VALUE, applies)); - childrenList.add(new Property("issued", "instant", "The date and time this observation was made available.", 0, java.lang.Integer.MAX_VALUE, issued)); - childrenList.add(new Property("status", "code", "The status of the result value.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("reliability", "code", "An estimate of the degree to which quality issues have impacted on the value reported.", 0, java.lang.Integer.MAX_VALUE, reliability)); - childrenList.add(new Property("bodySite[x]", "CodeableConcept|Reference(BodySite)", "Indicates the site on the subject's body where the observation was made ( i.e. the target site).", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("method", "CodeableConcept", "Indicates the mechanism used to perform the observation.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("identifier", "Identifier", "A unique identifier for the simple observation.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus,\nother observer (for example a relative or EMT), or any observation made about the subject.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("specimen", "Reference(Specimen)", "The specimen that was used when this observation was made.", 0, java.lang.Integer.MAX_VALUE, specimen)); - childrenList.add(new Property("performer", "Reference(Practitioner|Organization|Patient|RelatedPerson)", "Who was responsible for asserting the observed value as 'true'.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("device", "Reference(Device|DeviceMetric)", "The device used to generate the observation data.", 0, java.lang.Integer.MAX_VALUE, device)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The healthcare event ( e.g. a patient and healthcare provider interaction ) during which this observation is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("referenceRange", "", "Guidance on how to interpret the value by comparison to a normal or recommended range.", 0, java.lang.Integer.MAX_VALUE, referenceRange)); - childrenList.add(new Property("related", "", "Related observations - either components, or previous observations, or statements of derivation.", 0, java.lang.Integer.MAX_VALUE, related)); - } - - public Observation copy() { - Observation dst = new Observation(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.value = value == null ? null : value.copy(); - dst.dataAbsentReason = dataAbsentReason == null ? null : dataAbsentReason.copy(); - dst.interpretation = interpretation == null ? null : interpretation.copy(); - dst.comments = comments == null ? null : comments.copy(); - dst.applies = applies == null ? null : applies.copy(); - dst.issued = issued == null ? null : issued.copy(); - dst.status = status == null ? null : status.copy(); - dst.reliability = reliability == null ? null : reliability.copy(); - dst.bodySite = bodySite == null ? null : bodySite.copy(); - dst.method = method == null ? null : method.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.subject = subject == null ? null : subject.copy(); - dst.specimen = specimen == null ? null : specimen.copy(); - if (performer != null) { - dst.performer = new ArrayList(); - for (Reference i : performer) - dst.performer.add(i.copy()); - }; - dst.device = device == null ? null : device.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - if (referenceRange != null) { - dst.referenceRange = new ArrayList(); - for (ObservationReferenceRangeComponent i : referenceRange) - dst.referenceRange.add(i.copy()); - }; - if (related != null) { - dst.related = new ArrayList(); - for (ObservationRelatedComponent i : related) - dst.related.add(i.copy()); - }; - return dst; - } - - protected Observation typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Observation)) - return false; - Observation o = (Observation) other; - return compareDeep(code, o.code, true) && compareDeep(value, o.value, true) && compareDeep(dataAbsentReason, o.dataAbsentReason, true) - && compareDeep(interpretation, o.interpretation, true) && compareDeep(comments, o.comments, true) - && compareDeep(applies, o.applies, true) && compareDeep(issued, o.issued, true) && compareDeep(status, o.status, true) - && compareDeep(reliability, o.reliability, true) && compareDeep(bodySite, o.bodySite, true) && compareDeep(method, o.method, true) - && compareDeep(identifier, o.identifier, true) && compareDeep(subject, o.subject, true) && compareDeep(specimen, o.specimen, true) - && compareDeep(performer, o.performer, true) && compareDeep(device, o.device, true) && compareDeep(encounter, o.encounter, true) - && compareDeep(referenceRange, o.referenceRange, true) && compareDeep(related, o.related, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Observation)) - return false; - Observation o = (Observation) other; - return compareValues(comments, o.comments, true) && compareValues(issued, o.issued, true) && compareValues(status, o.status, true) - && compareValues(reliability, o.reliability, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (value == null || value.isEmpty()) - && (dataAbsentReason == null || dataAbsentReason.isEmpty()) && (interpretation == null || interpretation.isEmpty()) - && (comments == null || comments.isEmpty()) && (applies == null || applies.isEmpty()) && (issued == null || issued.isEmpty()) - && (status == null || status.isEmpty()) && (reliability == null || reliability.isEmpty()) - && (bodySite == null || bodySite.isEmpty()) && (method == null || method.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (subject == null || subject.isEmpty()) && (specimen == null || specimen.isEmpty()) && (performer == null || performer.isEmpty()) - && (device == null || device.isEmpty()) && (encounter == null || encounter.isEmpty()) && (referenceRange == null || referenceRange.isEmpty()) - && (related == null || related.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Observation; - } - - @SearchParamDefinition(name="value-string", path="Observation.valueString", description="The value of the observation, if the value is a string, and also searches in CodeableConcept.text", type="string" ) - public static final String SP_VALUESTRING = "value-string"; - @SearchParamDefinition(name="status", path="Observation.status", description="The status of the observation", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="subject", path="Observation.subject", description="The subject that the observation is about", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="value-concept", path="Observation.valueCodeableConcept", description="The value of the observation, if the value is a CodeableConcept", type="token" ) - public static final String SP_VALUECONCEPT = "value-concept"; - @SearchParamDefinition(name="reliability", path="Observation.reliability", description="The reliability of the observation", type="token" ) - public static final String SP_RELIABILITY = "reliability"; - @SearchParamDefinition(name="encounter", path="Observation.encounter", description="Healthcare event related to the observation", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - @SearchParamDefinition(name="code", path="Observation.code", description="The code of the observation type", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="date", path="Observation.applies[x]", description="Obtained date/time. If the obtained element is a period, a date that falls in the period", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="related-target", path="Observation.related.target", description="Observation that is related to this one", type="reference" ) - public static final String SP_RELATEDTARGET = "related-target"; - @SearchParamDefinition(name="data-absent-reason", path="Observation.dataAbsentReason", description="The reason why the expected value in the element Observation.value[x] is missing.", type="token" ) - public static final String SP_DATAABSENTREASON = "data-absent-reason"; - @SearchParamDefinition(name="related", path="", description="Related Observations - search on related-type and related-target together", type="composite" ) - public static final String SP_RELATED = "related"; - @SearchParamDefinition(name="patient", path="Observation.subject", description="The subject that the observation is about (if patient)", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="specimen", path="Observation.specimen", description="Specimen used for this observation", type="reference" ) - public static final String SP_SPECIMEN = "specimen"; - @SearchParamDefinition(name="device", path="Observation.device", description="The Device that generated the observation data.", type="reference" ) - public static final String SP_DEVICE = "device"; - @SearchParamDefinition(name="related-type", path="Observation.related.type", description="has-component | has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by", type="token" ) - public static final String SP_RELATEDTYPE = "related-type"; - @SearchParamDefinition(name="performer", path="Observation.performer", description="Who performed the observation", type="reference" ) - public static final String SP_PERFORMER = "performer"; - @SearchParamDefinition(name="identifier", path="Observation.identifier", description="The unique Id for a particular observation", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="value-quantity", path="Observation.valueQuantity", description="The value of the observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)", type="quantity" ) - public static final String SP_VALUEQUANTITY = "value-quantity"; - @SearchParamDefinition(name="code-value-[x]", path="", description="Both code and one of the value parameters", type="composite" ) - public static final String SP_CODEVALUEX = "code-value-[x]"; - @SearchParamDefinition(name="value-date", path="Observation.valueDateTime|Observation.valuePeriod", description="The value of the observation, if the value is a Period", type="date" ) - public static final String SP_VALUEDATE = "value-date"; - -} - +other observer (for example a relative or EMT), or any observation made about the subject.) + */ + public Observation setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #specimen} (The specimen that was used when this observation was made.) + */ + public Reference getSpecimen() { + if (this.specimen == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.specimen"); + else if (Configuration.doAutoCreate()) + this.specimen = new Reference(); // cc + return this.specimen; + } + + public boolean hasSpecimen() { + return this.specimen != null && !this.specimen.isEmpty(); + } + + /** + * @param value {@link #specimen} (The specimen that was used when this observation was made.) + */ + public Observation setSpecimen(Reference value) { + this.specimen = value; + return this; + } + + /** + * @return {@link #specimen} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The specimen that was used when this observation was made.) + */ + public Specimen getSpecimenTarget() { + if (this.specimenTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.specimen"); + else if (Configuration.doAutoCreate()) + this.specimenTarget = new Specimen(); // aa + return this.specimenTarget; + } + + /** + * @param value {@link #specimen} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The specimen that was used when this observation was made.) + */ + public Observation setSpecimenTarget(Specimen value) { + this.specimenTarget = value; + return this; + } + + /** + * @return {@link #performer} (Who was responsible for asserting the observed value as "true".) + */ + public List getPerformer() { + if (this.performer == null) + this.performer = new ArrayList(); + return this.performer; + } + + public boolean hasPerformer() { + if (this.performer == null) + return false; + for (Reference item : this.performer) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #performer} (Who was responsible for asserting the observed value as "true".) + */ + // syntactic sugar + public Reference addPerformer() { //3 + Reference t = new Reference(); + if (this.performer == null) + this.performer = new ArrayList(); + this.performer.add(t); + return t; + } + + // syntactic sugar + public Observation addPerformer(Reference t) { //3 + if (t == null) + return this; + if (this.performer == null) + this.performer = new ArrayList(); + this.performer.add(t); + return this; + } + + /** + * @return {@link #performer} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Who was responsible for asserting the observed value as "true".) + */ + public List getPerformerTarget() { + if (this.performerTarget == null) + this.performerTarget = new ArrayList(); + return this.performerTarget; + } + + /** + * @return {@link #device} (The device used to generate the observation data.) + */ + public Reference getDevice() { + if (this.device == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.device"); + else if (Configuration.doAutoCreate()) + this.device = new Reference(); // cc + return this.device; + } + + public boolean hasDevice() { + return this.device != null && !this.device.isEmpty(); + } + + /** + * @param value {@link #device} (The device used to generate the observation data.) + */ + public Observation setDevice(Reference value) { + this.device = value; + return this; + } + + /** + * @return {@link #device} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The device used to generate the observation data.) + */ + public Resource getDeviceTarget() { + return this.deviceTarget; + } + + /** + * @param value {@link #device} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The device used to generate the observation data.) + */ + public Observation setDeviceTarget(Resource value) { + this.deviceTarget = value; + return this; + } + + /** + * @return {@link #encounter} (The healthcare event ( e.g. a patient and healthcare provider interaction ) during which this observation is made.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (The healthcare event ( e.g. a patient and healthcare provider interaction ) during which this observation is made.) + */ + public Observation setEncounter(Reference value) { + this.encounter = value; + return this; + } + + /** + * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The healthcare event ( e.g. a patient and healthcare provider interaction ) during which this observation is made.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + return this.encounterTarget; + } + + /** + * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The healthcare event ( e.g. a patient and healthcare provider interaction ) during which this observation is made.) + */ + public Observation setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #referenceRange} (Guidance on how to interpret the value by comparison to a normal or recommended range.) + */ + public List getReferenceRange() { + if (this.referenceRange == null) + this.referenceRange = new ArrayList(); + return this.referenceRange; + } + + public boolean hasReferenceRange() { + if (this.referenceRange == null) + return false; + for (ObservationReferenceRangeComponent item : this.referenceRange) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #referenceRange} (Guidance on how to interpret the value by comparison to a normal or recommended range.) + */ + // syntactic sugar + public ObservationReferenceRangeComponent addReferenceRange() { //3 + ObservationReferenceRangeComponent t = new ObservationReferenceRangeComponent(); + if (this.referenceRange == null) + this.referenceRange = new ArrayList(); + this.referenceRange.add(t); + return t; + } + + // syntactic sugar + public Observation addReferenceRange(ObservationReferenceRangeComponent t) { //3 + if (t == null) + return this; + if (this.referenceRange == null) + this.referenceRange = new ArrayList(); + this.referenceRange.add(t); + return this; + } + + /** + * @return {@link #derivedFrom} (A reference to a resource from which this observation value is derived. For example an Observation resource for a calculated anion gap or Apgar score Observation or a QuestionnaireAnswer resource for an Assessment Tool Observation.( 5/18/2015 EH: TODO need to get a specific example /use cases for example using something other than Observtion).) + */ + public List getDerivedFrom() { + if (this.derivedFrom == null) + this.derivedFrom = new ArrayList(); + return this.derivedFrom; + } + + public boolean hasDerivedFrom() { + if (this.derivedFrom == null) + return false; + for (Reference item : this.derivedFrom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #derivedFrom} (A reference to a resource from which this observation value is derived. For example an Observation resource for a calculated anion gap or Apgar score Observation or a QuestionnaireAnswer resource for an Assessment Tool Observation.( 5/18/2015 EH: TODO need to get a specific example /use cases for example using something other than Observtion).) + */ + // syntactic sugar + public Reference addDerivedFrom() { //3 + Reference t = new Reference(); + if (this.derivedFrom == null) + this.derivedFrom = new ArrayList(); + this.derivedFrom.add(t); + return t; + } + + // syntactic sugar + public Observation addDerivedFrom(Reference t) { //3 + if (t == null) + return this; + if (this.derivedFrom == null) + this.derivedFrom = new ArrayList(); + this.derivedFrom.add(t); + return this; + } + + /** + * @return {@link #derivedFrom} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A reference to a resource from which this observation value is derived. For example an Observation resource for a calculated anion gap or Apgar score Observation or a QuestionnaireAnswer resource for an Assessment Tool Observation.( 5/18/2015 EH: TODO need to get a specific example /use cases for example using something other than Observtion).) + */ + public List getDerivedFromTarget() { + if (this.derivedFromTarget == null) + this.derivedFromTarget = new ArrayList(); + return this.derivedFromTarget; + } + + /** + * @return {@link #related} (A reference to another observations whose relationship is defined by the relationship type code.) + */ + public List getRelated() { + if (this.related == null) + this.related = new ArrayList(); + return this.related; + } + + public boolean hasRelated() { + if (this.related == null) + return false; + for (ObservationRelatedComponent item : this.related) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #related} (A reference to another observations whose relationship is defined by the relationship type code.) + */ + // syntactic sugar + public ObservationRelatedComponent addRelated() { //3 + ObservationRelatedComponent t = new ObservationRelatedComponent(); + if (this.related == null) + this.related = new ArrayList(); + this.related.add(t); + return t; + } + + // syntactic sugar + public Observation addRelated(ObservationRelatedComponent t) { //3 + if (t == null) + return this; + if (this.related == null) + this.related = new ArrayList(); + this.related.add(t); + return this; + } + + /** + * @return {@link #component} (Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same metadata. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for for genetics observations.) + */ + public List getComponent() { + if (this.component == null) + this.component = new ArrayList(); + return this.component; + } + + public boolean hasComponent() { + if (this.component == null) + return false; + for (ObservationComponentComponent item : this.component) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #component} (Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same metadata. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for for genetics observations.) + */ + // syntactic sugar + public ObservationComponentComponent addComponent() { //3 + ObservationComponentComponent t = new ObservationComponentComponent(); + if (this.component == null) + this.component = new ArrayList(); + this.component.add(t); + return t; + } + + // syntactic sugar + public Observation addComponent(ObservationComponentComponent t) { //3 + if (t == null) + return this; + if (this.component == null) + this.component = new ArrayList(); + this.component.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "Describes what was observed. Sometimes this is called the observation 'name'.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("category", "CodeableConcept", "Describes the general type of observation being made and is used to group or limit searching of observations.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("value[x]", "Quantity|CodeableConcept|string|Range|Ratio|SampledData|Attachment|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("dataAbsentReason", "CodeableConcept", "Provides a reason why the expected value in the element Observation.value[x] is missing.", 0, java.lang.Integer.MAX_VALUE, dataAbsentReason)); + childrenList.add(new Property("interpretation", "CodeableConcept", "The assessment made based on the result of the observation.", 0, java.lang.Integer.MAX_VALUE, interpretation)); + childrenList.add(new Property("comments", "string", "May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.", 0, java.lang.Integer.MAX_VALUE, comments)); + childrenList.add(new Property("applies[x]", "dateTime|Period", "The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the 'physiologically relevant time'. This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.", 0, java.lang.Integer.MAX_VALUE, applies)); + childrenList.add(new Property("issued", "instant", "The date and time this observation was made available.", 0, java.lang.Integer.MAX_VALUE, issued)); + childrenList.add(new Property("status", "code", "The status of the result value.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("reliability", "code", "An estimate of the degree to which quality issues have impacted on the value reported.", 0, java.lang.Integer.MAX_VALUE, reliability)); + childrenList.add(new Property("bodySite[x]", "CodeableConcept|Reference(BodySite)", "Indicates the site on the subject's body where the observation was made ( i.e. the target site).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("method", "CodeableConcept", "Indicates the mechanism used to perform the observation.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("identifier", "Identifier", "A unique identifier for the simple observation.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus,\nother observer (for example a relative or EMT), or any observation made about the subject.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("specimen", "Reference(Specimen)", "The specimen that was used when this observation was made.", 0, java.lang.Integer.MAX_VALUE, specimen)); + childrenList.add(new Property("performer", "Reference(Practitioner|Organization|Patient|RelatedPerson)", "Who was responsible for asserting the observed value as 'true'.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("device", "Reference(Device|DeviceMetric)", "The device used to generate the observation data.", 0, java.lang.Integer.MAX_VALUE, device)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The healthcare event ( e.g. a patient and healthcare provider interaction ) during which this observation is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("referenceRange", "", "Guidance on how to interpret the value by comparison to a normal or recommended range.", 0, java.lang.Integer.MAX_VALUE, referenceRange)); + childrenList.add(new Property("derivedFrom", "Reference(AllergyIntolerance|Condition|FamilyMemberHistory|ImagingStudy|Immunization|MedicationStatement|Procedure|QuestionnaireAnswers|Observation)", "A reference to a resource from which this observation value is derived. For example an Observation resource for a calculated anion gap or Apgar score Observation or a QuestionnaireAnswer resource for an Assessment Tool Observation.( 5/18/2015 EH: TODO need to get a specific example /use cases for example using something other than Observtion).", 0, java.lang.Integer.MAX_VALUE, derivedFrom)); + childrenList.add(new Property("related", "", "A reference to another observations whose relationship is defined by the relationship type code.", 0, java.lang.Integer.MAX_VALUE, related)); + childrenList.add(new Property("component", "", "Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same metadata. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for for genetics observations.", 0, java.lang.Integer.MAX_VALUE, component)); + } + + public Observation copy() { + Observation dst = new Observation(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.category = category == null ? null : category.copy(); + dst.value = value == null ? null : value.copy(); + dst.dataAbsentReason = dataAbsentReason == null ? null : dataAbsentReason.copy(); + dst.interpretation = interpretation == null ? null : interpretation.copy(); + dst.comments = comments == null ? null : comments.copy(); + dst.applies = applies == null ? null : applies.copy(); + dst.issued = issued == null ? null : issued.copy(); + dst.status = status == null ? null : status.copy(); + dst.reliability = reliability == null ? null : reliability.copy(); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + dst.method = method == null ? null : method.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.subject = subject == null ? null : subject.copy(); + dst.specimen = specimen == null ? null : specimen.copy(); + if (performer != null) { + dst.performer = new ArrayList(); + for (Reference i : performer) + dst.performer.add(i.copy()); + }; + dst.device = device == null ? null : device.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + if (referenceRange != null) { + dst.referenceRange = new ArrayList(); + for (ObservationReferenceRangeComponent i : referenceRange) + dst.referenceRange.add(i.copy()); + }; + if (derivedFrom != null) { + dst.derivedFrom = new ArrayList(); + for (Reference i : derivedFrom) + dst.derivedFrom.add(i.copy()); + }; + if (related != null) { + dst.related = new ArrayList(); + for (ObservationRelatedComponent i : related) + dst.related.add(i.copy()); + }; + if (component != null) { + dst.component = new ArrayList(); + for (ObservationComponentComponent i : component) + dst.component.add(i.copy()); + }; + return dst; + } + + protected Observation typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Observation)) + return false; + Observation o = (Observation) other; + return compareDeep(code, o.code, true) && compareDeep(category, o.category, true) && compareDeep(value, o.value, true) + && compareDeep(dataAbsentReason, o.dataAbsentReason, true) && compareDeep(interpretation, o.interpretation, true) + && compareDeep(comments, o.comments, true) && compareDeep(applies, o.applies, true) && compareDeep(issued, o.issued, true) + && compareDeep(status, o.status, true) && compareDeep(reliability, o.reliability, true) && compareDeep(bodySite, o.bodySite, true) + && compareDeep(method, o.method, true) && compareDeep(identifier, o.identifier, true) && compareDeep(subject, o.subject, true) + && compareDeep(specimen, o.specimen, true) && compareDeep(performer, o.performer, true) && compareDeep(device, o.device, true) + && compareDeep(encounter, o.encounter, true) && compareDeep(referenceRange, o.referenceRange, true) + && compareDeep(derivedFrom, o.derivedFrom, true) && compareDeep(related, o.related, true) && compareDeep(component, o.component, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Observation)) + return false; + Observation o = (Observation) other; + return compareValues(comments, o.comments, true) && compareValues(issued, o.issued, true) && compareValues(status, o.status, true) + && compareValues(reliability, o.reliability, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (category == null || category.isEmpty()) + && (value == null || value.isEmpty()) && (dataAbsentReason == null || dataAbsentReason.isEmpty()) + && (interpretation == null || interpretation.isEmpty()) && (comments == null || comments.isEmpty()) + && (applies == null || applies.isEmpty()) && (issued == null || issued.isEmpty()) && (status == null || status.isEmpty()) + && (reliability == null || reliability.isEmpty()) && (bodySite == null || bodySite.isEmpty()) + && (method == null || method.isEmpty()) && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) + && (specimen == null || specimen.isEmpty()) && (performer == null || performer.isEmpty()) + && (device == null || device.isEmpty()) && (encounter == null || encounter.isEmpty()) && (referenceRange == null || referenceRange.isEmpty()) + && (derivedFrom == null || derivedFrom.isEmpty()) && (related == null || related.isEmpty()) + && (component == null || component.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Observation; + } + + @SearchParamDefinition(name="date", path="Observation.applies[x]", description="Obtained date/time. If the obtained element is a period, a date that falls in the period", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="code", path="Observation.code", description="The code of the observation type", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="subject", path="Observation.subject", description="The subject that the observation is about", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="component-data-absent-reason", path="Observation.component.dataAbsentReason", description="The reason why the expected value in the element Observation.component.value[x] is missing.", type="token" ) + public static final String SP_COMPONENTDATAABSENTREASON = "component-data-absent-reason"; + @SearchParamDefinition(name="reliability", path="Observation.reliability", description="The reliability of the observation", type="token" ) + public static final String SP_RELIABILITY = "reliability"; + @SearchParamDefinition(name="value-concept", path="Observation.valueCodeableConcept", description="The value of the observation, if the value is a CodeableConcept", type="token" ) + public static final String SP_VALUECONCEPT = "value-concept"; + @SearchParamDefinition(name="value-date", path="Observation.valueDateTime|Observation.valuePeriod", description="The value of the observation, if the value is a date or period of time", type="date" ) + public static final String SP_VALUEDATE = "value-date"; + @SearchParamDefinition(name="related", path="", description="Related Observations - search on related-type and related-target together", type="composite" ) + public static final String SP_RELATED = "related"; + @SearchParamDefinition(name="patient", path="Observation.subject", description="The subject that the observation is about (if patient)", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="specimen", path="Observation.specimen", description="Specimen used for this observation", type="reference" ) + public static final String SP_SPECIMEN = "specimen"; + @SearchParamDefinition(name="component-code", path="Observation.component.code", description="The component code of the observation type", type="token" ) + public static final String SP_COMPONENTCODE = "component-code"; + @SearchParamDefinition(name="value-string", path="Observation.valueString", description="The value of the observation, if the value is a string, and also searches in CodeableConcept.text", type="string" ) + public static final String SP_VALUESTRING = "value-string"; + @SearchParamDefinition(name="identifier", path="Observation.identifier", description="The unique Id for a particular observation", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="component-code-value-[x]", path="", description="Both component code and one of the component value parameters", type="composite" ) + public static final String SP_COMPONENTCODEVALUEX = "component-code-value-[x]"; + @SearchParamDefinition(name="code-value-[x]", path="", description="Both code and one of the value parameters", type="composite" ) + public static final String SP_CODEVALUEX = "code-value-[x]"; + @SearchParamDefinition(name="performer", path="Observation.performer", description="Who performed the observation", type="reference" ) + public static final String SP_PERFORMER = "performer"; + @SearchParamDefinition(name="value-quantity", path="Observation.valueQuantity", description="The value of the observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)", type="quantity" ) + public static final String SP_VALUEQUANTITY = "value-quantity"; + @SearchParamDefinition(name="component-value-quantity", path="Observation.component.valueQuantity", description="The value of the component observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)", type="quantity" ) + public static final String SP_COMPONENTVALUEQUANTITY = "component-value-quantity"; + @SearchParamDefinition(name="data-absent-reason", path="Observation.dataAbsentReason", description="The reason why the expected value in the element Observation.value[x] is missing.", type="token" ) + public static final String SP_DATAABSENTREASON = "data-absent-reason"; + @SearchParamDefinition(name="encounter", path="Observation.encounter", description="Healthcare event related to the observation", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + @SearchParamDefinition(name="related-type", path="Observation.related.type", description="has-member | sequel-to | replaces | qualified-by | interfered-by", type="token" ) + public static final String SP_RELATEDTYPE = "related-type"; + @SearchParamDefinition(name="related-target", path="Observation.related.target", description="Observation that is related to this one", type="reference" ) + public static final String SP_RELATEDTARGET = "related-target"; + @SearchParamDefinition(name="component-value-string", path="Observation.component.valueString", description="The value of the component observation, if the value is a string, and also searches in CodeableConcept.text", type="string" ) + public static final String SP_COMPONENTVALUESTRING = "component-value-string"; + @SearchParamDefinition(name="component-value-concept", path="Observation.component.valueCodeableConcept", description="The value of the component observation, if the value is a CodeableConcept", type="token" ) + public static final String SP_COMPONENTVALUECONCEPT = "component-value-concept"; + @SearchParamDefinition(name="category", path="Observation.category", description="The classification of the type of observation", type="token" ) + public static final String SP_CATEGORY = "category"; + @SearchParamDefinition(name="device", path="Observation.device", description="The Device that generated the observation data.", type="reference" ) + public static final String SP_DEVICE = "device"; + @SearchParamDefinition(name="status", path="Observation.status", description="The status of the observation", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/OidType.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/OidType.java index 0cc2b6235e6..b5702609e60 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/OidType.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/OidType.java @@ -1,93 +1,72 @@ -/* -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; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import java.net.URI; - -import org.hl7.fhir.instance.model.annotations.DatatypeDef; - -/** - * Primitive type "oid" in FHIR: an OID represented as urn:oid:0.1.2.3.4... - */ -@DatatypeDef(name="oid") -public class OidType extends UriType { - - private static final long serialVersionUID = 3L; - - /** - * Constructor - */ - public OidType() { - super(); - } - - /** - * Constructor - */ - public OidType(String theValue) { - super(theValue); - } - - /** - * Constructor - */ - public OidType(URI theValue) { - super(theValue); - } - - /** - * Constructor - */ - @Override - public OidType copy() { - return new OidType(getValue()); - } - -} +/* +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; + +import java.net.URI; + +import org.hl7.fhir.instance.model.annotations.DatatypeDef; + +/** + * Primitive type "oid" in FHIR: an OID represented as urn:oid:0.1.2.3.4... + */ +@DatatypeDef(name="oid") +public class OidType extends UriType { + + private static final long serialVersionUID = 3L; + + /** + * Constructor + */ + public OidType() { + super(); + } + + /** + * Constructor + */ + public OidType(String theValue) { + super(theValue); + } + + /** + * Constructor + */ + public OidType(URI theValue) { + super(theValue); + } + + /** + * Constructor + */ + @Override + public OidType copy() { + return new OidType(getValue()); + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/OperationDefinition.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/OperationDefinition.java index 800abf79ee6..4b67b352353 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/OperationDefinition.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/OperationDefinition.java @@ -1,2457 +1,2436 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import java.util.*; - -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.instance.model.Enumerations.*; -import org.hl7.fhir.instance.model.annotations.ResourceDef; -import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; -import org.hl7.fhir.instance.model.annotations.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). - */ -@ResourceDef(name="OperationDefinition", profile="http://hl7.org/fhir/Profile/OperationDefinition") -public class OperationDefinition extends DomainResource { - - public enum OperationKind { - /** - * This operation is invoked as an operation. - */ - OPERATION, - /** - * This operation is a named query, invoked using the search mechanism. - */ - QUERY, - /** - * added to help the parsers - */ - NULL; - public static OperationKind fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("operation".equals(codeString)) - return OPERATION; - if ("query".equals(codeString)) - return QUERY; - throw new Exception("Unknown OperationKind code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case OPERATION: return "operation"; - case QUERY: return "query"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case OPERATION: return ""; - case QUERY: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case OPERATION: return "This operation is invoked as an operation."; - case QUERY: return "This operation is a named query, invoked using the search mechanism."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case OPERATION: return "Operation"; - case QUERY: return "Query"; - default: return "?"; - } - } - } - - public static class OperationKindEnumFactory implements EnumFactory { - public OperationKind fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("operation".equals(codeString)) - return OperationKind.OPERATION; - if ("query".equals(codeString)) - return OperationKind.QUERY; - throw new IllegalArgumentException("Unknown OperationKind code '"+codeString+"'"); - } - public String toCode(OperationKind code) { - if (code == OperationKind.OPERATION) - return "operation"; - if (code == OperationKind.QUERY) - return "query"; - return "?"; - } - } - - public enum OperationParameterUse { - /** - * This is an input parameter. - */ - IN, - /** - * This is an output parameter. - */ - OUT, - /** - * added to help the parsers - */ - NULL; - public static OperationParameterUse fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("in".equals(codeString)) - return IN; - if ("out".equals(codeString)) - return OUT; - throw new Exception("Unknown OperationParameterUse code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case IN: return "in"; - case OUT: return "out"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case IN: return ""; - case OUT: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case IN: return "This is an input parameter."; - case OUT: return "This is an output parameter."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case IN: return "In"; - case OUT: return "Out"; - default: return "?"; - } - } - } - - public static class OperationParameterUseEnumFactory implements EnumFactory { - public OperationParameterUse fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in".equals(codeString)) - return OperationParameterUse.IN; - if ("out".equals(codeString)) - return OperationParameterUse.OUT; - throw new IllegalArgumentException("Unknown OperationParameterUse code '"+codeString+"'"); - } - public String toCode(OperationParameterUse code) { - if (code == OperationParameterUse.IN) - return "in"; - if (code == OperationParameterUse.OUT) - return "out"; - return "?"; - } - } - - @Block() - public static class OperationDefinitionContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the operation definition. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Name of a individual to contact", formalDefinition="The name of an individual to contact regarding the operation definition." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /* - * Constructor - */ - public OperationDefinitionContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the operation definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the operation definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public OperationDefinitionContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the operation definition. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the operation definition. - */ - public OperationDefinitionContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public OperationDefinitionContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the operation definition.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - public OperationDefinitionContactComponent copy() { - OperationDefinitionContactComponent dst = new OperationDefinitionContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OperationDefinitionContactComponent)) - return false; - OperationDefinitionContactComponent o = (OperationDefinitionContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OperationDefinitionContactComponent)) - return false; - OperationDefinitionContactComponent o = (OperationDefinitionContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - } - - @Block() - public static class OperationDefinitionParameterComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of used to identify the parameter. - */ - @Child(name = "name", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Name of the parameter", formalDefinition="The name of used to identify the parameter." ) - protected CodeType name; - - /** - * Whether this is an input or an output parameter. - */ - @Child(name = "use", type = {CodeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="in | out", formalDefinition="Whether this is an input or an output parameter." ) - protected Enumeration use; - - /** - * The minimum number of times this parameter SHALL appear in the request or response. - */ - @Child(name = "min", type = {IntegerType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Minimum Cardinality", formalDefinition="The minimum number of times this parameter SHALL appear in the request or response." ) - protected IntegerType min; - - /** - * The maximum number of times this element is permitted to appear in the request or response. - */ - @Child(name = "max", type = {StringType.class}, order=4, min=1, max=1) - @Description(shortDefinition="Maximum Cardinality (a number or *)", formalDefinition="The maximum number of times this element is permitted to appear in the request or response." ) - protected StringType max; - - /** - * Describes the meaning or use of this parameter. - */ - @Child(name = "documentation", type = {StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Description of meaning/use", formalDefinition="Describes the meaning or use of this parameter." ) - protected StringType documentation; - - /** - * The type for this parameter. - */ - @Child(name = "type", type = {CodeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="What type this parameter hs", formalDefinition="The type for this parameter." ) - protected CodeType type; - - /** - * A profile the specifies the rules that this parameter must conform to. - */ - @Child(name = "profile", type = {StructureDefinition.class}, order=7, min=0, max=1) - @Description(shortDefinition="Profile on the type", formalDefinition="A profile the specifies the rules that this parameter must conform to." ) - protected Reference profile; - - /** - * The actual object that is the target of the reference (A profile the specifies the rules that this parameter must conform to.) - */ - protected StructureDefinition profileTarget; - - /** - * The parts of a Tuple Parameter. - */ - @Child(name = "part", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Parts of a Tuple Parameter", formalDefinition="The parts of a Tuple Parameter." ) - protected List part; - - private static final long serialVersionUID = 633191560L; - - /* - * Constructor - */ - public OperationDefinitionParameterComponent() { - super(); - } - - /* - * Constructor - */ - public OperationDefinitionParameterComponent(CodeType name, Enumeration use, IntegerType min, StringType max) { - super(); - this.name = name; - this.use = use; - this.min = min; - this.max = max; - } - - /** - * @return {@link #name} (The name of used to identify the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public CodeType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new CodeType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of used to identify the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public OperationDefinitionParameterComponent setNameElement(CodeType value) { - this.name = value; - return this; - } - - /** - * @return The name of used to identify the parameter. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of used to identify the parameter. - */ - public OperationDefinitionParameterComponent setName(String value) { - if (this.name == null) - this.name = new CodeType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #use} (Whether this is an input or an output parameter.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(new OperationParameterUseEnumFactory()); // bb - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (Whether this is an input or an output parameter.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public OperationDefinitionParameterComponent setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return Whether this is an input or an output parameter. - */ - public OperationParameterUse getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value Whether this is an input or an output parameter. - */ - public OperationDefinitionParameterComponent setUse(OperationParameterUse value) { - if (this.use == null) - this.use = new Enumeration(new OperationParameterUseEnumFactory()); - this.use.setValue(value); - return this; - } - - /** - * @return {@link #min} (The minimum number of times this parameter SHALL appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value - */ - public IntegerType getMinElement() { - if (this.min == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.min"); - else if (Configuration.doAutoCreate()) - this.min = new IntegerType(); // bb - return this.min; - } - - public boolean hasMinElement() { - return this.min != null && !this.min.isEmpty(); - } - - public boolean hasMin() { - return this.min != null && !this.min.isEmpty(); - } - - /** - * @param value {@link #min} (The minimum number of times this parameter SHALL appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value - */ - public OperationDefinitionParameterComponent setMinElement(IntegerType value) { - this.min = value; - return this; - } - - /** - * @return The minimum number of times this parameter SHALL appear in the request or response. - */ - public int getMin() { - return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue(); - } - - /** - * @param value The minimum number of times this parameter SHALL appear in the request or response. - */ - public OperationDefinitionParameterComponent setMin(int value) { - if (this.min == null) - this.min = new IntegerType(); - this.min.setValue(value); - return this; - } - - /** - * @return {@link #max} (The maximum number of times this element is permitted to appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value - */ - public StringType getMaxElement() { - if (this.max == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.max"); - else if (Configuration.doAutoCreate()) - this.max = new StringType(); // bb - return this.max; - } - - public boolean hasMaxElement() { - return this.max != null && !this.max.isEmpty(); - } - - public boolean hasMax() { - return this.max != null && !this.max.isEmpty(); - } - - /** - * @param value {@link #max} (The maximum number of times this element is permitted to appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value - */ - public OperationDefinitionParameterComponent setMaxElement(StringType value) { - this.max = value; - return this; - } - - /** - * @return The maximum number of times this element is permitted to appear in the request or response. - */ - public String getMax() { - return this.max == null ? null : this.max.getValue(); - } - - /** - * @param value The maximum number of times this element is permitted to appear in the request or response. - */ - public OperationDefinitionParameterComponent setMax(String value) { - if (this.max == null) - this.max = new StringType(); - this.max.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (Describes the meaning or use of this parameter.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (Describes the meaning or use of this parameter.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public OperationDefinitionParameterComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Describes the meaning or use of this parameter. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Describes the meaning or use of this parameter. - */ - public OperationDefinitionParameterComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The type for this parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public CodeType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeType(); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type for this parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public OperationDefinitionParameterComponent setTypeElement(CodeType value) { - this.type = value; - return this; - } - - /** - * @return The type for this parameter. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type for this parameter. - */ - public OperationDefinitionParameterComponent setType(String value) { - if (Utilities.noString(value)) - this.type = null; - else { - if (this.type == null) - this.type = new CodeType(); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #profile} (A profile the specifies the rules that this parameter must conform to.) - */ - public Reference getProfile() { - if (this.profile == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profile = new Reference(); // cc - return this.profile; - } - - public boolean hasProfile() { - return this.profile != null && !this.profile.isEmpty(); - } - - /** - * @param value {@link #profile} (A profile the specifies the rules that this parameter must conform to.) - */ - public OperationDefinitionParameterComponent setProfile(Reference value) { - this.profile = value; - return this; - } - - /** - * @return {@link #profile} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A profile the specifies the rules that this parameter must conform to.) - */ - public StructureDefinition getProfileTarget() { - if (this.profileTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profileTarget = new StructureDefinition(); // aa - return this.profileTarget; - } - - /** - * @param value {@link #profile} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A profile the specifies the rules that this parameter must conform to.) - */ - public OperationDefinitionParameterComponent setProfileTarget(StructureDefinition value) { - this.profileTarget = value; - return this; - } - - /** - * @return {@link #part} (The parts of a Tuple Parameter.) - */ - public List getPart() { - if (this.part == null) - this.part = new ArrayList(); - return this.part; - } - - public boolean hasPart() { - if (this.part == null) - return false; - for (OperationDefinitionParameterPartComponent item : this.part) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #part} (The parts of a Tuple Parameter.) - */ - // syntactic sugar - public OperationDefinitionParameterPartComponent addPart() { //3 - OperationDefinitionParameterPartComponent t = new OperationDefinitionParameterPartComponent(); - if (this.part == null) - this.part = new ArrayList(); - this.part.add(t); - return t; - } - - // syntactic sugar - public OperationDefinitionParameterComponent addPart(OperationDefinitionParameterPartComponent t) { //3 - if (t == null) - return this; - if (this.part == null) - this.part = new ArrayList(); - this.part.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "code", "The name of used to identify the parameter.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("use", "code", "Whether this is an input or an output parameter.", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("min", "integer", "The minimum number of times this parameter SHALL appear in the request or response.", 0, java.lang.Integer.MAX_VALUE, min)); - childrenList.add(new Property("max", "string", "The maximum number of times this element is permitted to appear in the request or response.", 0, java.lang.Integer.MAX_VALUE, max)); - childrenList.add(new Property("documentation", "string", "Describes the meaning or use of this parameter.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("type", "code", "The type for this parameter.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A profile the specifies the rules that this parameter must conform to.", 0, java.lang.Integer.MAX_VALUE, profile)); - childrenList.add(new Property("part", "", "The parts of a Tuple Parameter.", 0, java.lang.Integer.MAX_VALUE, part)); - } - - public OperationDefinitionParameterComponent copy() { - OperationDefinitionParameterComponent dst = new OperationDefinitionParameterComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.use = use == null ? null : use.copy(); - dst.min = min == null ? null : min.copy(); - dst.max = max == null ? null : max.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - dst.type = type == null ? null : type.copy(); - dst.profile = profile == null ? null : profile.copy(); - if (part != null) { - dst.part = new ArrayList(); - for (OperationDefinitionParameterPartComponent i : part) - dst.part.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OperationDefinitionParameterComponent)) - return false; - OperationDefinitionParameterComponent o = (OperationDefinitionParameterComponent) other; - return compareDeep(name, o.name, true) && compareDeep(use, o.use, true) && compareDeep(min, o.min, true) - && compareDeep(max, o.max, true) && compareDeep(documentation, o.documentation, true) && compareDeep(type, o.type, true) - && compareDeep(profile, o.profile, true) && compareDeep(part, o.part, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OperationDefinitionParameterComponent)) - return false; - OperationDefinitionParameterComponent o = (OperationDefinitionParameterComponent) other; - return compareValues(name, o.name, true) && compareValues(use, o.use, true) && compareValues(min, o.min, true) - && compareValues(max, o.max, true) && compareValues(documentation, o.documentation, true) && compareValues(type, o.type, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (use == null || use.isEmpty()) - && (min == null || min.isEmpty()) && (max == null || max.isEmpty()) && (documentation == null || documentation.isEmpty()) - && (type == null || type.isEmpty()) && (profile == null || profile.isEmpty()) && (part == null || part.isEmpty()) - ; - } - - } - - @Block() - public static class OperationDefinitionParameterPartComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of used to identify the parameter. - */ - @Child(name = "name", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Name of the parameter", formalDefinition="The name of used to identify the parameter." ) - protected CodeType name; - - /** - * The minimum number of times this parameter SHALL appear in the request or response. - */ - @Child(name = "min", type = {UnsignedIntType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Minimum Cardinality", formalDefinition="The minimum number of times this parameter SHALL appear in the request or response." ) - protected UnsignedIntType min; - - /** - * The maximum number of times this element is permitted to appear in the request or response. - */ - @Child(name = "max", type = {StringType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Maximum Cardinality (a number or *)", formalDefinition="The maximum number of times this element is permitted to appear in the request or response." ) - protected StringType max; - - /** - * Describes the meaning or use of this parameter. - */ - @Child(name = "documentation", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Description of meaning/use", formalDefinition="Describes the meaning or use of this parameter." ) - protected StringType documentation; - - /** - * The type for this parameter. - */ - @Child(name = "type", type = {CodeType.class}, order=5, min=1, max=1) - @Description(shortDefinition="What type this parameter hs", formalDefinition="The type for this parameter." ) - protected CodeType type; - - /** - * A profile the specifies the rules that this parameter must conform to. - */ - @Child(name = "profile", type = {StructureDefinition.class}, order=6, min=0, max=1) - @Description(shortDefinition="Profile on the type", formalDefinition="A profile the specifies the rules that this parameter must conform to." ) - protected Reference profile; - - /** - * The actual object that is the target of the reference (A profile the specifies the rules that this parameter must conform to.) - */ - protected StructureDefinition profileTarget; - - private static final long serialVersionUID = -856151797L; - - /* - * Constructor - */ - public OperationDefinitionParameterPartComponent() { - super(); - } - - /* - * Constructor - */ - public OperationDefinitionParameterPartComponent(CodeType name, UnsignedIntType min, StringType max, CodeType type) { - super(); - this.name = name; - this.min = min; - this.max = max; - this.type = type; - } - - /** - * @return {@link #name} (The name of used to identify the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public CodeType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new CodeType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of used to identify the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public OperationDefinitionParameterPartComponent setNameElement(CodeType value) { - this.name = value; - return this; - } - - /** - * @return The name of used to identify the parameter. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of used to identify the parameter. - */ - public OperationDefinitionParameterPartComponent setName(String value) { - if (this.name == null) - this.name = new CodeType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #min} (The minimum number of times this parameter SHALL appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value - */ - public UnsignedIntType getMinElement() { - if (this.min == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.min"); - else if (Configuration.doAutoCreate()) - this.min = new UnsignedIntType(); // bb - return this.min; - } - - public boolean hasMinElement() { - return this.min != null && !this.min.isEmpty(); - } - - public boolean hasMin() { - return this.min != null && !this.min.isEmpty(); - } - - /** - * @param value {@link #min} (The minimum number of times this parameter SHALL appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value - */ - public OperationDefinitionParameterPartComponent setMinElement(UnsignedIntType value) { - this.min = value; - return this; - } - - /** - * @return The minimum number of times this parameter SHALL appear in the request or response. - */ - public int getMin() { - return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue(); - } - - /** - * @param value The minimum number of times this parameter SHALL appear in the request or response. - */ - public OperationDefinitionParameterPartComponent setMin(int value) { - if (this.min == null) - this.min = new UnsignedIntType(); - this.min.setValue(value); - return this; - } - - /** - * @return {@link #max} (The maximum number of times this element is permitted to appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value - */ - public StringType getMaxElement() { - if (this.max == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.max"); - else if (Configuration.doAutoCreate()) - this.max = new StringType(); // bb - return this.max; - } - - public boolean hasMaxElement() { - return this.max != null && !this.max.isEmpty(); - } - - public boolean hasMax() { - return this.max != null && !this.max.isEmpty(); - } - - /** - * @param value {@link #max} (The maximum number of times this element is permitted to appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value - */ - public OperationDefinitionParameterPartComponent setMaxElement(StringType value) { - this.max = value; - return this; - } - - /** - * @return The maximum number of times this element is permitted to appear in the request or response. - */ - public String getMax() { - return this.max == null ? null : this.max.getValue(); - } - - /** - * @param value The maximum number of times this element is permitted to appear in the request or response. - */ - public OperationDefinitionParameterPartComponent setMax(String value) { - if (this.max == null) - this.max = new StringType(); - this.max.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (Describes the meaning or use of this parameter.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (Describes the meaning or use of this parameter.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public OperationDefinitionParameterPartComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Describes the meaning or use of this parameter. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Describes the meaning or use of this parameter. - */ - public OperationDefinitionParameterPartComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The type for this parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public CodeType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeType(); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type for this parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public OperationDefinitionParameterPartComponent setTypeElement(CodeType value) { - this.type = value; - return this; - } - - /** - * @return The type for this parameter. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type for this parameter. - */ - public OperationDefinitionParameterPartComponent setType(String value) { - if (this.type == null) - this.type = new CodeType(); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #profile} (A profile the specifies the rules that this parameter must conform to.) - */ - public Reference getProfile() { - if (this.profile == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profile = new Reference(); // cc - return this.profile; - } - - public boolean hasProfile() { - return this.profile != null && !this.profile.isEmpty(); - } - - /** - * @param value {@link #profile} (A profile the specifies the rules that this parameter must conform to.) - */ - public OperationDefinitionParameterPartComponent setProfile(Reference value) { - this.profile = value; - return this; - } - - /** - * @return {@link #profile} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A profile the specifies the rules that this parameter must conform to.) - */ - public StructureDefinition getProfileTarget() { - if (this.profileTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profileTarget = new StructureDefinition(); // aa - return this.profileTarget; - } - - /** - * @param value {@link #profile} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A profile the specifies the rules that this parameter must conform to.) - */ - public OperationDefinitionParameterPartComponent setProfileTarget(StructureDefinition value) { - this.profileTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "code", "The name of used to identify the parameter.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("min", "unsignedInt", "The minimum number of times this parameter SHALL appear in the request or response.", 0, java.lang.Integer.MAX_VALUE, min)); - childrenList.add(new Property("max", "string", "The maximum number of times this element is permitted to appear in the request or response.", 0, java.lang.Integer.MAX_VALUE, max)); - childrenList.add(new Property("documentation", "string", "Describes the meaning or use of this parameter.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("type", "code", "The type for this parameter.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A profile the specifies the rules that this parameter must conform to.", 0, java.lang.Integer.MAX_VALUE, profile)); - } - - public OperationDefinitionParameterPartComponent copy() { - OperationDefinitionParameterPartComponent dst = new OperationDefinitionParameterPartComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.min = min == null ? null : min.copy(); - dst.max = max == null ? null : max.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - dst.type = type == null ? null : type.copy(); - dst.profile = profile == null ? null : profile.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OperationDefinitionParameterPartComponent)) - return false; - OperationDefinitionParameterPartComponent o = (OperationDefinitionParameterPartComponent) other; - return compareDeep(name, o.name, true) && compareDeep(min, o.min, true) && compareDeep(max, o.max, true) - && compareDeep(documentation, o.documentation, true) && compareDeep(type, o.type, true) && compareDeep(profile, o.profile, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OperationDefinitionParameterPartComponent)) - return false; - OperationDefinitionParameterPartComponent o = (OperationDefinitionParameterPartComponent) other; - return compareValues(name, o.name, true) && compareValues(min, o.min, true) && compareValues(max, o.max, true) - && compareValues(documentation, o.documentation, true) && compareValues(type, o.type, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (min == null || min.isEmpty()) - && (max == null || max.isEmpty()) && (documentation == null || documentation.isEmpty()) && (type == null || type.isEmpty()) - && (profile == null || profile.isEmpty()); - } - - } - - /** - * An absolute url that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique uri). - */ - @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Logical url to reference this operation definition", formalDefinition="An absolute url that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique uri)." ) - protected UriType url; - - /** - * The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Logical id for this version of the operation definition", formalDefinition="The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) - protected StringType version; - - /** - * A free text natural language name identifying the Profile. - */ - @Child(name = "name", type = {StringType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Informal name for this profile", formalDefinition="A free text natural language name identifying the Profile." ) - protected StringType name; - - /** - * The name of the individual or organization that published the operation definition. - */ - @Child(name = "publisher", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the operation definition." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * A free text natural language description of the profile and its use. - */ - @Child(name = "description", type = {StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Natural language description of the operation", formalDefinition="A free text natural language description of the profile and its use." ) - protected StringType description; - - /** - * Explains why this operation definition is needed and why it's been constrained as it has. - */ - @Child(name = "requirements", type = {StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Why is this needed?", formalDefinition="Explains why this operation definition is needed and why it's been constrained as it has." ) - protected StringType requirements; - - /** - * The status of the profile. - */ - @Child(name = "status", type = {CodeType.class}, order=7, min=1, max=1) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the profile." ) - protected Enumeration status; - - /** - * This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name = "experimental", type = {BooleanType.class}, order=8, min=0, max=1) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The date that this version of the profile was published. - */ - @Child(name = "date", type = {DateTimeType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Date for this version of the operation definition", formalDefinition="The date that this version of the profile was published." ) - protected DateTimeType date; - - /** - * Whether this is operation or named query. - */ - @Child(name = "kind", type = {CodeType.class}, order=10, min=1, max=1) - @Description(shortDefinition="operation | query", formalDefinition="Whether this is operation or named query." ) - protected Enumeration kind; - - /** - * Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST. - */ - @Child(name = "idempotent", type = {BooleanType.class}, order=11, min=0, max=1) - @Description(shortDefinition="Whether operation causes changes to content", formalDefinition="Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST." ) - protected BooleanType idempotent; - - /** - * The name used to invoke the operation. - */ - @Child(name = "code", type = {CodeType.class}, order=12, min=1, max=1) - @Description(shortDefinition="Name used to invoke the operation", formalDefinition="The name used to invoke the operation." ) - protected CodeType code; - - /** - * Additional information about how to use this operation or named query. - */ - @Child(name = "notes", type = {StringType.class}, order=13, min=0, max=1) - @Description(shortDefinition="Additional information about use", formalDefinition="Additional information about how to use this operation or named query." ) - protected StringType notes; - - /** - * Indicates that this operation definition is a constraining profile on the base. - */ - @Child(name = "base", type = {OperationDefinition.class}, order=14, min=0, max=1) - @Description(shortDefinition="Marks this as a profile of the base", formalDefinition="Indicates that this operation definition is a constraining profile on the base." ) - protected Reference base; - - /** - * The actual object that is the target of the reference (Indicates that this operation definition is a constraining profile on the base.) - */ - protected OperationDefinition baseTarget; - - /** - * Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context). - */ - @Child(name = "system", type = {BooleanType.class}, order=15, min=1, max=1) - @Description(shortDefinition="Invoke at the system level?", formalDefinition="Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context)." ) - protected BooleanType system; - - /** - * Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context). - */ - @Child(name = "type", type = {CodeType.class}, order=16, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Invoke at resource level for these type", formalDefinition="Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context)." ) - protected List type; - - /** - * Indicates whether this operation can be invoked on a particular instance of one of the given types. - */ - @Child(name = "instance", type = {BooleanType.class}, order=17, min=1, max=1) - @Description(shortDefinition="Invoke on an instance?", formalDefinition="Indicates whether this operation can be invoked on a particular instance of one of the given types." ) - protected BooleanType instance; - - /** - * The parameters for the operation/query. - */ - @Child(name = "parameter", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Parameters for the operation/query", formalDefinition="The parameters for the operation/query." ) - protected List parameter; - - private static final long serialVersionUID = 1747303098L; - - /* - * Constructor - */ - public OperationDefinition() { - super(); - } - - /* - * Constructor - */ - public OperationDefinition(StringType name, Enumeration status, Enumeration kind, CodeType code, BooleanType system, BooleanType instance) { - super(); - this.name = name; - this.status = status; - this.kind = kind; - this.code = code; - this.system = system; - this.instance = instance; - } - - /** - * @return {@link #url} (An absolute url that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique uri).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute url that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique uri).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public OperationDefinition setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute url that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique uri). - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute url that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique uri). - */ - public OperationDefinition setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #version} (The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public OperationDefinition setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public OperationDefinition setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A free text natural language name identifying the Profile.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A free text natural language name identifying the Profile.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public OperationDefinition setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name identifying the Profile. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name identifying the Profile. - */ - public OperationDefinition setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the operation definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the operation definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public OperationDefinition setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the operation definition. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the operation definition. - */ - public OperationDefinition setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (OperationDefinitionContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public OperationDefinitionContactComponent addContact() { //3 - OperationDefinitionContactComponent t = new OperationDefinitionContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public OperationDefinition addContact(OperationDefinitionContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #description} (A free text natural language description of the profile and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A free text natural language description of the profile and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public OperationDefinition setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the profile and its use. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the profile and its use. - */ - public OperationDefinition setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #requirements} (Explains why this operation definition is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); // bb - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (Explains why this operation definition is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public OperationDefinition setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return Explains why this operation definition is needed and why it's been constrained as it has. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value Explains why this operation definition is needed and why it's been constrained as it has. - */ - public OperationDefinition setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of the profile.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the profile.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public OperationDefinition setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the profile. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the profile. - */ - public OperationDefinition setStatus(ConformanceResourceStatus value) { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #experimental} (This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); // bb - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public OperationDefinition setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); - } - - /** - * @param value This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public OperationDefinition setExperimental(boolean value) { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - return this; - } - - /** - * @return {@link #date} (The date that this version of the profile was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date that this version of the profile was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public OperationDefinition setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date that this version of the profile was published. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date that this version of the profile was published. - */ - public OperationDefinition setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #kind} (Whether this is operation or named query.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value - */ - public Enumeration getKindElement() { - if (this.kind == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.kind"); - else if (Configuration.doAutoCreate()) - this.kind = new Enumeration(new OperationKindEnumFactory()); // bb - return this.kind; - } - - public boolean hasKindElement() { - return this.kind != null && !this.kind.isEmpty(); - } - - public boolean hasKind() { - return this.kind != null && !this.kind.isEmpty(); - } - - /** - * @param value {@link #kind} (Whether this is operation or named query.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value - */ - public OperationDefinition setKindElement(Enumeration value) { - this.kind = value; - return this; - } - - /** - * @return Whether this is operation or named query. - */ - public OperationKind getKind() { - return this.kind == null ? null : this.kind.getValue(); - } - - /** - * @param value Whether this is operation or named query. - */ - public OperationDefinition setKind(OperationKind value) { - if (this.kind == null) - this.kind = new Enumeration(new OperationKindEnumFactory()); - this.kind.setValue(value); - return this; - } - - /** - * @return {@link #idempotent} (Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST.). This is the underlying object with id, value and extensions. The accessor "getIdempotent" gives direct access to the value - */ - public BooleanType getIdempotentElement() { - if (this.idempotent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.idempotent"); - else if (Configuration.doAutoCreate()) - this.idempotent = new BooleanType(); // bb - return this.idempotent; - } - - public boolean hasIdempotentElement() { - return this.idempotent != null && !this.idempotent.isEmpty(); - } - - public boolean hasIdempotent() { - return this.idempotent != null && !this.idempotent.isEmpty(); - } - - /** - * @param value {@link #idempotent} (Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST.). This is the underlying object with id, value and extensions. The accessor "getIdempotent" gives direct access to the value - */ - public OperationDefinition setIdempotentElement(BooleanType value) { - this.idempotent = value; - return this; - } - - /** - * @return Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST. - */ - public boolean getIdempotent() { - return this.idempotent == null || this.idempotent.isEmpty() ? false : this.idempotent.getValue(); - } - - /** - * @param value Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST. - */ - public OperationDefinition setIdempotent(boolean value) { - if (this.idempotent == null) - this.idempotent = new BooleanType(); - this.idempotent.setValue(value); - return this; - } - - /** - * @return {@link #code} (The name used to invoke the operation.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (The name used to invoke the operation.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public OperationDefinition setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return The name used to invoke the operation. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value The name used to invoke the operation. - */ - public OperationDefinition setCode(String value) { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #notes} (Additional information about how to use this operation or named query.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public StringType getNotesElement() { - if (this.notes == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.notes"); - else if (Configuration.doAutoCreate()) - this.notes = new StringType(); // bb - return this.notes; - } - - public boolean hasNotesElement() { - return this.notes != null && !this.notes.isEmpty(); - } - - public boolean hasNotes() { - return this.notes != null && !this.notes.isEmpty(); - } - - /** - * @param value {@link #notes} (Additional information about how to use this operation or named query.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public OperationDefinition setNotesElement(StringType value) { - this.notes = value; - return this; - } - - /** - * @return Additional information about how to use this operation or named query. - */ - public String getNotes() { - return this.notes == null ? null : this.notes.getValue(); - } - - /** - * @param value Additional information about how to use this operation or named query. - */ - public OperationDefinition setNotes(String value) { - if (Utilities.noString(value)) - this.notes = null; - else { - if (this.notes == null) - this.notes = new StringType(); - this.notes.setValue(value); - } - return this; - } - - /** - * @return {@link #base} (Indicates that this operation definition is a constraining profile on the base.) - */ - public Reference getBase() { - if (this.base == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.base"); - else if (Configuration.doAutoCreate()) - this.base = new Reference(); // cc - return this.base; - } - - public boolean hasBase() { - return this.base != null && !this.base.isEmpty(); - } - - /** - * @param value {@link #base} (Indicates that this operation definition is a constraining profile on the base.) - */ - public OperationDefinition setBase(Reference value) { - this.base = value; - return this; - } - - /** - * @return {@link #base} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates that this operation definition is a constraining profile on the base.) - */ - public OperationDefinition getBaseTarget() { - if (this.baseTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.base"); - else if (Configuration.doAutoCreate()) - this.baseTarget = new OperationDefinition(); // aa - return this.baseTarget; - } - - /** - * @param value {@link #base} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates that this operation definition is a constraining profile on the base.) - */ - public OperationDefinition setBaseTarget(OperationDefinition value) { - this.baseTarget = value; - return this; - } - - /** - * @return {@link #system} (Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public BooleanType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.system"); - else if (Configuration.doAutoCreate()) - this.system = new BooleanType(); // bb - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public OperationDefinition setSystemElement(BooleanType value) { - this.system = value; - return this; - } - - /** - * @return Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context). - */ - public boolean getSystem() { - return this.system == null || this.system.isEmpty() ? false : this.system.getValue(); - } - - /** - * @param value Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context). - */ - public OperationDefinition setSystem(boolean value) { - if (this.system == null) - this.system = new BooleanType(); - this.system.setValue(value); - return this; - } - - /** - * @return {@link #type} (Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context).) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (CodeType item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context).) - */ - // syntactic sugar - public CodeType addTypeElement() {//2 - CodeType t = new CodeType(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - /** - * @param value {@link #type} (Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context).) - */ - public OperationDefinition addType(String value) { //1 - CodeType t = new CodeType(); - t.setValue(value); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - /** - * @param value {@link #type} (Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context).) - */ - public boolean hasType(String value) { - if (this.type == null) - return false; - for (CodeType v : this.type) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #instance} (Indicates whether this operation can be invoked on a particular instance of one of the given types.). This is the underlying object with id, value and extensions. The accessor "getInstance" gives direct access to the value - */ - public BooleanType getInstanceElement() { - if (this.instance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.instance"); - else if (Configuration.doAutoCreate()) - this.instance = new BooleanType(); // bb - return this.instance; - } - - public boolean hasInstanceElement() { - return this.instance != null && !this.instance.isEmpty(); - } - - public boolean hasInstance() { - return this.instance != null && !this.instance.isEmpty(); - } - - /** - * @param value {@link #instance} (Indicates whether this operation can be invoked on a particular instance of one of the given types.). This is the underlying object with id, value and extensions. The accessor "getInstance" gives direct access to the value - */ - public OperationDefinition setInstanceElement(BooleanType value) { - this.instance = value; - return this; - } - - /** - * @return Indicates whether this operation can be invoked on a particular instance of one of the given types. - */ - public boolean getInstance() { - return this.instance == null || this.instance.isEmpty() ? false : this.instance.getValue(); - } - - /** - * @param value Indicates whether this operation can be invoked on a particular instance of one of the given types. - */ - public OperationDefinition setInstance(boolean value) { - if (this.instance == null) - this.instance = new BooleanType(); - this.instance.setValue(value); - return this; - } - - /** - * @return {@link #parameter} (The parameters for the operation/query.) - */ - public List getParameter() { - if (this.parameter == null) - this.parameter = new ArrayList(); - return this.parameter; - } - - public boolean hasParameter() { - if (this.parameter == null) - return false; - for (OperationDefinitionParameterComponent item : this.parameter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #parameter} (The parameters for the operation/query.) - */ - // syntactic sugar - public OperationDefinitionParameterComponent addParameter() { //3 - OperationDefinitionParameterComponent t = new OperationDefinitionParameterComponent(); - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return t; - } - - // syntactic sugar - public OperationDefinition addParameter(OperationDefinitionParameterComponent t) { //3 - if (t == null) - return this; - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute url that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique uri).", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("name", "string", "A free text natural language name identifying the Profile.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the operation definition.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("description", "string", "A free text natural language description of the profile and its use.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("requirements", "string", "Explains why this operation definition is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("status", "code", "The status of the profile.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("date", "dateTime", "The date that this version of the profile was published.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("kind", "code", "Whether this is operation or named query.", 0, java.lang.Integer.MAX_VALUE, kind)); - childrenList.add(new Property("idempotent", "boolean", "Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST.", 0, java.lang.Integer.MAX_VALUE, idempotent)); - childrenList.add(new Property("code", "code", "The name used to invoke the operation.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("notes", "string", "Additional information about how to use this operation or named query.", 0, java.lang.Integer.MAX_VALUE, notes)); - childrenList.add(new Property("base", "Reference(OperationDefinition)", "Indicates that this operation definition is a constraining profile on the base.", 0, java.lang.Integer.MAX_VALUE, base)); - childrenList.add(new Property("system", "boolean", "Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context).", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("type", "code", "Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context).", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("instance", "boolean", "Indicates whether this operation can be invoked on a particular instance of one of the given types.", 0, java.lang.Integer.MAX_VALUE, instance)); - childrenList.add(new Property("parameter", "", "The parameters for the operation/query.", 0, java.lang.Integer.MAX_VALUE, parameter)); - } - - public OperationDefinition copy() { - OperationDefinition dst = new OperationDefinition(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.version = version == null ? null : version.copy(); - dst.name = name == null ? null : name.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (OperationDefinitionContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - dst.requirements = requirements == null ? null : requirements.copy(); - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.date = date == null ? null : date.copy(); - dst.kind = kind == null ? null : kind.copy(); - dst.idempotent = idempotent == null ? null : idempotent.copy(); - dst.code = code == null ? null : code.copy(); - dst.notes = notes == null ? null : notes.copy(); - dst.base = base == null ? null : base.copy(); - dst.system = system == null ? null : system.copy(); - if (type != null) { - dst.type = new ArrayList(); - for (CodeType i : type) - dst.type.add(i.copy()); - }; - dst.instance = instance == null ? null : instance.copy(); - if (parameter != null) { - dst.parameter = new ArrayList(); - for (OperationDefinitionParameterComponent i : parameter) - dst.parameter.add(i.copy()); - }; - return dst; - } - - protected OperationDefinition typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OperationDefinition)) - return false; - OperationDefinition o = (OperationDefinition) other; - return compareDeep(url, o.url, true) && compareDeep(version, o.version, true) && compareDeep(name, o.name, true) - && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(description, o.description, true) - && compareDeep(requirements, o.requirements, true) && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) - && compareDeep(date, o.date, true) && compareDeep(kind, o.kind, true) && compareDeep(idempotent, o.idempotent, true) - && compareDeep(code, o.code, true) && compareDeep(notes, o.notes, true) && compareDeep(base, o.base, true) - && compareDeep(system, o.system, true) && compareDeep(type, o.type, true) && compareDeep(instance, o.instance, true) - && compareDeep(parameter, o.parameter, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OperationDefinition)) - return false; - OperationDefinition o = (OperationDefinition) other; - return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) - && compareValues(publisher, o.publisher, true) && compareValues(description, o.description, true) && compareValues(requirements, o.requirements, true) - && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(date, o.date, true) - && compareValues(kind, o.kind, true) && compareValues(idempotent, o.idempotent, true) && compareValues(code, o.code, true) - && compareValues(notes, o.notes, true) && compareValues(system, o.system, true) && compareValues(type, o.type, true) - && compareValues(instance, o.instance, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (version == null || version.isEmpty()) - && (name == null || name.isEmpty()) && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) - && (description == null || description.isEmpty()) && (requirements == null || requirements.isEmpty()) - && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) - && (date == null || date.isEmpty()) && (kind == null || kind.isEmpty()) && (idempotent == null || idempotent.isEmpty()) - && (code == null || code.isEmpty()) && (notes == null || notes.isEmpty()) && (base == null || base.isEmpty()) - && (system == null || system.isEmpty()) && (type == null || type.isEmpty()) && (instance == null || instance.isEmpty()) - && (parameter == null || parameter.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.OperationDefinition; - } - - @SearchParamDefinition(name="status", path="OperationDefinition.status", description="draft | active | retired", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="code", path="OperationDefinition.code", description="Name used to invoke the operation", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="date", path="OperationDefinition.date", description="Date for this version of the operation definition", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="type", path="OperationDefinition.type", description="Invoke at resource level for these type", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="url", path="OperationDefinition.url", description="Logical url to reference this operation definition", type="uri" ) - public static final String SP_URL = "url"; - @SearchParamDefinition(name="kind", path="OperationDefinition.kind", description="operation | query", type="token" ) - public static final String SP_KIND = "kind"; - @SearchParamDefinition(name="version", path="OperationDefinition.version", description="Logical id for this version of the operation definition", type="token" ) - public static final String SP_VERSION = "version"; - @SearchParamDefinition(name="publisher", path="OperationDefinition.publisher", description="Name of the publisher (Organization or individual)", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - @SearchParamDefinition(name="system", path="OperationDefinition.system", description="Invoke at the system level?", type="token" ) - public static final String SP_SYSTEM = "system"; - @SearchParamDefinition(name="name", path="OperationDefinition.name", description="Informal name for this profile", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="base", path="OperationDefinition.base", description="Marks this as a profile of the base", type="reference" ) - public static final String SP_BASE = "base"; - @SearchParamDefinition(name="instance", path="OperationDefinition.instance", description="Invoke on an instance?", type="token" ) - public static final String SP_INSTANCE = "instance"; - @SearchParamDefinition(name="profile", path="OperationDefinition.parameter.profile", description="Profile on the type", type="reference" ) - public static final String SP_PROFILE = "profile"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import java.util.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.Enumerations.*; +import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). + */ +@ResourceDef(name="OperationDefinition", profile="http://hl7.org/fhir/Profile/OperationDefinition") +public class OperationDefinition extends DomainResource { + + public enum OperationKind { + /** + * This operation is invoked as an operation. + */ + OPERATION, + /** + * This operation is a named query, invoked using the search mechanism. + */ + QUERY, + /** + * added to help the parsers + */ + NULL; + public static OperationKind fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("operation".equals(codeString)) + return OPERATION; + if ("query".equals(codeString)) + return QUERY; + throw new Exception("Unknown OperationKind code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case OPERATION: return "operation"; + case QUERY: return "query"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case OPERATION: return ""; + case QUERY: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case OPERATION: return "This operation is invoked as an operation."; + case QUERY: return "This operation is a named query, invoked using the search mechanism."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case OPERATION: return "Operation"; + case QUERY: return "Query"; + default: return "?"; + } + } + } + + public static class OperationKindEnumFactory implements EnumFactory { + public OperationKind fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("operation".equals(codeString)) + return OperationKind.OPERATION; + if ("query".equals(codeString)) + return OperationKind.QUERY; + throw new IllegalArgumentException("Unknown OperationKind code '"+codeString+"'"); + } + public String toCode(OperationKind code) { + if (code == OperationKind.OPERATION) + return "operation"; + if (code == OperationKind.QUERY) + return "query"; + return "?"; + } + } + + public enum OperationParameterUse { + /** + * This is an input parameter. + */ + IN, + /** + * This is an output parameter. + */ + OUT, + /** + * added to help the parsers + */ + NULL; + public static OperationParameterUse fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("in".equals(codeString)) + return IN; + if ("out".equals(codeString)) + return OUT; + throw new Exception("Unknown OperationParameterUse code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case IN: return "in"; + case OUT: return "out"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case IN: return ""; + case OUT: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case IN: return "This is an input parameter."; + case OUT: return "This is an output parameter."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case IN: return "In"; + case OUT: return "Out"; + default: return "?"; + } + } + } + + public static class OperationParameterUseEnumFactory implements EnumFactory { + public OperationParameterUse fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in".equals(codeString)) + return OperationParameterUse.IN; + if ("out".equals(codeString)) + return OperationParameterUse.OUT; + throw new IllegalArgumentException("Unknown OperationParameterUse code '"+codeString+"'"); + } + public String toCode(OperationParameterUse code) { + if (code == OperationParameterUse.IN) + return "in"; + if (code == OperationParameterUse.OUT) + return "out"; + return "?"; + } + } + + @Block() + public static class OperationDefinitionContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the operation definition. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Name of a individual to contact", formalDefinition="The name of an individual to contact regarding the operation definition." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /* + * Constructor + */ + public OperationDefinitionContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the operation definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The name of an individual to contact regarding the operation definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public OperationDefinitionContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the operation definition. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the operation definition. + */ + public OperationDefinitionContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public OperationDefinitionContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the operation definition.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + public OperationDefinitionContactComponent copy() { + OperationDefinitionContactComponent dst = new OperationDefinitionContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OperationDefinitionContactComponent)) + return false; + OperationDefinitionContactComponent o = (OperationDefinitionContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OperationDefinitionContactComponent)) + return false; + OperationDefinitionContactComponent o = (OperationDefinitionContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + } + + @Block() + public static class OperationDefinitionParameterComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of used to identify the parameter. + */ + @Child(name = "name", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Name of the parameter", formalDefinition="The name of used to identify the parameter." ) + protected CodeType name; + + /** + * Whether this is an input or an output parameter. + */ + @Child(name = "use", type = {CodeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="in | out", formalDefinition="Whether this is an input or an output parameter." ) + protected Enumeration use; + + /** + * The minimum number of times this parameter SHALL appear in the request or response. + */ + @Child(name = "min", type = {IntegerType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Minimum Cardinality", formalDefinition="The minimum number of times this parameter SHALL appear in the request or response." ) + protected IntegerType min; + + /** + * The maximum number of times this element is permitted to appear in the request or response. + */ + @Child(name = "max", type = {StringType.class}, order=4, min=1, max=1) + @Description(shortDefinition="Maximum Cardinality (a number or *)", formalDefinition="The maximum number of times this element is permitted to appear in the request or response." ) + protected StringType max; + + /** + * Describes the meaning or use of this parameter. + */ + @Child(name = "documentation", type = {StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Description of meaning/use", formalDefinition="Describes the meaning or use of this parameter." ) + protected StringType documentation; + + /** + * The type for this parameter. + */ + @Child(name = "type", type = {CodeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="What type this parameter hs", formalDefinition="The type for this parameter." ) + protected CodeType type; + + /** + * A profile the specifies the rules that this parameter must conform to. + */ + @Child(name = "profile", type = {StructureDefinition.class}, order=7, min=0, max=1) + @Description(shortDefinition="Profile on the type", formalDefinition="A profile the specifies the rules that this parameter must conform to." ) + protected Reference profile; + + /** + * The actual object that is the target of the reference (A profile the specifies the rules that this parameter must conform to.) + */ + protected StructureDefinition profileTarget; + + /** + * The parts of a Tuple Parameter. + */ + @Child(name = "part", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Parts of a Tuple Parameter", formalDefinition="The parts of a Tuple Parameter." ) + protected List part; + + private static final long serialVersionUID = 633191560L; + + /* + * Constructor + */ + public OperationDefinitionParameterComponent() { + super(); + } + + /* + * Constructor + */ + public OperationDefinitionParameterComponent(CodeType name, Enumeration use, IntegerType min, StringType max) { + super(); + this.name = name; + this.use = use; + this.min = min; + this.max = max; + } + + /** + * @return {@link #name} (The name of used to identify the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public CodeType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new CodeType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The name of used to identify the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public OperationDefinitionParameterComponent setNameElement(CodeType value) { + this.name = value; + return this; + } + + /** + * @return The name of used to identify the parameter. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of used to identify the parameter. + */ + public OperationDefinitionParameterComponent setName(String value) { + if (this.name == null) + this.name = new CodeType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #use} (Whether this is an input or an output parameter.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Enumeration getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(new OperationParameterUseEnumFactory()); // bb + return this.use; + } + + public boolean hasUseElement() { + return this.use != null && !this.use.isEmpty(); + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (Whether this is an input or an output parameter.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public OperationDefinitionParameterComponent setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return Whether this is an input or an output parameter. + */ + public OperationParameterUse getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value Whether this is an input or an output parameter. + */ + public OperationDefinitionParameterComponent setUse(OperationParameterUse value) { + if (this.use == null) + this.use = new Enumeration(new OperationParameterUseEnumFactory()); + this.use.setValue(value); + return this; + } + + /** + * @return {@link #min} (The minimum number of times this parameter SHALL appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value + */ + public IntegerType getMinElement() { + if (this.min == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.min"); + else if (Configuration.doAutoCreate()) + this.min = new IntegerType(); // bb + return this.min; + } + + public boolean hasMinElement() { + return this.min != null && !this.min.isEmpty(); + } + + public boolean hasMin() { + return this.min != null && !this.min.isEmpty(); + } + + /** + * @param value {@link #min} (The minimum number of times this parameter SHALL appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value + */ + public OperationDefinitionParameterComponent setMinElement(IntegerType value) { + this.min = value; + return this; + } + + /** + * @return The minimum number of times this parameter SHALL appear in the request or response. + */ + public int getMin() { + return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue(); + } + + /** + * @param value The minimum number of times this parameter SHALL appear in the request or response. + */ + public OperationDefinitionParameterComponent setMin(int value) { + if (this.min == null) + this.min = new IntegerType(); + this.min.setValue(value); + return this; + } + + /** + * @return {@link #max} (The maximum number of times this element is permitted to appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value + */ + public StringType getMaxElement() { + if (this.max == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.max"); + else if (Configuration.doAutoCreate()) + this.max = new StringType(); // bb + return this.max; + } + + public boolean hasMaxElement() { + return this.max != null && !this.max.isEmpty(); + } + + public boolean hasMax() { + return this.max != null && !this.max.isEmpty(); + } + + /** + * @param value {@link #max} (The maximum number of times this element is permitted to appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value + */ + public OperationDefinitionParameterComponent setMaxElement(StringType value) { + this.max = value; + return this; + } + + /** + * @return The maximum number of times this element is permitted to appear in the request or response. + */ + public String getMax() { + return this.max == null ? null : this.max.getValue(); + } + + /** + * @param value The maximum number of times this element is permitted to appear in the request or response. + */ + public OperationDefinitionParameterComponent setMax(String value) { + if (this.max == null) + this.max = new StringType(); + this.max.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (Describes the meaning or use of this parameter.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public StringType getDocumentationElement() { + if (this.documentation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + return this.documentation; + } + + public boolean hasDocumentationElement() { + return this.documentation != null && !this.documentation.isEmpty(); + } + + public boolean hasDocumentation() { + return this.documentation != null && !this.documentation.isEmpty(); + } + + /** + * @param value {@link #documentation} (Describes the meaning or use of this parameter.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public OperationDefinitionParameterComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Describes the meaning or use of this parameter. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Describes the meaning or use of this parameter. + */ + public OperationDefinitionParameterComponent setDocumentation(String value) { + if (Utilities.noString(value)) + this.documentation = null; + else { + if (this.documentation == null) + this.documentation = new StringType(); + this.documentation.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (The type for this parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public CodeType getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeType(); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type for this parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public OperationDefinitionParameterComponent setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return The type for this parameter. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type for this parameter. + */ + public OperationDefinitionParameterComponent setType(String value) { + if (Utilities.noString(value)) + this.type = null; + else { + if (this.type == null) + this.type = new CodeType(); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #profile} (A profile the specifies the rules that this parameter must conform to.) + */ + public Reference getProfile() { + if (this.profile == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profile = new Reference(); // cc + return this.profile; + } + + public boolean hasProfile() { + return this.profile != null && !this.profile.isEmpty(); + } + + /** + * @param value {@link #profile} (A profile the specifies the rules that this parameter must conform to.) + */ + public OperationDefinitionParameterComponent setProfile(Reference value) { + this.profile = value; + return this; + } + + /** + * @return {@link #profile} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A profile the specifies the rules that this parameter must conform to.) + */ + public StructureDefinition getProfileTarget() { + if (this.profileTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profileTarget = new StructureDefinition(); // aa + return this.profileTarget; + } + + /** + * @param value {@link #profile} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A profile the specifies the rules that this parameter must conform to.) + */ + public OperationDefinitionParameterComponent setProfileTarget(StructureDefinition value) { + this.profileTarget = value; + return this; + } + + /** + * @return {@link #part} (The parts of a Tuple Parameter.) + */ + public List getPart() { + if (this.part == null) + this.part = new ArrayList(); + return this.part; + } + + public boolean hasPart() { + if (this.part == null) + return false; + for (OperationDefinitionParameterPartComponent item : this.part) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #part} (The parts of a Tuple Parameter.) + */ + // syntactic sugar + public OperationDefinitionParameterPartComponent addPart() { //3 + OperationDefinitionParameterPartComponent t = new OperationDefinitionParameterPartComponent(); + if (this.part == null) + this.part = new ArrayList(); + this.part.add(t); + return t; + } + + // syntactic sugar + public OperationDefinitionParameterComponent addPart(OperationDefinitionParameterPartComponent t) { //3 + if (t == null) + return this; + if (this.part == null) + this.part = new ArrayList(); + this.part.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "code", "The name of used to identify the parameter.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("use", "code", "Whether this is an input or an output parameter.", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("min", "integer", "The minimum number of times this parameter SHALL appear in the request or response.", 0, java.lang.Integer.MAX_VALUE, min)); + childrenList.add(new Property("max", "string", "The maximum number of times this element is permitted to appear in the request or response.", 0, java.lang.Integer.MAX_VALUE, max)); + childrenList.add(new Property("documentation", "string", "Describes the meaning or use of this parameter.", 0, java.lang.Integer.MAX_VALUE, documentation)); + childrenList.add(new Property("type", "code", "The type for this parameter.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A profile the specifies the rules that this parameter must conform to.", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("part", "", "The parts of a Tuple Parameter.", 0, java.lang.Integer.MAX_VALUE, part)); + } + + public OperationDefinitionParameterComponent copy() { + OperationDefinitionParameterComponent dst = new OperationDefinitionParameterComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.use = use == null ? null : use.copy(); + dst.min = min == null ? null : min.copy(); + dst.max = max == null ? null : max.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + dst.type = type == null ? null : type.copy(); + dst.profile = profile == null ? null : profile.copy(); + if (part != null) { + dst.part = new ArrayList(); + for (OperationDefinitionParameterPartComponent i : part) + dst.part.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OperationDefinitionParameterComponent)) + return false; + OperationDefinitionParameterComponent o = (OperationDefinitionParameterComponent) other; + return compareDeep(name, o.name, true) && compareDeep(use, o.use, true) && compareDeep(min, o.min, true) + && compareDeep(max, o.max, true) && compareDeep(documentation, o.documentation, true) && compareDeep(type, o.type, true) + && compareDeep(profile, o.profile, true) && compareDeep(part, o.part, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OperationDefinitionParameterComponent)) + return false; + OperationDefinitionParameterComponent o = (OperationDefinitionParameterComponent) other; + return compareValues(name, o.name, true) && compareValues(use, o.use, true) && compareValues(min, o.min, true) + && compareValues(max, o.max, true) && compareValues(documentation, o.documentation, true) && compareValues(type, o.type, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (use == null || use.isEmpty()) + && (min == null || min.isEmpty()) && (max == null || max.isEmpty()) && (documentation == null || documentation.isEmpty()) + && (type == null || type.isEmpty()) && (profile == null || profile.isEmpty()) && (part == null || part.isEmpty()) + ; + } + + } + + @Block() + public static class OperationDefinitionParameterPartComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of used to identify the parameter. + */ + @Child(name = "name", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Name of the parameter", formalDefinition="The name of used to identify the parameter." ) + protected CodeType name; + + /** + * The minimum number of times this parameter SHALL appear in the request or response. + */ + @Child(name = "min", type = {UnsignedIntType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Minimum Cardinality", formalDefinition="The minimum number of times this parameter SHALL appear in the request or response." ) + protected UnsignedIntType min; + + /** + * The maximum number of times this element is permitted to appear in the request or response. + */ + @Child(name = "max", type = {StringType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Maximum Cardinality (a number or *)", formalDefinition="The maximum number of times this element is permitted to appear in the request or response." ) + protected StringType max; + + /** + * Describes the meaning or use of this parameter. + */ + @Child(name = "documentation", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Description of meaning/use", formalDefinition="Describes the meaning or use of this parameter." ) + protected StringType documentation; + + /** + * The type for this parameter. + */ + @Child(name = "type", type = {CodeType.class}, order=5, min=1, max=1) + @Description(shortDefinition="What type this parameter hs", formalDefinition="The type for this parameter." ) + protected CodeType type; + + /** + * A profile the specifies the rules that this parameter must conform to. + */ + @Child(name = "profile", type = {StructureDefinition.class}, order=6, min=0, max=1) + @Description(shortDefinition="Profile on the type", formalDefinition="A profile the specifies the rules that this parameter must conform to." ) + protected Reference profile; + + /** + * The actual object that is the target of the reference (A profile the specifies the rules that this parameter must conform to.) + */ + protected StructureDefinition profileTarget; + + private static final long serialVersionUID = -856151797L; + + /* + * Constructor + */ + public OperationDefinitionParameterPartComponent() { + super(); + } + + /* + * Constructor + */ + public OperationDefinitionParameterPartComponent(CodeType name, UnsignedIntType min, StringType max, CodeType type) { + super(); + this.name = name; + this.min = min; + this.max = max; + this.type = type; + } + + /** + * @return {@link #name} (The name of used to identify the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public CodeType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new CodeType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The name of used to identify the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public OperationDefinitionParameterPartComponent setNameElement(CodeType value) { + this.name = value; + return this; + } + + /** + * @return The name of used to identify the parameter. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of used to identify the parameter. + */ + public OperationDefinitionParameterPartComponent setName(String value) { + if (this.name == null) + this.name = new CodeType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #min} (The minimum number of times this parameter SHALL appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value + */ + public UnsignedIntType getMinElement() { + if (this.min == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.min"); + else if (Configuration.doAutoCreate()) + this.min = new UnsignedIntType(); // bb + return this.min; + } + + public boolean hasMinElement() { + return this.min != null && !this.min.isEmpty(); + } + + public boolean hasMin() { + return this.min != null && !this.min.isEmpty(); + } + + /** + * @param value {@link #min} (The minimum number of times this parameter SHALL appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value + */ + public OperationDefinitionParameterPartComponent setMinElement(UnsignedIntType value) { + this.min = value; + return this; + } + + /** + * @return The minimum number of times this parameter SHALL appear in the request or response. + */ + public int getMin() { + return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue(); + } + + /** + * @param value The minimum number of times this parameter SHALL appear in the request or response. + */ + public OperationDefinitionParameterPartComponent setMin(int value) { + if (this.min == null) + this.min = new UnsignedIntType(); + this.min.setValue(value); + return this; + } + + /** + * @return {@link #max} (The maximum number of times this element is permitted to appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value + */ + public StringType getMaxElement() { + if (this.max == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.max"); + else if (Configuration.doAutoCreate()) + this.max = new StringType(); // bb + return this.max; + } + + public boolean hasMaxElement() { + return this.max != null && !this.max.isEmpty(); + } + + public boolean hasMax() { + return this.max != null && !this.max.isEmpty(); + } + + /** + * @param value {@link #max} (The maximum number of times this element is permitted to appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value + */ + public OperationDefinitionParameterPartComponent setMaxElement(StringType value) { + this.max = value; + return this; + } + + /** + * @return The maximum number of times this element is permitted to appear in the request or response. + */ + public String getMax() { + return this.max == null ? null : this.max.getValue(); + } + + /** + * @param value The maximum number of times this element is permitted to appear in the request or response. + */ + public OperationDefinitionParameterPartComponent setMax(String value) { + if (this.max == null) + this.max = new StringType(); + this.max.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (Describes the meaning or use of this parameter.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public StringType getDocumentationElement() { + if (this.documentation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + return this.documentation; + } + + public boolean hasDocumentationElement() { + return this.documentation != null && !this.documentation.isEmpty(); + } + + public boolean hasDocumentation() { + return this.documentation != null && !this.documentation.isEmpty(); + } + + /** + * @param value {@link #documentation} (Describes the meaning or use of this parameter.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public OperationDefinitionParameterPartComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Describes the meaning or use of this parameter. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Describes the meaning or use of this parameter. + */ + public OperationDefinitionParameterPartComponent setDocumentation(String value) { + if (Utilities.noString(value)) + this.documentation = null; + else { + if (this.documentation == null) + this.documentation = new StringType(); + this.documentation.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (The type for this parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public CodeType getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeType(); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type for this parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public OperationDefinitionParameterPartComponent setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return The type for this parameter. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type for this parameter. + */ + public OperationDefinitionParameterPartComponent setType(String value) { + if (this.type == null) + this.type = new CodeType(); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #profile} (A profile the specifies the rules that this parameter must conform to.) + */ + public Reference getProfile() { + if (this.profile == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profile = new Reference(); // cc + return this.profile; + } + + public boolean hasProfile() { + return this.profile != null && !this.profile.isEmpty(); + } + + /** + * @param value {@link #profile} (A profile the specifies the rules that this parameter must conform to.) + */ + public OperationDefinitionParameterPartComponent setProfile(Reference value) { + this.profile = value; + return this; + } + + /** + * @return {@link #profile} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A profile the specifies the rules that this parameter must conform to.) + */ + public StructureDefinition getProfileTarget() { + if (this.profileTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profileTarget = new StructureDefinition(); // aa + return this.profileTarget; + } + + /** + * @param value {@link #profile} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A profile the specifies the rules that this parameter must conform to.) + */ + public OperationDefinitionParameterPartComponent setProfileTarget(StructureDefinition value) { + this.profileTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "code", "The name of used to identify the parameter.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("min", "unsignedInt", "The minimum number of times this parameter SHALL appear in the request or response.", 0, java.lang.Integer.MAX_VALUE, min)); + childrenList.add(new Property("max", "string", "The maximum number of times this element is permitted to appear in the request or response.", 0, java.lang.Integer.MAX_VALUE, max)); + childrenList.add(new Property("documentation", "string", "Describes the meaning or use of this parameter.", 0, java.lang.Integer.MAX_VALUE, documentation)); + childrenList.add(new Property("type", "code", "The type for this parameter.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A profile the specifies the rules that this parameter must conform to.", 0, java.lang.Integer.MAX_VALUE, profile)); + } + + public OperationDefinitionParameterPartComponent copy() { + OperationDefinitionParameterPartComponent dst = new OperationDefinitionParameterPartComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.min = min == null ? null : min.copy(); + dst.max = max == null ? null : max.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + dst.type = type == null ? null : type.copy(); + dst.profile = profile == null ? null : profile.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OperationDefinitionParameterPartComponent)) + return false; + OperationDefinitionParameterPartComponent o = (OperationDefinitionParameterPartComponent) other; + return compareDeep(name, o.name, true) && compareDeep(min, o.min, true) && compareDeep(max, o.max, true) + && compareDeep(documentation, o.documentation, true) && compareDeep(type, o.type, true) && compareDeep(profile, o.profile, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OperationDefinitionParameterPartComponent)) + return false; + OperationDefinitionParameterPartComponent o = (OperationDefinitionParameterPartComponent) other; + return compareValues(name, o.name, true) && compareValues(min, o.min, true) && compareValues(max, o.max, true) + && compareValues(documentation, o.documentation, true) && compareValues(type, o.type, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (min == null || min.isEmpty()) + && (max == null || max.isEmpty()) && (documentation == null || documentation.isEmpty()) && (type == null || type.isEmpty()) + && (profile == null || profile.isEmpty()); + } + + } + + /** + * An absolute url that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique uri). + */ + @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Logical url to reference this operation definition", formalDefinition="An absolute url that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique uri)." ) + protected UriType url; + + /** + * The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Logical id for this version of the operation definition", formalDefinition="The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) + protected StringType version; + + /** + * A free text natural language name identifying the Profile. + */ + @Child(name = "name", type = {StringType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Informal name for this profile", formalDefinition="A free text natural language name identifying the Profile." ) + protected StringType name; + + /** + * The name of the individual or organization that published the operation definition. + */ + @Child(name = "publisher", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the operation definition." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * A free text natural language description of the profile and its use. + */ + @Child(name = "description", type = {StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Natural language description of the operation", formalDefinition="A free text natural language description of the profile and its use." ) + protected StringType description; + + /** + * Explains why this operation definition is needed and why it's been constrained as it has. + */ + @Child(name = "requirements", type = {StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Why is this needed?", formalDefinition="Explains why this operation definition is needed and why it's been constrained as it has." ) + protected StringType requirements; + + /** + * The status of the profile. + */ + @Child(name = "status", type = {CodeType.class}, order=7, min=1, max=1) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the profile." ) + protected Enumeration status; + + /** + * This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name = "experimental", type = {BooleanType.class}, order=8, min=0, max=1) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The date that this version of the profile was published. + */ + @Child(name = "date", type = {DateTimeType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Date for this version of the operation definition", formalDefinition="The date that this version of the profile was published." ) + protected DateTimeType date; + + /** + * Whether this is operation or named query. + */ + @Child(name = "kind", type = {CodeType.class}, order=10, min=1, max=1) + @Description(shortDefinition="operation | query", formalDefinition="Whether this is operation or named query." ) + protected Enumeration kind; + + /** + * Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST. + */ + @Child(name = "idempotent", type = {BooleanType.class}, order=11, min=0, max=1) + @Description(shortDefinition="Whether operation causes changes to content", formalDefinition="Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST." ) + protected BooleanType idempotent; + + /** + * The name used to invoke the operation. + */ + @Child(name = "code", type = {CodeType.class}, order=12, min=1, max=1) + @Description(shortDefinition="Name used to invoke the operation", formalDefinition="The name used to invoke the operation." ) + protected CodeType code; + + /** + * Additional information about how to use this operation or named query. + */ + @Child(name = "notes", type = {StringType.class}, order=13, min=0, max=1) + @Description(shortDefinition="Additional information about use", formalDefinition="Additional information about how to use this operation or named query." ) + protected StringType notes; + + /** + * Indicates that this operation definition is a constraining profile on the base. + */ + @Child(name = "base", type = {OperationDefinition.class}, order=14, min=0, max=1) + @Description(shortDefinition="Marks this as a profile of the base", formalDefinition="Indicates that this operation definition is a constraining profile on the base." ) + protected Reference base; + + /** + * The actual object that is the target of the reference (Indicates that this operation definition is a constraining profile on the base.) + */ + protected OperationDefinition baseTarget; + + /** + * Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context). + */ + @Child(name = "system", type = {BooleanType.class}, order=15, min=1, max=1) + @Description(shortDefinition="Invoke at the system level?", formalDefinition="Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context)." ) + protected BooleanType system; + + /** + * Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context). + */ + @Child(name = "type", type = {CodeType.class}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Invoke at resource level for these type", formalDefinition="Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context)." ) + protected List type; + + /** + * Indicates whether this operation can be invoked on a particular instance of one of the given types. + */ + @Child(name = "instance", type = {BooleanType.class}, order=17, min=1, max=1) + @Description(shortDefinition="Invoke on an instance?", formalDefinition="Indicates whether this operation can be invoked on a particular instance of one of the given types." ) + protected BooleanType instance; + + /** + * The parameters for the operation/query. + */ + @Child(name = "parameter", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Parameters for the operation/query", formalDefinition="The parameters for the operation/query." ) + protected List parameter; + + private static final long serialVersionUID = 1747303098L; + + /* + * Constructor + */ + public OperationDefinition() { + super(); + } + + /* + * Constructor + */ + public OperationDefinition(StringType name, Enumeration status, Enumeration kind, CodeType code, BooleanType system, BooleanType instance) { + super(); + this.name = name; + this.status = status; + this.kind = kind; + this.code = code; + this.system = system; + this.instance = instance; + } + + /** + * @return {@link #url} (An absolute url that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique uri).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute url that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique uri).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public OperationDefinition setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute url that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique uri). + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute url that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique uri). + */ + public OperationDefinition setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public OperationDefinition setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public OperationDefinition setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A free text natural language name identifying the Profile.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A free text natural language name identifying the Profile.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public OperationDefinition setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name identifying the Profile. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name identifying the Profile. + */ + public OperationDefinition setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the operation definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the operation definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public OperationDefinition setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the operation definition. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the operation definition. + */ + public OperationDefinition setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (OperationDefinitionContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public OperationDefinitionContactComponent addContact() { //3 + OperationDefinitionContactComponent t = new OperationDefinitionContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public OperationDefinition addContact(OperationDefinitionContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #description} (A free text natural language description of the profile and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (A free text natural language description of the profile and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public OperationDefinition setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the profile and its use. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the profile and its use. + */ + public OperationDefinition setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #requirements} (Explains why this operation definition is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); // bb + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (Explains why this operation definition is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public OperationDefinition setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return Explains why this operation definition is needed and why it's been constrained as it has. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value Explains why this operation definition is needed and why it's been constrained as it has. + */ + public OperationDefinition setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of the profile.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status of the profile.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public OperationDefinition setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the profile. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the profile. + */ + public OperationDefinition setStatus(ConformanceResourceStatus value) { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #experimental} (This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public OperationDefinition setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public OperationDefinition setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #date} (The date that this version of the profile was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date that this version of the profile was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public OperationDefinition setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date that this version of the profile was published. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date that this version of the profile was published. + */ + public OperationDefinition setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #kind} (Whether this is operation or named query.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public Enumeration getKindElement() { + if (this.kind == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.kind"); + else if (Configuration.doAutoCreate()) + this.kind = new Enumeration(new OperationKindEnumFactory()); // bb + return this.kind; + } + + public boolean hasKindElement() { + return this.kind != null && !this.kind.isEmpty(); + } + + public boolean hasKind() { + return this.kind != null && !this.kind.isEmpty(); + } + + /** + * @param value {@link #kind} (Whether this is operation or named query.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public OperationDefinition setKindElement(Enumeration value) { + this.kind = value; + return this; + } + + /** + * @return Whether this is operation or named query. + */ + public OperationKind getKind() { + return this.kind == null ? null : this.kind.getValue(); + } + + /** + * @param value Whether this is operation or named query. + */ + public OperationDefinition setKind(OperationKind value) { + if (this.kind == null) + this.kind = new Enumeration(new OperationKindEnumFactory()); + this.kind.setValue(value); + return this; + } + + /** + * @return {@link #idempotent} (Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST.). This is the underlying object with id, value and extensions. The accessor "getIdempotent" gives direct access to the value + */ + public BooleanType getIdempotentElement() { + if (this.idempotent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.idempotent"); + else if (Configuration.doAutoCreate()) + this.idempotent = new BooleanType(); // bb + return this.idempotent; + } + + public boolean hasIdempotentElement() { + return this.idempotent != null && !this.idempotent.isEmpty(); + } + + public boolean hasIdempotent() { + return this.idempotent != null && !this.idempotent.isEmpty(); + } + + /** + * @param value {@link #idempotent} (Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST.). This is the underlying object with id, value and extensions. The accessor "getIdempotent" gives direct access to the value + */ + public OperationDefinition setIdempotentElement(BooleanType value) { + this.idempotent = value; + return this; + } + + /** + * @return Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST. + */ + public boolean getIdempotent() { + return this.idempotent == null || this.idempotent.isEmpty() ? false : this.idempotent.getValue(); + } + + /** + * @param value Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST. + */ + public OperationDefinition setIdempotent(boolean value) { + if (this.idempotent == null) + this.idempotent = new BooleanType(); + this.idempotent.setValue(value); + return this; + } + + /** + * @return {@link #code} (The name used to invoke the operation.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (The name used to invoke the operation.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public OperationDefinition setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return The name used to invoke the operation. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value The name used to invoke the operation. + */ + public OperationDefinition setCode(String value) { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #notes} (Additional information about how to use this operation or named query.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public StringType getNotesElement() { + if (this.notes == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.notes"); + else if (Configuration.doAutoCreate()) + this.notes = new StringType(); // bb + return this.notes; + } + + public boolean hasNotesElement() { + return this.notes != null && !this.notes.isEmpty(); + } + + public boolean hasNotes() { + return this.notes != null && !this.notes.isEmpty(); + } + + /** + * @param value {@link #notes} (Additional information about how to use this operation or named query.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public OperationDefinition setNotesElement(StringType value) { + this.notes = value; + return this; + } + + /** + * @return Additional information about how to use this operation or named query. + */ + public String getNotes() { + return this.notes == null ? null : this.notes.getValue(); + } + + /** + * @param value Additional information about how to use this operation or named query. + */ + public OperationDefinition setNotes(String value) { + if (Utilities.noString(value)) + this.notes = null; + else { + if (this.notes == null) + this.notes = new StringType(); + this.notes.setValue(value); + } + return this; + } + + /** + * @return {@link #base} (Indicates that this operation definition is a constraining profile on the base.) + */ + public Reference getBase() { + if (this.base == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.base"); + else if (Configuration.doAutoCreate()) + this.base = new Reference(); // cc + return this.base; + } + + public boolean hasBase() { + return this.base != null && !this.base.isEmpty(); + } + + /** + * @param value {@link #base} (Indicates that this operation definition is a constraining profile on the base.) + */ + public OperationDefinition setBase(Reference value) { + this.base = value; + return this; + } + + /** + * @return {@link #base} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates that this operation definition is a constraining profile on the base.) + */ + public OperationDefinition getBaseTarget() { + if (this.baseTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.base"); + else if (Configuration.doAutoCreate()) + this.baseTarget = new OperationDefinition(); // aa + return this.baseTarget; + } + + /** + * @param value {@link #base} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates that this operation definition is a constraining profile on the base.) + */ + public OperationDefinition setBaseTarget(OperationDefinition value) { + this.baseTarget = value; + return this; + } + + /** + * @return {@link #system} (Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public BooleanType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.system"); + else if (Configuration.doAutoCreate()) + this.system = new BooleanType(); // bb + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public OperationDefinition setSystemElement(BooleanType value) { + this.system = value; + return this; + } + + /** + * @return Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context). + */ + public boolean getSystem() { + return this.system == null || this.system.isEmpty() ? false : this.system.getValue(); + } + + /** + * @param value Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context). + */ + public OperationDefinition setSystem(boolean value) { + if (this.system == null) + this.system = new BooleanType(); + this.system.setValue(value); + return this; + } + + /** + * @return {@link #type} (Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context).) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (CodeType item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context).) + */ + // syntactic sugar + public CodeType addTypeElement() {//2 + CodeType t = new CodeType(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + /** + * @param value {@link #type} (Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context).) + */ + public OperationDefinition addType(String value) { //1 + CodeType t = new CodeType(); + t.setValue(value); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + /** + * @param value {@link #type} (Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context).) + */ + public boolean hasType(String value) { + if (this.type == null) + return false; + for (CodeType v : this.type) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #instance} (Indicates whether this operation can be invoked on a particular instance of one of the given types.). This is the underlying object with id, value and extensions. The accessor "getInstance" gives direct access to the value + */ + public BooleanType getInstanceElement() { + if (this.instance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.instance"); + else if (Configuration.doAutoCreate()) + this.instance = new BooleanType(); // bb + return this.instance; + } + + public boolean hasInstanceElement() { + return this.instance != null && !this.instance.isEmpty(); + } + + public boolean hasInstance() { + return this.instance != null && !this.instance.isEmpty(); + } + + /** + * @param value {@link #instance} (Indicates whether this operation can be invoked on a particular instance of one of the given types.). This is the underlying object with id, value and extensions. The accessor "getInstance" gives direct access to the value + */ + public OperationDefinition setInstanceElement(BooleanType value) { + this.instance = value; + return this; + } + + /** + * @return Indicates whether this operation can be invoked on a particular instance of one of the given types. + */ + public boolean getInstance() { + return this.instance == null || this.instance.isEmpty() ? false : this.instance.getValue(); + } + + /** + * @param value Indicates whether this operation can be invoked on a particular instance of one of the given types. + */ + public OperationDefinition setInstance(boolean value) { + if (this.instance == null) + this.instance = new BooleanType(); + this.instance.setValue(value); + return this; + } + + /** + * @return {@link #parameter} (The parameters for the operation/query.) + */ + public List getParameter() { + if (this.parameter == null) + this.parameter = new ArrayList(); + return this.parameter; + } + + public boolean hasParameter() { + if (this.parameter == null) + return false; + for (OperationDefinitionParameterComponent item : this.parameter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #parameter} (The parameters for the operation/query.) + */ + // syntactic sugar + public OperationDefinitionParameterComponent addParameter() { //3 + OperationDefinitionParameterComponent t = new OperationDefinitionParameterComponent(); + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return t; + } + + // syntactic sugar + public OperationDefinition addParameter(OperationDefinitionParameterComponent t) { //3 + if (t == null) + return this; + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute url that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique uri).", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "A free text natural language name identifying the Profile.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the operation definition.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("description", "string", "A free text natural language description of the profile and its use.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("requirements", "string", "Explains why this operation definition is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("status", "code", "The status of the profile.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("date", "dateTime", "The date that this version of the profile was published.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("kind", "code", "Whether this is operation or named query.", 0, java.lang.Integer.MAX_VALUE, kind)); + childrenList.add(new Property("idempotent", "boolean", "Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST.", 0, java.lang.Integer.MAX_VALUE, idempotent)); + childrenList.add(new Property("code", "code", "The name used to invoke the operation.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("notes", "string", "Additional information about how to use this operation or named query.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("base", "Reference(OperationDefinition)", "Indicates that this operation definition is a constraining profile on the base.", 0, java.lang.Integer.MAX_VALUE, base)); + childrenList.add(new Property("system", "boolean", "Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context).", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("type", "code", "Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context).", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("instance", "boolean", "Indicates whether this operation can be invoked on a particular instance of one of the given types.", 0, java.lang.Integer.MAX_VALUE, instance)); + childrenList.add(new Property("parameter", "", "The parameters for the operation/query.", 0, java.lang.Integer.MAX_VALUE, parameter)); + } + + public OperationDefinition copy() { + OperationDefinition dst = new OperationDefinition(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (OperationDefinitionContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + dst.requirements = requirements == null ? null : requirements.copy(); + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.date = date == null ? null : date.copy(); + dst.kind = kind == null ? null : kind.copy(); + dst.idempotent = idempotent == null ? null : idempotent.copy(); + dst.code = code == null ? null : code.copy(); + dst.notes = notes == null ? null : notes.copy(); + dst.base = base == null ? null : base.copy(); + dst.system = system == null ? null : system.copy(); + if (type != null) { + dst.type = new ArrayList(); + for (CodeType i : type) + dst.type.add(i.copy()); + }; + dst.instance = instance == null ? null : instance.copy(); + if (parameter != null) { + dst.parameter = new ArrayList(); + for (OperationDefinitionParameterComponent i : parameter) + dst.parameter.add(i.copy()); + }; + return dst; + } + + protected OperationDefinition typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OperationDefinition)) + return false; + OperationDefinition o = (OperationDefinition) other; + return compareDeep(url, o.url, true) && compareDeep(version, o.version, true) && compareDeep(name, o.name, true) + && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(description, o.description, true) + && compareDeep(requirements, o.requirements, true) && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) + && compareDeep(date, o.date, true) && compareDeep(kind, o.kind, true) && compareDeep(idempotent, o.idempotent, true) + && compareDeep(code, o.code, true) && compareDeep(notes, o.notes, true) && compareDeep(base, o.base, true) + && compareDeep(system, o.system, true) && compareDeep(type, o.type, true) && compareDeep(instance, o.instance, true) + && compareDeep(parameter, o.parameter, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OperationDefinition)) + return false; + OperationDefinition o = (OperationDefinition) other; + return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) + && compareValues(publisher, o.publisher, true) && compareValues(description, o.description, true) && compareValues(requirements, o.requirements, true) + && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(date, o.date, true) + && compareValues(kind, o.kind, true) && compareValues(idempotent, o.idempotent, true) && compareValues(code, o.code, true) + && compareValues(notes, o.notes, true) && compareValues(system, o.system, true) && compareValues(type, o.type, true) + && compareValues(instance, o.instance, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (version == null || version.isEmpty()) + && (name == null || name.isEmpty()) && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) + && (description == null || description.isEmpty()) && (requirements == null || requirements.isEmpty()) + && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) + && (date == null || date.isEmpty()) && (kind == null || kind.isEmpty()) && (idempotent == null || idempotent.isEmpty()) + && (code == null || code.isEmpty()) && (notes == null || notes.isEmpty()) && (base == null || base.isEmpty()) + && (system == null || system.isEmpty()) && (type == null || type.isEmpty()) && (instance == null || instance.isEmpty()) + && (parameter == null || parameter.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.OperationDefinition; + } + + @SearchParamDefinition(name="date", path="OperationDefinition.date", description="Date for this version of the operation definition", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="code", path="OperationDefinition.code", description="Name used to invoke the operation", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="instance", path="OperationDefinition.instance", description="Invoke on an instance?", type="token" ) + public static final String SP_INSTANCE = "instance"; + @SearchParamDefinition(name="kind", path="OperationDefinition.kind", description="operation | query", type="token" ) + public static final String SP_KIND = "kind"; + @SearchParamDefinition(name="profile", path="OperationDefinition.parameter.profile", description="Profile on the type", type="reference" ) + public static final String SP_PROFILE = "profile"; + @SearchParamDefinition(name="type", path="OperationDefinition.type", description="Invoke at resource level for these type", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="version", path="OperationDefinition.version", description="Logical id for this version of the operation definition", type="token" ) + public static final String SP_VERSION = "version"; + @SearchParamDefinition(name="url", path="OperationDefinition.url", description="Logical url to reference this operation definition", type="uri" ) + public static final String SP_URL = "url"; + @SearchParamDefinition(name="system", path="OperationDefinition.system", description="Invoke at the system level?", type="token" ) + public static final String SP_SYSTEM = "system"; + @SearchParamDefinition(name="name", path="OperationDefinition.name", description="Informal name for this profile", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="publisher", path="OperationDefinition.publisher", description="Name of the publisher (Organization or individual)", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + @SearchParamDefinition(name="status", path="OperationDefinition.status", description="draft | active | retired", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="base", path="OperationDefinition.base", description="Marks this as a profile of the base", type="reference" ) + public static final String SP_BASE = "base"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/OperationOutcome.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/OperationOutcome.java index bf337a0a962..806e2213e35 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/OperationOutcome.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/OperationOutcome.java @@ -1,548 +1,527 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A collection of error, warning or information messages that result from a system action. - */ -@ResourceDef(name="OperationOutcome", profile="http://hl7.org/fhir/Profile/OperationOutcome") -public class OperationOutcome extends DomainResource { - - public enum IssueSeverity { - /** - * The issue caused the action to fail, and no further checking could be performed. - */ - FATAL, - /** - * The issue is sufficiently important to cause the action to fail. - */ - ERROR, - /** - * The issue is not important enough to cause the action to fail, but may cause it to be performed suboptimally or in a way that is not as desired. - */ - WARNING, - /** - * The issue has no relation to the degree of success of the action. - */ - INFORMATION, - /** - * added to help the parsers - */ - NULL; - public static IssueSeverity fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("fatal".equals(codeString)) - return FATAL; - if ("error".equals(codeString)) - return ERROR; - if ("warning".equals(codeString)) - return WARNING; - if ("information".equals(codeString)) - return INFORMATION; - throw new Exception("Unknown IssueSeverity code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case FATAL: return "fatal"; - case ERROR: return "error"; - case WARNING: return "warning"; - case INFORMATION: return "information"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case FATAL: return ""; - case ERROR: return ""; - case WARNING: return ""; - case INFORMATION: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case FATAL: return "The issue caused the action to fail, and no further checking could be performed."; - case ERROR: return "The issue is sufficiently important to cause the action to fail."; - case WARNING: return "The issue is not important enough to cause the action to fail, but may cause it to be performed suboptimally or in a way that is not as desired."; - case INFORMATION: return "The issue has no relation to the degree of success of the action."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case FATAL: return "Fatal"; - case ERROR: return "Error"; - case WARNING: return "Warning"; - case INFORMATION: return "Information"; - default: return "?"; - } - } - } - - public static class IssueSeverityEnumFactory implements EnumFactory { - public IssueSeverity fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("fatal".equals(codeString)) - return IssueSeverity.FATAL; - if ("error".equals(codeString)) - return IssueSeverity.ERROR; - if ("warning".equals(codeString)) - return IssueSeverity.WARNING; - if ("information".equals(codeString)) - return IssueSeverity.INFORMATION; - throw new IllegalArgumentException("Unknown IssueSeverity code '"+codeString+"'"); - } - public String toCode(IssueSeverity code) { - if (code == IssueSeverity.FATAL) - return "fatal"; - if (code == IssueSeverity.ERROR) - return "error"; - if (code == IssueSeverity.WARNING) - return "warning"; - if (code == IssueSeverity.INFORMATION) - return "information"; - return "?"; - } - } - - @Block() - public static class OperationOutcomeIssueComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Indicates whether the issue indicates a variation from successful processing. - */ - @Child(name = "severity", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="fatal | error | warning | information", formalDefinition="Indicates whether the issue indicates a variation from successful processing." ) - protected Enumeration severity; - - /** - * Describes the type of the issue. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=2, min=1, max=1) - @Description(shortDefinition="Error or warning code", formalDefinition="Describes the type of the issue." ) - protected CodeableConcept code; - - /** - * Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stck dump to help trace the issue. - */ - @Child(name = "details", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Additional diagnostic information about the issue", formalDefinition="Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stck dump to help trace the issue." ) - protected StringType details; - - /** - * A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised. - */ - @Child(name = "location", type = {StringType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="XPath of element(s) related to issue", formalDefinition="A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised." ) - protected List location; - - private static final long serialVersionUID = -869408333L; - - /* - * Constructor - */ - public OperationOutcomeIssueComponent() { - super(); - } - - /* - * Constructor - */ - public OperationOutcomeIssueComponent(Enumeration severity, CodeableConcept code) { - super(); - this.severity = severity; - this.code = code; - } - - /** - * @return {@link #severity} (Indicates whether the issue indicates a variation from successful processing.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public Enumeration getSeverityElement() { - if (this.severity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.severity"); - else if (Configuration.doAutoCreate()) - this.severity = new Enumeration(new IssueSeverityEnumFactory()); // bb - return this.severity; - } - - public boolean hasSeverityElement() { - return this.severity != null && !this.severity.isEmpty(); - } - - public boolean hasSeverity() { - return this.severity != null && !this.severity.isEmpty(); - } - - /** - * @param value {@link #severity} (Indicates whether the issue indicates a variation from successful processing.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public OperationOutcomeIssueComponent setSeverityElement(Enumeration value) { - this.severity = value; - return this; - } - - /** - * @return Indicates whether the issue indicates a variation from successful processing. - */ - public IssueSeverity getSeverity() { - return this.severity == null ? null : this.severity.getValue(); - } - - /** - * @param value Indicates whether the issue indicates a variation from successful processing. - */ - public OperationOutcomeIssueComponent setSeverity(IssueSeverity value) { - if (this.severity == null) - this.severity = new Enumeration(new IssueSeverityEnumFactory()); - this.severity.setValue(value); - return this; - } - - /** - * @return {@link #code} (Describes the type of the issue.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Describes the type of the issue.) - */ - public OperationOutcomeIssueComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #details} (Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stck dump to help trace the issue.). This is the underlying object with id, value and extensions. The accessor "getDetails" gives direct access to the value - */ - public StringType getDetailsElement() { - if (this.details == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.details"); - else if (Configuration.doAutoCreate()) - this.details = new StringType(); // bb - return this.details; - } - - public boolean hasDetailsElement() { - return this.details != null && !this.details.isEmpty(); - } - - public boolean hasDetails() { - return this.details != null && !this.details.isEmpty(); - } - - /** - * @param value {@link #details} (Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stck dump to help trace the issue.). This is the underlying object with id, value and extensions. The accessor "getDetails" gives direct access to the value - */ - public OperationOutcomeIssueComponent setDetailsElement(StringType value) { - this.details = value; - return this; - } - - /** - * @return Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stck dump to help trace the issue. - */ - public String getDetails() { - return this.details == null ? null : this.details.getValue(); - } - - /** - * @param value Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stck dump to help trace the issue. - */ - public OperationOutcomeIssueComponent setDetails(String value) { - if (Utilities.noString(value)) - this.details = null; - else { - if (this.details == null) - this.details = new StringType(); - this.details.setValue(value); - } - return this; - } - - /** - * @return {@link #location} (A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) - */ - public List getLocation() { - if (this.location == null) - this.location = new ArrayList(); - return this.location; - } - - public boolean hasLocation() { - if (this.location == null) - return false; - for (StringType item : this.location) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #location} (A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) - */ - // syntactic sugar - public StringType addLocationElement() {//2 - StringType t = new StringType(); - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return t; - } - - /** - * @param value {@link #location} (A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) - */ - public OperationOutcomeIssueComponent addLocation(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return this; - } - - /** - * @param value {@link #location} (A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) - */ - public boolean hasLocation(String value) { - if (this.location == null) - return false; - for (StringType v : this.location) - if (v.equals(value)) // string - return true; - return false; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("severity", "code", "Indicates whether the issue indicates a variation from successful processing.", 0, java.lang.Integer.MAX_VALUE, severity)); - childrenList.add(new Property("code", "CodeableConcept", "Describes the type of the issue.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("details", "string", "Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stck dump to help trace the issue.", 0, java.lang.Integer.MAX_VALUE, details)); - childrenList.add(new Property("location", "string", "A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.", 0, java.lang.Integer.MAX_VALUE, location)); - } - - public OperationOutcomeIssueComponent copy() { - OperationOutcomeIssueComponent dst = new OperationOutcomeIssueComponent(); - copyValues(dst); - dst.severity = severity == null ? null : severity.copy(); - dst.code = code == null ? null : code.copy(); - dst.details = details == null ? null : details.copy(); - if (location != null) { - dst.location = new ArrayList(); - for (StringType i : location) - dst.location.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OperationOutcomeIssueComponent)) - return false; - OperationOutcomeIssueComponent o = (OperationOutcomeIssueComponent) other; - return compareDeep(severity, o.severity, true) && compareDeep(code, o.code, true) && compareDeep(details, o.details, true) - && compareDeep(location, o.location, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OperationOutcomeIssueComponent)) - return false; - OperationOutcomeIssueComponent o = (OperationOutcomeIssueComponent) other; - return compareValues(severity, o.severity, true) && compareValues(details, o.details, true) && compareValues(location, o.location, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (severity == null || severity.isEmpty()) && (code == null || code.isEmpty()) - && (details == null || details.isEmpty()) && (location == null || location.isEmpty()); - } - - } - - /** - * An error, warning or information message that results from a system action. - */ - @Child(name = "issue", type = {}, order=0, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A single issue associated with the action", formalDefinition="An error, warning or information message that results from a system action." ) - protected List issue; - - private static final long serialVersionUID = -152150052L; - - /* - * Constructor - */ - public OperationOutcome() { - super(); - } - - /** - * @return {@link #issue} (An error, warning or information message that results from a system action.) - */ - public List getIssue() { - if (this.issue == null) - this.issue = new ArrayList(); - return this.issue; - } - - public boolean hasIssue() { - if (this.issue == null) - return false; - for (OperationOutcomeIssueComponent item : this.issue) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #issue} (An error, warning or information message that results from a system action.) - */ - // syntactic sugar - public OperationOutcomeIssueComponent addIssue() { //3 - OperationOutcomeIssueComponent t = new OperationOutcomeIssueComponent(); - if (this.issue == null) - this.issue = new ArrayList(); - this.issue.add(t); - return t; - } - - // syntactic sugar - public OperationOutcome addIssue(OperationOutcomeIssueComponent t) { //3 - if (t == null) - return this; - if (this.issue == null) - this.issue = new ArrayList(); - this.issue.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("issue", "", "An error, warning or information message that results from a system action.", 0, java.lang.Integer.MAX_VALUE, issue)); - } - - public OperationOutcome copy() { - OperationOutcome dst = new OperationOutcome(); - copyValues(dst); - if (issue != null) { - dst.issue = new ArrayList(); - for (OperationOutcomeIssueComponent i : issue) - dst.issue.add(i.copy()); - }; - return dst; - } - - protected OperationOutcome typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OperationOutcome)) - return false; - OperationOutcome o = (OperationOutcome) other; - return compareDeep(issue, o.issue, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OperationOutcome)) - return false; - OperationOutcome o = (OperationOutcome) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (issue == null || issue.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.OperationOutcome; - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A collection of error, warning or information messages that result from a system action. + */ +@ResourceDef(name="OperationOutcome", profile="http://hl7.org/fhir/Profile/OperationOutcome") +public class OperationOutcome extends DomainResource { + + public enum IssueSeverity { + /** + * The issue caused the action to fail, and no further checking could be performed. + */ + FATAL, + /** + * The issue is sufficiently important to cause the action to fail. + */ + ERROR, + /** + * The issue is not important enough to cause the action to fail, but may cause it to be performed suboptimally or in a way that is not as desired. + */ + WARNING, + /** + * The issue has no relation to the degree of success of the action. + */ + INFORMATION, + /** + * added to help the parsers + */ + NULL; + public static IssueSeverity fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("fatal".equals(codeString)) + return FATAL; + if ("error".equals(codeString)) + return ERROR; + if ("warning".equals(codeString)) + return WARNING; + if ("information".equals(codeString)) + return INFORMATION; + throw new Exception("Unknown IssueSeverity code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case FATAL: return "fatal"; + case ERROR: return "error"; + case WARNING: return "warning"; + case INFORMATION: return "information"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case FATAL: return ""; + case ERROR: return ""; + case WARNING: return ""; + case INFORMATION: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case FATAL: return "The issue caused the action to fail, and no further checking could be performed."; + case ERROR: return "The issue is sufficiently important to cause the action to fail."; + case WARNING: return "The issue is not important enough to cause the action to fail, but may cause it to be performed suboptimally or in a way that is not as desired."; + case INFORMATION: return "The issue has no relation to the degree of success of the action."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case FATAL: return "Fatal"; + case ERROR: return "Error"; + case WARNING: return "Warning"; + case INFORMATION: return "Information"; + default: return "?"; + } + } + } + + public static class IssueSeverityEnumFactory implements EnumFactory { + public IssueSeverity fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("fatal".equals(codeString)) + return IssueSeverity.FATAL; + if ("error".equals(codeString)) + return IssueSeverity.ERROR; + if ("warning".equals(codeString)) + return IssueSeverity.WARNING; + if ("information".equals(codeString)) + return IssueSeverity.INFORMATION; + throw new IllegalArgumentException("Unknown IssueSeverity code '"+codeString+"'"); + } + public String toCode(IssueSeverity code) { + if (code == IssueSeverity.FATAL) + return "fatal"; + if (code == IssueSeverity.ERROR) + return "error"; + if (code == IssueSeverity.WARNING) + return "warning"; + if (code == IssueSeverity.INFORMATION) + return "information"; + return "?"; + } + } + + @Block() + public static class OperationOutcomeIssueComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Indicates whether the issue indicates a variation from successful processing. + */ + @Child(name = "severity", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="fatal | error | warning | information", formalDefinition="Indicates whether the issue indicates a variation from successful processing." ) + protected Enumeration severity; + + /** + * Describes the type of the issue. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=2, min=1, max=1) + @Description(shortDefinition="Error or warning code", formalDefinition="Describes the type of the issue." ) + protected CodeableConcept code; + + /** + * Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stck dump to help trace the issue. + */ + @Child(name = "details", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Additional diagnostic information about the issue", formalDefinition="Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stck dump to help trace the issue." ) + protected StringType details; + + /** + * A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised. + */ + @Child(name = "location", type = {StringType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="XPath of element(s) related to issue", formalDefinition="A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised." ) + protected List location; + + private static final long serialVersionUID = -869408333L; + + /* + * Constructor + */ + public OperationOutcomeIssueComponent() { + super(); + } + + /* + * Constructor + */ + public OperationOutcomeIssueComponent(Enumeration severity, CodeableConcept code) { + super(); + this.severity = severity; + this.code = code; + } + + /** + * @return {@link #severity} (Indicates whether the issue indicates a variation from successful processing.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public Enumeration getSeverityElement() { + if (this.severity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.severity"); + else if (Configuration.doAutoCreate()) + this.severity = new Enumeration(new IssueSeverityEnumFactory()); // bb + return this.severity; + } + + public boolean hasSeverityElement() { + return this.severity != null && !this.severity.isEmpty(); + } + + public boolean hasSeverity() { + return this.severity != null && !this.severity.isEmpty(); + } + + /** + * @param value {@link #severity} (Indicates whether the issue indicates a variation from successful processing.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public OperationOutcomeIssueComponent setSeverityElement(Enumeration value) { + this.severity = value; + return this; + } + + /** + * @return Indicates whether the issue indicates a variation from successful processing. + */ + public IssueSeverity getSeverity() { + return this.severity == null ? null : this.severity.getValue(); + } + + /** + * @param value Indicates whether the issue indicates a variation from successful processing. + */ + public OperationOutcomeIssueComponent setSeverity(IssueSeverity value) { + if (this.severity == null) + this.severity = new Enumeration(new IssueSeverityEnumFactory()); + this.severity.setValue(value); + return this; + } + + /** + * @return {@link #code} (Describes the type of the issue.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Describes the type of the issue.) + */ + public OperationOutcomeIssueComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #details} (Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stck dump to help trace the issue.). This is the underlying object with id, value and extensions. The accessor "getDetails" gives direct access to the value + */ + public StringType getDetailsElement() { + if (this.details == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.details"); + else if (Configuration.doAutoCreate()) + this.details = new StringType(); // bb + return this.details; + } + + public boolean hasDetailsElement() { + return this.details != null && !this.details.isEmpty(); + } + + public boolean hasDetails() { + return this.details != null && !this.details.isEmpty(); + } + + /** + * @param value {@link #details} (Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stck dump to help trace the issue.). This is the underlying object with id, value and extensions. The accessor "getDetails" gives direct access to the value + */ + public OperationOutcomeIssueComponent setDetailsElement(StringType value) { + this.details = value; + return this; + } + + /** + * @return Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stck dump to help trace the issue. + */ + public String getDetails() { + return this.details == null ? null : this.details.getValue(); + } + + /** + * @param value Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stck dump to help trace the issue. + */ + public OperationOutcomeIssueComponent setDetails(String value) { + if (Utilities.noString(value)) + this.details = null; + else { + if (this.details == null) + this.details = new StringType(); + this.details.setValue(value); + } + return this; + } + + /** + * @return {@link #location} (A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) + */ + public List getLocation() { + if (this.location == null) + this.location = new ArrayList(); + return this.location; + } + + public boolean hasLocation() { + if (this.location == null) + return false; + for (StringType item : this.location) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #location} (A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) + */ + // syntactic sugar + public StringType addLocationElement() {//2 + StringType t = new StringType(); + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return t; + } + + /** + * @param value {@link #location} (A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) + */ + public OperationOutcomeIssueComponent addLocation(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return this; + } + + /** + * @param value {@link #location} (A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) + */ + public boolean hasLocation(String value) { + if (this.location == null) + return false; + for (StringType v : this.location) + if (v.equals(value)) // string + return true; + return false; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("severity", "code", "Indicates whether the issue indicates a variation from successful processing.", 0, java.lang.Integer.MAX_VALUE, severity)); + childrenList.add(new Property("code", "CodeableConcept", "Describes the type of the issue.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("details", "string", "Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stck dump to help trace the issue.", 0, java.lang.Integer.MAX_VALUE, details)); + childrenList.add(new Property("location", "string", "A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.", 0, java.lang.Integer.MAX_VALUE, location)); + } + + public OperationOutcomeIssueComponent copy() { + OperationOutcomeIssueComponent dst = new OperationOutcomeIssueComponent(); + copyValues(dst); + dst.severity = severity == null ? null : severity.copy(); + dst.code = code == null ? null : code.copy(); + dst.details = details == null ? null : details.copy(); + if (location != null) { + dst.location = new ArrayList(); + for (StringType i : location) + dst.location.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OperationOutcomeIssueComponent)) + return false; + OperationOutcomeIssueComponent o = (OperationOutcomeIssueComponent) other; + return compareDeep(severity, o.severity, true) && compareDeep(code, o.code, true) && compareDeep(details, o.details, true) + && compareDeep(location, o.location, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OperationOutcomeIssueComponent)) + return false; + OperationOutcomeIssueComponent o = (OperationOutcomeIssueComponent) other; + return compareValues(severity, o.severity, true) && compareValues(details, o.details, true) && compareValues(location, o.location, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (severity == null || severity.isEmpty()) && (code == null || code.isEmpty()) + && (details == null || details.isEmpty()) && (location == null || location.isEmpty()); + } + + } + + /** + * An error, warning or information message that results from a system action. + */ + @Child(name = "issue", type = {}, order=0, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A single issue associated with the action", formalDefinition="An error, warning or information message that results from a system action." ) + protected List issue; + + private static final long serialVersionUID = -152150052L; + + /* + * Constructor + */ + public OperationOutcome() { + super(); + } + + /** + * @return {@link #issue} (An error, warning or information message that results from a system action.) + */ + public List getIssue() { + if (this.issue == null) + this.issue = new ArrayList(); + return this.issue; + } + + public boolean hasIssue() { + if (this.issue == null) + return false; + for (OperationOutcomeIssueComponent item : this.issue) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #issue} (An error, warning or information message that results from a system action.) + */ + // syntactic sugar + public OperationOutcomeIssueComponent addIssue() { //3 + OperationOutcomeIssueComponent t = new OperationOutcomeIssueComponent(); + if (this.issue == null) + this.issue = new ArrayList(); + this.issue.add(t); + return t; + } + + // syntactic sugar + public OperationOutcome addIssue(OperationOutcomeIssueComponent t) { //3 + if (t == null) + return this; + if (this.issue == null) + this.issue = new ArrayList(); + this.issue.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("issue", "", "An error, warning or information message that results from a system action.", 0, java.lang.Integer.MAX_VALUE, issue)); + } + + public OperationOutcome copy() { + OperationOutcome dst = new OperationOutcome(); + copyValues(dst); + if (issue != null) { + dst.issue = new ArrayList(); + for (OperationOutcomeIssueComponent i : issue) + dst.issue.add(i.copy()); + }; + return dst; + } + + protected OperationOutcome typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OperationOutcome)) + return false; + OperationOutcome o = (OperationOutcome) other; + return compareDeep(issue, o.issue, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OperationOutcome)) + return false; + OperationOutcome o = (OperationOutcome) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (issue == null || issue.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.OperationOutcome; + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Order.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Order.java index 46bce6d2585..73fb9c3512f 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Order.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Order.java @@ -1,735 +1,714 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A request to perform an action. - */ -@ResourceDef(name="Order", profile="http://hl7.org/fhir/Profile/Order") -public class Order extends DomainResource { - - @Block() - public static class OrderWhenComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code specifies when request should be done. The code may simply be a priority code. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Code specifies when request should be done. The code may simply be a priority code", formalDefinition="Code specifies when request should be done. The code may simply be a priority code." ) - protected CodeableConcept code; - - /** - * A formal schedule. - */ - @Child(name = "schedule", type = {Timing.class}, order=2, min=0, max=1) - @Description(shortDefinition="A formal schedule", formalDefinition="A formal schedule." ) - protected Timing schedule; - - private static final long serialVersionUID = 307115287L; - - /* - * Constructor - */ - public OrderWhenComponent() { - super(); - } - - /** - * @return {@link #code} (Code specifies when request should be done. The code may simply be a priority code.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderWhenComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code specifies when request should be done. The code may simply be a priority code.) - */ - public OrderWhenComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #schedule} (A formal schedule.) - */ - public Timing getSchedule() { - if (this.schedule == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderWhenComponent.schedule"); - else if (Configuration.doAutoCreate()) - this.schedule = new Timing(); // cc - return this.schedule; - } - - public boolean hasSchedule() { - return this.schedule != null && !this.schedule.isEmpty(); - } - - /** - * @param value {@link #schedule} (A formal schedule.) - */ - public OrderWhenComponent setSchedule(Timing value) { - this.schedule = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "Code specifies when request should be done. The code may simply be a priority code.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("schedule", "Timing", "A formal schedule.", 0, java.lang.Integer.MAX_VALUE, schedule)); - } - - public OrderWhenComponent copy() { - OrderWhenComponent dst = new OrderWhenComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.schedule = schedule == null ? null : schedule.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OrderWhenComponent)) - return false; - OrderWhenComponent o = (OrderWhenComponent) other; - return compareDeep(code, o.code, true) && compareDeep(schedule, o.schedule, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OrderWhenComponent)) - return false; - OrderWhenComponent o = (OrderWhenComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (schedule == null || schedule.isEmpty()) - ; - } - - } - - /** - * Identifiers assigned to this order by the orderer or by the receiver. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Identifiers assigned to this order by the orderer or by the receiver", formalDefinition="Identifiers assigned to this order by the orderer or by the receiver." ) - protected List identifier; - - /** - * When the order was made. - */ - @Child(name = "date", type = {DateTimeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="When the order was made", formalDefinition="When the order was made." ) - protected DateTimeType date; - - /** - * Patient this order is about. - */ - @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Substance.class}, order=2, min=0, max=1) - @Description(shortDefinition="Patient this order is about", formalDefinition="Patient this order is about." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Patient this order is about.) - */ - protected Resource subjectTarget; - - /** - * Who initiated the order. - */ - @Child(name = "source", type = {Practitioner.class}, order=3, min=0, max=1) - @Description(shortDefinition="Who initiated the order", formalDefinition="Who initiated the order." ) - protected Reference source; - - /** - * The actual object that is the target of the reference (Who initiated the order.) - */ - protected Practitioner sourceTarget; - - /** - * Who is intended to fulfill the order. - */ - @Child(name = "target", type = {Organization.class, Device.class, Practitioner.class}, order=4, min=0, max=1) - @Description(shortDefinition="Who is intended to fulfill the order", formalDefinition="Who is intended to fulfill the order." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (Who is intended to fulfill the order.) - */ - protected Resource targetTarget; - - /** - * Text - why the order was made. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=5, min=0, max=1) - @Description(shortDefinition="Text - why the order was made", formalDefinition="Text - why the order was made." ) - protected Type reason; - - /** - * If required by policy. - */ - @Child(name = "authority", type = {}, order=6, min=0, max=1) - @Description(shortDefinition="If required by policy", formalDefinition="If required by policy." ) - protected Reference authority; - - /** - * The actual object that is the target of the reference (If required by policy.) - */ - protected Resource authorityTarget; - - /** - * When order should be fulfilled. - */ - @Child(name = "when", type = {}, order=7, min=0, max=1) - @Description(shortDefinition="When order should be fulfilled", formalDefinition="When order should be fulfilled." ) - protected OrderWhenComponent when; - - /** - * What action is being ordered. - */ - @Child(name = "detail", type = {}, order=8, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="What action is being ordered", formalDefinition="What action is being ordered." ) - protected List detail; - /** - * The actual objects that are the target of the reference (What action is being ordered.) - */ - protected List detailTarget; - - - private static final long serialVersionUID = 595782234L; - - /* - * Constructor - */ - public Order() { - super(); - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the orderer or by the receiver.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the orderer or by the receiver.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Order addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #date} (When the order was made.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Order.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (When the order was made.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public Order setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return When the order was made. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value When the order was made. - */ - public Order setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #subject} (Patient this order is about.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Order.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (Patient this order is about.) - */ - public Order setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Patient this order is about.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Patient this order is about.) - */ - public Order setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #source} (Who initiated the order.) - */ - public Reference getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Order.source"); - else if (Configuration.doAutoCreate()) - this.source = new Reference(); // cc - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (Who initiated the order.) - */ - public Order setSource(Reference value) { - this.source = value; - return this; - } - - /** - * @return {@link #source} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who initiated the order.) - */ - public Practitioner getSourceTarget() { - if (this.sourceTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Order.source"); - else if (Configuration.doAutoCreate()) - this.sourceTarget = new Practitioner(); // aa - return this.sourceTarget; - } - - /** - * @param value {@link #source} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who initiated the order.) - */ - public Order setSourceTarget(Practitioner value) { - this.sourceTarget = value; - return this; - } - - /** - * @return {@link #target} (Who is intended to fulfill the order.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Order.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); // cc - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (Who is intended to fulfill the order.) - */ - public Order setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who is intended to fulfill the order.) - */ - public Resource getTargetTarget() { - return this.targetTarget; - } - - /** - * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who is intended to fulfill the order.) - */ - public Order setTargetTarget(Resource value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #reason} (Text - why the order was made.) - */ - public Type getReason() { - return this.reason; - } - - /** - * @return {@link #reason} (Text - why the order was made.) - */ - public CodeableConcept getReasonCodeableConcept() throws Exception { - if (!(this.reason instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (CodeableConcept) this.reason; - } - - /** - * @return {@link #reason} (Text - why the order was made.) - */ - public Reference getReasonReference() throws Exception { - if (!(this.reason instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (Reference) this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Text - why the order was made.) - */ - public Order setReason(Type value) { - this.reason = value; - return this; - } - - /** - * @return {@link #authority} (If required by policy.) - */ - public Reference getAuthority() { - if (this.authority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Order.authority"); - else if (Configuration.doAutoCreate()) - this.authority = new Reference(); // cc - return this.authority; - } - - public boolean hasAuthority() { - return this.authority != null && !this.authority.isEmpty(); - } - - /** - * @param value {@link #authority} (If required by policy.) - */ - public Order setAuthority(Reference value) { - this.authority = value; - return this; - } - - /** - * @return {@link #authority} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (If required by policy.) - */ - public Resource getAuthorityTarget() { - return this.authorityTarget; - } - - /** - * @param value {@link #authority} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (If required by policy.) - */ - public Order setAuthorityTarget(Resource value) { - this.authorityTarget = value; - return this; - } - - /** - * @return {@link #when} (When order should be fulfilled.) - */ - public OrderWhenComponent getWhen() { - if (this.when == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Order.when"); - else if (Configuration.doAutoCreate()) - this.when = new OrderWhenComponent(); // cc - return this.when; - } - - public boolean hasWhen() { - return this.when != null && !this.when.isEmpty(); - } - - /** - * @param value {@link #when} (When order should be fulfilled.) - */ - public Order setWhen(OrderWhenComponent value) { - this.when = value; - return this; - } - - /** - * @return {@link #detail} (What action is being ordered.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (Reference item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (What action is being ordered.) - */ - // syntactic sugar - public Reference addDetail() { //3 - Reference t = new Reference(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - // syntactic sugar - public Order addDetail(Reference t) { //3 - if (t == null) - return this; - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return this; - } - - /** - * @return {@link #detail} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. What action is being ordered.) - */ - public List getDetailTarget() { - if (this.detailTarget == null) - this.detailTarget = new ArrayList(); - return this.detailTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the orderer or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("date", "dateTime", "When the order was made.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Substance)", "Patient this order is about.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("source", "Reference(Practitioner)", "Who initiated the order.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("target", "Reference(Organization|Device|Practitioner)", "Who is intended to fulfill the order.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Any)", "Text - why the order was made.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("authority", "Reference(Any)", "If required by policy.", 0, java.lang.Integer.MAX_VALUE, authority)); - childrenList.add(new Property("when", "", "When order should be fulfilled.", 0, java.lang.Integer.MAX_VALUE, when)); - childrenList.add(new Property("detail", "Reference(Any)", "What action is being ordered.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - public Order copy() { - Order dst = new Order(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.date = date == null ? null : date.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.source = source == null ? null : source.copy(); - dst.target = target == null ? null : target.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.authority = authority == null ? null : authority.copy(); - dst.when = when == null ? null : when.copy(); - if (detail != null) { - dst.detail = new ArrayList(); - for (Reference i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - protected Order typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Order)) - return false; - Order o = (Order) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(date, o.date, true) && compareDeep(subject, o.subject, true) - && compareDeep(source, o.source, true) && compareDeep(target, o.target, true) && compareDeep(reason, o.reason, true) - && compareDeep(authority, o.authority, true) && compareDeep(when, o.when, true) && compareDeep(detail, o.detail, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Order)) - return false; - Order o = (Order) other; - return compareValues(date, o.date, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (date == null || date.isEmpty()) - && (subject == null || subject.isEmpty()) && (source == null || source.isEmpty()) && (target == null || target.isEmpty()) - && (reason == null || reason.isEmpty()) && (authority == null || authority.isEmpty()) && (when == null || when.isEmpty()) - && (detail == null || detail.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Order; - } - - @SearchParamDefinition(name="authority", path="Order.authority", description="If required by policy", type="reference" ) - public static final String SP_AUTHORITY = "authority"; - @SearchParamDefinition(name="detail", path="Order.detail", description="What action is being ordered", type="reference" ) - public static final String SP_DETAIL = "detail"; - @SearchParamDefinition(name="patient", path="Order.subject", description="Patient this order is about", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="source", path="Order.source", description="Who initiated the order", type="reference" ) - public static final String SP_SOURCE = "source"; - @SearchParamDefinition(name="subject", path="Order.subject", description="Patient this order is about", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="when", path="Order.when.schedule", description="A formal schedule", type="date" ) - public static final String SP_WHEN = "when"; - @SearchParamDefinition(name="target", path="Order.target", description="Who is intended to fulfill the order", type="reference" ) - public static final String SP_TARGET = "target"; - @SearchParamDefinition(name="when_code", path="Order.when.code", description="Code specifies when request should be done. The code may simply be a priority code", type="token" ) - public static final String SP_WHENCODE = "when_code"; - @SearchParamDefinition(name="date", path="Order.date", description="When the order was made", type="date" ) - public static final String SP_DATE = "date"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A request to perform an action. + */ +@ResourceDef(name="Order", profile="http://hl7.org/fhir/Profile/Order") +public class Order extends DomainResource { + + @Block() + public static class OrderWhenComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code specifies when request should be done. The code may simply be a priority code. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Code specifies when request should be done. The code may simply be a priority code", formalDefinition="Code specifies when request should be done. The code may simply be a priority code." ) + protected CodeableConcept code; + + /** + * A formal schedule. + */ + @Child(name = "schedule", type = {Timing.class}, order=2, min=0, max=1) + @Description(shortDefinition="A formal schedule", formalDefinition="A formal schedule." ) + protected Timing schedule; + + private static final long serialVersionUID = 307115287L; + + /* + * Constructor + */ + public OrderWhenComponent() { + super(); + } + + /** + * @return {@link #code} (Code specifies when request should be done. The code may simply be a priority code.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderWhenComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code specifies when request should be done. The code may simply be a priority code.) + */ + public OrderWhenComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #schedule} (A formal schedule.) + */ + public Timing getSchedule() { + if (this.schedule == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderWhenComponent.schedule"); + else if (Configuration.doAutoCreate()) + this.schedule = new Timing(); // cc + return this.schedule; + } + + public boolean hasSchedule() { + return this.schedule != null && !this.schedule.isEmpty(); + } + + /** + * @param value {@link #schedule} (A formal schedule.) + */ + public OrderWhenComponent setSchedule(Timing value) { + this.schedule = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "Code specifies when request should be done. The code may simply be a priority code.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("schedule", "Timing", "A formal schedule.", 0, java.lang.Integer.MAX_VALUE, schedule)); + } + + public OrderWhenComponent copy() { + OrderWhenComponent dst = new OrderWhenComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.schedule = schedule == null ? null : schedule.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OrderWhenComponent)) + return false; + OrderWhenComponent o = (OrderWhenComponent) other; + return compareDeep(code, o.code, true) && compareDeep(schedule, o.schedule, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OrderWhenComponent)) + return false; + OrderWhenComponent o = (OrderWhenComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (schedule == null || schedule.isEmpty()) + ; + } + + } + + /** + * Identifiers assigned to this order by the orderer or by the receiver. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Identifiers assigned to this order by the orderer or by the receiver", formalDefinition="Identifiers assigned to this order by the orderer or by the receiver." ) + protected List identifier; + + /** + * When the order was made. + */ + @Child(name = "date", type = {DateTimeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="When the order was made", formalDefinition="When the order was made." ) + protected DateTimeType date; + + /** + * Patient this order is about. + */ + @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Substance.class}, order=2, min=0, max=1) + @Description(shortDefinition="Patient this order is about", formalDefinition="Patient this order is about." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Patient this order is about.) + */ + protected Resource subjectTarget; + + /** + * Who initiated the order. + */ + @Child(name = "source", type = {Practitioner.class}, order=3, min=0, max=1) + @Description(shortDefinition="Who initiated the order", formalDefinition="Who initiated the order." ) + protected Reference source; + + /** + * The actual object that is the target of the reference (Who initiated the order.) + */ + protected Practitioner sourceTarget; + + /** + * Who is intended to fulfill the order. + */ + @Child(name = "target", type = {Organization.class, Device.class, Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="Who is intended to fulfill the order", formalDefinition="Who is intended to fulfill the order." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (Who is intended to fulfill the order.) + */ + protected Resource targetTarget; + + /** + * Text - why the order was made. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=5, min=0, max=1) + @Description(shortDefinition="Text - why the order was made", formalDefinition="Text - why the order was made." ) + protected Type reason; + + /** + * If required by policy. + */ + @Child(name = "authority", type = {}, order=6, min=0, max=1) + @Description(shortDefinition="If required by policy", formalDefinition="If required by policy." ) + protected Reference authority; + + /** + * The actual object that is the target of the reference (If required by policy.) + */ + protected Resource authorityTarget; + + /** + * When order should be fulfilled. + */ + @Child(name = "when", type = {}, order=7, min=0, max=1) + @Description(shortDefinition="When order should be fulfilled", formalDefinition="When order should be fulfilled." ) + protected OrderWhenComponent when; + + /** + * What action is being ordered. + */ + @Child(name = "detail", type = {}, order=8, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="What action is being ordered", formalDefinition="What action is being ordered." ) + protected List detail; + /** + * The actual objects that are the target of the reference (What action is being ordered.) + */ + protected List detailTarget; + + + private static final long serialVersionUID = 595782234L; + + /* + * Constructor + */ + public Order() { + super(); + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order by the orderer or by the receiver.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order by the orderer or by the receiver.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Order addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #date} (When the order was made.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Order.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (When the order was made.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public Order setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return When the order was made. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value When the order was made. + */ + public Order setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #subject} (Patient this order is about.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Order.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Patient this order is about.) + */ + public Order setSubject(Reference value) { + this.subject = value; + return this; + } + + /** + * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Patient this order is about.) + */ + public Resource getSubjectTarget() { + return this.subjectTarget; + } + + /** + * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Patient this order is about.) + */ + public Order setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #source} (Who initiated the order.) + */ + public Reference getSource() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Order.source"); + else if (Configuration.doAutoCreate()) + this.source = new Reference(); // cc + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (Who initiated the order.) + */ + public Order setSource(Reference value) { + this.source = value; + return this; + } + + /** + * @return {@link #source} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who initiated the order.) + */ + public Practitioner getSourceTarget() { + if (this.sourceTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Order.source"); + else if (Configuration.doAutoCreate()) + this.sourceTarget = new Practitioner(); // aa + return this.sourceTarget; + } + + /** + * @param value {@link #source} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who initiated the order.) + */ + public Order setSourceTarget(Practitioner value) { + this.sourceTarget = value; + return this; + } + + /** + * @return {@link #target} (Who is intended to fulfill the order.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Order.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); // cc + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Who is intended to fulfill the order.) + */ + public Order setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who is intended to fulfill the order.) + */ + public Resource getTargetTarget() { + return this.targetTarget; + } + + /** + * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who is intended to fulfill the order.) + */ + public Order setTargetTarget(Resource value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #reason} (Text - why the order was made.) + */ + public Type getReason() { + return this.reason; + } + + /** + * @return {@link #reason} (Text - why the order was made.) + */ + public CodeableConcept getReasonCodeableConcept() throws Exception { + if (!(this.reason instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (CodeableConcept) this.reason; + } + + /** + * @return {@link #reason} (Text - why the order was made.) + */ + public Reference getReasonReference() throws Exception { + if (!(this.reason instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (Reference) this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Text - why the order was made.) + */ + public Order setReason(Type value) { + this.reason = value; + return this; + } + + /** + * @return {@link #authority} (If required by policy.) + */ + public Reference getAuthority() { + if (this.authority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Order.authority"); + else if (Configuration.doAutoCreate()) + this.authority = new Reference(); // cc + return this.authority; + } + + public boolean hasAuthority() { + return this.authority != null && !this.authority.isEmpty(); + } + + /** + * @param value {@link #authority} (If required by policy.) + */ + public Order setAuthority(Reference value) { + this.authority = value; + return this; + } + + /** + * @return {@link #authority} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (If required by policy.) + */ + public Resource getAuthorityTarget() { + return this.authorityTarget; + } + + /** + * @param value {@link #authority} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (If required by policy.) + */ + public Order setAuthorityTarget(Resource value) { + this.authorityTarget = value; + return this; + } + + /** + * @return {@link #when} (When order should be fulfilled.) + */ + public OrderWhenComponent getWhen() { + if (this.when == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Order.when"); + else if (Configuration.doAutoCreate()) + this.when = new OrderWhenComponent(); // cc + return this.when; + } + + public boolean hasWhen() { + return this.when != null && !this.when.isEmpty(); + } + + /** + * @param value {@link #when} (When order should be fulfilled.) + */ + public Order setWhen(OrderWhenComponent value) { + this.when = value; + return this; + } + + /** + * @return {@link #detail} (What action is being ordered.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (Reference item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (What action is being ordered.) + */ + // syntactic sugar + public Reference addDetail() { //3 + Reference t = new Reference(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + // syntactic sugar + public Order addDetail(Reference t) { //3 + if (t == null) + return this; + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return this; + } + + /** + * @return {@link #detail} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. What action is being ordered.) + */ + public List getDetailTarget() { + if (this.detailTarget == null) + this.detailTarget = new ArrayList(); + return this.detailTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the orderer or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("date", "dateTime", "When the order was made.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Substance)", "Patient this order is about.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("source", "Reference(Practitioner)", "Who initiated the order.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("target", "Reference(Organization|Device|Practitioner)", "Who is intended to fulfill the order.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Any)", "Text - why the order was made.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("authority", "Reference(Any)", "If required by policy.", 0, java.lang.Integer.MAX_VALUE, authority)); + childrenList.add(new Property("when", "", "When order should be fulfilled.", 0, java.lang.Integer.MAX_VALUE, when)); + childrenList.add(new Property("detail", "Reference(Any)", "What action is being ordered.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public Order copy() { + Order dst = new Order(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.date = date == null ? null : date.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.source = source == null ? null : source.copy(); + dst.target = target == null ? null : target.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.authority = authority == null ? null : authority.copy(); + dst.when = when == null ? null : when.copy(); + if (detail != null) { + dst.detail = new ArrayList(); + for (Reference i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + protected Order typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Order)) + return false; + Order o = (Order) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(date, o.date, true) && compareDeep(subject, o.subject, true) + && compareDeep(source, o.source, true) && compareDeep(target, o.target, true) && compareDeep(reason, o.reason, true) + && compareDeep(authority, o.authority, true) && compareDeep(when, o.when, true) && compareDeep(detail, o.detail, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Order)) + return false; + Order o = (Order) other; + return compareValues(date, o.date, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (date == null || date.isEmpty()) + && (subject == null || subject.isEmpty()) && (source == null || source.isEmpty()) && (target == null || target.isEmpty()) + && (reason == null || reason.isEmpty()) && (authority == null || authority.isEmpty()) && (when == null || when.isEmpty()) + && (detail == null || detail.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Order; + } + + @SearchParamDefinition(name="date", path="Order.date", description="When the order was made", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="subject", path="Order.subject", description="Patient this order is about", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="patient", path="Order.subject", description="Patient this order is about", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="authority", path="Order.authority", description="If required by policy", type="reference" ) + public static final String SP_AUTHORITY = "authority"; + @SearchParamDefinition(name="source", path="Order.source", description="Who initiated the order", type="reference" ) + public static final String SP_SOURCE = "source"; + @SearchParamDefinition(name="detail", path="Order.detail", description="What action is being ordered", type="reference" ) + public static final String SP_DETAIL = "detail"; + @SearchParamDefinition(name="when", path="Order.when.schedule", description="A formal schedule", type="date" ) + public static final String SP_WHEN = "when"; + @SearchParamDefinition(name="target", path="Order.target", description="Who is intended to fulfill the order", type="reference" ) + public static final String SP_TARGET = "target"; + @SearchParamDefinition(name="when_code", path="Order.when.code", description="Code specifies when request should be done. The code may simply be a priority code", type="token" ) + public static final String SP_WHENCODE = "when_code"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/OrderResponse.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/OrderResponse.java index d123542d6ef..3534a0271a4 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/OrderResponse.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/OrderResponse.java @@ -1,769 +1,748 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A response to an order. - */ -@ResourceDef(name="OrderResponse", profile="http://hl7.org/fhir/Profile/OrderResponse") -public class OrderResponse extends DomainResource { - - public enum OrderStatus { - /** - * The order is known, but no processing has occurred at this time. - */ - PENDING, - /** - * The order is undergoing initial processing to determine whether it will be accepted (usually this involves human review). - */ - REVIEW, - /** - * The order was rejected because of a workflow/business logic reason. - */ - REJECTED, - /** - * The order was unable to be processed because of a technical error (i.e. unexpected error). - */ - ERROR, - /** - * The order has been accepted, and work is in progress. - */ - ACCEPTED, - /** - * Processing the order was halted at the initiators request. - */ - CANCELLED, - /** - * The order has been cancelled and replaced by another. - */ - REPLACED, - /** - * Processing the order was stopped because of some workflow/business logic reason. - */ - ABORTED, - /** - * The order has been completed. - */ - COMPLETED, - /** - * added to help the parsers - */ - NULL; - public static OrderStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("pending".equals(codeString)) - return PENDING; - if ("review".equals(codeString)) - return REVIEW; - if ("rejected".equals(codeString)) - return REJECTED; - if ("error".equals(codeString)) - return ERROR; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("cancelled".equals(codeString)) - return CANCELLED; - if ("replaced".equals(codeString)) - return REPLACED; - if ("aborted".equals(codeString)) - return ABORTED; - if ("completed".equals(codeString)) - return COMPLETED; - throw new Exception("Unknown OrderStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PENDING: return "pending"; - case REVIEW: return "review"; - case REJECTED: return "rejected"; - case ERROR: return "error"; - case ACCEPTED: return "accepted"; - case CANCELLED: return "cancelled"; - case REPLACED: return "replaced"; - case ABORTED: return "aborted"; - case COMPLETED: return "completed"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PENDING: return ""; - case REVIEW: return ""; - case REJECTED: return ""; - case ERROR: return ""; - case ACCEPTED: return ""; - case CANCELLED: return ""; - case REPLACED: return ""; - case ABORTED: return ""; - case COMPLETED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PENDING: return "The order is known, but no processing has occurred at this time."; - case REVIEW: return "The order is undergoing initial processing to determine whether it will be accepted (usually this involves human review)."; - case REJECTED: return "The order was rejected because of a workflow/business logic reason."; - case ERROR: return "The order was unable to be processed because of a technical error (i.e. unexpected error)."; - case ACCEPTED: return "The order has been accepted, and work is in progress."; - case CANCELLED: return "Processing the order was halted at the initiators request."; - case REPLACED: return "The order has been cancelled and replaced by another."; - case ABORTED: return "Processing the order was stopped because of some workflow/business logic reason."; - case COMPLETED: return "The order has been completed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PENDING: return "Pending"; - case REVIEW: return "Review"; - case REJECTED: return "Rejected"; - case ERROR: return "Error"; - case ACCEPTED: return "Accepted"; - case CANCELLED: return "Cancelled"; - case REPLACED: return "Replaced"; - case ABORTED: return "Aborted"; - case COMPLETED: return "Completed"; - default: return "?"; - } - } - } - - public static class OrderStatusEnumFactory implements EnumFactory { - public OrderStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("pending".equals(codeString)) - return OrderStatus.PENDING; - if ("review".equals(codeString)) - return OrderStatus.REVIEW; - if ("rejected".equals(codeString)) - return OrderStatus.REJECTED; - if ("error".equals(codeString)) - return OrderStatus.ERROR; - if ("accepted".equals(codeString)) - return OrderStatus.ACCEPTED; - if ("cancelled".equals(codeString)) - return OrderStatus.CANCELLED; - if ("replaced".equals(codeString)) - return OrderStatus.REPLACED; - if ("aborted".equals(codeString)) - return OrderStatus.ABORTED; - if ("completed".equals(codeString)) - return OrderStatus.COMPLETED; - throw new IllegalArgumentException("Unknown OrderStatus code '"+codeString+"'"); - } - public String toCode(OrderStatus code) { - if (code == OrderStatus.PENDING) - return "pending"; - if (code == OrderStatus.REVIEW) - return "review"; - if (code == OrderStatus.REJECTED) - return "rejected"; - if (code == OrderStatus.ERROR) - return "error"; - if (code == OrderStatus.ACCEPTED) - return "accepted"; - if (code == OrderStatus.CANCELLED) - return "cancelled"; - if (code == OrderStatus.REPLACED) - return "replaced"; - if (code == OrderStatus.ABORTED) - return "aborted"; - if (code == OrderStatus.COMPLETED) - return "completed"; - return "?"; - } - } - - /** - * Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Identifiers assigned to this order by the orderer or by the receiver", formalDefinition="Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems." ) - protected List identifier; - - /** - * A reference to the order that this is in response to. - */ - @Child(name = "request", type = {Order.class}, order=1, min=1, max=1) - @Description(shortDefinition="The order that this is a response to", formalDefinition="A reference to the order that this is in response to." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (A reference to the order that this is in response to.) - */ - protected Order requestTarget; - - /** - * The date and time at which this order response was made (created/posted). - */ - @Child(name = "date", type = {DateTimeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="When the response was made", formalDefinition="The date and time at which this order response was made (created/posted)." ) - protected DateTimeType date; - - /** - * The person, organization, or device credited with making the response. - */ - @Child(name = "who", type = {Practitioner.class, Organization.class, Device.class}, order=3, min=0, max=1) - @Description(shortDefinition="Who made the response", formalDefinition="The person, organization, or device credited with making the response." ) - protected Reference who; - - /** - * The actual object that is the target of the reference (The person, organization, or device credited with making the response.) - */ - protected Resource whoTarget; - - /** - * A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection. - */ - @Child(name = "authority", type = {CodeableConcept.class}, order=4, min=0, max=1) - @Description(shortDefinition="If required by policy", formalDefinition="A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection." ) - protected Type authority; - - /** - * What this response says about the status of the original order. - */ - @Child(name = "orderStatus", type = {CodeType.class}, order=5, min=1, max=1) - @Description(shortDefinition="pending | review | rejected | error | accepted | cancelled | replaced | aborted | completed", formalDefinition="What this response says about the status of the original order." ) - protected Enumeration orderStatus; - - /** - * Additional description about the response - e.g. a text description provided by a human user when making decisions about the order. - */ - @Child(name = "description", type = {StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Additional description of the response", formalDefinition="Additional description about the response - e.g. a text description provided by a human user when making decisions about the order." ) - protected StringType description; - - /** - * Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order. - */ - @Child(name = "fulfillment", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Details of the outcome of performing the order", formalDefinition="Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order." ) - protected List fulfillment; - /** - * The actual objects that are the target of the reference (Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.) - */ - protected List fulfillmentTarget; - - - private static final long serialVersionUID = -1983664888L; - - /* - * Constructor - */ - public OrderResponse() { - super(); - } - - /* - * Constructor - */ - public OrderResponse(Reference request, Enumeration orderStatus) { - super(); - this.request = request; - this.orderStatus = orderStatus; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public OrderResponse addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #request} (A reference to the order that this is in response to.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderResponse.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); // cc - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (A reference to the order that this is in response to.) - */ - public OrderResponse setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the order that this is in response to.) - */ - public Order getRequestTarget() { - if (this.requestTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderResponse.request"); - else if (Configuration.doAutoCreate()) - this.requestTarget = new Order(); // aa - return this.requestTarget; - } - - /** - * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the order that this is in response to.) - */ - public OrderResponse setRequestTarget(Order value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #date} (The date and time at which this order response was made (created/posted).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderResponse.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date and time at which this order response was made (created/posted).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public OrderResponse setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date and time at which this order response was made (created/posted). - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date and time at which this order response was made (created/posted). - */ - public OrderResponse setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #who} (The person, organization, or device credited with making the response.) - */ - public Reference getWho() { - if (this.who == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderResponse.who"); - else if (Configuration.doAutoCreate()) - this.who = new Reference(); // cc - return this.who; - } - - public boolean hasWho() { - return this.who != null && !this.who.isEmpty(); - } - - /** - * @param value {@link #who} (The person, organization, or device credited with making the response.) - */ - public OrderResponse setWho(Reference value) { - this.who = value; - return this; - } - - /** - * @return {@link #who} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person, organization, or device credited with making the response.) - */ - public Resource getWhoTarget() { - return this.whoTarget; - } - - /** - * @param value {@link #who} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person, organization, or device credited with making the response.) - */ - public OrderResponse setWhoTarget(Resource value) { - this.whoTarget = value; - return this; - } - - /** - * @return {@link #authority} (A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection.) - */ - public Type getAuthority() { - return this.authority; - } - - /** - * @return {@link #authority} (A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection.) - */ - public CodeableConcept getAuthorityCodeableConcept() throws Exception { - if (!(this.authority instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.authority.getClass().getName()+" was encountered"); - return (CodeableConcept) this.authority; - } - - /** - * @return {@link #authority} (A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection.) - */ - public Reference getAuthorityReference() throws Exception { - if (!(this.authority instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.authority.getClass().getName()+" was encountered"); - return (Reference) this.authority; - } - - public boolean hasAuthority() { - return this.authority != null && !this.authority.isEmpty(); - } - - /** - * @param value {@link #authority} (A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection.) - */ - public OrderResponse setAuthority(Type value) { - this.authority = value; - return this; - } - - /** - * @return {@link #orderStatus} (What this response says about the status of the original order.). This is the underlying object with id, value and extensions. The accessor "getOrderStatus" gives direct access to the value - */ - public Enumeration getOrderStatusElement() { - if (this.orderStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderResponse.orderStatus"); - else if (Configuration.doAutoCreate()) - this.orderStatus = new Enumeration(new OrderStatusEnumFactory()); // bb - return this.orderStatus; - } - - public boolean hasOrderStatusElement() { - return this.orderStatus != null && !this.orderStatus.isEmpty(); - } - - public boolean hasOrderStatus() { - return this.orderStatus != null && !this.orderStatus.isEmpty(); - } - - /** - * @param value {@link #orderStatus} (What this response says about the status of the original order.). This is the underlying object with id, value and extensions. The accessor "getOrderStatus" gives direct access to the value - */ - public OrderResponse setOrderStatusElement(Enumeration value) { - this.orderStatus = value; - return this; - } - - /** - * @return What this response says about the status of the original order. - */ - public OrderStatus getOrderStatus() { - return this.orderStatus == null ? null : this.orderStatus.getValue(); - } - - /** - * @param value What this response says about the status of the original order. - */ - public OrderResponse setOrderStatus(OrderStatus value) { - if (this.orderStatus == null) - this.orderStatus = new Enumeration(new OrderStatusEnumFactory()); - this.orderStatus.setValue(value); - return this; - } - - /** - * @return {@link #description} (Additional description about the response - e.g. a text description provided by a human user when making decisions about the order.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderResponse.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Additional description about the response - e.g. a text description provided by a human user when making decisions about the order.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public OrderResponse setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Additional description about the response - e.g. a text description provided by a human user when making decisions about the order. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Additional description about the response - e.g. a text description provided by a human user when making decisions about the order. - */ - public OrderResponse setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #fulfillment} (Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.) - */ - public List getFulfillment() { - if (this.fulfillment == null) - this.fulfillment = new ArrayList(); - return this.fulfillment; - } - - public boolean hasFulfillment() { - if (this.fulfillment == null) - return false; - for (Reference item : this.fulfillment) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #fulfillment} (Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.) - */ - // syntactic sugar - public Reference addFulfillment() { //3 - Reference t = new Reference(); - if (this.fulfillment == null) - this.fulfillment = new ArrayList(); - this.fulfillment.add(t); - return t; - } - - // syntactic sugar - public OrderResponse addFulfillment(Reference t) { //3 - if (t == null) - return this; - if (this.fulfillment == null) - this.fulfillment = new ArrayList(); - this.fulfillment.add(t); - return this; - } - - /** - * @return {@link #fulfillment} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.) - */ - public List getFulfillmentTarget() { - if (this.fulfillmentTarget == null) - this.fulfillmentTarget = new ArrayList(); - return this.fulfillmentTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("request", "Reference(Order)", "A reference to the order that this is in response to.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("date", "dateTime", "The date and time at which this order response was made (created/posted).", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("who", "Reference(Practitioner|Organization|Device)", "The person, organization, or device credited with making the response.", 0, java.lang.Integer.MAX_VALUE, who)); - childrenList.add(new Property("authority[x]", "CodeableConcept|Reference(Any)", "A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection.", 0, java.lang.Integer.MAX_VALUE, authority)); - childrenList.add(new Property("orderStatus", "code", "What this response says about the status of the original order.", 0, java.lang.Integer.MAX_VALUE, orderStatus)); - childrenList.add(new Property("description", "string", "Additional description about the response - e.g. a text description provided by a human user when making decisions about the order.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("fulfillment", "Reference(Any)", "Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.", 0, java.lang.Integer.MAX_VALUE, fulfillment)); - } - - public OrderResponse copy() { - OrderResponse dst = new OrderResponse(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.request = request == null ? null : request.copy(); - dst.date = date == null ? null : date.copy(); - dst.who = who == null ? null : who.copy(); - dst.authority = authority == null ? null : authority.copy(); - dst.orderStatus = orderStatus == null ? null : orderStatus.copy(); - dst.description = description == null ? null : description.copy(); - if (fulfillment != null) { - dst.fulfillment = new ArrayList(); - for (Reference i : fulfillment) - dst.fulfillment.add(i.copy()); - }; - return dst; - } - - protected OrderResponse typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OrderResponse)) - return false; - OrderResponse o = (OrderResponse) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(date, o.date, true) - && compareDeep(who, o.who, true) && compareDeep(authority, o.authority, true) && compareDeep(orderStatus, o.orderStatus, true) - && compareDeep(description, o.description, true) && compareDeep(fulfillment, o.fulfillment, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OrderResponse)) - return false; - OrderResponse o = (OrderResponse) other; - return compareValues(date, o.date, true) && compareValues(orderStatus, o.orderStatus, true) && compareValues(description, o.description, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) - && (date == null || date.isEmpty()) && (who == null || who.isEmpty()) && (authority == null || authority.isEmpty()) - && (orderStatus == null || orderStatus.isEmpty()) && (description == null || description.isEmpty()) - && (fulfillment == null || fulfillment.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.OrderResponse; - } - - @SearchParamDefinition(name="patient", path="", description="The patient the reuqest order is related to", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="fulfillment", path="OrderResponse.fulfillment", description="Details of the outcome of performing the order", type="reference" ) - public static final String SP_FULFILLMENT = "fulfillment"; - @SearchParamDefinition(name="request", path="OrderResponse.request", description="The order that this is a response to", type="reference" ) - public static final String SP_REQUEST = "request"; - @SearchParamDefinition(name="code", path="OrderResponse.orderStatus", description="pending | review | rejected | error | accepted | cancelled | replaced | aborted | completed", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="date", path="OrderResponse.date", description="When the response was made", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="who", path="OrderResponse.who", description="Who made the response", type="reference" ) - public static final String SP_WHO = "who"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A response to an order. + */ +@ResourceDef(name="OrderResponse", profile="http://hl7.org/fhir/Profile/OrderResponse") +public class OrderResponse extends DomainResource { + + public enum OrderStatus { + /** + * The order is known, but no processing has occurred at this time. + */ + PENDING, + /** + * The order is undergoing initial processing to determine whether it will be accepted (usually this involves human review). + */ + REVIEW, + /** + * The order was rejected because of a workflow/business logic reason. + */ + REJECTED, + /** + * The order was unable to be processed because of a technical error (i.e. unexpected error). + */ + ERROR, + /** + * The order has been accepted, and work is in progress. + */ + ACCEPTED, + /** + * Processing the order was halted at the initiators request. + */ + CANCELLED, + /** + * The order has been cancelled and replaced by another. + */ + REPLACED, + /** + * Processing the order was stopped because of some workflow/business logic reason. + */ + ABORTED, + /** + * The order has been completed. + */ + COMPLETED, + /** + * added to help the parsers + */ + NULL; + public static OrderStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("pending".equals(codeString)) + return PENDING; + if ("review".equals(codeString)) + return REVIEW; + if ("rejected".equals(codeString)) + return REJECTED; + if ("error".equals(codeString)) + return ERROR; + if ("accepted".equals(codeString)) + return ACCEPTED; + if ("cancelled".equals(codeString)) + return CANCELLED; + if ("replaced".equals(codeString)) + return REPLACED; + if ("aborted".equals(codeString)) + return ABORTED; + if ("completed".equals(codeString)) + return COMPLETED; + throw new Exception("Unknown OrderStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PENDING: return "pending"; + case REVIEW: return "review"; + case REJECTED: return "rejected"; + case ERROR: return "error"; + case ACCEPTED: return "accepted"; + case CANCELLED: return "cancelled"; + case REPLACED: return "replaced"; + case ABORTED: return "aborted"; + case COMPLETED: return "completed"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PENDING: return ""; + case REVIEW: return ""; + case REJECTED: return ""; + case ERROR: return ""; + case ACCEPTED: return ""; + case CANCELLED: return ""; + case REPLACED: return ""; + case ABORTED: return ""; + case COMPLETED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PENDING: return "The order is known, but no processing has occurred at this time."; + case REVIEW: return "The order is undergoing initial processing to determine whether it will be accepted (usually this involves human review)."; + case REJECTED: return "The order was rejected because of a workflow/business logic reason."; + case ERROR: return "The order was unable to be processed because of a technical error (i.e. unexpected error)."; + case ACCEPTED: return "The order has been accepted, and work is in progress."; + case CANCELLED: return "Processing the order was halted at the initiators request."; + case REPLACED: return "The order has been cancelled and replaced by another."; + case ABORTED: return "Processing the order was stopped because of some workflow/business logic reason."; + case COMPLETED: return "The order has been completed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PENDING: return "Pending"; + case REVIEW: return "Review"; + case REJECTED: return "Rejected"; + case ERROR: return "Error"; + case ACCEPTED: return "Accepted"; + case CANCELLED: return "Cancelled"; + case REPLACED: return "Replaced"; + case ABORTED: return "Aborted"; + case COMPLETED: return "Completed"; + default: return "?"; + } + } + } + + public static class OrderStatusEnumFactory implements EnumFactory { + public OrderStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("pending".equals(codeString)) + return OrderStatus.PENDING; + if ("review".equals(codeString)) + return OrderStatus.REVIEW; + if ("rejected".equals(codeString)) + return OrderStatus.REJECTED; + if ("error".equals(codeString)) + return OrderStatus.ERROR; + if ("accepted".equals(codeString)) + return OrderStatus.ACCEPTED; + if ("cancelled".equals(codeString)) + return OrderStatus.CANCELLED; + if ("replaced".equals(codeString)) + return OrderStatus.REPLACED; + if ("aborted".equals(codeString)) + return OrderStatus.ABORTED; + if ("completed".equals(codeString)) + return OrderStatus.COMPLETED; + throw new IllegalArgumentException("Unknown OrderStatus code '"+codeString+"'"); + } + public String toCode(OrderStatus code) { + if (code == OrderStatus.PENDING) + return "pending"; + if (code == OrderStatus.REVIEW) + return "review"; + if (code == OrderStatus.REJECTED) + return "rejected"; + if (code == OrderStatus.ERROR) + return "error"; + if (code == OrderStatus.ACCEPTED) + return "accepted"; + if (code == OrderStatus.CANCELLED) + return "cancelled"; + if (code == OrderStatus.REPLACED) + return "replaced"; + if (code == OrderStatus.ABORTED) + return "aborted"; + if (code == OrderStatus.COMPLETED) + return "completed"; + return "?"; + } + } + + /** + * Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Identifiers assigned to this order by the orderer or by the receiver", formalDefinition="Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems." ) + protected List identifier; + + /** + * A reference to the order that this is in response to. + */ + @Child(name = "request", type = {Order.class}, order=1, min=1, max=1) + @Description(shortDefinition="The order that this is a response to", formalDefinition="A reference to the order that this is in response to." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (A reference to the order that this is in response to.) + */ + protected Order requestTarget; + + /** + * The date and time at which this order response was made (created/posted). + */ + @Child(name = "date", type = {DateTimeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="When the response was made", formalDefinition="The date and time at which this order response was made (created/posted)." ) + protected DateTimeType date; + + /** + * The person, organization, or device credited with making the response. + */ + @Child(name = "who", type = {Practitioner.class, Organization.class, Device.class}, order=3, min=0, max=1) + @Description(shortDefinition="Who made the response", formalDefinition="The person, organization, or device credited with making the response." ) + protected Reference who; + + /** + * The actual object that is the target of the reference (The person, organization, or device credited with making the response.) + */ + protected Resource whoTarget; + + /** + * A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection. + */ + @Child(name = "authority", type = {CodeableConcept.class}, order=4, min=0, max=1) + @Description(shortDefinition="If required by policy", formalDefinition="A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection." ) + protected Type authority; + + /** + * What this response says about the status of the original order. + */ + @Child(name = "orderStatus", type = {CodeType.class}, order=5, min=1, max=1) + @Description(shortDefinition="pending | review | rejected | error | accepted | cancelled | replaced | aborted | completed", formalDefinition="What this response says about the status of the original order." ) + protected Enumeration orderStatus; + + /** + * Additional description about the response - e.g. a text description provided by a human user when making decisions about the order. + */ + @Child(name = "description", type = {StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Additional description of the response", formalDefinition="Additional description about the response - e.g. a text description provided by a human user when making decisions about the order." ) + protected StringType description; + + /** + * Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order. + */ + @Child(name = "fulfillment", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Details of the outcome of performing the order", formalDefinition="Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order." ) + protected List fulfillment; + /** + * The actual objects that are the target of the reference (Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.) + */ + protected List fulfillmentTarget; + + + private static final long serialVersionUID = -1983664888L; + + /* + * Constructor + */ + public OrderResponse() { + super(); + } + + /* + * Constructor + */ + public OrderResponse(Reference request, Enumeration orderStatus) { + super(); + this.request = request; + this.orderStatus = orderStatus; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public OrderResponse addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #request} (A reference to the order that this is in response to.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderResponse.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); // cc + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (A reference to the order that this is in response to.) + */ + public OrderResponse setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the order that this is in response to.) + */ + public Order getRequestTarget() { + if (this.requestTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderResponse.request"); + else if (Configuration.doAutoCreate()) + this.requestTarget = new Order(); // aa + return this.requestTarget; + } + + /** + * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the order that this is in response to.) + */ + public OrderResponse setRequestTarget(Order value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #date} (The date and time at which this order response was made (created/posted).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderResponse.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date and time at which this order response was made (created/posted).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public OrderResponse setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date and time at which this order response was made (created/posted). + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date and time at which this order response was made (created/posted). + */ + public OrderResponse setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #who} (The person, organization, or device credited with making the response.) + */ + public Reference getWho() { + if (this.who == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderResponse.who"); + else if (Configuration.doAutoCreate()) + this.who = new Reference(); // cc + return this.who; + } + + public boolean hasWho() { + return this.who != null && !this.who.isEmpty(); + } + + /** + * @param value {@link #who} (The person, organization, or device credited with making the response.) + */ + public OrderResponse setWho(Reference value) { + this.who = value; + return this; + } + + /** + * @return {@link #who} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person, organization, or device credited with making the response.) + */ + public Resource getWhoTarget() { + return this.whoTarget; + } + + /** + * @param value {@link #who} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person, organization, or device credited with making the response.) + */ + public OrderResponse setWhoTarget(Resource value) { + this.whoTarget = value; + return this; + } + + /** + * @return {@link #authority} (A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection.) + */ + public Type getAuthority() { + return this.authority; + } + + /** + * @return {@link #authority} (A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection.) + */ + public CodeableConcept getAuthorityCodeableConcept() throws Exception { + if (!(this.authority instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.authority.getClass().getName()+" was encountered"); + return (CodeableConcept) this.authority; + } + + /** + * @return {@link #authority} (A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection.) + */ + public Reference getAuthorityReference() throws Exception { + if (!(this.authority instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.authority.getClass().getName()+" was encountered"); + return (Reference) this.authority; + } + + public boolean hasAuthority() { + return this.authority != null && !this.authority.isEmpty(); + } + + /** + * @param value {@link #authority} (A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection.) + */ + public OrderResponse setAuthority(Type value) { + this.authority = value; + return this; + } + + /** + * @return {@link #orderStatus} (What this response says about the status of the original order.). This is the underlying object with id, value and extensions. The accessor "getOrderStatus" gives direct access to the value + */ + public Enumeration getOrderStatusElement() { + if (this.orderStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderResponse.orderStatus"); + else if (Configuration.doAutoCreate()) + this.orderStatus = new Enumeration(new OrderStatusEnumFactory()); // bb + return this.orderStatus; + } + + public boolean hasOrderStatusElement() { + return this.orderStatus != null && !this.orderStatus.isEmpty(); + } + + public boolean hasOrderStatus() { + return this.orderStatus != null && !this.orderStatus.isEmpty(); + } + + /** + * @param value {@link #orderStatus} (What this response says about the status of the original order.). This is the underlying object with id, value and extensions. The accessor "getOrderStatus" gives direct access to the value + */ + public OrderResponse setOrderStatusElement(Enumeration value) { + this.orderStatus = value; + return this; + } + + /** + * @return What this response says about the status of the original order. + */ + public OrderStatus getOrderStatus() { + return this.orderStatus == null ? null : this.orderStatus.getValue(); + } + + /** + * @param value What this response says about the status of the original order. + */ + public OrderResponse setOrderStatus(OrderStatus value) { + if (this.orderStatus == null) + this.orderStatus = new Enumeration(new OrderStatusEnumFactory()); + this.orderStatus.setValue(value); + return this; + } + + /** + * @return {@link #description} (Additional description about the response - e.g. a text description provided by a human user when making decisions about the order.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderResponse.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Additional description about the response - e.g. a text description provided by a human user when making decisions about the order.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public OrderResponse setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Additional description about the response - e.g. a text description provided by a human user when making decisions about the order. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Additional description about the response - e.g. a text description provided by a human user when making decisions about the order. + */ + public OrderResponse setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #fulfillment} (Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.) + */ + public List getFulfillment() { + if (this.fulfillment == null) + this.fulfillment = new ArrayList(); + return this.fulfillment; + } + + public boolean hasFulfillment() { + if (this.fulfillment == null) + return false; + for (Reference item : this.fulfillment) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #fulfillment} (Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.) + */ + // syntactic sugar + public Reference addFulfillment() { //3 + Reference t = new Reference(); + if (this.fulfillment == null) + this.fulfillment = new ArrayList(); + this.fulfillment.add(t); + return t; + } + + // syntactic sugar + public OrderResponse addFulfillment(Reference t) { //3 + if (t == null) + return this; + if (this.fulfillment == null) + this.fulfillment = new ArrayList(); + this.fulfillment.add(t); + return this; + } + + /** + * @return {@link #fulfillment} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.) + */ + public List getFulfillmentTarget() { + if (this.fulfillmentTarget == null) + this.fulfillmentTarget = new ArrayList(); + return this.fulfillmentTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("request", "Reference(Order)", "A reference to the order that this is in response to.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("date", "dateTime", "The date and time at which this order response was made (created/posted).", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("who", "Reference(Practitioner|Organization|Device)", "The person, organization, or device credited with making the response.", 0, java.lang.Integer.MAX_VALUE, who)); + childrenList.add(new Property("authority[x]", "CodeableConcept|Reference(Any)", "A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection.", 0, java.lang.Integer.MAX_VALUE, authority)); + childrenList.add(new Property("orderStatus", "code", "What this response says about the status of the original order.", 0, java.lang.Integer.MAX_VALUE, orderStatus)); + childrenList.add(new Property("description", "string", "Additional description about the response - e.g. a text description provided by a human user when making decisions about the order.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("fulfillment", "Reference(Any)", "Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.", 0, java.lang.Integer.MAX_VALUE, fulfillment)); + } + + public OrderResponse copy() { + OrderResponse dst = new OrderResponse(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.request = request == null ? null : request.copy(); + dst.date = date == null ? null : date.copy(); + dst.who = who == null ? null : who.copy(); + dst.authority = authority == null ? null : authority.copy(); + dst.orderStatus = orderStatus == null ? null : orderStatus.copy(); + dst.description = description == null ? null : description.copy(); + if (fulfillment != null) { + dst.fulfillment = new ArrayList(); + for (Reference i : fulfillment) + dst.fulfillment.add(i.copy()); + }; + return dst; + } + + protected OrderResponse typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OrderResponse)) + return false; + OrderResponse o = (OrderResponse) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(date, o.date, true) + && compareDeep(who, o.who, true) && compareDeep(authority, o.authority, true) && compareDeep(orderStatus, o.orderStatus, true) + && compareDeep(description, o.description, true) && compareDeep(fulfillment, o.fulfillment, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OrderResponse)) + return false; + OrderResponse o = (OrderResponse) other; + return compareValues(date, o.date, true) && compareValues(orderStatus, o.orderStatus, true) && compareValues(description, o.description, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) + && (date == null || date.isEmpty()) && (who == null || who.isEmpty()) && (authority == null || authority.isEmpty()) + && (orderStatus == null || orderStatus.isEmpty()) && (description == null || description.isEmpty()) + && (fulfillment == null || fulfillment.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.OrderResponse; + } + + @SearchParamDefinition(name="date", path="OrderResponse.date", description="When the response was made", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="request", path="OrderResponse.request", description="The order that this is a response to", type="reference" ) + public static final String SP_REQUEST = "request"; + @SearchParamDefinition(name="code", path="OrderResponse.orderStatus", description="pending | review | rejected | error | accepted | cancelled | replaced | aborted | completed", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="patient", path="", description="The patient the reuqest order is related to", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="fulfillment", path="OrderResponse.fulfillment", description="Details of the outcome of performing the order", type="reference" ) + public static final String SP_FULFILLMENT = "fulfillment"; + @SearchParamDefinition(name="who", path="OrderResponse.who", description="Who made the response", type="reference" ) + public static final String SP_WHO = "who"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Organization.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Organization.java index 53ca188cf28..9ea89c2de59 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Organization.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Organization.java @@ -1,759 +1,738 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc. - */ -@ResourceDef(name="Organization", profile="http://hl7.org/fhir/Profile/Organization") -public class Organization extends DomainResource { - - @Block() - public static class OrganizationContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Indicates a purpose for which the contact can be reached. - */ - @Child(name = "purpose", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="The type of contact", formalDefinition="Indicates a purpose for which the contact can be reached." ) - protected CodeableConcept purpose; - - /** - * A name associated with the contact. - */ - @Child(name = "name", type = {HumanName.class}, order=2, min=0, max=1) - @Description(shortDefinition="A name associated with the contact", formalDefinition="A name associated with the contact." ) - protected HumanName name; - - /** - * A contact detail (e.g. a telephone number or an email address) by which the party may be contacted. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details (telephone, email, etc) for a contact", formalDefinition="A contact detail (e.g. a telephone number or an email address) by which the party may be contacted." ) - protected List telecom; - - /** - * Visiting or postal addresses for the contact. - */ - @Child(name = "address", type = {Address.class}, order=4, min=0, max=1) - @Description(shortDefinition="Visiting or postal addresses for the contact", formalDefinition="Visiting or postal addresses for the contact." ) - protected Address address; - - private static final long serialVersionUID = 1831121305L; - - /* - * Constructor - */ - public OrganizationContactComponent() { - super(); - } - - /** - * @return {@link #purpose} (Indicates a purpose for which the contact can be reached.) - */ - public CodeableConcept getPurpose() { - if (this.purpose == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrganizationContactComponent.purpose"); - else if (Configuration.doAutoCreate()) - this.purpose = new CodeableConcept(); // cc - return this.purpose; - } - - public boolean hasPurpose() { - return this.purpose != null && !this.purpose.isEmpty(); - } - - /** - * @param value {@link #purpose} (Indicates a purpose for which the contact can be reached.) - */ - public OrganizationContactComponent setPurpose(CodeableConcept value) { - this.purpose = value; - return this; - } - - /** - * @return {@link #name} (A name associated with the contact.) - */ - public HumanName getName() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrganizationContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new HumanName(); // cc - return this.name; - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A name associated with the contact.) - */ - public OrganizationContactComponent setName(HumanName value) { - this.name = value; - return this; - } - - /** - * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public OrganizationContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #address} (Visiting or postal addresses for the contact.) - */ - public Address getAddress() { - if (this.address == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrganizationContactComponent.address"); - else if (Configuration.doAutoCreate()) - this.address = new Address(); // cc - return this.address; - } - - public boolean hasAddress() { - return this.address != null && !this.address.isEmpty(); - } - - /** - * @param value {@link #address} (Visiting or postal addresses for the contact.) - */ - public OrganizationContactComponent setAddress(Address value) { - this.address = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("purpose", "CodeableConcept", "Indicates a purpose for which the contact can be reached.", 0, java.lang.Integer.MAX_VALUE, purpose)); - childrenList.add(new Property("name", "HumanName", "A name associated with the contact.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("address", "Address", "Visiting or postal addresses for the contact.", 0, java.lang.Integer.MAX_VALUE, address)); - } - - public OrganizationContactComponent copy() { - OrganizationContactComponent dst = new OrganizationContactComponent(); - copyValues(dst); - dst.purpose = purpose == null ? null : purpose.copy(); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.address = address == null ? null : address.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OrganizationContactComponent)) - return false; - OrganizationContactComponent o = (OrganizationContactComponent) other; - return compareDeep(purpose, o.purpose, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) - && compareDeep(address, o.address, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OrganizationContactComponent)) - return false; - OrganizationContactComponent o = (OrganizationContactComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (purpose == null || purpose.isEmpty()) && (name == null || name.isEmpty()) - && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()); - } - - } - - /** - * Identifier for the organization that is used to identify the organization across multiple disparate systems. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Identifies this organization across multiple systems", formalDefinition="Identifier for the organization that is used to identify the organization across multiple disparate systems." ) - protected List identifier; - - /** - * A name associated with the organization. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Name used for the organization", formalDefinition="A name associated with the organization." ) - protected StringType name; - - /** - * The kind of organization that this is. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Kind of organization", formalDefinition="The kind of organization that this is." ) - protected CodeableConcept type; - - /** - * A contact detail for the organization. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A contact detail for the organization", formalDefinition="A contact detail for the organization." ) - protected List telecom; - - /** - * An address for the organization. - */ - @Child(name = "address", type = {Address.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="An address for the organization", formalDefinition="An address for the organization." ) - protected List
address; - - /** - * The organization of which this organization forms a part. - */ - @Child(name = "partOf", type = {Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="The organization of which this organization forms a part", formalDefinition="The organization of which this organization forms a part." ) - protected Reference partOf; - - /** - * The actual object that is the target of the reference (The organization of which this organization forms a part.) - */ - protected Organization partOfTarget; - - /** - * Contact for the organization for a certain purpose. - */ - @Child(name = "contact", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact for the organization for a certain purpose", formalDefinition="Contact for the organization for a certain purpose." ) - protected List contact; - - /** - * Whether the organization's record is still in active use. - */ - @Child(name = "active", type = {BooleanType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Whether the organization's record is still in active use", formalDefinition="Whether the organization's record is still in active use." ) - protected BooleanType active; - - private static final long serialVersionUID = 1766834739L; - - /* - * Constructor - */ - public Organization() { - super(); - } - - /** - * @return {@link #identifier} (Identifier for the organization that is used to identify the organization across multiple disparate systems.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifier for the organization that is used to identify the organization across multiple disparate systems.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Organization addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #name} (A name associated with the organization.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Organization.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A name associated with the organization.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public Organization setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A name associated with the organization. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A name associated with the organization. - */ - public Organization setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The kind of organization that this is.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Organization.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The kind of organization that this is.) - */ - public Organization setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #telecom} (A contact detail for the organization.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (A contact detail for the organization.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public Organization addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #address} (An address for the organization.) - */ - public List
getAddress() { - if (this.address == null) - this.address = new ArrayList
(); - return this.address; - } - - public boolean hasAddress() { - if (this.address == null) - return false; - for (Address item : this.address) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #address} (An address for the organization.) - */ - // syntactic sugar - public Address addAddress() { //3 - Address t = new Address(); - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return t; - } - - // syntactic sugar - public Organization addAddress(Address t) { //3 - if (t == null) - return this; - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return this; - } - - /** - * @return {@link #partOf} (The organization of which this organization forms a part.) - */ - public Reference getPartOf() { - if (this.partOf == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Organization.partOf"); - else if (Configuration.doAutoCreate()) - this.partOf = new Reference(); // cc - return this.partOf; - } - - public boolean hasPartOf() { - return this.partOf != null && !this.partOf.isEmpty(); - } - - /** - * @param value {@link #partOf} (The organization of which this organization forms a part.) - */ - public Organization setPartOf(Reference value) { - this.partOf = value; - return this; - } - - /** - * @return {@link #partOf} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization of which this organization forms a part.) - */ - public Organization getPartOfTarget() { - if (this.partOfTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Organization.partOf"); - else if (Configuration.doAutoCreate()) - this.partOfTarget = new Organization(); // aa - return this.partOfTarget; - } - - /** - * @param value {@link #partOf} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization of which this organization forms a part.) - */ - public Organization setPartOfTarget(Organization value) { - this.partOfTarget = value; - return this; - } - - /** - * @return {@link #contact} (Contact for the organization for a certain purpose.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (OrganizationContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contact for the organization for a certain purpose.) - */ - // syntactic sugar - public OrganizationContactComponent addContact() { //3 - OrganizationContactComponent t = new OrganizationContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public Organization addContact(OrganizationContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #active} (Whether the organization's record is still in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public BooleanType getActiveElement() { - if (this.active == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Organization.active"); - else if (Configuration.doAutoCreate()) - this.active = new BooleanType(); // bb - return this.active; - } - - public boolean hasActiveElement() { - return this.active != null && !this.active.isEmpty(); - } - - public boolean hasActive() { - return this.active != null && !this.active.isEmpty(); - } - - /** - * @param value {@link #active} (Whether the organization's record is still in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public Organization setActiveElement(BooleanType value) { - this.active = value; - return this; - } - - /** - * @return Whether the organization's record is still in active use. - */ - public boolean getActive() { - return this.active == null || this.active.isEmpty() ? false : this.active.getValue(); - } - - /** - * @param value Whether the organization's record is still in active use. - */ - public Organization setActive(boolean value) { - if (this.active == null) - this.active = new BooleanType(); - this.active.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier for the organization that is used to identify the organization across multiple disparate systems.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("name", "string", "A name associated with the organization.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("type", "CodeableConcept", "The kind of organization that this is.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the organization.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("address", "Address", "An address for the organization.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("partOf", "Reference(Organization)", "The organization of which this organization forms a part.", 0, java.lang.Integer.MAX_VALUE, partOf)); - childrenList.add(new Property("contact", "", "Contact for the organization for a certain purpose.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("active", "boolean", "Whether the organization's record is still in active use.", 0, java.lang.Integer.MAX_VALUE, active)); - } - - public Organization copy() { - Organization dst = new Organization(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.name = name == null ? null : name.copy(); - dst.type = type == null ? null : type.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - if (address != null) { - dst.address = new ArrayList
(); - for (Address i : address) - dst.address.add(i.copy()); - }; - dst.partOf = partOf == null ? null : partOf.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (OrganizationContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.active = active == null ? null : active.copy(); - return dst; - } - - protected Organization typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Organization)) - return false; - Organization o = (Organization) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(type, o.type, true) - && compareDeep(telecom, o.telecom, true) && compareDeep(address, o.address, true) && compareDeep(partOf, o.partOf, true) - && compareDeep(contact, o.contact, true) && compareDeep(active, o.active, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Organization)) - return false; - Organization o = (Organization) other; - return compareValues(name, o.name, true) && compareValues(active, o.active, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) - && (type == null || type.isEmpty()) && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) - && (partOf == null || partOf.isEmpty()) && (contact == null || contact.isEmpty()) && (active == null || active.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Organization; - } - - @SearchParamDefinition(name="phonetic", path="", description="A portion of the organization's name using some kind of phonetic matching algorithm", type="string" ) - public static final String SP_PHONETIC = "phonetic"; - @SearchParamDefinition(name="partof", path="Organization.partOf", description="Search all organizations that are part of the given organization", type="reference" ) - public static final String SP_PARTOF = "partof"; - @SearchParamDefinition(name="address", path="Organization.address", description="A (part of the) address of the Organization", type="string" ) - public static final String SP_ADDRESS = "address"; - @SearchParamDefinition(name="name", path="Organization.name", description="A portion of the organization's name", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="active", path="Organization.active", description="Whether the organization's record is active", type="token" ) - public static final String SP_ACTIVE = "active"; - @SearchParamDefinition(name="type", path="Organization.type", description="A code for the type of organization", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="identifier", path="Organization.identifier", description="Any identifier for the organization (not the accreditation issuer's identifier)", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc. + */ +@ResourceDef(name="Organization", profile="http://hl7.org/fhir/Profile/Organization") +public class Organization extends DomainResource { + + @Block() + public static class OrganizationContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Indicates a purpose for which the contact can be reached. + */ + @Child(name = "purpose", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="The type of contact", formalDefinition="Indicates a purpose for which the contact can be reached." ) + protected CodeableConcept purpose; + + /** + * A name associated with the contact. + */ + @Child(name = "name", type = {HumanName.class}, order=2, min=0, max=1) + @Description(shortDefinition="A name associated with the contact", formalDefinition="A name associated with the contact." ) + protected HumanName name; + + /** + * A contact detail (e.g. a telephone number or an email address) by which the party may be contacted. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details (telephone, email, etc) for a contact", formalDefinition="A contact detail (e.g. a telephone number or an email address) by which the party may be contacted." ) + protected List telecom; + + /** + * Visiting or postal addresses for the contact. + */ + @Child(name = "address", type = {Address.class}, order=4, min=0, max=1) + @Description(shortDefinition="Visiting or postal addresses for the contact", formalDefinition="Visiting or postal addresses for the contact." ) + protected Address address; + + private static final long serialVersionUID = 1831121305L; + + /* + * Constructor + */ + public OrganizationContactComponent() { + super(); + } + + /** + * @return {@link #purpose} (Indicates a purpose for which the contact can be reached.) + */ + public CodeableConcept getPurpose() { + if (this.purpose == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrganizationContactComponent.purpose"); + else if (Configuration.doAutoCreate()) + this.purpose = new CodeableConcept(); // cc + return this.purpose; + } + + public boolean hasPurpose() { + return this.purpose != null && !this.purpose.isEmpty(); + } + + /** + * @param value {@link #purpose} (Indicates a purpose for which the contact can be reached.) + */ + public OrganizationContactComponent setPurpose(CodeableConcept value) { + this.purpose = value; + return this; + } + + /** + * @return {@link #name} (A name associated with the contact.) + */ + public HumanName getName() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrganizationContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new HumanName(); // cc + return this.name; + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A name associated with the contact.) + */ + public OrganizationContactComponent setName(HumanName value) { + this.name = value; + return this; + } + + /** + * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public OrganizationContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @return {@link #address} (Visiting or postal addresses for the contact.) + */ + public Address getAddress() { + if (this.address == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrganizationContactComponent.address"); + else if (Configuration.doAutoCreate()) + this.address = new Address(); // cc + return this.address; + } + + public boolean hasAddress() { + return this.address != null && !this.address.isEmpty(); + } + + /** + * @param value {@link #address} (Visiting or postal addresses for the contact.) + */ + public OrganizationContactComponent setAddress(Address value) { + this.address = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("purpose", "CodeableConcept", "Indicates a purpose for which the contact can be reached.", 0, java.lang.Integer.MAX_VALUE, purpose)); + childrenList.add(new Property("name", "HumanName", "A name associated with the contact.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("address", "Address", "Visiting or postal addresses for the contact.", 0, java.lang.Integer.MAX_VALUE, address)); + } + + public OrganizationContactComponent copy() { + OrganizationContactComponent dst = new OrganizationContactComponent(); + copyValues(dst); + dst.purpose = purpose == null ? null : purpose.copy(); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.address = address == null ? null : address.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OrganizationContactComponent)) + return false; + OrganizationContactComponent o = (OrganizationContactComponent) other; + return compareDeep(purpose, o.purpose, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) + && compareDeep(address, o.address, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OrganizationContactComponent)) + return false; + OrganizationContactComponent o = (OrganizationContactComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (purpose == null || purpose.isEmpty()) && (name == null || name.isEmpty()) + && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()); + } + + } + + /** + * Identifier for the organization that is used to identify the organization across multiple disparate systems. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Identifies this organization across multiple systems", formalDefinition="Identifier for the organization that is used to identify the organization across multiple disparate systems." ) + protected List identifier; + + /** + * A name associated with the organization. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Name used for the organization", formalDefinition="A name associated with the organization." ) + protected StringType name; + + /** + * The kind of organization that this is. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Kind of organization", formalDefinition="The kind of organization that this is." ) + protected CodeableConcept type; + + /** + * A contact detail for the organization. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A contact detail for the organization", formalDefinition="A contact detail for the organization." ) + protected List telecom; + + /** + * An address for the organization. + */ + @Child(name = "address", type = {Address.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="An address for the organization", formalDefinition="An address for the organization." ) + protected List
address; + + /** + * The organization of which this organization forms a part. + */ + @Child(name = "partOf", type = {Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="The organization of which this organization forms a part", formalDefinition="The organization of which this organization forms a part." ) + protected Reference partOf; + + /** + * The actual object that is the target of the reference (The organization of which this organization forms a part.) + */ + protected Organization partOfTarget; + + /** + * Contact for the organization for a certain purpose. + */ + @Child(name = "contact", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact for the organization for a certain purpose", formalDefinition="Contact for the organization for a certain purpose." ) + protected List contact; + + /** + * Whether the organization's record is still in active use. + */ + @Child(name = "active", type = {BooleanType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Whether the organization's record is still in active use", formalDefinition="Whether the organization's record is still in active use." ) + protected BooleanType active; + + private static final long serialVersionUID = 1766834739L; + + /* + * Constructor + */ + public Organization() { + super(); + } + + /** + * @return {@link #identifier} (Identifier for the organization that is used to identify the organization across multiple disparate systems.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Identifier for the organization that is used to identify the organization across multiple disparate systems.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Organization addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #name} (A name associated with the organization.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Organization.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A name associated with the organization.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public Organization setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A name associated with the organization. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A name associated with the organization. + */ + public Organization setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (The kind of organization that this is.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Organization.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The kind of organization that this is.) + */ + public Organization setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #telecom} (A contact detail for the organization.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (A contact detail for the organization.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public Organization addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @return {@link #address} (An address for the organization.) + */ + public List
getAddress() { + if (this.address == null) + this.address = new ArrayList
(); + return this.address; + } + + public boolean hasAddress() { + if (this.address == null) + return false; + for (Address item : this.address) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #address} (An address for the organization.) + */ + // syntactic sugar + public Address addAddress() { //3 + Address t = new Address(); + if (this.address == null) + this.address = new ArrayList
(); + this.address.add(t); + return t; + } + + // syntactic sugar + public Organization addAddress(Address t) { //3 + if (t == null) + return this; + if (this.address == null) + this.address = new ArrayList
(); + this.address.add(t); + return this; + } + + /** + * @return {@link #partOf} (The organization of which this organization forms a part.) + */ + public Reference getPartOf() { + if (this.partOf == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Organization.partOf"); + else if (Configuration.doAutoCreate()) + this.partOf = new Reference(); // cc + return this.partOf; + } + + public boolean hasPartOf() { + return this.partOf != null && !this.partOf.isEmpty(); + } + + /** + * @param value {@link #partOf} (The organization of which this organization forms a part.) + */ + public Organization setPartOf(Reference value) { + this.partOf = value; + return this; + } + + /** + * @return {@link #partOf} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization of which this organization forms a part.) + */ + public Organization getPartOfTarget() { + if (this.partOfTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Organization.partOf"); + else if (Configuration.doAutoCreate()) + this.partOfTarget = new Organization(); // aa + return this.partOfTarget; + } + + /** + * @param value {@link #partOf} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization of which this organization forms a part.) + */ + public Organization setPartOfTarget(Organization value) { + this.partOfTarget = value; + return this; + } + + /** + * @return {@link #contact} (Contact for the organization for a certain purpose.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (OrganizationContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contact for the organization for a certain purpose.) + */ + // syntactic sugar + public OrganizationContactComponent addContact() { //3 + OrganizationContactComponent t = new OrganizationContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public Organization addContact(OrganizationContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #active} (Whether the organization's record is still in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value + */ + public BooleanType getActiveElement() { + if (this.active == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Organization.active"); + else if (Configuration.doAutoCreate()) + this.active = new BooleanType(); // bb + return this.active; + } + + public boolean hasActiveElement() { + return this.active != null && !this.active.isEmpty(); + } + + public boolean hasActive() { + return this.active != null && !this.active.isEmpty(); + } + + /** + * @param value {@link #active} (Whether the organization's record is still in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value + */ + public Organization setActiveElement(BooleanType value) { + this.active = value; + return this; + } + + /** + * @return Whether the organization's record is still in active use. + */ + public boolean getActive() { + return this.active == null || this.active.isEmpty() ? false : this.active.getValue(); + } + + /** + * @param value Whether the organization's record is still in active use. + */ + public Organization setActive(boolean value) { + if (this.active == null) + this.active = new BooleanType(); + this.active.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier for the organization that is used to identify the organization across multiple disparate systems.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("name", "string", "A name associated with the organization.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("type", "CodeableConcept", "The kind of organization that this is.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the organization.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("address", "Address", "An address for the organization.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("partOf", "Reference(Organization)", "The organization of which this organization forms a part.", 0, java.lang.Integer.MAX_VALUE, partOf)); + childrenList.add(new Property("contact", "", "Contact for the organization for a certain purpose.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("active", "boolean", "Whether the organization's record is still in active use.", 0, java.lang.Integer.MAX_VALUE, active)); + } + + public Organization copy() { + Organization dst = new Organization(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.name = name == null ? null : name.copy(); + dst.type = type == null ? null : type.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + if (address != null) { + dst.address = new ArrayList
(); + for (Address i : address) + dst.address.add(i.copy()); + }; + dst.partOf = partOf == null ? null : partOf.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (OrganizationContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.active = active == null ? null : active.copy(); + return dst; + } + + protected Organization typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Organization)) + return false; + Organization o = (Organization) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(type, o.type, true) + && compareDeep(telecom, o.telecom, true) && compareDeep(address, o.address, true) && compareDeep(partOf, o.partOf, true) + && compareDeep(contact, o.contact, true) && compareDeep(active, o.active, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Organization)) + return false; + Organization o = (Organization) other; + return compareValues(name, o.name, true) && compareValues(active, o.active, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) + && (type == null || type.isEmpty()) && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) + && (partOf == null || partOf.isEmpty()) && (contact == null || contact.isEmpty()) && (active == null || active.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Organization; + } + + @SearchParamDefinition(name="identifier", path="Organization.identifier", description="Any identifier for the organization (not the accreditation issuer's identifier)", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="partof", path="Organization.partOf", description="Search all organizations that are part of the given organization", type="reference" ) + public static final String SP_PARTOF = "partof"; + @SearchParamDefinition(name="phonetic", path="", description="A portion of the organization's name using some kind of phonetic matching algorithm", type="string" ) + public static final String SP_PHONETIC = "phonetic"; + @SearchParamDefinition(name="address", path="Organization.address", description="A (part of the) address of the Organization", type="string" ) + public static final String SP_ADDRESS = "address"; + @SearchParamDefinition(name="name", path="Organization.name", description="A portion of the organization's name", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="active", path="Organization.active", description="Whether the organization's record is active", type="token" ) + public static final String SP_ACTIVE = "active"; + @SearchParamDefinition(name="type", path="Organization.type", description="A code for the type of organization", type="token" ) + public static final String SP_TYPE = "type"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Parameters.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Parameters.java index 1a821ec6a3f..61a167bd022 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Parameters.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Parameters.java @@ -1,564 +1,543 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * This special resource type is used to represent [operation](operations.html] request and response. It has no other use, and there is no RESTful end=point associated with it. - */ -@ResourceDef(name="Parameters", profile="http://hl7.org/fhir/Profile/Parameters") -public class Parameters extends Resource implements IBaseParameters { - - @Block() - public static class ParametersParameterComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of the parameter (reference to the operation definition). - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Name from the definition", formalDefinition="The name of the parameter (reference to the operation definition)." ) - protected StringType name; - - /** - * If the parameter is a data type. - */ - @Child(name = "value", type = {}, order=2, min=0, max=1) - @Description(shortDefinition="If parameter is a data type", formalDefinition="If the parameter is a data type." ) - protected org.hl7.fhir.instance.model.Type value; - - /** - * If the parameter is a whole resource. - */ - @Child(name = "resource", type = {Resource.class}, order=3, min=0, max=1) - @Description(shortDefinition="If parameter is a whole resource", formalDefinition="If the parameter is a whole resource." ) - protected Resource resource; - - /** - * A named part of a parameter. In many implementation context, a set of named parts is known as a "Tuple". - */ - @Child(name = "part", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Named part of a parameter (e.g. Tuple)", formalDefinition="A named part of a parameter. In many implementation context, a set of named parts is known as a 'Tuple'." ) - protected List part; - - private static final long serialVersionUID = 2101270343L; - - /* - * Constructor - */ - public ParametersParameterComponent() { - super(); - } - - /* - * Constructor - */ - public ParametersParameterComponent(StringType name) { - super(); - this.name = name; - } - - /** - * @return {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ParametersParameterComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ParametersParameterComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of the parameter (reference to the operation definition). - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of the parameter (reference to the operation definition). - */ - public ParametersParameterComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #value} (If the parameter is a data type.) - */ - public org.hl7.fhir.instance.model.Type getValue() { - return this.value; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (If the parameter is a data type.) - */ - public ParametersParameterComponent setValue(org.hl7.fhir.instance.model.Type value) { - this.value = value; - return this; - } - - /** - * @return {@link #resource} (If the parameter is a whole resource.) - */ - public Resource getResource() { - return this.resource; - } - - public boolean hasResource() { - return this.resource != null && !this.resource.isEmpty(); - } - - /** - * @param value {@link #resource} (If the parameter is a whole resource.) - */ - public ParametersParameterComponent setResource(Resource value) { - this.resource = value; - return this; - } - - /** - * @return {@link #part} (A named part of a parameter. In many implementation context, a set of named parts is known as a "Tuple".) - */ - public List getPart() { - if (this.part == null) - this.part = new ArrayList(); - return this.part; - } - - public boolean hasPart() { - if (this.part == null) - return false; - for (ParametersParameterPartComponent item : this.part) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #part} (A named part of a parameter. In many implementation context, a set of named parts is known as a "Tuple".) - */ - // syntactic sugar - public ParametersParameterPartComponent addPart() { //3 - ParametersParameterPartComponent t = new ParametersParameterPartComponent(); - if (this.part == null) - this.part = new ArrayList(); - this.part.add(t); - return t; - } - - // syntactic sugar - public ParametersParameterComponent addPart(ParametersParameterPartComponent t) { //3 - if (t == null) - return this; - if (this.part == null) - this.part = new ArrayList(); - this.part.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of the parameter (reference to the operation definition).", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("value[x]", "*", "If the parameter is a data type.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("resource", "Resource", "If the parameter is a whole resource.", 0, java.lang.Integer.MAX_VALUE, resource)); - childrenList.add(new Property("part", "", "A named part of a parameter. In many implementation context, a set of named parts is known as a 'Tuple'.", 0, java.lang.Integer.MAX_VALUE, part)); - } - - public ParametersParameterComponent copy() { - ParametersParameterComponent dst = new ParametersParameterComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.value = value == null ? null : value.copy(); - dst.resource = resource == null ? null : resource.copy(); - if (part != null) { - dst.part = new ArrayList(); - for (ParametersParameterPartComponent i : part) - dst.part.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ParametersParameterComponent)) - return false; - ParametersParameterComponent o = (ParametersParameterComponent) other; - return compareDeep(name, o.name, true) && compareDeep(value, o.value, true) && compareDeep(resource, o.resource, true) - && compareDeep(part, o.part, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ParametersParameterComponent)) - return false; - ParametersParameterComponent o = (ParametersParameterComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) - && (resource == null || resource.isEmpty()) && (part == null || part.isEmpty()); - } - - } - - @Block() - public static class ParametersParameterPartComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of the parameter (reference to the operation definition). - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Name from the definition", formalDefinition="The name of the parameter (reference to the operation definition)." ) - protected StringType name; - - /** - * The value of the parameter. - */ - @Child(name = "value", type = {}, order=2, min=0, max=1) - @Description(shortDefinition="Value of the part", formalDefinition="The value of the parameter." ) - protected org.hl7.fhir.instance.model.Type value; - - /** - * If the parameter is a whole resource. - */ - @Child(name = "resource", type = {Resource.class}, order=3, min=0, max=1) - @Description(shortDefinition="If part is a whole resource", formalDefinition="If the parameter is a whole resource." ) - protected Resource resource; - - private static final long serialVersionUID = 1120601371L; - - /* - * Constructor - */ - public ParametersParameterPartComponent() { - super(); - } - - /* - * Constructor - */ - public ParametersParameterPartComponent(StringType name) { - super(); - this.name = name; - } - - /** - * @return {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ParametersParameterPartComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ParametersParameterPartComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of the parameter (reference to the operation definition). - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of the parameter (reference to the operation definition). - */ - public ParametersParameterPartComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #value} (The value of the parameter.) - */ - public org.hl7.fhir.instance.model.Type getValue() { - return this.value; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value of the parameter.) - */ - public ParametersParameterPartComponent setValue(org.hl7.fhir.instance.model.Type value) { - this.value = value; - return this; - } - - /** - * @return {@link #resource} (If the parameter is a whole resource.) - */ - public Resource getResource() { - return this.resource; - } - - public boolean hasResource() { - return this.resource != null && !this.resource.isEmpty(); - } - - /** - * @param value {@link #resource} (If the parameter is a whole resource.) - */ - public ParametersParameterPartComponent setResource(Resource value) { - this.resource = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of the parameter (reference to the operation definition).", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("value[x]", "*", "The value of the parameter.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("resource", "Resource", "If the parameter is a whole resource.", 0, java.lang.Integer.MAX_VALUE, resource)); - } - - public ParametersParameterPartComponent copy() { - ParametersParameterPartComponent dst = new ParametersParameterPartComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.value = value == null ? null : value.copy(); - dst.resource = resource == null ? null : resource.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ParametersParameterPartComponent)) - return false; - ParametersParameterPartComponent o = (ParametersParameterPartComponent) other; - return compareDeep(name, o.name, true) && compareDeep(value, o.value, true) && compareDeep(resource, o.resource, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ParametersParameterPartComponent)) - return false; - ParametersParameterPartComponent o = (ParametersParameterPartComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) - && (resource == null || resource.isEmpty()); - } - - } - - /** - * A parameter passed to or received from the operation. - */ - @Child(name = "parameter", type = {}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Operation Parameter", formalDefinition="A parameter passed to or received from the operation." ) - protected List parameter; - - private static final long serialVersionUID = -1495940293L; - - /* - * Constructor - */ - public Parameters() { - super(); - } - - /** - * @return {@link #parameter} (A parameter passed to or received from the operation.) - */ - public List getParameter() { - if (this.parameter == null) - this.parameter = new ArrayList(); - return this.parameter; - } - - public boolean hasParameter() { - if (this.parameter == null) - return false; - for (ParametersParameterComponent item : this.parameter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #parameter} (A parameter passed to or received from the operation.) - */ - // syntactic sugar - public ParametersParameterComponent addParameter() { //3 - ParametersParameterComponent t = new ParametersParameterComponent(); - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return t; - } - - // syntactic sugar - public Parameters addParameter(ParametersParameterComponent t) { //3 - if (t == null) - return this; - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("parameter", "", "A parameter passed to or received from the operation.", 0, java.lang.Integer.MAX_VALUE, parameter)); - } - - public Parameters copy() { - Parameters dst = new Parameters(); - copyValues(dst); - if (parameter != null) { - dst.parameter = new ArrayList(); - for (ParametersParameterComponent i : parameter) - dst.parameter.add(i.copy()); - }; - return dst; - } - - protected Parameters typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Parameters)) - return false; - Parameters o = (Parameters) other; - return compareDeep(parameter, o.parameter, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Parameters)) - return false; - Parameters o = (Parameters) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (parameter == null || parameter.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Parameters; - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * This special resource type is used to represent [operation](operations.html] request and response. It has no other use, and there is no RESTful end=point associated with it. + */ +@ResourceDef(name="Parameters", profile="http://hl7.org/fhir/Profile/Parameters") +public class Parameters extends Resource implements IBaseParameters { + + @Block() + public static class ParametersParameterComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of the parameter (reference to the operation definition). + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Name from the definition", formalDefinition="The name of the parameter (reference to the operation definition)." ) + protected StringType name; + + /** + * If the parameter is a data type. + */ + @Child(name = "value", type = {}, order=2, min=0, max=1) + @Description(shortDefinition="If parameter is a data type", formalDefinition="If the parameter is a data type." ) + protected org.hl7.fhir.instance.model.Type value; + + /** + * If the parameter is a whole resource. + */ + @Child(name = "resource", type = {Resource.class}, order=3, min=0, max=1) + @Description(shortDefinition="If parameter is a whole resource", formalDefinition="If the parameter is a whole resource." ) + protected Resource resource; + + /** + * A named part of a parameter. In many implementation context, a set of named parts is known as a "Tuple". + */ + @Child(name = "part", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Named part of a parameter (e.g. Tuple)", formalDefinition="A named part of a parameter. In many implementation context, a set of named parts is known as a 'Tuple'." ) + protected List part; + + private static final long serialVersionUID = 2101270343L; + + /* + * Constructor + */ + public ParametersParameterComponent() { + super(); + } + + /* + * Constructor + */ + public ParametersParameterComponent(StringType name) { + super(); + this.name = name; + } + + /** + * @return {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ParametersParameterComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ParametersParameterComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of the parameter (reference to the operation definition). + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of the parameter (reference to the operation definition). + */ + public ParametersParameterComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #value} (If the parameter is a data type.) + */ + public org.hl7.fhir.instance.model.Type getValue() { + return this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (If the parameter is a data type.) + */ + public ParametersParameterComponent setValue(org.hl7.fhir.instance.model.Type value) { + this.value = value; + return this; + } + + /** + * @return {@link #resource} (If the parameter is a whole resource.) + */ + public Resource getResource() { + return this.resource; + } + + public boolean hasResource() { + return this.resource != null && !this.resource.isEmpty(); + } + + /** + * @param value {@link #resource} (If the parameter is a whole resource.) + */ + public ParametersParameterComponent setResource(Resource value) { + this.resource = value; + return this; + } + + /** + * @return {@link #part} (A named part of a parameter. In many implementation context, a set of named parts is known as a "Tuple".) + */ + public List getPart() { + if (this.part == null) + this.part = new ArrayList(); + return this.part; + } + + public boolean hasPart() { + if (this.part == null) + return false; + for (ParametersParameterPartComponent item : this.part) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #part} (A named part of a parameter. In many implementation context, a set of named parts is known as a "Tuple".) + */ + // syntactic sugar + public ParametersParameterPartComponent addPart() { //3 + ParametersParameterPartComponent t = new ParametersParameterPartComponent(); + if (this.part == null) + this.part = new ArrayList(); + this.part.add(t); + return t; + } + + // syntactic sugar + public ParametersParameterComponent addPart(ParametersParameterPartComponent t) { //3 + if (t == null) + return this; + if (this.part == null) + this.part = new ArrayList(); + this.part.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of the parameter (reference to the operation definition).", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("value[x]", "*", "If the parameter is a data type.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("resource", "Resource", "If the parameter is a whole resource.", 0, java.lang.Integer.MAX_VALUE, resource)); + childrenList.add(new Property("part", "", "A named part of a parameter. In many implementation context, a set of named parts is known as a 'Tuple'.", 0, java.lang.Integer.MAX_VALUE, part)); + } + + public ParametersParameterComponent copy() { + ParametersParameterComponent dst = new ParametersParameterComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.value = value == null ? null : value.copy(); + dst.resource = resource == null ? null : resource.copy(); + if (part != null) { + dst.part = new ArrayList(); + for (ParametersParameterPartComponent i : part) + dst.part.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ParametersParameterComponent)) + return false; + ParametersParameterComponent o = (ParametersParameterComponent) other; + return compareDeep(name, o.name, true) && compareDeep(value, o.value, true) && compareDeep(resource, o.resource, true) + && compareDeep(part, o.part, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ParametersParameterComponent)) + return false; + ParametersParameterComponent o = (ParametersParameterComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) + && (resource == null || resource.isEmpty()) && (part == null || part.isEmpty()); + } + + } + + @Block() + public static class ParametersParameterPartComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of the parameter (reference to the operation definition). + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Name from the definition", formalDefinition="The name of the parameter (reference to the operation definition)." ) + protected StringType name; + + /** + * The value of the parameter. + */ + @Child(name = "value", type = {}, order=2, min=0, max=1) + @Description(shortDefinition="Value of the part", formalDefinition="The value of the parameter." ) + protected org.hl7.fhir.instance.model.Type value; + + /** + * If the parameter is a whole resource. + */ + @Child(name = "resource", type = {Resource.class}, order=3, min=0, max=1) + @Description(shortDefinition="If part is a whole resource", formalDefinition="If the parameter is a whole resource." ) + protected Resource resource; + + private static final long serialVersionUID = 1120601371L; + + /* + * Constructor + */ + public ParametersParameterPartComponent() { + super(); + } + + /* + * Constructor + */ + public ParametersParameterPartComponent(StringType name) { + super(); + this.name = name; + } + + /** + * @return {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ParametersParameterPartComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ParametersParameterPartComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of the parameter (reference to the operation definition). + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of the parameter (reference to the operation definition). + */ + public ParametersParameterPartComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #value} (The value of the parameter.) + */ + public org.hl7.fhir.instance.model.Type getValue() { + return this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value of the parameter.) + */ + public ParametersParameterPartComponent setValue(org.hl7.fhir.instance.model.Type value) { + this.value = value; + return this; + } + + /** + * @return {@link #resource} (If the parameter is a whole resource.) + */ + public Resource getResource() { + return this.resource; + } + + public boolean hasResource() { + return this.resource != null && !this.resource.isEmpty(); + } + + /** + * @param value {@link #resource} (If the parameter is a whole resource.) + */ + public ParametersParameterPartComponent setResource(Resource value) { + this.resource = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of the parameter (reference to the operation definition).", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("value[x]", "*", "The value of the parameter.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("resource", "Resource", "If the parameter is a whole resource.", 0, java.lang.Integer.MAX_VALUE, resource)); + } + + public ParametersParameterPartComponent copy() { + ParametersParameterPartComponent dst = new ParametersParameterPartComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.value = value == null ? null : value.copy(); + dst.resource = resource == null ? null : resource.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ParametersParameterPartComponent)) + return false; + ParametersParameterPartComponent o = (ParametersParameterPartComponent) other; + return compareDeep(name, o.name, true) && compareDeep(value, o.value, true) && compareDeep(resource, o.resource, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ParametersParameterPartComponent)) + return false; + ParametersParameterPartComponent o = (ParametersParameterPartComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) + && (resource == null || resource.isEmpty()); + } + + } + + /** + * A parameter passed to or received from the operation. + */ + @Child(name = "parameter", type = {}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Operation Parameter", formalDefinition="A parameter passed to or received from the operation." ) + protected List parameter; + + private static final long serialVersionUID = -1495940293L; + + /* + * Constructor + */ + public Parameters() { + super(); + } + + /** + * @return {@link #parameter} (A parameter passed to or received from the operation.) + */ + public List getParameter() { + if (this.parameter == null) + this.parameter = new ArrayList(); + return this.parameter; + } + + public boolean hasParameter() { + if (this.parameter == null) + return false; + for (ParametersParameterComponent item : this.parameter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #parameter} (A parameter passed to or received from the operation.) + */ + // syntactic sugar + public ParametersParameterComponent addParameter() { //3 + ParametersParameterComponent t = new ParametersParameterComponent(); + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return t; + } + + // syntactic sugar + public Parameters addParameter(ParametersParameterComponent t) { //3 + if (t == null) + return this; + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("parameter", "", "A parameter passed to or received from the operation.", 0, java.lang.Integer.MAX_VALUE, parameter)); + } + + public Parameters copy() { + Parameters dst = new Parameters(); + copyValues(dst); + if (parameter != null) { + dst.parameter = new ArrayList(); + for (ParametersParameterComponent i : parameter) + dst.parameter.add(i.copy()); + }; + return dst; + } + + protected Parameters typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Parameters)) + return false; + Parameters o = (Parameters) other; + return compareDeep(parameter, o.parameter, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Parameters)) + return false; + Parameters o = (Parameters) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (parameter == null || parameter.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Parameters; + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Patient.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Patient.java index 63e4b512d9c..b1f8f1c0776 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Patient.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Patient.java @@ -1,2077 +1,2056 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Demographics and other administrative information about an individual or animal receiving care or other health-related services. - */ -@ResourceDef(name="Patient", profile="http://hl7.org/fhir/Profile/Patient") -public class Patient extends DomainResource { - - public enum AdministrativeGender { - /** - * Male - */ - MALE, - /** - * Female - */ - FEMALE, - /** - * Other - */ - OTHER, - /** - * Unknown - */ - UNKNOWN, - /** - * added to help the parsers - */ - NULL; - public static AdministrativeGender fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return MALE; - if ("female".equals(codeString)) - return FEMALE; - if ("other".equals(codeString)) - return OTHER; - if ("unknown".equals(codeString)) - return UNKNOWN; - throw new Exception("Unknown AdministrativeGender code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case MALE: return "male"; - case FEMALE: return "female"; - case OTHER: return "other"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MALE: return ""; - case FEMALE: return ""; - case OTHER: return ""; - case UNKNOWN: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MALE: return "Male"; - case FEMALE: return "Female"; - case OTHER: return "Other"; - case UNKNOWN: return "Unknown"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MALE: return "Male"; - case FEMALE: return "Female"; - case OTHER: return "Other"; - case UNKNOWN: return "Unknown"; - default: return "?"; - } - } - } - - public static class AdministrativeGenderEnumFactory implements EnumFactory { - public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return AdministrativeGender.MALE; - if ("female".equals(codeString)) - return AdministrativeGender.FEMALE; - if ("other".equals(codeString)) - return AdministrativeGender.OTHER; - if ("unknown".equals(codeString)) - return AdministrativeGender.UNKNOWN; - throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); - } - public String toCode(AdministrativeGender code) { - if (code == AdministrativeGender.MALE) - return "male"; - if (code == AdministrativeGender.FEMALE) - return "female"; - if (code == AdministrativeGender.OTHER) - return "other"; - if (code == AdministrativeGender.UNKNOWN) - return "unknown"; - return "?"; - } - } - - public enum LinkType { - /** - * The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains the link. - */ - REPLACE, - /** - * The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information. - */ - REFER, - /** - * The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid. - */ - SEEALSO, - /** - * added to help the parsers - */ - NULL; - public static LinkType fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("replace".equals(codeString)) - return REPLACE; - if ("refer".equals(codeString)) - return REFER; - if ("seealso".equals(codeString)) - return SEEALSO; - throw new Exception("Unknown LinkType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case REPLACE: return "replace"; - case REFER: return "refer"; - case SEEALSO: return "seealso"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REPLACE: return ""; - case REFER: return ""; - case SEEALSO: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REPLACE: return "The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains the link."; - case REFER: return "The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information."; - case SEEALSO: return "The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REPLACE: return "replace"; - case REFER: return "refer"; - case SEEALSO: return "see also"; - default: return "?"; - } - } - } - - public static class LinkTypeEnumFactory implements EnumFactory { - public LinkType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("replace".equals(codeString)) - return LinkType.REPLACE; - if ("refer".equals(codeString)) - return LinkType.REFER; - if ("seealso".equals(codeString)) - return LinkType.SEEALSO; - throw new IllegalArgumentException("Unknown LinkType code '"+codeString+"'"); - } - public String toCode(LinkType code) { - if (code == LinkType.REPLACE) - return "replace"; - if (code == LinkType.REFER) - return "refer"; - if (code == LinkType.SEEALSO) - return "seealso"; - return "?"; - } - } - - @Block() - public static class ContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The nature of the relationship between the patient and the contact person. - */ - @Child(name = "relationship", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The kind of relationship", formalDefinition="The nature of the relationship between the patient and the contact person." ) - protected List relationship; - - /** - * A name associated with the contact person. - */ - @Child(name = "name", type = {HumanName.class}, order=2, min=0, max=1) - @Description(shortDefinition="A name associated with the contact person", formalDefinition="A name associated with the contact person." ) - protected HumanName name; - - /** - * A contact detail for the person, e.g. a telephone number or an email address. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." ) - protected List telecom; - - /** - * Address for the contact person. - */ - @Child(name = "address", type = {Address.class}, order=4, min=0, max=1) - @Description(shortDefinition="Address for the contact person", formalDefinition="Address for the contact person." ) - protected Address address; - - /** - * Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes. - */ - @Child(name = "gender", type = {CodeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes." ) - protected Enumeration gender; - - /** - * Organization on behalf of which the contact is acting or for which the contact is working. - */ - @Child(name = "organization", type = {Organization.class}, order=6, min=0, max=1) - @Description(shortDefinition="Organization that is associated with the contact", formalDefinition="Organization on behalf of which the contact is acting or for which the contact is working." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (Organization on behalf of which the contact is acting or for which the contact is working.) - */ - protected Organization organizationTarget; - - /** - * The period during which this contact person or organization is valid to be contacted relating to this patient. - */ - @Child(name = "period", type = {Period.class}, order=7, min=0, max=1) - @Description(shortDefinition="The period during which this contact person or organization is valid to be contacted relating to this patient", formalDefinition="The period during which this contact person or organization is valid to be contacted relating to this patient." ) - protected Period period; - - private static final long serialVersionUID = 364269017L; - - /* - * Constructor - */ - public ContactComponent() { - super(); - } - - /** - * @return {@link #relationship} (The nature of the relationship between the patient and the contact person.) - */ - public List getRelationship() { - if (this.relationship == null) - this.relationship = new ArrayList(); - return this.relationship; - } - - public boolean hasRelationship() { - if (this.relationship == null) - return false; - for (CodeableConcept item : this.relationship) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #relationship} (The nature of the relationship between the patient and the contact person.) - */ - // syntactic sugar - public CodeableConcept addRelationship() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.relationship == null) - this.relationship = new ArrayList(); - this.relationship.add(t); - return t; - } - - // syntactic sugar - public ContactComponent addRelationship(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.relationship == null) - this.relationship = new ArrayList(); - this.relationship.add(t); - return this; - } - - /** - * @return {@link #name} (A name associated with the contact person.) - */ - public HumanName getName() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new HumanName(); // cc - return this.name; - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A name associated with the contact person.) - */ - public ContactComponent setName(HumanName value) { - this.name = value; - return this; - } - - /** - * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public ContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #address} (Address for the contact person.) - */ - public Address getAddress() { - if (this.address == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactComponent.address"); - else if (Configuration.doAutoCreate()) - this.address = new Address(); // cc - return this.address; - } - - public boolean hasAddress() { - return this.address != null && !this.address.isEmpty(); - } - - /** - * @param value {@link #address} (Address for the contact person.) - */ - public ContactComponent setAddress(Address value) { - this.address = value; - return this; - } - - /** - * @return {@link #gender} (Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Enumeration getGenderElement() { - if (this.gender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactComponent.gender"); - else if (Configuration.doAutoCreate()) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb - return this.gender; - } - - public boolean hasGenderElement() { - return this.gender != null && !this.gender.isEmpty(); - } - - public boolean hasGender() { - return this.gender != null && !this.gender.isEmpty(); - } - - /** - * @param value {@link #gender} (Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public ContactComponent setGenderElement(Enumeration value) { - this.gender = value; - return this; - } - - /** - * @return Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes. - */ - public AdministrativeGender getGender() { - return this.gender == null ? null : this.gender.getValue(); - } - - /** - * @param value Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes. - */ - public ContactComponent setGender(AdministrativeGender value) { - if (value == null) - this.gender = null; - else { - if (this.gender == null) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); - this.gender.setValue(value); - } - return this; - } - - /** - * @return {@link #organization} (Organization on behalf of which the contact is acting or for which the contact is working.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); // cc - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (Organization on behalf of which the contact is acting or for which the contact is working.) - */ - public ContactComponent setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Organization on behalf of which the contact is acting or for which the contact is working.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); // aa - return this.organizationTarget; - } - - /** - * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Organization on behalf of which the contact is acting or for which the contact is working.) - */ - public ContactComponent setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #period} (The period during which this contact person or organization is valid to be contacted relating to this patient.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The period during which this contact person or organization is valid to be contacted relating to this patient.) - */ - public ContactComponent setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("relationship", "CodeableConcept", "The nature of the relationship between the patient and the contact person.", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("name", "HumanName", "A name associated with the contact person.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the person, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("address", "Address", "Address for the contact person.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); - childrenList.add(new Property("organization", "Reference(Organization)", "Organization on behalf of which the contact is acting or for which the contact is working.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("period", "Period", "The period during which this contact person or organization is valid to be contacted relating to this patient.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - public ContactComponent copy() { - ContactComponent dst = new ContactComponent(); - copyValues(dst); - if (relationship != null) { - dst.relationship = new ArrayList(); - for (CodeableConcept i : relationship) - dst.relationship.add(i.copy()); - }; - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.address = address == null ? null : address.copy(); - dst.gender = gender == null ? null : gender.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ContactComponent)) - return false; - ContactComponent o = (ContactComponent) other; - return compareDeep(relationship, o.relationship, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) - && compareDeep(address, o.address, true) && compareDeep(gender, o.gender, true) && compareDeep(organization, o.organization, true) - && compareDeep(period, o.period, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ContactComponent)) - return false; - ContactComponent o = (ContactComponent) other; - return compareValues(gender, o.gender, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (relationship == null || relationship.isEmpty()) && (name == null || name.isEmpty()) - && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) && (gender == null || gender.isEmpty()) - && (organization == null || organization.isEmpty()) && (period == null || period.isEmpty()) - ; - } - - } - - @Block() - public static class AnimalComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifies the high level taxonomic categorization of the kind of animal. - */ - @Child(name = "species", type = {CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="E.g. Dog, Cow", formalDefinition="Identifies the high level taxonomic categorization of the kind of animal." ) - protected CodeableConcept species; - - /** - * Identifies the detailed categorization of the kind of animal. - */ - @Child(name = "breed", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="E.g. Poodle, Angus", formalDefinition="Identifies the detailed categorization of the kind of animal." ) - protected CodeableConcept breed; - - /** - * Indicates the current state of the animal's reproductive organs. - */ - @Child(name = "genderStatus", type = {CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="E.g. Neutered, Intact", formalDefinition="Indicates the current state of the animal's reproductive organs." ) - protected CodeableConcept genderStatus; - - private static final long serialVersionUID = -549738382L; - - /* - * Constructor - */ - public AnimalComponent() { - super(); - } - - /* - * Constructor - */ - public AnimalComponent(CodeableConcept species) { - super(); - this.species = species; - } - - /** - * @return {@link #species} (Identifies the high level taxonomic categorization of the kind of animal.) - */ - public CodeableConcept getSpecies() { - if (this.species == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AnimalComponent.species"); - else if (Configuration.doAutoCreate()) - this.species = new CodeableConcept(); // cc - return this.species; - } - - public boolean hasSpecies() { - return this.species != null && !this.species.isEmpty(); - } - - /** - * @param value {@link #species} (Identifies the high level taxonomic categorization of the kind of animal.) - */ - public AnimalComponent setSpecies(CodeableConcept value) { - this.species = value; - return this; - } - - /** - * @return {@link #breed} (Identifies the detailed categorization of the kind of animal.) - */ - public CodeableConcept getBreed() { - if (this.breed == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AnimalComponent.breed"); - else if (Configuration.doAutoCreate()) - this.breed = new CodeableConcept(); // cc - return this.breed; - } - - public boolean hasBreed() { - return this.breed != null && !this.breed.isEmpty(); - } - - /** - * @param value {@link #breed} (Identifies the detailed categorization of the kind of animal.) - */ - public AnimalComponent setBreed(CodeableConcept value) { - this.breed = value; - return this; - } - - /** - * @return {@link #genderStatus} (Indicates the current state of the animal's reproductive organs.) - */ - public CodeableConcept getGenderStatus() { - if (this.genderStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AnimalComponent.genderStatus"); - else if (Configuration.doAutoCreate()) - this.genderStatus = new CodeableConcept(); // cc - return this.genderStatus; - } - - public boolean hasGenderStatus() { - return this.genderStatus != null && !this.genderStatus.isEmpty(); - } - - /** - * @param value {@link #genderStatus} (Indicates the current state of the animal's reproductive organs.) - */ - public AnimalComponent setGenderStatus(CodeableConcept value) { - this.genderStatus = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("species", "CodeableConcept", "Identifies the high level taxonomic categorization of the kind of animal.", 0, java.lang.Integer.MAX_VALUE, species)); - childrenList.add(new Property("breed", "CodeableConcept", "Identifies the detailed categorization of the kind of animal.", 0, java.lang.Integer.MAX_VALUE, breed)); - childrenList.add(new Property("genderStatus", "CodeableConcept", "Indicates the current state of the animal's reproductive organs.", 0, java.lang.Integer.MAX_VALUE, genderStatus)); - } - - public AnimalComponent copy() { - AnimalComponent dst = new AnimalComponent(); - copyValues(dst); - dst.species = species == null ? null : species.copy(); - dst.breed = breed == null ? null : breed.copy(); - dst.genderStatus = genderStatus == null ? null : genderStatus.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AnimalComponent)) - return false; - AnimalComponent o = (AnimalComponent) other; - return compareDeep(species, o.species, true) && compareDeep(breed, o.breed, true) && compareDeep(genderStatus, o.genderStatus, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AnimalComponent)) - return false; - AnimalComponent o = (AnimalComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (species == null || species.isEmpty()) && (breed == null || breed.isEmpty()) - && (genderStatus == null || genderStatus.isEmpty()); - } - - } - - @Block() - public static class PatientCommunicationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case. E.g. "en" for English, or "en-US" for American English versus "en-EN" for England English. - */ - @Child(name = "language", type = {CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="The language which can be used to communicate with the patient about his or her health", formalDefinition="The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case. E.g. 'en' for English, or 'en-US' for American English versus 'en-EN' for England English." ) - protected CodeableConcept language; - - /** - * Indicates whether or not the Patient prefers this language (over other languages he masters up a certain level). - */ - @Child(name = "preferred", type = {BooleanType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Language preference indicator", formalDefinition="Indicates whether or not the Patient prefers this language (over other languages he masters up a certain level)." ) - protected BooleanType preferred; - - private static final long serialVersionUID = 633792918L; - - /* - * Constructor - */ - public PatientCommunicationComponent() { - super(); - } - - /* - * Constructor - */ - public PatientCommunicationComponent(CodeableConcept language) { - super(); - this.language = language; - } - - /** - * @return {@link #language} (The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case. E.g. "en" for English, or "en-US" for American English versus "en-EN" for England English.) - */ - public CodeableConcept getLanguage() { - if (this.language == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PatientCommunicationComponent.language"); - else if (Configuration.doAutoCreate()) - this.language = new CodeableConcept(); // cc - return this.language; - } - - public boolean hasLanguage() { - return this.language != null && !this.language.isEmpty(); - } - - /** - * @param value {@link #language} (The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case. E.g. "en" for English, or "en-US" for American English versus "en-EN" for England English.) - */ - public PatientCommunicationComponent setLanguage(CodeableConcept value) { - this.language = value; - return this; - } - - /** - * @return {@link #preferred} (Indicates whether or not the Patient prefers this language (over other languages he masters up a certain level).). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value - */ - public BooleanType getPreferredElement() { - if (this.preferred == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PatientCommunicationComponent.preferred"); - else if (Configuration.doAutoCreate()) - this.preferred = new BooleanType(); // bb - return this.preferred; - } - - public boolean hasPreferredElement() { - return this.preferred != null && !this.preferred.isEmpty(); - } - - public boolean hasPreferred() { - return this.preferred != null && !this.preferred.isEmpty(); - } - - /** - * @param value {@link #preferred} (Indicates whether or not the Patient prefers this language (over other languages he masters up a certain level).). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value - */ - public PatientCommunicationComponent setPreferredElement(BooleanType value) { - this.preferred = value; - return this; - } - - /** - * @return Indicates whether or not the Patient prefers this language (over other languages he masters up a certain level). - */ - public boolean getPreferred() { - return this.preferred == null || this.preferred.isEmpty() ? false : this.preferred.getValue(); - } - - /** - * @param value Indicates whether or not the Patient prefers this language (over other languages he masters up a certain level). - */ - public PatientCommunicationComponent setPreferred(boolean value) { - if (this.preferred == null) - this.preferred = new BooleanType(); - this.preferred.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("language", "CodeableConcept", "The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case. E.g. 'en' for English, or 'en-US' for American English versus 'en-EN' for England English.", 0, java.lang.Integer.MAX_VALUE, language)); - childrenList.add(new Property("preferred", "boolean", "Indicates whether or not the Patient prefers this language (over other languages he masters up a certain level).", 0, java.lang.Integer.MAX_VALUE, preferred)); - } - - public PatientCommunicationComponent copy() { - PatientCommunicationComponent dst = new PatientCommunicationComponent(); - copyValues(dst); - dst.language = language == null ? null : language.copy(); - dst.preferred = preferred == null ? null : preferred.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof PatientCommunicationComponent)) - return false; - PatientCommunicationComponent o = (PatientCommunicationComponent) other; - return compareDeep(language, o.language, true) && compareDeep(preferred, o.preferred, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof PatientCommunicationComponent)) - return false; - PatientCommunicationComponent o = (PatientCommunicationComponent) other; - return compareValues(preferred, o.preferred, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (language == null || language.isEmpty()) && (preferred == null || preferred.isEmpty()) - ; - } - - } - - @Block() - public static class PatientLinkComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The other patient resource that the link refers to. - */ - @Child(name = "other", type = {Patient.class}, order=1, min=1, max=1) - @Description(shortDefinition="The other patient resource that the link refers to", formalDefinition="The other patient resource that the link refers to." ) - protected Reference other; - - /** - * The actual object that is the target of the reference (The other patient resource that the link refers to.) - */ - protected Patient otherTarget; - - /** - * The type of link between this patient resource and another patient resource. - */ - @Child(name = "type", type = {CodeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="replace | refer | seealso - type of link", formalDefinition="The type of link between this patient resource and another patient resource." ) - protected Enumeration type; - - private static final long serialVersionUID = -1942104050L; - - /* - * Constructor - */ - public PatientLinkComponent() { - super(); - } - - /* - * Constructor - */ - public PatientLinkComponent(Reference other, Enumeration type) { - super(); - this.other = other; - this.type = type; - } - - /** - * @return {@link #other} (The other patient resource that the link refers to.) - */ - public Reference getOther() { - if (this.other == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PatientLinkComponent.other"); - else if (Configuration.doAutoCreate()) - this.other = new Reference(); // cc - return this.other; - } - - public boolean hasOther() { - return this.other != null && !this.other.isEmpty(); - } - - /** - * @param value {@link #other} (The other patient resource that the link refers to.) - */ - public PatientLinkComponent setOther(Reference value) { - this.other = value; - return this; - } - - /** - * @return {@link #other} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The other patient resource that the link refers to.) - */ - public Patient getOtherTarget() { - if (this.otherTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PatientLinkComponent.other"); - else if (Configuration.doAutoCreate()) - this.otherTarget = new Patient(); // aa - return this.otherTarget; - } - - /** - * @param value {@link #other} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The other patient resource that the link refers to.) - */ - public PatientLinkComponent setOtherTarget(Patient value) { - this.otherTarget = value; - return this; - } - - /** - * @return {@link #type} (The type of link between this patient resource and another patient resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PatientLinkComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new LinkTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of link between this patient resource and another patient resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public PatientLinkComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The type of link between this patient resource and another patient resource. - */ - public LinkType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of link between this patient resource and another patient resource. - */ - public PatientLinkComponent setType(LinkType value) { - if (this.type == null) - this.type = new Enumeration(new LinkTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("other", "Reference(Patient)", "The other patient resource that the link refers to.", 0, java.lang.Integer.MAX_VALUE, other)); - childrenList.add(new Property("type", "code", "The type of link between this patient resource and another patient resource.", 0, java.lang.Integer.MAX_VALUE, type)); - } - - public PatientLinkComponent copy() { - PatientLinkComponent dst = new PatientLinkComponent(); - copyValues(dst); - dst.other = other == null ? null : other.copy(); - dst.type = type == null ? null : type.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof PatientLinkComponent)) - return false; - PatientLinkComponent o = (PatientLinkComponent) other; - return compareDeep(other, o.other, true) && compareDeep(type, o.type, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof PatientLinkComponent)) - return false; - PatientLinkComponent o = (PatientLinkComponent) other; - return compareValues(type, o.type, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (other == null || other.isEmpty()) && (type == null || type.isEmpty()) - ; - } - - } - - /** - * An identifier for this patient. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="An identifier for this patient", formalDefinition="An identifier for this patient." ) - protected List identifier; - - /** - * A name associated with the individual. - */ - @Child(name = "name", type = {HumanName.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A name associated with the patient", formalDefinition="A name associated with the individual." ) - protected List name; - - /** - * A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A contact detail for the individual", formalDefinition="A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted." ) - protected List telecom; - - /** - * Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. - */ - @Child(name = "gender", type = {CodeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes." ) - protected Enumeration gender; - - /** - * The date of birth for the individual. - */ - @Child(name = "birthDate", type = {DateType.class}, order=4, min=0, max=1) - @Description(shortDefinition="The date of birth for the individual", formalDefinition="The date of birth for the individual." ) - protected DateType birthDate; - - /** - * Indicates if the individual is deceased or not. - */ - @Child(name = "deceased", type = {BooleanType.class, DateTimeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Indicates if the individual is deceased or not", formalDefinition="Indicates if the individual is deceased or not." ) - protected Type deceased; - - /** - * Addresses for the individual. - */ - @Child(name = "address", type = {Address.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Addresses for the individual", formalDefinition="Addresses for the individual." ) - protected List
address; - - /** - * This field contains a patient's most recent marital (civil) status. - */ - @Child(name = "maritalStatus", type = {CodeableConcept.class}, order=7, min=0, max=1) - @Description(shortDefinition="Marital (civil) status of a patient", formalDefinition="This field contains a patient's most recent marital (civil) status." ) - protected CodeableConcept maritalStatus; - - /** - * Indicates whether the patient is part of a multiple or indicates the actual birth order. - */ - @Child(name = "multipleBirth", type = {BooleanType.class, IntegerType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Whether patient is part of a multiple birth", formalDefinition="Indicates whether the patient is part of a multiple or indicates the actual birth order." ) - protected Type multipleBirth; - - /** - * Image of the patient. - */ - @Child(name = "photo", type = {Attachment.class}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Image of the patient", formalDefinition="Image of the patient." ) - protected List photo; - - /** - * A contact party (e.g. guardian, partner, friend) for the patient. - */ - @Child(name = "contact", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A contact party (e.g. guardian, partner, friend) for the patient", formalDefinition="A contact party (e.g. guardian, partner, friend) for the patient." ) - protected List contact; - - /** - * This element has a value if the patient is an animal. - */ - @Child(name = "animal", type = {}, order=11, min=0, max=1) - @Description(shortDefinition="If this patient is an animal (non-human)", formalDefinition="This element has a value if the patient is an animal." ) - protected AnimalComponent animal; - - /** - * Languages which may be used to communicate with the patient about his or her health. - */ - @Child(name = "communication", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A list of Languages which may be used to communicate with the patient about his or her health", formalDefinition="Languages which may be used to communicate with the patient about his or her health." ) - protected List communication; - - /** - * Patient's nominated care provider. - */ - @Child(name = "careProvider", type = {Organization.class, Practitioner.class}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Patient's nominated care provider", formalDefinition="Patient's nominated care provider." ) - protected List careProvider; - /** - * The actual objects that are the target of the reference (Patient's nominated care provider.) - */ - protected List careProviderTarget; - - - /** - * Organization that is the custodian of the patient record. - */ - @Child(name = "managingOrganization", type = {Organization.class}, order=14, min=0, max=1) - @Description(shortDefinition="Organization that is the custodian of the patient record", formalDefinition="Organization that is the custodian of the patient record." ) - protected Reference managingOrganization; - - /** - * The actual object that is the target of the reference (Organization that is the custodian of the patient record.) - */ - protected Organization managingOrganizationTarget; - - /** - * Link to another patient resource that concerns the same actual patient. - */ - @Child(name = "link", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Link to another patient resource that concerns the same actual person", formalDefinition="Link to another patient resource that concerns the same actual patient." ) - protected List link; - - /** - * Whether this patient record is in active use. - */ - @Child(name = "active", type = {BooleanType.class}, order=16, min=0, max=1) - @Description(shortDefinition="Whether this patient's record is in active use", formalDefinition="Whether this patient record is in active use." ) - protected BooleanType active; - - private static final long serialVersionUID = 2057666410L; - - /* - * Constructor - */ - public Patient() { - super(); - } - - /** - * @return {@link #identifier} (An identifier for this patient.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (An identifier for this patient.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Patient addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #name} (A name associated with the individual.) - */ - public List getName() { - if (this.name == null) - this.name = new ArrayList(); - return this.name; - } - - public boolean hasName() { - if (this.name == null) - return false; - for (HumanName item : this.name) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #name} (A name associated with the individual.) - */ - // syntactic sugar - public HumanName addName() { //3 - HumanName t = new HumanName(); - if (this.name == null) - this.name = new ArrayList(); - this.name.add(t); - return t; - } - - // syntactic sugar - public Patient addName(HumanName t) { //3 - if (t == null) - return this; - if (this.name == null) - this.name = new ArrayList(); - this.name.add(t); - return this; - } - - /** - * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public Patient addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #gender} (Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Enumeration getGenderElement() { - if (this.gender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Patient.gender"); - else if (Configuration.doAutoCreate()) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb - return this.gender; - } - - public boolean hasGenderElement() { - return this.gender != null && !this.gender.isEmpty(); - } - - public boolean hasGender() { - return this.gender != null && !this.gender.isEmpty(); - } - - /** - * @param value {@link #gender} (Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Patient setGenderElement(Enumeration value) { - this.gender = value; - return this; - } - - /** - * @return Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. - */ - public AdministrativeGender getGender() { - return this.gender == null ? null : this.gender.getValue(); - } - - /** - * @param value Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. - */ - public Patient setGender(AdministrativeGender value) { - if (value == null) - this.gender = null; - else { - if (this.gender == null) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); - this.gender.setValue(value); - } - return this; - } - - /** - * @return {@link #birthDate} (The date of birth for the individual.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value - */ - public DateType getBirthDateElement() { - if (this.birthDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Patient.birthDate"); - else if (Configuration.doAutoCreate()) - this.birthDate = new DateType(); // bb - return this.birthDate; - } - - public boolean hasBirthDateElement() { - return this.birthDate != null && !this.birthDate.isEmpty(); - } - - public boolean hasBirthDate() { - return this.birthDate != null && !this.birthDate.isEmpty(); - } - - /** - * @param value {@link #birthDate} (The date of birth for the individual.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value - */ - public Patient setBirthDateElement(DateType value) { - this.birthDate = value; - return this; - } - - /** - * @return The date of birth for the individual. - */ - public Date getBirthDate() { - return this.birthDate == null ? null : this.birthDate.getValue(); - } - - /** - * @param value The date of birth for the individual. - */ - public Patient setBirthDate(Date value) { - if (value == null) - this.birthDate = null; - else { - if (this.birthDate == null) - this.birthDate = new DateType(); - this.birthDate.setValue(value); - } - return this; - } - - /** - * @return {@link #deceased} (Indicates if the individual is deceased or not.) - */ - public Type getDeceased() { - return this.deceased; - } - - /** - * @return {@link #deceased} (Indicates if the individual is deceased or not.) - */ - public BooleanType getDeceasedBooleanType() throws Exception { - if (!(this.deceased instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.deceased.getClass().getName()+" was encountered"); - return (BooleanType) this.deceased; - } - - /** - * @return {@link #deceased} (Indicates if the individual is deceased or not.) - */ - public DateTimeType getDeceasedDateTimeType() throws Exception { - if (!(this.deceased instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.deceased.getClass().getName()+" was encountered"); - return (DateTimeType) this.deceased; - } - - public boolean hasDeceased() { - return this.deceased != null && !this.deceased.isEmpty(); - } - - /** - * @param value {@link #deceased} (Indicates if the individual is deceased or not.) - */ - public Patient setDeceased(Type value) { - this.deceased = value; - return this; - } - - /** - * @return {@link #address} (Addresses for the individual.) - */ - public List
getAddress() { - if (this.address == null) - this.address = new ArrayList
(); - return this.address; - } - - public boolean hasAddress() { - if (this.address == null) - return false; - for (Address item : this.address) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #address} (Addresses for the individual.) - */ - // syntactic sugar - public Address addAddress() { //3 - Address t = new Address(); - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return t; - } - - // syntactic sugar - public Patient addAddress(Address t) { //3 - if (t == null) - return this; - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return this; - } - - /** - * @return {@link #maritalStatus} (This field contains a patient's most recent marital (civil) status.) - */ - public CodeableConcept getMaritalStatus() { - if (this.maritalStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Patient.maritalStatus"); - else if (Configuration.doAutoCreate()) - this.maritalStatus = new CodeableConcept(); // cc - return this.maritalStatus; - } - - public boolean hasMaritalStatus() { - return this.maritalStatus != null && !this.maritalStatus.isEmpty(); - } - - /** - * @param value {@link #maritalStatus} (This field contains a patient's most recent marital (civil) status.) - */ - public Patient setMaritalStatus(CodeableConcept value) { - this.maritalStatus = value; - return this; - } - - /** - * @return {@link #multipleBirth} (Indicates whether the patient is part of a multiple or indicates the actual birth order.) - */ - public Type getMultipleBirth() { - return this.multipleBirth; - } - - /** - * @return {@link #multipleBirth} (Indicates whether the patient is part of a multiple or indicates the actual birth order.) - */ - public BooleanType getMultipleBirthBooleanType() throws Exception { - if (!(this.multipleBirth instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.multipleBirth.getClass().getName()+" was encountered"); - return (BooleanType) this.multipleBirth; - } - - /** - * @return {@link #multipleBirth} (Indicates whether the patient is part of a multiple or indicates the actual birth order.) - */ - public IntegerType getMultipleBirthIntegerType() throws Exception { - if (!(this.multipleBirth instanceof IntegerType)) - throw new Exception("Type mismatch: the type IntegerType was expected, but "+this.multipleBirth.getClass().getName()+" was encountered"); - return (IntegerType) this.multipleBirth; - } - - public boolean hasMultipleBirth() { - return this.multipleBirth != null && !this.multipleBirth.isEmpty(); - } - - /** - * @param value {@link #multipleBirth} (Indicates whether the patient is part of a multiple or indicates the actual birth order.) - */ - public Patient setMultipleBirth(Type value) { - this.multipleBirth = value; - return this; - } - - /** - * @return {@link #photo} (Image of the patient.) - */ - public List getPhoto() { - if (this.photo == null) - this.photo = new ArrayList(); - return this.photo; - } - - public boolean hasPhoto() { - if (this.photo == null) - return false; - for (Attachment item : this.photo) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #photo} (Image of the patient.) - */ - // syntactic sugar - public Attachment addPhoto() { //3 - Attachment t = new Attachment(); - if (this.photo == null) - this.photo = new ArrayList(); - this.photo.add(t); - return t; - } - - // syntactic sugar - public Patient addPhoto(Attachment t) { //3 - if (t == null) - return this; - if (this.photo == null) - this.photo = new ArrayList(); - this.photo.add(t); - return this; - } - - /** - * @return {@link #contact} (A contact party (e.g. guardian, partner, friend) for the patient.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (ContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (A contact party (e.g. guardian, partner, friend) for the patient.) - */ - // syntactic sugar - public ContactComponent addContact() { //3 - ContactComponent t = new ContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public Patient addContact(ContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #animal} (This element has a value if the patient is an animal.) - */ - public AnimalComponent getAnimal() { - if (this.animal == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Patient.animal"); - else if (Configuration.doAutoCreate()) - this.animal = new AnimalComponent(); // cc - return this.animal; - } - - public boolean hasAnimal() { - return this.animal != null && !this.animal.isEmpty(); - } - - /** - * @param value {@link #animal} (This element has a value if the patient is an animal.) - */ - public Patient setAnimal(AnimalComponent value) { - this.animal = value; - return this; - } - - /** - * @return {@link #communication} (Languages which may be used to communicate with the patient about his or her health.) - */ - public List getCommunication() { - if (this.communication == null) - this.communication = new ArrayList(); - return this.communication; - } - - public boolean hasCommunication() { - if (this.communication == null) - return false; - for (PatientCommunicationComponent item : this.communication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #communication} (Languages which may be used to communicate with the patient about his or her health.) - */ - // syntactic sugar - public PatientCommunicationComponent addCommunication() { //3 - PatientCommunicationComponent t = new PatientCommunicationComponent(); - if (this.communication == null) - this.communication = new ArrayList(); - this.communication.add(t); - return t; - } - - // syntactic sugar - public Patient addCommunication(PatientCommunicationComponent t) { //3 - if (t == null) - return this; - if (this.communication == null) - this.communication = new ArrayList(); - this.communication.add(t); - return this; - } - - /** - * @return {@link #careProvider} (Patient's nominated care provider.) - */ - public List getCareProvider() { - if (this.careProvider == null) - this.careProvider = new ArrayList(); - return this.careProvider; - } - - public boolean hasCareProvider() { - if (this.careProvider == null) - return false; - for (Reference item : this.careProvider) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #careProvider} (Patient's nominated care provider.) - */ - // syntactic sugar - public Reference addCareProvider() { //3 - Reference t = new Reference(); - if (this.careProvider == null) - this.careProvider = new ArrayList(); - this.careProvider.add(t); - return t; - } - - // syntactic sugar - public Patient addCareProvider(Reference t) { //3 - if (t == null) - return this; - if (this.careProvider == null) - this.careProvider = new ArrayList(); - this.careProvider.add(t); - return this; - } - - /** - * @return {@link #careProvider} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Patient's nominated care provider.) - */ - public List getCareProviderTarget() { - if (this.careProviderTarget == null) - this.careProviderTarget = new ArrayList(); - return this.careProviderTarget; - } - - /** - * @return {@link #managingOrganization} (Organization that is the custodian of the patient record.) - */ - public Reference getManagingOrganization() { - if (this.managingOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Patient.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganization = new Reference(); // cc - return this.managingOrganization; - } - - public boolean hasManagingOrganization() { - return this.managingOrganization != null && !this.managingOrganization.isEmpty(); - } - - /** - * @param value {@link #managingOrganization} (Organization that is the custodian of the patient record.) - */ - public Patient setManagingOrganization(Reference value) { - this.managingOrganization = value; - return this; - } - - /** - * @return {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Organization that is the custodian of the patient record.) - */ - public Organization getManagingOrganizationTarget() { - if (this.managingOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Patient.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganizationTarget = new Organization(); // aa - return this.managingOrganizationTarget; - } - - /** - * @param value {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Organization that is the custodian of the patient record.) - */ - public Patient setManagingOrganizationTarget(Organization value) { - this.managingOrganizationTarget = value; - return this; - } - - /** - * @return {@link #link} (Link to another patient resource that concerns the same actual patient.) - */ - public List getLink() { - if (this.link == null) - this.link = new ArrayList(); - return this.link; - } - - public boolean hasLink() { - if (this.link == null) - return false; - for (PatientLinkComponent item : this.link) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #link} (Link to another patient resource that concerns the same actual patient.) - */ - // syntactic sugar - public PatientLinkComponent addLink() { //3 - PatientLinkComponent t = new PatientLinkComponent(); - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return t; - } - - // syntactic sugar - public Patient addLink(PatientLinkComponent t) { //3 - if (t == null) - return this; - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return this; - } - - /** - * @return {@link #active} (Whether this patient record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public BooleanType getActiveElement() { - if (this.active == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Patient.active"); - else if (Configuration.doAutoCreate()) - this.active = new BooleanType(); // bb - return this.active; - } - - public boolean hasActiveElement() { - return this.active != null && !this.active.isEmpty(); - } - - public boolean hasActive() { - return this.active != null && !this.active.isEmpty(); - } - - /** - * @param value {@link #active} (Whether this patient record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public Patient setActiveElement(BooleanType value) { - this.active = value; - return this; - } - - /** - * @return Whether this patient record is in active use. - */ - public boolean getActive() { - return this.active == null || this.active.isEmpty() ? false : this.active.getValue(); - } - - /** - * @param value Whether this patient record is in active use. - */ - public Patient setActive(boolean value) { - if (this.active == null) - this.active = new BooleanType(); - this.active.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "An identifier for this patient.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("name", "HumanName", "A name associated with the individual.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); - childrenList.add(new Property("birthDate", "date", "The date of birth for the individual.", 0, java.lang.Integer.MAX_VALUE, birthDate)); - childrenList.add(new Property("deceased[x]", "boolean|dateTime", "Indicates if the individual is deceased or not.", 0, java.lang.Integer.MAX_VALUE, deceased)); - childrenList.add(new Property("address", "Address", "Addresses for the individual.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("maritalStatus", "CodeableConcept", "This field contains a patient's most recent marital (civil) status.", 0, java.lang.Integer.MAX_VALUE, maritalStatus)); - childrenList.add(new Property("multipleBirth[x]", "boolean|integer", "Indicates whether the patient is part of a multiple or indicates the actual birth order.", 0, java.lang.Integer.MAX_VALUE, multipleBirth)); - childrenList.add(new Property("photo", "Attachment", "Image of the patient.", 0, java.lang.Integer.MAX_VALUE, photo)); - childrenList.add(new Property("contact", "", "A contact party (e.g. guardian, partner, friend) for the patient.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("animal", "", "This element has a value if the patient is an animal.", 0, java.lang.Integer.MAX_VALUE, animal)); - childrenList.add(new Property("communication", "", "Languages which may be used to communicate with the patient about his or her health.", 0, java.lang.Integer.MAX_VALUE, communication)); - childrenList.add(new Property("careProvider", "Reference(Organization|Practitioner)", "Patient's nominated care provider.", 0, java.lang.Integer.MAX_VALUE, careProvider)); - childrenList.add(new Property("managingOrganization", "Reference(Organization)", "Organization that is the custodian of the patient record.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); - childrenList.add(new Property("link", "", "Link to another patient resource that concerns the same actual patient.", 0, java.lang.Integer.MAX_VALUE, link)); - childrenList.add(new Property("active", "boolean", "Whether this patient record is in active use.", 0, java.lang.Integer.MAX_VALUE, active)); - } - - public Patient copy() { - Patient dst = new Patient(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - if (name != null) { - dst.name = new ArrayList(); - for (HumanName i : name) - dst.name.add(i.copy()); - }; - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.gender = gender == null ? null : gender.copy(); - dst.birthDate = birthDate == null ? null : birthDate.copy(); - dst.deceased = deceased == null ? null : deceased.copy(); - if (address != null) { - dst.address = new ArrayList
(); - for (Address i : address) - dst.address.add(i.copy()); - }; - dst.maritalStatus = maritalStatus == null ? null : maritalStatus.copy(); - dst.multipleBirth = multipleBirth == null ? null : multipleBirth.copy(); - if (photo != null) { - dst.photo = new ArrayList(); - for (Attachment i : photo) - dst.photo.add(i.copy()); - }; - if (contact != null) { - dst.contact = new ArrayList(); - for (ContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.animal = animal == null ? null : animal.copy(); - if (communication != null) { - dst.communication = new ArrayList(); - for (PatientCommunicationComponent i : communication) - dst.communication.add(i.copy()); - }; - if (careProvider != null) { - dst.careProvider = new ArrayList(); - for (Reference i : careProvider) - dst.careProvider.add(i.copy()); - }; - dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); - if (link != null) { - dst.link = new ArrayList(); - for (PatientLinkComponent i : link) - dst.link.add(i.copy()); - }; - dst.active = active == null ? null : active.copy(); - return dst; - } - - protected Patient typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Patient)) - return false; - Patient o = (Patient) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) - && compareDeep(gender, o.gender, true) && compareDeep(birthDate, o.birthDate, true) && compareDeep(deceased, o.deceased, true) - && compareDeep(address, o.address, true) && compareDeep(maritalStatus, o.maritalStatus, true) && compareDeep(multipleBirth, o.multipleBirth, true) - && compareDeep(photo, o.photo, true) && compareDeep(contact, o.contact, true) && compareDeep(animal, o.animal, true) - && compareDeep(communication, o.communication, true) && compareDeep(careProvider, o.careProvider, true) - && compareDeep(managingOrganization, o.managingOrganization, true) && compareDeep(link, o.link, true) - && compareDeep(active, o.active, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Patient)) - return false; - Patient o = (Patient) other; - return compareValues(gender, o.gender, true) && compareValues(birthDate, o.birthDate, true) && compareValues(active, o.active, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) - && (telecom == null || telecom.isEmpty()) && (gender == null || gender.isEmpty()) && (birthDate == null || birthDate.isEmpty()) - && (deceased == null || deceased.isEmpty()) && (address == null || address.isEmpty()) && (maritalStatus == null || maritalStatus.isEmpty()) - && (multipleBirth == null || multipleBirth.isEmpty()) && (photo == null || photo.isEmpty()) - && (contact == null || contact.isEmpty()) && (animal == null || animal.isEmpty()) && (communication == null || communication.isEmpty()) - && (careProvider == null || careProvider.isEmpty()) && (managingOrganization == null || managingOrganization.isEmpty()) - && (link == null || link.isEmpty()) && (active == null || active.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Patient; - } - - @SearchParamDefinition(name="animal-breed", path="Patient.animal.breed", description="The breed for animal patients", type="token" ) - public static final String SP_ANIMALBREED = "animal-breed"; - @SearchParamDefinition(name="phonetic", path="", description="A portion of either family or given name using some kind of phonetic matching algorithm", type="string" ) - public static final String SP_PHONETIC = "phonetic"; - @SearchParamDefinition(name="link", path="Patient.link.other", description="All patients linked to the given patient", type="reference" ) - public static final String SP_LINK = "link"; - @SearchParamDefinition(name="animal-species", path="Patient.animal.species", description="The species for animal patients", type="token" ) - public static final String SP_ANIMALSPECIES = "animal-species"; - @SearchParamDefinition(name="deathdate", path="Patient.deceased[x]", description="The date of death has been provided and satisfies this search value", type="date" ) - public static final String SP_DEATHDATE = "deathdate"; - @SearchParamDefinition(name="organization", path="Patient.managingOrganization", description="The organization at which this person is a patient", type="reference" ) - public static final String SP_ORGANIZATION = "organization"; - @SearchParamDefinition(name="given", path="Patient.name.given", description="A portion of the given name of the patient", type="string" ) - public static final String SP_GIVEN = "given"; - @SearchParamDefinition(name="careprovider", path="Patient.careProvider", description="Patient's nominated care provider, could be a care manager, not the organization that manages the record", type="reference" ) - public static final String SP_CAREPROVIDER = "careprovider"; - @SearchParamDefinition(name="address", path="Patient.address", description="An address in any kind of address/part of the patient", type="string" ) - public static final String SP_ADDRESS = "address"; - @SearchParamDefinition(name="family", path="Patient.name.family", description="A portion of the family name of the patient", type="string" ) - public static final String SP_FAMILY = "family"; - @SearchParamDefinition(name="name", path="Patient.name", description="A portion of either family or given name of the patient", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="telecom", path="Patient.telecom", description="The value in any kind of telecom details of the patient", type="token" ) - public static final String SP_TELECOM = "telecom"; - @SearchParamDefinition(name="birthdate", path="Patient.birthDate", description="The patient's date of birth", type="date" ) - public static final String SP_BIRTHDATE = "birthdate"; - @SearchParamDefinition(name="active", path="Patient.active", description="Whether the patient record is active", type="token" ) - public static final String SP_ACTIVE = "active"; - @SearchParamDefinition(name="gender", path="Patient.gender", description="Gender of the patient", type="token" ) - public static final String SP_GENDER = "gender"; - @SearchParamDefinition(name="deceased", path="Patient.deceased[x]", description="This patient has been marked as deceased, or as a death date entered", type="token" ) - public static final String SP_DECEASED = "deceased"; - @SearchParamDefinition(name="language", path="Patient.communication.language", description="Language code (irrespective of use value)", type="token" ) - public static final String SP_LANGUAGE = "language"; - @SearchParamDefinition(name="identifier", path="Patient.identifier", description="A patient identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Demographics and other administrative information about an individual or animal receiving care or other health-related services. + */ +@ResourceDef(name="Patient", profile="http://hl7.org/fhir/Profile/Patient") +public class Patient extends DomainResource { + + public enum AdministrativeGender { + /** + * Male + */ + MALE, + /** + * Female + */ + FEMALE, + /** + * Other + */ + OTHER, + /** + * Unknown + */ + UNKNOWN, + /** + * added to help the parsers + */ + NULL; + public static AdministrativeGender fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return MALE; + if ("female".equals(codeString)) + return FEMALE; + if ("other".equals(codeString)) + return OTHER; + if ("unknown".equals(codeString)) + return UNKNOWN; + throw new Exception("Unknown AdministrativeGender code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case MALE: return "male"; + case FEMALE: return "female"; + case OTHER: return "other"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MALE: return ""; + case FEMALE: return ""; + case OTHER: return ""; + case UNKNOWN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MALE: return "Male"; + case FEMALE: return "Female"; + case OTHER: return "Other"; + case UNKNOWN: return "Unknown"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MALE: return "Male"; + case FEMALE: return "Female"; + case OTHER: return "Other"; + case UNKNOWN: return "Unknown"; + default: return "?"; + } + } + } + + public static class AdministrativeGenderEnumFactory implements EnumFactory { + public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return AdministrativeGender.MALE; + if ("female".equals(codeString)) + return AdministrativeGender.FEMALE; + if ("other".equals(codeString)) + return AdministrativeGender.OTHER; + if ("unknown".equals(codeString)) + return AdministrativeGender.UNKNOWN; + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); + } + public String toCode(AdministrativeGender code) { + if (code == AdministrativeGender.MALE) + return "male"; + if (code == AdministrativeGender.FEMALE) + return "female"; + if (code == AdministrativeGender.OTHER) + return "other"; + if (code == AdministrativeGender.UNKNOWN) + return "unknown"; + return "?"; + } + } + + public enum LinkType { + /** + * The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains the link. + */ + REPLACE, + /** + * The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information. + */ + REFER, + /** + * The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid. + */ + SEEALSO, + /** + * added to help the parsers + */ + NULL; + public static LinkType fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("replace".equals(codeString)) + return REPLACE; + if ("refer".equals(codeString)) + return REFER; + if ("seealso".equals(codeString)) + return SEEALSO; + throw new Exception("Unknown LinkType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case REPLACE: return "replace"; + case REFER: return "refer"; + case SEEALSO: return "seealso"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REPLACE: return ""; + case REFER: return ""; + case SEEALSO: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REPLACE: return "The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains the link."; + case REFER: return "The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information."; + case SEEALSO: return "The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REPLACE: return "replace"; + case REFER: return "refer"; + case SEEALSO: return "see also"; + default: return "?"; + } + } + } + + public static class LinkTypeEnumFactory implements EnumFactory { + public LinkType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("replace".equals(codeString)) + return LinkType.REPLACE; + if ("refer".equals(codeString)) + return LinkType.REFER; + if ("seealso".equals(codeString)) + return LinkType.SEEALSO; + throw new IllegalArgumentException("Unknown LinkType code '"+codeString+"'"); + } + public String toCode(LinkType code) { + if (code == LinkType.REPLACE) + return "replace"; + if (code == LinkType.REFER) + return "refer"; + if (code == LinkType.SEEALSO) + return "seealso"; + return "?"; + } + } + + @Block() + public static class ContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The nature of the relationship between the patient and the contact person. + */ + @Child(name = "relationship", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The kind of relationship", formalDefinition="The nature of the relationship between the patient and the contact person." ) + protected List relationship; + + /** + * A name associated with the contact person. + */ + @Child(name = "name", type = {HumanName.class}, order=2, min=0, max=1) + @Description(shortDefinition="A name associated with the contact person", formalDefinition="A name associated with the contact person." ) + protected HumanName name; + + /** + * A contact detail for the person, e.g. a telephone number or an email address. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." ) + protected List telecom; + + /** + * Address for the contact person. + */ + @Child(name = "address", type = {Address.class}, order=4, min=0, max=1) + @Description(shortDefinition="Address for the contact person", formalDefinition="Address for the contact person." ) + protected Address address; + + /** + * Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes. + */ + @Child(name = "gender", type = {CodeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes." ) + protected Enumeration gender; + + /** + * Organization on behalf of which the contact is acting or for which the contact is working. + */ + @Child(name = "organization", type = {Organization.class}, order=6, min=0, max=1) + @Description(shortDefinition="Organization that is associated with the contact", formalDefinition="Organization on behalf of which the contact is acting or for which the contact is working." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (Organization on behalf of which the contact is acting or for which the contact is working.) + */ + protected Organization organizationTarget; + + /** + * The period during which this contact person or organization is valid to be contacted relating to this patient. + */ + @Child(name = "period", type = {Period.class}, order=7, min=0, max=1) + @Description(shortDefinition="The period during which this contact person or organization is valid to be contacted relating to this patient", formalDefinition="The period during which this contact person or organization is valid to be contacted relating to this patient." ) + protected Period period; + + private static final long serialVersionUID = 364269017L; + + /* + * Constructor + */ + public ContactComponent() { + super(); + } + + /** + * @return {@link #relationship} (The nature of the relationship between the patient and the contact person.) + */ + public List getRelationship() { + if (this.relationship == null) + this.relationship = new ArrayList(); + return this.relationship; + } + + public boolean hasRelationship() { + if (this.relationship == null) + return false; + for (CodeableConcept item : this.relationship) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #relationship} (The nature of the relationship between the patient and the contact person.) + */ + // syntactic sugar + public CodeableConcept addRelationship() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.relationship == null) + this.relationship = new ArrayList(); + this.relationship.add(t); + return t; + } + + // syntactic sugar + public ContactComponent addRelationship(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.relationship == null) + this.relationship = new ArrayList(); + this.relationship.add(t); + return this; + } + + /** + * @return {@link #name} (A name associated with the contact person.) + */ + public HumanName getName() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new HumanName(); // cc + return this.name; + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A name associated with the contact person.) + */ + public ContactComponent setName(HumanName value) { + this.name = value; + return this; + } + + /** + * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public ContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @return {@link #address} (Address for the contact person.) + */ + public Address getAddress() { + if (this.address == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactComponent.address"); + else if (Configuration.doAutoCreate()) + this.address = new Address(); // cc + return this.address; + } + + public boolean hasAddress() { + return this.address != null && !this.address.isEmpty(); + } + + /** + * @param value {@link #address} (Address for the contact person.) + */ + public ContactComponent setAddress(Address value) { + this.address = value; + return this; + } + + /** + * @return {@link #gender} (Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Enumeration getGenderElement() { + if (this.gender == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactComponent.gender"); + else if (Configuration.doAutoCreate()) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb + return this.gender; + } + + public boolean hasGenderElement() { + return this.gender != null && !this.gender.isEmpty(); + } + + public boolean hasGender() { + return this.gender != null && !this.gender.isEmpty(); + } + + /** + * @param value {@link #gender} (Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public ContactComponent setGenderElement(Enumeration value) { + this.gender = value; + return this; + } + + /** + * @return Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes. + */ + public AdministrativeGender getGender() { + return this.gender == null ? null : this.gender.getValue(); + } + + /** + * @param value Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes. + */ + public ContactComponent setGender(AdministrativeGender value) { + if (value == null) + this.gender = null; + else { + if (this.gender == null) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); + this.gender.setValue(value); + } + return this; + } + + /** + * @return {@link #organization} (Organization on behalf of which the contact is acting or for which the contact is working.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); // cc + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (Organization on behalf of which the contact is acting or for which the contact is working.) + */ + public ContactComponent setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Organization on behalf of which the contact is acting or for which the contact is working.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); // aa + return this.organizationTarget; + } + + /** + * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Organization on behalf of which the contact is acting or for which the contact is working.) + */ + public ContactComponent setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #period} (The period during which this contact person or organization is valid to be contacted relating to this patient.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period during which this contact person or organization is valid to be contacted relating to this patient.) + */ + public ContactComponent setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("relationship", "CodeableConcept", "The nature of the relationship between the patient and the contact person.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("name", "HumanName", "A name associated with the contact person.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the person, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("address", "Address", "Address for the contact person.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); + childrenList.add(new Property("organization", "Reference(Organization)", "Organization on behalf of which the contact is acting or for which the contact is working.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("period", "Period", "The period during which this contact person or organization is valid to be contacted relating to this patient.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + public ContactComponent copy() { + ContactComponent dst = new ContactComponent(); + copyValues(dst); + if (relationship != null) { + dst.relationship = new ArrayList(); + for (CodeableConcept i : relationship) + dst.relationship.add(i.copy()); + }; + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.address = address == null ? null : address.copy(); + dst.gender = gender == null ? null : gender.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ContactComponent)) + return false; + ContactComponent o = (ContactComponent) other; + return compareDeep(relationship, o.relationship, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) + && compareDeep(address, o.address, true) && compareDeep(gender, o.gender, true) && compareDeep(organization, o.organization, true) + && compareDeep(period, o.period, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ContactComponent)) + return false; + ContactComponent o = (ContactComponent) other; + return compareValues(gender, o.gender, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (relationship == null || relationship.isEmpty()) && (name == null || name.isEmpty()) + && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) && (gender == null || gender.isEmpty()) + && (organization == null || organization.isEmpty()) && (period == null || period.isEmpty()) + ; + } + + } + + @Block() + public static class AnimalComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifies the high level taxonomic categorization of the kind of animal. + */ + @Child(name = "species", type = {CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="E.g. Dog, Cow", formalDefinition="Identifies the high level taxonomic categorization of the kind of animal." ) + protected CodeableConcept species; + + /** + * Identifies the detailed categorization of the kind of animal. + */ + @Child(name = "breed", type = {CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="E.g. Poodle, Angus", formalDefinition="Identifies the detailed categorization of the kind of animal." ) + protected CodeableConcept breed; + + /** + * Indicates the current state of the animal's reproductive organs. + */ + @Child(name = "genderStatus", type = {CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="E.g. Neutered, Intact", formalDefinition="Indicates the current state of the animal's reproductive organs." ) + protected CodeableConcept genderStatus; + + private static final long serialVersionUID = -549738382L; + + /* + * Constructor + */ + public AnimalComponent() { + super(); + } + + /* + * Constructor + */ + public AnimalComponent(CodeableConcept species) { + super(); + this.species = species; + } + + /** + * @return {@link #species} (Identifies the high level taxonomic categorization of the kind of animal.) + */ + public CodeableConcept getSpecies() { + if (this.species == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AnimalComponent.species"); + else if (Configuration.doAutoCreate()) + this.species = new CodeableConcept(); // cc + return this.species; + } + + public boolean hasSpecies() { + return this.species != null && !this.species.isEmpty(); + } + + /** + * @param value {@link #species} (Identifies the high level taxonomic categorization of the kind of animal.) + */ + public AnimalComponent setSpecies(CodeableConcept value) { + this.species = value; + return this; + } + + /** + * @return {@link #breed} (Identifies the detailed categorization of the kind of animal.) + */ + public CodeableConcept getBreed() { + if (this.breed == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AnimalComponent.breed"); + else if (Configuration.doAutoCreate()) + this.breed = new CodeableConcept(); // cc + return this.breed; + } + + public boolean hasBreed() { + return this.breed != null && !this.breed.isEmpty(); + } + + /** + * @param value {@link #breed} (Identifies the detailed categorization of the kind of animal.) + */ + public AnimalComponent setBreed(CodeableConcept value) { + this.breed = value; + return this; + } + + /** + * @return {@link #genderStatus} (Indicates the current state of the animal's reproductive organs.) + */ + public CodeableConcept getGenderStatus() { + if (this.genderStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AnimalComponent.genderStatus"); + else if (Configuration.doAutoCreate()) + this.genderStatus = new CodeableConcept(); // cc + return this.genderStatus; + } + + public boolean hasGenderStatus() { + return this.genderStatus != null && !this.genderStatus.isEmpty(); + } + + /** + * @param value {@link #genderStatus} (Indicates the current state of the animal's reproductive organs.) + */ + public AnimalComponent setGenderStatus(CodeableConcept value) { + this.genderStatus = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("species", "CodeableConcept", "Identifies the high level taxonomic categorization of the kind of animal.", 0, java.lang.Integer.MAX_VALUE, species)); + childrenList.add(new Property("breed", "CodeableConcept", "Identifies the detailed categorization of the kind of animal.", 0, java.lang.Integer.MAX_VALUE, breed)); + childrenList.add(new Property("genderStatus", "CodeableConcept", "Indicates the current state of the animal's reproductive organs.", 0, java.lang.Integer.MAX_VALUE, genderStatus)); + } + + public AnimalComponent copy() { + AnimalComponent dst = new AnimalComponent(); + copyValues(dst); + dst.species = species == null ? null : species.copy(); + dst.breed = breed == null ? null : breed.copy(); + dst.genderStatus = genderStatus == null ? null : genderStatus.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AnimalComponent)) + return false; + AnimalComponent o = (AnimalComponent) other; + return compareDeep(species, o.species, true) && compareDeep(breed, o.breed, true) && compareDeep(genderStatus, o.genderStatus, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AnimalComponent)) + return false; + AnimalComponent o = (AnimalComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (species == null || species.isEmpty()) && (breed == null || breed.isEmpty()) + && (genderStatus == null || genderStatus.isEmpty()); + } + + } + + @Block() + public static class PatientCommunicationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case. E.g. "en" for English, or "en-US" for American English versus "en-EN" for England English. + */ + @Child(name = "language", type = {CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="The language which can be used to communicate with the patient about his or her health", formalDefinition="The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case. E.g. 'en' for English, or 'en-US' for American English versus 'en-EN' for England English." ) + protected CodeableConcept language; + + /** + * Indicates whether or not the Patient prefers this language (over other languages he masters up a certain level). + */ + @Child(name = "preferred", type = {BooleanType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Language preference indicator", formalDefinition="Indicates whether or not the Patient prefers this language (over other languages he masters up a certain level)." ) + protected BooleanType preferred; + + private static final long serialVersionUID = 633792918L; + + /* + * Constructor + */ + public PatientCommunicationComponent() { + super(); + } + + /* + * Constructor + */ + public PatientCommunicationComponent(CodeableConcept language) { + super(); + this.language = language; + } + + /** + * @return {@link #language} (The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case. E.g. "en" for English, or "en-US" for American English versus "en-EN" for England English.) + */ + public CodeableConcept getLanguage() { + if (this.language == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PatientCommunicationComponent.language"); + else if (Configuration.doAutoCreate()) + this.language = new CodeableConcept(); // cc + return this.language; + } + + public boolean hasLanguage() { + return this.language != null && !this.language.isEmpty(); + } + + /** + * @param value {@link #language} (The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case. E.g. "en" for English, or "en-US" for American English versus "en-EN" for England English.) + */ + public PatientCommunicationComponent setLanguage(CodeableConcept value) { + this.language = value; + return this; + } + + /** + * @return {@link #preferred} (Indicates whether or not the Patient prefers this language (over other languages he masters up a certain level).). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value + */ + public BooleanType getPreferredElement() { + if (this.preferred == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PatientCommunicationComponent.preferred"); + else if (Configuration.doAutoCreate()) + this.preferred = new BooleanType(); // bb + return this.preferred; + } + + public boolean hasPreferredElement() { + return this.preferred != null && !this.preferred.isEmpty(); + } + + public boolean hasPreferred() { + return this.preferred != null && !this.preferred.isEmpty(); + } + + /** + * @param value {@link #preferred} (Indicates whether or not the Patient prefers this language (over other languages he masters up a certain level).). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value + */ + public PatientCommunicationComponent setPreferredElement(BooleanType value) { + this.preferred = value; + return this; + } + + /** + * @return Indicates whether or not the Patient prefers this language (over other languages he masters up a certain level). + */ + public boolean getPreferred() { + return this.preferred == null || this.preferred.isEmpty() ? false : this.preferred.getValue(); + } + + /** + * @param value Indicates whether or not the Patient prefers this language (over other languages he masters up a certain level). + */ + public PatientCommunicationComponent setPreferred(boolean value) { + if (this.preferred == null) + this.preferred = new BooleanType(); + this.preferred.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("language", "CodeableConcept", "The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case. E.g. 'en' for English, or 'en-US' for American English versus 'en-EN' for England English.", 0, java.lang.Integer.MAX_VALUE, language)); + childrenList.add(new Property("preferred", "boolean", "Indicates whether or not the Patient prefers this language (over other languages he masters up a certain level).", 0, java.lang.Integer.MAX_VALUE, preferred)); + } + + public PatientCommunicationComponent copy() { + PatientCommunicationComponent dst = new PatientCommunicationComponent(); + copyValues(dst); + dst.language = language == null ? null : language.copy(); + dst.preferred = preferred == null ? null : preferred.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof PatientCommunicationComponent)) + return false; + PatientCommunicationComponent o = (PatientCommunicationComponent) other; + return compareDeep(language, o.language, true) && compareDeep(preferred, o.preferred, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof PatientCommunicationComponent)) + return false; + PatientCommunicationComponent o = (PatientCommunicationComponent) other; + return compareValues(preferred, o.preferred, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (language == null || language.isEmpty()) && (preferred == null || preferred.isEmpty()) + ; + } + + } + + @Block() + public static class PatientLinkComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The other patient resource that the link refers to. + */ + @Child(name = "other", type = {Patient.class}, order=1, min=1, max=1) + @Description(shortDefinition="The other patient resource that the link refers to", formalDefinition="The other patient resource that the link refers to." ) + protected Reference other; + + /** + * The actual object that is the target of the reference (The other patient resource that the link refers to.) + */ + protected Patient otherTarget; + + /** + * The type of link between this patient resource and another patient resource. + */ + @Child(name = "type", type = {CodeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="replace | refer | seealso - type of link", formalDefinition="The type of link between this patient resource and another patient resource." ) + protected Enumeration type; + + private static final long serialVersionUID = -1942104050L; + + /* + * Constructor + */ + public PatientLinkComponent() { + super(); + } + + /* + * Constructor + */ + public PatientLinkComponent(Reference other, Enumeration type) { + super(); + this.other = other; + this.type = type; + } + + /** + * @return {@link #other} (The other patient resource that the link refers to.) + */ + public Reference getOther() { + if (this.other == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PatientLinkComponent.other"); + else if (Configuration.doAutoCreate()) + this.other = new Reference(); // cc + return this.other; + } + + public boolean hasOther() { + return this.other != null && !this.other.isEmpty(); + } + + /** + * @param value {@link #other} (The other patient resource that the link refers to.) + */ + public PatientLinkComponent setOther(Reference value) { + this.other = value; + return this; + } + + /** + * @return {@link #other} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The other patient resource that the link refers to.) + */ + public Patient getOtherTarget() { + if (this.otherTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PatientLinkComponent.other"); + else if (Configuration.doAutoCreate()) + this.otherTarget = new Patient(); // aa + return this.otherTarget; + } + + /** + * @param value {@link #other} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The other patient resource that the link refers to.) + */ + public PatientLinkComponent setOtherTarget(Patient value) { + this.otherTarget = value; + return this; + } + + /** + * @return {@link #type} (The type of link between this patient resource and another patient resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PatientLinkComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new LinkTypeEnumFactory()); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of link between this patient resource and another patient resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public PatientLinkComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The type of link between this patient resource and another patient resource. + */ + public LinkType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of link between this patient resource and another patient resource. + */ + public PatientLinkComponent setType(LinkType value) { + if (this.type == null) + this.type = new Enumeration(new LinkTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("other", "Reference(Patient)", "The other patient resource that the link refers to.", 0, java.lang.Integer.MAX_VALUE, other)); + childrenList.add(new Property("type", "code", "The type of link between this patient resource and another patient resource.", 0, java.lang.Integer.MAX_VALUE, type)); + } + + public PatientLinkComponent copy() { + PatientLinkComponent dst = new PatientLinkComponent(); + copyValues(dst); + dst.other = other == null ? null : other.copy(); + dst.type = type == null ? null : type.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof PatientLinkComponent)) + return false; + PatientLinkComponent o = (PatientLinkComponent) other; + return compareDeep(other, o.other, true) && compareDeep(type, o.type, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof PatientLinkComponent)) + return false; + PatientLinkComponent o = (PatientLinkComponent) other; + return compareValues(type, o.type, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (other == null || other.isEmpty()) && (type == null || type.isEmpty()) + ; + } + + } + + /** + * An identifier for this patient. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="An identifier for this patient", formalDefinition="An identifier for this patient." ) + protected List identifier; + + /** + * A name associated with the individual. + */ + @Child(name = "name", type = {HumanName.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A name associated with the patient", formalDefinition="A name associated with the individual." ) + protected List name; + + /** + * A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A contact detail for the individual", formalDefinition="A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted." ) + protected List telecom; + + /** + * Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. + */ + @Child(name = "gender", type = {CodeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes." ) + protected Enumeration gender; + + /** + * The date of birth for the individual. + */ + @Child(name = "birthDate", type = {DateType.class}, order=4, min=0, max=1) + @Description(shortDefinition="The date of birth for the individual", formalDefinition="The date of birth for the individual." ) + protected DateType birthDate; + + /** + * Indicates if the individual is deceased or not. + */ + @Child(name = "deceased", type = {BooleanType.class, DateTimeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Indicates if the individual is deceased or not", formalDefinition="Indicates if the individual is deceased or not." ) + protected Type deceased; + + /** + * Addresses for the individual. + */ + @Child(name = "address", type = {Address.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Addresses for the individual", formalDefinition="Addresses for the individual." ) + protected List
address; + + /** + * This field contains a patient's most recent marital (civil) status. + */ + @Child(name = "maritalStatus", type = {CodeableConcept.class}, order=7, min=0, max=1) + @Description(shortDefinition="Marital (civil) status of a patient", formalDefinition="This field contains a patient's most recent marital (civil) status." ) + protected CodeableConcept maritalStatus; + + /** + * Indicates whether the patient is part of a multiple or indicates the actual birth order. + */ + @Child(name = "multipleBirth", type = {BooleanType.class, IntegerType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Whether patient is part of a multiple birth", formalDefinition="Indicates whether the patient is part of a multiple or indicates the actual birth order." ) + protected Type multipleBirth; + + /** + * Image of the patient. + */ + @Child(name = "photo", type = {Attachment.class}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Image of the patient", formalDefinition="Image of the patient." ) + protected List photo; + + /** + * A contact party (e.g. guardian, partner, friend) for the patient. + */ + @Child(name = "contact", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A contact party (e.g. guardian, partner, friend) for the patient", formalDefinition="A contact party (e.g. guardian, partner, friend) for the patient." ) + protected List contact; + + /** + * This element has a value if the patient is an animal. + */ + @Child(name = "animal", type = {}, order=11, min=0, max=1) + @Description(shortDefinition="If this patient is an animal (non-human)", formalDefinition="This element has a value if the patient is an animal." ) + protected AnimalComponent animal; + + /** + * Languages which may be used to communicate with the patient about his or her health. + */ + @Child(name = "communication", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A list of Languages which may be used to communicate with the patient about his or her health", formalDefinition="Languages which may be used to communicate with the patient about his or her health." ) + protected List communication; + + /** + * Patient's nominated care provider. + */ + @Child(name = "careProvider", type = {Organization.class, Practitioner.class}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Patient's nominated care provider", formalDefinition="Patient's nominated care provider." ) + protected List careProvider; + /** + * The actual objects that are the target of the reference (Patient's nominated care provider.) + */ + protected List careProviderTarget; + + + /** + * Organization that is the custodian of the patient record. + */ + @Child(name = "managingOrganization", type = {Organization.class}, order=14, min=0, max=1) + @Description(shortDefinition="Organization that is the custodian of the patient record", formalDefinition="Organization that is the custodian of the patient record." ) + protected Reference managingOrganization; + + /** + * The actual object that is the target of the reference (Organization that is the custodian of the patient record.) + */ + protected Organization managingOrganizationTarget; + + /** + * Link to another patient resource that concerns the same actual patient. + */ + @Child(name = "link", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Link to another patient resource that concerns the same actual person", formalDefinition="Link to another patient resource that concerns the same actual patient." ) + protected List link; + + /** + * Whether this patient record is in active use. + */ + @Child(name = "active", type = {BooleanType.class}, order=16, min=0, max=1) + @Description(shortDefinition="Whether this patient's record is in active use", formalDefinition="Whether this patient record is in active use." ) + protected BooleanType active; + + private static final long serialVersionUID = 2057666410L; + + /* + * Constructor + */ + public Patient() { + super(); + } + + /** + * @return {@link #identifier} (An identifier for this patient.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (An identifier for this patient.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Patient addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #name} (A name associated with the individual.) + */ + public List getName() { + if (this.name == null) + this.name = new ArrayList(); + return this.name; + } + + public boolean hasName() { + if (this.name == null) + return false; + for (HumanName item : this.name) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #name} (A name associated with the individual.) + */ + // syntactic sugar + public HumanName addName() { //3 + HumanName t = new HumanName(); + if (this.name == null) + this.name = new ArrayList(); + this.name.add(t); + return t; + } + + // syntactic sugar + public Patient addName(HumanName t) { //3 + if (t == null) + return this; + if (this.name == null) + this.name = new ArrayList(); + this.name.add(t); + return this; + } + + /** + * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public Patient addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @return {@link #gender} (Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Enumeration getGenderElement() { + if (this.gender == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Patient.gender"); + else if (Configuration.doAutoCreate()) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb + return this.gender; + } + + public boolean hasGenderElement() { + return this.gender != null && !this.gender.isEmpty(); + } + + public boolean hasGender() { + return this.gender != null && !this.gender.isEmpty(); + } + + /** + * @param value {@link #gender} (Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Patient setGenderElement(Enumeration value) { + this.gender = value; + return this; + } + + /** + * @return Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. + */ + public AdministrativeGender getGender() { + return this.gender == null ? null : this.gender.getValue(); + } + + /** + * @param value Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. + */ + public Patient setGender(AdministrativeGender value) { + if (value == null) + this.gender = null; + else { + if (this.gender == null) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); + this.gender.setValue(value); + } + return this; + } + + /** + * @return {@link #birthDate} (The date of birth for the individual.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value + */ + public DateType getBirthDateElement() { + if (this.birthDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Patient.birthDate"); + else if (Configuration.doAutoCreate()) + this.birthDate = new DateType(); // bb + return this.birthDate; + } + + public boolean hasBirthDateElement() { + return this.birthDate != null && !this.birthDate.isEmpty(); + } + + public boolean hasBirthDate() { + return this.birthDate != null && !this.birthDate.isEmpty(); + } + + /** + * @param value {@link #birthDate} (The date of birth for the individual.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value + */ + public Patient setBirthDateElement(DateType value) { + this.birthDate = value; + return this; + } + + /** + * @return The date of birth for the individual. + */ + public Date getBirthDate() { + return this.birthDate == null ? null : this.birthDate.getValue(); + } + + /** + * @param value The date of birth for the individual. + */ + public Patient setBirthDate(Date value) { + if (value == null) + this.birthDate = null; + else { + if (this.birthDate == null) + this.birthDate = new DateType(); + this.birthDate.setValue(value); + } + return this; + } + + /** + * @return {@link #deceased} (Indicates if the individual is deceased or not.) + */ + public Type getDeceased() { + return this.deceased; + } + + /** + * @return {@link #deceased} (Indicates if the individual is deceased or not.) + */ + public BooleanType getDeceasedBooleanType() throws Exception { + if (!(this.deceased instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.deceased.getClass().getName()+" was encountered"); + return (BooleanType) this.deceased; + } + + /** + * @return {@link #deceased} (Indicates if the individual is deceased or not.) + */ + public DateTimeType getDeceasedDateTimeType() throws Exception { + if (!(this.deceased instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.deceased.getClass().getName()+" was encountered"); + return (DateTimeType) this.deceased; + } + + public boolean hasDeceased() { + return this.deceased != null && !this.deceased.isEmpty(); + } + + /** + * @param value {@link #deceased} (Indicates if the individual is deceased or not.) + */ + public Patient setDeceased(Type value) { + this.deceased = value; + return this; + } + + /** + * @return {@link #address} (Addresses for the individual.) + */ + public List
getAddress() { + if (this.address == null) + this.address = new ArrayList
(); + return this.address; + } + + public boolean hasAddress() { + if (this.address == null) + return false; + for (Address item : this.address) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #address} (Addresses for the individual.) + */ + // syntactic sugar + public Address addAddress() { //3 + Address t = new Address(); + if (this.address == null) + this.address = new ArrayList
(); + this.address.add(t); + return t; + } + + // syntactic sugar + public Patient addAddress(Address t) { //3 + if (t == null) + return this; + if (this.address == null) + this.address = new ArrayList
(); + this.address.add(t); + return this; + } + + /** + * @return {@link #maritalStatus} (This field contains a patient's most recent marital (civil) status.) + */ + public CodeableConcept getMaritalStatus() { + if (this.maritalStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Patient.maritalStatus"); + else if (Configuration.doAutoCreate()) + this.maritalStatus = new CodeableConcept(); // cc + return this.maritalStatus; + } + + public boolean hasMaritalStatus() { + return this.maritalStatus != null && !this.maritalStatus.isEmpty(); + } + + /** + * @param value {@link #maritalStatus} (This field contains a patient's most recent marital (civil) status.) + */ + public Patient setMaritalStatus(CodeableConcept value) { + this.maritalStatus = value; + return this; + } + + /** + * @return {@link #multipleBirth} (Indicates whether the patient is part of a multiple or indicates the actual birth order.) + */ + public Type getMultipleBirth() { + return this.multipleBirth; + } + + /** + * @return {@link #multipleBirth} (Indicates whether the patient is part of a multiple or indicates the actual birth order.) + */ + public BooleanType getMultipleBirthBooleanType() throws Exception { + if (!(this.multipleBirth instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.multipleBirth.getClass().getName()+" was encountered"); + return (BooleanType) this.multipleBirth; + } + + /** + * @return {@link #multipleBirth} (Indicates whether the patient is part of a multiple or indicates the actual birth order.) + */ + public IntegerType getMultipleBirthIntegerType() throws Exception { + if (!(this.multipleBirth instanceof IntegerType)) + throw new Exception("Type mismatch: the type IntegerType was expected, but "+this.multipleBirth.getClass().getName()+" was encountered"); + return (IntegerType) this.multipleBirth; + } + + public boolean hasMultipleBirth() { + return this.multipleBirth != null && !this.multipleBirth.isEmpty(); + } + + /** + * @param value {@link #multipleBirth} (Indicates whether the patient is part of a multiple or indicates the actual birth order.) + */ + public Patient setMultipleBirth(Type value) { + this.multipleBirth = value; + return this; + } + + /** + * @return {@link #photo} (Image of the patient.) + */ + public List getPhoto() { + if (this.photo == null) + this.photo = new ArrayList(); + return this.photo; + } + + public boolean hasPhoto() { + if (this.photo == null) + return false; + for (Attachment item : this.photo) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #photo} (Image of the patient.) + */ + // syntactic sugar + public Attachment addPhoto() { //3 + Attachment t = new Attachment(); + if (this.photo == null) + this.photo = new ArrayList(); + this.photo.add(t); + return t; + } + + // syntactic sugar + public Patient addPhoto(Attachment t) { //3 + if (t == null) + return this; + if (this.photo == null) + this.photo = new ArrayList(); + this.photo.add(t); + return this; + } + + /** + * @return {@link #contact} (A contact party (e.g. guardian, partner, friend) for the patient.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (ContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (A contact party (e.g. guardian, partner, friend) for the patient.) + */ + // syntactic sugar + public ContactComponent addContact() { //3 + ContactComponent t = new ContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public Patient addContact(ContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #animal} (This element has a value if the patient is an animal.) + */ + public AnimalComponent getAnimal() { + if (this.animal == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Patient.animal"); + else if (Configuration.doAutoCreate()) + this.animal = new AnimalComponent(); // cc + return this.animal; + } + + public boolean hasAnimal() { + return this.animal != null && !this.animal.isEmpty(); + } + + /** + * @param value {@link #animal} (This element has a value if the patient is an animal.) + */ + public Patient setAnimal(AnimalComponent value) { + this.animal = value; + return this; + } + + /** + * @return {@link #communication} (Languages which may be used to communicate with the patient about his or her health.) + */ + public List getCommunication() { + if (this.communication == null) + this.communication = new ArrayList(); + return this.communication; + } + + public boolean hasCommunication() { + if (this.communication == null) + return false; + for (PatientCommunicationComponent item : this.communication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #communication} (Languages which may be used to communicate with the patient about his or her health.) + */ + // syntactic sugar + public PatientCommunicationComponent addCommunication() { //3 + PatientCommunicationComponent t = new PatientCommunicationComponent(); + if (this.communication == null) + this.communication = new ArrayList(); + this.communication.add(t); + return t; + } + + // syntactic sugar + public Patient addCommunication(PatientCommunicationComponent t) { //3 + if (t == null) + return this; + if (this.communication == null) + this.communication = new ArrayList(); + this.communication.add(t); + return this; + } + + /** + * @return {@link #careProvider} (Patient's nominated care provider.) + */ + public List getCareProvider() { + if (this.careProvider == null) + this.careProvider = new ArrayList(); + return this.careProvider; + } + + public boolean hasCareProvider() { + if (this.careProvider == null) + return false; + for (Reference item : this.careProvider) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #careProvider} (Patient's nominated care provider.) + */ + // syntactic sugar + public Reference addCareProvider() { //3 + Reference t = new Reference(); + if (this.careProvider == null) + this.careProvider = new ArrayList(); + this.careProvider.add(t); + return t; + } + + // syntactic sugar + public Patient addCareProvider(Reference t) { //3 + if (t == null) + return this; + if (this.careProvider == null) + this.careProvider = new ArrayList(); + this.careProvider.add(t); + return this; + } + + /** + * @return {@link #careProvider} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Patient's nominated care provider.) + */ + public List getCareProviderTarget() { + if (this.careProviderTarget == null) + this.careProviderTarget = new ArrayList(); + return this.careProviderTarget; + } + + /** + * @return {@link #managingOrganization} (Organization that is the custodian of the patient record.) + */ + public Reference getManagingOrganization() { + if (this.managingOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Patient.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganization = new Reference(); // cc + return this.managingOrganization; + } + + public boolean hasManagingOrganization() { + return this.managingOrganization != null && !this.managingOrganization.isEmpty(); + } + + /** + * @param value {@link #managingOrganization} (Organization that is the custodian of the patient record.) + */ + public Patient setManagingOrganization(Reference value) { + this.managingOrganization = value; + return this; + } + + /** + * @return {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Organization that is the custodian of the patient record.) + */ + public Organization getManagingOrganizationTarget() { + if (this.managingOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Patient.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganizationTarget = new Organization(); // aa + return this.managingOrganizationTarget; + } + + /** + * @param value {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Organization that is the custodian of the patient record.) + */ + public Patient setManagingOrganizationTarget(Organization value) { + this.managingOrganizationTarget = value; + return this; + } + + /** + * @return {@link #link} (Link to another patient resource that concerns the same actual patient.) + */ + public List getLink() { + if (this.link == null) + this.link = new ArrayList(); + return this.link; + } + + public boolean hasLink() { + if (this.link == null) + return false; + for (PatientLinkComponent item : this.link) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #link} (Link to another patient resource that concerns the same actual patient.) + */ + // syntactic sugar + public PatientLinkComponent addLink() { //3 + PatientLinkComponent t = new PatientLinkComponent(); + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return t; + } + + // syntactic sugar + public Patient addLink(PatientLinkComponent t) { //3 + if (t == null) + return this; + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return this; + } + + /** + * @return {@link #active} (Whether this patient record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value + */ + public BooleanType getActiveElement() { + if (this.active == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Patient.active"); + else if (Configuration.doAutoCreate()) + this.active = new BooleanType(); // bb + return this.active; + } + + public boolean hasActiveElement() { + return this.active != null && !this.active.isEmpty(); + } + + public boolean hasActive() { + return this.active != null && !this.active.isEmpty(); + } + + /** + * @param value {@link #active} (Whether this patient record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value + */ + public Patient setActiveElement(BooleanType value) { + this.active = value; + return this; + } + + /** + * @return Whether this patient record is in active use. + */ + public boolean getActive() { + return this.active == null || this.active.isEmpty() ? false : this.active.getValue(); + } + + /** + * @param value Whether this patient record is in active use. + */ + public Patient setActive(boolean value) { + if (this.active == null) + this.active = new BooleanType(); + this.active.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "An identifier for this patient.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("name", "HumanName", "A name associated with the individual.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); + childrenList.add(new Property("birthDate", "date", "The date of birth for the individual.", 0, java.lang.Integer.MAX_VALUE, birthDate)); + childrenList.add(new Property("deceased[x]", "boolean|dateTime", "Indicates if the individual is deceased or not.", 0, java.lang.Integer.MAX_VALUE, deceased)); + childrenList.add(new Property("address", "Address", "Addresses for the individual.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("maritalStatus", "CodeableConcept", "This field contains a patient's most recent marital (civil) status.", 0, java.lang.Integer.MAX_VALUE, maritalStatus)); + childrenList.add(new Property("multipleBirth[x]", "boolean|integer", "Indicates whether the patient is part of a multiple or indicates the actual birth order.", 0, java.lang.Integer.MAX_VALUE, multipleBirth)); + childrenList.add(new Property("photo", "Attachment", "Image of the patient.", 0, java.lang.Integer.MAX_VALUE, photo)); + childrenList.add(new Property("contact", "", "A contact party (e.g. guardian, partner, friend) for the patient.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("animal", "", "This element has a value if the patient is an animal.", 0, java.lang.Integer.MAX_VALUE, animal)); + childrenList.add(new Property("communication", "", "Languages which may be used to communicate with the patient about his or her health.", 0, java.lang.Integer.MAX_VALUE, communication)); + childrenList.add(new Property("careProvider", "Reference(Organization|Practitioner)", "Patient's nominated care provider.", 0, java.lang.Integer.MAX_VALUE, careProvider)); + childrenList.add(new Property("managingOrganization", "Reference(Organization)", "Organization that is the custodian of the patient record.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); + childrenList.add(new Property("link", "", "Link to another patient resource that concerns the same actual patient.", 0, java.lang.Integer.MAX_VALUE, link)); + childrenList.add(new Property("active", "boolean", "Whether this patient record is in active use.", 0, java.lang.Integer.MAX_VALUE, active)); + } + + public Patient copy() { + Patient dst = new Patient(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + if (name != null) { + dst.name = new ArrayList(); + for (HumanName i : name) + dst.name.add(i.copy()); + }; + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.gender = gender == null ? null : gender.copy(); + dst.birthDate = birthDate == null ? null : birthDate.copy(); + dst.deceased = deceased == null ? null : deceased.copy(); + if (address != null) { + dst.address = new ArrayList
(); + for (Address i : address) + dst.address.add(i.copy()); + }; + dst.maritalStatus = maritalStatus == null ? null : maritalStatus.copy(); + dst.multipleBirth = multipleBirth == null ? null : multipleBirth.copy(); + if (photo != null) { + dst.photo = new ArrayList(); + for (Attachment i : photo) + dst.photo.add(i.copy()); + }; + if (contact != null) { + dst.contact = new ArrayList(); + for (ContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.animal = animal == null ? null : animal.copy(); + if (communication != null) { + dst.communication = new ArrayList(); + for (PatientCommunicationComponent i : communication) + dst.communication.add(i.copy()); + }; + if (careProvider != null) { + dst.careProvider = new ArrayList(); + for (Reference i : careProvider) + dst.careProvider.add(i.copy()); + }; + dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); + if (link != null) { + dst.link = new ArrayList(); + for (PatientLinkComponent i : link) + dst.link.add(i.copy()); + }; + dst.active = active == null ? null : active.copy(); + return dst; + } + + protected Patient typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Patient)) + return false; + Patient o = (Patient) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) + && compareDeep(gender, o.gender, true) && compareDeep(birthDate, o.birthDate, true) && compareDeep(deceased, o.deceased, true) + && compareDeep(address, o.address, true) && compareDeep(maritalStatus, o.maritalStatus, true) && compareDeep(multipleBirth, o.multipleBirth, true) + && compareDeep(photo, o.photo, true) && compareDeep(contact, o.contact, true) && compareDeep(animal, o.animal, true) + && compareDeep(communication, o.communication, true) && compareDeep(careProvider, o.careProvider, true) + && compareDeep(managingOrganization, o.managingOrganization, true) && compareDeep(link, o.link, true) + && compareDeep(active, o.active, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Patient)) + return false; + Patient o = (Patient) other; + return compareValues(gender, o.gender, true) && compareValues(birthDate, o.birthDate, true) && compareValues(active, o.active, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) + && (telecom == null || telecom.isEmpty()) && (gender == null || gender.isEmpty()) && (birthDate == null || birthDate.isEmpty()) + && (deceased == null || deceased.isEmpty()) && (address == null || address.isEmpty()) && (maritalStatus == null || maritalStatus.isEmpty()) + && (multipleBirth == null || multipleBirth.isEmpty()) && (photo == null || photo.isEmpty()) + && (contact == null || contact.isEmpty()) && (animal == null || animal.isEmpty()) && (communication == null || communication.isEmpty()) + && (careProvider == null || careProvider.isEmpty()) && (managingOrganization == null || managingOrganization.isEmpty()) + && (link == null || link.isEmpty()) && (active == null || active.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Patient; + } + + @SearchParamDefinition(name="identifier", path="Patient.identifier", description="A patient identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="given", path="Patient.name.given", description="A portion of the given name of the patient", type="string" ) + public static final String SP_GIVEN = "given"; + @SearchParamDefinition(name="address", path="Patient.address", description="An address in any kind of address/part of the patient", type="string" ) + public static final String SP_ADDRESS = "address"; + @SearchParamDefinition(name="birthdate", path="Patient.birthDate", description="The patient's date of birth", type="date" ) + public static final String SP_BIRTHDATE = "birthdate"; + @SearchParamDefinition(name="deceased", path="Patient.deceased[x]", description="This patient has been marked as deceased, or as a death date entered", type="token" ) + public static final String SP_DECEASED = "deceased"; + @SearchParamDefinition(name="gender", path="Patient.gender", description="Gender of the patient", type="token" ) + public static final String SP_GENDER = "gender"; + @SearchParamDefinition(name="animal-species", path="Patient.animal.species", description="The species for animal patients", type="token" ) + public static final String SP_ANIMALSPECIES = "animal-species"; + @SearchParamDefinition(name="link", path="Patient.link.other", description="All patients linked to the given patient", type="reference" ) + public static final String SP_LINK = "link"; + @SearchParamDefinition(name="active", path="Patient.active", description="Whether the patient record is active", type="token" ) + public static final String SP_ACTIVE = "active"; + @SearchParamDefinition(name="language", path="Patient.communication.language", description="Language code (irrespective of use value)", type="token" ) + public static final String SP_LANGUAGE = "language"; + @SearchParamDefinition(name="deathdate", path="Patient.deceased[x]", description="The date of death has been provided and satisfies this search value", type="date" ) + public static final String SP_DEATHDATE = "deathdate"; + @SearchParamDefinition(name="animal-breed", path="Patient.animal.breed", description="The breed for animal patients", type="token" ) + public static final String SP_ANIMALBREED = "animal-breed"; + @SearchParamDefinition(name="careprovider", path="Patient.careProvider", description="Patient's nominated care provider, could be a care manager, not the organization that manages the record", type="reference" ) + public static final String SP_CAREPROVIDER = "careprovider"; + @SearchParamDefinition(name="phonetic", path="", description="A portion of either family or given name using some kind of phonetic matching algorithm", type="string" ) + public static final String SP_PHONETIC = "phonetic"; + @SearchParamDefinition(name="organization", path="Patient.managingOrganization", description="The organization at which this person is a patient", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + @SearchParamDefinition(name="name", path="Patient.name", description="A portion of either family or given name of the patient", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="telecom", path="Patient.telecom", description="The value in any kind of telecom details of the patient", type="token" ) + public static final String SP_TELECOM = "telecom"; + @SearchParamDefinition(name="family", path="Patient.name.family", description="A portion of the family name of the patient", type="string" ) + public static final String SP_FAMILY = "family"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/PaymentNotice.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/PaymentNotice.java index 7dad7c8ec5d..296042477bf 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/PaymentNotice.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/PaymentNotice.java @@ -1,630 +1,609 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * This resource provides the status of the payment for goods and services rendered, and the request and response resource references. - */ -@ResourceDef(name="PaymentNotice", profile="http://hl7.org/fhir/Profile/PaymentNotice") -public class PaymentNotice extends DomainResource { - - /** - * The Response Business Identifier. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=2, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when this resource was created. - */ - @Child(name = "created", type = {DateTimeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) - protected DateTimeType created; - - /** - * The Insurer who is target of the request. - */ - @Child(name = "target", type = {Organization.class}, order=4, min=0, max=1) - @Description(shortDefinition="Insurer or Regulatory body", formalDefinition="The Insurer who is target of the request." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (The Insurer who is target of the request.) - */ - protected Organization targetTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name = "provider", type = {Practitioner.class}, order=5, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner providerTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name = "organization", type = {Organization.class}, order=6, min=0, max=1) - @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; - - /** - * Reference of resource to reverse. - */ - @Child(name = "request", type = {}, order=7, min=0, max=1) - @Description(shortDefinition="Request reference", formalDefinition="Reference of resource to reverse." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (Reference of resource to reverse.) - */ - protected Resource requestTarget; - - /** - * Reference of response to resource to reverse. - */ - @Child(name = "response", type = {}, order=8, min=0, max=1) - @Description(shortDefinition="Response reference", formalDefinition="Reference of response to resource to reverse." ) - protected Reference response; - - /** - * The actual object that is the target of the reference (Reference of response to resource to reverse.) - */ - protected Resource responseTarget; - - /** - * The payment status, typically paid: payment sent, cleared: payment received. - */ - @Child(name = "paymentStatus", type = {Coding.class}, order=9, min=1, max=1) - @Description(shortDefinition="Status of the payment", formalDefinition="The payment status, typically paid: payment sent, cleared: payment received." ) - protected Coding paymentStatus; - - private static final long serialVersionUID = -394826458L; - - /* - * Constructor - */ - public PaymentNotice() { - super(); - } - - /* - * Constructor - */ - public PaymentNotice(Coding paymentStatus) { - super(); - this.paymentStatus = paymentStatus; - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public PaymentNotice addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public PaymentNotice setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public PaymentNotice setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public PaymentNotice setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when this resource was created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when this resource was created. - */ - public PaymentNotice setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (The Insurer who is target of the request.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); // cc - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The Insurer who is target of the request.) - */ - public PaymentNotice 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 PaymentNotice.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Organization(); // aa - return this.targetTarget; - } - - /** - * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who is target of the request.) - */ - public PaymentNotice 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 PaymentNotice.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); // cc - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public PaymentNotice 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 PaymentNotice.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); // aa - return this.providerTarget; - } - - /** - * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) - */ - public PaymentNotice 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 PaymentNotice.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); // cc - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public PaymentNotice 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 PaymentNotice.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); // aa - return this.organizationTarget; - } - - /** - * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) - */ - public PaymentNotice setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #request} (Reference of resource to reverse.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); // cc - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Reference of resource to reverse.) - */ - public PaymentNotice setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference of resource to reverse.) - */ - public Resource getRequestTarget() { - return this.requestTarget; - } - - /** - * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference of resource to reverse.) - */ - public PaymentNotice setRequestTarget(Resource value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #response} (Reference of response to resource to reverse.) - */ - public Reference getResponse() { - if (this.response == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.response"); - else if (Configuration.doAutoCreate()) - this.response = new Reference(); // cc - return this.response; - } - - public boolean hasResponse() { - return this.response != null && !this.response.isEmpty(); - } - - /** - * @param value {@link #response} (Reference of response to resource to reverse.) - */ - public PaymentNotice setResponse(Reference value) { - this.response = value; - return this; - } - - /** - * @return {@link #response} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference of response to resource to reverse.) - */ - public Resource getResponseTarget() { - return this.responseTarget; - } - - /** - * @param value {@link #response} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference of response to resource to reverse.) - */ - public PaymentNotice setResponseTarget(Resource value) { - this.responseTarget = value; - return this; - } - - /** - * @return {@link #paymentStatus} (The payment status, typically paid: payment sent, cleared: payment received.) - */ - public Coding getPaymentStatus() { - if (this.paymentStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.paymentStatus"); - else if (Configuration.doAutoCreate()) - this.paymentStatus = new Coding(); // cc - return this.paymentStatus; - } - - public boolean hasPaymentStatus() { - return this.paymentStatus != null && !this.paymentStatus.isEmpty(); - } - - /** - * @param value {@link #paymentStatus} (The payment status, typically paid: payment sent, cleared: payment received.) - */ - public PaymentNotice setPaymentStatus(Coding value) { - this.paymentStatus = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("target", "Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("request", "Reference(Any)", "Reference of resource to reverse.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("response", "Reference(Any)", "Reference of response to resource to reverse.", 0, java.lang.Integer.MAX_VALUE, response)); - childrenList.add(new Property("paymentStatus", "Coding", "The payment status, typically paid: payment sent, cleared: payment received.", 0, java.lang.Integer.MAX_VALUE, paymentStatus)); - } - - public PaymentNotice copy() { - PaymentNotice dst = new PaymentNotice(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.target = target == null ? null : target.copy(); - dst.provider = provider == null ? null : provider.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.request = request == null ? null : request.copy(); - dst.response = response == null ? null : response.copy(); - dst.paymentStatus = paymentStatus == null ? null : paymentStatus.copy(); - return dst; - } - - protected PaymentNotice typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof PaymentNotice)) - return false; - PaymentNotice o = (PaymentNotice) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) - && compareDeep(created, o.created, true) && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) - && compareDeep(organization, o.organization, true) && compareDeep(request, o.request, true) && compareDeep(response, o.response, true) - && compareDeep(paymentStatus, o.paymentStatus, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof PaymentNotice)) - return false; - PaymentNotice o = (PaymentNotice) other; - return compareValues(created, o.created, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) - && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) - && (request == null || request.isEmpty()) && (response == null || response.isEmpty()) && (paymentStatus == null || paymentStatus.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.PaymentNotice; - } - - @SearchParamDefinition(name="identifier", path="PaymentNotice.identifier", description="The business identifier of the Eligibility", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * This resource provides the status of the payment for goods and services rendered, and the request and response resource references. + */ +@ResourceDef(name="PaymentNotice", profile="http://hl7.org/fhir/Profile/PaymentNotice") +public class PaymentNotice extends DomainResource { + + /** + * The Response Business Identifier. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name = "ruleset", type = {Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=2, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when this resource was created. + */ + @Child(name = "created", type = {DateTimeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) + protected DateTimeType created; + + /** + * The Insurer who is target of the request. + */ + @Child(name = "target", type = {Organization.class}, order=4, min=0, max=1) + @Description(shortDefinition="Insurer or Regulatory body", formalDefinition="The Insurer who is target of the request." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (The Insurer who is target of the request.) + */ + protected Organization targetTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name = "provider", type = {Practitioner.class}, order=5, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name = "organization", type = {Organization.class}, order=6, min=0, max=1) + @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; + + /** + * Reference of resource to reverse. + */ + @Child(name = "request", type = {}, order=7, min=0, max=1) + @Description(shortDefinition="Request reference", formalDefinition="Reference of resource to reverse." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (Reference of resource to reverse.) + */ + protected Resource requestTarget; + + /** + * Reference of response to resource to reverse. + */ + @Child(name = "response", type = {}, order=8, min=0, max=1) + @Description(shortDefinition="Response reference", formalDefinition="Reference of response to resource to reverse." ) + protected Reference response; + + /** + * The actual object that is the target of the reference (Reference of response to resource to reverse.) + */ + protected Resource responseTarget; + + /** + * The payment status, typically paid: payment sent, cleared: payment received. + */ + @Child(name = "paymentStatus", type = {Coding.class}, order=9, min=1, max=1) + @Description(shortDefinition="Status of the payment", formalDefinition="The payment status, typically paid: payment sent, cleared: payment received." ) + protected Coding paymentStatus; + + private static final long serialVersionUID = -394826458L; + + /* + * Constructor + */ + public PaymentNotice() { + super(); + } + + /* + * Constructor + */ + public PaymentNotice(Coding paymentStatus) { + super(); + this.paymentStatus = paymentStatus; + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public PaymentNotice addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public PaymentNotice setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public PaymentNotice setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public PaymentNotice setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when this resource was created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when this resource was created. + */ + public PaymentNotice setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (The Insurer who is target of the request.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); // cc + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The Insurer who is target of the request.) + */ + public PaymentNotice 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 PaymentNotice.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); // aa + return this.targetTarget; + } + + /** + * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who is target of the request.) + */ + public PaymentNotice 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 PaymentNotice.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); // cc + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public PaymentNotice 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 PaymentNotice.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); // aa + return this.providerTarget; + } + + /** + * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public PaymentNotice 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 PaymentNotice.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); // cc + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public PaymentNotice 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 PaymentNotice.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); // aa + return this.organizationTarget; + } + + /** + * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) + */ + public PaymentNotice setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #request} (Reference of resource to reverse.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); // cc + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Reference of resource to reverse.) + */ + public PaymentNotice setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference of resource to reverse.) + */ + public Resource getRequestTarget() { + return this.requestTarget; + } + + /** + * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference of resource to reverse.) + */ + public PaymentNotice setRequestTarget(Resource value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #response} (Reference of response to resource to reverse.) + */ + public Reference getResponse() { + if (this.response == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.response"); + else if (Configuration.doAutoCreate()) + this.response = new Reference(); // cc + return this.response; + } + + public boolean hasResponse() { + return this.response != null && !this.response.isEmpty(); + } + + /** + * @param value {@link #response} (Reference of response to resource to reverse.) + */ + public PaymentNotice setResponse(Reference value) { + this.response = value; + return this; + } + + /** + * @return {@link #response} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference of response to resource to reverse.) + */ + public Resource getResponseTarget() { + return this.responseTarget; + } + + /** + * @param value {@link #response} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference of response to resource to reverse.) + */ + public PaymentNotice setResponseTarget(Resource value) { + this.responseTarget = value; + return this; + } + + /** + * @return {@link #paymentStatus} (The payment status, typically paid: payment sent, cleared: payment received.) + */ + public Coding getPaymentStatus() { + if (this.paymentStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.paymentStatus"); + else if (Configuration.doAutoCreate()) + this.paymentStatus = new Coding(); // cc + return this.paymentStatus; + } + + public boolean hasPaymentStatus() { + return this.paymentStatus != null && !this.paymentStatus.isEmpty(); + } + + /** + * @param value {@link #paymentStatus} (The payment status, typically paid: payment sent, cleared: payment received.) + */ + public PaymentNotice setPaymentStatus(Coding value) { + this.paymentStatus = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); + childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); + childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("target", "Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("request", "Reference(Any)", "Reference of resource to reverse.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("response", "Reference(Any)", "Reference of response to resource to reverse.", 0, java.lang.Integer.MAX_VALUE, response)); + childrenList.add(new Property("paymentStatus", "Coding", "The payment status, typically paid: payment sent, cleared: payment received.", 0, java.lang.Integer.MAX_VALUE, paymentStatus)); + } + + public PaymentNotice copy() { + PaymentNotice dst = new PaymentNotice(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + dst.created = created == null ? null : created.copy(); + dst.target = target == null ? null : target.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.request = request == null ? null : request.copy(); + dst.response = response == null ? null : response.copy(); + dst.paymentStatus = paymentStatus == null ? null : paymentStatus.copy(); + return dst; + } + + protected PaymentNotice typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof PaymentNotice)) + return false; + PaymentNotice o = (PaymentNotice) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) + && compareDeep(created, o.created, true) && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) + && compareDeep(organization, o.organization, true) && compareDeep(request, o.request, true) && compareDeep(response, o.response, true) + && compareDeep(paymentStatus, o.paymentStatus, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof PaymentNotice)) + return false; + PaymentNotice o = (PaymentNotice) other; + return compareValues(created, o.created, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) + && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) + && (request == null || request.isEmpty()) && (response == null || response.isEmpty()) && (paymentStatus == null || paymentStatus.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.PaymentNotice; + } + + @SearchParamDefinition(name="identifier", path="PaymentNotice.identifier", description="The business identifier of the Eligibility", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/PaymentReconciliation.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/PaymentReconciliation.java index b063cff9b68..00b1facf06e 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/PaymentReconciliation.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/PaymentReconciliation.java @@ -1,1493 +1,1472 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * This resource provides payment details and claim references supporting a bulk payment. - */ -@ResourceDef(name="PaymentReconciliation", profile="http://hl7.org/fhir/Profile/PaymentReconciliation") -public class PaymentReconciliation extends DomainResource { - - public enum RSLink { - /** - * The processing completed without errors. - */ - COMPLETE, - /** - * The processing identified with errors. - */ - ERROR, - /** - * added to help the parsers - */ - NULL; - public static RSLink fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return COMPLETE; - if ("error".equals(codeString)) - return ERROR; - throw new Exception("Unknown RSLink code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case COMPLETE: return "complete"; - case ERROR: return "error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case COMPLETE: return ""; - case ERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case COMPLETE: return "The processing completed without errors."; - case ERROR: return "The processing identified with errors."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case COMPLETE: return "Complete"; - case ERROR: return "Error"; - default: return "?"; - } - } - } - - public static class RSLinkEnumFactory implements EnumFactory { - public RSLink fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return RSLink.COMPLETE; - if ("error".equals(codeString)) - return RSLink.ERROR; - throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); - } - public String toCode(RSLink code) { - if (code == RSLink.COMPLETE) - return "complete"; - if (code == RSLink.ERROR) - return "error"; - return "?"; - } - } - - @Block() - public static class DetailsComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code to indicate the nature of the payment, adjustment, funds advance, etc. - */ - @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Type code", formalDefinition="Code to indicate the nature of the payment, adjustment, funds advance, etc." ) - protected Coding type; - - /** - * The claim or financial resource. - */ - @Child(name = "request", type = {}, order=2, min=0, max=1) - @Description(shortDefinition="Claim", formalDefinition="The claim or financial resource." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (The claim or financial resource.) - */ - protected Resource requestTarget; - - /** - * The claim response resource. - */ - @Child(name = "responce", type = {}, order=3, min=0, max=1) - @Description(shortDefinition="Claim Response", formalDefinition="The claim response resource." ) - protected Reference responce; - - /** - * The actual object that is the target of the reference (The claim response resource.) - */ - protected Resource responceTarget; - - /** - * The Organization which submitted the invoice or financial transaction. - */ - @Child(name = "submitter", type = {Organization.class}, order=4, min=0, max=1) - @Description(shortDefinition="Submitter", formalDefinition="The Organization which submitted the invoice or financial transaction." ) - protected Reference submitter; - - /** - * The actual object that is the target of the reference (The Organization which submitted the invoice or financial transaction.) - */ - protected Organization submitterTarget; - - /** - * The organization which is receiving the payment. - */ - @Child(name = "payee", type = {Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="Payee", formalDefinition="The organization which is receiving the payment." ) - protected Reference payee; - - /** - * The actual object that is the target of the reference (The organization which is receiving the payment.) - */ - protected Organization payeeTarget; - - /** - * The date of the invoice or financial resource. - */ - @Child(name = "date", type = {DateType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Invoice date", formalDefinition="The date of the invoice or financial resource." ) - protected DateType date; - - /** - * Amount paid for this detail. - */ - @Child(name = "amount", type = {Money.class}, order=7, min=0, max=1) - @Description(shortDefinition="Detail amount", formalDefinition="Amount paid for this detail." ) - protected Money amount; - - private static final long serialVersionUID = -1644048062L; - - /* - * Constructor - */ - public DetailsComponent() { - super(); - } - - /* - * Constructor - */ - public DetailsComponent(Coding type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (Code to indicate the nature of the payment, adjustment, funds advance, etc.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailsComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Code to indicate the nature of the payment, adjustment, funds advance, etc.) - */ - public DetailsComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #request} (The claim or financial resource.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailsComponent.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); // cc - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (The claim or financial resource.) - */ - public DetailsComponent setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The claim or financial resource.) - */ - public Resource getRequestTarget() { - return this.requestTarget; - } - - /** - * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The claim or financial resource.) - */ - public DetailsComponent setRequestTarget(Resource value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #responce} (The claim response resource.) - */ - public Reference getResponce() { - if (this.responce == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailsComponent.responce"); - else if (Configuration.doAutoCreate()) - this.responce = new Reference(); // cc - return this.responce; - } - - public boolean hasResponce() { - return this.responce != null && !this.responce.isEmpty(); - } - - /** - * @param value {@link #responce} (The claim response resource.) - */ - public DetailsComponent setResponce(Reference value) { - this.responce = value; - return this; - } - - /** - * @return {@link #responce} The actual object that is the 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 claim response resource.) - */ - public Resource getResponceTarget() { - return this.responceTarget; - } - - /** - * @param value {@link #responce} The actual object that is the 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 claim response resource.) - */ - public DetailsComponent setResponceTarget(Resource value) { - this.responceTarget = value; - return this; - } - - /** - * @return {@link #submitter} (The Organization which submitted the invoice or financial transaction.) - */ - public Reference getSubmitter() { - if (this.submitter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailsComponent.submitter"); - else if (Configuration.doAutoCreate()) - this.submitter = new Reference(); // cc - return this.submitter; - } - - public boolean hasSubmitter() { - return this.submitter != null && !this.submitter.isEmpty(); - } - - /** - * @param value {@link #submitter} (The Organization which submitted the invoice or financial transaction.) - */ - public DetailsComponent setSubmitter(Reference value) { - this.submitter = value; - return this; - } - - /** - * @return {@link #submitter} The actual object that is the 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 submitted the invoice or financial transaction.) - */ - public Organization getSubmitterTarget() { - if (this.submitterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailsComponent.submitter"); - else if (Configuration.doAutoCreate()) - this.submitterTarget = new Organization(); // aa - return this.submitterTarget; - } - - /** - * @param value {@link #submitter} The actual object that is the 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 submitted the invoice or financial transaction.) - */ - public DetailsComponent setSubmitterTarget(Organization value) { - this.submitterTarget = value; - return this; - } - - /** - * @return {@link #payee} (The organization which is receiving the payment.) - */ - public Reference getPayee() { - if (this.payee == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailsComponent.payee"); - else if (Configuration.doAutoCreate()) - this.payee = new Reference(); // cc - return this.payee; - } - - public boolean hasPayee() { - return this.payee != null && !this.payee.isEmpty(); - } - - /** - * @param value {@link #payee} (The organization which is receiving the payment.) - */ - public DetailsComponent setPayee(Reference value) { - this.payee = value; - return this; - } - - /** - * @return {@link #payee} The actual object that is the 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 receiving the payment.) - */ - public Organization getPayeeTarget() { - if (this.payeeTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailsComponent.payee"); - else if (Configuration.doAutoCreate()) - this.payeeTarget = new Organization(); // aa - return this.payeeTarget; - } - - /** - * @param value {@link #payee} The actual object that is the 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 receiving the payment.) - */ - public DetailsComponent setPayeeTarget(Organization value) { - this.payeeTarget = value; - return this; - } - - /** - * @return {@link #date} (The date of the invoice or financial resource.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailsComponent.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date of the invoice or financial resource.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DetailsComponent setDateElement(DateType value) { - this.date = value; - return this; - } - - /** - * @return The date of the invoice or financial resource. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date of the invoice or financial resource. - */ - public DetailsComponent setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #amount} (Amount paid for this detail.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailsComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Amount paid for this detail.) - */ - public DetailsComponent setAmount(Money value) { - this.amount = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Code to indicate the nature of the payment, adjustment, funds advance, etc.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("request", "Reference(Any)", "The claim or financial resource.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("responce", "Reference(Any)", "The claim response resource.", 0, java.lang.Integer.MAX_VALUE, responce)); - childrenList.add(new Property("submitter", "Reference(Organization)", "The Organization which submitted the invoice or financial transaction.", 0, java.lang.Integer.MAX_VALUE, submitter)); - childrenList.add(new Property("payee", "Reference(Organization)", "The organization which is receiving the payment.", 0, java.lang.Integer.MAX_VALUE, payee)); - childrenList.add(new Property("date", "date", "The date of the invoice or financial resource.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("amount", "Money", "Amount paid for this detail.", 0, java.lang.Integer.MAX_VALUE, amount)); - } - - public DetailsComponent copy() { - DetailsComponent dst = new DetailsComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.request = request == null ? null : request.copy(); - dst.responce = responce == null ? null : responce.copy(); - dst.submitter = submitter == null ? null : submitter.copy(); - dst.payee = payee == null ? null : payee.copy(); - dst.date = date == null ? null : date.copy(); - dst.amount = amount == null ? null : amount.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DetailsComponent)) - return false; - DetailsComponent o = (DetailsComponent) other; - return compareDeep(type, o.type, true) && compareDeep(request, o.request, true) && compareDeep(responce, o.responce, true) - && compareDeep(submitter, o.submitter, true) && compareDeep(payee, o.payee, true) && compareDeep(date, o.date, true) - && compareDeep(amount, o.amount, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DetailsComponent)) - return false; - DetailsComponent o = (DetailsComponent) other; - return compareValues(date, o.date, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (request == null || request.isEmpty()) - && (responce == null || responce.isEmpty()) && (submitter == null || submitter.isEmpty()) - && (payee == null || payee.isEmpty()) && (date == null || date.isEmpty()) && (amount == null || amount.isEmpty()) - ; - } - - } - - @Block() - public static class NotesComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The note purpose: Print/Display. - */ - @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) - protected Coding type; - - /** - * The note text. - */ - @Child(name = "text", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Notes text", formalDefinition="The note text." ) - protected StringType text; - - private static final long serialVersionUID = 129959202L; - - /* - * Constructor - */ - public NotesComponent() { - super(); - } - - /** - * @return {@link #type} (The note purpose: Print/Display.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NotesComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The note purpose: Print/Display.) - */ - public NotesComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NotesComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public NotesComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return The note text. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value The note text. - */ - public NotesComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); - } - - public NotesComponent copy() { - NotesComponent dst = new NotesComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.text = text == null ? null : text.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NotesComponent)) - return false; - NotesComponent o = (NotesComponent) other; - return compareDeep(type, o.type, true) && compareDeep(text, o.text, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NotesComponent)) - return false; - NotesComponent o = (NotesComponent) other; - return compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (text == null || text.isEmpty()) - ; - } - - } - - /** - * The Response Business Identifier. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * Original request resource reference. - */ - @Child(name = "request", type = {ProcessRequest.class}, order=1, min=0, max=1) - @Description(shortDefinition="Claim reference", formalDefinition="Original request resource reference." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (Original request resource reference.) - */ - protected ProcessRequest requestTarget; - - /** - * Transaction status: error, complete. - */ - @Child(name = "outcome", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) - protected Enumeration outcome; - - /** - * A description of the status of the adjudication. - */ - @Child(name = "disposition", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) - protected StringType disposition; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=5, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateTimeType created; - - /** - * The period of time for which payments have been gathered into this bulk payment for settlement. - */ - @Child(name = "period", type = {Period.class}, order=7, min=0, max=1) - @Description(shortDefinition="Period covered", formalDefinition="The period of time for which payments have been gathered into this bulk payment for settlement." ) - protected Period period; - - /** - * The Insurer who produced this adjudicated response. - */ - @Child(name = "organization", type = {Organization.class}, order=8, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) - */ - protected Organization organizationTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name = "requestProvider", type = {Practitioner.class}, order=9, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference requestProvider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner requestProviderTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name = "requestOrganization", type = {Organization.class}, order=10, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference requestOrganization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization requestOrganizationTarget; - - /** - * List of individual settlement amounts and the corresponding transaction. - */ - @Child(name = "detail", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Details", formalDefinition="List of individual settlement amounts and the corresponding transaction." ) - protected List detail; - - /** - * The form to be used for printing the content. - */ - @Child(name = "form", type = {Coding.class}, order=12, min=0, max=1) - @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) - protected Coding form; - - /** - * Total payment amount. - */ - @Child(name = "total", type = {Money.class}, order=13, min=1, max=1) - @Description(shortDefinition="Total amount of Payment", formalDefinition="Total payment amount." ) - protected Money total; - - /** - * Suite of notes. - */ - @Child(name = "note", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Note text", formalDefinition="Suite of notes." ) - protected List note; - - private static final long serialVersionUID = 1602249640L; - - /* - * Constructor - */ - public PaymentReconciliation() { - super(); - } - - /* - * Constructor - */ - public PaymentReconciliation(Money total) { - super(); - this.total = total; - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public PaymentReconciliation addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #request} (Original request resource reference.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); // cc - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request resource reference.) - */ - public PaymentReconciliation setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original request resource reference.) - */ - public ProcessRequest getRequestTarget() { - if (this.requestTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.request"); - else if (Configuration.doAutoCreate()) - this.requestTarget = new ProcessRequest(); // aa - return this.requestTarget; - } - - /** - * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original request resource reference.) - */ - public PaymentReconciliation setRequestTarget(ProcessRequest value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public Enumeration getOutcomeElement() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Enumeration(new RSLinkEnumFactory()); // bb - return this.outcome; - } - - public boolean hasOutcomeElement() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public PaymentReconciliation setOutcomeElement(Enumeration value) { - this.outcome = value; - return this; - } - - /** - * @return Transaction status: error, complete. - */ - public RSLink getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value Transaction status: error, complete. - */ - public PaymentReconciliation setOutcome(RSLink value) { - if (value == null) - this.outcome = null; - else { - if (this.outcome == null) - this.outcome = new Enumeration(new RSLinkEnumFactory()); - this.outcome.setValue(value); - } - return this; - } - - /** - * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public StringType getDispositionElement() { - if (this.disposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.disposition"); - else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); // bb - return this.disposition; - } - - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - /** - * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public PaymentReconciliation setDispositionElement(StringType value) { - this.disposition = value; - return this; - } - - /** - * @return A description of the status of the adjudication. - */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); - } - - /** - * @param value A description of the status of the adjudication. - */ - public PaymentReconciliation setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); - } - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public PaymentReconciliation setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public PaymentReconciliation setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public PaymentReconciliation setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when the enclosed suite of services were performed or completed. - */ - public PaymentReconciliation setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #period} (The period of time for which payments have been gathered into this bulk payment for settlement.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The period of time for which payments have been gathered into this bulk payment for settlement.) - */ - public PaymentReconciliation setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); // cc - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public PaymentReconciliation setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); // aa - return this.organizationTarget; - } - - /** - * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) - */ - public PaymentReconciliation setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getRequestProvider() { - if (this.requestProvider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProvider = new Reference(); // cc - return this.requestProvider; - } - - public boolean hasRequestProvider() { - return this.requestProvider != null && !this.requestProvider.isEmpty(); - } - - /** - * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public PaymentReconciliation setRequestProvider(Reference value) { - this.requestProvider = value; - return this; - } - - /** - * @return {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getRequestProviderTarget() { - if (this.requestProviderTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProviderTarget = new Practitioner(); // aa - return this.requestProviderTarget; - } - - /** - * @param value {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) - */ - public PaymentReconciliation setRequestProviderTarget(Practitioner value) { - this.requestProviderTarget = value; - return this; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getRequestOrganization() { - if (this.requestOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganization = new Reference(); // cc - return this.requestOrganization; - } - - public boolean hasRequestOrganization() { - return this.requestOrganization != null && !this.requestOrganization.isEmpty(); - } - - /** - * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public PaymentReconciliation setRequestOrganization(Reference value) { - this.requestOrganization = value; - return this; - } - - /** - * @return {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) - */ - public Organization getRequestOrganizationTarget() { - if (this.requestOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganizationTarget = new Organization(); // aa - return this.requestOrganizationTarget; - } - - /** - * @param value {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) - */ - public PaymentReconciliation setRequestOrganizationTarget(Organization value) { - this.requestOrganizationTarget = value; - return this; - } - - /** - * @return {@link #detail} (List of individual settlement amounts and the corresponding transaction.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (DetailsComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (List of individual settlement amounts and the corresponding transaction.) - */ - // syntactic sugar - public DetailsComponent addDetail() { //3 - DetailsComponent t = new DetailsComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - // syntactic sugar - public PaymentReconciliation addDetail(DetailsComponent t) { //3 - if (t == null) - return this; - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return this; - } - - /** - * @return {@link #form} (The form to be used for printing the content.) - */ - public Coding getForm() { - if (this.form == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.form"); - else if (Configuration.doAutoCreate()) - this.form = new Coding(); // cc - return this.form; - } - - public boolean hasForm() { - return this.form != null && !this.form.isEmpty(); - } - - /** - * @param value {@link #form} (The form to be used for printing the content.) - */ - public PaymentReconciliation setForm(Coding value) { - this.form = value; - return this; - } - - /** - * @return {@link #total} (Total payment amount.) - */ - public Money getTotal() { - if (this.total == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.total"); - else if (Configuration.doAutoCreate()) - this.total = new Money(); // cc - return this.total; - } - - public boolean hasTotal() { - return this.total != null && !this.total.isEmpty(); - } - - /** - * @param value {@link #total} (Total payment amount.) - */ - public PaymentReconciliation setTotal(Money value) { - this.total = value; - return this; - } - - /** - * @return {@link #note} (Suite of notes.) - */ - public List getNote() { - if (this.note == null) - this.note = new ArrayList(); - return this.note; - } - - public boolean hasNote() { - if (this.note == null) - return false; - for (NotesComponent item : this.note) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #note} (Suite of notes.) - */ - // syntactic sugar - public NotesComponent addNote() { //3 - NotesComponent t = new NotesComponent(); - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return t; - } - - // syntactic sugar - public PaymentReconciliation addNote(NotesComponent t) { //3 - if (t == null) - return this; - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("request", "Reference(ProcessRequest)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition)); - childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("period", "Period", "The period of time for which payments have been gathered into this bulk payment for settlement.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); - childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); - childrenList.add(new Property("detail", "", "List of individual settlement amounts and the corresponding transaction.", 0, java.lang.Integer.MAX_VALUE, detail)); - childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); - childrenList.add(new Property("total", "Money", "Total payment amount.", 0, java.lang.Integer.MAX_VALUE, total)); - childrenList.add(new Property("note", "", "Suite of notes.", 0, java.lang.Integer.MAX_VALUE, note)); - } - - public PaymentReconciliation copy() { - PaymentReconciliation dst = new PaymentReconciliation(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.request = request == null ? null : request.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.disposition = disposition == null ? null : disposition.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.period = period == null ? null : period.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); - dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); - if (detail != null) { - dst.detail = new ArrayList(); - for (DetailsComponent i : detail) - dst.detail.add(i.copy()); - }; - dst.form = form == null ? null : form.copy(); - dst.total = total == null ? null : total.copy(); - if (note != null) { - dst.note = new ArrayList(); - for (NotesComponent i : note) - dst.note.add(i.copy()); - }; - return dst; - } - - protected PaymentReconciliation typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof PaymentReconciliation)) - return false; - PaymentReconciliation o = (PaymentReconciliation) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true) - && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) - && compareDeep(created, o.created, true) && compareDeep(period, o.period, true) && compareDeep(organization, o.organization, true) - && compareDeep(requestProvider, o.requestProvider, true) && compareDeep(requestOrganization, o.requestOrganization, true) - && compareDeep(detail, o.detail, true) && compareDeep(form, o.form, true) && compareDeep(total, o.total, true) - && compareDeep(note, o.note, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof PaymentReconciliation)) - return false; - PaymentReconciliation o = (PaymentReconciliation) other; - return compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) - && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) - && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - && (created == null || created.isEmpty()) && (period == null || period.isEmpty()) && (organization == null || organization.isEmpty()) - && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) - && (detail == null || detail.isEmpty()) && (form == null || form.isEmpty()) && (total == null || total.isEmpty()) - && (note == null || note.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.PaymentReconciliation; - } - - @SearchParamDefinition(name="identifier", path="PaymentReconciliation.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * This resource provides payment details and claim references supporting a bulk payment. + */ +@ResourceDef(name="PaymentReconciliation", profile="http://hl7.org/fhir/Profile/PaymentReconciliation") +public class PaymentReconciliation extends DomainResource { + + public enum RSLink { + /** + * The processing completed without errors. + */ + COMPLETE, + /** + * The processing identified with errors. + */ + ERROR, + /** + * added to help the parsers + */ + NULL; + public static RSLink fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return COMPLETE; + if ("error".equals(codeString)) + return ERROR; + throw new Exception("Unknown RSLink code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case ERROR: return "error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return ""; + case ERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The processing completed without errors."; + case ERROR: return "The processing identified with errors."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "Complete"; + case ERROR: return "Error"; + default: return "?"; + } + } + } + + public static class RSLinkEnumFactory implements EnumFactory { + public RSLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return RSLink.COMPLETE; + if ("error".equals(codeString)) + return RSLink.ERROR; + throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); + } + public String toCode(RSLink code) { + if (code == RSLink.COMPLETE) + return "complete"; + if (code == RSLink.ERROR) + return "error"; + return "?"; + } + } + + @Block() + public static class DetailsComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code to indicate the nature of the payment, adjustment, funds advance, etc. + */ + @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Type code", formalDefinition="Code to indicate the nature of the payment, adjustment, funds advance, etc." ) + protected Coding type; + + /** + * The claim or financial resource. + */ + @Child(name = "request", type = {}, order=2, min=0, max=1) + @Description(shortDefinition="Claim", formalDefinition="The claim or financial resource." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (The claim or financial resource.) + */ + protected Resource requestTarget; + + /** + * The claim response resource. + */ + @Child(name = "responce", type = {}, order=3, min=0, max=1) + @Description(shortDefinition="Claim Response", formalDefinition="The claim response resource." ) + protected Reference responce; + + /** + * The actual object that is the target of the reference (The claim response resource.) + */ + protected Resource responceTarget; + + /** + * The Organization which submitted the invoice or financial transaction. + */ + @Child(name = "submitter", type = {Organization.class}, order=4, min=0, max=1) + @Description(shortDefinition="Submitter", formalDefinition="The Organization which submitted the invoice or financial transaction." ) + protected Reference submitter; + + /** + * The actual object that is the target of the reference (The Organization which submitted the invoice or financial transaction.) + */ + protected Organization submitterTarget; + + /** + * The organization which is receiving the payment. + */ + @Child(name = "payee", type = {Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Payee", formalDefinition="The organization which is receiving the payment." ) + protected Reference payee; + + /** + * The actual object that is the target of the reference (The organization which is receiving the payment.) + */ + protected Organization payeeTarget; + + /** + * The date of the invoice or financial resource. + */ + @Child(name = "date", type = {DateType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Invoice date", formalDefinition="The date of the invoice or financial resource." ) + protected DateType date; + + /** + * Amount paid for this detail. + */ + @Child(name = "amount", type = {Money.class}, order=7, min=0, max=1) + @Description(shortDefinition="Detail amount", formalDefinition="Amount paid for this detail." ) + protected Money amount; + + private static final long serialVersionUID = -1644048062L; + + /* + * Constructor + */ + public DetailsComponent() { + super(); + } + + /* + * Constructor + */ + public DetailsComponent(Coding type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (Code to indicate the nature of the payment, adjustment, funds advance, etc.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailsComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Code to indicate the nature of the payment, adjustment, funds advance, etc.) + */ + public DetailsComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #request} (The claim or financial resource.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailsComponent.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); // cc + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (The claim or financial resource.) + */ + public DetailsComponent setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The claim or financial resource.) + */ + public Resource getRequestTarget() { + return this.requestTarget; + } + + /** + * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The claim or financial resource.) + */ + public DetailsComponent setRequestTarget(Resource value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #responce} (The claim response resource.) + */ + public Reference getResponce() { + if (this.responce == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailsComponent.responce"); + else if (Configuration.doAutoCreate()) + this.responce = new Reference(); // cc + return this.responce; + } + + public boolean hasResponce() { + return this.responce != null && !this.responce.isEmpty(); + } + + /** + * @param value {@link #responce} (The claim response resource.) + */ + public DetailsComponent setResponce(Reference value) { + this.responce = value; + return this; + } + + /** + * @return {@link #responce} The actual object that is the 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 claim response resource.) + */ + public Resource getResponceTarget() { + return this.responceTarget; + } + + /** + * @param value {@link #responce} The actual object that is the 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 claim response resource.) + */ + public DetailsComponent setResponceTarget(Resource value) { + this.responceTarget = value; + return this; + } + + /** + * @return {@link #submitter} (The Organization which submitted the invoice or financial transaction.) + */ + public Reference getSubmitter() { + if (this.submitter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailsComponent.submitter"); + else if (Configuration.doAutoCreate()) + this.submitter = new Reference(); // cc + return this.submitter; + } + + public boolean hasSubmitter() { + return this.submitter != null && !this.submitter.isEmpty(); + } + + /** + * @param value {@link #submitter} (The Organization which submitted the invoice or financial transaction.) + */ + public DetailsComponent setSubmitter(Reference value) { + this.submitter = value; + return this; + } + + /** + * @return {@link #submitter} The actual object that is the 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 submitted the invoice or financial transaction.) + */ + public Organization getSubmitterTarget() { + if (this.submitterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailsComponent.submitter"); + else if (Configuration.doAutoCreate()) + this.submitterTarget = new Organization(); // aa + return this.submitterTarget; + } + + /** + * @param value {@link #submitter} The actual object that is the 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 submitted the invoice or financial transaction.) + */ + public DetailsComponent setSubmitterTarget(Organization value) { + this.submitterTarget = value; + return this; + } + + /** + * @return {@link #payee} (The organization which is receiving the payment.) + */ + public Reference getPayee() { + if (this.payee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailsComponent.payee"); + else if (Configuration.doAutoCreate()) + this.payee = new Reference(); // cc + return this.payee; + } + + public boolean hasPayee() { + return this.payee != null && !this.payee.isEmpty(); + } + + /** + * @param value {@link #payee} (The organization which is receiving the payment.) + */ + public DetailsComponent setPayee(Reference value) { + this.payee = value; + return this; + } + + /** + * @return {@link #payee} The actual object that is the 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 receiving the payment.) + */ + public Organization getPayeeTarget() { + if (this.payeeTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailsComponent.payee"); + else if (Configuration.doAutoCreate()) + this.payeeTarget = new Organization(); // aa + return this.payeeTarget; + } + + /** + * @param value {@link #payee} The actual object that is the 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 receiving the payment.) + */ + public DetailsComponent setPayeeTarget(Organization value) { + this.payeeTarget = value; + return this; + } + + /** + * @return {@link #date} (The date of the invoice or financial resource.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailsComponent.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date of the invoice or financial resource.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DetailsComponent setDateElement(DateType value) { + this.date = value; + return this; + } + + /** + * @return The date of the invoice or financial resource. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date of the invoice or financial resource. + */ + public DetailsComponent setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #amount} (Amount paid for this detail.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailsComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Amount paid for this detail.) + */ + public DetailsComponent setAmount(Money value) { + this.amount = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Code to indicate the nature of the payment, adjustment, funds advance, etc.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("request", "Reference(Any)", "The claim or financial resource.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("responce", "Reference(Any)", "The claim response resource.", 0, java.lang.Integer.MAX_VALUE, responce)); + childrenList.add(new Property("submitter", "Reference(Organization)", "The Organization which submitted the invoice or financial transaction.", 0, java.lang.Integer.MAX_VALUE, submitter)); + childrenList.add(new Property("payee", "Reference(Organization)", "The organization which is receiving the payment.", 0, java.lang.Integer.MAX_VALUE, payee)); + childrenList.add(new Property("date", "date", "The date of the invoice or financial resource.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("amount", "Money", "Amount paid for this detail.", 0, java.lang.Integer.MAX_VALUE, amount)); + } + + public DetailsComponent copy() { + DetailsComponent dst = new DetailsComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.request = request == null ? null : request.copy(); + dst.responce = responce == null ? null : responce.copy(); + dst.submitter = submitter == null ? null : submitter.copy(); + dst.payee = payee == null ? null : payee.copy(); + dst.date = date == null ? null : date.copy(); + dst.amount = amount == null ? null : amount.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DetailsComponent)) + return false; + DetailsComponent o = (DetailsComponent) other; + return compareDeep(type, o.type, true) && compareDeep(request, o.request, true) && compareDeep(responce, o.responce, true) + && compareDeep(submitter, o.submitter, true) && compareDeep(payee, o.payee, true) && compareDeep(date, o.date, true) + && compareDeep(amount, o.amount, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DetailsComponent)) + return false; + DetailsComponent o = (DetailsComponent) other; + return compareValues(date, o.date, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (request == null || request.isEmpty()) + && (responce == null || responce.isEmpty()) && (submitter == null || submitter.isEmpty()) + && (payee == null || payee.isEmpty()) && (date == null || date.isEmpty()) && (amount == null || amount.isEmpty()) + ; + } + + } + + @Block() + public static class NotesComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The note purpose: Print/Display. + */ + @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) + protected Coding type; + + /** + * The note text. + */ + @Child(name = "text", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Notes text", formalDefinition="The note text." ) + protected StringType text; + + private static final long serialVersionUID = 129959202L; + + /* + * Constructor + */ + public NotesComponent() { + super(); + } + + /** + * @return {@link #type} (The note purpose: Print/Display.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NotesComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The note purpose: Print/Display.) + */ + public NotesComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NotesComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public NotesComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return The note text. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value The note text. + */ + public NotesComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); + } + + public NotesComponent copy() { + NotesComponent dst = new NotesComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.text = text == null ? null : text.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NotesComponent)) + return false; + NotesComponent o = (NotesComponent) other; + return compareDeep(type, o.type, true) && compareDeep(text, o.text, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NotesComponent)) + return false; + NotesComponent o = (NotesComponent) other; + return compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (text == null || text.isEmpty()) + ; + } + + } + + /** + * The Response Business Identifier. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * Original request resource reference. + */ + @Child(name = "request", type = {ProcessRequest.class}, order=1, min=0, max=1) + @Description(shortDefinition="Claim reference", formalDefinition="Original request resource reference." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (Original request resource reference.) + */ + protected ProcessRequest requestTarget; + + /** + * Transaction status: error, complete. + */ + @Child(name = "outcome", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) + protected Enumeration outcome; + + /** + * A description of the status of the adjudication. + */ + @Child(name = "disposition", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) + protected StringType disposition; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=5, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateTimeType created; + + /** + * The period of time for which payments have been gathered into this bulk payment for settlement. + */ + @Child(name = "period", type = {Period.class}, order=7, min=0, max=1) + @Description(shortDefinition="Period covered", formalDefinition="The period of time for which payments have been gathered into this bulk payment for settlement." ) + protected Period period; + + /** + * The Insurer who produced this adjudicated response. + */ + @Child(name = "organization", type = {Organization.class}, order=8, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) + */ + protected Organization organizationTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name = "requestProvider", type = {Practitioner.class}, order=9, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference requestProvider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner requestProviderTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name = "requestOrganization", type = {Organization.class}, order=10, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference requestOrganization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization requestOrganizationTarget; + + /** + * List of individual settlement amounts and the corresponding transaction. + */ + @Child(name = "detail", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Details", formalDefinition="List of individual settlement amounts and the corresponding transaction." ) + protected List detail; + + /** + * The form to be used for printing the content. + */ + @Child(name = "form", type = {Coding.class}, order=12, min=0, max=1) + @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) + protected Coding form; + + /** + * Total payment amount. + */ + @Child(name = "total", type = {Money.class}, order=13, min=1, max=1) + @Description(shortDefinition="Total amount of Payment", formalDefinition="Total payment amount." ) + protected Money total; + + /** + * Suite of notes. + */ + @Child(name = "note", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Note text", formalDefinition="Suite of notes." ) + protected List note; + + private static final long serialVersionUID = 1602249640L; + + /* + * Constructor + */ + public PaymentReconciliation() { + super(); + } + + /* + * Constructor + */ + public PaymentReconciliation(Money total) { + super(); + this.total = total; + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public PaymentReconciliation addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #request} (Original request resource reference.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); // cc + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request resource reference.) + */ + public PaymentReconciliation setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original request resource reference.) + */ + public ProcessRequest getRequestTarget() { + if (this.requestTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.request"); + else if (Configuration.doAutoCreate()) + this.requestTarget = new ProcessRequest(); // aa + return this.requestTarget; + } + + /** + * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original request resource reference.) + */ + public PaymentReconciliation setRequestTarget(ProcessRequest value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public Enumeration getOutcomeElement() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new Enumeration(new RSLinkEnumFactory()); // bb + return this.outcome; + } + + public boolean hasOutcomeElement() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public PaymentReconciliation setOutcomeElement(Enumeration value) { + this.outcome = value; + return this; + } + + /** + * @return Transaction status: error, complete. + */ + public RSLink getOutcome() { + return this.outcome == null ? null : this.outcome.getValue(); + } + + /** + * @param value Transaction status: error, complete. + */ + public PaymentReconciliation setOutcome(RSLink value) { + if (value == null) + this.outcome = null; + else { + if (this.outcome == null) + this.outcome = new Enumeration(new RSLinkEnumFactory()); + this.outcome.setValue(value); + } + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); // bb + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public PaymentReconciliation setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication. + */ + public PaymentReconciliation setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public PaymentReconciliation setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public PaymentReconciliation setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public PaymentReconciliation setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when the enclosed suite of services were performed or completed. + */ + public PaymentReconciliation setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #period} (The period of time for which payments have been gathered into this bulk payment for settlement.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period of time for which payments have been gathered into this bulk payment for settlement.) + */ + public PaymentReconciliation setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); // cc + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public PaymentReconciliation setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); // aa + return this.organizationTarget; + } + + /** + * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) + */ + public PaymentReconciliation setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getRequestProvider() { + if (this.requestProvider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProvider = new Reference(); // cc + return this.requestProvider; + } + + public boolean hasRequestProvider() { + return this.requestProvider != null && !this.requestProvider.isEmpty(); + } + + /** + * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public PaymentReconciliation setRequestProvider(Reference value) { + this.requestProvider = value; + return this; + } + + /** + * @return {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getRequestProviderTarget() { + if (this.requestProviderTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProviderTarget = new Practitioner(); // aa + return this.requestProviderTarget; + } + + /** + * @param value {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public PaymentReconciliation setRequestProviderTarget(Practitioner value) { + this.requestProviderTarget = value; + return this; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getRequestOrganization() { + if (this.requestOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganization = new Reference(); // cc + return this.requestOrganization; + } + + public boolean hasRequestOrganization() { + return this.requestOrganization != null && !this.requestOrganization.isEmpty(); + } + + /** + * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public PaymentReconciliation setRequestOrganization(Reference value) { + this.requestOrganization = value; + return this; + } + + /** + * @return {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) + */ + public Organization getRequestOrganizationTarget() { + if (this.requestOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganizationTarget = new Organization(); // aa + return this.requestOrganizationTarget; + } + + /** + * @param value {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) + */ + public PaymentReconciliation setRequestOrganizationTarget(Organization value) { + this.requestOrganizationTarget = value; + return this; + } + + /** + * @return {@link #detail} (List of individual settlement amounts and the corresponding transaction.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (DetailsComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (List of individual settlement amounts and the corresponding transaction.) + */ + // syntactic sugar + public DetailsComponent addDetail() { //3 + DetailsComponent t = new DetailsComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + // syntactic sugar + public PaymentReconciliation addDetail(DetailsComponent t) { //3 + if (t == null) + return this; + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return this; + } + + /** + * @return {@link #form} (The form to be used for printing the content.) + */ + public Coding getForm() { + if (this.form == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.form"); + else if (Configuration.doAutoCreate()) + this.form = new Coding(); // cc + return this.form; + } + + public boolean hasForm() { + return this.form != null && !this.form.isEmpty(); + } + + /** + * @param value {@link #form} (The form to be used for printing the content.) + */ + public PaymentReconciliation setForm(Coding value) { + this.form = value; + return this; + } + + /** + * @return {@link #total} (Total payment amount.) + */ + public Money getTotal() { + if (this.total == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.total"); + else if (Configuration.doAutoCreate()) + this.total = new Money(); // cc + return this.total; + } + + public boolean hasTotal() { + return this.total != null && !this.total.isEmpty(); + } + + /** + * @param value {@link #total} (Total payment amount.) + */ + public PaymentReconciliation setTotal(Money value) { + this.total = value; + return this; + } + + /** + * @return {@link #note} (Suite of notes.) + */ + public List getNote() { + if (this.note == null) + this.note = new ArrayList(); + return this.note; + } + + public boolean hasNote() { + if (this.note == null) + return false; + for (NotesComponent item : this.note) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #note} (Suite of notes.) + */ + // syntactic sugar + public NotesComponent addNote() { //3 + NotesComponent t = new NotesComponent(); + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return t; + } + + // syntactic sugar + public PaymentReconciliation addNote(NotesComponent t) { //3 + if (t == null) + return this; + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("request", "Reference(ProcessRequest)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome)); + childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition)); + childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); + childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); + childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("period", "Period", "The period of time for which payments have been gathered into this bulk payment for settlement.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); + childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); + childrenList.add(new Property("detail", "", "List of individual settlement amounts and the corresponding transaction.", 0, java.lang.Integer.MAX_VALUE, detail)); + childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); + childrenList.add(new Property("total", "Money", "Total payment amount.", 0, java.lang.Integer.MAX_VALUE, total)); + childrenList.add(new Property("note", "", "Suite of notes.", 0, java.lang.Integer.MAX_VALUE, note)); + } + + public PaymentReconciliation copy() { + PaymentReconciliation dst = new PaymentReconciliation(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.request = request == null ? null : request.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.disposition = disposition == null ? null : disposition.copy(); + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + dst.created = created == null ? null : created.copy(); + dst.period = period == null ? null : period.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); + dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); + if (detail != null) { + dst.detail = new ArrayList(); + for (DetailsComponent i : detail) + dst.detail.add(i.copy()); + }; + dst.form = form == null ? null : form.copy(); + dst.total = total == null ? null : total.copy(); + if (note != null) { + dst.note = new ArrayList(); + for (NotesComponent i : note) + dst.note.add(i.copy()); + }; + return dst; + } + + protected PaymentReconciliation typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof PaymentReconciliation)) + return false; + PaymentReconciliation o = (PaymentReconciliation) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true) + && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) + && compareDeep(created, o.created, true) && compareDeep(period, o.period, true) && compareDeep(organization, o.organization, true) + && compareDeep(requestProvider, o.requestProvider, true) && compareDeep(requestOrganization, o.requestOrganization, true) + && compareDeep(detail, o.detail, true) && compareDeep(form, o.form, true) && compareDeep(total, o.total, true) + && compareDeep(note, o.note, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof PaymentReconciliation)) + return false; + PaymentReconciliation o = (PaymentReconciliation) other; + return compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) + && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) + && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) + && (created == null || created.isEmpty()) && (period == null || period.isEmpty()) && (organization == null || organization.isEmpty()) + && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) + && (detail == null || detail.isEmpty()) && (form == null || form.isEmpty()) && (total == null || total.isEmpty()) + && (note == null || note.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.PaymentReconciliation; + } + + @SearchParamDefinition(name="identifier", path="PaymentReconciliation.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Period.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Period.java index 53f34c34077..2b183a9e17f 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Period.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Period.java @@ -1,234 +1,213 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A time period defined by a start and end date and optionally time. - */ -@DatatypeDef(name="Period") -public class Period extends Type implements ICompositeType { - - /** - * The start of the period. The boundary is inclusive. - */ - @Child(name = "start", type = {DateTimeType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Starting time with inclusive boundary", formalDefinition="The start of the period. The boundary is inclusive." ) - protected DateTimeType start; - - /** - * The end of the period. If the end of the period is missing, it means that the period is ongoing. - */ - @Child(name = "end", type = {DateTimeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="End time with inclusive boundary, if not ongoing", formalDefinition="The end of the period. If the end of the period is missing, it means that the period is ongoing." ) - protected DateTimeType end; - - private static final long serialVersionUID = 649791751L; - - /* - * Constructor - */ - public Period() { - super(); - } - - /** - * @return {@link #start} (The start of the period. The boundary is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public DateTimeType getStartElement() { - if (this.start == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Period.start"); - else if (Configuration.doAutoCreate()) - this.start = new DateTimeType(); // bb - return this.start; - } - - public boolean hasStartElement() { - return this.start != null && !this.start.isEmpty(); - } - - public boolean hasStart() { - return this.start != null && !this.start.isEmpty(); - } - - /** - * @param value {@link #start} (The start of the period. The boundary is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public Period setStartElement(DateTimeType value) { - this.start = value; - return this; - } - - /** - * @return The start of the period. The boundary is inclusive. - */ - public Date getStart() { - return this.start == null ? null : this.start.getValue(); - } - - /** - * @param value The start of the period. The boundary is inclusive. - */ - public Period setStart(Date value) { - if (value == null) - this.start = null; - else { - if (this.start == null) - this.start = new DateTimeType(); - this.start.setValue(value); - } - return this; - } - - /** - * @return {@link #end} (The end of the period. If the end of the period is missing, it means that the period is ongoing.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public DateTimeType getEndElement() { - if (this.end == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Period.end"); - else if (Configuration.doAutoCreate()) - this.end = new DateTimeType(); // bb - return this.end; - } - - public boolean hasEndElement() { - return this.end != null && !this.end.isEmpty(); - } - - public boolean hasEnd() { - return this.end != null && !this.end.isEmpty(); - } - - /** - * @param value {@link #end} (The end of the period. If the end of the period is missing, it means that the period is ongoing.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public Period setEndElement(DateTimeType value) { - this.end = value; - return this; - } - - /** - * @return The end of the period. If the end of the period is missing, it means that the period is ongoing. - */ - public Date getEnd() { - return this.end == null ? null : this.end.getValue(); - } - - /** - * @param value The end of the period. If the end of the period is missing, it means that the period is ongoing. - */ - public Period setEnd(Date value) { - if (value == null) - this.end = null; - else { - if (this.end == null) - this.end = new DateTimeType(); - this.end.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("start", "dateTime", "The start of the period. The boundary is inclusive.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("end", "dateTime", "The end of the period. If the end of the period is missing, it means that the period is ongoing.", 0, java.lang.Integer.MAX_VALUE, end)); - } - - public Period copy() { - Period dst = new Period(); - copyValues(dst); - dst.start = start == null ? null : start.copy(); - dst.end = end == null ? null : end.copy(); - return dst; - } - - protected Period typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Period)) - return false; - Period o = (Period) other; - return compareDeep(start, o.start, true) && compareDeep(end, o.end, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Period)) - return false; - Period o = (Period) other; - return compareValues(start, o.start, true) && compareValues(end, o.end, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) - ; - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A time period defined by a start and end date and optionally time. + */ +@DatatypeDef(name="Period") +public class Period extends Type implements ICompositeType { + + /** + * The start of the period. The boundary is inclusive. + */ + @Child(name = "start", type = {DateTimeType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Starting time with inclusive boundary", formalDefinition="The start of the period. The boundary is inclusive." ) + protected DateTimeType start; + + /** + * The end of the period. If the end of the period is missing, it means that the period is ongoing. + */ + @Child(name = "end", type = {DateTimeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="End time with inclusive boundary, if not ongoing", formalDefinition="The end of the period. If the end of the period is missing, it means that the period is ongoing." ) + protected DateTimeType end; + + private static final long serialVersionUID = 649791751L; + + /* + * Constructor + */ + public Period() { + super(); + } + + /** + * @return {@link #start} (The start of the period. The boundary is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public DateTimeType getStartElement() { + if (this.start == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Period.start"); + else if (Configuration.doAutoCreate()) + this.start = new DateTimeType(); // bb + return this.start; + } + + public boolean hasStartElement() { + return this.start != null && !this.start.isEmpty(); + } + + public boolean hasStart() { + return this.start != null && !this.start.isEmpty(); + } + + /** + * @param value {@link #start} (The start of the period. The boundary is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public Period setStartElement(DateTimeType value) { + this.start = value; + return this; + } + + /** + * @return The start of the period. The boundary is inclusive. + */ + public Date getStart() { + return this.start == null ? null : this.start.getValue(); + } + + /** + * @param value The start of the period. The boundary is inclusive. + */ + public Period setStart(Date value) { + if (value == null) + this.start = null; + else { + if (this.start == null) + this.start = new DateTimeType(); + this.start.setValue(value); + } + return this; + } + + /** + * @return {@link #end} (The end of the period. If the end of the period is missing, it means that the period is ongoing.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public DateTimeType getEndElement() { + if (this.end == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Period.end"); + else if (Configuration.doAutoCreate()) + this.end = new DateTimeType(); // bb + return this.end; + } + + public boolean hasEndElement() { + return this.end != null && !this.end.isEmpty(); + } + + public boolean hasEnd() { + return this.end != null && !this.end.isEmpty(); + } + + /** + * @param value {@link #end} (The end of the period. If the end of the period is missing, it means that the period is ongoing.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public Period setEndElement(DateTimeType value) { + this.end = value; + return this; + } + + /** + * @return The end of the period. If the end of the period is missing, it means that the period is ongoing. + */ + public Date getEnd() { + return this.end == null ? null : this.end.getValue(); + } + + /** + * @param value The end of the period. If the end of the period is missing, it means that the period is ongoing. + */ + public Period setEnd(Date value) { + if (value == null) + this.end = null; + else { + if (this.end == null) + this.end = new DateTimeType(); + this.end.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("start", "dateTime", "The start of the period. The boundary is inclusive.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("end", "dateTime", "The end of the period. If the end of the period is missing, it means that the period is ongoing.", 0, java.lang.Integer.MAX_VALUE, end)); + } + + public Period copy() { + Period dst = new Period(); + copyValues(dst); + dst.start = start == null ? null : start.copy(); + dst.end = end == null ? null : end.copy(); + return dst; + } + + protected Period typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Period)) + return false; + Period o = (Period) other; + return compareDeep(start, o.start, true) && compareDeep(end, o.end, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Period)) + return false; + Period o = (Period) other; + return compareValues(start, o.start, true) && compareValues(end, o.end, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Person.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Person.java index 726ad28782e..113dc84b8bb 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Person.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Person.java @@ -1,1048 +1,1027 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Demographics and administrative information about a person independent of a specific health-related context. - */ -@ResourceDef(name="Person", profile="http://hl7.org/fhir/Profile/Person") -public class Person extends DomainResource { - - public enum AdministrativeGender { - /** - * Male - */ - MALE, - /** - * Female - */ - FEMALE, - /** - * Other - */ - OTHER, - /** - * Unknown - */ - UNKNOWN, - /** - * added to help the parsers - */ - NULL; - public static AdministrativeGender fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return MALE; - if ("female".equals(codeString)) - return FEMALE; - if ("other".equals(codeString)) - return OTHER; - if ("unknown".equals(codeString)) - return UNKNOWN; - throw new Exception("Unknown AdministrativeGender code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case MALE: return "male"; - case FEMALE: return "female"; - case OTHER: return "other"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MALE: return ""; - case FEMALE: return ""; - case OTHER: return ""; - case UNKNOWN: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MALE: return "Male"; - case FEMALE: return "Female"; - case OTHER: return "Other"; - case UNKNOWN: return "Unknown"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MALE: return "Male"; - case FEMALE: return "Female"; - case OTHER: return "Other"; - case UNKNOWN: return "Unknown"; - default: return "?"; - } - } - } - - public static class AdministrativeGenderEnumFactory implements EnumFactory { - public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return AdministrativeGender.MALE; - if ("female".equals(codeString)) - return AdministrativeGender.FEMALE; - if ("other".equals(codeString)) - return AdministrativeGender.OTHER; - if ("unknown".equals(codeString)) - return AdministrativeGender.UNKNOWN; - throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); - } - public String toCode(AdministrativeGender code) { - if (code == AdministrativeGender.MALE) - return "male"; - if (code == AdministrativeGender.FEMALE) - return "female"; - if (code == AdministrativeGender.OTHER) - return "other"; - if (code == AdministrativeGender.UNKNOWN) - return "unknown"; - return "?"; - } - } - - public enum IdentityAssuranceLevel { - /** - * Little or no confidence in the asserted identity's accuracy. - */ - LEVEL1, - /** - * Some confidence in the asserted identity's accuracy. - */ - LEVEL2, - /** - * High confidence in the asserted identity's accuracy. - */ - LEVEL3, - /** - * Very high confidence in the asserted identity's accuracy. - */ - LEVEL4, - /** - * added to help the parsers - */ - NULL; - public static IdentityAssuranceLevel fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("level1".equals(codeString)) - return LEVEL1; - if ("level2".equals(codeString)) - return LEVEL2; - if ("level3".equals(codeString)) - return LEVEL3; - if ("level4".equals(codeString)) - return LEVEL4; - throw new Exception("Unknown IdentityAssuranceLevel code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case LEVEL1: return "level1"; - case LEVEL2: return "level2"; - case LEVEL3: return "level3"; - case LEVEL4: return "level4"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case LEVEL1: return ""; - case LEVEL2: return ""; - case LEVEL3: return ""; - case LEVEL4: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case LEVEL1: return "Little or no confidence in the asserted identity's accuracy."; - case LEVEL2: return "Some confidence in the asserted identity's accuracy."; - case LEVEL3: return "High confidence in the asserted identity's accuracy."; - case LEVEL4: return "Very high confidence in the asserted identity's accuracy."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case LEVEL1: return "Level 1"; - case LEVEL2: return "Level 2"; - case LEVEL3: return "Level 3"; - case LEVEL4: return "Level 4"; - default: return "?"; - } - } - } - - public static class IdentityAssuranceLevelEnumFactory implements EnumFactory { - public IdentityAssuranceLevel fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("level1".equals(codeString)) - return IdentityAssuranceLevel.LEVEL1; - if ("level2".equals(codeString)) - return IdentityAssuranceLevel.LEVEL2; - if ("level3".equals(codeString)) - return IdentityAssuranceLevel.LEVEL3; - if ("level4".equals(codeString)) - return IdentityAssuranceLevel.LEVEL4; - throw new IllegalArgumentException("Unknown IdentityAssuranceLevel code '"+codeString+"'"); - } - public String toCode(IdentityAssuranceLevel code) { - if (code == IdentityAssuranceLevel.LEVEL1) - return "level1"; - if (code == IdentityAssuranceLevel.LEVEL2) - return "level2"; - if (code == IdentityAssuranceLevel.LEVEL3) - return "level3"; - if (code == IdentityAssuranceLevel.LEVEL4) - return "level4"; - return "?"; - } - } - - @Block() - public static class PersonLinkComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The resource to which this actual person is associated. - */ - @Child(name = "target", type = {Patient.class, Practitioner.class, RelatedPerson.class, Person.class}, order=1, min=1, max=1) - @Description(shortDefinition="The resource to which this actual person is associated", formalDefinition="The resource to which this actual person is associated." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (The resource to which this actual person is associated.) - */ - protected Resource targetTarget; - - /** - * Level of assurance that this link is actually associated with the target resource. - */ - @Child(name = "assurance", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="level1 | level2 | level3 | level4", formalDefinition="Level of assurance that this link is actually associated with the target resource." ) - protected Enumeration assurance; - - private static final long serialVersionUID = 508763647L; - - /* - * Constructor - */ - public PersonLinkComponent() { - super(); - } - - /* - * Constructor - */ - public PersonLinkComponent(Reference target) { - super(); - this.target = target; - } - - /** - * @return {@link #target} (The resource to which this actual person is associated.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PersonLinkComponent.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); // cc - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The resource to which this actual person is associated.) - */ - public PersonLinkComponent setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The resource to which this actual person is associated.) - */ - public Resource getTargetTarget() { - return this.targetTarget; - } - - /** - * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The resource to which this actual person is associated.) - */ - public PersonLinkComponent setTargetTarget(Resource value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #assurance} (Level of assurance that this link is actually associated with the target resource.). This is the underlying object with id, value and extensions. The accessor "getAssurance" gives direct access to the value - */ - public Enumeration getAssuranceElement() { - if (this.assurance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PersonLinkComponent.assurance"); - else if (Configuration.doAutoCreate()) - this.assurance = new Enumeration(new IdentityAssuranceLevelEnumFactory()); // bb - return this.assurance; - } - - public boolean hasAssuranceElement() { - return this.assurance != null && !this.assurance.isEmpty(); - } - - public boolean hasAssurance() { - return this.assurance != null && !this.assurance.isEmpty(); - } - - /** - * @param value {@link #assurance} (Level of assurance that this link is actually associated with the target resource.). This is the underlying object with id, value and extensions. The accessor "getAssurance" gives direct access to the value - */ - public PersonLinkComponent setAssuranceElement(Enumeration value) { - this.assurance = value; - return this; - } - - /** - * @return Level of assurance that this link is actually associated with the target resource. - */ - public IdentityAssuranceLevel getAssurance() { - return this.assurance == null ? null : this.assurance.getValue(); - } - - /** - * @param value Level of assurance that this link is actually associated with the target resource. - */ - public PersonLinkComponent setAssurance(IdentityAssuranceLevel value) { - if (value == null) - this.assurance = null; - else { - if (this.assurance == null) - this.assurance = new Enumeration(new IdentityAssuranceLevelEnumFactory()); - this.assurance.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("target", "Reference(Patient|Practitioner|RelatedPerson|Person)", "The resource to which this actual person is associated.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("assurance", "code", "Level of assurance that this link is actually associated with the target resource.", 0, java.lang.Integer.MAX_VALUE, assurance)); - } - - public PersonLinkComponent copy() { - PersonLinkComponent dst = new PersonLinkComponent(); - copyValues(dst); - dst.target = target == null ? null : target.copy(); - dst.assurance = assurance == null ? null : assurance.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof PersonLinkComponent)) - return false; - PersonLinkComponent o = (PersonLinkComponent) other; - return compareDeep(target, o.target, true) && compareDeep(assurance, o.assurance, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof PersonLinkComponent)) - return false; - PersonLinkComponent o = (PersonLinkComponent) other; - return compareValues(assurance, o.assurance, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (target == null || target.isEmpty()) && (assurance == null || assurance.isEmpty()) - ; - } - - } - - /** - * Identifier for a person within a particular scope. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A Human identifier for this person", formalDefinition="Identifier for a person within a particular scope." ) - protected List identifier; - - /** - * A name associated with the person. - */ - @Child(name = "name", type = {HumanName.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." ) - protected List name; - - /** - * A contact detail for the person, e.g. a telephone number or an email address. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." ) - protected List telecom; - - /** - * Administrative Gender. - */ - @Child(name = "gender", type = {CodeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender." ) - protected Enumeration gender; - - /** - * The birth date for the person. - */ - @Child(name = "birthDate", type = {DateTimeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="The birth date for the person", formalDefinition="The birth date for the person." ) - protected DateTimeType birthDate; - - /** - * One or more addresses for the person. - */ - @Child(name = "address", type = {Address.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="One or more addresses for the person", formalDefinition="One or more addresses for the person." ) - protected List
address; - - /** - * An image that can be displayed as a thumbnail of the person to enhance the identification of the individual. - */ - @Child(name = "photo", type = {Attachment.class}, order=6, min=0, max=1) - @Description(shortDefinition="Image of the Person", formalDefinition="An image that can be displayed as a thumbnail of the person to enhance the identification of the individual." ) - protected Attachment photo; - - /** - * The Organization that is the custodian of the person record. - */ - @Child(name = "managingOrganization", type = {Organization.class}, order=7, min=0, max=1) - @Description(shortDefinition="The Organization that is the custodian of the person record", formalDefinition="The Organization that is the custodian of the person record." ) - protected Reference managingOrganization; - - /** - * The actual object that is the target of the reference (The Organization that is the custodian of the person record.) - */ - protected Organization managingOrganizationTarget; - - /** - * Whether this person's record is in active use. - */ - @Child(name = "active", type = {BooleanType.class}, order=8, min=0, max=1) - @Description(shortDefinition="This person's record is in active use", formalDefinition="Whether this person's record is in active use." ) - protected BooleanType active; - - /** - * Link to a resource that concerns the same actual person. - */ - @Child(name = "link", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Link to a resource that concerns the same actual person", formalDefinition="Link to a resource that concerns the same actual person." ) - protected List link; - - private static final long serialVersionUID = -2072707611L; - - /* - * Constructor - */ - public Person() { - super(); - } - - /** - * @return {@link #identifier} (Identifier for a person within a particular scope.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifier for a person within a particular scope.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Person addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #name} (A name associated with the person.) - */ - public List getName() { - if (this.name == null) - this.name = new ArrayList(); - return this.name; - } - - public boolean hasName() { - if (this.name == null) - return false; - for (HumanName item : this.name) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #name} (A name associated with the person.) - */ - // syntactic sugar - public HumanName addName() { //3 - HumanName t = new HumanName(); - if (this.name == null) - this.name = new ArrayList(); - this.name.add(t); - return t; - } - - // syntactic sugar - public Person addName(HumanName t) { //3 - if (t == null) - return this; - if (this.name == null) - this.name = new ArrayList(); - this.name.add(t); - return this; - } - - /** - * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public Person addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #gender} (Administrative Gender.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Enumeration getGenderElement() { - if (this.gender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Person.gender"); - else if (Configuration.doAutoCreate()) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb - return this.gender; - } - - public boolean hasGenderElement() { - return this.gender != null && !this.gender.isEmpty(); - } - - public boolean hasGender() { - return this.gender != null && !this.gender.isEmpty(); - } - - /** - * @param value {@link #gender} (Administrative Gender.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Person setGenderElement(Enumeration value) { - this.gender = value; - return this; - } - - /** - * @return Administrative Gender. - */ - public AdministrativeGender getGender() { - return this.gender == null ? null : this.gender.getValue(); - } - - /** - * @param value Administrative Gender. - */ - public Person setGender(AdministrativeGender value) { - if (value == null) - this.gender = null; - else { - if (this.gender == null) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); - this.gender.setValue(value); - } - return this; - } - - /** - * @return {@link #birthDate} (The birth date for the person.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value - */ - public DateTimeType getBirthDateElement() { - if (this.birthDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Person.birthDate"); - else if (Configuration.doAutoCreate()) - this.birthDate = new DateTimeType(); // bb - return this.birthDate; - } - - public boolean hasBirthDateElement() { - return this.birthDate != null && !this.birthDate.isEmpty(); - } - - public boolean hasBirthDate() { - return this.birthDate != null && !this.birthDate.isEmpty(); - } - - /** - * @param value {@link #birthDate} (The birth date for the person.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value - */ - public Person setBirthDateElement(DateTimeType value) { - this.birthDate = value; - return this; - } - - /** - * @return The birth date for the person. - */ - public Date getBirthDate() { - return this.birthDate == null ? null : this.birthDate.getValue(); - } - - /** - * @param value The birth date for the person. - */ - public Person setBirthDate(Date value) { - if (value == null) - this.birthDate = null; - else { - if (this.birthDate == null) - this.birthDate = new DateTimeType(); - this.birthDate.setValue(value); - } - return this; - } - - /** - * @return {@link #address} (One or more addresses for the person.) - */ - public List
getAddress() { - if (this.address == null) - this.address = new ArrayList
(); - return this.address; - } - - public boolean hasAddress() { - if (this.address == null) - return false; - for (Address item : this.address) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #address} (One or more addresses for the person.) - */ - // syntactic sugar - public Address addAddress() { //3 - Address t = new Address(); - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return t; - } - - // syntactic sugar - public Person addAddress(Address t) { //3 - if (t == null) - return this; - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return this; - } - - /** - * @return {@link #photo} (An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.) - */ - public Attachment getPhoto() { - if (this.photo == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Person.photo"); - else if (Configuration.doAutoCreate()) - this.photo = new Attachment(); // cc - return this.photo; - } - - public boolean hasPhoto() { - return this.photo != null && !this.photo.isEmpty(); - } - - /** - * @param value {@link #photo} (An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.) - */ - public Person setPhoto(Attachment value) { - this.photo = value; - return this; - } - - /** - * @return {@link #managingOrganization} (The Organization that is the custodian of the person record.) - */ - public Reference getManagingOrganization() { - if (this.managingOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Person.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganization = new Reference(); // cc - return this.managingOrganization; - } - - public boolean hasManagingOrganization() { - return this.managingOrganization != null && !this.managingOrganization.isEmpty(); - } - - /** - * @param value {@link #managingOrganization} (The Organization that is the custodian of the person record.) - */ - public Person setManagingOrganization(Reference value) { - this.managingOrganization = value; - return this; - } - - /** - * @return {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Organization that is the custodian of the person record.) - */ - public Organization getManagingOrganizationTarget() { - if (this.managingOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Person.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganizationTarget = new Organization(); // aa - return this.managingOrganizationTarget; - } - - /** - * @param value {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Organization that is the custodian of the person record.) - */ - public Person setManagingOrganizationTarget(Organization value) { - this.managingOrganizationTarget = value; - return this; - } - - /** - * @return {@link #active} (Whether this person's record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public BooleanType getActiveElement() { - if (this.active == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Person.active"); - else if (Configuration.doAutoCreate()) - this.active = new BooleanType(); // bb - return this.active; - } - - public boolean hasActiveElement() { - return this.active != null && !this.active.isEmpty(); - } - - public boolean hasActive() { - return this.active != null && !this.active.isEmpty(); - } - - /** - * @param value {@link #active} (Whether this person's record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public Person setActiveElement(BooleanType value) { - this.active = value; - return this; - } - - /** - * @return Whether this person's record is in active use. - */ - public boolean getActive() { - return this.active == null || this.active.isEmpty() ? false : this.active.getValue(); - } - - /** - * @param value Whether this person's record is in active use. - */ - public Person setActive(boolean value) { - if (this.active == null) - this.active = new BooleanType(); - this.active.setValue(value); - return this; - } - - /** - * @return {@link #link} (Link to a resource that concerns the same actual person.) - */ - public List getLink() { - if (this.link == null) - this.link = new ArrayList(); - return this.link; - } - - public boolean hasLink() { - if (this.link == null) - return false; - for (PersonLinkComponent item : this.link) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #link} (Link to a resource that concerns the same actual person.) - */ - // syntactic sugar - public PersonLinkComponent addLink() { //3 - PersonLinkComponent t = new PersonLinkComponent(); - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return t; - } - - // syntactic sugar - public Person addLink(PersonLinkComponent t) { //3 - if (t == null) - return this; - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier for a person within a particular scope.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the person, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("gender", "code", "Administrative Gender.", 0, java.lang.Integer.MAX_VALUE, gender)); - childrenList.add(new Property("birthDate", "dateTime", "The birth date for the person.", 0, java.lang.Integer.MAX_VALUE, birthDate)); - childrenList.add(new Property("address", "Address", "One or more addresses for the person.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("photo", "Attachment", "An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.", 0, java.lang.Integer.MAX_VALUE, photo)); - childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The Organization that is the custodian of the person record.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); - childrenList.add(new Property("active", "boolean", "Whether this person's record is in active use.", 0, java.lang.Integer.MAX_VALUE, active)); - childrenList.add(new Property("link", "", "Link to a resource that concerns the same actual person.", 0, java.lang.Integer.MAX_VALUE, link)); - } - - public Person copy() { - Person dst = new Person(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - if (name != null) { - dst.name = new ArrayList(); - for (HumanName i : name) - dst.name.add(i.copy()); - }; - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.gender = gender == null ? null : gender.copy(); - dst.birthDate = birthDate == null ? null : birthDate.copy(); - if (address != null) { - dst.address = new ArrayList
(); - for (Address i : address) - dst.address.add(i.copy()); - }; - dst.photo = photo == null ? null : photo.copy(); - dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); - dst.active = active == null ? null : active.copy(); - if (link != null) { - dst.link = new ArrayList(); - for (PersonLinkComponent i : link) - dst.link.add(i.copy()); - }; - return dst; - } - - protected Person typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Person)) - return false; - Person o = (Person) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) - && compareDeep(gender, o.gender, true) && compareDeep(birthDate, o.birthDate, true) && compareDeep(address, o.address, true) - && compareDeep(photo, o.photo, true) && compareDeep(managingOrganization, o.managingOrganization, true) - && compareDeep(active, o.active, true) && compareDeep(link, o.link, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Person)) - return false; - Person o = (Person) other; - return compareValues(gender, o.gender, true) && compareValues(birthDate, o.birthDate, true) && compareValues(active, o.active, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) - && (telecom == null || telecom.isEmpty()) && (gender == null || gender.isEmpty()) && (birthDate == null || birthDate.isEmpty()) - && (address == null || address.isEmpty()) && (photo == null || photo.isEmpty()) && (managingOrganization == null || managingOrganization.isEmpty()) - && (active == null || active.isEmpty()) && (link == null || link.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Person; - } - - @SearchParamDefinition(name="organization", path="Person.managingOrganization", description="The organization at which this person record is being managed", type="reference" ) - public static final String SP_ORGANIZATION = "organization"; - @SearchParamDefinition(name="patient", path="Person.link.target", description="The Person links to this Patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="phonetic", path="", description="A portion of name using some kind of phonetic matching algorithm", type="string" ) - public static final String SP_PHONETIC = "phonetic"; - @SearchParamDefinition(name="practitioner", path="Person.link.target", description="The Person links to this Practitioner", type="reference" ) - public static final String SP_PRACTITIONER = "practitioner"; - @SearchParamDefinition(name="address", path="Person.address", description="An address in any kind of address/part", type="string" ) - public static final String SP_ADDRESS = "address"; - @SearchParamDefinition(name="link", path="Person.link.target", description="Any link has this Patient, Person, RelatedPerson or Practitioner reference", type="reference" ) - public static final String SP_LINK = "link"; - @SearchParamDefinition(name="name", path="Person.name", description="A portion of name in any name part", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="birthdate", path="Person.birthDate", description="The person's date of birth", type="date" ) - public static final String SP_BIRTHDATE = "birthdate"; - @SearchParamDefinition(name="telecom", path="Person.telecom", description="The value in any kind of contact", type="token" ) - public static final String SP_TELECOM = "telecom"; - @SearchParamDefinition(name="gender", path="Person.gender", description="The gender of the person", type="token" ) - public static final String SP_GENDER = "gender"; - @SearchParamDefinition(name="identifier", path="Person.identifier", description="A person Identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="relatedperson", path="Person.link.target", description="The Person links to this RelatedPerson", type="reference" ) - public static final String SP_RELATEDPERSON = "relatedperson"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Demographics and administrative information about a person independent of a specific health-related context. + */ +@ResourceDef(name="Person", profile="http://hl7.org/fhir/Profile/Person") +public class Person extends DomainResource { + + public enum AdministrativeGender { + /** + * Male + */ + MALE, + /** + * Female + */ + FEMALE, + /** + * Other + */ + OTHER, + /** + * Unknown + */ + UNKNOWN, + /** + * added to help the parsers + */ + NULL; + public static AdministrativeGender fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return MALE; + if ("female".equals(codeString)) + return FEMALE; + if ("other".equals(codeString)) + return OTHER; + if ("unknown".equals(codeString)) + return UNKNOWN; + throw new Exception("Unknown AdministrativeGender code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case MALE: return "male"; + case FEMALE: return "female"; + case OTHER: return "other"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MALE: return ""; + case FEMALE: return ""; + case OTHER: return ""; + case UNKNOWN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MALE: return "Male"; + case FEMALE: return "Female"; + case OTHER: return "Other"; + case UNKNOWN: return "Unknown"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MALE: return "Male"; + case FEMALE: return "Female"; + case OTHER: return "Other"; + case UNKNOWN: return "Unknown"; + default: return "?"; + } + } + } + + public static class AdministrativeGenderEnumFactory implements EnumFactory { + public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return AdministrativeGender.MALE; + if ("female".equals(codeString)) + return AdministrativeGender.FEMALE; + if ("other".equals(codeString)) + return AdministrativeGender.OTHER; + if ("unknown".equals(codeString)) + return AdministrativeGender.UNKNOWN; + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); + } + public String toCode(AdministrativeGender code) { + if (code == AdministrativeGender.MALE) + return "male"; + if (code == AdministrativeGender.FEMALE) + return "female"; + if (code == AdministrativeGender.OTHER) + return "other"; + if (code == AdministrativeGender.UNKNOWN) + return "unknown"; + return "?"; + } + } + + public enum IdentityAssuranceLevel { + /** + * Little or no confidence in the asserted identity's accuracy. + */ + LEVEL1, + /** + * Some confidence in the asserted identity's accuracy. + */ + LEVEL2, + /** + * High confidence in the asserted identity's accuracy. + */ + LEVEL3, + /** + * Very high confidence in the asserted identity's accuracy. + */ + LEVEL4, + /** + * added to help the parsers + */ + NULL; + public static IdentityAssuranceLevel fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("level1".equals(codeString)) + return LEVEL1; + if ("level2".equals(codeString)) + return LEVEL2; + if ("level3".equals(codeString)) + return LEVEL3; + if ("level4".equals(codeString)) + return LEVEL4; + throw new Exception("Unknown IdentityAssuranceLevel code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case LEVEL1: return "level1"; + case LEVEL2: return "level2"; + case LEVEL3: return "level3"; + case LEVEL4: return "level4"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case LEVEL1: return ""; + case LEVEL2: return ""; + case LEVEL3: return ""; + case LEVEL4: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case LEVEL1: return "Little or no confidence in the asserted identity's accuracy."; + case LEVEL2: return "Some confidence in the asserted identity's accuracy."; + case LEVEL3: return "High confidence in the asserted identity's accuracy."; + case LEVEL4: return "Very high confidence in the asserted identity's accuracy."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case LEVEL1: return "Level 1"; + case LEVEL2: return "Level 2"; + case LEVEL3: return "Level 3"; + case LEVEL4: return "Level 4"; + default: return "?"; + } + } + } + + public static class IdentityAssuranceLevelEnumFactory implements EnumFactory { + public IdentityAssuranceLevel fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("level1".equals(codeString)) + return IdentityAssuranceLevel.LEVEL1; + if ("level2".equals(codeString)) + return IdentityAssuranceLevel.LEVEL2; + if ("level3".equals(codeString)) + return IdentityAssuranceLevel.LEVEL3; + if ("level4".equals(codeString)) + return IdentityAssuranceLevel.LEVEL4; + throw new IllegalArgumentException("Unknown IdentityAssuranceLevel code '"+codeString+"'"); + } + public String toCode(IdentityAssuranceLevel code) { + if (code == IdentityAssuranceLevel.LEVEL1) + return "level1"; + if (code == IdentityAssuranceLevel.LEVEL2) + return "level2"; + if (code == IdentityAssuranceLevel.LEVEL3) + return "level3"; + if (code == IdentityAssuranceLevel.LEVEL4) + return "level4"; + return "?"; + } + } + + @Block() + public static class PersonLinkComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The resource to which this actual person is associated. + */ + @Child(name = "target", type = {Patient.class, Practitioner.class, RelatedPerson.class, Person.class}, order=1, min=1, max=1) + @Description(shortDefinition="The resource to which this actual person is associated", formalDefinition="The resource to which this actual person is associated." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (The resource to which this actual person is associated.) + */ + protected Resource targetTarget; + + /** + * Level of assurance that this link is actually associated with the target resource. + */ + @Child(name = "assurance", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="level1 | level2 | level3 | level4", formalDefinition="Level of assurance that this link is actually associated with the target resource." ) + protected Enumeration assurance; + + private static final long serialVersionUID = 508763647L; + + /* + * Constructor + */ + public PersonLinkComponent() { + super(); + } + + /* + * Constructor + */ + public PersonLinkComponent(Reference target) { + super(); + this.target = target; + } + + /** + * @return {@link #target} (The resource to which this actual person is associated.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PersonLinkComponent.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); // cc + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The resource to which this actual person is associated.) + */ + public PersonLinkComponent setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The resource to which this actual person is associated.) + */ + public Resource getTargetTarget() { + return this.targetTarget; + } + + /** + * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The resource to which this actual person is associated.) + */ + public PersonLinkComponent setTargetTarget(Resource value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #assurance} (Level of assurance that this link is actually associated with the target resource.). This is the underlying object with id, value and extensions. The accessor "getAssurance" gives direct access to the value + */ + public Enumeration getAssuranceElement() { + if (this.assurance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PersonLinkComponent.assurance"); + else if (Configuration.doAutoCreate()) + this.assurance = new Enumeration(new IdentityAssuranceLevelEnumFactory()); // bb + return this.assurance; + } + + public boolean hasAssuranceElement() { + return this.assurance != null && !this.assurance.isEmpty(); + } + + public boolean hasAssurance() { + return this.assurance != null && !this.assurance.isEmpty(); + } + + /** + * @param value {@link #assurance} (Level of assurance that this link is actually associated with the target resource.). This is the underlying object with id, value and extensions. The accessor "getAssurance" gives direct access to the value + */ + public PersonLinkComponent setAssuranceElement(Enumeration value) { + this.assurance = value; + return this; + } + + /** + * @return Level of assurance that this link is actually associated with the target resource. + */ + public IdentityAssuranceLevel getAssurance() { + return this.assurance == null ? null : this.assurance.getValue(); + } + + /** + * @param value Level of assurance that this link is actually associated with the target resource. + */ + public PersonLinkComponent setAssurance(IdentityAssuranceLevel value) { + if (value == null) + this.assurance = null; + else { + if (this.assurance == null) + this.assurance = new Enumeration(new IdentityAssuranceLevelEnumFactory()); + this.assurance.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("target", "Reference(Patient|Practitioner|RelatedPerson|Person)", "The resource to which this actual person is associated.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("assurance", "code", "Level of assurance that this link is actually associated with the target resource.", 0, java.lang.Integer.MAX_VALUE, assurance)); + } + + public PersonLinkComponent copy() { + PersonLinkComponent dst = new PersonLinkComponent(); + copyValues(dst); + dst.target = target == null ? null : target.copy(); + dst.assurance = assurance == null ? null : assurance.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof PersonLinkComponent)) + return false; + PersonLinkComponent o = (PersonLinkComponent) other; + return compareDeep(target, o.target, true) && compareDeep(assurance, o.assurance, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof PersonLinkComponent)) + return false; + PersonLinkComponent o = (PersonLinkComponent) other; + return compareValues(assurance, o.assurance, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (target == null || target.isEmpty()) && (assurance == null || assurance.isEmpty()) + ; + } + + } + + /** + * Identifier for a person within a particular scope. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A Human identifier for this person", formalDefinition="Identifier for a person within a particular scope." ) + protected List identifier; + + /** + * A name associated with the person. + */ + @Child(name = "name", type = {HumanName.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." ) + protected List name; + + /** + * A contact detail for the person, e.g. a telephone number or an email address. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." ) + protected List telecom; + + /** + * Administrative Gender. + */ + @Child(name = "gender", type = {CodeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender." ) + protected Enumeration gender; + + /** + * The birth date for the person. + */ + @Child(name = "birthDate", type = {DateTimeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="The birth date for the person", formalDefinition="The birth date for the person." ) + protected DateTimeType birthDate; + + /** + * One or more addresses for the person. + */ + @Child(name = "address", type = {Address.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="One or more addresses for the person", formalDefinition="One or more addresses for the person." ) + protected List
address; + + /** + * An image that can be displayed as a thumbnail of the person to enhance the identification of the individual. + */ + @Child(name = "photo", type = {Attachment.class}, order=6, min=0, max=1) + @Description(shortDefinition="Image of the Person", formalDefinition="An image that can be displayed as a thumbnail of the person to enhance the identification of the individual." ) + protected Attachment photo; + + /** + * The Organization that is the custodian of the person record. + */ + @Child(name = "managingOrganization", type = {Organization.class}, order=7, min=0, max=1) + @Description(shortDefinition="The Organization that is the custodian of the person record", formalDefinition="The Organization that is the custodian of the person record." ) + protected Reference managingOrganization; + + /** + * The actual object that is the target of the reference (The Organization that is the custodian of the person record.) + */ + protected Organization managingOrganizationTarget; + + /** + * Whether this person's record is in active use. + */ + @Child(name = "active", type = {BooleanType.class}, order=8, min=0, max=1) + @Description(shortDefinition="This person's record is in active use", formalDefinition="Whether this person's record is in active use." ) + protected BooleanType active; + + /** + * Link to a resource that concerns the same actual person. + */ + @Child(name = "link", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Link to a resource that concerns the same actual person", formalDefinition="Link to a resource that concerns the same actual person." ) + protected List link; + + private static final long serialVersionUID = -2072707611L; + + /* + * Constructor + */ + public Person() { + super(); + } + + /** + * @return {@link #identifier} (Identifier for a person within a particular scope.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Identifier for a person within a particular scope.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Person addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #name} (A name associated with the person.) + */ + public List getName() { + if (this.name == null) + this.name = new ArrayList(); + return this.name; + } + + public boolean hasName() { + if (this.name == null) + return false; + for (HumanName item : this.name) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #name} (A name associated with the person.) + */ + // syntactic sugar + public HumanName addName() { //3 + HumanName t = new HumanName(); + if (this.name == null) + this.name = new ArrayList(); + this.name.add(t); + return t; + } + + // syntactic sugar + public Person addName(HumanName t) { //3 + if (t == null) + return this; + if (this.name == null) + this.name = new ArrayList(); + this.name.add(t); + return this; + } + + /** + * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public Person addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @return {@link #gender} (Administrative Gender.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Enumeration getGenderElement() { + if (this.gender == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Person.gender"); + else if (Configuration.doAutoCreate()) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb + return this.gender; + } + + public boolean hasGenderElement() { + return this.gender != null && !this.gender.isEmpty(); + } + + public boolean hasGender() { + return this.gender != null && !this.gender.isEmpty(); + } + + /** + * @param value {@link #gender} (Administrative Gender.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Person setGenderElement(Enumeration value) { + this.gender = value; + return this; + } + + /** + * @return Administrative Gender. + */ + public AdministrativeGender getGender() { + return this.gender == null ? null : this.gender.getValue(); + } + + /** + * @param value Administrative Gender. + */ + public Person setGender(AdministrativeGender value) { + if (value == null) + this.gender = null; + else { + if (this.gender == null) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); + this.gender.setValue(value); + } + return this; + } + + /** + * @return {@link #birthDate} (The birth date for the person.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value + */ + public DateTimeType getBirthDateElement() { + if (this.birthDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Person.birthDate"); + else if (Configuration.doAutoCreate()) + this.birthDate = new DateTimeType(); // bb + return this.birthDate; + } + + public boolean hasBirthDateElement() { + return this.birthDate != null && !this.birthDate.isEmpty(); + } + + public boolean hasBirthDate() { + return this.birthDate != null && !this.birthDate.isEmpty(); + } + + /** + * @param value {@link #birthDate} (The birth date for the person.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value + */ + public Person setBirthDateElement(DateTimeType value) { + this.birthDate = value; + return this; + } + + /** + * @return The birth date for the person. + */ + public Date getBirthDate() { + return this.birthDate == null ? null : this.birthDate.getValue(); + } + + /** + * @param value The birth date for the person. + */ + public Person setBirthDate(Date value) { + if (value == null) + this.birthDate = null; + else { + if (this.birthDate == null) + this.birthDate = new DateTimeType(); + this.birthDate.setValue(value); + } + return this; + } + + /** + * @return {@link #address} (One or more addresses for the person.) + */ + public List
getAddress() { + if (this.address == null) + this.address = new ArrayList
(); + return this.address; + } + + public boolean hasAddress() { + if (this.address == null) + return false; + for (Address item : this.address) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #address} (One or more addresses for the person.) + */ + // syntactic sugar + public Address addAddress() { //3 + Address t = new Address(); + if (this.address == null) + this.address = new ArrayList
(); + this.address.add(t); + return t; + } + + // syntactic sugar + public Person addAddress(Address t) { //3 + if (t == null) + return this; + if (this.address == null) + this.address = new ArrayList
(); + this.address.add(t); + return this; + } + + /** + * @return {@link #photo} (An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.) + */ + public Attachment getPhoto() { + if (this.photo == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Person.photo"); + else if (Configuration.doAutoCreate()) + this.photo = new Attachment(); // cc + return this.photo; + } + + public boolean hasPhoto() { + return this.photo != null && !this.photo.isEmpty(); + } + + /** + * @param value {@link #photo} (An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.) + */ + public Person setPhoto(Attachment value) { + this.photo = value; + return this; + } + + /** + * @return {@link #managingOrganization} (The Organization that is the custodian of the person record.) + */ + public Reference getManagingOrganization() { + if (this.managingOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Person.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganization = new Reference(); // cc + return this.managingOrganization; + } + + public boolean hasManagingOrganization() { + return this.managingOrganization != null && !this.managingOrganization.isEmpty(); + } + + /** + * @param value {@link #managingOrganization} (The Organization that is the custodian of the person record.) + */ + public Person setManagingOrganization(Reference value) { + this.managingOrganization = value; + return this; + } + + /** + * @return {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Organization that is the custodian of the person record.) + */ + public Organization getManagingOrganizationTarget() { + if (this.managingOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Person.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganizationTarget = new Organization(); // aa + return this.managingOrganizationTarget; + } + + /** + * @param value {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Organization that is the custodian of the person record.) + */ + public Person setManagingOrganizationTarget(Organization value) { + this.managingOrganizationTarget = value; + return this; + } + + /** + * @return {@link #active} (Whether this person's record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value + */ + public BooleanType getActiveElement() { + if (this.active == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Person.active"); + else if (Configuration.doAutoCreate()) + this.active = new BooleanType(); // bb + return this.active; + } + + public boolean hasActiveElement() { + return this.active != null && !this.active.isEmpty(); + } + + public boolean hasActive() { + return this.active != null && !this.active.isEmpty(); + } + + /** + * @param value {@link #active} (Whether this person's record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value + */ + public Person setActiveElement(BooleanType value) { + this.active = value; + return this; + } + + /** + * @return Whether this person's record is in active use. + */ + public boolean getActive() { + return this.active == null || this.active.isEmpty() ? false : this.active.getValue(); + } + + /** + * @param value Whether this person's record is in active use. + */ + public Person setActive(boolean value) { + if (this.active == null) + this.active = new BooleanType(); + this.active.setValue(value); + return this; + } + + /** + * @return {@link #link} (Link to a resource that concerns the same actual person.) + */ + public List getLink() { + if (this.link == null) + this.link = new ArrayList(); + return this.link; + } + + public boolean hasLink() { + if (this.link == null) + return false; + for (PersonLinkComponent item : this.link) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #link} (Link to a resource that concerns the same actual person.) + */ + // syntactic sugar + public PersonLinkComponent addLink() { //3 + PersonLinkComponent t = new PersonLinkComponent(); + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return t; + } + + // syntactic sugar + public Person addLink(PersonLinkComponent t) { //3 + if (t == null) + return this; + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier for a person within a particular scope.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the person, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("gender", "code", "Administrative Gender.", 0, java.lang.Integer.MAX_VALUE, gender)); + childrenList.add(new Property("birthDate", "dateTime", "The birth date for the person.", 0, java.lang.Integer.MAX_VALUE, birthDate)); + childrenList.add(new Property("address", "Address", "One or more addresses for the person.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("photo", "Attachment", "An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.", 0, java.lang.Integer.MAX_VALUE, photo)); + childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The Organization that is the custodian of the person record.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); + childrenList.add(new Property("active", "boolean", "Whether this person's record is in active use.", 0, java.lang.Integer.MAX_VALUE, active)); + childrenList.add(new Property("link", "", "Link to a resource that concerns the same actual person.", 0, java.lang.Integer.MAX_VALUE, link)); + } + + public Person copy() { + Person dst = new Person(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + if (name != null) { + dst.name = new ArrayList(); + for (HumanName i : name) + dst.name.add(i.copy()); + }; + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.gender = gender == null ? null : gender.copy(); + dst.birthDate = birthDate == null ? null : birthDate.copy(); + if (address != null) { + dst.address = new ArrayList
(); + for (Address i : address) + dst.address.add(i.copy()); + }; + dst.photo = photo == null ? null : photo.copy(); + dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); + dst.active = active == null ? null : active.copy(); + if (link != null) { + dst.link = new ArrayList(); + for (PersonLinkComponent i : link) + dst.link.add(i.copy()); + }; + return dst; + } + + protected Person typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Person)) + return false; + Person o = (Person) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) + && compareDeep(gender, o.gender, true) && compareDeep(birthDate, o.birthDate, true) && compareDeep(address, o.address, true) + && compareDeep(photo, o.photo, true) && compareDeep(managingOrganization, o.managingOrganization, true) + && compareDeep(active, o.active, true) && compareDeep(link, o.link, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Person)) + return false; + Person o = (Person) other; + return compareValues(gender, o.gender, true) && compareValues(birthDate, o.birthDate, true) && compareValues(active, o.active, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) + && (telecom == null || telecom.isEmpty()) && (gender == null || gender.isEmpty()) && (birthDate == null || birthDate.isEmpty()) + && (address == null || address.isEmpty()) && (photo == null || photo.isEmpty()) && (managingOrganization == null || managingOrganization.isEmpty()) + && (active == null || active.isEmpty()) && (link == null || link.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Person; + } + + @SearchParamDefinition(name="identifier", path="Person.identifier", description="A person Identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="phonetic", path="", description="A portion of name using some kind of phonetic matching algorithm", type="string" ) + public static final String SP_PHONETIC = "phonetic"; + @SearchParamDefinition(name="address", path="Person.address", description="An address in any kind of address/part", type="string" ) + public static final String SP_ADDRESS = "address"; + @SearchParamDefinition(name="birthdate", path="Person.birthDate", description="The person's date of birth", type="date" ) + public static final String SP_BIRTHDATE = "birthdate"; + @SearchParamDefinition(name="gender", path="Person.gender", description="The gender of the person", type="token" ) + public static final String SP_GENDER = "gender"; + @SearchParamDefinition(name="practitioner", path="Person.link.target", description="The Person links to this Practitioner", type="reference" ) + public static final String SP_PRACTITIONER = "practitioner"; + @SearchParamDefinition(name="patient", path="Person.link.target", description="The Person links to this Patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="organization", path="Person.managingOrganization", description="The organization at which this person record is being managed", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + @SearchParamDefinition(name="name", path="Person.name", description="A portion of name in any name part", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="link", path="Person.link.target", description="Any link has this Patient, Person, RelatedPerson or Practitioner reference", type="reference" ) + public static final String SP_LINK = "link"; + @SearchParamDefinition(name="telecom", path="Person.telecom", description="The value in any kind of contact", type="token" ) + public static final String SP_TELECOM = "telecom"; + @SearchParamDefinition(name="relatedperson", path="Person.link.target", description="The Person links to this RelatedPerson", type="reference" ) + public static final String SP_RELATEDPERSON = "relatedperson"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/PositiveIntType.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/PositiveIntType.java index cd190679fd1..fdc04b3f487 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/PositiveIntType.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/PositiveIntType.java @@ -1,115 +1,94 @@ -/* -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; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import org.hl7.fhir.instance.model.annotations.DatatypeDef; - -/** - * Primitive type "integer" in FHIR: A signed 32-bit integer - */ -@DatatypeDef(name = "positiveInt") -public class PositiveIntType extends IntegerType { - - /** - * - */ - private static final long serialVersionUID = 1686497884249402429L; - - /** - * Constructor - */ - public PositiveIntType() { - // nothing - } - - /** - * Constructor - */ - public PositiveIntType(int theInteger) { - setValue(theInteger); - } - - /** - * Constructor - * - * @param theIntegerAsString - * A string representation of an integer - * @throws IllegalArgumentException - * If the string is not a valid integer representation - */ - public PositiveIntType(String theIntegerAsString) { - setValueAsString(theIntegerAsString); - } - - /** - * Constructor - * - * @param theValue The value - * @throws IllegalArgumentException If the value is too large to fit in a signed integer - */ - public PositiveIntType(Long theValue) { - if (theValue < 1 || theValue > java.lang.Integer.MAX_VALUE) { - throw new IllegalArgumentException - (theValue + " cannot be cast to int without changing its value."); - } - if(theValue!=null) { - setValue((int)theValue.longValue()); - } - } - - @Override - public PositiveIntType copy() { - return new PositiveIntType(getValue()); - } - -} +/* +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; + +import org.hl7.fhir.instance.model.annotations.DatatypeDef; + +/** + * Primitive type "integer" in FHIR: A signed 32-bit integer + */ +@DatatypeDef(name = "positiveInt") +public class PositiveIntType extends IntegerType { + + /** + * + */ + private static final long serialVersionUID = 1686497884249402429L; + + /** + * Constructor + */ + public PositiveIntType() { + // nothing + } + + /** + * Constructor + */ + public PositiveIntType(int theInteger) { + setValue(theInteger); + } + + /** + * Constructor + * + * @param theIntegerAsString + * A string representation of an integer + * @throws IllegalArgumentException + * If the string is not a valid integer representation + */ + public PositiveIntType(String theIntegerAsString) { + setValueAsString(theIntegerAsString); + } + + /** + * Constructor + * + * @param theValue The value + * @throws IllegalArgumentException If the value is too large to fit in a signed integer + */ + public PositiveIntType(Long theValue) { + if (theValue < 1 || theValue > java.lang.Integer.MAX_VALUE) { + throw new IllegalArgumentException + (theValue + " cannot be cast to int without changing its value."); + } + if(theValue!=null) { + setValue((int)theValue.longValue()); + } + } + + @Override + public PositiveIntType copy() { + return new PositiveIntType(getValue()); + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Practitioner.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Practitioner.java index 606b0794636..606edab0b40 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Practitioner.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Practitioner.java @@ -1,1398 +1,1377 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A person who is directly or indirectly involved in the provisioning of healthcare. - */ -@ResourceDef(name="Practitioner", profile="http://hl7.org/fhir/Profile/Practitioner") -public class Practitioner extends DomainResource { - - public enum AdministrativeGender { - /** - * Male - */ - MALE, - /** - * Female - */ - FEMALE, - /** - * Other - */ - OTHER, - /** - * Unknown - */ - UNKNOWN, - /** - * added to help the parsers - */ - NULL; - public static AdministrativeGender fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return MALE; - if ("female".equals(codeString)) - return FEMALE; - if ("other".equals(codeString)) - return OTHER; - if ("unknown".equals(codeString)) - return UNKNOWN; - throw new Exception("Unknown AdministrativeGender code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case MALE: return "male"; - case FEMALE: return "female"; - case OTHER: return "other"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MALE: return ""; - case FEMALE: return ""; - case OTHER: return ""; - case UNKNOWN: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MALE: return "Male"; - case FEMALE: return "Female"; - case OTHER: return "Other"; - case UNKNOWN: return "Unknown"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MALE: return "Male"; - case FEMALE: return "Female"; - case OTHER: return "Other"; - case UNKNOWN: return "Unknown"; - default: return "?"; - } - } - } - - public static class AdministrativeGenderEnumFactory implements EnumFactory { - public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return AdministrativeGender.MALE; - if ("female".equals(codeString)) - return AdministrativeGender.FEMALE; - if ("other".equals(codeString)) - return AdministrativeGender.OTHER; - if ("unknown".equals(codeString)) - return AdministrativeGender.UNKNOWN; - throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); - } - public String toCode(AdministrativeGender code) { - if (code == AdministrativeGender.MALE) - return "male"; - if (code == AdministrativeGender.FEMALE) - return "female"; - if (code == AdministrativeGender.OTHER) - return "other"; - if (code == AdministrativeGender.UNKNOWN) - return "unknown"; - return "?"; - } - } - - @Block() - public static class PractitionerPractitionerRoleComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The Organization where the Practitioner performs the roles associated. - */ - @Child(name = "managingOrganization", type = {Organization.class}, order=1, min=0, max=1) - @Description(shortDefinition="The Organization where the Practitioner performs the roles associated", formalDefinition="The Organization where the Practitioner performs the roles associated." ) - protected Reference managingOrganization; - - /** - * The actual object that is the target of the reference (The Organization where the Practitioner performs the roles associated.) - */ - protected Organization managingOrganizationTarget; - - /** - * Roles which this practitioner is authorized to perform for the organization. - */ - @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Roles which this practitioner may perform", formalDefinition="Roles which this practitioner is authorized to perform for the organization." ) - protected CodeableConcept role; - - /** - * Specific specialty of the practitioner. - */ - @Child(name = "specialty", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Specific specialty of the practitioner", formalDefinition="Specific specialty of the practitioner." ) - protected List specialty; - - /** - * The period during which the person is authorized to act as a practitioner in these role(s) for the organization. - */ - @Child(name = "period", type = {Period.class}, order=4, min=0, max=1) - @Description(shortDefinition="The period during which the practitioner is authorized to perform in these role(s)", formalDefinition="The period during which the person is authorized to act as a practitioner in these role(s) for the organization." ) - protected Period period; - - /** - * The location(s) at which this practitioner provides care. - */ - @Child(name = "location", type = {Location.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The location(s) at which this practitioner provides care", formalDefinition="The location(s) at which this practitioner provides care." ) - protected List location; - /** - * The actual objects that are the target of the reference (The location(s) at which this practitioner provides care.) - */ - protected List locationTarget; - - - /** - * The list of healthcare services that this worker provides for this role's Organization/Location(s). - */ - @Child(name = "healthcareService", type = {HealthcareService.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The list of healthcare services that this worker provides for this role's Organization/Location(s)", formalDefinition="The list of healthcare services that this worker provides for this role's Organization/Location(s)." ) - protected List healthcareService; - /** - * The actual objects that are the target of the reference (The list of healthcare services that this worker provides for this role's Organization/Location(s).) - */ - protected List healthcareServiceTarget; - - - private static final long serialVersionUID = -2146177018L; - - /* - * Constructor - */ - public PractitionerPractitionerRoleComponent() { - super(); - } - - /** - * @return {@link #managingOrganization} (The Organization where the Practitioner performs the roles associated.) - */ - public Reference getManagingOrganization() { - if (this.managingOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerPractitionerRoleComponent.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganization = new Reference(); // cc - return this.managingOrganization; - } - - public boolean hasManagingOrganization() { - return this.managingOrganization != null && !this.managingOrganization.isEmpty(); - } - - /** - * @param value {@link #managingOrganization} (The Organization where the Practitioner performs the roles associated.) - */ - public PractitionerPractitionerRoleComponent setManagingOrganization(Reference value) { - this.managingOrganization = value; - return this; - } - - /** - * @return {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Organization where the Practitioner performs the roles associated.) - */ - public Organization getManagingOrganizationTarget() { - if (this.managingOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerPractitionerRoleComponent.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganizationTarget = new Organization(); // aa - return this.managingOrganizationTarget; - } - - /** - * @param value {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Organization where the Practitioner performs the roles associated.) - */ - public PractitionerPractitionerRoleComponent setManagingOrganizationTarget(Organization value) { - this.managingOrganizationTarget = value; - return this; - } - - /** - * @return {@link #role} (Roles which this practitioner is authorized to perform for the organization.) - */ - public CodeableConcept getRole() { - if (this.role == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerPractitionerRoleComponent.role"); - else if (Configuration.doAutoCreate()) - this.role = new CodeableConcept(); // cc - return this.role; - } - - public boolean hasRole() { - return this.role != null && !this.role.isEmpty(); - } - - /** - * @param value {@link #role} (Roles which this practitioner is authorized to perform for the organization.) - */ - public PractitionerPractitionerRoleComponent setRole(CodeableConcept value) { - this.role = value; - return this; - } - - /** - * @return {@link #specialty} (Specific specialty of the practitioner.) - */ - public List getSpecialty() { - if (this.specialty == null) - this.specialty = new ArrayList(); - return this.specialty; - } - - public boolean hasSpecialty() { - if (this.specialty == null) - return false; - for (CodeableConcept item : this.specialty) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specialty} (Specific specialty of the practitioner.) - */ - // syntactic sugar - public CodeableConcept addSpecialty() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.specialty == null) - this.specialty = new ArrayList(); - this.specialty.add(t); - return t; - } - - // syntactic sugar - public PractitionerPractitionerRoleComponent addSpecialty(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.specialty == null) - this.specialty = new ArrayList(); - this.specialty.add(t); - return this; - } - - /** - * @return {@link #period} (The period during which the person is authorized to act as a practitioner in these role(s) for the organization.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerPractitionerRoleComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The period during which the person is authorized to act as a practitioner in these role(s) for the organization.) - */ - public PractitionerPractitionerRoleComponent setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #location} (The location(s) at which this practitioner provides care.) - */ - public List getLocation() { - if (this.location == null) - this.location = new ArrayList(); - return this.location; - } - - public boolean hasLocation() { - if (this.location == null) - return false; - for (Reference item : this.location) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #location} (The location(s) at which this practitioner provides care.) - */ - // syntactic sugar - public Reference addLocation() { //3 - Reference t = new Reference(); - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return t; - } - - // syntactic sugar - public PractitionerPractitionerRoleComponent addLocation(Reference t) { //3 - if (t == null) - return this; - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return this; - } - - /** - * @return {@link #location} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The location(s) at which this practitioner provides care.) - */ - public List getLocationTarget() { - if (this.locationTarget == null) - this.locationTarget = new ArrayList(); - return this.locationTarget; - } - - // syntactic sugar - /** - * @return {@link #location} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The location(s) at which this practitioner provides care.) - */ - public Location addLocationTarget() { - Location r = new Location(); - if (this.locationTarget == null) - this.locationTarget = new ArrayList(); - this.locationTarget.add(r); - return r; - } - - /** - * @return {@link #healthcareService} (The list of healthcare services that this worker provides for this role's Organization/Location(s).) - */ - public List getHealthcareService() { - if (this.healthcareService == null) - this.healthcareService = new ArrayList(); - return this.healthcareService; - } - - public boolean hasHealthcareService() { - if (this.healthcareService == null) - return false; - for (Reference item : this.healthcareService) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #healthcareService} (The list of healthcare services that this worker provides for this role's Organization/Location(s).) - */ - // syntactic sugar - public Reference addHealthcareService() { //3 - Reference t = new Reference(); - if (this.healthcareService == null) - this.healthcareService = new ArrayList(); - this.healthcareService.add(t); - return t; - } - - // syntactic sugar - public PractitionerPractitionerRoleComponent addHealthcareService(Reference t) { //3 - if (t == null) - return this; - if (this.healthcareService == null) - this.healthcareService = new ArrayList(); - this.healthcareService.add(t); - return this; - } - - /** - * @return {@link #healthcareService} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The list of healthcare services that this worker provides for this role's Organization/Location(s).) - */ - public List getHealthcareServiceTarget() { - if (this.healthcareServiceTarget == null) - this.healthcareServiceTarget = new ArrayList(); - return this.healthcareServiceTarget; - } - - // syntactic sugar - /** - * @return {@link #healthcareService} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The list of healthcare services that this worker provides for this role's Organization/Location(s).) - */ - public HealthcareService addHealthcareServiceTarget() { - HealthcareService r = new HealthcareService(); - if (this.healthcareServiceTarget == null) - this.healthcareServiceTarget = new ArrayList(); - this.healthcareServiceTarget.add(r); - return r; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The Organization where the Practitioner performs the roles associated.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); - childrenList.add(new Property("role", "CodeableConcept", "Roles which this practitioner is authorized to perform for the organization.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("specialty", "CodeableConcept", "Specific specialty of the practitioner.", 0, java.lang.Integer.MAX_VALUE, specialty)); - childrenList.add(new Property("period", "Period", "The period during which the person is authorized to act as a practitioner in these role(s) for the organization.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("location", "Reference(Location)", "The location(s) at which this practitioner provides care.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("healthcareService", "Reference(HealthcareService)", "The list of healthcare services that this worker provides for this role's Organization/Location(s).", 0, java.lang.Integer.MAX_VALUE, healthcareService)); - } - - public PractitionerPractitionerRoleComponent copy() { - PractitionerPractitionerRoleComponent dst = new PractitionerPractitionerRoleComponent(); - copyValues(dst); - dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); - dst.role = role == null ? null : role.copy(); - if (specialty != null) { - dst.specialty = new ArrayList(); - for (CodeableConcept i : specialty) - dst.specialty.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - if (location != null) { - dst.location = new ArrayList(); - for (Reference i : location) - dst.location.add(i.copy()); - }; - if (healthcareService != null) { - dst.healthcareService = new ArrayList(); - for (Reference i : healthcareService) - dst.healthcareService.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof PractitionerPractitionerRoleComponent)) - return false; - PractitionerPractitionerRoleComponent o = (PractitionerPractitionerRoleComponent) other; - return compareDeep(managingOrganization, o.managingOrganization, true) && compareDeep(role, o.role, true) - && compareDeep(specialty, o.specialty, true) && compareDeep(period, o.period, true) && compareDeep(location, o.location, true) - && compareDeep(healthcareService, o.healthcareService, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof PractitionerPractitionerRoleComponent)) - return false; - PractitionerPractitionerRoleComponent o = (PractitionerPractitionerRoleComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (managingOrganization == null || managingOrganization.isEmpty()) && (role == null || role.isEmpty()) - && (specialty == null || specialty.isEmpty()) && (period == null || period.isEmpty()) && (location == null || location.isEmpty()) - && (healthcareService == null || healthcareService.isEmpty()); - } - - } - - @Block() - public static class PractitionerQualificationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An identifier that applies to this person's qualification in this role. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="An identifier for this qualification for the practitioner", formalDefinition="An identifier that applies to this person's qualification in this role." ) - protected List identifier; - - /** - * Coded representation of the qualification. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=2, min=1, max=1) - @Description(shortDefinition="Coded representation of the qualification", formalDefinition="Coded representation of the qualification." ) - protected CodeableConcept code; - - /** - * Period during which the qualification is valid. - */ - @Child(name = "period", type = {Period.class}, order=3, min=0, max=1) - @Description(shortDefinition="Period during which the qualification is valid", formalDefinition="Period during which the qualification is valid." ) - protected Period period; - - /** - * Organization that regulates and issues the qualification. - */ - @Child(name = "issuer", type = {Organization.class}, order=4, min=0, max=1) - @Description(shortDefinition="Organization that regulates and issues the qualification", formalDefinition="Organization that regulates and issues the qualification." ) - protected Reference issuer; - - /** - * The actual object that is the target of the reference (Organization that regulates and issues the qualification.) - */ - protected Organization issuerTarget; - - private static final long serialVersionUID = 1095219071L; - - /* - * Constructor - */ - public PractitionerQualificationComponent() { - super(); - } - - /* - * Constructor - */ - public PractitionerQualificationComponent(CodeableConcept code) { - super(); - this.code = code; - } - - /** - * @return {@link #identifier} (An identifier that applies to this person's qualification in this role.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (An identifier that applies to this person's qualification in this role.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public PractitionerQualificationComponent addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #code} (Coded representation of the qualification.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerQualificationComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Coded representation of the qualification.) - */ - public PractitionerQualificationComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #period} (Period during which the qualification is valid.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerQualificationComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (Period during which the qualification is valid.) - */ - public PractitionerQualificationComponent setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #issuer} (Organization that regulates and issues the qualification.) - */ - public Reference getIssuer() { - if (this.issuer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerQualificationComponent.issuer"); - else if (Configuration.doAutoCreate()) - this.issuer = new Reference(); // cc - return this.issuer; - } - - public boolean hasIssuer() { - return this.issuer != null && !this.issuer.isEmpty(); - } - - /** - * @param value {@link #issuer} (Organization that regulates and issues the qualification.) - */ - public PractitionerQualificationComponent setIssuer(Reference value) { - this.issuer = value; - return this; - } - - /** - * @return {@link #issuer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Organization that regulates and issues the qualification.) - */ - public Organization getIssuerTarget() { - if (this.issuerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerQualificationComponent.issuer"); - else if (Configuration.doAutoCreate()) - this.issuerTarget = new Organization(); // aa - return this.issuerTarget; - } - - /** - * @param value {@link #issuer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Organization that regulates and issues the qualification.) - */ - public PractitionerQualificationComponent setIssuerTarget(Organization value) { - this.issuerTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "An identifier that applies to this person's qualification in this role.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("code", "CodeableConcept", "Coded representation of the qualification.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("period", "Period", "Period during which the qualification is valid.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("issuer", "Reference(Organization)", "Organization that regulates and issues the qualification.", 0, java.lang.Integer.MAX_VALUE, issuer)); - } - - public PractitionerQualificationComponent copy() { - PractitionerQualificationComponent dst = new PractitionerQualificationComponent(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.code = code == null ? null : code.copy(); - dst.period = period == null ? null : period.copy(); - dst.issuer = issuer == null ? null : issuer.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof PractitionerQualificationComponent)) - return false; - PractitionerQualificationComponent o = (PractitionerQualificationComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(code, o.code, true) && compareDeep(period, o.period, true) - && compareDeep(issuer, o.issuer, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof PractitionerQualificationComponent)) - return false; - PractitionerQualificationComponent o = (PractitionerQualificationComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) - && (period == null || period.isEmpty()) && (issuer == null || issuer.isEmpty()); - } - - } - - /** - * An identifier that applies to this person in this role. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A identifier for the person as this agent", formalDefinition="An identifier that applies to this person in this role." ) - protected List identifier; - - /** - * A name associated with the person. - */ - @Child(name = "name", type = {HumanName.class}, order=1, min=0, max=1) - @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." ) - protected HumanName name; - - /** - * A contact detail for the practitioner, e.g. a telephone number or an email address. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A contact detail for the practitioner", formalDefinition="A contact detail for the practitioner, e.g. a telephone number or an email address." ) - protected List telecom; - - /** - * The postal address where the practitioner can be found or visited or to which mail can be delivered. - */ - @Child(name = "address", type = {Address.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Where practitioner can be found/visited", formalDefinition="The postal address where the practitioner can be found or visited or to which mail can be delivered." ) - protected List
address; - - /** - * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - @Child(name = "gender", type = {CodeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." ) - protected Enumeration gender; - - /** - * The date of birth for the practitioner. - */ - @Child(name = "birthDate", type = {DateType.class}, order=5, min=0, max=1) - @Description(shortDefinition="The date of birth for the practitioner", formalDefinition="The date of birth for the practitioner." ) - protected DateType birthDate; - - /** - * Image of the person. - */ - @Child(name = "photo", type = {Attachment.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Image of the person", formalDefinition="Image of the person." ) - protected List photo; - - /** - * The list of Roles/Organizations that the Practitioner is associated with. - */ - @Child(name = "practitionerRole", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The list of Roles/Organizations that the Practitioner is associated with", formalDefinition="The list of Roles/Organizations that the Practitioner is associated with." ) - protected List practitionerRole; - - /** - * Qualifications obtained by training and certification. - */ - @Child(name = "qualification", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Qualifications obtained by training and certification", formalDefinition="Qualifications obtained by training and certification." ) - protected List qualification; - - /** - * A language the practitioner is able to use in patient communication. - */ - @Child(name = "communication", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A language the practitioner is able to use in patient communication", formalDefinition="A language the practitioner is able to use in patient communication." ) - protected List communication; - - private static final long serialVersionUID = 781100268L; - - /* - * Constructor - */ - public Practitioner() { - super(); - } - - /** - * @return {@link #identifier} (An identifier that applies to this person in this role.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (An identifier that applies to this person in this role.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Practitioner addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #name} (A name associated with the person.) - */ - public HumanName getName() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Practitioner.name"); - else if (Configuration.doAutoCreate()) - this.name = new HumanName(); // cc - return this.name; - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A name associated with the person.) - */ - public Practitioner setName(HumanName value) { - this.name = value; - return this; - } - - /** - * @return {@link #telecom} (A contact detail for the practitioner, e.g. a telephone number or an email address.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (A contact detail for the practitioner, e.g. a telephone number or an email address.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public Practitioner addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #address} (The postal address where the practitioner can be found or visited or to which mail can be delivered.) - */ - public List
getAddress() { - if (this.address == null) - this.address = new ArrayList
(); - return this.address; - } - - public boolean hasAddress() { - if (this.address == null) - return false; - for (Address item : this.address) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #address} (The postal address where the practitioner can be found or visited or to which mail can be delivered.) - */ - // syntactic sugar - public Address addAddress() { //3 - Address t = new Address(); - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return t; - } - - // syntactic sugar - public Practitioner addAddress(Address t) { //3 - if (t == null) - return this; - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return this; - } - - /** - * @return {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Enumeration getGenderElement() { - if (this.gender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Practitioner.gender"); - else if (Configuration.doAutoCreate()) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb - return this.gender; - } - - public boolean hasGenderElement() { - return this.gender != null && !this.gender.isEmpty(); - } - - public boolean hasGender() { - return this.gender != null && !this.gender.isEmpty(); - } - - /** - * @param value {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Practitioner setGenderElement(Enumeration value) { - this.gender = value; - return this; - } - - /** - * @return Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - public AdministrativeGender getGender() { - return this.gender == null ? null : this.gender.getValue(); - } - - /** - * @param value Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - public Practitioner setGender(AdministrativeGender value) { - if (value == null) - this.gender = null; - else { - if (this.gender == null) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); - this.gender.setValue(value); - } - return this; - } - - /** - * @return {@link #birthDate} (The date of birth for the practitioner.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value - */ - public DateType getBirthDateElement() { - if (this.birthDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Practitioner.birthDate"); - else if (Configuration.doAutoCreate()) - this.birthDate = new DateType(); // bb - return this.birthDate; - } - - public boolean hasBirthDateElement() { - return this.birthDate != null && !this.birthDate.isEmpty(); - } - - public boolean hasBirthDate() { - return this.birthDate != null && !this.birthDate.isEmpty(); - } - - /** - * @param value {@link #birthDate} (The date of birth for the practitioner.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value - */ - public Practitioner setBirthDateElement(DateType value) { - this.birthDate = value; - return this; - } - - /** - * @return The date of birth for the practitioner. - */ - public Date getBirthDate() { - return this.birthDate == null ? null : this.birthDate.getValue(); - } - - /** - * @param value The date of birth for the practitioner. - */ - public Practitioner setBirthDate(Date value) { - if (value == null) - this.birthDate = null; - else { - if (this.birthDate == null) - this.birthDate = new DateType(); - this.birthDate.setValue(value); - } - return this; - } - - /** - * @return {@link #photo} (Image of the person.) - */ - public List getPhoto() { - if (this.photo == null) - this.photo = new ArrayList(); - return this.photo; - } - - public boolean hasPhoto() { - if (this.photo == null) - return false; - for (Attachment item : this.photo) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #photo} (Image of the person.) - */ - // syntactic sugar - public Attachment addPhoto() { //3 - Attachment t = new Attachment(); - if (this.photo == null) - this.photo = new ArrayList(); - this.photo.add(t); - return t; - } - - // syntactic sugar - public Practitioner addPhoto(Attachment t) { //3 - if (t == null) - return this; - if (this.photo == null) - this.photo = new ArrayList(); - this.photo.add(t); - return this; - } - - /** - * @return {@link #practitionerRole} (The list of Roles/Organizations that the Practitioner is associated with.) - */ - public List getPractitionerRole() { - if (this.practitionerRole == null) - this.practitionerRole = new ArrayList(); - return this.practitionerRole; - } - - public boolean hasPractitionerRole() { - if (this.practitionerRole == null) - return false; - for (PractitionerPractitionerRoleComponent item : this.practitionerRole) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #practitionerRole} (The list of Roles/Organizations that the Practitioner is associated with.) - */ - // syntactic sugar - public PractitionerPractitionerRoleComponent addPractitionerRole() { //3 - PractitionerPractitionerRoleComponent t = new PractitionerPractitionerRoleComponent(); - if (this.practitionerRole == null) - this.practitionerRole = new ArrayList(); - this.practitionerRole.add(t); - return t; - } - - // syntactic sugar - public Practitioner addPractitionerRole(PractitionerPractitionerRoleComponent t) { //3 - if (t == null) - return this; - if (this.practitionerRole == null) - this.practitionerRole = new ArrayList(); - this.practitionerRole.add(t); - return this; - } - - /** - * @return {@link #qualification} (Qualifications obtained by training and certification.) - */ - public List getQualification() { - if (this.qualification == null) - this.qualification = new ArrayList(); - return this.qualification; - } - - public boolean hasQualification() { - if (this.qualification == null) - return false; - for (PractitionerQualificationComponent item : this.qualification) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #qualification} (Qualifications obtained by training and certification.) - */ - // syntactic sugar - public PractitionerQualificationComponent addQualification() { //3 - PractitionerQualificationComponent t = new PractitionerQualificationComponent(); - if (this.qualification == null) - this.qualification = new ArrayList(); - this.qualification.add(t); - return t; - } - - // syntactic sugar - public Practitioner addQualification(PractitionerQualificationComponent t) { //3 - if (t == null) - return this; - if (this.qualification == null) - this.qualification = new ArrayList(); - this.qualification.add(t); - return this; - } - - /** - * @return {@link #communication} (A language the practitioner is able to use in patient communication.) - */ - public List getCommunication() { - if (this.communication == null) - this.communication = new ArrayList(); - return this.communication; - } - - public boolean hasCommunication() { - if (this.communication == null) - return false; - for (CodeableConcept item : this.communication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #communication} (A language the practitioner is able to use in patient communication.) - */ - // syntactic sugar - public CodeableConcept addCommunication() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.communication == null) - this.communication = new ArrayList(); - this.communication.add(t); - return t; - } - - // syntactic sugar - public Practitioner addCommunication(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.communication == null) - this.communication = new ArrayList(); - this.communication.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "An identifier that applies to this person in this role.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the practitioner, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("address", "Address", "The postal address where the practitioner can be found or visited or to which mail can be delivered.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); - childrenList.add(new Property("birthDate", "date", "The date of birth for the practitioner.", 0, java.lang.Integer.MAX_VALUE, birthDate)); - childrenList.add(new Property("photo", "Attachment", "Image of the person.", 0, java.lang.Integer.MAX_VALUE, photo)); - childrenList.add(new Property("practitionerRole", "", "The list of Roles/Organizations that the Practitioner is associated with.", 0, java.lang.Integer.MAX_VALUE, practitionerRole)); - childrenList.add(new Property("qualification", "", "Qualifications obtained by training and certification.", 0, java.lang.Integer.MAX_VALUE, qualification)); - childrenList.add(new Property("communication", "CodeableConcept", "A language the practitioner is able to use in patient communication.", 0, java.lang.Integer.MAX_VALUE, communication)); - } - - public Practitioner copy() { - Practitioner dst = new Practitioner(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - if (address != null) { - dst.address = new ArrayList
(); - for (Address i : address) - dst.address.add(i.copy()); - }; - dst.gender = gender == null ? null : gender.copy(); - dst.birthDate = birthDate == null ? null : birthDate.copy(); - if (photo != null) { - dst.photo = new ArrayList(); - for (Attachment i : photo) - dst.photo.add(i.copy()); - }; - if (practitionerRole != null) { - dst.practitionerRole = new ArrayList(); - for (PractitionerPractitionerRoleComponent i : practitionerRole) - dst.practitionerRole.add(i.copy()); - }; - if (qualification != null) { - dst.qualification = new ArrayList(); - for (PractitionerQualificationComponent i : qualification) - dst.qualification.add(i.copy()); - }; - if (communication != null) { - dst.communication = new ArrayList(); - for (CodeableConcept i : communication) - dst.communication.add(i.copy()); - }; - return dst; - } - - protected Practitioner typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Practitioner)) - return false; - Practitioner o = (Practitioner) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) - && compareDeep(address, o.address, true) && compareDeep(gender, o.gender, true) && compareDeep(birthDate, o.birthDate, true) - && compareDeep(photo, o.photo, true) && compareDeep(practitionerRole, o.practitionerRole, true) - && compareDeep(qualification, o.qualification, true) && compareDeep(communication, o.communication, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Practitioner)) - return false; - Practitioner o = (Practitioner) other; - return compareValues(gender, o.gender, true) && compareValues(birthDate, o.birthDate, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) - && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) && (gender == null || gender.isEmpty()) - && (birthDate == null || birthDate.isEmpty()) && (photo == null || photo.isEmpty()) && (practitionerRole == null || practitionerRole.isEmpty()) - && (qualification == null || qualification.isEmpty()) && (communication == null || communication.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Practitioner; - } - - @SearchParamDefinition(name="phonetic", path="Practitioner.name", description="A portion of either family or given name using some kind of phonetic matching algorithm", type="string" ) - public static final String SP_PHONETIC = "phonetic"; - @SearchParamDefinition(name="communication", path="Practitioner.communication", description="One of the languages that the practitioner can communicate with", type="token" ) - public static final String SP_COMMUNICATION = "communication"; - @SearchParamDefinition(name="location", path="Practitioner.practitionerRole.location", description="One of the locations at which this practitioner provides care", type="reference" ) - public static final String SP_LOCATION = "location"; - @SearchParamDefinition(name="organization", path="Practitioner.practitionerRole.managingOrganization", description="The identity of the organization the practitioner represents / acts on behalf of", type="reference" ) - public static final String SP_ORGANIZATION = "organization"; - @SearchParamDefinition(name="given", path="Practitioner.name", description="A portion of the given name", type="string" ) - public static final String SP_GIVEN = "given"; - @SearchParamDefinition(name="address", path="Practitioner.address", description="An address in any kind of address/part", type="string" ) - public static final String SP_ADDRESS = "address"; - @SearchParamDefinition(name="family", path="Practitioner.name", description="A portion of the family name", type="string" ) - public static final String SP_FAMILY = "family"; - @SearchParamDefinition(name="name", path="Practitioner.name", description="A portion of either family or given name", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="telecom", path="Practitioner.telecom", description="The value in any kind of contact", type="token" ) - public static final String SP_TELECOM = "telecom"; - @SearchParamDefinition(name="role", path="Practitioner.practitionerRole.role", description="The practitioner can perform this role at for the organization", type="token" ) - public static final String SP_ROLE = "role"; - @SearchParamDefinition(name="gender", path="Practitioner.gender", description="Gender of the practitioner", type="token" ) - public static final String SP_GENDER = "gender"; - @SearchParamDefinition(name="identifier", path="Practitioner.identifier", description="A practitioner's Identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="specialty", path="Practitioner.practitionerRole.specialty", description="The practitioner has this specailty at an organization", type="token" ) - public static final String SP_SPECIALTY = "specialty"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A person who is directly or indirectly involved in the provisioning of healthcare. + */ +@ResourceDef(name="Practitioner", profile="http://hl7.org/fhir/Profile/Practitioner") +public class Practitioner extends DomainResource { + + public enum AdministrativeGender { + /** + * Male + */ + MALE, + /** + * Female + */ + FEMALE, + /** + * Other + */ + OTHER, + /** + * Unknown + */ + UNKNOWN, + /** + * added to help the parsers + */ + NULL; + public static AdministrativeGender fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return MALE; + if ("female".equals(codeString)) + return FEMALE; + if ("other".equals(codeString)) + return OTHER; + if ("unknown".equals(codeString)) + return UNKNOWN; + throw new Exception("Unknown AdministrativeGender code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case MALE: return "male"; + case FEMALE: return "female"; + case OTHER: return "other"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MALE: return ""; + case FEMALE: return ""; + case OTHER: return ""; + case UNKNOWN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MALE: return "Male"; + case FEMALE: return "Female"; + case OTHER: return "Other"; + case UNKNOWN: return "Unknown"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MALE: return "Male"; + case FEMALE: return "Female"; + case OTHER: return "Other"; + case UNKNOWN: return "Unknown"; + default: return "?"; + } + } + } + + public static class AdministrativeGenderEnumFactory implements EnumFactory { + public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return AdministrativeGender.MALE; + if ("female".equals(codeString)) + return AdministrativeGender.FEMALE; + if ("other".equals(codeString)) + return AdministrativeGender.OTHER; + if ("unknown".equals(codeString)) + return AdministrativeGender.UNKNOWN; + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); + } + public String toCode(AdministrativeGender code) { + if (code == AdministrativeGender.MALE) + return "male"; + if (code == AdministrativeGender.FEMALE) + return "female"; + if (code == AdministrativeGender.OTHER) + return "other"; + if (code == AdministrativeGender.UNKNOWN) + return "unknown"; + return "?"; + } + } + + @Block() + public static class PractitionerPractitionerRoleComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The Organization where the Practitioner performs the roles associated. + */ + @Child(name = "managingOrganization", type = {Organization.class}, order=1, min=0, max=1) + @Description(shortDefinition="The Organization where the Practitioner performs the roles associated", formalDefinition="The Organization where the Practitioner performs the roles associated." ) + protected Reference managingOrganization; + + /** + * The actual object that is the target of the reference (The Organization where the Practitioner performs the roles associated.) + */ + protected Organization managingOrganizationTarget; + + /** + * Roles which this practitioner is authorized to perform for the organization. + */ + @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Roles which this practitioner may perform", formalDefinition="Roles which this practitioner is authorized to perform for the organization." ) + protected CodeableConcept role; + + /** + * Specific specialty of the practitioner. + */ + @Child(name = "specialty", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Specific specialty of the practitioner", formalDefinition="Specific specialty of the practitioner." ) + protected List specialty; + + /** + * The period during which the person is authorized to act as a practitioner in these role(s) for the organization. + */ + @Child(name = "period", type = {Period.class}, order=4, min=0, max=1) + @Description(shortDefinition="The period during which the practitioner is authorized to perform in these role(s)", formalDefinition="The period during which the person is authorized to act as a practitioner in these role(s) for the organization." ) + protected Period period; + + /** + * The location(s) at which this practitioner provides care. + */ + @Child(name = "location", type = {Location.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The location(s) at which this practitioner provides care", formalDefinition="The location(s) at which this practitioner provides care." ) + protected List location; + /** + * The actual objects that are the target of the reference (The location(s) at which this practitioner provides care.) + */ + protected List locationTarget; + + + /** + * The list of healthcare services that this worker provides for this role's Organization/Location(s). + */ + @Child(name = "healthcareService", type = {HealthcareService.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The list of healthcare services that this worker provides for this role's Organization/Location(s)", formalDefinition="The list of healthcare services that this worker provides for this role's Organization/Location(s)." ) + protected List healthcareService; + /** + * The actual objects that are the target of the reference (The list of healthcare services that this worker provides for this role's Organization/Location(s).) + */ + protected List healthcareServiceTarget; + + + private static final long serialVersionUID = -2146177018L; + + /* + * Constructor + */ + public PractitionerPractitionerRoleComponent() { + super(); + } + + /** + * @return {@link #managingOrganization} (The Organization where the Practitioner performs the roles associated.) + */ + public Reference getManagingOrganization() { + if (this.managingOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerPractitionerRoleComponent.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganization = new Reference(); // cc + return this.managingOrganization; + } + + public boolean hasManagingOrganization() { + return this.managingOrganization != null && !this.managingOrganization.isEmpty(); + } + + /** + * @param value {@link #managingOrganization} (The Organization where the Practitioner performs the roles associated.) + */ + public PractitionerPractitionerRoleComponent setManagingOrganization(Reference value) { + this.managingOrganization = value; + return this; + } + + /** + * @return {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Organization where the Practitioner performs the roles associated.) + */ + public Organization getManagingOrganizationTarget() { + if (this.managingOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerPractitionerRoleComponent.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganizationTarget = new Organization(); // aa + return this.managingOrganizationTarget; + } + + /** + * @param value {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Organization where the Practitioner performs the roles associated.) + */ + public PractitionerPractitionerRoleComponent setManagingOrganizationTarget(Organization value) { + this.managingOrganizationTarget = value; + return this; + } + + /** + * @return {@link #role} (Roles which this practitioner is authorized to perform for the organization.) + */ + public CodeableConcept getRole() { + if (this.role == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerPractitionerRoleComponent.role"); + else if (Configuration.doAutoCreate()) + this.role = new CodeableConcept(); // cc + return this.role; + } + + public boolean hasRole() { + return this.role != null && !this.role.isEmpty(); + } + + /** + * @param value {@link #role} (Roles which this practitioner is authorized to perform for the organization.) + */ + public PractitionerPractitionerRoleComponent setRole(CodeableConcept value) { + this.role = value; + return this; + } + + /** + * @return {@link #specialty} (Specific specialty of the practitioner.) + */ + public List getSpecialty() { + if (this.specialty == null) + this.specialty = new ArrayList(); + return this.specialty; + } + + public boolean hasSpecialty() { + if (this.specialty == null) + return false; + for (CodeableConcept item : this.specialty) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specialty} (Specific specialty of the practitioner.) + */ + // syntactic sugar + public CodeableConcept addSpecialty() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.specialty == null) + this.specialty = new ArrayList(); + this.specialty.add(t); + return t; + } + + // syntactic sugar + public PractitionerPractitionerRoleComponent addSpecialty(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.specialty == null) + this.specialty = new ArrayList(); + this.specialty.add(t); + return this; + } + + /** + * @return {@link #period} (The period during which the person is authorized to act as a practitioner in these role(s) for the organization.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerPractitionerRoleComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period during which the person is authorized to act as a practitioner in these role(s) for the organization.) + */ + public PractitionerPractitionerRoleComponent setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #location} (The location(s) at which this practitioner provides care.) + */ + public List getLocation() { + if (this.location == null) + this.location = new ArrayList(); + return this.location; + } + + public boolean hasLocation() { + if (this.location == null) + return false; + for (Reference item : this.location) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #location} (The location(s) at which this practitioner provides care.) + */ + // syntactic sugar + public Reference addLocation() { //3 + Reference t = new Reference(); + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return t; + } + + // syntactic sugar + public PractitionerPractitionerRoleComponent addLocation(Reference t) { //3 + if (t == null) + return this; + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return this; + } + + /** + * @return {@link #location} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The location(s) at which this practitioner provides care.) + */ + public List getLocationTarget() { + if (this.locationTarget == null) + this.locationTarget = new ArrayList(); + return this.locationTarget; + } + + // syntactic sugar + /** + * @return {@link #location} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The location(s) at which this practitioner provides care.) + */ + public Location addLocationTarget() { + Location r = new Location(); + if (this.locationTarget == null) + this.locationTarget = new ArrayList(); + this.locationTarget.add(r); + return r; + } + + /** + * @return {@link #healthcareService} (The list of healthcare services that this worker provides for this role's Organization/Location(s).) + */ + public List getHealthcareService() { + if (this.healthcareService == null) + this.healthcareService = new ArrayList(); + return this.healthcareService; + } + + public boolean hasHealthcareService() { + if (this.healthcareService == null) + return false; + for (Reference item : this.healthcareService) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #healthcareService} (The list of healthcare services that this worker provides for this role's Organization/Location(s).) + */ + // syntactic sugar + public Reference addHealthcareService() { //3 + Reference t = new Reference(); + if (this.healthcareService == null) + this.healthcareService = new ArrayList(); + this.healthcareService.add(t); + return t; + } + + // syntactic sugar + public PractitionerPractitionerRoleComponent addHealthcareService(Reference t) { //3 + if (t == null) + return this; + if (this.healthcareService == null) + this.healthcareService = new ArrayList(); + this.healthcareService.add(t); + return this; + } + + /** + * @return {@link #healthcareService} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The list of healthcare services that this worker provides for this role's Organization/Location(s).) + */ + public List getHealthcareServiceTarget() { + if (this.healthcareServiceTarget == null) + this.healthcareServiceTarget = new ArrayList(); + return this.healthcareServiceTarget; + } + + // syntactic sugar + /** + * @return {@link #healthcareService} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The list of healthcare services that this worker provides for this role's Organization/Location(s).) + */ + public HealthcareService addHealthcareServiceTarget() { + HealthcareService r = new HealthcareService(); + if (this.healthcareServiceTarget == null) + this.healthcareServiceTarget = new ArrayList(); + this.healthcareServiceTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The Organization where the Practitioner performs the roles associated.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); + childrenList.add(new Property("role", "CodeableConcept", "Roles which this practitioner is authorized to perform for the organization.", 0, java.lang.Integer.MAX_VALUE, role)); + childrenList.add(new Property("specialty", "CodeableConcept", "Specific specialty of the practitioner.", 0, java.lang.Integer.MAX_VALUE, specialty)); + childrenList.add(new Property("period", "Period", "The period during which the person is authorized to act as a practitioner in these role(s) for the organization.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("location", "Reference(Location)", "The location(s) at which this practitioner provides care.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("healthcareService", "Reference(HealthcareService)", "The list of healthcare services that this worker provides for this role's Organization/Location(s).", 0, java.lang.Integer.MAX_VALUE, healthcareService)); + } + + public PractitionerPractitionerRoleComponent copy() { + PractitionerPractitionerRoleComponent dst = new PractitionerPractitionerRoleComponent(); + copyValues(dst); + dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); + dst.role = role == null ? null : role.copy(); + if (specialty != null) { + dst.specialty = new ArrayList(); + for (CodeableConcept i : specialty) + dst.specialty.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + if (location != null) { + dst.location = new ArrayList(); + for (Reference i : location) + dst.location.add(i.copy()); + }; + if (healthcareService != null) { + dst.healthcareService = new ArrayList(); + for (Reference i : healthcareService) + dst.healthcareService.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof PractitionerPractitionerRoleComponent)) + return false; + PractitionerPractitionerRoleComponent o = (PractitionerPractitionerRoleComponent) other; + return compareDeep(managingOrganization, o.managingOrganization, true) && compareDeep(role, o.role, true) + && compareDeep(specialty, o.specialty, true) && compareDeep(period, o.period, true) && compareDeep(location, o.location, true) + && compareDeep(healthcareService, o.healthcareService, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof PractitionerPractitionerRoleComponent)) + return false; + PractitionerPractitionerRoleComponent o = (PractitionerPractitionerRoleComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (managingOrganization == null || managingOrganization.isEmpty()) && (role == null || role.isEmpty()) + && (specialty == null || specialty.isEmpty()) && (period == null || period.isEmpty()) && (location == null || location.isEmpty()) + && (healthcareService == null || healthcareService.isEmpty()); + } + + } + + @Block() + public static class PractitionerQualificationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An identifier that applies to this person's qualification in this role. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="An identifier for this qualification for the practitioner", formalDefinition="An identifier that applies to this person's qualification in this role." ) + protected List identifier; + + /** + * Coded representation of the qualification. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=2, min=1, max=1) + @Description(shortDefinition="Coded representation of the qualification", formalDefinition="Coded representation of the qualification." ) + protected CodeableConcept code; + + /** + * Period during which the qualification is valid. + */ + @Child(name = "period", type = {Period.class}, order=3, min=0, max=1) + @Description(shortDefinition="Period during which the qualification is valid", formalDefinition="Period during which the qualification is valid." ) + protected Period period; + + /** + * Organization that regulates and issues the qualification. + */ + @Child(name = "issuer", type = {Organization.class}, order=4, min=0, max=1) + @Description(shortDefinition="Organization that regulates and issues the qualification", formalDefinition="Organization that regulates and issues the qualification." ) + protected Reference issuer; + + /** + * The actual object that is the target of the reference (Organization that regulates and issues the qualification.) + */ + protected Organization issuerTarget; + + private static final long serialVersionUID = 1095219071L; + + /* + * Constructor + */ + public PractitionerQualificationComponent() { + super(); + } + + /* + * Constructor + */ + public PractitionerQualificationComponent(CodeableConcept code) { + super(); + this.code = code; + } + + /** + * @return {@link #identifier} (An identifier that applies to this person's qualification in this role.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (An identifier that applies to this person's qualification in this role.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public PractitionerQualificationComponent addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #code} (Coded representation of the qualification.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerQualificationComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Coded representation of the qualification.) + */ + public PractitionerQualificationComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #period} (Period during which the qualification is valid.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerQualificationComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Period during which the qualification is valid.) + */ + public PractitionerQualificationComponent setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #issuer} (Organization that regulates and issues the qualification.) + */ + public Reference getIssuer() { + if (this.issuer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerQualificationComponent.issuer"); + else if (Configuration.doAutoCreate()) + this.issuer = new Reference(); // cc + return this.issuer; + } + + public boolean hasIssuer() { + return this.issuer != null && !this.issuer.isEmpty(); + } + + /** + * @param value {@link #issuer} (Organization that regulates and issues the qualification.) + */ + public PractitionerQualificationComponent setIssuer(Reference value) { + this.issuer = value; + return this; + } + + /** + * @return {@link #issuer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Organization that regulates and issues the qualification.) + */ + public Organization getIssuerTarget() { + if (this.issuerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerQualificationComponent.issuer"); + else if (Configuration.doAutoCreate()) + this.issuerTarget = new Organization(); // aa + return this.issuerTarget; + } + + /** + * @param value {@link #issuer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Organization that regulates and issues the qualification.) + */ + public PractitionerQualificationComponent setIssuerTarget(Organization value) { + this.issuerTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "An identifier that applies to this person's qualification in this role.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("code", "CodeableConcept", "Coded representation of the qualification.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("period", "Period", "Period during which the qualification is valid.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("issuer", "Reference(Organization)", "Organization that regulates and issues the qualification.", 0, java.lang.Integer.MAX_VALUE, issuer)); + } + + public PractitionerQualificationComponent copy() { + PractitionerQualificationComponent dst = new PractitionerQualificationComponent(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.code = code == null ? null : code.copy(); + dst.period = period == null ? null : period.copy(); + dst.issuer = issuer == null ? null : issuer.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof PractitionerQualificationComponent)) + return false; + PractitionerQualificationComponent o = (PractitionerQualificationComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(code, o.code, true) && compareDeep(period, o.period, true) + && compareDeep(issuer, o.issuer, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof PractitionerQualificationComponent)) + return false; + PractitionerQualificationComponent o = (PractitionerQualificationComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) + && (period == null || period.isEmpty()) && (issuer == null || issuer.isEmpty()); + } + + } + + /** + * An identifier that applies to this person in this role. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A identifier for the person as this agent", formalDefinition="An identifier that applies to this person in this role." ) + protected List identifier; + + /** + * A name associated with the person. + */ + @Child(name = "name", type = {HumanName.class}, order=1, min=0, max=1) + @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." ) + protected HumanName name; + + /** + * A contact detail for the practitioner, e.g. a telephone number or an email address. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A contact detail for the practitioner", formalDefinition="A contact detail for the practitioner, e.g. a telephone number or an email address." ) + protected List telecom; + + /** + * The postal address where the practitioner can be found or visited or to which mail can be delivered. + */ + @Child(name = "address", type = {Address.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Where practitioner can be found/visited", formalDefinition="The postal address where the practitioner can be found or visited or to which mail can be delivered." ) + protected List
address; + + /** + * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + @Child(name = "gender", type = {CodeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." ) + protected Enumeration gender; + + /** + * The date of birth for the practitioner. + */ + @Child(name = "birthDate", type = {DateType.class}, order=5, min=0, max=1) + @Description(shortDefinition="The date of birth for the practitioner", formalDefinition="The date of birth for the practitioner." ) + protected DateType birthDate; + + /** + * Image of the person. + */ + @Child(name = "photo", type = {Attachment.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Image of the person", formalDefinition="Image of the person." ) + protected List photo; + + /** + * The list of Roles/Organizations that the Practitioner is associated with. + */ + @Child(name = "practitionerRole", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The list of Roles/Organizations that the Practitioner is associated with", formalDefinition="The list of Roles/Organizations that the Practitioner is associated with." ) + protected List practitionerRole; + + /** + * Qualifications obtained by training and certification. + */ + @Child(name = "qualification", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Qualifications obtained by training and certification", formalDefinition="Qualifications obtained by training and certification." ) + protected List qualification; + + /** + * A language the practitioner is able to use in patient communication. + */ + @Child(name = "communication", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A language the practitioner is able to use in patient communication", formalDefinition="A language the practitioner is able to use in patient communication." ) + protected List communication; + + private static final long serialVersionUID = 781100268L; + + /* + * Constructor + */ + public Practitioner() { + super(); + } + + /** + * @return {@link #identifier} (An identifier that applies to this person in this role.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (An identifier that applies to this person in this role.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Practitioner addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #name} (A name associated with the person.) + */ + public HumanName getName() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Practitioner.name"); + else if (Configuration.doAutoCreate()) + this.name = new HumanName(); // cc + return this.name; + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A name associated with the person.) + */ + public Practitioner setName(HumanName value) { + this.name = value; + return this; + } + + /** + * @return {@link #telecom} (A contact detail for the practitioner, e.g. a telephone number or an email address.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (A contact detail for the practitioner, e.g. a telephone number or an email address.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public Practitioner addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @return {@link #address} (The postal address where the practitioner can be found or visited or to which mail can be delivered.) + */ + public List
getAddress() { + if (this.address == null) + this.address = new ArrayList
(); + return this.address; + } + + public boolean hasAddress() { + if (this.address == null) + return false; + for (Address item : this.address) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #address} (The postal address where the practitioner can be found or visited or to which mail can be delivered.) + */ + // syntactic sugar + public Address addAddress() { //3 + Address t = new Address(); + if (this.address == null) + this.address = new ArrayList
(); + this.address.add(t); + return t; + } + + // syntactic sugar + public Practitioner addAddress(Address t) { //3 + if (t == null) + return this; + if (this.address == null) + this.address = new ArrayList
(); + this.address.add(t); + return this; + } + + /** + * @return {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Enumeration getGenderElement() { + if (this.gender == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Practitioner.gender"); + else if (Configuration.doAutoCreate()) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb + return this.gender; + } + + public boolean hasGenderElement() { + return this.gender != null && !this.gender.isEmpty(); + } + + public boolean hasGender() { + return this.gender != null && !this.gender.isEmpty(); + } + + /** + * @param value {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Practitioner setGenderElement(Enumeration value) { + this.gender = value; + return this; + } + + /** + * @return Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + public AdministrativeGender getGender() { + return this.gender == null ? null : this.gender.getValue(); + } + + /** + * @param value Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + public Practitioner setGender(AdministrativeGender value) { + if (value == null) + this.gender = null; + else { + if (this.gender == null) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); + this.gender.setValue(value); + } + return this; + } + + /** + * @return {@link #birthDate} (The date of birth for the practitioner.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value + */ + public DateType getBirthDateElement() { + if (this.birthDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Practitioner.birthDate"); + else if (Configuration.doAutoCreate()) + this.birthDate = new DateType(); // bb + return this.birthDate; + } + + public boolean hasBirthDateElement() { + return this.birthDate != null && !this.birthDate.isEmpty(); + } + + public boolean hasBirthDate() { + return this.birthDate != null && !this.birthDate.isEmpty(); + } + + /** + * @param value {@link #birthDate} (The date of birth for the practitioner.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value + */ + public Practitioner setBirthDateElement(DateType value) { + this.birthDate = value; + return this; + } + + /** + * @return The date of birth for the practitioner. + */ + public Date getBirthDate() { + return this.birthDate == null ? null : this.birthDate.getValue(); + } + + /** + * @param value The date of birth for the practitioner. + */ + public Practitioner setBirthDate(Date value) { + if (value == null) + this.birthDate = null; + else { + if (this.birthDate == null) + this.birthDate = new DateType(); + this.birthDate.setValue(value); + } + return this; + } + + /** + * @return {@link #photo} (Image of the person.) + */ + public List getPhoto() { + if (this.photo == null) + this.photo = new ArrayList(); + return this.photo; + } + + public boolean hasPhoto() { + if (this.photo == null) + return false; + for (Attachment item : this.photo) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #photo} (Image of the person.) + */ + // syntactic sugar + public Attachment addPhoto() { //3 + Attachment t = new Attachment(); + if (this.photo == null) + this.photo = new ArrayList(); + this.photo.add(t); + return t; + } + + // syntactic sugar + public Practitioner addPhoto(Attachment t) { //3 + if (t == null) + return this; + if (this.photo == null) + this.photo = new ArrayList(); + this.photo.add(t); + return this; + } + + /** + * @return {@link #practitionerRole} (The list of Roles/Organizations that the Practitioner is associated with.) + */ + public List getPractitionerRole() { + if (this.practitionerRole == null) + this.practitionerRole = new ArrayList(); + return this.practitionerRole; + } + + public boolean hasPractitionerRole() { + if (this.practitionerRole == null) + return false; + for (PractitionerPractitionerRoleComponent item : this.practitionerRole) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #practitionerRole} (The list of Roles/Organizations that the Practitioner is associated with.) + */ + // syntactic sugar + public PractitionerPractitionerRoleComponent addPractitionerRole() { //3 + PractitionerPractitionerRoleComponent t = new PractitionerPractitionerRoleComponent(); + if (this.practitionerRole == null) + this.practitionerRole = new ArrayList(); + this.practitionerRole.add(t); + return t; + } + + // syntactic sugar + public Practitioner addPractitionerRole(PractitionerPractitionerRoleComponent t) { //3 + if (t == null) + return this; + if (this.practitionerRole == null) + this.practitionerRole = new ArrayList(); + this.practitionerRole.add(t); + return this; + } + + /** + * @return {@link #qualification} (Qualifications obtained by training and certification.) + */ + public List getQualification() { + if (this.qualification == null) + this.qualification = new ArrayList(); + return this.qualification; + } + + public boolean hasQualification() { + if (this.qualification == null) + return false; + for (PractitionerQualificationComponent item : this.qualification) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #qualification} (Qualifications obtained by training and certification.) + */ + // syntactic sugar + public PractitionerQualificationComponent addQualification() { //3 + PractitionerQualificationComponent t = new PractitionerQualificationComponent(); + if (this.qualification == null) + this.qualification = new ArrayList(); + this.qualification.add(t); + return t; + } + + // syntactic sugar + public Practitioner addQualification(PractitionerQualificationComponent t) { //3 + if (t == null) + return this; + if (this.qualification == null) + this.qualification = new ArrayList(); + this.qualification.add(t); + return this; + } + + /** + * @return {@link #communication} (A language the practitioner is able to use in patient communication.) + */ + public List getCommunication() { + if (this.communication == null) + this.communication = new ArrayList(); + return this.communication; + } + + public boolean hasCommunication() { + if (this.communication == null) + return false; + for (CodeableConcept item : this.communication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #communication} (A language the practitioner is able to use in patient communication.) + */ + // syntactic sugar + public CodeableConcept addCommunication() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.communication == null) + this.communication = new ArrayList(); + this.communication.add(t); + return t; + } + + // syntactic sugar + public Practitioner addCommunication(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.communication == null) + this.communication = new ArrayList(); + this.communication.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "An identifier that applies to this person in this role.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the practitioner, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("address", "Address", "The postal address where the practitioner can be found or visited or to which mail can be delivered.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); + childrenList.add(new Property("birthDate", "date", "The date of birth for the practitioner.", 0, java.lang.Integer.MAX_VALUE, birthDate)); + childrenList.add(new Property("photo", "Attachment", "Image of the person.", 0, java.lang.Integer.MAX_VALUE, photo)); + childrenList.add(new Property("practitionerRole", "", "The list of Roles/Organizations that the Practitioner is associated with.", 0, java.lang.Integer.MAX_VALUE, practitionerRole)); + childrenList.add(new Property("qualification", "", "Qualifications obtained by training and certification.", 0, java.lang.Integer.MAX_VALUE, qualification)); + childrenList.add(new Property("communication", "CodeableConcept", "A language the practitioner is able to use in patient communication.", 0, java.lang.Integer.MAX_VALUE, communication)); + } + + public Practitioner copy() { + Practitioner dst = new Practitioner(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + if (address != null) { + dst.address = new ArrayList
(); + for (Address i : address) + dst.address.add(i.copy()); + }; + dst.gender = gender == null ? null : gender.copy(); + dst.birthDate = birthDate == null ? null : birthDate.copy(); + if (photo != null) { + dst.photo = new ArrayList(); + for (Attachment i : photo) + dst.photo.add(i.copy()); + }; + if (practitionerRole != null) { + dst.practitionerRole = new ArrayList(); + for (PractitionerPractitionerRoleComponent i : practitionerRole) + dst.practitionerRole.add(i.copy()); + }; + if (qualification != null) { + dst.qualification = new ArrayList(); + for (PractitionerQualificationComponent i : qualification) + dst.qualification.add(i.copy()); + }; + if (communication != null) { + dst.communication = new ArrayList(); + for (CodeableConcept i : communication) + dst.communication.add(i.copy()); + }; + return dst; + } + + protected Practitioner typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Practitioner)) + return false; + Practitioner o = (Practitioner) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) + && compareDeep(address, o.address, true) && compareDeep(gender, o.gender, true) && compareDeep(birthDate, o.birthDate, true) + && compareDeep(photo, o.photo, true) && compareDeep(practitionerRole, o.practitionerRole, true) + && compareDeep(qualification, o.qualification, true) && compareDeep(communication, o.communication, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Practitioner)) + return false; + Practitioner o = (Practitioner) other; + return compareValues(gender, o.gender, true) && compareValues(birthDate, o.birthDate, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) + && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) && (gender == null || gender.isEmpty()) + && (birthDate == null || birthDate.isEmpty()) && (photo == null || photo.isEmpty()) && (practitionerRole == null || practitionerRole.isEmpty()) + && (qualification == null || qualification.isEmpty()) && (communication == null || communication.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Practitioner; + } + + @SearchParamDefinition(name="identifier", path="Practitioner.identifier", description="A practitioner's Identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="given", path="Practitioner.name", description="A portion of the given name", type="string" ) + public static final String SP_GIVEN = "given"; + @SearchParamDefinition(name="specialty", path="Practitioner.practitionerRole.specialty", description="The practitioner has this specailty at an organization", type="token" ) + public static final String SP_SPECIALTY = "specialty"; + @SearchParamDefinition(name="address", path="Practitioner.address", description="An address in any kind of address/part", type="string" ) + public static final String SP_ADDRESS = "address"; + @SearchParamDefinition(name="role", path="Practitioner.practitionerRole.role", description="The practitioner can perform this role at for the organization", type="token" ) + public static final String SP_ROLE = "role"; + @SearchParamDefinition(name="gender", path="Practitioner.gender", description="Gender of the practitioner", type="token" ) + public static final String SP_GENDER = "gender"; + @SearchParamDefinition(name="phonetic", path="Practitioner.name", description="A portion of either family or given name using some kind of phonetic matching algorithm", type="string" ) + public static final String SP_PHONETIC = "phonetic"; + @SearchParamDefinition(name="organization", path="Practitioner.practitionerRole.managingOrganization", description="The identity of the organization the practitioner represents / acts on behalf of", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + @SearchParamDefinition(name="name", path="Practitioner.name", description="A portion of either family or given name", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="telecom", path="Practitioner.telecom", description="The value in any kind of contact", type="token" ) + public static final String SP_TELECOM = "telecom"; + @SearchParamDefinition(name="location", path="Practitioner.practitionerRole.location", description="One of the locations at which this practitioner provides care", type="reference" ) + public static final String SP_LOCATION = "location"; + @SearchParamDefinition(name="family", path="Practitioner.name", description="A portion of the family name", type="string" ) + public static final String SP_FAMILY = "family"; + @SearchParamDefinition(name="communication", path="Practitioner.communication", description="One of the languages that the practitioner can communicate with", type="token" ) + public static final String SP_COMMUNICATION = "communication"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/PrimitiveType.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/PrimitiveType.java index 41b95a8b63e..74069cd03b5 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/PrimitiveType.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/PrimitiveType.java @@ -1,155 +1,134 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import org.hl7.fhir.instance.model.api.IBaseHasExtensions; -import org.hl7.fhir.instance.model.api.IPrimitiveType; - -public abstract class PrimitiveType extends Type implements IPrimitiveType, IBaseHasExtensions { - - private static final long serialVersionUID = 3L; - - private T myCoercedValue; - private String myStringValue; - - public T getValue() { - return myCoercedValue; - } - - public String asStringValue() { - return myStringValue; - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(getValue()).toHashCode(); - } - - public PrimitiveType setValue(T theValue) { - myCoercedValue = theValue; - updateStringValue(); - return this; - } - - protected void updateStringValue() { - if (myCoercedValue == null) { - myStringValue = null; - } else { - // NB this might be null - myStringValue = encode(myCoercedValue); - } - } - - @Override - public boolean isEmpty() { - return super.isEmpty() && StringUtils.isBlank(getValueAsString()); - } - - public void fromStringValue(String theValue) { - if (theValue == null) { - myCoercedValue = null; - } else { - // NB this might be null - myCoercedValue = parse(theValue); - } - myStringValue = theValue; - } - - /** - * Subclasses must override to convert an encoded representation of this datatype into a "coerced" one - * - * @param theValue - * Will not be null - * @return May return null if the value does not correspond to anything - */ - protected abstract T parse(String theValue); - - /** - * Subclasses must override to convert a "coerced" value into an encoded one. - * - * @param theValue - * Will not be null - * @return May return null if the value does not correspond to anything - */ - protected abstract String encode(T theValue); - - @Override - public String toString() { - return getClass().getSimpleName() + "[" + asStringValue() + "]"; - } - - public boolean hasValue() { - return !isEmpty(); - } - - public String getValueAsString() { - return asStringValue(); - } - - public void setValueAsString(String theValue) { - fromStringValue(theValue); - } - - protected Type typedCopy() { - return copy(); - } - - public abstract Type copy(); - - @Override - public boolean equalsDeep(Base obj) { - if (!super.equalsDeep(obj)) - return false; - if (obj == null) { - return false; - } - if (!(obj.getClass() == getClass())) { - return false; - } - - PrimitiveType o = (PrimitiveType) obj; - - EqualsBuilder b = new EqualsBuilder(); - b.append(getValue(), o.getValue()); - return b.isEquals(); - } - - @Override - public boolean equalsShallow(Base obj) { - if (obj == null) { - return false; - } - if (!(obj.getClass() == getClass())) { - return false; - } - - PrimitiveType o = (PrimitiveType) obj; - - EqualsBuilder b = new EqualsBuilder(); - b.append(getValue(), o.getValue()); - return b.isEquals(); - } - -} +package org.hl7.fhir.instance.model; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.hl7.fhir.instance.model.api.IBaseHasExtensions; +import org.hl7.fhir.instance.model.api.IPrimitiveType; + +public abstract class PrimitiveType extends Type implements IPrimitiveType, IBaseHasExtensions { + + private static final long serialVersionUID = 3L; + + private T myCoercedValue; + private String myStringValue; + + public T getValue() { + return myCoercedValue; + } + + public String asStringValue() { + return myStringValue; + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(getValue()).toHashCode(); + } + + public PrimitiveType setValue(T theValue) { + myCoercedValue = theValue; + updateStringValue(); + return this; + } + + protected void updateStringValue() { + if (myCoercedValue == null) { + myStringValue = null; + } else { + // NB this might be null + myStringValue = encode(myCoercedValue); + } + } + + @Override + public boolean isEmpty() { + return super.isEmpty() && StringUtils.isBlank(getValueAsString()); + } + + public void fromStringValue(String theValue) { + if (theValue == null) { + myCoercedValue = null; + } else { + // NB this might be null + myCoercedValue = parse(theValue); + } + myStringValue = theValue; + } + + /** + * Subclasses must override to convert an encoded representation of this datatype into a "coerced" one + * + * @param theValue + * Will not be null + * @return May return null if the value does not correspond to anything + */ + protected abstract T parse(String theValue); + + /** + * Subclasses must override to convert a "coerced" value into an encoded one. + * + * @param theValue + * Will not be null + * @return May return null if the value does not correspond to anything + */ + protected abstract String encode(T theValue); + + @Override + public String toString() { + return getClass().getSimpleName() + "[" + asStringValue() + "]"; + } + + public boolean hasValue() { + return !isEmpty(); + } + + public String getValueAsString() { + return asStringValue(); + } + + public void setValueAsString(String theValue) { + fromStringValue(theValue); + } + + protected Type typedCopy() { + return copy(); + } + + public abstract Type copy(); + + @Override + public boolean equalsDeep(Base obj) { + if (!super.equalsDeep(obj)) + return false; + if (obj == null) { + return false; + } + if (!(obj.getClass() == getClass())) { + return false; + } + + PrimitiveType o = (PrimitiveType) obj; + + EqualsBuilder b = new EqualsBuilder(); + b.append(getValue(), o.getValue()); + return b.isEquals(); + } + + @Override + public boolean equalsShallow(Base obj) { + if (obj == null) { + return false; + } + if (!(obj.getClass() == getClass())) { + return false; + } + + PrimitiveType o = (PrimitiveType) obj; + + EqualsBuilder b = new EqualsBuilder(); + b.append(getValue(), o.getValue()); + return b.isEquals(); + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Procedure.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Procedure.java index dbf0a871166..5060eb73ed5 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Procedure.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Procedure.java @@ -1,1874 +1,1853 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * An action that is or was performed on a patient. This can be a physical 'thing' like an operation, or less invasive like counseling or hypnotherapy. - */ -@ResourceDef(name="Procedure", profile="http://hl7.org/fhir/Profile/Procedure") -public class Procedure extends DomainResource { - - public enum ProcedureStatus { - /** - * The procedure is still occurring. - */ - INPROGRESS, - /** - * The procedure was terminated without completing successfully. - */ - ABORTED, - /** - * All actions involved in the procedure have taken place. - */ - COMPLETED, - /** - * The statement was entered in error and Is not valid. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static ProcedureStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("aborted".equals(codeString)) - return ABORTED; - if ("completed".equals(codeString)) - return COMPLETED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new Exception("Unknown ProcedureStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INPROGRESS: return "in-progress"; - case ABORTED: return "aborted"; - case COMPLETED: return "completed"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPROGRESS: return ""; - case ABORTED: return ""; - case COMPLETED: return ""; - case ENTEREDINERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPROGRESS: return "The procedure is still occurring."; - case ABORTED: return "The procedure was terminated without completing successfully."; - case COMPLETED: return "All actions involved in the procedure have taken place."; - case ENTEREDINERROR: return "The statement was entered in error and Is not valid."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPROGRESS: return "In Progress"; - case ABORTED: return "Aborted"; - case COMPLETED: return "Completed"; - case ENTEREDINERROR: return "Entered In Error"; - default: return "?"; - } - } - } - - public static class ProcedureStatusEnumFactory implements EnumFactory { - public ProcedureStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return ProcedureStatus.INPROGRESS; - if ("aborted".equals(codeString)) - return ProcedureStatus.ABORTED; - if ("completed".equals(codeString)) - return ProcedureStatus.COMPLETED; - if ("entered-in-error".equals(codeString)) - return ProcedureStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown ProcedureStatus code '"+codeString+"'"); - } - public String toCode(ProcedureStatus code) { - if (code == ProcedureStatus.INPROGRESS) - return "in-progress"; - if (code == ProcedureStatus.ABORTED) - return "aborted"; - if (code == ProcedureStatus.COMPLETED) - return "completed"; - if (code == ProcedureStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - } - - public enum ProcedureRelationshipType { - /** - * This procedure had to be performed because of the related one. - */ - CAUSEDBY, - /** - * This procedure caused the related one to be performed. - */ - BECAUSEOF, - /** - * added to help the parsers - */ - NULL; - public static ProcedureRelationshipType fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("caused-by".equals(codeString)) - return CAUSEDBY; - if ("because-of".equals(codeString)) - return BECAUSEOF; - throw new Exception("Unknown ProcedureRelationshipType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CAUSEDBY: return "caused-by"; - case BECAUSEOF: return "because-of"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CAUSEDBY: return ""; - case BECAUSEOF: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CAUSEDBY: return "This procedure had to be performed because of the related one."; - case BECAUSEOF: return "This procedure caused the related one to be performed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CAUSEDBY: return "Caused By"; - case BECAUSEOF: return "Because Of"; - default: return "?"; - } - } - } - - public static class ProcedureRelationshipTypeEnumFactory implements EnumFactory { - public ProcedureRelationshipType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("caused-by".equals(codeString)) - return ProcedureRelationshipType.CAUSEDBY; - if ("because-of".equals(codeString)) - return ProcedureRelationshipType.BECAUSEOF; - throw new IllegalArgumentException("Unknown ProcedureRelationshipType code '"+codeString+"'"); - } - public String toCode(ProcedureRelationshipType code) { - if (code == ProcedureRelationshipType.CAUSEDBY) - return "caused-by"; - if (code == ProcedureRelationshipType.BECAUSEOF) - return "because-of"; - return "?"; - } - } - - @Block() - public static class ProcedureBodySiteComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion. - */ - @Child(name = "site", type = {CodeableConcept.class, BodySite.class}, order=1, min=1, max=1) - @Description(shortDefinition="Precise location details", formalDefinition="Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion." ) - protected Type site; - - private static final long serialVersionUID = 1429072605L; - - /* - * Constructor - */ - public ProcedureBodySiteComponent() { - super(); - } - - /* - * Constructor - */ - public ProcedureBodySiteComponent(Type site) { - super(); - this.site = site; - } - - /** - * @return {@link #site} (Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.) - */ - public Type getSite() { - return this.site; - } - - /** - * @return {@link #site} (Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.) - */ - public CodeableConcept getSiteCodeableConcept() throws Exception { - if (!(this.site instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.site.getClass().getName()+" was encountered"); - return (CodeableConcept) this.site; - } - - /** - * @return {@link #site} (Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.) - */ - public Reference getSiteReference() throws Exception { - if (!(this.site instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.site.getClass().getName()+" was encountered"); - return (Reference) this.site; - } - - public boolean hasSite() { - return this.site != null && !this.site.isEmpty(); - } - - /** - * @param value {@link #site} (Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.) - */ - public ProcedureBodySiteComponent setSite(Type value) { - this.site = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("site[x]", "CodeableConcept|Reference(BodySite)", "Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.", 0, java.lang.Integer.MAX_VALUE, site)); - } - - public ProcedureBodySiteComponent copy() { - ProcedureBodySiteComponent dst = new ProcedureBodySiteComponent(); - copyValues(dst); - dst.site = site == null ? null : site.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProcedureBodySiteComponent)) - return false; - ProcedureBodySiteComponent o = (ProcedureBodySiteComponent) other; - return compareDeep(site, o.site, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProcedureBodySiteComponent)) - return false; - ProcedureBodySiteComponent o = (ProcedureBodySiteComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (site == null || site.isEmpty()); - } - - } - - @Block() - public static class ProcedurePerformerComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The practitioner who was involved in the procedure. - */ - @Child(name = "person", type = {Practitioner.class, Patient.class, RelatedPerson.class}, order=1, min=0, max=1) - @Description(shortDefinition="The reference to the practitioner", formalDefinition="The practitioner who was involved in the procedure." ) - protected Reference person; - - /** - * The actual object that is the target of the reference (The practitioner who was involved in the procedure.) - */ - protected Resource personTarget; - - /** - * E.g. surgeon, anaethetist, endoscopist. - */ - @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="The role the person was in", formalDefinition="E.g. surgeon, anaethetist, endoscopist." ) - protected CodeableConcept role; - - private static final long serialVersionUID = -1975652413L; - - /* - * Constructor - */ - public ProcedurePerformerComponent() { - super(); - } - - /** - * @return {@link #person} (The practitioner who was involved in the procedure.) - */ - public Reference getPerson() { - if (this.person == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedurePerformerComponent.person"); - else if (Configuration.doAutoCreate()) - this.person = new Reference(); // cc - return this.person; - } - - public boolean hasPerson() { - return this.person != null && !this.person.isEmpty(); - } - - /** - * @param value {@link #person} (The practitioner who was involved in the procedure.) - */ - public ProcedurePerformerComponent setPerson(Reference value) { - this.person = value; - return this; - } - - /** - * @return {@link #person} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who was involved in the procedure.) - */ - public Resource getPersonTarget() { - return this.personTarget; - } - - /** - * @param value {@link #person} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who was involved in the procedure.) - */ - public ProcedurePerformerComponent setPersonTarget(Resource value) { - this.personTarget = value; - return this; - } - - /** - * @return {@link #role} (E.g. surgeon, anaethetist, endoscopist.) - */ - public CodeableConcept getRole() { - if (this.role == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedurePerformerComponent.role"); - else if (Configuration.doAutoCreate()) - this.role = new CodeableConcept(); // cc - return this.role; - } - - public boolean hasRole() { - return this.role != null && !this.role.isEmpty(); - } - - /** - * @param value {@link #role} (E.g. surgeon, anaethetist, endoscopist.) - */ - public ProcedurePerformerComponent setRole(CodeableConcept value) { - this.role = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("person", "Reference(Practitioner|Patient|RelatedPerson)", "The practitioner who was involved in the procedure.", 0, java.lang.Integer.MAX_VALUE, person)); - childrenList.add(new Property("role", "CodeableConcept", "E.g. surgeon, anaethetist, endoscopist.", 0, java.lang.Integer.MAX_VALUE, role)); - } - - public ProcedurePerformerComponent copy() { - ProcedurePerformerComponent dst = new ProcedurePerformerComponent(); - copyValues(dst); - dst.person = person == null ? null : person.copy(); - dst.role = role == null ? null : role.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProcedurePerformerComponent)) - return false; - ProcedurePerformerComponent o = (ProcedurePerformerComponent) other; - return compareDeep(person, o.person, true) && compareDeep(role, o.role, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProcedurePerformerComponent)) - return false; - ProcedurePerformerComponent o = (ProcedurePerformerComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (person == null || person.isEmpty()) && (role == null || role.isEmpty()) - ; - } - - } - - @Block() - public static class ProcedureRelatedItemComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The nature of the relationship. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="caused-by | because-of", formalDefinition="The nature of the relationship." ) - protected Enumeration type; - - /** - * The related item - e.g. a procedure. - */ - @Child(name = "target", type = {AllergyIntolerance.class, CarePlan.class, Condition.class, DiagnosticReport.class, FamilyMemberHistory.class, ImagingStudy.class, Immunization.class, ImmunizationRecommendation.class, MedicationAdministration.class, MedicationDispense.class, MedicationPrescription.class, MedicationStatement.class, Observation.class, Procedure.class}, order=2, min=0, max=1) - @Description(shortDefinition="The related item - e.g. a procedure", formalDefinition="The related item - e.g. a procedure." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (The related item - e.g. a procedure.) - */ - protected Resource targetTarget; - - private static final long serialVersionUID = 41929784L; - - /* - * Constructor - */ - public ProcedureRelatedItemComponent() { - super(); - } - - /** - * @return {@link #type} (The nature of the relationship.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRelatedItemComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new ProcedureRelationshipTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The nature of the relationship.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ProcedureRelatedItemComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The nature of the relationship. - */ - public ProcedureRelationshipType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The nature of the relationship. - */ - public ProcedureRelatedItemComponent setType(ProcedureRelationshipType value) { - if (value == null) - this.type = null; - else { - if (this.type == null) - this.type = new Enumeration(new ProcedureRelationshipTypeEnumFactory()); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (The related item - e.g. a procedure.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRelatedItemComponent.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); // cc - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The related item - e.g. a procedure.) - */ - public ProcedureRelatedItemComponent 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 related item - e.g. a procedure.) - */ - public Resource getTargetTarget() { - return this.targetTarget; - } - - /** - * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The related item - e.g. a procedure.) - */ - public ProcedureRelatedItemComponent setTargetTarget(Resource value) { - this.targetTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "The nature of the relationship.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("target", "Reference(AllergyIntolerance|CarePlan|Condition|DiagnosticReport|FamilyMemberHistory|ImagingStudy|Immunization|ImmunizationRecommendation|MedicationAdministration|MedicationDispense|MedicationPrescription|MedicationStatement|Observation|Procedure)", "The related item - e.g. a procedure.", 0, java.lang.Integer.MAX_VALUE, target)); - } - - public ProcedureRelatedItemComponent copy() { - ProcedureRelatedItemComponent dst = new ProcedureRelatedItemComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.target = target == null ? null : target.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProcedureRelatedItemComponent)) - return false; - ProcedureRelatedItemComponent o = (ProcedureRelatedItemComponent) other; - return compareDeep(type, o.type, true) && compareDeep(target, o.target, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProcedureRelatedItemComponent)) - return false; - ProcedureRelatedItemComponent o = (ProcedureRelatedItemComponent) other; - return compareValues(type, o.type, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (target == null || target.isEmpty()) - ; - } - - } - - @Block() - public static class ProcedureDeviceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The kind of change that happened to the device during the procedure. - */ - @Child(name = "action", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Kind of change to device", formalDefinition="The kind of change that happened to the device during the procedure." ) - protected CodeableConcept action; - - /** - * The device that was manipulated (changed) during the procedure. - */ - @Child(name = "manipulated", type = {Device.class}, order=2, min=1, max=1) - @Description(shortDefinition="Device that was changed", formalDefinition="The device that was manipulated (changed) during the procedure." ) - protected Reference manipulated; - - /** - * The actual object that is the target of the reference (The device that was manipulated (changed) during the procedure.) - */ - protected Device manipulatedTarget; - - private static final long serialVersionUID = 1779937807L; - - /* - * Constructor - */ - public ProcedureDeviceComponent() { - super(); - } - - /* - * Constructor - */ - public ProcedureDeviceComponent(Reference manipulated) { - super(); - this.manipulated = manipulated; - } - - /** - * @return {@link #action} (The kind of change that happened to the device during the procedure.) - */ - public CodeableConcept getAction() { - if (this.action == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureDeviceComponent.action"); - else if (Configuration.doAutoCreate()) - this.action = new CodeableConcept(); // cc - return this.action; - } - - public boolean hasAction() { - return this.action != null && !this.action.isEmpty(); - } - - /** - * @param value {@link #action} (The kind of change that happened to the device during the procedure.) - */ - public ProcedureDeviceComponent setAction(CodeableConcept value) { - this.action = value; - return this; - } - - /** - * @return {@link #manipulated} (The device that was manipulated (changed) during the procedure.) - */ - public Reference getManipulated() { - if (this.manipulated == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureDeviceComponent.manipulated"); - else if (Configuration.doAutoCreate()) - this.manipulated = new Reference(); // cc - return this.manipulated; - } - - public boolean hasManipulated() { - return this.manipulated != null && !this.manipulated.isEmpty(); - } - - /** - * @param value {@link #manipulated} (The device that was manipulated (changed) during the procedure.) - */ - public ProcedureDeviceComponent setManipulated(Reference value) { - this.manipulated = value; - return this; - } - - /** - * @return {@link #manipulated} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The device that was manipulated (changed) during the procedure.) - */ - public Device getManipulatedTarget() { - if (this.manipulatedTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureDeviceComponent.manipulated"); - else if (Configuration.doAutoCreate()) - this.manipulatedTarget = new Device(); // aa - return this.manipulatedTarget; - } - - /** - * @param value {@link #manipulated} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The device that was manipulated (changed) during the procedure.) - */ - public ProcedureDeviceComponent setManipulatedTarget(Device value) { - this.manipulatedTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("action", "CodeableConcept", "The kind of change that happened to the device during the procedure.", 0, java.lang.Integer.MAX_VALUE, action)); - childrenList.add(new Property("manipulated", "Reference(Device)", "The device that was manipulated (changed) during the procedure.", 0, java.lang.Integer.MAX_VALUE, manipulated)); - } - - public ProcedureDeviceComponent copy() { - ProcedureDeviceComponent dst = new ProcedureDeviceComponent(); - copyValues(dst); - dst.action = action == null ? null : action.copy(); - dst.manipulated = manipulated == null ? null : manipulated.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProcedureDeviceComponent)) - return false; - ProcedureDeviceComponent o = (ProcedureDeviceComponent) other; - return compareDeep(action, o.action, true) && compareDeep(manipulated, o.manipulated, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProcedureDeviceComponent)) - return false; - ProcedureDeviceComponent o = (ProcedureDeviceComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (action == null || action.isEmpty()) && (manipulated == null || manipulated.isEmpty()) - ; - } - - } - - /** - * This records identifiers associated with this procedure that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External Ids for this procedure", formalDefinition="This records identifiers associated with this procedure that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) - protected List identifier; - - /** - * The person on whom the procedure was performed. - */ - @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1) - @Description(shortDefinition="Who procedure was performed on", formalDefinition="The person on whom the procedure was performed." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The person on whom the procedure was performed.) - */ - protected Patient patientTarget; - - /** - * A code specifying the state of the procedure record. Generally this will be in-progress or completed state. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="in-progress | aborted | completed | entered-in-error", formalDefinition="A code specifying the state of the procedure record. Generally this will be in-progress or completed state." ) - protected Enumeration status; - - /** - * A code that classifies the procedure for searching, sorting and display purposes. - */ - @Child(name = "category", type = {CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Classification of the procedure", formalDefinition="A code that classifies the procedure for searching, sorting and display purposes." ) - protected CodeableConcept category; - - /** - * The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=4, min=1, max=1) - @Description(shortDefinition="Identification of the procedure", formalDefinition="The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded." ) - protected CodeableConcept type; - - /** - * Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion. - */ - @Child(name = "bodySite", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Precise location details", formalDefinition="Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion." ) - protected List bodySite; - - /** - * The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text. - */ - @Child(name = "indication", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Reason procedure performed", formalDefinition="The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text." ) - protected List indication; - - /** - * Limited to 'real' people rather than equipment. - */ - @Child(name = "performer", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The people who performed the procedure", formalDefinition="Limited to 'real' people rather than equipment." ) - protected List performer; - - /** - * The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured. - */ - @Child(name = "performed", type = {DateTimeType.class, Period.class}, order=8, min=0, max=1) - @Description(shortDefinition="Date/Period the procedure was performed", formalDefinition="The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured." ) - protected Type performed; - - /** - * The encounter during which the procedure was performed. - */ - @Child(name = "encounter", type = {Encounter.class}, order=9, min=0, max=1) - @Description(shortDefinition="The encounter when procedure performed", formalDefinition="The encounter during which the procedure was performed." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The encounter during which the procedure was performed.) - */ - protected Encounter encounterTarget; - - /** - * The location where the procedure actually happened. e.g. a newborn at home, a tracheostomy at a restaurant. - */ - @Child(name = "location", type = {Location.class}, order=10, min=0, max=1) - @Description(shortDefinition="Where the procedure happened", formalDefinition="The location where the procedure actually happened. e.g. a newborn at home, a tracheostomy at a restaurant." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (The location where the procedure actually happened. e.g. a newborn at home, a tracheostomy at a restaurant.) - */ - protected Location locationTarget; - - /** - * What was the outcome of the procedure - did it resolve reasons why the procedure was performed? - */ - @Child(name = "outcome", type = {CodeableConcept.class}, order=11, min=0, max=1) - @Description(shortDefinition="What was result of procedure?", formalDefinition="What was the outcome of the procedure - did it resolve reasons why the procedure was performed?" ) - protected CodeableConcept outcome; - - /** - * This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies. - */ - @Child(name = "report", type = {DiagnosticReport.class}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Any report that results from the procedure", formalDefinition="This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies." ) - protected List report; - /** - * The actual objects that are the target of the reference (This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.) - */ - protected List reportTarget; - - - /** - * Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues. - */ - @Child(name = "complication", type = {CodeableConcept.class}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Complication following the procedure", formalDefinition="Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues." ) - protected List complication; - - /** - * If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used. - */ - @Child(name = "followUp", type = {CodeableConcept.class}, order=14, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Instructions for follow up", formalDefinition="If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used." ) - protected List followUp; - - /** - * Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure. - */ - @Child(name = "relatedItem", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A procedure that is related to this one", formalDefinition="Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure." ) - protected List relatedItem; - - /** - * Any other notes about the procedure - e.g. the operative notes. - */ - @Child(name = "notes", type = {StringType.class}, order=16, min=0, max=1) - @Description(shortDefinition="Additional information about procedure", formalDefinition="Any other notes about the procedure - e.g. the operative notes." ) - protected StringType notes; - - /** - * A device change during the procedure. - */ - @Child(name = "device", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Device changed in procedure", formalDefinition="A device change during the procedure." ) - protected List device; - - /** - * Identifies medications, devices and other substance used as part of the procedure. - */ - @Child(name = "used", type = {Device.class, Medication.class, Substance.class}, order=18, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Items used during procedure", formalDefinition="Identifies medications, devices and other substance used as part of the procedure." ) - protected List used; - /** - * The actual objects that are the target of the reference (Identifies medications, devices and other substance used as part of the procedure.) - */ - protected List usedTarget; - - - private static final long serialVersionUID = -1258770542L; - - /* - * Constructor - */ - public Procedure() { - super(); - } - - /* - * Constructor - */ - public Procedure(Reference patient, Enumeration status, CodeableConcept type) { - super(); - this.patient = patient; - this.status = status; - this.type = type; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this procedure that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this procedure that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Procedure addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #patient} (The person on whom the procedure was performed.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The person on whom the procedure was performed.) - */ - public Procedure setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person on whom the procedure was performed.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person on whom the procedure was performed.) - */ - public Procedure setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #status} (A code specifying the state of the procedure record. Generally this will be in-progress or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ProcedureStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (A code specifying the state of the procedure record. Generally this will be in-progress or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Procedure setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return A code specifying the state of the procedure record. Generally this will be in-progress or completed state. - */ - public ProcedureStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value A code specifying the state of the procedure record. Generally this will be in-progress or completed state. - */ - public Procedure setStatus(ProcedureStatus value) { - if (this.status == null) - this.status = new Enumeration(new ProcedureStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #category} (A code that classifies the procedure for searching, sorting and display purposes.) - */ - public CodeableConcept getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.category"); - else if (Configuration.doAutoCreate()) - this.category = new CodeableConcept(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (A code that classifies the procedure for searching, sorting and display purposes.) - */ - public Procedure setCategory(CodeableConcept value) { - this.category = value; - return this; - } - - /** - * @return {@link #type} (The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded.) - */ - public Procedure setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #bodySite} (Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.) - */ - public List getBodySite() { - if (this.bodySite == null) - this.bodySite = new ArrayList(); - return this.bodySite; - } - - public boolean hasBodySite() { - if (this.bodySite == null) - return false; - for (ProcedureBodySiteComponent item : this.bodySite) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #bodySite} (Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.) - */ - // syntactic sugar - public ProcedureBodySiteComponent addBodySite() { //3 - ProcedureBodySiteComponent t = new ProcedureBodySiteComponent(); - if (this.bodySite == null) - this.bodySite = new ArrayList(); - this.bodySite.add(t); - return t; - } - - // syntactic sugar - public Procedure addBodySite(ProcedureBodySiteComponent t) { //3 - if (t == null) - return this; - if (this.bodySite == null) - this.bodySite = new ArrayList(); - this.bodySite.add(t); - return this; - } - - /** - * @return {@link #indication} (The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text.) - */ - public List getIndication() { - if (this.indication == null) - this.indication = new ArrayList(); - return this.indication; - } - - public boolean hasIndication() { - if (this.indication == null) - return false; - for (CodeableConcept item : this.indication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #indication} (The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text.) - */ - // syntactic sugar - public CodeableConcept addIndication() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.indication == null) - this.indication = new ArrayList(); - this.indication.add(t); - return t; - } - - // syntactic sugar - public Procedure addIndication(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.indication == null) - this.indication = new ArrayList(); - this.indication.add(t); - return this; - } - - /** - * @return {@link #performer} (Limited to 'real' people rather than equipment.) - */ - public List getPerformer() { - if (this.performer == null) - this.performer = new ArrayList(); - return this.performer; - } - - public boolean hasPerformer() { - if (this.performer == null) - return false; - for (ProcedurePerformerComponent item : this.performer) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #performer} (Limited to 'real' people rather than equipment.) - */ - // syntactic sugar - public ProcedurePerformerComponent addPerformer() { //3 - ProcedurePerformerComponent t = new ProcedurePerformerComponent(); - if (this.performer == null) - this.performer = new ArrayList(); - this.performer.add(t); - return t; - } - - // syntactic sugar - public Procedure addPerformer(ProcedurePerformerComponent t) { //3 - if (t == null) - return this; - if (this.performer == null) - this.performer = new ArrayList(); - this.performer.add(t); - return this; - } - - /** - * @return {@link #performed} (The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.) - */ - public Type getPerformed() { - return this.performed; - } - - /** - * @return {@link #performed} (The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.) - */ - public DateTimeType getPerformedDateTimeType() throws Exception { - if (!(this.performed instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.performed.getClass().getName()+" was encountered"); - return (DateTimeType) this.performed; - } - - /** - * @return {@link #performed} (The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.) - */ - public Period getPerformedPeriod() throws Exception { - if (!(this.performed instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.performed.getClass().getName()+" was encountered"); - return (Period) this.performed; - } - - public boolean hasPerformed() { - return this.performed != null && !this.performed.isEmpty(); - } - - /** - * @param value {@link #performed} (The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.) - */ - public Procedure setPerformed(Type value) { - this.performed = value; - return this; - } - - /** - * @return {@link #encounter} (The encounter during which the procedure was performed.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (The encounter during which the procedure was performed.) - */ - public Procedure setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter during which the procedure was performed.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter during which the procedure was performed.) - */ - public Procedure setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #location} (The location where the procedure actually happened. e.g. a newborn at home, a tracheostomy at a restaurant.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); // cc - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (The location where the procedure actually happened. e.g. a newborn at home, a tracheostomy at a restaurant.) - */ - public Procedure setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The location where the procedure actually happened. e.g. a newborn at home, a tracheostomy at a restaurant.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); // aa - return this.locationTarget; - } - - /** - * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The location where the procedure actually happened. e.g. a newborn at home, a tracheostomy at a restaurant.) - */ - public Procedure setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #outcome} (What was the outcome of the procedure - did it resolve reasons why the procedure was performed?) - */ - public CodeableConcept getOutcome() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new CodeableConcept(); // cc - return this.outcome; - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (What was the outcome of the procedure - did it resolve reasons why the procedure was performed?) - */ - public Procedure setOutcome(CodeableConcept value) { - this.outcome = value; - return this; - } - - /** - * @return {@link #report} (This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.) - */ - public List getReport() { - if (this.report == null) - this.report = new ArrayList(); - return this.report; - } - - public boolean hasReport() { - if (this.report == null) - return false; - for (Reference item : this.report) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #report} (This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.) - */ - // syntactic sugar - public Reference addReport() { //3 - Reference t = new Reference(); - if (this.report == null) - this.report = new ArrayList(); - this.report.add(t); - return t; - } - - // syntactic sugar - public Procedure addReport(Reference t) { //3 - if (t == null) - return this; - if (this.report == null) - this.report = new ArrayList(); - this.report.add(t); - return this; - } - - /** - * @return {@link #report} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.) - */ - public List getReportTarget() { - if (this.reportTarget == null) - this.reportTarget = new ArrayList(); - return this.reportTarget; - } - - // syntactic sugar - /** - * @return {@link #report} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.) - */ - public DiagnosticReport addReportTarget() { - DiagnosticReport r = new DiagnosticReport(); - if (this.reportTarget == null) - this.reportTarget = new ArrayList(); - this.reportTarget.add(r); - return r; - } - - /** - * @return {@link #complication} (Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues.) - */ - public List getComplication() { - if (this.complication == null) - this.complication = new ArrayList(); - return this.complication; - } - - public boolean hasComplication() { - if (this.complication == null) - return false; - for (CodeableConcept item : this.complication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #complication} (Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues.) - */ - // syntactic sugar - public CodeableConcept addComplication() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.complication == null) - this.complication = new ArrayList(); - this.complication.add(t); - return t; - } - - // syntactic sugar - public Procedure addComplication(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.complication == null) - this.complication = new ArrayList(); - this.complication.add(t); - return this; - } - - /** - * @return {@link #followUp} (If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used.) - */ - public List getFollowUp() { - if (this.followUp == null) - this.followUp = new ArrayList(); - return this.followUp; - } - - public boolean hasFollowUp() { - if (this.followUp == null) - return false; - for (CodeableConcept item : this.followUp) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #followUp} (If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used.) - */ - // syntactic sugar - public CodeableConcept addFollowUp() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.followUp == null) - this.followUp = new ArrayList(); - this.followUp.add(t); - return t; - } - - // syntactic sugar - public Procedure addFollowUp(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.followUp == null) - this.followUp = new ArrayList(); - this.followUp.add(t); - return this; - } - - /** - * @return {@link #relatedItem} (Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure.) - */ - public List getRelatedItem() { - if (this.relatedItem == null) - this.relatedItem = new ArrayList(); - return this.relatedItem; - } - - public boolean hasRelatedItem() { - if (this.relatedItem == null) - return false; - for (ProcedureRelatedItemComponent item : this.relatedItem) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #relatedItem} (Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure.) - */ - // syntactic sugar - public ProcedureRelatedItemComponent addRelatedItem() { //3 - ProcedureRelatedItemComponent t = new ProcedureRelatedItemComponent(); - if (this.relatedItem == null) - this.relatedItem = new ArrayList(); - this.relatedItem.add(t); - return t; - } - - // syntactic sugar - public Procedure addRelatedItem(ProcedureRelatedItemComponent t) { //3 - if (t == null) - return this; - if (this.relatedItem == null) - this.relatedItem = new ArrayList(); - this.relatedItem.add(t); - return this; - } - - /** - * @return {@link #notes} (Any other notes about the procedure - e.g. the operative notes.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public StringType getNotesElement() { - if (this.notes == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.notes"); - else if (Configuration.doAutoCreate()) - this.notes = new StringType(); // bb - return this.notes; - } - - public boolean hasNotesElement() { - return this.notes != null && !this.notes.isEmpty(); - } - - public boolean hasNotes() { - return this.notes != null && !this.notes.isEmpty(); - } - - /** - * @param value {@link #notes} (Any other notes about the procedure - e.g. the operative notes.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public Procedure setNotesElement(StringType value) { - this.notes = value; - return this; - } - - /** - * @return Any other notes about the procedure - e.g. the operative notes. - */ - public String getNotes() { - return this.notes == null ? null : this.notes.getValue(); - } - - /** - * @param value Any other notes about the procedure - e.g. the operative notes. - */ - public Procedure setNotes(String value) { - if (Utilities.noString(value)) - this.notes = null; - else { - if (this.notes == null) - this.notes = new StringType(); - this.notes.setValue(value); - } - return this; - } - - /** - * @return {@link #device} (A device change during the procedure.) - */ - public List getDevice() { - if (this.device == null) - this.device = new ArrayList(); - return this.device; - } - - public boolean hasDevice() { - if (this.device == null) - return false; - for (ProcedureDeviceComponent item : this.device) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #device} (A device change during the procedure.) - */ - // syntactic sugar - public ProcedureDeviceComponent addDevice() { //3 - ProcedureDeviceComponent t = new ProcedureDeviceComponent(); - if (this.device == null) - this.device = new ArrayList(); - this.device.add(t); - return t; - } - - // syntactic sugar - public Procedure addDevice(ProcedureDeviceComponent t) { //3 - if (t == null) - return this; - if (this.device == null) - this.device = new ArrayList(); - this.device.add(t); - return this; - } - - /** - * @return {@link #used} (Identifies medications, devices and other substance used as part of the procedure.) - */ - public List getUsed() { - if (this.used == null) - this.used = new ArrayList(); - return this.used; - } - - public boolean hasUsed() { - if (this.used == null) - return false; - for (Reference item : this.used) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #used} (Identifies medications, devices and other substance used as part of the procedure.) - */ - // syntactic sugar - public Reference addUsed() { //3 - Reference t = new Reference(); - if (this.used == null) - this.used = new ArrayList(); - this.used.add(t); - return t; - } - - // syntactic sugar - public Procedure addUsed(Reference t) { //3 - if (t == null) - return this; - if (this.used == null) - this.used = new ArrayList(); - this.used.add(t); - return this; - } - - /** - * @return {@link #used} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies medications, devices and other substance used as part of the procedure.) - */ - public List getUsedTarget() { - if (this.usedTarget == null) - this.usedTarget = new ArrayList(); - return this.usedTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this procedure that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("patient", "Reference(Patient)", "The person on whom the procedure was performed.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("status", "code", "A code specifying the state of the procedure record. Generally this will be in-progress or completed state.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("category", "CodeableConcept", "A code that classifies the procedure for searching, sorting and display purposes.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("type", "CodeableConcept", "The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("bodySite", "", "Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("indication", "CodeableConcept", "The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text.", 0, java.lang.Integer.MAX_VALUE, indication)); - childrenList.add(new Property("performer", "", "Limited to 'real' people rather than equipment.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("performed[x]", "dateTime|Period", "The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, java.lang.Integer.MAX_VALUE, performed)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter during which the procedure was performed.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("location", "Reference(Location)", "The location where the procedure actually happened. e.g. a newborn at home, a tracheostomy at a restaurant.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("outcome", "CodeableConcept", "What was the outcome of the procedure - did it resolve reasons why the procedure was performed?", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("report", "Reference(DiagnosticReport)", "This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.", 0, java.lang.Integer.MAX_VALUE, report)); - childrenList.add(new Property("complication", "CodeableConcept", "Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues.", 0, java.lang.Integer.MAX_VALUE, complication)); - childrenList.add(new Property("followUp", "CodeableConcept", "If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used.", 0, java.lang.Integer.MAX_VALUE, followUp)); - childrenList.add(new Property("relatedItem", "", "Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure.", 0, java.lang.Integer.MAX_VALUE, relatedItem)); - childrenList.add(new Property("notes", "string", "Any other notes about the procedure - e.g. the operative notes.", 0, java.lang.Integer.MAX_VALUE, notes)); - childrenList.add(new Property("device", "", "A device change during the procedure.", 0, java.lang.Integer.MAX_VALUE, device)); - childrenList.add(new Property("used", "Reference(Device|Medication|Substance)", "Identifies medications, devices and other substance used as part of the procedure.", 0, java.lang.Integer.MAX_VALUE, used)); - } - - public Procedure copy() { - Procedure dst = new Procedure(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - dst.status = status == null ? null : status.copy(); - dst.category = category == null ? null : category.copy(); - dst.type = type == null ? null : type.copy(); - if (bodySite != null) { - dst.bodySite = new ArrayList(); - for (ProcedureBodySiteComponent i : bodySite) - dst.bodySite.add(i.copy()); - }; - if (indication != null) { - dst.indication = new ArrayList(); - for (CodeableConcept i : indication) - dst.indication.add(i.copy()); - }; - if (performer != null) { - dst.performer = new ArrayList(); - for (ProcedurePerformerComponent i : performer) - dst.performer.add(i.copy()); - }; - dst.performed = performed == null ? null : performed.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.location = location == null ? null : location.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - if (report != null) { - dst.report = new ArrayList(); - for (Reference i : report) - dst.report.add(i.copy()); - }; - if (complication != null) { - dst.complication = new ArrayList(); - for (CodeableConcept i : complication) - dst.complication.add(i.copy()); - }; - if (followUp != null) { - dst.followUp = new ArrayList(); - for (CodeableConcept i : followUp) - dst.followUp.add(i.copy()); - }; - if (relatedItem != null) { - dst.relatedItem = new ArrayList(); - for (ProcedureRelatedItemComponent i : relatedItem) - dst.relatedItem.add(i.copy()); - }; - dst.notes = notes == null ? null : notes.copy(); - if (device != null) { - dst.device = new ArrayList(); - for (ProcedureDeviceComponent i : device) - dst.device.add(i.copy()); - }; - if (used != null) { - dst.used = new ArrayList(); - for (Reference i : used) - dst.used.add(i.copy()); - }; - return dst; - } - - protected Procedure typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Procedure)) - return false; - Procedure o = (Procedure) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(status, o.status, true) - && compareDeep(category, o.category, true) && compareDeep(type, o.type, true) && compareDeep(bodySite, o.bodySite, true) - && compareDeep(indication, o.indication, true) && compareDeep(performer, o.performer, true) && compareDeep(performed, o.performed, true) - && compareDeep(encounter, o.encounter, true) && compareDeep(location, o.location, true) && compareDeep(outcome, o.outcome, true) - && compareDeep(report, o.report, true) && compareDeep(complication, o.complication, true) && compareDeep(followUp, o.followUp, true) - && compareDeep(relatedItem, o.relatedItem, true) && compareDeep(notes, o.notes, true) && compareDeep(device, o.device, true) - && compareDeep(used, o.used, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Procedure)) - return false; - Procedure o = (Procedure) other; - return compareValues(status, o.status, true) && compareValues(notes, o.notes, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) - && (status == null || status.isEmpty()) && (category == null || category.isEmpty()) && (type == null || type.isEmpty()) - && (bodySite == null || bodySite.isEmpty()) && (indication == null || indication.isEmpty()) - && (performer == null || performer.isEmpty()) && (performed == null || performed.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (location == null || location.isEmpty()) - && (outcome == null || outcome.isEmpty()) && (report == null || report.isEmpty()) && (complication == null || complication.isEmpty()) - && (followUp == null || followUp.isEmpty()) && (relatedItem == null || relatedItem.isEmpty()) - && (notes == null || notes.isEmpty()) && (device == null || device.isEmpty()) && (used == null || used.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Procedure; - } - - @SearchParamDefinition(name="patient", path="Procedure.patient", description="The identity of a patient to list procedures for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="location", path="Procedure.location", description="Where the procedure happened", type="reference" ) - public static final String SP_LOCATION = "location"; - @SearchParamDefinition(name="performer", path="Procedure.performer.person", description="The reference to the practitioner", type="reference" ) - public static final String SP_PERFORMER = "performer"; - @SearchParamDefinition(name="encounter", path="Procedure.encounter", description="The encounter when procedure performed", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - @SearchParamDefinition(name="date", path="Procedure.performed[x]", description="Date/Period the procedure was performed", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="type", path="Procedure.type", description="Type of procedure", type="token" ) - public static final String SP_TYPE = "type"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * An action that is or was performed on a patient. This can be a physical 'thing' like an operation, or less invasive like counseling or hypnotherapy. + */ +@ResourceDef(name="Procedure", profile="http://hl7.org/fhir/Profile/Procedure") +public class Procedure extends DomainResource { + + public enum ProcedureStatus { + /** + * The procedure is still occurring. + */ + INPROGRESS, + /** + * The procedure was terminated without completing successfully. + */ + ABORTED, + /** + * All actions involved in the procedure have taken place. + */ + COMPLETED, + /** + * The statement was entered in error and Is not valid. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static ProcedureStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("aborted".equals(codeString)) + return ABORTED; + if ("completed".equals(codeString)) + return COMPLETED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new Exception("Unknown ProcedureStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INPROGRESS: return "in-progress"; + case ABORTED: return "aborted"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return ""; + case ABORTED: return ""; + case COMPLETED: return ""; + case ENTEREDINERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "The procedure is still occurring."; + case ABORTED: return "The procedure was terminated without completing successfully."; + case COMPLETED: return "All actions involved in the procedure have taken place."; + case ENTEREDINERROR: return "The statement was entered in error and Is not valid."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "In Progress"; + case ABORTED: return "Aborted"; + case COMPLETED: return "Completed"; + case ENTEREDINERROR: return "Entered In Error"; + default: return "?"; + } + } + } + + public static class ProcedureStatusEnumFactory implements EnumFactory { + public ProcedureStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return ProcedureStatus.INPROGRESS; + if ("aborted".equals(codeString)) + return ProcedureStatus.ABORTED; + if ("completed".equals(codeString)) + return ProcedureStatus.COMPLETED; + if ("entered-in-error".equals(codeString)) + return ProcedureStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown ProcedureStatus code '"+codeString+"'"); + } + public String toCode(ProcedureStatus code) { + if (code == ProcedureStatus.INPROGRESS) + return "in-progress"; + if (code == ProcedureStatus.ABORTED) + return "aborted"; + if (code == ProcedureStatus.COMPLETED) + return "completed"; + if (code == ProcedureStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + } + + public enum ProcedureRelationshipType { + /** + * This procedure had to be performed because of the related one. + */ + CAUSEDBY, + /** + * This procedure caused the related one to be performed. + */ + BECAUSEOF, + /** + * added to help the parsers + */ + NULL; + public static ProcedureRelationshipType fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("caused-by".equals(codeString)) + return CAUSEDBY; + if ("because-of".equals(codeString)) + return BECAUSEOF; + throw new Exception("Unknown ProcedureRelationshipType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CAUSEDBY: return "caused-by"; + case BECAUSEOF: return "because-of"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CAUSEDBY: return ""; + case BECAUSEOF: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CAUSEDBY: return "This procedure had to be performed because of the related one."; + case BECAUSEOF: return "This procedure caused the related one to be performed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CAUSEDBY: return "Caused By"; + case BECAUSEOF: return "Because Of"; + default: return "?"; + } + } + } + + public static class ProcedureRelationshipTypeEnumFactory implements EnumFactory { + public ProcedureRelationshipType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("caused-by".equals(codeString)) + return ProcedureRelationshipType.CAUSEDBY; + if ("because-of".equals(codeString)) + return ProcedureRelationshipType.BECAUSEOF; + throw new IllegalArgumentException("Unknown ProcedureRelationshipType code '"+codeString+"'"); + } + public String toCode(ProcedureRelationshipType code) { + if (code == ProcedureRelationshipType.CAUSEDBY) + return "caused-by"; + if (code == ProcedureRelationshipType.BECAUSEOF) + return "because-of"; + return "?"; + } + } + + @Block() + public static class ProcedureBodySiteComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion. + */ + @Child(name = "site", type = {CodeableConcept.class, BodySite.class}, order=1, min=1, max=1) + @Description(shortDefinition="Precise location details", formalDefinition="Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion." ) + protected Type site; + + private static final long serialVersionUID = 1429072605L; + + /* + * Constructor + */ + public ProcedureBodySiteComponent() { + super(); + } + + /* + * Constructor + */ + public ProcedureBodySiteComponent(Type site) { + super(); + this.site = site; + } + + /** + * @return {@link #site} (Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.) + */ + public Type getSite() { + return this.site; + } + + /** + * @return {@link #site} (Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.) + */ + public CodeableConcept getSiteCodeableConcept() throws Exception { + if (!(this.site instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.site.getClass().getName()+" was encountered"); + return (CodeableConcept) this.site; + } + + /** + * @return {@link #site} (Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.) + */ + public Reference getSiteReference() throws Exception { + if (!(this.site instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.site.getClass().getName()+" was encountered"); + return (Reference) this.site; + } + + public boolean hasSite() { + return this.site != null && !this.site.isEmpty(); + } + + /** + * @param value {@link #site} (Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.) + */ + public ProcedureBodySiteComponent setSite(Type value) { + this.site = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("site[x]", "CodeableConcept|Reference(BodySite)", "Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.", 0, java.lang.Integer.MAX_VALUE, site)); + } + + public ProcedureBodySiteComponent copy() { + ProcedureBodySiteComponent dst = new ProcedureBodySiteComponent(); + copyValues(dst); + dst.site = site == null ? null : site.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProcedureBodySiteComponent)) + return false; + ProcedureBodySiteComponent o = (ProcedureBodySiteComponent) other; + return compareDeep(site, o.site, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProcedureBodySiteComponent)) + return false; + ProcedureBodySiteComponent o = (ProcedureBodySiteComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (site == null || site.isEmpty()); + } + + } + + @Block() + public static class ProcedurePerformerComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The practitioner who was involved in the procedure. + */ + @Child(name = "person", type = {Practitioner.class, Patient.class, RelatedPerson.class}, order=1, min=0, max=1) + @Description(shortDefinition="The reference to the practitioner", formalDefinition="The practitioner who was involved in the procedure." ) + protected Reference person; + + /** + * The actual object that is the target of the reference (The practitioner who was involved in the procedure.) + */ + protected Resource personTarget; + + /** + * E.g. surgeon, anaethetist, endoscopist. + */ + @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="The role the person was in", formalDefinition="E.g. surgeon, anaethetist, endoscopist." ) + protected CodeableConcept role; + + private static final long serialVersionUID = -1975652413L; + + /* + * Constructor + */ + public ProcedurePerformerComponent() { + super(); + } + + /** + * @return {@link #person} (The practitioner who was involved in the procedure.) + */ + public Reference getPerson() { + if (this.person == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedurePerformerComponent.person"); + else if (Configuration.doAutoCreate()) + this.person = new Reference(); // cc + return this.person; + } + + public boolean hasPerson() { + return this.person != null && !this.person.isEmpty(); + } + + /** + * @param value {@link #person} (The practitioner who was involved in the procedure.) + */ + public ProcedurePerformerComponent setPerson(Reference value) { + this.person = value; + return this; + } + + /** + * @return {@link #person} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who was involved in the procedure.) + */ + public Resource getPersonTarget() { + return this.personTarget; + } + + /** + * @param value {@link #person} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who was involved in the procedure.) + */ + public ProcedurePerformerComponent setPersonTarget(Resource value) { + this.personTarget = value; + return this; + } + + /** + * @return {@link #role} (E.g. surgeon, anaethetist, endoscopist.) + */ + public CodeableConcept getRole() { + if (this.role == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedurePerformerComponent.role"); + else if (Configuration.doAutoCreate()) + this.role = new CodeableConcept(); // cc + return this.role; + } + + public boolean hasRole() { + return this.role != null && !this.role.isEmpty(); + } + + /** + * @param value {@link #role} (E.g. surgeon, anaethetist, endoscopist.) + */ + public ProcedurePerformerComponent setRole(CodeableConcept value) { + this.role = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("person", "Reference(Practitioner|Patient|RelatedPerson)", "The practitioner who was involved in the procedure.", 0, java.lang.Integer.MAX_VALUE, person)); + childrenList.add(new Property("role", "CodeableConcept", "E.g. surgeon, anaethetist, endoscopist.", 0, java.lang.Integer.MAX_VALUE, role)); + } + + public ProcedurePerformerComponent copy() { + ProcedurePerformerComponent dst = new ProcedurePerformerComponent(); + copyValues(dst); + dst.person = person == null ? null : person.copy(); + dst.role = role == null ? null : role.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProcedurePerformerComponent)) + return false; + ProcedurePerformerComponent o = (ProcedurePerformerComponent) other; + return compareDeep(person, o.person, true) && compareDeep(role, o.role, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProcedurePerformerComponent)) + return false; + ProcedurePerformerComponent o = (ProcedurePerformerComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (person == null || person.isEmpty()) && (role == null || role.isEmpty()) + ; + } + + } + + @Block() + public static class ProcedureRelatedItemComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The nature of the relationship. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="caused-by | because-of", formalDefinition="The nature of the relationship." ) + protected Enumeration type; + + /** + * The related item - e.g. a procedure. + */ + @Child(name = "target", type = {AllergyIntolerance.class, CarePlan.class, Condition.class, DiagnosticReport.class, FamilyMemberHistory.class, ImagingStudy.class, Immunization.class, ImmunizationRecommendation.class, MedicationAdministration.class, MedicationDispense.class, MedicationPrescription.class, MedicationStatement.class, Observation.class, Procedure.class}, order=2, min=0, max=1) + @Description(shortDefinition="The related item - e.g. a procedure", formalDefinition="The related item - e.g. a procedure." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (The related item - e.g. a procedure.) + */ + protected Resource targetTarget; + + private static final long serialVersionUID = 41929784L; + + /* + * Constructor + */ + public ProcedureRelatedItemComponent() { + super(); + } + + /** + * @return {@link #type} (The nature of the relationship.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRelatedItemComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new ProcedureRelationshipTypeEnumFactory()); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The nature of the relationship.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ProcedureRelatedItemComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The nature of the relationship. + */ + public ProcedureRelationshipType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The nature of the relationship. + */ + public ProcedureRelatedItemComponent setType(ProcedureRelationshipType value) { + if (value == null) + this.type = null; + else { + if (this.type == null) + this.type = new Enumeration(new ProcedureRelationshipTypeEnumFactory()); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (The related item - e.g. a procedure.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRelatedItemComponent.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); // cc + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The related item - e.g. a procedure.) + */ + public ProcedureRelatedItemComponent 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 related item - e.g. a procedure.) + */ + public Resource getTargetTarget() { + return this.targetTarget; + } + + /** + * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The related item - e.g. a procedure.) + */ + public ProcedureRelatedItemComponent setTargetTarget(Resource value) { + this.targetTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "The nature of the relationship.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("target", "Reference(AllergyIntolerance|CarePlan|Condition|DiagnosticReport|FamilyMemberHistory|ImagingStudy|Immunization|ImmunizationRecommendation|MedicationAdministration|MedicationDispense|MedicationPrescription|MedicationStatement|Observation|Procedure)", "The related item - e.g. a procedure.", 0, java.lang.Integer.MAX_VALUE, target)); + } + + public ProcedureRelatedItemComponent copy() { + ProcedureRelatedItemComponent dst = new ProcedureRelatedItemComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.target = target == null ? null : target.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProcedureRelatedItemComponent)) + return false; + ProcedureRelatedItemComponent o = (ProcedureRelatedItemComponent) other; + return compareDeep(type, o.type, true) && compareDeep(target, o.target, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProcedureRelatedItemComponent)) + return false; + ProcedureRelatedItemComponent o = (ProcedureRelatedItemComponent) other; + return compareValues(type, o.type, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (target == null || target.isEmpty()) + ; + } + + } + + @Block() + public static class ProcedureDeviceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The kind of change that happened to the device during the procedure. + */ + @Child(name = "action", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Kind of change to device", formalDefinition="The kind of change that happened to the device during the procedure." ) + protected CodeableConcept action; + + /** + * The device that was manipulated (changed) during the procedure. + */ + @Child(name = "manipulated", type = {Device.class}, order=2, min=1, max=1) + @Description(shortDefinition="Device that was changed", formalDefinition="The device that was manipulated (changed) during the procedure." ) + protected Reference manipulated; + + /** + * The actual object that is the target of the reference (The device that was manipulated (changed) during the procedure.) + */ + protected Device manipulatedTarget; + + private static final long serialVersionUID = 1779937807L; + + /* + * Constructor + */ + public ProcedureDeviceComponent() { + super(); + } + + /* + * Constructor + */ + public ProcedureDeviceComponent(Reference manipulated) { + super(); + this.manipulated = manipulated; + } + + /** + * @return {@link #action} (The kind of change that happened to the device during the procedure.) + */ + public CodeableConcept getAction() { + if (this.action == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureDeviceComponent.action"); + else if (Configuration.doAutoCreate()) + this.action = new CodeableConcept(); // cc + return this.action; + } + + public boolean hasAction() { + return this.action != null && !this.action.isEmpty(); + } + + /** + * @param value {@link #action} (The kind of change that happened to the device during the procedure.) + */ + public ProcedureDeviceComponent setAction(CodeableConcept value) { + this.action = value; + return this; + } + + /** + * @return {@link #manipulated} (The device that was manipulated (changed) during the procedure.) + */ + public Reference getManipulated() { + if (this.manipulated == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureDeviceComponent.manipulated"); + else if (Configuration.doAutoCreate()) + this.manipulated = new Reference(); // cc + return this.manipulated; + } + + public boolean hasManipulated() { + return this.manipulated != null && !this.manipulated.isEmpty(); + } + + /** + * @param value {@link #manipulated} (The device that was manipulated (changed) during the procedure.) + */ + public ProcedureDeviceComponent setManipulated(Reference value) { + this.manipulated = value; + return this; + } + + /** + * @return {@link #manipulated} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The device that was manipulated (changed) during the procedure.) + */ + public Device getManipulatedTarget() { + if (this.manipulatedTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureDeviceComponent.manipulated"); + else if (Configuration.doAutoCreate()) + this.manipulatedTarget = new Device(); // aa + return this.manipulatedTarget; + } + + /** + * @param value {@link #manipulated} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The device that was manipulated (changed) during the procedure.) + */ + public ProcedureDeviceComponent setManipulatedTarget(Device value) { + this.manipulatedTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("action", "CodeableConcept", "The kind of change that happened to the device during the procedure.", 0, java.lang.Integer.MAX_VALUE, action)); + childrenList.add(new Property("manipulated", "Reference(Device)", "The device that was manipulated (changed) during the procedure.", 0, java.lang.Integer.MAX_VALUE, manipulated)); + } + + public ProcedureDeviceComponent copy() { + ProcedureDeviceComponent dst = new ProcedureDeviceComponent(); + copyValues(dst); + dst.action = action == null ? null : action.copy(); + dst.manipulated = manipulated == null ? null : manipulated.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProcedureDeviceComponent)) + return false; + ProcedureDeviceComponent o = (ProcedureDeviceComponent) other; + return compareDeep(action, o.action, true) && compareDeep(manipulated, o.manipulated, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProcedureDeviceComponent)) + return false; + ProcedureDeviceComponent o = (ProcedureDeviceComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (action == null || action.isEmpty()) && (manipulated == null || manipulated.isEmpty()) + ; + } + + } + + /** + * This records identifiers associated with this procedure that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Ids for this procedure", formalDefinition="This records identifiers associated with this procedure that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) + protected List identifier; + + /** + * The person on whom the procedure was performed. + */ + @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1) + @Description(shortDefinition="Who procedure was performed on", formalDefinition="The person on whom the procedure was performed." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The person on whom the procedure was performed.) + */ + protected Patient patientTarget; + + /** + * A code specifying the state of the procedure record. Generally this will be in-progress or completed state. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="in-progress | aborted | completed | entered-in-error", formalDefinition="A code specifying the state of the procedure record. Generally this will be in-progress or completed state." ) + protected Enumeration status; + + /** + * A code that classifies the procedure for searching, sorting and display purposes. + */ + @Child(name = "category", type = {CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Classification of the procedure", formalDefinition="A code that classifies the procedure for searching, sorting and display purposes." ) + protected CodeableConcept category; + + /** + * The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=4, min=1, max=1) + @Description(shortDefinition="Identification of the procedure", formalDefinition="The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded." ) + protected CodeableConcept type; + + /** + * Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion. + */ + @Child(name = "bodySite", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Precise location details", formalDefinition="Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion." ) + protected List bodySite; + + /** + * The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text. + */ + @Child(name = "indication", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Reason procedure performed", formalDefinition="The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text." ) + protected List indication; + + /** + * Limited to 'real' people rather than equipment. + */ + @Child(name = "performer", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The people who performed the procedure", formalDefinition="Limited to 'real' people rather than equipment." ) + protected List performer; + + /** + * The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured. + */ + @Child(name = "performed", type = {DateTimeType.class, Period.class}, order=8, min=0, max=1) + @Description(shortDefinition="Date/Period the procedure was performed", formalDefinition="The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured." ) + protected Type performed; + + /** + * The encounter during which the procedure was performed. + */ + @Child(name = "encounter", type = {Encounter.class}, order=9, min=0, max=1) + @Description(shortDefinition="The encounter when procedure performed", formalDefinition="The encounter during which the procedure was performed." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The encounter during which the procedure was performed.) + */ + protected Encounter encounterTarget; + + /** + * The location where the procedure actually happened. e.g. a newborn at home, a tracheostomy at a restaurant. + */ + @Child(name = "location", type = {Location.class}, order=10, min=0, max=1) + @Description(shortDefinition="Where the procedure happened", formalDefinition="The location where the procedure actually happened. e.g. a newborn at home, a tracheostomy at a restaurant." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (The location where the procedure actually happened. e.g. a newborn at home, a tracheostomy at a restaurant.) + */ + protected Location locationTarget; + + /** + * What was the outcome of the procedure - did it resolve reasons why the procedure was performed? + */ + @Child(name = "outcome", type = {CodeableConcept.class}, order=11, min=0, max=1) + @Description(shortDefinition="What was result of procedure?", formalDefinition="What was the outcome of the procedure - did it resolve reasons why the procedure was performed?" ) + protected CodeableConcept outcome; + + /** + * This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies. + */ + @Child(name = "report", type = {DiagnosticReport.class}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Any report that results from the procedure", formalDefinition="This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies." ) + protected List report; + /** + * The actual objects that are the target of the reference (This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.) + */ + protected List reportTarget; + + + /** + * Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues. + */ + @Child(name = "complication", type = {CodeableConcept.class}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Complication following the procedure", formalDefinition="Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues." ) + protected List complication; + + /** + * If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used. + */ + @Child(name = "followUp", type = {CodeableConcept.class}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Instructions for follow up", formalDefinition="If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used." ) + protected List followUp; + + /** + * Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure. + */ + @Child(name = "relatedItem", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A procedure that is related to this one", formalDefinition="Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure." ) + protected List relatedItem; + + /** + * Any other notes about the procedure - e.g. the operative notes. + */ + @Child(name = "notes", type = {StringType.class}, order=16, min=0, max=1) + @Description(shortDefinition="Additional information about procedure", formalDefinition="Any other notes about the procedure - e.g. the operative notes." ) + protected StringType notes; + + /** + * A device change during the procedure. + */ + @Child(name = "device", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Device changed in procedure", formalDefinition="A device change during the procedure." ) + protected List device; + + /** + * Identifies medications, devices and other substance used as part of the procedure. + */ + @Child(name = "used", type = {Device.class, Medication.class, Substance.class}, order=18, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Items used during procedure", formalDefinition="Identifies medications, devices and other substance used as part of the procedure." ) + protected List used; + /** + * The actual objects that are the target of the reference (Identifies medications, devices and other substance used as part of the procedure.) + */ + protected List usedTarget; + + + private static final long serialVersionUID = -1258770542L; + + /* + * Constructor + */ + public Procedure() { + super(); + } + + /* + * Constructor + */ + public Procedure(Reference patient, Enumeration status, CodeableConcept type) { + super(); + this.patient = patient; + this.status = status; + this.type = type; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this procedure that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this procedure that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Procedure addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #patient} (The person on whom the procedure was performed.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The person on whom the procedure was performed.) + */ + public Procedure setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person on whom the procedure was performed.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person on whom the procedure was performed.) + */ + public Procedure setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #status} (A code specifying the state of the procedure record. Generally this will be in-progress or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ProcedureStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (A code specifying the state of the procedure record. Generally this will be in-progress or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Procedure setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return A code specifying the state of the procedure record. Generally this will be in-progress or completed state. + */ + public ProcedureStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value A code specifying the state of the procedure record. Generally this will be in-progress or completed state. + */ + public Procedure setStatus(ProcedureStatus value) { + if (this.status == null) + this.status = new Enumeration(new ProcedureStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #category} (A code that classifies the procedure for searching, sorting and display purposes.) + */ + public CodeableConcept getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.category"); + else if (Configuration.doAutoCreate()) + this.category = new CodeableConcept(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (A code that classifies the procedure for searching, sorting and display purposes.) + */ + public Procedure setCategory(CodeableConcept value) { + this.category = value; + return this; + } + + /** + * @return {@link #type} (The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded.) + */ + public Procedure setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #bodySite} (Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.) + */ + public List getBodySite() { + if (this.bodySite == null) + this.bodySite = new ArrayList(); + return this.bodySite; + } + + public boolean hasBodySite() { + if (this.bodySite == null) + return false; + for (ProcedureBodySiteComponent item : this.bodySite) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #bodySite} (Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.) + */ + // syntactic sugar + public ProcedureBodySiteComponent addBodySite() { //3 + ProcedureBodySiteComponent t = new ProcedureBodySiteComponent(); + if (this.bodySite == null) + this.bodySite = new ArrayList(); + this.bodySite.add(t); + return t; + } + + // syntactic sugar + public Procedure addBodySite(ProcedureBodySiteComponent t) { //3 + if (t == null) + return this; + if (this.bodySite == null) + this.bodySite = new ArrayList(); + this.bodySite.add(t); + return this; + } + + /** + * @return {@link #indication} (The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text.) + */ + public List getIndication() { + if (this.indication == null) + this.indication = new ArrayList(); + return this.indication; + } + + public boolean hasIndication() { + if (this.indication == null) + return false; + for (CodeableConcept item : this.indication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #indication} (The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text.) + */ + // syntactic sugar + public CodeableConcept addIndication() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return t; + } + + // syntactic sugar + public Procedure addIndication(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return this; + } + + /** + * @return {@link #performer} (Limited to 'real' people rather than equipment.) + */ + public List getPerformer() { + if (this.performer == null) + this.performer = new ArrayList(); + return this.performer; + } + + public boolean hasPerformer() { + if (this.performer == null) + return false; + for (ProcedurePerformerComponent item : this.performer) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #performer} (Limited to 'real' people rather than equipment.) + */ + // syntactic sugar + public ProcedurePerformerComponent addPerformer() { //3 + ProcedurePerformerComponent t = new ProcedurePerformerComponent(); + if (this.performer == null) + this.performer = new ArrayList(); + this.performer.add(t); + return t; + } + + // syntactic sugar + public Procedure addPerformer(ProcedurePerformerComponent t) { //3 + if (t == null) + return this; + if (this.performer == null) + this.performer = new ArrayList(); + this.performer.add(t); + return this; + } + + /** + * @return {@link #performed} (The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.) + */ + public Type getPerformed() { + return this.performed; + } + + /** + * @return {@link #performed} (The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.) + */ + public DateTimeType getPerformedDateTimeType() throws Exception { + if (!(this.performed instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.performed.getClass().getName()+" was encountered"); + return (DateTimeType) this.performed; + } + + /** + * @return {@link #performed} (The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.) + */ + public Period getPerformedPeriod() throws Exception { + if (!(this.performed instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.performed.getClass().getName()+" was encountered"); + return (Period) this.performed; + } + + public boolean hasPerformed() { + return this.performed != null && !this.performed.isEmpty(); + } + + /** + * @param value {@link #performed} (The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.) + */ + public Procedure setPerformed(Type value) { + this.performed = value; + return this; + } + + /** + * @return {@link #encounter} (The encounter during which the procedure was performed.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (The encounter during which the procedure was performed.) + */ + public Procedure setEncounter(Reference value) { + this.encounter = value; + return this; + } + + /** + * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter during which the procedure was performed.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + return this.encounterTarget; + } + + /** + * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter during which the procedure was performed.) + */ + public Procedure setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #location} (The location where the procedure actually happened. e.g. a newborn at home, a tracheostomy at a restaurant.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); // cc + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (The location where the procedure actually happened. e.g. a newborn at home, a tracheostomy at a restaurant.) + */ + public Procedure setLocation(Reference value) { + this.location = value; + return this; + } + + /** + * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The location where the procedure actually happened. e.g. a newborn at home, a tracheostomy at a restaurant.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); // aa + return this.locationTarget; + } + + /** + * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The location where the procedure actually happened. e.g. a newborn at home, a tracheostomy at a restaurant.) + */ + public Procedure setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #outcome} (What was the outcome of the procedure - did it resolve reasons why the procedure was performed?) + */ + public CodeableConcept getOutcome() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new CodeableConcept(); // cc + return this.outcome; + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (What was the outcome of the procedure - did it resolve reasons why the procedure was performed?) + */ + public Procedure setOutcome(CodeableConcept value) { + this.outcome = value; + return this; + } + + /** + * @return {@link #report} (This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.) + */ + public List getReport() { + if (this.report == null) + this.report = new ArrayList(); + return this.report; + } + + public boolean hasReport() { + if (this.report == null) + return false; + for (Reference item : this.report) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #report} (This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.) + */ + // syntactic sugar + public Reference addReport() { //3 + Reference t = new Reference(); + if (this.report == null) + this.report = new ArrayList(); + this.report.add(t); + return t; + } + + // syntactic sugar + public Procedure addReport(Reference t) { //3 + if (t == null) + return this; + if (this.report == null) + this.report = new ArrayList(); + this.report.add(t); + return this; + } + + /** + * @return {@link #report} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.) + */ + public List getReportTarget() { + if (this.reportTarget == null) + this.reportTarget = new ArrayList(); + return this.reportTarget; + } + + // syntactic sugar + /** + * @return {@link #report} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.) + */ + public DiagnosticReport addReportTarget() { + DiagnosticReport r = new DiagnosticReport(); + if (this.reportTarget == null) + this.reportTarget = new ArrayList(); + this.reportTarget.add(r); + return r; + } + + /** + * @return {@link #complication} (Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues.) + */ + public List getComplication() { + if (this.complication == null) + this.complication = new ArrayList(); + return this.complication; + } + + public boolean hasComplication() { + if (this.complication == null) + return false; + for (CodeableConcept item : this.complication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #complication} (Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues.) + */ + // syntactic sugar + public CodeableConcept addComplication() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.complication == null) + this.complication = new ArrayList(); + this.complication.add(t); + return t; + } + + // syntactic sugar + public Procedure addComplication(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.complication == null) + this.complication = new ArrayList(); + this.complication.add(t); + return this; + } + + /** + * @return {@link #followUp} (If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used.) + */ + public List getFollowUp() { + if (this.followUp == null) + this.followUp = new ArrayList(); + return this.followUp; + } + + public boolean hasFollowUp() { + if (this.followUp == null) + return false; + for (CodeableConcept item : this.followUp) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #followUp} (If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used.) + */ + // syntactic sugar + public CodeableConcept addFollowUp() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.followUp == null) + this.followUp = new ArrayList(); + this.followUp.add(t); + return t; + } + + // syntactic sugar + public Procedure addFollowUp(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.followUp == null) + this.followUp = new ArrayList(); + this.followUp.add(t); + return this; + } + + /** + * @return {@link #relatedItem} (Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure.) + */ + public List getRelatedItem() { + if (this.relatedItem == null) + this.relatedItem = new ArrayList(); + return this.relatedItem; + } + + public boolean hasRelatedItem() { + if (this.relatedItem == null) + return false; + for (ProcedureRelatedItemComponent item : this.relatedItem) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #relatedItem} (Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure.) + */ + // syntactic sugar + public ProcedureRelatedItemComponent addRelatedItem() { //3 + ProcedureRelatedItemComponent t = new ProcedureRelatedItemComponent(); + if (this.relatedItem == null) + this.relatedItem = new ArrayList(); + this.relatedItem.add(t); + return t; + } + + // syntactic sugar + public Procedure addRelatedItem(ProcedureRelatedItemComponent t) { //3 + if (t == null) + return this; + if (this.relatedItem == null) + this.relatedItem = new ArrayList(); + this.relatedItem.add(t); + return this; + } + + /** + * @return {@link #notes} (Any other notes about the procedure - e.g. the operative notes.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public StringType getNotesElement() { + if (this.notes == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.notes"); + else if (Configuration.doAutoCreate()) + this.notes = new StringType(); // bb + return this.notes; + } + + public boolean hasNotesElement() { + return this.notes != null && !this.notes.isEmpty(); + } + + public boolean hasNotes() { + return this.notes != null && !this.notes.isEmpty(); + } + + /** + * @param value {@link #notes} (Any other notes about the procedure - e.g. the operative notes.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public Procedure setNotesElement(StringType value) { + this.notes = value; + return this; + } + + /** + * @return Any other notes about the procedure - e.g. the operative notes. + */ + public String getNotes() { + return this.notes == null ? null : this.notes.getValue(); + } + + /** + * @param value Any other notes about the procedure - e.g. the operative notes. + */ + public Procedure setNotes(String value) { + if (Utilities.noString(value)) + this.notes = null; + else { + if (this.notes == null) + this.notes = new StringType(); + this.notes.setValue(value); + } + return this; + } + + /** + * @return {@link #device} (A device change during the procedure.) + */ + public List getDevice() { + if (this.device == null) + this.device = new ArrayList(); + return this.device; + } + + public boolean hasDevice() { + if (this.device == null) + return false; + for (ProcedureDeviceComponent item : this.device) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #device} (A device change during the procedure.) + */ + // syntactic sugar + public ProcedureDeviceComponent addDevice() { //3 + ProcedureDeviceComponent t = new ProcedureDeviceComponent(); + if (this.device == null) + this.device = new ArrayList(); + this.device.add(t); + return t; + } + + // syntactic sugar + public Procedure addDevice(ProcedureDeviceComponent t) { //3 + if (t == null) + return this; + if (this.device == null) + this.device = new ArrayList(); + this.device.add(t); + return this; + } + + /** + * @return {@link #used} (Identifies medications, devices and other substance used as part of the procedure.) + */ + public List getUsed() { + if (this.used == null) + this.used = new ArrayList(); + return this.used; + } + + public boolean hasUsed() { + if (this.used == null) + return false; + for (Reference item : this.used) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #used} (Identifies medications, devices and other substance used as part of the procedure.) + */ + // syntactic sugar + public Reference addUsed() { //3 + Reference t = new Reference(); + if (this.used == null) + this.used = new ArrayList(); + this.used.add(t); + return t; + } + + // syntactic sugar + public Procedure addUsed(Reference t) { //3 + if (t == null) + return this; + if (this.used == null) + this.used = new ArrayList(); + this.used.add(t); + return this; + } + + /** + * @return {@link #used} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies medications, devices and other substance used as part of the procedure.) + */ + public List getUsedTarget() { + if (this.usedTarget == null) + this.usedTarget = new ArrayList(); + return this.usedTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this procedure that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("patient", "Reference(Patient)", "The person on whom the procedure was performed.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("status", "code", "A code specifying the state of the procedure record. Generally this will be in-progress or completed state.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("category", "CodeableConcept", "A code that classifies the procedure for searching, sorting and display purposes.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("type", "CodeableConcept", "The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("bodySite", "", "Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("indication", "CodeableConcept", "The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text.", 0, java.lang.Integer.MAX_VALUE, indication)); + childrenList.add(new Property("performer", "", "Limited to 'real' people rather than equipment.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("performed[x]", "dateTime|Period", "The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, java.lang.Integer.MAX_VALUE, performed)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter during which the procedure was performed.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("location", "Reference(Location)", "The location where the procedure actually happened. e.g. a newborn at home, a tracheostomy at a restaurant.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("outcome", "CodeableConcept", "What was the outcome of the procedure - did it resolve reasons why the procedure was performed?", 0, java.lang.Integer.MAX_VALUE, outcome)); + childrenList.add(new Property("report", "Reference(DiagnosticReport)", "This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.", 0, java.lang.Integer.MAX_VALUE, report)); + childrenList.add(new Property("complication", "CodeableConcept", "Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues.", 0, java.lang.Integer.MAX_VALUE, complication)); + childrenList.add(new Property("followUp", "CodeableConcept", "If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used.", 0, java.lang.Integer.MAX_VALUE, followUp)); + childrenList.add(new Property("relatedItem", "", "Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure.", 0, java.lang.Integer.MAX_VALUE, relatedItem)); + childrenList.add(new Property("notes", "string", "Any other notes about the procedure - e.g. the operative notes.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("device", "", "A device change during the procedure.", 0, java.lang.Integer.MAX_VALUE, device)); + childrenList.add(new Property("used", "Reference(Device|Medication|Substance)", "Identifies medications, devices and other substance used as part of the procedure.", 0, java.lang.Integer.MAX_VALUE, used)); + } + + public Procedure copy() { + Procedure dst = new Procedure(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + dst.status = status == null ? null : status.copy(); + dst.category = category == null ? null : category.copy(); + dst.type = type == null ? null : type.copy(); + if (bodySite != null) { + dst.bodySite = new ArrayList(); + for (ProcedureBodySiteComponent i : bodySite) + dst.bodySite.add(i.copy()); + }; + if (indication != null) { + dst.indication = new ArrayList(); + for (CodeableConcept i : indication) + dst.indication.add(i.copy()); + }; + if (performer != null) { + dst.performer = new ArrayList(); + for (ProcedurePerformerComponent i : performer) + dst.performer.add(i.copy()); + }; + dst.performed = performed == null ? null : performed.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.location = location == null ? null : location.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + if (report != null) { + dst.report = new ArrayList(); + for (Reference i : report) + dst.report.add(i.copy()); + }; + if (complication != null) { + dst.complication = new ArrayList(); + for (CodeableConcept i : complication) + dst.complication.add(i.copy()); + }; + if (followUp != null) { + dst.followUp = new ArrayList(); + for (CodeableConcept i : followUp) + dst.followUp.add(i.copy()); + }; + if (relatedItem != null) { + dst.relatedItem = new ArrayList(); + for (ProcedureRelatedItemComponent i : relatedItem) + dst.relatedItem.add(i.copy()); + }; + dst.notes = notes == null ? null : notes.copy(); + if (device != null) { + dst.device = new ArrayList(); + for (ProcedureDeviceComponent i : device) + dst.device.add(i.copy()); + }; + if (used != null) { + dst.used = new ArrayList(); + for (Reference i : used) + dst.used.add(i.copy()); + }; + return dst; + } + + protected Procedure typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Procedure)) + return false; + Procedure o = (Procedure) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(status, o.status, true) + && compareDeep(category, o.category, true) && compareDeep(type, o.type, true) && compareDeep(bodySite, o.bodySite, true) + && compareDeep(indication, o.indication, true) && compareDeep(performer, o.performer, true) && compareDeep(performed, o.performed, true) + && compareDeep(encounter, o.encounter, true) && compareDeep(location, o.location, true) && compareDeep(outcome, o.outcome, true) + && compareDeep(report, o.report, true) && compareDeep(complication, o.complication, true) && compareDeep(followUp, o.followUp, true) + && compareDeep(relatedItem, o.relatedItem, true) && compareDeep(notes, o.notes, true) && compareDeep(device, o.device, true) + && compareDeep(used, o.used, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Procedure)) + return false; + Procedure o = (Procedure) other; + return compareValues(status, o.status, true) && compareValues(notes, o.notes, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) + && (status == null || status.isEmpty()) && (category == null || category.isEmpty()) && (type == null || type.isEmpty()) + && (bodySite == null || bodySite.isEmpty()) && (indication == null || indication.isEmpty()) + && (performer == null || performer.isEmpty()) && (performed == null || performed.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (location == null || location.isEmpty()) + && (outcome == null || outcome.isEmpty()) && (report == null || report.isEmpty()) && (complication == null || complication.isEmpty()) + && (followUp == null || followUp.isEmpty()) && (relatedItem == null || relatedItem.isEmpty()) + && (notes == null || notes.isEmpty()) && (device == null || device.isEmpty()) && (used == null || used.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Procedure; + } + + @SearchParamDefinition(name="date", path="Procedure.performed[x]", description="Date/Period the procedure was performed", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="performer", path="Procedure.performer.person", description="The reference to the practitioner", type="reference" ) + public static final String SP_PERFORMER = "performer"; + @SearchParamDefinition(name="patient", path="Procedure.patient", description="The identity of a patient to list procedures for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="location", path="Procedure.location", description="Where the procedure happened", type="reference" ) + public static final String SP_LOCATION = "location"; + @SearchParamDefinition(name="encounter", path="Procedure.encounter", description="The encounter when procedure performed", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + @SearchParamDefinition(name="type", path="Procedure.type", description="Type of procedure", type="token" ) + public static final String SP_TYPE = "type"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ProcedureRequest.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ProcedureRequest.java index f544d84af22..e28ebe2c476 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ProcedureRequest.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ProcedureRequest.java @@ -1,1294 +1,1273 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A request for a procedure to be performed. May be a proposal or an order. - */ -@ResourceDef(name="ProcedureRequest", profile="http://hl7.org/fhir/Profile/ProcedureRequest") -public class ProcedureRequest extends DomainResource { - - public enum ProcedureRequestStatus { - /** - * The request has been proposed. - */ - PROPOSED, - /** - * The request is in preliminary form, prior to being requested. - */ - DRAFT, - /** - * The request has been placed. - */ - REQUESTED, - /** - * The receiving system has received the request but not yet decided whether it will be performed. - */ - RECEIVED, - /** - * The receiving system has accepted the request, but work has not yet commenced. - */ - ACCEPTED, - /** - * The work to fulfill the request is happening. - */ - INPROGRESS, - /** - * The work has been complete, the report(s) released, and no further work is planned. - */ - COMPLETED, - /** - * The request has been held by originating system/user request. - */ - SUSPENDED, - /** - * The receiving system has declined to fulfill the request. - */ - REJECTED, - /** - * The request was attempted, but due to some procedural error, it could not be completed. - */ - ABORTED, - /** - * added to help the parsers - */ - NULL; - public static ProcedureRequestStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("draft".equals(codeString)) - return DRAFT; - if ("requested".equals(codeString)) - return REQUESTED; - if ("received".equals(codeString)) - return RECEIVED; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("completed".equals(codeString)) - return COMPLETED; - if ("suspended".equals(codeString)) - return SUSPENDED; - if ("rejected".equals(codeString)) - return REJECTED; - if ("aborted".equals(codeString)) - return ABORTED; - throw new Exception("Unknown ProcedureRequestStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PROPOSED: return "proposed"; - case DRAFT: return "draft"; - case REQUESTED: return "requested"; - case RECEIVED: return "received"; - case ACCEPTED: return "accepted"; - case INPROGRESS: return "in-progress"; - case COMPLETED: return "completed"; - case SUSPENDED: return "suspended"; - case REJECTED: return "rejected"; - case ABORTED: return "aborted"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PROPOSED: return ""; - case DRAFT: return ""; - case REQUESTED: return ""; - case RECEIVED: return ""; - case ACCEPTED: return ""; - case INPROGRESS: return ""; - case COMPLETED: return ""; - case SUSPENDED: return ""; - case REJECTED: return ""; - case ABORTED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PROPOSED: return "The request has been proposed."; - case DRAFT: return "The request is in preliminary form, prior to being requested."; - case REQUESTED: return "The request has been placed."; - case RECEIVED: return "The receiving system has received the request but not yet decided whether it will be performed."; - case ACCEPTED: return "The receiving system has accepted the request, but work has not yet commenced."; - case INPROGRESS: return "The work to fulfill the request is happening."; - case COMPLETED: return "The work has been complete, the report(s) released, and no further work is planned."; - case SUSPENDED: return "The request has been held by originating system/user request."; - case REJECTED: return "The receiving system has declined to fulfill the request."; - case ABORTED: return "The request was attempted, but due to some procedural error, it could not be completed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PROPOSED: return "Proposed"; - case DRAFT: return "Draft"; - case REQUESTED: return "Requested"; - case RECEIVED: return "Received"; - case ACCEPTED: return "Accepted"; - case INPROGRESS: return "In Progress"; - case COMPLETED: return "Completed"; - case SUSPENDED: return "Suspended"; - case REJECTED: return "Rejected"; - case ABORTED: return "Aborted"; - default: return "?"; - } - } - } - - public static class ProcedureRequestStatusEnumFactory implements EnumFactory { - public ProcedureRequestStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return ProcedureRequestStatus.PROPOSED; - if ("draft".equals(codeString)) - return ProcedureRequestStatus.DRAFT; - if ("requested".equals(codeString)) - return ProcedureRequestStatus.REQUESTED; - if ("received".equals(codeString)) - return ProcedureRequestStatus.RECEIVED; - if ("accepted".equals(codeString)) - return ProcedureRequestStatus.ACCEPTED; - if ("in-progress".equals(codeString)) - return ProcedureRequestStatus.INPROGRESS; - if ("completed".equals(codeString)) - return ProcedureRequestStatus.COMPLETED; - if ("suspended".equals(codeString)) - return ProcedureRequestStatus.SUSPENDED; - if ("rejected".equals(codeString)) - return ProcedureRequestStatus.REJECTED; - if ("aborted".equals(codeString)) - return ProcedureRequestStatus.ABORTED; - throw new IllegalArgumentException("Unknown ProcedureRequestStatus code '"+codeString+"'"); - } - public String toCode(ProcedureRequestStatus code) { - if (code == ProcedureRequestStatus.PROPOSED) - return "proposed"; - if (code == ProcedureRequestStatus.DRAFT) - return "draft"; - if (code == ProcedureRequestStatus.REQUESTED) - return "requested"; - if (code == ProcedureRequestStatus.RECEIVED) - return "received"; - if (code == ProcedureRequestStatus.ACCEPTED) - return "accepted"; - if (code == ProcedureRequestStatus.INPROGRESS) - return "in-progress"; - if (code == ProcedureRequestStatus.COMPLETED) - return "completed"; - if (code == ProcedureRequestStatus.SUSPENDED) - return "suspended"; - if (code == ProcedureRequestStatus.REJECTED) - return "rejected"; - if (code == ProcedureRequestStatus.ABORTED) - return "aborted"; - return "?"; - } - } - - public enum ProcedureRequestPriority { - /** - * The request has a normal priority. - */ - ROUTINE, - /** - * The request should be done urgently. - */ - URGENT, - /** - * The request is time-critical. - */ - STAT, - /** - * The request should be acted on as soon as possible. - */ - ASAP, - /** - * added to help the parsers - */ - NULL; - public static ProcedureRequestPriority fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("routine".equals(codeString)) - return ROUTINE; - if ("urgent".equals(codeString)) - return URGENT; - if ("stat".equals(codeString)) - return STAT; - if ("asap".equals(codeString)) - return ASAP; - throw new Exception("Unknown ProcedureRequestPriority code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ROUTINE: return "routine"; - case URGENT: return "urgent"; - case STAT: return "stat"; - case ASAP: return "asap"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ROUTINE: return ""; - case URGENT: return ""; - case STAT: return ""; - case ASAP: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ROUTINE: return "The request has a normal priority."; - case URGENT: return "The request should be done urgently."; - case STAT: return "The request is time-critical."; - case ASAP: return "The request should be acted on as soon as possible."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ROUTINE: return "Routine"; - case URGENT: return "Urgent"; - case STAT: return "Stat"; - case ASAP: return "Asap"; - default: return "?"; - } - } - } - - public static class ProcedureRequestPriorityEnumFactory implements EnumFactory { - public ProcedureRequestPriority fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("routine".equals(codeString)) - return ProcedureRequestPriority.ROUTINE; - if ("urgent".equals(codeString)) - return ProcedureRequestPriority.URGENT; - if ("stat".equals(codeString)) - return ProcedureRequestPriority.STAT; - if ("asap".equals(codeString)) - return ProcedureRequestPriority.ASAP; - throw new IllegalArgumentException("Unknown ProcedureRequestPriority code '"+codeString+"'"); - } - public String toCode(ProcedureRequestPriority code) { - if (code == ProcedureRequestPriority.ROUTINE) - return "routine"; - if (code == ProcedureRequestPriority.URGENT) - return "urgent"; - if (code == ProcedureRequestPriority.STAT) - return "stat"; - if (code == ProcedureRequestPriority.ASAP) - return "asap"; - return "?"; - } - } - - @Block() - public static class ProcedureRequestBodySiteComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Indicates the site on the subject's body where the procedure should be performed ( i.e. the target sites). - */ - @Child(name = "site", type = {CodeableConcept.class, BodySite.class}, order=1, min=1, max=1) - @Description(shortDefinition="Target body site", formalDefinition="Indicates the site on the subject's body where the procedure should be performed ( i.e. the target sites)." ) - protected Type site; - - private static final long serialVersionUID = 1429072605L; - - /* - * Constructor - */ - public ProcedureRequestBodySiteComponent() { - super(); - } - - /* - * Constructor - */ - public ProcedureRequestBodySiteComponent(Type site) { - super(); - this.site = site; - } - - /** - * @return {@link #site} (Indicates the site on the subject's body where the procedure should be performed ( i.e. the target sites).) - */ - public Type getSite() { - return this.site; - } - - /** - * @return {@link #site} (Indicates the site on the subject's body where the procedure should be performed ( i.e. the target sites).) - */ - public CodeableConcept getSiteCodeableConcept() throws Exception { - if (!(this.site instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.site.getClass().getName()+" was encountered"); - return (CodeableConcept) this.site; - } - - /** - * @return {@link #site} (Indicates the site on the subject's body where the procedure should be performed ( i.e. the target sites).) - */ - public Reference getSiteReference() throws Exception { - if (!(this.site instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.site.getClass().getName()+" was encountered"); - return (Reference) this.site; - } - - public boolean hasSite() { - return this.site != null && !this.site.isEmpty(); - } - - /** - * @param value {@link #site} (Indicates the site on the subject's body where the procedure should be performed ( i.e. the target sites).) - */ - public ProcedureRequestBodySiteComponent setSite(Type value) { - this.site = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("site[x]", "CodeableConcept|Reference(BodySite)", "Indicates the site on the subject's body where the procedure should be performed ( i.e. the target sites).", 0, java.lang.Integer.MAX_VALUE, site)); - } - - public ProcedureRequestBodySiteComponent copy() { - ProcedureRequestBodySiteComponent dst = new ProcedureRequestBodySiteComponent(); - copyValues(dst); - dst.site = site == null ? null : site.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProcedureRequestBodySiteComponent)) - return false; - ProcedureRequestBodySiteComponent o = (ProcedureRequestBodySiteComponent) other; - return compareDeep(site, o.site, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProcedureRequestBodySiteComponent)) - return false; - ProcedureRequestBodySiteComponent o = (ProcedureRequestBodySiteComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (site == null || site.isEmpty()); - } - - } - - /** - * Identifiers assigned to this order by the order or by the receiver. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Identifier", formalDefinition="Identifiers assigned to this order by the order or by the receiver." ) - protected List identifier; - - /** - * The patient who will receive the procedure. - */ - @Child(name = "subject", type = {Patient.class}, order=1, min=1, max=1) - @Description(shortDefinition="Subject", formalDefinition="The patient who will receive the procedure." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient who will receive the procedure.) - */ - protected Patient subjectTarget; - - /** - * The specific procedure that is ordered. Use text if the exact nature of the procedure can't be coded. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=2, min=1, max=1) - @Description(shortDefinition="Procedure Type", formalDefinition="The specific procedure that is ordered. Use text if the exact nature of the procedure can't be coded." ) - protected CodeableConcept type; - - /** - * Indicates the sites on the subject's body where the procedure should be performed ( i.e. the target sites). - */ - @Child(name = "bodySite", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Target body sites", formalDefinition="Indicates the sites on the subject's body where the procedure should be performed ( i.e. the target sites)." ) - protected List bodySite; - - /** - * The reason why the procedure is proposed or ordered. This procedure request may be motivated by a Condition for instance. - */ - @Child(name = "indication", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Indication", formalDefinition="The reason why the procedure is proposed or ordered. This procedure request may be motivated by a Condition for instance." ) - protected List indication; - - /** - * The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". - */ - @Child(name = "timing", type = {DateTimeType.class, Period.class, Timing.class}, order=5, min=0, max=1) - @Description(shortDefinition="Procedure timing schedule", formalDefinition="The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'." ) - protected Type timing; - - /** - * The encounter within which the procedure proposal or request was created. - */ - @Child(name = "encounter", type = {Encounter.class}, order=6, min=0, max=1) - @Description(shortDefinition="Encounter", formalDefinition="The encounter within which the procedure proposal or request was created." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The encounter within which the procedure proposal or request was created.) - */ - protected Encounter encounterTarget; - - /** - * E.g. surgeon, anaethetist, endoscopist. - */ - @Child(name = "performer", type = {Practitioner.class, Organization.class, Patient.class, RelatedPerson.class}, order=7, min=0, max=1) - @Description(shortDefinition="Performer", formalDefinition="E.g. surgeon, anaethetist, endoscopist." ) - protected Reference performer; - - /** - * The actual object that is the target of the reference (E.g. surgeon, anaethetist, endoscopist.) - */ - protected Resource performerTarget; - - /** - * The status of the order. - */ - @Child(name = "status", type = {CodeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="proposed | draft | requested | received | accepted | in-progress | completed | suspended | rejected | aborted", formalDefinition="The status of the order." ) - protected Enumeration status; - - /** - * Any other notes associated with this proposal or order - e.g., provider instructions. - */ - @Child(name = "notes", type = {StringType.class}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Notes", formalDefinition="Any other notes associated with this proposal or order - e.g., provider instructions." ) - protected List notes; - - /** - * If a CodeableConcept is present, it indicates the pre-condition for performing the procedure. - */ - @Child(name = "asNeeded", type = {BooleanType.class, CodeableConcept.class}, order=10, min=0, max=1) - @Description(shortDefinition="PRN", formalDefinition="If a CodeableConcept is present, it indicates the pre-condition for performing the procedure." ) - protected Type asNeeded; - - /** - * The time when the request was made. - */ - @Child(name = "orderedOn", type = {DateTimeType.class}, order=11, min=0, max=1) - @Description(shortDefinition="When Requested", formalDefinition="The time when the request was made." ) - protected DateTimeType orderedOn; - - /** - * The healthcare professional responsible for proposing or ordering the procedure. - */ - @Child(name = "orderer", type = {Practitioner.class, Patient.class, RelatedPerson.class, Device.class}, order=12, min=0, max=1) - @Description(shortDefinition="Ordering Party", formalDefinition="The healthcare professional responsible for proposing or ordering the procedure." ) - protected Reference orderer; - - /** - * The actual object that is the target of the reference (The healthcare professional responsible for proposing or ordering the procedure.) - */ - protected Resource ordererTarget; - - /** - * The clinical priority associated with this order. - */ - @Child(name = "priority", type = {CodeType.class}, order=13, min=0, max=1) - @Description(shortDefinition="routine | urgent | stat | asap", formalDefinition="The clinical priority associated with this order." ) - protected Enumeration priority; - - private static final long serialVersionUID = -1687850759L; - - /* - * Constructor - */ - public ProcedureRequest() { - super(); - } - - /* - * Constructor - */ - public ProcedureRequest(Reference subject, CodeableConcept type) { - super(); - this.subject = subject; - this.type = type; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the order or by the receiver.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the order or by the receiver.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public ProcedureRequest addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #subject} (The patient who will receive the procedure.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (The patient who will receive the procedure.) - */ - public ProcedureRequest setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who will receive the procedure.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.subject"); - else if (Configuration.doAutoCreate()) - this.subjectTarget = new Patient(); // aa - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who will receive the procedure.) - */ - public ProcedureRequest setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #type} (The specific procedure that is ordered. Use text if the exact nature of the procedure can't be coded.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The specific procedure that is ordered. Use text if the exact nature of the procedure can't be coded.) - */ - public ProcedureRequest setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #bodySite} (Indicates the sites on the subject's body where the procedure should be performed ( i.e. the target sites).) - */ - public List getBodySite() { - if (this.bodySite == null) - this.bodySite = new ArrayList(); - return this.bodySite; - } - - public boolean hasBodySite() { - if (this.bodySite == null) - return false; - for (ProcedureRequestBodySiteComponent item : this.bodySite) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #bodySite} (Indicates the sites on the subject's body where the procedure should be performed ( i.e. the target sites).) - */ - // syntactic sugar - public ProcedureRequestBodySiteComponent addBodySite() { //3 - ProcedureRequestBodySiteComponent t = new ProcedureRequestBodySiteComponent(); - if (this.bodySite == null) - this.bodySite = new ArrayList(); - this.bodySite.add(t); - return t; - } - - // syntactic sugar - public ProcedureRequest addBodySite(ProcedureRequestBodySiteComponent t) { //3 - if (t == null) - return this; - if (this.bodySite == null) - this.bodySite = new ArrayList(); - this.bodySite.add(t); - return this; - } - - /** - * @return {@link #indication} (The reason why the procedure is proposed or ordered. This procedure request may be motivated by a Condition for instance.) - */ - public List getIndication() { - if (this.indication == null) - this.indication = new ArrayList(); - return this.indication; - } - - public boolean hasIndication() { - if (this.indication == null) - return false; - for (CodeableConcept item : this.indication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #indication} (The reason why the procedure is proposed or ordered. This procedure request may be motivated by a Condition for instance.) - */ - // syntactic sugar - public CodeableConcept addIndication() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.indication == null) - this.indication = new ArrayList(); - this.indication.add(t); - return t; - } - - // syntactic sugar - public ProcedureRequest addIndication(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.indication == null) - this.indication = new ArrayList(); - this.indication.add(t); - return this; - } - - /** - * @return {@link #timing} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Type getTiming() { - return this.timing; - } - - /** - * @return {@link #timing} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public DateTimeType getTimingDateTimeType() throws Exception { - if (!(this.timing instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (DateTimeType) this.timing; - } - - /** - * @return {@link #timing} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Period getTimingPeriod() throws Exception { - if (!(this.timing instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (Period) this.timing; - } - - /** - * @return {@link #timing} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Timing getTimingTiming() throws Exception { - if (!(this.timing instanceof Timing)) - throw new Exception("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (Timing) this.timing; - } - - public boolean hasTiming() { - return this.timing != null && !this.timing.isEmpty(); - } - - /** - * @param value {@link #timing} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public ProcedureRequest setTiming(Type value) { - this.timing = value; - return this; - } - - /** - * @return {@link #encounter} (The encounter within which the procedure proposal or request was created.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (The encounter within which the procedure proposal or request was created.) - */ - public ProcedureRequest setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter within which the procedure proposal or request was created.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter within which the procedure proposal or request was created.) - */ - public ProcedureRequest setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #performer} (E.g. surgeon, anaethetist, endoscopist.) - */ - public Reference getPerformer() { - if (this.performer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.performer"); - else if (Configuration.doAutoCreate()) - this.performer = new Reference(); // cc - return this.performer; - } - - public boolean hasPerformer() { - return this.performer != null && !this.performer.isEmpty(); - } - - /** - * @param value {@link #performer} (E.g. surgeon, anaethetist, endoscopist.) - */ - public ProcedureRequest setPerformer(Reference value) { - this.performer = value; - return this; - } - - /** - * @return {@link #performer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (E.g. surgeon, anaethetist, endoscopist.) - */ - public Resource getPerformerTarget() { - return this.performerTarget; - } - - /** - * @param value {@link #performer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (E.g. surgeon, anaethetist, endoscopist.) - */ - public ProcedureRequest setPerformerTarget(Resource value) { - this.performerTarget = value; - return this; - } - - /** - * @return {@link #status} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ProcedureRequestStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public ProcedureRequest setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the order. - */ - public ProcedureRequestStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the order. - */ - public ProcedureRequest setStatus(ProcedureRequestStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new ProcedureRequestStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #notes} (Any other notes associated with this proposal or order - e.g., provider instructions.) - */ - public List getNotes() { - if (this.notes == null) - this.notes = new ArrayList(); - return this.notes; - } - - public boolean hasNotes() { - if (this.notes == null) - return false; - for (StringType item : this.notes) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #notes} (Any other notes associated with this proposal or order - e.g., provider instructions.) - */ - // syntactic sugar - public StringType addNotesElement() {//2 - StringType t = new StringType(); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return t; - } - - /** - * @param value {@link #notes} (Any other notes associated with this proposal or order - e.g., provider instructions.) - */ - public ProcedureRequest addNotes(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return this; - } - - /** - * @param value {@link #notes} (Any other notes associated with this proposal or order - e.g., provider instructions.) - */ - public boolean hasNotes(String value) { - if (this.notes == null) - return false; - for (StringType v : this.notes) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) - */ - public Type getAsNeeded() { - return this.asNeeded; - } - - /** - * @return {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) - */ - public BooleanType getAsNeededBooleanType() throws Exception { - if (!(this.asNeeded instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (BooleanType) this.asNeeded; - } - - /** - * @return {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) - */ - public CodeableConcept getAsNeededCodeableConcept() throws Exception { - if (!(this.asNeeded instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (CodeableConcept) this.asNeeded; - } - - public boolean hasAsNeeded() { - return this.asNeeded != null && !this.asNeeded.isEmpty(); - } - - /** - * @param value {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) - */ - public ProcedureRequest setAsNeeded(Type value) { - this.asNeeded = value; - return this; - } - - /** - * @return {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value - */ - public DateTimeType getOrderedOnElement() { - if (this.orderedOn == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.orderedOn"); - else if (Configuration.doAutoCreate()) - this.orderedOn = new DateTimeType(); // bb - return this.orderedOn; - } - - public boolean hasOrderedOnElement() { - return this.orderedOn != null && !this.orderedOn.isEmpty(); - } - - public boolean hasOrderedOn() { - return this.orderedOn != null && !this.orderedOn.isEmpty(); - } - - /** - * @param value {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value - */ - public ProcedureRequest setOrderedOnElement(DateTimeType value) { - this.orderedOn = value; - return this; - } - - /** - * @return The time when the request was made. - */ - public Date getOrderedOn() { - return this.orderedOn == null ? null : this.orderedOn.getValue(); - } - - /** - * @param value The time when the request was made. - */ - public ProcedureRequest setOrderedOn(Date value) { - if (value == null) - this.orderedOn = null; - else { - if (this.orderedOn == null) - this.orderedOn = new DateTimeType(); - this.orderedOn.setValue(value); - } - return this; - } - - /** - * @return {@link #orderer} (The healthcare professional responsible for proposing or ordering the procedure.) - */ - public Reference getOrderer() { - if (this.orderer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.orderer"); - else if (Configuration.doAutoCreate()) - this.orderer = new Reference(); // cc - return this.orderer; - } - - public boolean hasOrderer() { - return this.orderer != null && !this.orderer.isEmpty(); - } - - /** - * @param value {@link #orderer} (The healthcare professional responsible for proposing or ordering the procedure.) - */ - public ProcedureRequest setOrderer(Reference value) { - this.orderer = value; - return this; - } - - /** - * @return {@link #orderer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The healthcare professional responsible for proposing or ordering the procedure.) - */ - public Resource getOrdererTarget() { - return this.ordererTarget; - } - - /** - * @param value {@link #orderer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The healthcare professional responsible for proposing or ordering the procedure.) - */ - public ProcedureRequest setOrdererTarget(Resource value) { - this.ordererTarget = value; - return this; - } - - /** - * @return {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public Enumeration getPriorityElement() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new Enumeration(new ProcedureRequestPriorityEnumFactory()); // bb - return this.priority; - } - - public boolean hasPriorityElement() { - return this.priority != null && !this.priority.isEmpty(); - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public ProcedureRequest setPriorityElement(Enumeration value) { - this.priority = value; - return this; - } - - /** - * @return The clinical priority associated with this order. - */ - public ProcedureRequestPriority getPriority() { - return this.priority == null ? null : this.priority.getValue(); - } - - /** - * @param value The clinical priority associated with this order. - */ - public ProcedureRequest setPriority(ProcedureRequestPriority value) { - if (value == null) - this.priority = null; - else { - if (this.priority == null) - this.priority = new Enumeration(new ProcedureRequestPriorityEnumFactory()); - this.priority.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the order or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("subject", "Reference(Patient)", "The patient who will receive the procedure.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("type", "CodeableConcept", "The specific procedure that is ordered. Use text if the exact nature of the procedure can't be coded.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("bodySite", "", "Indicates the sites on the subject's body where the procedure should be performed ( i.e. the target sites).", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("indication", "CodeableConcept", "The reason why the procedure is proposed or ordered. This procedure request may be motivated by a Condition for instance.", 0, java.lang.Integer.MAX_VALUE, indication)); - childrenList.add(new Property("timing[x]", "dateTime|Period|Timing", "The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'.", 0, java.lang.Integer.MAX_VALUE, timing)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter within which the procedure proposal or request was created.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("performer", "Reference(Practitioner|Organization|Patient|RelatedPerson)", "E.g. surgeon, anaethetist, endoscopist.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("status", "code", "The status of the order.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("notes", "string", "Any other notes associated with this proposal or order - e.g., provider instructions.", 0, java.lang.Integer.MAX_VALUE, notes)); - childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); - childrenList.add(new Property("orderedOn", "dateTime", "The time when the request was made.", 0, java.lang.Integer.MAX_VALUE, orderedOn)); - childrenList.add(new Property("orderer", "Reference(Practitioner|Patient|RelatedPerson|Device)", "The healthcare professional responsible for proposing or ordering the procedure.", 0, java.lang.Integer.MAX_VALUE, orderer)); - childrenList.add(new Property("priority", "code", "The clinical priority associated with this order.", 0, java.lang.Integer.MAX_VALUE, priority)); - } - - public ProcedureRequest copy() { - ProcedureRequest dst = new ProcedureRequest(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.subject = subject == null ? null : subject.copy(); - dst.type = type == null ? null : type.copy(); - if (bodySite != null) { - dst.bodySite = new ArrayList(); - for (ProcedureRequestBodySiteComponent i : bodySite) - dst.bodySite.add(i.copy()); - }; - if (indication != null) { - dst.indication = new ArrayList(); - for (CodeableConcept i : indication) - dst.indication.add(i.copy()); - }; - dst.timing = timing == null ? null : timing.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.performer = performer == null ? null : performer.copy(); - dst.status = status == null ? null : status.copy(); - if (notes != null) { - dst.notes = new ArrayList(); - for (StringType i : notes) - dst.notes.add(i.copy()); - }; - dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); - dst.orderedOn = orderedOn == null ? null : orderedOn.copy(); - dst.orderer = orderer == null ? null : orderer.copy(); - dst.priority = priority == null ? null : priority.copy(); - return dst; - } - - protected ProcedureRequest typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProcedureRequest)) - return false; - ProcedureRequest o = (ProcedureRequest) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(subject, o.subject, true) && compareDeep(type, o.type, true) - && compareDeep(bodySite, o.bodySite, true) && compareDeep(indication, o.indication, true) && compareDeep(timing, o.timing, true) - && compareDeep(encounter, o.encounter, true) && compareDeep(performer, o.performer, true) && compareDeep(status, o.status, true) - && compareDeep(notes, o.notes, true) && compareDeep(asNeeded, o.asNeeded, true) && compareDeep(orderedOn, o.orderedOn, true) - && compareDeep(orderer, o.orderer, true) && compareDeep(priority, o.priority, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProcedureRequest)) - return false; - ProcedureRequest o = (ProcedureRequest) other; - return compareValues(status, o.status, true) && compareValues(notes, o.notes, true) && compareValues(orderedOn, o.orderedOn, true) - && compareValues(priority, o.priority, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) - && (type == null || type.isEmpty()) && (bodySite == null || bodySite.isEmpty()) && (indication == null || indication.isEmpty()) - && (timing == null || timing.isEmpty()) && (encounter == null || encounter.isEmpty()) && (performer == null || performer.isEmpty()) - && (status == null || status.isEmpty()) && (notes == null || notes.isEmpty()) && (asNeeded == null || asNeeded.isEmpty()) - && (orderedOn == null || orderedOn.isEmpty()) && (orderer == null || orderer.isEmpty()) && (priority == null || priority.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ProcedureRequest; - } - - @SearchParamDefinition(name="orderer", path="ProcedureRequest.orderer", description="Ordering Party", type="reference" ) - public static final String SP_ORDERER = "orderer"; - @SearchParamDefinition(name="patient", path="ProcedureRequest.subject", description="Search by subject - a patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="subject", path="ProcedureRequest.subject", description="Search by subject", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="performer", path="ProcedureRequest.performer", description="Performer", type="reference" ) - public static final String SP_PERFORMER = "performer"; - @SearchParamDefinition(name="encounter", path="ProcedureRequest.encounter", description="Encounter", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A request for a procedure to be performed. May be a proposal or an order. + */ +@ResourceDef(name="ProcedureRequest", profile="http://hl7.org/fhir/Profile/ProcedureRequest") +public class ProcedureRequest extends DomainResource { + + public enum ProcedureRequestStatus { + /** + * The request has been proposed. + */ + PROPOSED, + /** + * The request is in preliminary form, prior to being requested. + */ + DRAFT, + /** + * The request has been placed. + */ + REQUESTED, + /** + * The receiving system has received the request but not yet decided whether it will be performed. + */ + RECEIVED, + /** + * The receiving system has accepted the request, but work has not yet commenced. + */ + ACCEPTED, + /** + * The work to fulfill the request is happening. + */ + INPROGRESS, + /** + * The work has been complete, the report(s) released, and no further work is planned. + */ + COMPLETED, + /** + * The request has been held by originating system/user request. + */ + SUSPENDED, + /** + * The receiving system has declined to fulfill the request. + */ + REJECTED, + /** + * The request was attempted, but due to some procedural error, it could not be completed. + */ + ABORTED, + /** + * added to help the parsers + */ + NULL; + public static ProcedureRequestStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("draft".equals(codeString)) + return DRAFT; + if ("requested".equals(codeString)) + return REQUESTED; + if ("received".equals(codeString)) + return RECEIVED; + if ("accepted".equals(codeString)) + return ACCEPTED; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("completed".equals(codeString)) + return COMPLETED; + if ("suspended".equals(codeString)) + return SUSPENDED; + if ("rejected".equals(codeString)) + return REJECTED; + if ("aborted".equals(codeString)) + return ABORTED; + throw new Exception("Unknown ProcedureRequestStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROPOSED: return "proposed"; + case DRAFT: return "draft"; + case REQUESTED: return "requested"; + case RECEIVED: return "received"; + case ACCEPTED: return "accepted"; + case INPROGRESS: return "in-progress"; + case COMPLETED: return "completed"; + case SUSPENDED: return "suspended"; + case REJECTED: return "rejected"; + case ABORTED: return "aborted"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROPOSED: return ""; + case DRAFT: return ""; + case REQUESTED: return ""; + case RECEIVED: return ""; + case ACCEPTED: return ""; + case INPROGRESS: return ""; + case COMPLETED: return ""; + case SUSPENDED: return ""; + case REJECTED: return ""; + case ABORTED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROPOSED: return "The request has been proposed."; + case DRAFT: return "The request is in preliminary form, prior to being requested."; + case REQUESTED: return "The request has been placed."; + case RECEIVED: return "The receiving system has received the request but not yet decided whether it will be performed."; + case ACCEPTED: return "The receiving system has accepted the request, but work has not yet commenced."; + case INPROGRESS: return "The work to fulfill the request is happening."; + case COMPLETED: return "The work has been complete, the report(s) released, and no further work is planned."; + case SUSPENDED: return "The request has been held by originating system/user request."; + case REJECTED: return "The receiving system has declined to fulfill the request."; + case ABORTED: return "The request was attempted, but due to some procedural error, it could not be completed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROPOSED: return "Proposed"; + case DRAFT: return "Draft"; + case REQUESTED: return "Requested"; + case RECEIVED: return "Received"; + case ACCEPTED: return "Accepted"; + case INPROGRESS: return "In Progress"; + case COMPLETED: return "Completed"; + case SUSPENDED: return "Suspended"; + case REJECTED: return "Rejected"; + case ABORTED: return "Aborted"; + default: return "?"; + } + } + } + + public static class ProcedureRequestStatusEnumFactory implements EnumFactory { + public ProcedureRequestStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return ProcedureRequestStatus.PROPOSED; + if ("draft".equals(codeString)) + return ProcedureRequestStatus.DRAFT; + if ("requested".equals(codeString)) + return ProcedureRequestStatus.REQUESTED; + if ("received".equals(codeString)) + return ProcedureRequestStatus.RECEIVED; + if ("accepted".equals(codeString)) + return ProcedureRequestStatus.ACCEPTED; + if ("in-progress".equals(codeString)) + return ProcedureRequestStatus.INPROGRESS; + if ("completed".equals(codeString)) + return ProcedureRequestStatus.COMPLETED; + if ("suspended".equals(codeString)) + return ProcedureRequestStatus.SUSPENDED; + if ("rejected".equals(codeString)) + return ProcedureRequestStatus.REJECTED; + if ("aborted".equals(codeString)) + return ProcedureRequestStatus.ABORTED; + throw new IllegalArgumentException("Unknown ProcedureRequestStatus code '"+codeString+"'"); + } + public String toCode(ProcedureRequestStatus code) { + if (code == ProcedureRequestStatus.PROPOSED) + return "proposed"; + if (code == ProcedureRequestStatus.DRAFT) + return "draft"; + if (code == ProcedureRequestStatus.REQUESTED) + return "requested"; + if (code == ProcedureRequestStatus.RECEIVED) + return "received"; + if (code == ProcedureRequestStatus.ACCEPTED) + return "accepted"; + if (code == ProcedureRequestStatus.INPROGRESS) + return "in-progress"; + if (code == ProcedureRequestStatus.COMPLETED) + return "completed"; + if (code == ProcedureRequestStatus.SUSPENDED) + return "suspended"; + if (code == ProcedureRequestStatus.REJECTED) + return "rejected"; + if (code == ProcedureRequestStatus.ABORTED) + return "aborted"; + return "?"; + } + } + + public enum ProcedureRequestPriority { + /** + * The request has a normal priority. + */ + ROUTINE, + /** + * The request should be done urgently. + */ + URGENT, + /** + * The request is time-critical. + */ + STAT, + /** + * The request should be acted on as soon as possible. + */ + ASAP, + /** + * added to help the parsers + */ + NULL; + public static ProcedureRequestPriority fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("routine".equals(codeString)) + return ROUTINE; + if ("urgent".equals(codeString)) + return URGENT; + if ("stat".equals(codeString)) + return STAT; + if ("asap".equals(codeString)) + return ASAP; + throw new Exception("Unknown ProcedureRequestPriority code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ROUTINE: return "routine"; + case URGENT: return "urgent"; + case STAT: return "stat"; + case ASAP: return "asap"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ROUTINE: return ""; + case URGENT: return ""; + case STAT: return ""; + case ASAP: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ROUTINE: return "The request has a normal priority."; + case URGENT: return "The request should be done urgently."; + case STAT: return "The request is time-critical."; + case ASAP: return "The request should be acted on as soon as possible."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ROUTINE: return "Routine"; + case URGENT: return "Urgent"; + case STAT: return "Stat"; + case ASAP: return "Asap"; + default: return "?"; + } + } + } + + public static class ProcedureRequestPriorityEnumFactory implements EnumFactory { + public ProcedureRequestPriority fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("routine".equals(codeString)) + return ProcedureRequestPriority.ROUTINE; + if ("urgent".equals(codeString)) + return ProcedureRequestPriority.URGENT; + if ("stat".equals(codeString)) + return ProcedureRequestPriority.STAT; + if ("asap".equals(codeString)) + return ProcedureRequestPriority.ASAP; + throw new IllegalArgumentException("Unknown ProcedureRequestPriority code '"+codeString+"'"); + } + public String toCode(ProcedureRequestPriority code) { + if (code == ProcedureRequestPriority.ROUTINE) + return "routine"; + if (code == ProcedureRequestPriority.URGENT) + return "urgent"; + if (code == ProcedureRequestPriority.STAT) + return "stat"; + if (code == ProcedureRequestPriority.ASAP) + return "asap"; + return "?"; + } + } + + @Block() + public static class ProcedureRequestBodySiteComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Indicates the site on the subject's body where the procedure should be performed ( i.e. the target sites). + */ + @Child(name = "site", type = {CodeableConcept.class, BodySite.class}, order=1, min=1, max=1) + @Description(shortDefinition="Target body site", formalDefinition="Indicates the site on the subject's body where the procedure should be performed ( i.e. the target sites)." ) + protected Type site; + + private static final long serialVersionUID = 1429072605L; + + /* + * Constructor + */ + public ProcedureRequestBodySiteComponent() { + super(); + } + + /* + * Constructor + */ + public ProcedureRequestBodySiteComponent(Type site) { + super(); + this.site = site; + } + + /** + * @return {@link #site} (Indicates the site on the subject's body where the procedure should be performed ( i.e. the target sites).) + */ + public Type getSite() { + return this.site; + } + + /** + * @return {@link #site} (Indicates the site on the subject's body where the procedure should be performed ( i.e. the target sites).) + */ + public CodeableConcept getSiteCodeableConcept() throws Exception { + if (!(this.site instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.site.getClass().getName()+" was encountered"); + return (CodeableConcept) this.site; + } + + /** + * @return {@link #site} (Indicates the site on the subject's body where the procedure should be performed ( i.e. the target sites).) + */ + public Reference getSiteReference() throws Exception { + if (!(this.site instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.site.getClass().getName()+" was encountered"); + return (Reference) this.site; + } + + public boolean hasSite() { + return this.site != null && !this.site.isEmpty(); + } + + /** + * @param value {@link #site} (Indicates the site on the subject's body where the procedure should be performed ( i.e. the target sites).) + */ + public ProcedureRequestBodySiteComponent setSite(Type value) { + this.site = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("site[x]", "CodeableConcept|Reference(BodySite)", "Indicates the site on the subject's body where the procedure should be performed ( i.e. the target sites).", 0, java.lang.Integer.MAX_VALUE, site)); + } + + public ProcedureRequestBodySiteComponent copy() { + ProcedureRequestBodySiteComponent dst = new ProcedureRequestBodySiteComponent(); + copyValues(dst); + dst.site = site == null ? null : site.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProcedureRequestBodySiteComponent)) + return false; + ProcedureRequestBodySiteComponent o = (ProcedureRequestBodySiteComponent) other; + return compareDeep(site, o.site, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProcedureRequestBodySiteComponent)) + return false; + ProcedureRequestBodySiteComponent o = (ProcedureRequestBodySiteComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (site == null || site.isEmpty()); + } + + } + + /** + * Identifiers assigned to this order by the order or by the receiver. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Identifier", formalDefinition="Identifiers assigned to this order by the order or by the receiver." ) + protected List identifier; + + /** + * The patient who will receive the procedure. + */ + @Child(name = "subject", type = {Patient.class}, order=1, min=1, max=1) + @Description(shortDefinition="Subject", formalDefinition="The patient who will receive the procedure." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient who will receive the procedure.) + */ + protected Patient subjectTarget; + + /** + * The specific procedure that is ordered. Use text if the exact nature of the procedure can't be coded. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=2, min=1, max=1) + @Description(shortDefinition="Procedure Type", formalDefinition="The specific procedure that is ordered. Use text if the exact nature of the procedure can't be coded." ) + protected CodeableConcept type; + + /** + * Indicates the sites on the subject's body where the procedure should be performed ( i.e. the target sites). + */ + @Child(name = "bodySite", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Target body sites", formalDefinition="Indicates the sites on the subject's body where the procedure should be performed ( i.e. the target sites)." ) + protected List bodySite; + + /** + * The reason why the procedure is proposed or ordered. This procedure request may be motivated by a Condition for instance. + */ + @Child(name = "indication", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Indication", formalDefinition="The reason why the procedure is proposed or ordered. This procedure request may be motivated by a Condition for instance." ) + protected List indication; + + /** + * The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". + */ + @Child(name = "timing", type = {DateTimeType.class, Period.class, Timing.class}, order=5, min=0, max=1) + @Description(shortDefinition="Procedure timing schedule", formalDefinition="The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'." ) + protected Type timing; + + /** + * The encounter within which the procedure proposal or request was created. + */ + @Child(name = "encounter", type = {Encounter.class}, order=6, min=0, max=1) + @Description(shortDefinition="Encounter", formalDefinition="The encounter within which the procedure proposal or request was created." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The encounter within which the procedure proposal or request was created.) + */ + protected Encounter encounterTarget; + + /** + * E.g. surgeon, anaethetist, endoscopist. + */ + @Child(name = "performer", type = {Practitioner.class, Organization.class, Patient.class, RelatedPerson.class}, order=7, min=0, max=1) + @Description(shortDefinition="Performer", formalDefinition="E.g. surgeon, anaethetist, endoscopist." ) + protected Reference performer; + + /** + * The actual object that is the target of the reference (E.g. surgeon, anaethetist, endoscopist.) + */ + protected Resource performerTarget; + + /** + * The status of the order. + */ + @Child(name = "status", type = {CodeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="proposed | draft | requested | received | accepted | in-progress | completed | suspended | rejected | aborted", formalDefinition="The status of the order." ) + protected Enumeration status; + + /** + * Any other notes associated with this proposal or order - e.g., provider instructions. + */ + @Child(name = "notes", type = {StringType.class}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Notes", formalDefinition="Any other notes associated with this proposal or order - e.g., provider instructions." ) + protected List notes; + + /** + * If a CodeableConcept is present, it indicates the pre-condition for performing the procedure. + */ + @Child(name = "asNeeded", type = {BooleanType.class, CodeableConcept.class}, order=10, min=0, max=1) + @Description(shortDefinition="PRN", formalDefinition="If a CodeableConcept is present, it indicates the pre-condition for performing the procedure." ) + protected Type asNeeded; + + /** + * The time when the request was made. + */ + @Child(name = "orderedOn", type = {DateTimeType.class}, order=11, min=0, max=1) + @Description(shortDefinition="When Requested", formalDefinition="The time when the request was made." ) + protected DateTimeType orderedOn; + + /** + * The healthcare professional responsible for proposing or ordering the procedure. + */ + @Child(name = "orderer", type = {Practitioner.class, Patient.class, RelatedPerson.class, Device.class}, order=12, min=0, max=1) + @Description(shortDefinition="Ordering Party", formalDefinition="The healthcare professional responsible for proposing or ordering the procedure." ) + protected Reference orderer; + + /** + * The actual object that is the target of the reference (The healthcare professional responsible for proposing or ordering the procedure.) + */ + protected Resource ordererTarget; + + /** + * The clinical priority associated with this order. + */ + @Child(name = "priority", type = {CodeType.class}, order=13, min=0, max=1) + @Description(shortDefinition="routine | urgent | stat | asap", formalDefinition="The clinical priority associated with this order." ) + protected Enumeration priority; + + private static final long serialVersionUID = -1687850759L; + + /* + * Constructor + */ + public ProcedureRequest() { + super(); + } + + /* + * Constructor + */ + public ProcedureRequest(Reference subject, CodeableConcept type) { + super(); + this.subject = subject; + this.type = type; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order by the order or by the receiver.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order by the order or by the receiver.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public ProcedureRequest addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #subject} (The patient who will receive the procedure.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The patient who will receive the procedure.) + */ + public ProcedureRequest setSubject(Reference value) { + this.subject = value; + return this; + } + + /** + * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who will receive the procedure.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.subject"); + else if (Configuration.doAutoCreate()) + this.subjectTarget = new Patient(); // aa + return this.subjectTarget; + } + + /** + * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who will receive the procedure.) + */ + public ProcedureRequest setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #type} (The specific procedure that is ordered. Use text if the exact nature of the procedure can't be coded.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The specific procedure that is ordered. Use text if the exact nature of the procedure can't be coded.) + */ + public ProcedureRequest setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #bodySite} (Indicates the sites on the subject's body where the procedure should be performed ( i.e. the target sites).) + */ + public List getBodySite() { + if (this.bodySite == null) + this.bodySite = new ArrayList(); + return this.bodySite; + } + + public boolean hasBodySite() { + if (this.bodySite == null) + return false; + for (ProcedureRequestBodySiteComponent item : this.bodySite) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #bodySite} (Indicates the sites on the subject's body where the procedure should be performed ( i.e. the target sites).) + */ + // syntactic sugar + public ProcedureRequestBodySiteComponent addBodySite() { //3 + ProcedureRequestBodySiteComponent t = new ProcedureRequestBodySiteComponent(); + if (this.bodySite == null) + this.bodySite = new ArrayList(); + this.bodySite.add(t); + return t; + } + + // syntactic sugar + public ProcedureRequest addBodySite(ProcedureRequestBodySiteComponent t) { //3 + if (t == null) + return this; + if (this.bodySite == null) + this.bodySite = new ArrayList(); + this.bodySite.add(t); + return this; + } + + /** + * @return {@link #indication} (The reason why the procedure is proposed or ordered. This procedure request may be motivated by a Condition for instance.) + */ + public List getIndication() { + if (this.indication == null) + this.indication = new ArrayList(); + return this.indication; + } + + public boolean hasIndication() { + if (this.indication == null) + return false; + for (CodeableConcept item : this.indication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #indication} (The reason why the procedure is proposed or ordered. This procedure request may be motivated by a Condition for instance.) + */ + // syntactic sugar + public CodeableConcept addIndication() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return t; + } + + // syntactic sugar + public ProcedureRequest addIndication(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return this; + } + + /** + * @return {@link #timing} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Type getTiming() { + return this.timing; + } + + /** + * @return {@link #timing} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public DateTimeType getTimingDateTimeType() throws Exception { + if (!(this.timing instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (DateTimeType) this.timing; + } + + /** + * @return {@link #timing} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Period getTimingPeriod() throws Exception { + if (!(this.timing instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (Period) this.timing; + } + + /** + * @return {@link #timing} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Timing getTimingTiming() throws Exception { + if (!(this.timing instanceof Timing)) + throw new Exception("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (Timing) this.timing; + } + + public boolean hasTiming() { + return this.timing != null && !this.timing.isEmpty(); + } + + /** + * @param value {@link #timing} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public ProcedureRequest setTiming(Type value) { + this.timing = value; + return this; + } + + /** + * @return {@link #encounter} (The encounter within which the procedure proposal or request was created.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (The encounter within which the procedure proposal or request was created.) + */ + public ProcedureRequest setEncounter(Reference value) { + this.encounter = value; + return this; + } + + /** + * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter within which the procedure proposal or request was created.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + return this.encounterTarget; + } + + /** + * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter within which the procedure proposal or request was created.) + */ + public ProcedureRequest setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #performer} (E.g. surgeon, anaethetist, endoscopist.) + */ + public Reference getPerformer() { + if (this.performer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.performer"); + else if (Configuration.doAutoCreate()) + this.performer = new Reference(); // cc + return this.performer; + } + + public boolean hasPerformer() { + return this.performer != null && !this.performer.isEmpty(); + } + + /** + * @param value {@link #performer} (E.g. surgeon, anaethetist, endoscopist.) + */ + public ProcedureRequest setPerformer(Reference value) { + this.performer = value; + return this; + } + + /** + * @return {@link #performer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (E.g. surgeon, anaethetist, endoscopist.) + */ + public Resource getPerformerTarget() { + return this.performerTarget; + } + + /** + * @param value {@link #performer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (E.g. surgeon, anaethetist, endoscopist.) + */ + public ProcedureRequest setPerformerTarget(Resource value) { + this.performerTarget = value; + return this; + } + + /** + * @return {@link #status} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ProcedureRequestStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public ProcedureRequest setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the order. + */ + public ProcedureRequestStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the order. + */ + public ProcedureRequest setStatus(ProcedureRequestStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new ProcedureRequestStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #notes} (Any other notes associated with this proposal or order - e.g., provider instructions.) + */ + public List getNotes() { + if (this.notes == null) + this.notes = new ArrayList(); + return this.notes; + } + + public boolean hasNotes() { + if (this.notes == null) + return false; + for (StringType item : this.notes) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #notes} (Any other notes associated with this proposal or order - e.g., provider instructions.) + */ + // syntactic sugar + public StringType addNotesElement() {//2 + StringType t = new StringType(); + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return t; + } + + /** + * @param value {@link #notes} (Any other notes associated with this proposal or order - e.g., provider instructions.) + */ + public ProcedureRequest addNotes(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return this; + } + + /** + * @param value {@link #notes} (Any other notes associated with this proposal or order - e.g., provider instructions.) + */ + public boolean hasNotes(String value) { + if (this.notes == null) + return false; + for (StringType v : this.notes) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) + */ + public Type getAsNeeded() { + return this.asNeeded; + } + + /** + * @return {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) + */ + public BooleanType getAsNeededBooleanType() throws Exception { + if (!(this.asNeeded instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (BooleanType) this.asNeeded; + } + + /** + * @return {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) + */ + public CodeableConcept getAsNeededCodeableConcept() throws Exception { + if (!(this.asNeeded instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (CodeableConcept) this.asNeeded; + } + + public boolean hasAsNeeded() { + return this.asNeeded != null && !this.asNeeded.isEmpty(); + } + + /** + * @param value {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) + */ + public ProcedureRequest setAsNeeded(Type value) { + this.asNeeded = value; + return this; + } + + /** + * @return {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value + */ + public DateTimeType getOrderedOnElement() { + if (this.orderedOn == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.orderedOn"); + else if (Configuration.doAutoCreate()) + this.orderedOn = new DateTimeType(); // bb + return this.orderedOn; + } + + public boolean hasOrderedOnElement() { + return this.orderedOn != null && !this.orderedOn.isEmpty(); + } + + public boolean hasOrderedOn() { + return this.orderedOn != null && !this.orderedOn.isEmpty(); + } + + /** + * @param value {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value + */ + public ProcedureRequest setOrderedOnElement(DateTimeType value) { + this.orderedOn = value; + return this; + } + + /** + * @return The time when the request was made. + */ + public Date getOrderedOn() { + return this.orderedOn == null ? null : this.orderedOn.getValue(); + } + + /** + * @param value The time when the request was made. + */ + public ProcedureRequest setOrderedOn(Date value) { + if (value == null) + this.orderedOn = null; + else { + if (this.orderedOn == null) + this.orderedOn = new DateTimeType(); + this.orderedOn.setValue(value); + } + return this; + } + + /** + * @return {@link #orderer} (The healthcare professional responsible for proposing or ordering the procedure.) + */ + public Reference getOrderer() { + if (this.orderer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.orderer"); + else if (Configuration.doAutoCreate()) + this.orderer = new Reference(); // cc + return this.orderer; + } + + public boolean hasOrderer() { + return this.orderer != null && !this.orderer.isEmpty(); + } + + /** + * @param value {@link #orderer} (The healthcare professional responsible for proposing or ordering the procedure.) + */ + public ProcedureRequest setOrderer(Reference value) { + this.orderer = value; + return this; + } + + /** + * @return {@link #orderer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The healthcare professional responsible for proposing or ordering the procedure.) + */ + public Resource getOrdererTarget() { + return this.ordererTarget; + } + + /** + * @param value {@link #orderer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The healthcare professional responsible for proposing or ordering the procedure.) + */ + public ProcedureRequest setOrdererTarget(Resource value) { + this.ordererTarget = value; + return this; + } + + /** + * @return {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public Enumeration getPriorityElement() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Enumeration(new ProcedureRequestPriorityEnumFactory()); // bb + return this.priority; + } + + public boolean hasPriorityElement() { + return this.priority != null && !this.priority.isEmpty(); + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public ProcedureRequest setPriorityElement(Enumeration value) { + this.priority = value; + return this; + } + + /** + * @return The clinical priority associated with this order. + */ + public ProcedureRequestPriority getPriority() { + return this.priority == null ? null : this.priority.getValue(); + } + + /** + * @param value The clinical priority associated with this order. + */ + public ProcedureRequest setPriority(ProcedureRequestPriority value) { + if (value == null) + this.priority = null; + else { + if (this.priority == null) + this.priority = new Enumeration(new ProcedureRequestPriorityEnumFactory()); + this.priority.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the order or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("subject", "Reference(Patient)", "The patient who will receive the procedure.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("type", "CodeableConcept", "The specific procedure that is ordered. Use text if the exact nature of the procedure can't be coded.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("bodySite", "", "Indicates the sites on the subject's body where the procedure should be performed ( i.e. the target sites).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("indication", "CodeableConcept", "The reason why the procedure is proposed or ordered. This procedure request may be motivated by a Condition for instance.", 0, java.lang.Integer.MAX_VALUE, indication)); + childrenList.add(new Property("timing[x]", "dateTime|Period|Timing", "The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'.", 0, java.lang.Integer.MAX_VALUE, timing)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter within which the procedure proposal or request was created.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("performer", "Reference(Practitioner|Organization|Patient|RelatedPerson)", "E.g. surgeon, anaethetist, endoscopist.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("status", "code", "The status of the order.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("notes", "string", "Any other notes associated with this proposal or order - e.g., provider instructions.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); + childrenList.add(new Property("orderedOn", "dateTime", "The time when the request was made.", 0, java.lang.Integer.MAX_VALUE, orderedOn)); + childrenList.add(new Property("orderer", "Reference(Practitioner|Patient|RelatedPerson|Device)", "The healthcare professional responsible for proposing or ordering the procedure.", 0, java.lang.Integer.MAX_VALUE, orderer)); + childrenList.add(new Property("priority", "code", "The clinical priority associated with this order.", 0, java.lang.Integer.MAX_VALUE, priority)); + } + + public ProcedureRequest copy() { + ProcedureRequest dst = new ProcedureRequest(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.subject = subject == null ? null : subject.copy(); + dst.type = type == null ? null : type.copy(); + if (bodySite != null) { + dst.bodySite = new ArrayList(); + for (ProcedureRequestBodySiteComponent i : bodySite) + dst.bodySite.add(i.copy()); + }; + if (indication != null) { + dst.indication = new ArrayList(); + for (CodeableConcept i : indication) + dst.indication.add(i.copy()); + }; + dst.timing = timing == null ? null : timing.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.performer = performer == null ? null : performer.copy(); + dst.status = status == null ? null : status.copy(); + if (notes != null) { + dst.notes = new ArrayList(); + for (StringType i : notes) + dst.notes.add(i.copy()); + }; + dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); + dst.orderedOn = orderedOn == null ? null : orderedOn.copy(); + dst.orderer = orderer == null ? null : orderer.copy(); + dst.priority = priority == null ? null : priority.copy(); + return dst; + } + + protected ProcedureRequest typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProcedureRequest)) + return false; + ProcedureRequest o = (ProcedureRequest) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(subject, o.subject, true) && compareDeep(type, o.type, true) + && compareDeep(bodySite, o.bodySite, true) && compareDeep(indication, o.indication, true) && compareDeep(timing, o.timing, true) + && compareDeep(encounter, o.encounter, true) && compareDeep(performer, o.performer, true) && compareDeep(status, o.status, true) + && compareDeep(notes, o.notes, true) && compareDeep(asNeeded, o.asNeeded, true) && compareDeep(orderedOn, o.orderedOn, true) + && compareDeep(orderer, o.orderer, true) && compareDeep(priority, o.priority, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProcedureRequest)) + return false; + ProcedureRequest o = (ProcedureRequest) other; + return compareValues(status, o.status, true) && compareValues(notes, o.notes, true) && compareValues(orderedOn, o.orderedOn, true) + && compareValues(priority, o.priority, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) + && (type == null || type.isEmpty()) && (bodySite == null || bodySite.isEmpty()) && (indication == null || indication.isEmpty()) + && (timing == null || timing.isEmpty()) && (encounter == null || encounter.isEmpty()) && (performer == null || performer.isEmpty()) + && (status == null || status.isEmpty()) && (notes == null || notes.isEmpty()) && (asNeeded == null || asNeeded.isEmpty()) + && (orderedOn == null || orderedOn.isEmpty()) && (orderer == null || orderer.isEmpty()) && (priority == null || priority.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ProcedureRequest; + } + + @SearchParamDefinition(name="performer", path="ProcedureRequest.performer", description="Performer", type="reference" ) + public static final String SP_PERFORMER = "performer"; + @SearchParamDefinition(name="subject", path="ProcedureRequest.subject", description="Search by subject", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="patient", path="ProcedureRequest.subject", description="Search by subject - a patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="orderer", path="ProcedureRequest.orderer", description="Ordering Party", type="reference" ) + public static final String SP_ORDERER = "orderer"; + @SearchParamDefinition(name="encounter", path="ProcedureRequest.encounter", description="Encounter", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ProcessRequest.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ProcessRequest.java index cc4f0ceb8fe..297301b45fc 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ProcessRequest.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ProcessRequest.java @@ -1,1205 +1,1184 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources. - */ -@ResourceDef(name="ProcessRequest", profile="http://hl7.org/fhir/Profile/ProcessRequest") -public class ProcessRequest extends DomainResource { - - public enum Actionlist { - /** - * Cancel, Reverse or nullify the target resource. - */ - CANCEL, - /** - * Check for previously un-read/ not-retrieved resources. - */ - POLL, - /** - * Re-process the target resource. - */ - REPROCESS, - /** - * Retrieve the processing status of the target resource. - */ - STATUS, - /** - * added to help the parsers - */ - NULL; - public static Actionlist fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("cancel".equals(codeString)) - return CANCEL; - if ("poll".equals(codeString)) - return POLL; - if ("reprocess".equals(codeString)) - return REPROCESS; - if ("status".equals(codeString)) - return STATUS; - throw new Exception("Unknown Actionlist code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CANCEL: return "cancel"; - case POLL: return "poll"; - case REPROCESS: return "reprocess"; - case STATUS: return "status"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CANCEL: return ""; - case POLL: return ""; - case REPROCESS: return ""; - case STATUS: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CANCEL: return "Cancel, Reverse or nullify the target resource."; - case POLL: return "Check for previously un-read/ not-retrieved resources."; - case REPROCESS: return "Re-process the target resource."; - case STATUS: return "Retrieve the processing status of the target resource."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CANCEL: return "Cancel, Reverse or Nullify"; - case POLL: return "Poll"; - case REPROCESS: return "Re-Process"; - case STATUS: return "Status Check"; - default: return "?"; - } - } - } - - public static class ActionlistEnumFactory implements EnumFactory { - public Actionlist fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("cancel".equals(codeString)) - return Actionlist.CANCEL; - if ("poll".equals(codeString)) - return Actionlist.POLL; - if ("reprocess".equals(codeString)) - return Actionlist.REPROCESS; - if ("status".equals(codeString)) - return Actionlist.STATUS; - throw new IllegalArgumentException("Unknown Actionlist code '"+codeString+"'"); - } - public String toCode(Actionlist code) { - if (code == Actionlist.CANCEL) - return "cancel"; - if (code == Actionlist.POLL) - return "poll"; - if (code == Actionlist.REPROCESS) - return "reprocess"; - if (code == Actionlist.STATUS) - return "status"; - return "?"; - } - } - - @Block() - public static class ItemsComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A service line number. - */ - @Child(name = "sequenceLinkId", type = {IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected IntegerType sequenceLinkId; - - private static final long serialVersionUID = -1598360600L; - - /* - * Constructor - */ - public ItemsComponent() { - super(); - } - - /* - * Constructor - */ - public ItemsComponent(IntegerType sequenceLinkId) { - super(); - this.sequenceLinkId = sequenceLinkId; - } - - /** - * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public IntegerType getSequenceLinkIdElement() { - if (this.sequenceLinkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.sequenceLinkId"); - else if (Configuration.doAutoCreate()) - this.sequenceLinkId = new IntegerType(); // bb - return this.sequenceLinkId; - } - - public boolean hasSequenceLinkIdElement() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - public boolean hasSequenceLinkId() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - /** - * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public ItemsComponent setSequenceLinkIdElement(IntegerType value) { - this.sequenceLinkId = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequenceLinkId() { - return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue(); - } - - /** - * @param value A service line number. - */ - public ItemsComponent setSequenceLinkId(int value) { - if (this.sequenceLinkId == null) - this.sequenceLinkId = new IntegerType(); - this.sequenceLinkId.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequenceLinkId", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); - } - - public ItemsComponent copy() { - ItemsComponent dst = new ItemsComponent(); - copyValues(dst); - dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ItemsComponent)) - return false; - ItemsComponent o = (ItemsComponent) other; - return compareDeep(sequenceLinkId, o.sequenceLinkId, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ItemsComponent)) - return false; - ItemsComponent o = (ItemsComponent) other; - return compareValues(sequenceLinkId, o.sequenceLinkId, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()); - } - - } - - /** - * The type of procesing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest. - */ - @Child(name = "action", type = {CodeType.class}, order=0, min=1, max=1) - @Description(shortDefinition="cancel | poll | reprocess | status", formalDefinition="The type of procesing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest." ) - protected Enumeration action; - - /** - * The ProcessRequest Business Identifier. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The ProcessRequest Business Identifier." ) - protected List identifier; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=2, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=3, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when this resource was created. - */ - @Child(name = "created", type = {DateTimeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) - protected DateTimeType created; - - /** - * The organization which is target of the request. - */ - @Child(name = "target", type = {Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="Target of the request", formalDefinition="The organization which is target of the request." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (The organization which is target of the request.) - */ - protected Organization targetTarget; - - /** - * The practitioner who is responsible for the action specified in thise request. - */ - @Child(name = "provider", type = {Practitioner.class}, order=6, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the action specified in thise request." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the action specified in thise request.) - */ - protected Practitioner providerTarget; - - /** - * The organization which is responsible for the action speccified in thise request. - */ - @Child(name = "organization", type = {Organization.class}, order=7, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the action speccified in thise request." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the action speccified in thise request.) - */ - protected Organization organizationTarget; - - /** - * Reference of resource which is the target or subject of this action. - */ - @Child(name = "request", type = {}, order=8, min=0, max=1) - @Description(shortDefinition="Request reference", formalDefinition="Reference of resource which is the target or subject of this action." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (Reference of resource which is the target or subject of this action.) - */ - protected Resource requestTarget; - - /** - * Reference of a prior response to resource which is the target or subject of this action. - */ - @Child(name = "response", type = {}, order=9, min=0, max=1) - @Description(shortDefinition="Response reference", formalDefinition="Reference of a prior response to resource which is the target or subject of this action." ) - protected Reference response; - - /** - * The actual object that is the target of the reference (Reference of a prior response to resource which is the target or subject of this action.) - */ - protected Resource responseTarget; - - /** - * If true remove all history excluding audit. - */ - @Child(name = "nullify", type = {BooleanType.class}, order=10, min=0, max=1) - @Description(shortDefinition="Nullify", formalDefinition="If true remove all history excluding audit." ) - protected BooleanType nullify; - - /** - * A reference to supply which authenticates the process. - */ - @Child(name = "reference", type = {StringType.class}, order=11, min=0, max=1) - @Description(shortDefinition="Reference number/string", formalDefinition="A reference to supply which authenticates the process." ) - protected StringType reference; - - /** - * List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated. - */ - @Child(name = "item", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Items to re-adjudicate", formalDefinition="List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated." ) - protected List item; - - /** - * Names of resource types to include. - */ - @Child(name = "include", type = {StringType.class}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Resource type(s) to include", formalDefinition="Names of resource types to include." ) - protected List include; - - /** - * Names of resource types to exclude. - */ - @Child(name = "exclude", type = {StringType.class}, order=14, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Resource type(s) to exclude", formalDefinition="Names of resource types to exclude." ) - protected List exclude; - - /** - * A period of time during which the fulfilling resources would have been created. - */ - @Child(name = "period", type = {Period.class}, order=15, min=0, max=1) - @Description(shortDefinition="Period", formalDefinition="A period of time during which the fulfilling resources would have been created." ) - protected Period period; - - private static final long serialVersionUID = -1852083956L; - - /* - * Constructor - */ - public ProcessRequest() { - super(); - } - - /* - * Constructor - */ - public ProcessRequest(Enumeration action) { - super(); - this.action = action; - } - - /** - * @return {@link #action} (The type of procesing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value - */ - public Enumeration getActionElement() { - if (this.action == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.action"); - else if (Configuration.doAutoCreate()) - this.action = new Enumeration(new ActionlistEnumFactory()); // bb - return this.action; - } - - public boolean hasActionElement() { - return this.action != null && !this.action.isEmpty(); - } - - public boolean hasAction() { - return this.action != null && !this.action.isEmpty(); - } - - /** - * @param value {@link #action} (The type of procesing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value - */ - public ProcessRequest setActionElement(Enumeration value) { - this.action = value; - return this; - } - - /** - * @return The type of procesing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest. - */ - public Actionlist getAction() { - return this.action == null ? null : this.action.getValue(); - } - - /** - * @param value The type of procesing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest. - */ - public ProcessRequest setAction(Actionlist value) { - if (this.action == null) - this.action = new Enumeration(new ActionlistEnumFactory()); - this.action.setValue(value); - return this; - } - - /** - * @return {@link #identifier} (The ProcessRequest Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The ProcessRequest Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public ProcessRequest addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public ProcessRequest setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public ProcessRequest setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public ProcessRequest setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when this resource was created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when this resource was created. - */ - public ProcessRequest setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (The organization which is target of the request.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); // cc - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The organization which is target of the request.) - */ - public ProcessRequest 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 organization which is target of the request.) - */ - public Organization getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Organization(); // aa - return this.targetTarget; - } - - /** - * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is target of the request.) - */ - public ProcessRequest setTargetTarget(Organization value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the action specified in thise request.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); // cc - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the action specified in thise request.) - */ - public ProcessRequest 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 action specified in thise request.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); // aa - return this.providerTarget; - } - - /** - * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the action specified in thise request.) - */ - public ProcessRequest setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization which is responsible for the action speccified in thise request.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); // cc - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the action speccified in thise request.) - */ - public ProcessRequest 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 action speccified in thise request.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); // aa - return this.organizationTarget; - } - - /** - * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the action speccified in thise request.) - */ - public ProcessRequest setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #request} (Reference of resource which is the target or subject of this action.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); // cc - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Reference of resource which is the target or subject of this action.) - */ - public ProcessRequest setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference of resource which is the target or subject of this action.) - */ - public Resource getRequestTarget() { - return this.requestTarget; - } - - /** - * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference of resource which is the target or subject of this action.) - */ - public ProcessRequest setRequestTarget(Resource value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #response} (Reference of a prior response to resource which is the target or subject of this action.) - */ - public Reference getResponse() { - if (this.response == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.response"); - else if (Configuration.doAutoCreate()) - this.response = new Reference(); // cc - return this.response; - } - - public boolean hasResponse() { - return this.response != null && !this.response.isEmpty(); - } - - /** - * @param value {@link #response} (Reference of a prior response to resource which is the target or subject of this action.) - */ - public ProcessRequest setResponse(Reference value) { - this.response = value; - return this; - } - - /** - * @return {@link #response} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference of a prior response to resource which is the target or subject of this action.) - */ - public Resource getResponseTarget() { - return this.responseTarget; - } - - /** - * @param value {@link #response} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference of a prior response to resource which is the target or subject of this action.) - */ - public ProcessRequest setResponseTarget(Resource value) { - this.responseTarget = value; - return this; - } - - /** - * @return {@link #nullify} (If true remove all history excluding audit.). This is the underlying object with id, value and extensions. The accessor "getNullify" gives direct access to the value - */ - public BooleanType getNullifyElement() { - if (this.nullify == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.nullify"); - else if (Configuration.doAutoCreate()) - this.nullify = new BooleanType(); // bb - return this.nullify; - } - - public boolean hasNullifyElement() { - return this.nullify != null && !this.nullify.isEmpty(); - } - - public boolean hasNullify() { - return this.nullify != null && !this.nullify.isEmpty(); - } - - /** - * @param value {@link #nullify} (If true remove all history excluding audit.). This is the underlying object with id, value and extensions. The accessor "getNullify" gives direct access to the value - */ - public ProcessRequest setNullifyElement(BooleanType value) { - this.nullify = value; - return this; - } - - /** - * @return If true remove all history excluding audit. - */ - public boolean getNullify() { - return this.nullify == null || this.nullify.isEmpty() ? false : this.nullify.getValue(); - } - - /** - * @param value If true remove all history excluding audit. - */ - public ProcessRequest setNullify(boolean value) { - if (this.nullify == null) - this.nullify = new BooleanType(); - this.nullify.setValue(value); - return this; - } - - /** - * @return {@link #reference} (A reference to supply which authenticates the process.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public StringType getReferenceElement() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new StringType(); // bb - return this.reference; - } - - public boolean hasReferenceElement() { - return this.reference != null && !this.reference.isEmpty(); - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (A reference to supply which authenticates the process.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public ProcessRequest setReferenceElement(StringType value) { - this.reference = value; - return this; - } - - /** - * @return A reference to supply which authenticates the process. - */ - public String getReference() { - return this.reference == null ? null : this.reference.getValue(); - } - - /** - * @param value A reference to supply which authenticates the process. - */ - public ProcessRequest setReference(String value) { - if (Utilities.noString(value)) - this.reference = null; - else { - if (this.reference == null) - this.reference = new StringType(); - this.reference.setValue(value); - } - return this; - } - - /** - * @return {@link #item} (List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (ItemsComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated.) - */ - // syntactic sugar - public ItemsComponent addItem() { //3 - ItemsComponent t = new ItemsComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - // syntactic sugar - public ProcessRequest addItem(ItemsComponent t) { //3 - if (t == null) - return this; - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return this; - } - - /** - * @return {@link #include} (Names of resource types to include.) - */ - public List getInclude() { - if (this.include == null) - this.include = new ArrayList(); - return this.include; - } - - public boolean hasInclude() { - if (this.include == null) - return false; - for (StringType item : this.include) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #include} (Names of resource types to include.) - */ - // syntactic sugar - public StringType addIncludeElement() {//2 - StringType t = new StringType(); - if (this.include == null) - this.include = new ArrayList(); - this.include.add(t); - return t; - } - - /** - * @param value {@link #include} (Names of resource types to include.) - */ - public ProcessRequest addInclude(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.include == null) - this.include = new ArrayList(); - this.include.add(t); - return this; - } - - /** - * @param value {@link #include} (Names of resource types to include.) - */ - public boolean hasInclude(String value) { - if (this.include == null) - return false; - for (StringType v : this.include) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #exclude} (Names of resource types to exclude.) - */ - public List getExclude() { - if (this.exclude == null) - this.exclude = new ArrayList(); - return this.exclude; - } - - public boolean hasExclude() { - if (this.exclude == null) - return false; - for (StringType item : this.exclude) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #exclude} (Names of resource types to exclude.) - */ - // syntactic sugar - public StringType addExcludeElement() {//2 - StringType t = new StringType(); - if (this.exclude == null) - this.exclude = new ArrayList(); - this.exclude.add(t); - return t; - } - - /** - * @param value {@link #exclude} (Names of resource types to exclude.) - */ - public ProcessRequest addExclude(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.exclude == null) - this.exclude = new ArrayList(); - this.exclude.add(t); - return this; - } - - /** - * @param value {@link #exclude} (Names of resource types to exclude.) - */ - public boolean hasExclude(String value) { - if (this.exclude == null) - return false; - for (StringType v : this.exclude) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #period} (A period of time during which the fulfilling resources would have been created.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (A period of time during which the fulfilling resources would have been created.) - */ - public ProcessRequest setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("action", "code", "The type of procesing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest.", 0, java.lang.Integer.MAX_VALUE, action)); - childrenList.add(new Property("identifier", "Identifier", "The ProcessRequest Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("target", "Reference(Organization)", "The organization which 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 action specified in thise request.", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the action speccified in thise request.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("request", "Reference(Any)", "Reference of resource which is the target or subject of this action.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("response", "Reference(Any)", "Reference of a prior response to resource which is the target or subject of this action.", 0, java.lang.Integer.MAX_VALUE, response)); - childrenList.add(new Property("nullify", "boolean", "If true remove all history excluding audit.", 0, java.lang.Integer.MAX_VALUE, nullify)); - childrenList.add(new Property("reference", "string", "A reference to supply which authenticates the process.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("item", "", "List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("include", "string", "Names of resource types to include.", 0, java.lang.Integer.MAX_VALUE, include)); - childrenList.add(new Property("exclude", "string", "Names of resource types to exclude.", 0, java.lang.Integer.MAX_VALUE, exclude)); - childrenList.add(new Property("period", "Period", "A period of time during which the fulfilling resources would have been created.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - public ProcessRequest copy() { - ProcessRequest dst = new ProcessRequest(); - copyValues(dst); - dst.action = action == null ? null : action.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.target = target == null ? null : target.copy(); - dst.provider = provider == null ? null : provider.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.request = request == null ? null : request.copy(); - dst.response = response == null ? null : response.copy(); - dst.nullify = nullify == null ? null : nullify.copy(); - dst.reference = reference == null ? null : reference.copy(); - if (item != null) { - dst.item = new ArrayList(); - for (ItemsComponent i : item) - dst.item.add(i.copy()); - }; - if (include != null) { - dst.include = new ArrayList(); - for (StringType i : include) - dst.include.add(i.copy()); - }; - if (exclude != null) { - dst.exclude = new ArrayList(); - for (StringType i : exclude) - dst.exclude.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - return dst; - } - - protected ProcessRequest typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProcessRequest)) - return false; - ProcessRequest o = (ProcessRequest) other; - return compareDeep(action, o.action, true) && compareDeep(identifier, o.identifier, true) && compareDeep(ruleset, o.ruleset, true) - && compareDeep(originalRuleset, o.originalRuleset, true) && compareDeep(created, o.created, true) - && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) && compareDeep(organization, o.organization, true) - && compareDeep(request, o.request, true) && compareDeep(response, o.response, true) && compareDeep(nullify, o.nullify, true) - && compareDeep(reference, o.reference, true) && compareDeep(item, o.item, true) && compareDeep(include, o.include, true) - && compareDeep(exclude, o.exclude, true) && compareDeep(period, o.period, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProcessRequest)) - return false; - ProcessRequest o = (ProcessRequest) other; - return compareValues(action, o.action, true) && compareValues(created, o.created, true) && compareValues(nullify, o.nullify, true) - && compareValues(reference, o.reference, true) && compareValues(include, o.include, true) && compareValues(exclude, o.exclude, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (action == null || action.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - && (created == null || created.isEmpty()) && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) - && (organization == null || organization.isEmpty()) && (request == null || request.isEmpty()) - && (response == null || response.isEmpty()) && (nullify == null || nullify.isEmpty()) && (reference == null || reference.isEmpty()) - && (item == null || item.isEmpty()) && (include == null || include.isEmpty()) && (exclude == null || exclude.isEmpty()) - && (period == null || period.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ProcessRequest; - } - - @SearchParamDefinition(name="organization", path="ProcessRequest.organization", description="The organization who generated this request", type="reference" ) - public static final String SP_ORGANIZATION = "organization"; - @SearchParamDefinition(name="action", path="ProcessRequest.action", description="The action requested by this resource", type="token" ) - public static final String SP_ACTION = "action"; - @SearchParamDefinition(name="provider", path="ProcessRequest.provider", description="The provider who renerated this request", type="reference" ) - public static final String SP_PROVIDER = "provider"; - @SearchParamDefinition(name="identifier", path="ProcessRequest.identifier", description="The business identifier of the ProcessRequest", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources. + */ +@ResourceDef(name="ProcessRequest", profile="http://hl7.org/fhir/Profile/ProcessRequest") +public class ProcessRequest extends DomainResource { + + public enum Actionlist { + /** + * Cancel, Reverse or nullify the target resource. + */ + CANCEL, + /** + * Check for previously un-read/ not-retrieved resources. + */ + POLL, + /** + * Re-process the target resource. + */ + REPROCESS, + /** + * Retrieve the processing status of the target resource. + */ + STATUS, + /** + * added to help the parsers + */ + NULL; + public static Actionlist fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("cancel".equals(codeString)) + return CANCEL; + if ("poll".equals(codeString)) + return POLL; + if ("reprocess".equals(codeString)) + return REPROCESS; + if ("status".equals(codeString)) + return STATUS; + throw new Exception("Unknown Actionlist code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CANCEL: return "cancel"; + case POLL: return "poll"; + case REPROCESS: return "reprocess"; + case STATUS: return "status"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CANCEL: return ""; + case POLL: return ""; + case REPROCESS: return ""; + case STATUS: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CANCEL: return "Cancel, Reverse or nullify the target resource."; + case POLL: return "Check for previously un-read/ not-retrieved resources."; + case REPROCESS: return "Re-process the target resource."; + case STATUS: return "Retrieve the processing status of the target resource."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CANCEL: return "Cancel, Reverse or Nullify"; + case POLL: return "Poll"; + case REPROCESS: return "Re-Process"; + case STATUS: return "Status Check"; + default: return "?"; + } + } + } + + public static class ActionlistEnumFactory implements EnumFactory { + public Actionlist fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("cancel".equals(codeString)) + return Actionlist.CANCEL; + if ("poll".equals(codeString)) + return Actionlist.POLL; + if ("reprocess".equals(codeString)) + return Actionlist.REPROCESS; + if ("status".equals(codeString)) + return Actionlist.STATUS; + throw new IllegalArgumentException("Unknown Actionlist code '"+codeString+"'"); + } + public String toCode(Actionlist code) { + if (code == Actionlist.CANCEL) + return "cancel"; + if (code == Actionlist.POLL) + return "poll"; + if (code == Actionlist.REPROCESS) + return "reprocess"; + if (code == Actionlist.STATUS) + return "status"; + return "?"; + } + } + + @Block() + public static class ItemsComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A service line number. + */ + @Child(name = "sequenceLinkId", type = {IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequenceLinkId; + + private static final long serialVersionUID = -1598360600L; + + /* + * Constructor + */ + public ItemsComponent() { + super(); + } + + /* + * Constructor + */ + public ItemsComponent(IntegerType sequenceLinkId) { + super(); + this.sequenceLinkId = sequenceLinkId; + } + + /** + * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public IntegerType getSequenceLinkIdElement() { + if (this.sequenceLinkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.sequenceLinkId"); + else if (Configuration.doAutoCreate()) + this.sequenceLinkId = new IntegerType(); // bb + return this.sequenceLinkId; + } + + public boolean hasSequenceLinkIdElement() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + public boolean hasSequenceLinkId() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + /** + * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public ItemsComponent setSequenceLinkIdElement(IntegerType value) { + this.sequenceLinkId = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequenceLinkId() { + return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemsComponent setSequenceLinkId(int value) { + if (this.sequenceLinkId == null) + this.sequenceLinkId = new IntegerType(); + this.sequenceLinkId.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequenceLinkId", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); + } + + public ItemsComponent copy() { + ItemsComponent dst = new ItemsComponent(); + copyValues(dst); + dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ItemsComponent)) + return false; + ItemsComponent o = (ItemsComponent) other; + return compareDeep(sequenceLinkId, o.sequenceLinkId, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ItemsComponent)) + return false; + ItemsComponent o = (ItemsComponent) other; + return compareValues(sequenceLinkId, o.sequenceLinkId, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()); + } + + } + + /** + * The type of procesing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest. + */ + @Child(name = "action", type = {CodeType.class}, order=0, min=1, max=1) + @Description(shortDefinition="cancel | poll | reprocess | status", formalDefinition="The type of procesing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest." ) + protected Enumeration action; + + /** + * The ProcessRequest Business Identifier. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The ProcessRequest Business Identifier." ) + protected List identifier; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name = "ruleset", type = {Coding.class}, order=2, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=3, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when this resource was created. + */ + @Child(name = "created", type = {DateTimeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) + protected DateTimeType created; + + /** + * The organization which is target of the request. + */ + @Child(name = "target", type = {Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Target of the request", formalDefinition="The organization which is target of the request." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (The organization which is target of the request.) + */ + protected Organization targetTarget; + + /** + * The practitioner who is responsible for the action specified in thise request. + */ + @Child(name = "provider", type = {Practitioner.class}, order=6, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the action specified in thise request." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the action specified in thise request.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the action speccified in thise request. + */ + @Child(name = "organization", type = {Organization.class}, order=7, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the action speccified in thise request." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the action speccified in thise request.) + */ + protected Organization organizationTarget; + + /** + * Reference of resource which is the target or subject of this action. + */ + @Child(name = "request", type = {}, order=8, min=0, max=1) + @Description(shortDefinition="Request reference", formalDefinition="Reference of resource which is the target or subject of this action." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (Reference of resource which is the target or subject of this action.) + */ + protected Resource requestTarget; + + /** + * Reference of a prior response to resource which is the target or subject of this action. + */ + @Child(name = "response", type = {}, order=9, min=0, max=1) + @Description(shortDefinition="Response reference", formalDefinition="Reference of a prior response to resource which is the target or subject of this action." ) + protected Reference response; + + /** + * The actual object that is the target of the reference (Reference of a prior response to resource which is the target or subject of this action.) + */ + protected Resource responseTarget; + + /** + * If true remove all history excluding audit. + */ + @Child(name = "nullify", type = {BooleanType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Nullify", formalDefinition="If true remove all history excluding audit." ) + protected BooleanType nullify; + + /** + * A reference to supply which authenticates the process. + */ + @Child(name = "reference", type = {StringType.class}, order=11, min=0, max=1) + @Description(shortDefinition="Reference number/string", formalDefinition="A reference to supply which authenticates the process." ) + protected StringType reference; + + /** + * List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated. + */ + @Child(name = "item", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Items to re-adjudicate", formalDefinition="List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated." ) + protected List item; + + /** + * Names of resource types to include. + */ + @Child(name = "include", type = {StringType.class}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Resource type(s) to include", formalDefinition="Names of resource types to include." ) + protected List include; + + /** + * Names of resource types to exclude. + */ + @Child(name = "exclude", type = {StringType.class}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Resource type(s) to exclude", formalDefinition="Names of resource types to exclude." ) + protected List exclude; + + /** + * A period of time during which the fulfilling resources would have been created. + */ + @Child(name = "period", type = {Period.class}, order=15, min=0, max=1) + @Description(shortDefinition="Period", formalDefinition="A period of time during which the fulfilling resources would have been created." ) + protected Period period; + + private static final long serialVersionUID = -1852083956L; + + /* + * Constructor + */ + public ProcessRequest() { + super(); + } + + /* + * Constructor + */ + public ProcessRequest(Enumeration action) { + super(); + this.action = action; + } + + /** + * @return {@link #action} (The type of procesing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value + */ + public Enumeration getActionElement() { + if (this.action == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.action"); + else if (Configuration.doAutoCreate()) + this.action = new Enumeration(new ActionlistEnumFactory()); // bb + return this.action; + } + + public boolean hasActionElement() { + return this.action != null && !this.action.isEmpty(); + } + + public boolean hasAction() { + return this.action != null && !this.action.isEmpty(); + } + + /** + * @param value {@link #action} (The type of procesing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value + */ + public ProcessRequest setActionElement(Enumeration value) { + this.action = value; + return this; + } + + /** + * @return The type of procesing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest. + */ + public Actionlist getAction() { + return this.action == null ? null : this.action.getValue(); + } + + /** + * @param value The type of procesing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest. + */ + public ProcessRequest setAction(Actionlist value) { + if (this.action == null) + this.action = new Enumeration(new ActionlistEnumFactory()); + this.action.setValue(value); + return this; + } + + /** + * @return {@link #identifier} (The ProcessRequest Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (The ProcessRequest Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public ProcessRequest addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public ProcessRequest setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public ProcessRequest setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public ProcessRequest setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when this resource was created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when this resource was created. + */ + public ProcessRequest setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (The organization which is target of the request.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); // cc + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The organization which is target of the request.) + */ + public ProcessRequest 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 organization which is target of the request.) + */ + public Organization getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); // aa + return this.targetTarget; + } + + /** + * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is target of the request.) + */ + public ProcessRequest setTargetTarget(Organization value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the action specified in thise request.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); // cc + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the action specified in thise request.) + */ + public ProcessRequest 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 action specified in thise request.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); // aa + return this.providerTarget; + } + + /** + * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the action specified in thise request.) + */ + public ProcessRequest setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the action speccified in thise request.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); // cc + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the action speccified in thise request.) + */ + public ProcessRequest 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 action speccified in thise request.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); // aa + return this.organizationTarget; + } + + /** + * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the action speccified in thise request.) + */ + public ProcessRequest setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #request} (Reference of resource which is the target or subject of this action.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); // cc + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Reference of resource which is the target or subject of this action.) + */ + public ProcessRequest setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference of resource which is the target or subject of this action.) + */ + public Resource getRequestTarget() { + return this.requestTarget; + } + + /** + * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference of resource which is the target or subject of this action.) + */ + public ProcessRequest setRequestTarget(Resource value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #response} (Reference of a prior response to resource which is the target or subject of this action.) + */ + public Reference getResponse() { + if (this.response == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.response"); + else if (Configuration.doAutoCreate()) + this.response = new Reference(); // cc + return this.response; + } + + public boolean hasResponse() { + return this.response != null && !this.response.isEmpty(); + } + + /** + * @param value {@link #response} (Reference of a prior response to resource which is the target or subject of this action.) + */ + public ProcessRequest setResponse(Reference value) { + this.response = value; + return this; + } + + /** + * @return {@link #response} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference of a prior response to resource which is the target or subject of this action.) + */ + public Resource getResponseTarget() { + return this.responseTarget; + } + + /** + * @param value {@link #response} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference of a prior response to resource which is the target or subject of this action.) + */ + public ProcessRequest setResponseTarget(Resource value) { + this.responseTarget = value; + return this; + } + + /** + * @return {@link #nullify} (If true remove all history excluding audit.). This is the underlying object with id, value and extensions. The accessor "getNullify" gives direct access to the value + */ + public BooleanType getNullifyElement() { + if (this.nullify == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.nullify"); + else if (Configuration.doAutoCreate()) + this.nullify = new BooleanType(); // bb + return this.nullify; + } + + public boolean hasNullifyElement() { + return this.nullify != null && !this.nullify.isEmpty(); + } + + public boolean hasNullify() { + return this.nullify != null && !this.nullify.isEmpty(); + } + + /** + * @param value {@link #nullify} (If true remove all history excluding audit.). This is the underlying object with id, value and extensions. The accessor "getNullify" gives direct access to the value + */ + public ProcessRequest setNullifyElement(BooleanType value) { + this.nullify = value; + return this; + } + + /** + * @return If true remove all history excluding audit. + */ + public boolean getNullify() { + return this.nullify == null || this.nullify.isEmpty() ? false : this.nullify.getValue(); + } + + /** + * @param value If true remove all history excluding audit. + */ + public ProcessRequest setNullify(boolean value) { + if (this.nullify == null) + this.nullify = new BooleanType(); + this.nullify.setValue(value); + return this; + } + + /** + * @return {@link #reference} (A reference to supply which authenticates the process.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public StringType getReferenceElement() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new StringType(); // bb + return this.reference; + } + + public boolean hasReferenceElement() { + return this.reference != null && !this.reference.isEmpty(); + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (A reference to supply which authenticates the process.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public ProcessRequest setReferenceElement(StringType value) { + this.reference = value; + return this; + } + + /** + * @return A reference to supply which authenticates the process. + */ + public String getReference() { + return this.reference == null ? null : this.reference.getValue(); + } + + /** + * @param value A reference to supply which authenticates the process. + */ + public ProcessRequest setReference(String value) { + if (Utilities.noString(value)) + this.reference = null; + else { + if (this.reference == null) + this.reference = new StringType(); + this.reference.setValue(value); + } + return this; + } + + /** + * @return {@link #item} (List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (ItemsComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated.) + */ + // syntactic sugar + public ItemsComponent addItem() { //3 + ItemsComponent t = new ItemsComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + // syntactic sugar + public ProcessRequest addItem(ItemsComponent t) { //3 + if (t == null) + return this; + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return this; + } + + /** + * @return {@link #include} (Names of resource types to include.) + */ + public List getInclude() { + if (this.include == null) + this.include = new ArrayList(); + return this.include; + } + + public boolean hasInclude() { + if (this.include == null) + return false; + for (StringType item : this.include) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #include} (Names of resource types to include.) + */ + // syntactic sugar + public StringType addIncludeElement() {//2 + StringType t = new StringType(); + if (this.include == null) + this.include = new ArrayList(); + this.include.add(t); + return t; + } + + /** + * @param value {@link #include} (Names of resource types to include.) + */ + public ProcessRequest addInclude(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.include == null) + this.include = new ArrayList(); + this.include.add(t); + return this; + } + + /** + * @param value {@link #include} (Names of resource types to include.) + */ + public boolean hasInclude(String value) { + if (this.include == null) + return false; + for (StringType v : this.include) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #exclude} (Names of resource types to exclude.) + */ + public List getExclude() { + if (this.exclude == null) + this.exclude = new ArrayList(); + return this.exclude; + } + + public boolean hasExclude() { + if (this.exclude == null) + return false; + for (StringType item : this.exclude) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #exclude} (Names of resource types to exclude.) + */ + // syntactic sugar + public StringType addExcludeElement() {//2 + StringType t = new StringType(); + if (this.exclude == null) + this.exclude = new ArrayList(); + this.exclude.add(t); + return t; + } + + /** + * @param value {@link #exclude} (Names of resource types to exclude.) + */ + public ProcessRequest addExclude(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.exclude == null) + this.exclude = new ArrayList(); + this.exclude.add(t); + return this; + } + + /** + * @param value {@link #exclude} (Names of resource types to exclude.) + */ + public boolean hasExclude(String value) { + if (this.exclude == null) + return false; + for (StringType v : this.exclude) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #period} (A period of time during which the fulfilling resources would have been created.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (A period of time during which the fulfilling resources would have been created.) + */ + public ProcessRequest setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("action", "code", "The type of procesing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest.", 0, java.lang.Integer.MAX_VALUE, action)); + childrenList.add(new Property("identifier", "Identifier", "The ProcessRequest Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); + childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); + childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("target", "Reference(Organization)", "The organization which 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 action specified in thise request.", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the action speccified in thise request.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("request", "Reference(Any)", "Reference of resource which is the target or subject of this action.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("response", "Reference(Any)", "Reference of a prior response to resource which is the target or subject of this action.", 0, java.lang.Integer.MAX_VALUE, response)); + childrenList.add(new Property("nullify", "boolean", "If true remove all history excluding audit.", 0, java.lang.Integer.MAX_VALUE, nullify)); + childrenList.add(new Property("reference", "string", "A reference to supply which authenticates the process.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("item", "", "List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("include", "string", "Names of resource types to include.", 0, java.lang.Integer.MAX_VALUE, include)); + childrenList.add(new Property("exclude", "string", "Names of resource types to exclude.", 0, java.lang.Integer.MAX_VALUE, exclude)); + childrenList.add(new Property("period", "Period", "A period of time during which the fulfilling resources would have been created.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + public ProcessRequest copy() { + ProcessRequest dst = new ProcessRequest(); + copyValues(dst); + dst.action = action == null ? null : action.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + dst.created = created == null ? null : created.copy(); + dst.target = target == null ? null : target.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.request = request == null ? null : request.copy(); + dst.response = response == null ? null : response.copy(); + dst.nullify = nullify == null ? null : nullify.copy(); + dst.reference = reference == null ? null : reference.copy(); + if (item != null) { + dst.item = new ArrayList(); + for (ItemsComponent i : item) + dst.item.add(i.copy()); + }; + if (include != null) { + dst.include = new ArrayList(); + for (StringType i : include) + dst.include.add(i.copy()); + }; + if (exclude != null) { + dst.exclude = new ArrayList(); + for (StringType i : exclude) + dst.exclude.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + return dst; + } + + protected ProcessRequest typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProcessRequest)) + return false; + ProcessRequest o = (ProcessRequest) other; + return compareDeep(action, o.action, true) && compareDeep(identifier, o.identifier, true) && compareDeep(ruleset, o.ruleset, true) + && compareDeep(originalRuleset, o.originalRuleset, true) && compareDeep(created, o.created, true) + && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) && compareDeep(organization, o.organization, true) + && compareDeep(request, o.request, true) && compareDeep(response, o.response, true) && compareDeep(nullify, o.nullify, true) + && compareDeep(reference, o.reference, true) && compareDeep(item, o.item, true) && compareDeep(include, o.include, true) + && compareDeep(exclude, o.exclude, true) && compareDeep(period, o.period, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProcessRequest)) + return false; + ProcessRequest o = (ProcessRequest) other; + return compareValues(action, o.action, true) && compareValues(created, o.created, true) && compareValues(nullify, o.nullify, true) + && compareValues(reference, o.reference, true) && compareValues(include, o.include, true) && compareValues(exclude, o.exclude, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (action == null || action.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) + && (created == null || created.isEmpty()) && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) + && (organization == null || organization.isEmpty()) && (request == null || request.isEmpty()) + && (response == null || response.isEmpty()) && (nullify == null || nullify.isEmpty()) && (reference == null || reference.isEmpty()) + && (item == null || item.isEmpty()) && (include == null || include.isEmpty()) && (exclude == null || exclude.isEmpty()) + && (period == null || period.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ProcessRequest; + } + + @SearchParamDefinition(name="identifier", path="ProcessRequest.identifier", description="The business identifier of the ProcessRequest", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="provider", path="ProcessRequest.provider", description="The provider who renerated this request", type="reference" ) + public static final String SP_PROVIDER = "provider"; + @SearchParamDefinition(name="organization", path="ProcessRequest.organization", description="The organization who generated this request", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + @SearchParamDefinition(name="action", path="ProcessRequest.action", description="The action requested by this resource", type="token" ) + public static final String SP_ACTION = "action"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ProcessResponse.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ProcessResponse.java index 6def5442882..864946cc7a6 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ProcessResponse.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ProcessResponse.java @@ -1,917 +1,896 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * This resource provides processing status, errors and notes from the processing of a resource. - */ -@ResourceDef(name="ProcessResponse", profile="http://hl7.org/fhir/Profile/ProcessResponse") -public class ProcessResponse extends DomainResource { - - @Block() - public static class ProcessResponseNotesComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The note purpose: Print/Display. - */ - @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) - protected Coding type; - - /** - * The note text. - */ - @Child(name = "text", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Notes text", formalDefinition="The note text." ) - protected StringType text; - - private static final long serialVersionUID = 129959202L; - - /* - * Constructor - */ - public ProcessResponseNotesComponent() { - super(); - } - - /** - * @return {@link #type} (The note purpose: Print/Display.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponseNotesComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The note purpose: Print/Display.) - */ - public ProcessResponseNotesComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponseNotesComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public ProcessResponseNotesComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return The note text. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value The note text. - */ - public ProcessResponseNotesComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); - } - - public ProcessResponseNotesComponent copy() { - ProcessResponseNotesComponent dst = new ProcessResponseNotesComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.text = text == null ? null : text.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProcessResponseNotesComponent)) - return false; - ProcessResponseNotesComponent o = (ProcessResponseNotesComponent) other; - return compareDeep(type, o.type, true) && compareDeep(text, o.text, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProcessResponseNotesComponent)) - return false; - ProcessResponseNotesComponent o = (ProcessResponseNotesComponent) other; - return compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (text == null || text.isEmpty()) - ; - } - - } - - /** - * The Response Business Identifier. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * Original request resource reference. - */ - @Child(name = "request", type = {}, order=1, min=0, max=1) - @Description(shortDefinition="Request reference", formalDefinition="Original request resource reference." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (Original request resource reference.) - */ - protected Resource requestTarget; - - /** - * Transaction status: error, complete, held. - */ - @Child(name = "outcome", type = {Coding.class}, order=2, min=0, max=1) - @Description(shortDefinition="Processing outcome", formalDefinition="Transaction status: error, complete, held." ) - protected Coding outcome; - - /** - * A description of the status of the adjudication or processing. - */ - @Child(name = "disposition", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication or processing." ) - protected StringType disposition; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=5, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateTimeType created; - - /** - * The organization who produced this adjudicated response. - */ - @Child(name = "organization", type = {Organization.class}, order=7, min=0, max=1) - @Description(shortDefinition="Authoring Organization", formalDefinition="The organization who produced this adjudicated response." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization who produced this adjudicated response.) - */ - protected Organization organizationTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name = "requestProvider", type = {Practitioner.class}, order=8, min=0, max=1) - @Description(shortDefinition="Responsible Practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference requestProvider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner requestProviderTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name = "requestOrganization", type = {Organization.class}, order=9, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference requestOrganization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization requestOrganizationTarget; - - /** - * The form to be used for printing the content. - */ - @Child(name = "form", type = {Coding.class}, order=10, min=0, max=1) - @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) - protected Coding form; - - /** - * Suite of processing note or additional requirements is the processing has been held. - */ - @Child(name = "notes", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Notes", formalDefinition="Suite of processing note or additional requirements is the processing has been held." ) - protected List notes; - - /** - * Processing errors. - */ - @Child(name = "error", type = {Coding.class}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Error code", formalDefinition="Processing errors." ) - protected List error; - - private static final long serialVersionUID = -1668062545L; - - /* - * Constructor - */ - public ProcessResponse() { - super(); - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public ProcessResponse addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #request} (Original request resource reference.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); // cc - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request resource reference.) - */ - public ProcessResponse setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original request resource reference.) - */ - public Resource getRequestTarget() { - return this.requestTarget; - } - - /** - * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original request resource reference.) - */ - public ProcessResponse setRequestTarget(Resource value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #outcome} (Transaction status: error, complete, held.) - */ - public Coding getOutcome() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Coding(); // cc - return this.outcome; - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Transaction status: error, complete, held.) - */ - public ProcessResponse setOutcome(Coding value) { - this.outcome = value; - return this; - } - - /** - * @return {@link #disposition} (A description of the status of the adjudication or processing.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public StringType getDispositionElement() { - if (this.disposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.disposition"); - else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); // bb - return this.disposition; - } - - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - /** - * @param value {@link #disposition} (A description of the status of the adjudication or processing.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public ProcessResponse setDispositionElement(StringType value) { - this.disposition = value; - return this; - } - - /** - * @return A description of the status of the adjudication or processing. - */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); - } - - /** - * @param value A description of the status of the adjudication or processing. - */ - public ProcessResponse setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); - } - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public ProcessResponse setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public ProcessResponse setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public ProcessResponse setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when the enclosed suite of services were performed or completed. - */ - public ProcessResponse setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #organization} (The organization who produced this adjudicated response.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); // cc - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization who produced this adjudicated response.) - */ - public ProcessResponse 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 who produced this adjudicated response.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); // aa - return this.organizationTarget; - } - - /** - * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization who produced this adjudicated response.) - */ - public ProcessResponse setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getRequestProvider() { - if (this.requestProvider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProvider = new Reference(); // cc - return this.requestProvider; - } - - public boolean hasRequestProvider() { - return this.requestProvider != null && !this.requestProvider.isEmpty(); - } - - /** - * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public ProcessResponse setRequestProvider(Reference value) { - this.requestProvider = value; - return this; - } - - /** - * @return {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getRequestProviderTarget() { - if (this.requestProviderTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProviderTarget = new Practitioner(); // aa - return this.requestProviderTarget; - } - - /** - * @param value {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) - */ - public ProcessResponse setRequestProviderTarget(Practitioner value) { - this.requestProviderTarget = value; - return this; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getRequestOrganization() { - if (this.requestOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganization = new Reference(); // cc - return this.requestOrganization; - } - - public boolean hasRequestOrganization() { - return this.requestOrganization != null && !this.requestOrganization.isEmpty(); - } - - /** - * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public ProcessResponse setRequestOrganization(Reference value) { - this.requestOrganization = value; - return this; - } - - /** - * @return {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) - */ - public Organization getRequestOrganizationTarget() { - if (this.requestOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganizationTarget = new Organization(); // aa - return this.requestOrganizationTarget; - } - - /** - * @param value {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) - */ - public ProcessResponse setRequestOrganizationTarget(Organization value) { - this.requestOrganizationTarget = value; - return this; - } - - /** - * @return {@link #form} (The form to be used for printing the content.) - */ - public Coding getForm() { - if (this.form == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.form"); - else if (Configuration.doAutoCreate()) - this.form = new Coding(); // cc - return this.form; - } - - public boolean hasForm() { - return this.form != null && !this.form.isEmpty(); - } - - /** - * @param value {@link #form} (The form to be used for printing the content.) - */ - public ProcessResponse setForm(Coding value) { - this.form = value; - return this; - } - - /** - * @return {@link #notes} (Suite of processing note or additional requirements is the processing has been held.) - */ - public List getNotes() { - if (this.notes == null) - this.notes = new ArrayList(); - return this.notes; - } - - public boolean hasNotes() { - if (this.notes == null) - return false; - for (ProcessResponseNotesComponent item : this.notes) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #notes} (Suite of processing note or additional requirements is the processing has been held.) - */ - // syntactic sugar - public ProcessResponseNotesComponent addNotes() { //3 - ProcessResponseNotesComponent t = new ProcessResponseNotesComponent(); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return t; - } - - // syntactic sugar - public ProcessResponse addNotes(ProcessResponseNotesComponent t) { //3 - if (t == null) - return this; - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return this; - } - - /** - * @return {@link #error} (Processing errors.) - */ - public List getError() { - if (this.error == null) - this.error = new ArrayList(); - return this.error; - } - - public boolean hasError() { - if (this.error == null) - return false; - for (Coding item : this.error) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #error} (Processing errors.) - */ - // syntactic sugar - public Coding addError() { //3 - Coding t = new Coding(); - if (this.error == null) - this.error = new ArrayList(); - this.error.add(t); - return t; - } - - // syntactic sugar - public ProcessResponse addError(Coding t) { //3 - if (t == null) - return this; - if (this.error == null) - this.error = new ArrayList(); - this.error.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("request", "Reference(Any)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("outcome", "Coding", "Transaction status: error, complete, held.", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication or processing.", 0, java.lang.Integer.MAX_VALUE, disposition)); - childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("organization", "Reference(Organization)", "The organization who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); - childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); - childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); - childrenList.add(new Property("notes", "", "Suite of processing note or additional requirements is the processing has been held.", 0, java.lang.Integer.MAX_VALUE, notes)); - childrenList.add(new Property("error", "Coding", "Processing errors.", 0, java.lang.Integer.MAX_VALUE, error)); - } - - public ProcessResponse copy() { - ProcessResponse dst = new ProcessResponse(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.request = request == null ? null : request.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.disposition = disposition == null ? null : disposition.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); - dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); - dst.form = form == null ? null : form.copy(); - if (notes != null) { - dst.notes = new ArrayList(); - for (ProcessResponseNotesComponent i : notes) - dst.notes.add(i.copy()); - }; - if (error != null) { - dst.error = new ArrayList(); - for (Coding i : error) - dst.error.add(i.copy()); - }; - return dst; - } - - protected ProcessResponse typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProcessResponse)) - return false; - ProcessResponse o = (ProcessResponse) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true) - && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) - && compareDeep(created, o.created, true) && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) - && compareDeep(requestOrganization, o.requestOrganization, true) && compareDeep(form, o.form, true) - && compareDeep(notes, o.notes, true) && compareDeep(error, o.error, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProcessResponse)) - return false; - ProcessResponse o = (ProcessResponse) other; - return compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) - && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) - && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) - && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) - && (form == null || form.isEmpty()) && (notes == null || notes.isEmpty()) && (error == null || error.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ProcessResponse; - } - - @SearchParamDefinition(name="organization", path="ProcessResponse.organization", description="The organization who generated this resource", type="reference" ) - public static final String SP_ORGANIZATION = "organization"; - @SearchParamDefinition(name="requestprovider", path="ProcessResponse.requestProvider", description="The Provider who is responsible the request transaction", type="reference" ) - public static final String SP_REQUESTPROVIDER = "requestprovider"; - @SearchParamDefinition(name="request", path="ProcessResponse.request", description="The reference to the claim", type="reference" ) - public static final String SP_REQUEST = "request"; - @SearchParamDefinition(name="requestorganization", path="ProcessResponse.requestOrganization", description="The Organization who is responsible the request transaction", type="reference" ) - public static final String SP_REQUESTORGANIZATION = "requestorganization"; - @SearchParamDefinition(name="identifier", path="ProcessResponse.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * This resource provides processing status, errors and notes from the processing of a resource. + */ +@ResourceDef(name="ProcessResponse", profile="http://hl7.org/fhir/Profile/ProcessResponse") +public class ProcessResponse extends DomainResource { + + @Block() + public static class ProcessResponseNotesComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The note purpose: Print/Display. + */ + @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) + protected Coding type; + + /** + * The note text. + */ + @Child(name = "text", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Notes text", formalDefinition="The note text." ) + protected StringType text; + + private static final long serialVersionUID = 129959202L; + + /* + * Constructor + */ + public ProcessResponseNotesComponent() { + super(); + } + + /** + * @return {@link #type} (The note purpose: Print/Display.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponseNotesComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The note purpose: Print/Display.) + */ + public ProcessResponseNotesComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponseNotesComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public ProcessResponseNotesComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return The note text. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value The note text. + */ + public ProcessResponseNotesComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); + } + + public ProcessResponseNotesComponent copy() { + ProcessResponseNotesComponent dst = new ProcessResponseNotesComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.text = text == null ? null : text.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProcessResponseNotesComponent)) + return false; + ProcessResponseNotesComponent o = (ProcessResponseNotesComponent) other; + return compareDeep(type, o.type, true) && compareDeep(text, o.text, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProcessResponseNotesComponent)) + return false; + ProcessResponseNotesComponent o = (ProcessResponseNotesComponent) other; + return compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (text == null || text.isEmpty()) + ; + } + + } + + /** + * The Response Business Identifier. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * Original request resource reference. + */ + @Child(name = "request", type = {}, order=1, min=0, max=1) + @Description(shortDefinition="Request reference", formalDefinition="Original request resource reference." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (Original request resource reference.) + */ + protected Resource requestTarget; + + /** + * Transaction status: error, complete, held. + */ + @Child(name = "outcome", type = {Coding.class}, order=2, min=0, max=1) + @Description(shortDefinition="Processing outcome", formalDefinition="Transaction status: error, complete, held." ) + protected Coding outcome; + + /** + * A description of the status of the adjudication or processing. + */ + @Child(name = "disposition", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication or processing." ) + protected StringType disposition; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=5, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateTimeType created; + + /** + * The organization who produced this adjudicated response. + */ + @Child(name = "organization", type = {Organization.class}, order=7, min=0, max=1) + @Description(shortDefinition="Authoring Organization", formalDefinition="The organization who produced this adjudicated response." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization who produced this adjudicated response.) + */ + protected Organization organizationTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name = "requestProvider", type = {Practitioner.class}, order=8, min=0, max=1) + @Description(shortDefinition="Responsible Practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference requestProvider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner requestProviderTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name = "requestOrganization", type = {Organization.class}, order=9, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference requestOrganization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization requestOrganizationTarget; + + /** + * The form to be used for printing the content. + */ + @Child(name = "form", type = {Coding.class}, order=10, min=0, max=1) + @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) + protected Coding form; + + /** + * Suite of processing note or additional requirements is the processing has been held. + */ + @Child(name = "notes", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Notes", formalDefinition="Suite of processing note or additional requirements is the processing has been held." ) + protected List notes; + + /** + * Processing errors. + */ + @Child(name = "error", type = {Coding.class}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Error code", formalDefinition="Processing errors." ) + protected List error; + + private static final long serialVersionUID = -1668062545L; + + /* + * Constructor + */ + public ProcessResponse() { + super(); + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public ProcessResponse addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #request} (Original request resource reference.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponse.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); // cc + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request resource reference.) + */ + public ProcessResponse setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original request resource reference.) + */ + public Resource getRequestTarget() { + return this.requestTarget; + } + + /** + * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original request resource reference.) + */ + public ProcessResponse setRequestTarget(Resource value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #outcome} (Transaction status: error, complete, held.) + */ + public Coding getOutcome() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponse.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new Coding(); // cc + return this.outcome; + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Transaction status: error, complete, held.) + */ + public ProcessResponse setOutcome(Coding value) { + this.outcome = value; + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication or processing.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponse.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); // bb + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication or processing.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public ProcessResponse setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication or processing. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication or processing. + */ + public ProcessResponse setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponse.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public ProcessResponse setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponse.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public ProcessResponse setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponse.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public ProcessResponse setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when the enclosed suite of services were performed or completed. + */ + public ProcessResponse setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #organization} (The organization who produced this adjudicated response.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponse.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); // cc + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization who produced this adjudicated response.) + */ + public ProcessResponse 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 who produced this adjudicated response.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponse.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); // aa + return this.organizationTarget; + } + + /** + * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization who produced this adjudicated response.) + */ + public ProcessResponse setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getRequestProvider() { + if (this.requestProvider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponse.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProvider = new Reference(); // cc + return this.requestProvider; + } + + public boolean hasRequestProvider() { + return this.requestProvider != null && !this.requestProvider.isEmpty(); + } + + /** + * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public ProcessResponse setRequestProvider(Reference value) { + this.requestProvider = value; + return this; + } + + /** + * @return {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getRequestProviderTarget() { + if (this.requestProviderTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponse.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProviderTarget = new Practitioner(); // aa + return this.requestProviderTarget; + } + + /** + * @param value {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public ProcessResponse setRequestProviderTarget(Practitioner value) { + this.requestProviderTarget = value; + return this; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getRequestOrganization() { + if (this.requestOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponse.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganization = new Reference(); // cc + return this.requestOrganization; + } + + public boolean hasRequestOrganization() { + return this.requestOrganization != null && !this.requestOrganization.isEmpty(); + } + + /** + * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public ProcessResponse setRequestOrganization(Reference value) { + this.requestOrganization = value; + return this; + } + + /** + * @return {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) + */ + public Organization getRequestOrganizationTarget() { + if (this.requestOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponse.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganizationTarget = new Organization(); // aa + return this.requestOrganizationTarget; + } + + /** + * @param value {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) + */ + public ProcessResponse setRequestOrganizationTarget(Organization value) { + this.requestOrganizationTarget = value; + return this; + } + + /** + * @return {@link #form} (The form to be used for printing the content.) + */ + public Coding getForm() { + if (this.form == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponse.form"); + else if (Configuration.doAutoCreate()) + this.form = new Coding(); // cc + return this.form; + } + + public boolean hasForm() { + return this.form != null && !this.form.isEmpty(); + } + + /** + * @param value {@link #form} (The form to be used for printing the content.) + */ + public ProcessResponse setForm(Coding value) { + this.form = value; + return this; + } + + /** + * @return {@link #notes} (Suite of processing note or additional requirements is the processing has been held.) + */ + public List getNotes() { + if (this.notes == null) + this.notes = new ArrayList(); + return this.notes; + } + + public boolean hasNotes() { + if (this.notes == null) + return false; + for (ProcessResponseNotesComponent item : this.notes) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #notes} (Suite of processing note or additional requirements is the processing has been held.) + */ + // syntactic sugar + public ProcessResponseNotesComponent addNotes() { //3 + ProcessResponseNotesComponent t = new ProcessResponseNotesComponent(); + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return t; + } + + // syntactic sugar + public ProcessResponse addNotes(ProcessResponseNotesComponent t) { //3 + if (t == null) + return this; + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return this; + } + + /** + * @return {@link #error} (Processing errors.) + */ + public List getError() { + if (this.error == null) + this.error = new ArrayList(); + return this.error; + } + + public boolean hasError() { + if (this.error == null) + return false; + for (Coding item : this.error) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #error} (Processing errors.) + */ + // syntactic sugar + public Coding addError() { //3 + Coding t = new Coding(); + if (this.error == null) + this.error = new ArrayList(); + this.error.add(t); + return t; + } + + // syntactic sugar + public ProcessResponse addError(Coding t) { //3 + if (t == null) + return this; + if (this.error == null) + this.error = new ArrayList(); + this.error.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("request", "Reference(Any)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("outcome", "Coding", "Transaction status: error, complete, held.", 0, java.lang.Integer.MAX_VALUE, outcome)); + childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication or processing.", 0, java.lang.Integer.MAX_VALUE, disposition)); + childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); + childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); + childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); + childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); + childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); + childrenList.add(new Property("notes", "", "Suite of processing note or additional requirements is the processing has been held.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("error", "Coding", "Processing errors.", 0, java.lang.Integer.MAX_VALUE, error)); + } + + public ProcessResponse copy() { + ProcessResponse dst = new ProcessResponse(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.request = request == null ? null : request.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.disposition = disposition == null ? null : disposition.copy(); + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + dst.created = created == null ? null : created.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); + dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); + dst.form = form == null ? null : form.copy(); + if (notes != null) { + dst.notes = new ArrayList(); + for (ProcessResponseNotesComponent i : notes) + dst.notes.add(i.copy()); + }; + if (error != null) { + dst.error = new ArrayList(); + for (Coding i : error) + dst.error.add(i.copy()); + }; + return dst; + } + + protected ProcessResponse typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProcessResponse)) + return false; + ProcessResponse o = (ProcessResponse) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true) + && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) + && compareDeep(created, o.created, true) && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) + && compareDeep(requestOrganization, o.requestOrganization, true) && compareDeep(form, o.form, true) + && compareDeep(notes, o.notes, true) && compareDeep(error, o.error, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProcessResponse)) + return false; + ProcessResponse o = (ProcessResponse) other; + return compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) + && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) + && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) + && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) + && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) + && (form == null || form.isEmpty()) && (notes == null || notes.isEmpty()) && (error == null || error.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ProcessResponse; + } + + @SearchParamDefinition(name="identifier", path="ProcessResponse.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="request", path="ProcessResponse.request", description="The reference to the claim", type="reference" ) + public static final String SP_REQUEST = "request"; + @SearchParamDefinition(name="organization", path="ProcessResponse.organization", description="The organization who generated this resource", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + @SearchParamDefinition(name="requestprovider", path="ProcessResponse.requestProvider", description="The Provider who is responsible the request transaction", type="reference" ) + public static final String SP_REQUESTPROVIDER = "requestprovider"; + @SearchParamDefinition(name="requestorganization", path="ProcessResponse.requestOrganization", description="The Organization who is responsible the request transaction", type="reference" ) + public static final String SP_REQUESTORGANIZATION = "requestorganization"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Property.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Property.java index fe1c4e35d73..1adf6c74720 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Property.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Property.java @@ -1,161 +1,140 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import java.util.ArrayList; -import java.util.List; - -/** - * A child element or property defined by the FHIR specification - * This class is defined as a helper class when iterating the - * children of an element in a generic fashion - * - * At present, iteration is only based on the specification, but - * this may be changed to allow profile based expression at a - * later date - * - * note: there's no point in creating one of these classes outside this package - */ -public class Property { - - /** - * The name of the property as found in the FHIR specification - */ - private String name; - - /** - * The type of the property as specified in the FHIR specification (e.g. type|type|Reference(Name|Name) - */ - private String typeCode; - - /** - * The formal definition of the element given in the FHIR specification - */ - private String definition; - - /** - * The minimum allowed cardinality - 0 or 1 when based on the specification - */ - private int minCardinality; - - /** - * The maximum allowed cardinality - 1 or MAX_INT when based on the specification - */ - private int maxCardinality; - - /** - * The actual elements that exist on this instance - */ - private List values = new ArrayList(); - - /** - * For run time, if/once a property is hooked up to it's definition - */ - private StructureDefinition structure; - - /** - * Internal constructor - */ - public Property(String name, String typeCode, String definition, int minCardinality, int maxCardinality, Base value) { - super(); - this.name = name; - this.typeCode = typeCode; - this.definition = definition; - this.minCardinality = minCardinality; - this.maxCardinality = maxCardinality; - this.values.add(value); - } - - /** - * Internal constructor - */ - public Property(String name, String typeCode, String definition, int minCardinality, int maxCardinality, List values) { - super(); - this.name = name; - this.typeCode = typeCode; - this.definition = definition; - this.minCardinality = minCardinality; - this.maxCardinality = maxCardinality; - if (values != null) - this.values.addAll(values); - } - - /** - * @return The name of this property in the FHIR Specification - */ - public String getName() { - return name; - } - - /** - * @return The stated type in the FHIR specification - */ - public String getTypeCode() { - return typeCode; - } - - /** - * @return The definition of this element in the FHIR spec - */ - public String getDefinition() { - return definition; - } - - /** - * @return the minimum cardinality for this element - */ - public int getMinCardinality() { - return minCardinality; - } - - /** - * @return the maximum cardinality for this element - */ - public int getMaxCardinality() { - return maxCardinality; - } - - /** - * @return the actual values - will only be 1 unless maximum cardinality == MAX_INT - */ - public List getValues() { - return values; - } - - public boolean hasValues() { - for (Base e : getValues()) - if (e != null) - return true; - return false; - } - - public StructureDefinition getStructure() { - return structure; - } - - public void setStructure(StructureDefinition structure) { - this.structure = structure; - } - - - -} +package org.hl7.fhir.instance.model; + +import java.util.ArrayList; +import java.util.List; + +/** + * A child element or property defined by the FHIR specification + * This class is defined as a helper class when iterating the + * children of an element in a generic fashion + * + * At present, iteration is only based on the specification, but + * this may be changed to allow profile based expression at a + * later date + * + * note: there's no point in creating one of these classes outside this package + */ +public class Property { + + /** + * The name of the property as found in the FHIR specification + */ + private String name; + + /** + * The type of the property as specified in the FHIR specification (e.g. type|type|Reference(Name|Name) + */ + private String typeCode; + + /** + * The formal definition of the element given in the FHIR specification + */ + private String definition; + + /** + * The minimum allowed cardinality - 0 or 1 when based on the specification + */ + private int minCardinality; + + /** + * The maximum allowed cardinality - 1 or MAX_INT when based on the specification + */ + private int maxCardinality; + + /** + * The actual elements that exist on this instance + */ + private List values = new ArrayList(); + + /** + * For run time, if/once a property is hooked up to it's definition + */ + private StructureDefinition structure; + + /** + * Internal constructor + */ + public Property(String name, String typeCode, String definition, int minCardinality, int maxCardinality, Base value) { + super(); + this.name = name; + this.typeCode = typeCode; + this.definition = definition; + this.minCardinality = minCardinality; + this.maxCardinality = maxCardinality; + this.values.add(value); + } + + /** + * Internal constructor + */ + public Property(String name, String typeCode, String definition, int minCardinality, int maxCardinality, List values) { + super(); + this.name = name; + this.typeCode = typeCode; + this.definition = definition; + this.minCardinality = minCardinality; + this.maxCardinality = maxCardinality; + if (values != null) + this.values.addAll(values); + } + + /** + * @return The name of this property in the FHIR Specification + */ + public String getName() { + return name; + } + + /** + * @return The stated type in the FHIR specification + */ + public String getTypeCode() { + return typeCode; + } + + /** + * @return The definition of this element in the FHIR spec + */ + public String getDefinition() { + return definition; + } + + /** + * @return the minimum cardinality for this element + */ + public int getMinCardinality() { + return minCardinality; + } + + /** + * @return the maximum cardinality for this element + */ + public int getMaxCardinality() { + return maxCardinality; + } + + /** + * @return the actual values - will only be 1 unless maximum cardinality == MAX_INT + */ + public List getValues() { + return values; + } + + public boolean hasValues() { + for (Base e : getValues()) + if (e != null) + return true; + return false; + } + + public StructureDefinition getStructure() { + return structure; + } + + public void setStructure(StructureDefinition structure) { + this.structure = structure; + } + + + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Provenance.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Provenance.java index 05e98e999c4..c499c92fbea 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Provenance.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Provenance.java @@ -1,1246 +1,1225 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g., Document Completion - has the artifact been legally authenticated), all of which may impact Security, Privacy, and Trust policies. - */ -@ResourceDef(name="Provenance", profile="http://hl7.org/fhir/Profile/Provenance") -public class Provenance extends DomainResource { - - public enum ProvenanceEntityRole { - /** - * A transformation of an entity into another, an update of an entity resulting in a new one, or the construction of a new entity based on a preexisting entity. - */ - DERIVATION, - /** - * A derivation for which the resulting entity is a revised version of some original. - */ - REVISION, - /** - * The repeat of (some or all of) an entity, such as text or image, by someone who may or may not be its original author. - */ - QUOTATION, - /** - * A primary source for a topic refers to something produced by some agent with direct experience and knowledge about the topic, at the time of the topic's study, without benefit from hindsight. - */ - SOURCE, - /** - * added to help the parsers - */ - NULL; - public static ProvenanceEntityRole fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("derivation".equals(codeString)) - return DERIVATION; - if ("revision".equals(codeString)) - return REVISION; - if ("quotation".equals(codeString)) - return QUOTATION; - if ("source".equals(codeString)) - return SOURCE; - throw new Exception("Unknown ProvenanceEntityRole code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case DERIVATION: return "derivation"; - case REVISION: return "revision"; - case QUOTATION: return "quotation"; - case SOURCE: return "source"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DERIVATION: return ""; - case REVISION: return ""; - case QUOTATION: return ""; - case SOURCE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DERIVATION: return "A transformation of an entity into another, an update of an entity resulting in a new one, or the construction of a new entity based on a preexisting entity."; - case REVISION: return "A derivation for which the resulting entity is a revised version of some original."; - case QUOTATION: return "The repeat of (some or all of) an entity, such as text or image, by someone who may or may not be its original author."; - case SOURCE: return "A primary source for a topic refers to something produced by some agent with direct experience and knowledge about the topic, at the time of the topic's study, without benefit from hindsight."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DERIVATION: return "Derivation"; - case REVISION: return "Revision"; - case QUOTATION: return "Quotation"; - case SOURCE: return "Source"; - default: return "?"; - } - } - } - - public static class ProvenanceEntityRoleEnumFactory implements EnumFactory { - public ProvenanceEntityRole fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("derivation".equals(codeString)) - return ProvenanceEntityRole.DERIVATION; - if ("revision".equals(codeString)) - return ProvenanceEntityRole.REVISION; - if ("quotation".equals(codeString)) - return ProvenanceEntityRole.QUOTATION; - if ("source".equals(codeString)) - return ProvenanceEntityRole.SOURCE; - throw new IllegalArgumentException("Unknown ProvenanceEntityRole code '"+codeString+"'"); - } - public String toCode(ProvenanceEntityRole code) { - if (code == ProvenanceEntityRole.DERIVATION) - return "derivation"; - if (code == ProvenanceEntityRole.REVISION) - return "revision"; - if (code == ProvenanceEntityRole.QUOTATION) - return "quotation"; - if (code == ProvenanceEntityRole.SOURCE) - return "source"; - return "?"; - } - } - - @Block() - public static class ProvenanceAgentComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The function of the agent with respect to the activity. - */ - @Child(name = "role", type = {Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Agents Role", formalDefinition="The function of the agent with respect to the activity." ) - protected Coding role; - - /** - * The type of participation of the agent. - */ - @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Agent Type", formalDefinition="The type of participation of the agent." ) - protected Coding type; - - /** - * Identity of participant as a Resource or uri. - */ - @Child(name = "reference", type = {UriType.class, Practitioner.class, RelatedPerson.class, Patient.class, Device.class}, order=3, min=0, max=1) - @Description(shortDefinition="Identity of agent", formalDefinition="Identity of participant as a Resource or uri." ) - protected Type reference; - - /** - * Human-readable description of the participant. - */ - @Child(name = "display", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Human description of participant", formalDefinition="Human-readable description of the participant." ) - protected StringType display; - - private static final long serialVersionUID = -689391376L; - - /* - * Constructor - */ - public ProvenanceAgentComponent() { - super(); - } - - /* - * Constructor - */ - public ProvenanceAgentComponent(Coding role, Coding type) { - super(); - this.role = role; - this.type = type; - } - - /** - * @return {@link #role} (The function of the agent with respect to the activity.) - */ - public Coding getRole() { - if (this.role == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceAgentComponent.role"); - else if (Configuration.doAutoCreate()) - this.role = new Coding(); // cc - return this.role; - } - - public boolean hasRole() { - return this.role != null && !this.role.isEmpty(); - } - - /** - * @param value {@link #role} (The function of the agent with respect to the activity.) - */ - public ProvenanceAgentComponent setRole(Coding value) { - this.role = value; - return this; - } - - /** - * @return {@link #type} (The type of participation of the agent.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceAgentComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of participation of the agent.) - */ - public ProvenanceAgentComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #reference} (Identity of participant as a Resource or uri.) - */ - public Type getReference() { - return this.reference; - } - - /** - * @return {@link #reference} (Identity of participant as a Resource or uri.) - */ - public UriType getReferenceUriType() throws Exception { - if (!(this.reference instanceof UriType)) - throw new Exception("Type mismatch: the type UriType was expected, but "+this.reference.getClass().getName()+" was encountered"); - return (UriType) this.reference; - } - - /** - * @return {@link #reference} (Identity of participant as a Resource or uri.) - */ - public Reference getReferenceReference() throws Exception { - if (!(this.reference instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.reference.getClass().getName()+" was encountered"); - return (Reference) this.reference; - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (Identity of participant as a Resource or uri.) - */ - public ProvenanceAgentComponent setReference(Type value) { - this.reference = value; - return this; - } - - /** - * @return {@link #display} (Human-readable description of the participant.). 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 ProvenanceAgentComponent.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); // bb - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (Human-readable description of the participant.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public ProvenanceAgentComponent setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return Human-readable description of the participant. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value Human-readable description of the participant. - */ - public ProvenanceAgentComponent 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; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("role", "Coding", "The function of the agent with respect to the activity.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("type", "Coding", "The type of participation of the agent.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("reference[x]", "uri|Reference(Practitioner|RelatedPerson|Patient|Device)", "Identity of participant as a Resource or uri.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("display", "string", "Human-readable description of the participant.", 0, java.lang.Integer.MAX_VALUE, display)); - } - - public ProvenanceAgentComponent copy() { - ProvenanceAgentComponent dst = new ProvenanceAgentComponent(); - copyValues(dst); - dst.role = role == null ? null : role.copy(); - dst.type = type == null ? null : type.copy(); - dst.reference = reference == null ? null : reference.copy(); - dst.display = display == null ? null : display.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProvenanceAgentComponent)) - return false; - ProvenanceAgentComponent o = (ProvenanceAgentComponent) other; - return compareDeep(role, o.role, true) && compareDeep(type, o.type, true) && compareDeep(reference, o.reference, true) - && compareDeep(display, o.display, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProvenanceAgentComponent)) - return false; - ProvenanceAgentComponent o = (ProvenanceAgentComponent) other; - return compareValues(display, o.display, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (role == null || role.isEmpty()) && (type == null || type.isEmpty()) - && (reference == null || reference.isEmpty()) && (display == null || display.isEmpty()); - } - - } - - @Block() - public static class ProvenanceEntityComponent extends BackboneElement implements IBaseBackboneElement { - /** - * How the entity was used during the activity. - */ - @Child(name = "role", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="derivation | revision | quotation | source", formalDefinition="How the entity was used during the activity." ) - protected Enumeration role; - - /** - * The type of the entity. If the entity is a resource, then this is a resource type. - */ - @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Entity Type", formalDefinition="The type of the entity. If the entity is a resource, then this is a resource type." ) - protected Coding type; - - /** - * Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative. - */ - @Child(name = "reference", type = {UriType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Identity of entity", formalDefinition="Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative." ) - protected UriType reference; - - /** - * Human-readable description of the entity. - */ - @Child(name = "display", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Human description of entity", formalDefinition="Human-readable description of the entity." ) - protected StringType display; - - /** - * The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity. - */ - @Child(name = "agent", type = {ProvenanceAgentComponent.class}, order=5, min=0, max=1) - @Description(shortDefinition="Entity is attributed to this agent", formalDefinition="The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity." ) - protected ProvenanceAgentComponent agent; - - private static final long serialVersionUID = 1533729633L; - - /* - * Constructor - */ - public ProvenanceEntityComponent() { - super(); - } - - /* - * Constructor - */ - public ProvenanceEntityComponent(Enumeration role, Coding type, UriType reference) { - super(); - this.role = role; - this.type = type; - this.reference = reference; - } - - /** - * @return {@link #role} (How the entity was used during the activity.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value - */ - public Enumeration getRoleElement() { - if (this.role == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceEntityComponent.role"); - else if (Configuration.doAutoCreate()) - this.role = new Enumeration(new ProvenanceEntityRoleEnumFactory()); // bb - return this.role; - } - - public boolean hasRoleElement() { - return this.role != null && !this.role.isEmpty(); - } - - public boolean hasRole() { - return this.role != null && !this.role.isEmpty(); - } - - /** - * @param value {@link #role} (How the entity was used during the activity.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value - */ - public ProvenanceEntityComponent setRoleElement(Enumeration value) { - this.role = value; - return this; - } - - /** - * @return How the entity was used during the activity. - */ - public ProvenanceEntityRole getRole() { - return this.role == null ? null : this.role.getValue(); - } - - /** - * @param value How the entity was used during the activity. - */ - public ProvenanceEntityComponent setRole(ProvenanceEntityRole value) { - if (this.role == null) - this.role = new Enumeration(new ProvenanceEntityRoleEnumFactory()); - this.role.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of the entity. If the entity is a resource, then this is a resource type.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceEntityComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of the entity. If the entity is a resource, then this is a resource type.) - */ - public ProvenanceEntityComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #reference} (Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public UriType getReferenceElement() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceEntityComponent.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new UriType(); // bb - return this.reference; - } - - public boolean hasReferenceElement() { - return this.reference != null && !this.reference.isEmpty(); - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public ProvenanceEntityComponent setReferenceElement(UriType value) { - this.reference = value; - return this; - } - - /** - * @return Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative. - */ - public String getReference() { - return this.reference == null ? null : this.reference.getValue(); - } - - /** - * @param value Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative. - */ - public ProvenanceEntityComponent setReference(String value) { - if (this.reference == null) - this.reference = new UriType(); - this.reference.setValue(value); - return this; - } - - /** - * @return {@link #display} (Human-readable description of the entity.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceEntityComponent.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); // bb - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (Human-readable description of the entity.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public ProvenanceEntityComponent setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return Human-readable description of the entity. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value Human-readable description of the entity. - */ - public ProvenanceEntityComponent setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - /** - * @return {@link #agent} (The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.) - */ - public ProvenanceAgentComponent getAgent() { - if (this.agent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceEntityComponent.agent"); - else if (Configuration.doAutoCreate()) - this.agent = new ProvenanceAgentComponent(); // cc - return this.agent; - } - - public boolean hasAgent() { - return this.agent != null && !this.agent.isEmpty(); - } - - /** - * @param value {@link #agent} (The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.) - */ - public ProvenanceEntityComponent setAgent(ProvenanceAgentComponent value) { - this.agent = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("role", "code", "How the entity was used during the activity.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("type", "Coding", "The type of the entity. If the entity is a resource, then this is a resource type.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("reference", "uri", "Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("display", "string", "Human-readable description of the entity.", 0, java.lang.Integer.MAX_VALUE, display)); - childrenList.add(new Property("agent", "@Provenance.agent", "The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.", 0, java.lang.Integer.MAX_VALUE, agent)); - } - - public ProvenanceEntityComponent copy() { - ProvenanceEntityComponent dst = new ProvenanceEntityComponent(); - copyValues(dst); - dst.role = role == null ? null : role.copy(); - dst.type = type == null ? null : type.copy(); - dst.reference = reference == null ? null : reference.copy(); - dst.display = display == null ? null : display.copy(); - dst.agent = agent == null ? null : agent.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProvenanceEntityComponent)) - return false; - ProvenanceEntityComponent o = (ProvenanceEntityComponent) other; - return compareDeep(role, o.role, true) && compareDeep(type, o.type, true) && compareDeep(reference, o.reference, true) - && compareDeep(display, o.display, true) && compareDeep(agent, o.agent, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProvenanceEntityComponent)) - return false; - ProvenanceEntityComponent o = (ProvenanceEntityComponent) other; - return compareValues(role, o.role, true) && compareValues(reference, o.reference, true) && compareValues(display, o.display, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (role == null || role.isEmpty()) && (type == null || type.isEmpty()) - && (reference == null || reference.isEmpty()) && (display == null || display.isEmpty()) && (agent == null || agent.isEmpty()) - ; - } - - } - - /** - * The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity. - */ - @Child(name = "target", type = {}, order=0, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Target Reference(s) (usually version specific)", formalDefinition="The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity." ) - protected List target; - /** - * The actual objects that are the target of the reference (The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.) - */ - protected List targetTarget; - - - /** - * The period during which the activity occurred. - */ - @Child(name = "period", type = {Period.class}, order=1, min=0, max=1) - @Description(shortDefinition="When the activity occurred", formalDefinition="The period during which the activity occurred." ) - protected Period period; - - /** - * The instant of time at which the activity was recorded. - */ - @Child(name = "recorded", type = {InstantType.class}, order=2, min=1, max=1) - @Description(shortDefinition="When the activity was recorded / updated", formalDefinition="The instant of time at which the activity was recorded." ) - protected InstantType recorded; - - /** - * The reason that the activity was taking place. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Reason the activity is occurring", formalDefinition="The reason that the activity was taking place." ) - protected CodeableConcept reason; - - /** - * Where the activity occurred, if relevant. - */ - @Child(name = "location", type = {Location.class}, order=4, min=0, max=1) - @Description(shortDefinition="Where the activity occurred, if relevant", formalDefinition="Where the activity occurred, if relevant." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (Where the activity occurred, if relevant.) - */ - protected Location locationTarget; - - /** - * Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc. - */ - @Child(name = "policy", type = {UriType.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Policy or plan the activity was defined by", formalDefinition="Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc." ) - protected List policy; - - /** - * An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, an organization, software, or other entities that may be ascribed responsibility. - */ - @Child(name = "agent", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Agents involved in creating resource", formalDefinition="An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, an organization, software, or other entities that may be ascribed responsibility." ) - protected List agent; - - /** - * An entity used in this activity. - */ - @Child(name = "entity", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="An entity used in this activity", formalDefinition="An entity used in this activity." ) - protected List entity; - - /** - * A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated. - */ - @Child(name = "signature", type = {Signature.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Signature on target", formalDefinition="A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated." ) - protected List signature; - - private static final long serialVersionUID = 800452939L; - - /* - * Constructor - */ - public Provenance() { - super(); - } - - /* - * Constructor - */ - public Provenance(InstantType recorded) { - super(); - this.recorded = recorded; - } - - /** - * @return {@link #target} (The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.) - */ - public List getTarget() { - if (this.target == null) - this.target = new ArrayList(); - return this.target; - } - - public boolean hasTarget() { - if (this.target == null) - return false; - for (Reference item : this.target) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #target} (The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.) - */ - // syntactic sugar - public Reference addTarget() { //3 - Reference t = new Reference(); - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return t; - } - - // syntactic sugar - public Provenance addTarget(Reference t) { //3 - if (t == null) - return this; - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return this; - } - - /** - * @return {@link #target} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.) - */ - public List getTargetTarget() { - if (this.targetTarget == null) - this.targetTarget = new ArrayList(); - return this.targetTarget; - } - - /** - * @return {@link #period} (The period during which the activity occurred.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Provenance.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The period during which the activity occurred.) - */ - public Provenance setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #recorded} (The instant of time at which the activity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value - */ - public InstantType getRecordedElement() { - if (this.recorded == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Provenance.recorded"); - else if (Configuration.doAutoCreate()) - this.recorded = new InstantType(); // bb - return this.recorded; - } - - public boolean hasRecordedElement() { - return this.recorded != null && !this.recorded.isEmpty(); - } - - public boolean hasRecorded() { - return this.recorded != null && !this.recorded.isEmpty(); - } - - /** - * @param value {@link #recorded} (The instant of time at which the activity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value - */ - public Provenance setRecordedElement(InstantType value) { - this.recorded = value; - return this; - } - - /** - * @return The instant of time at which the activity was recorded. - */ - public Date getRecorded() { - return this.recorded == null ? null : this.recorded.getValue(); - } - - /** - * @param value The instant of time at which the activity was recorded. - */ - public Provenance setRecorded(Date value) { - if (this.recorded == null) - this.recorded = new InstantType(); - this.recorded.setValue(value); - return this; - } - - /** - * @return {@link #reason} (The reason that the activity was taking place.) - */ - public CodeableConcept getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Provenance.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new CodeableConcept(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (The reason that the activity was taking place.) - */ - public Provenance setReason(CodeableConcept value) { - this.reason = value; - return this; - } - - /** - * @return {@link #location} (Where the activity occurred, if relevant.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Provenance.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); // cc - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (Where the activity occurred, if relevant.) - */ - public Provenance setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Where the activity occurred, if relevant.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Provenance.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); // aa - return this.locationTarget; - } - - /** - * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Where the activity occurred, if relevant.) - */ - public Provenance setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.) - */ - public List getPolicy() { - if (this.policy == null) - this.policy = new ArrayList(); - return this.policy; - } - - public boolean hasPolicy() { - if (this.policy == null) - return false; - for (UriType item : this.policy) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.) - */ - // syntactic sugar - public UriType addPolicyElement() {//2 - UriType t = new UriType(); - if (this.policy == null) - this.policy = new ArrayList(); - this.policy.add(t); - return t; - } - - /** - * @param value {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.) - */ - public Provenance addPolicy(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.policy == null) - this.policy = new ArrayList(); - this.policy.add(t); - return this; - } - - /** - * @param value {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.) - */ - public boolean hasPolicy(String value) { - if (this.policy == null) - return false; - for (UriType v : this.policy) - if (v.equals(value)) // uri - return true; - return false; - } - - /** - * @return {@link #agent} (An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, an organization, software, or other entities that may be ascribed responsibility.) - */ - public List getAgent() { - if (this.agent == null) - this.agent = new ArrayList(); - return this.agent; - } - - public boolean hasAgent() { - if (this.agent == null) - return false; - for (ProvenanceAgentComponent item : this.agent) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #agent} (An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, an organization, software, or other entities that may be ascribed responsibility.) - */ - // syntactic sugar - public ProvenanceAgentComponent addAgent() { //3 - ProvenanceAgentComponent t = new ProvenanceAgentComponent(); - if (this.agent == null) - this.agent = new ArrayList(); - this.agent.add(t); - return t; - } - - // syntactic sugar - public Provenance addAgent(ProvenanceAgentComponent t) { //3 - if (t == null) - return this; - if (this.agent == null) - this.agent = new ArrayList(); - this.agent.add(t); - return this; - } - - /** - * @return {@link #entity} (An entity used in this activity.) - */ - public List getEntity() { - if (this.entity == null) - this.entity = new ArrayList(); - return this.entity; - } - - public boolean hasEntity() { - if (this.entity == null) - return false; - for (ProvenanceEntityComponent item : this.entity) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #entity} (An entity used in this activity.) - */ - // syntactic sugar - public ProvenanceEntityComponent addEntity() { //3 - ProvenanceEntityComponent t = new ProvenanceEntityComponent(); - if (this.entity == null) - this.entity = new ArrayList(); - this.entity.add(t); - return t; - } - - // syntactic sugar - public Provenance addEntity(ProvenanceEntityComponent t) { //3 - if (t == null) - return this; - if (this.entity == null) - this.entity = new ArrayList(); - this.entity.add(t); - return this; - } - - /** - * @return {@link #signature} (A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.) - */ - public List getSignature() { - if (this.signature == null) - this.signature = new ArrayList(); - return this.signature; - } - - public boolean hasSignature() { - if (this.signature == null) - return false; - for (Signature item : this.signature) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #signature} (A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.) - */ - // syntactic sugar - public Signature addSignature() { //3 - Signature t = new Signature(); - if (this.signature == null) - this.signature = new ArrayList(); - this.signature.add(t); - return t; - } - - // syntactic sugar - public Provenance addSignature(Signature t) { //3 - if (t == null) - return this; - if (this.signature == null) - this.signature = new ArrayList(); - this.signature.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("target", "Reference(Any)", "The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("period", "Period", "The period during which the activity occurred.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("recorded", "instant", "The instant of time at which the activity was recorded.", 0, java.lang.Integer.MAX_VALUE, recorded)); - childrenList.add(new Property("reason", "CodeableConcept", "The reason that the activity was taking place.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("location", "Reference(Location)", "Where the activity occurred, if relevant.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("policy", "uri", "Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.", 0, java.lang.Integer.MAX_VALUE, policy)); - childrenList.add(new Property("agent", "", "An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, an organization, software, or other entities that may be ascribed responsibility.", 0, java.lang.Integer.MAX_VALUE, agent)); - childrenList.add(new Property("entity", "", "An entity used in this activity.", 0, java.lang.Integer.MAX_VALUE, entity)); - childrenList.add(new Property("signature", "Signature", "A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.", 0, java.lang.Integer.MAX_VALUE, signature)); - } - - public Provenance copy() { - Provenance dst = new Provenance(); - copyValues(dst); - if (target != null) { - dst.target = new ArrayList(); - for (Reference i : target) - dst.target.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - dst.recorded = recorded == null ? null : recorded.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.location = location == null ? null : location.copy(); - if (policy != null) { - dst.policy = new ArrayList(); - for (UriType i : policy) - dst.policy.add(i.copy()); - }; - if (agent != null) { - dst.agent = new ArrayList(); - for (ProvenanceAgentComponent i : agent) - dst.agent.add(i.copy()); - }; - if (entity != null) { - dst.entity = new ArrayList(); - for (ProvenanceEntityComponent i : entity) - dst.entity.add(i.copy()); - }; - if (signature != null) { - dst.signature = new ArrayList(); - for (Signature i : signature) - dst.signature.add(i.copy()); - }; - return dst; - } - - protected Provenance typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Provenance)) - return false; - Provenance o = (Provenance) other; - return compareDeep(target, o.target, true) && compareDeep(period, o.period, true) && compareDeep(recorded, o.recorded, true) - && compareDeep(reason, o.reason, true) && compareDeep(location, o.location, true) && compareDeep(policy, o.policy, true) - && compareDeep(agent, o.agent, true) && compareDeep(entity, o.entity, true) && compareDeep(signature, o.signature, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Provenance)) - return false; - Provenance o = (Provenance) other; - return compareValues(recorded, o.recorded, true) && compareValues(policy, o.policy, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (target == null || target.isEmpty()) && (period == null || period.isEmpty()) - && (recorded == null || recorded.isEmpty()) && (reason == null || reason.isEmpty()) && (location == null || location.isEmpty()) - && (policy == null || policy.isEmpty()) && (agent == null || agent.isEmpty()) && (entity == null || entity.isEmpty()) - && (signature == null || signature.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Provenance; - } - - @SearchParamDefinition(name="sigtype", path="Provenance.signature.type", description="Indication of the reason the entity signed the object(s)", type="token" ) - public static final String SP_SIGTYPE = "sigtype"; - @SearchParamDefinition(name="patient", path="", description="A patient that the target resource(s) refer to", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="location", path="Provenance.location", description="Where the activity occurred, if relevant", type="reference" ) - public static final String SP_LOCATION = "location"; - @SearchParamDefinition(name="start", path="Provenance.period.start", description="Starting time with inclusive boundary", type="date" ) - public static final String SP_START = "start"; - @SearchParamDefinition(name="partytype", path="Provenance.agent.type", description="Agent Type", type="token" ) - public static final String SP_PARTYTYPE = "partytype"; - @SearchParamDefinition(name="target", path="Provenance.target", description="Target Reference(s) (usually version specific)", type="reference" ) - public static final String SP_TARGET = "target"; - @SearchParamDefinition(name="party", path="Provenance.agent.reference[x]", description="Identity of agent", type="reference" ) - public static final String SP_PARTY = "party"; - @SearchParamDefinition(name="end", path="Provenance.period.end", description="End time with inclusive boundary, if not ongoing", type="date" ) - public static final String SP_END = "end"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g., Document Completion - has the artifact been legally authenticated), all of which may impact Security, Privacy, and Trust policies. + */ +@ResourceDef(name="Provenance", profile="http://hl7.org/fhir/Profile/Provenance") +public class Provenance extends DomainResource { + + public enum ProvenanceEntityRole { + /** + * A transformation of an entity into another, an update of an entity resulting in a new one, or the construction of a new entity based on a preexisting entity. + */ + DERIVATION, + /** + * A derivation for which the resulting entity is a revised version of some original. + */ + REVISION, + /** + * The repeat of (some or all of) an entity, such as text or image, by someone who may or may not be its original author. + */ + QUOTATION, + /** + * A primary source for a topic refers to something produced by some agent with direct experience and knowledge about the topic, at the time of the topic's study, without benefit from hindsight. + */ + SOURCE, + /** + * added to help the parsers + */ + NULL; + public static ProvenanceEntityRole fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("derivation".equals(codeString)) + return DERIVATION; + if ("revision".equals(codeString)) + return REVISION; + if ("quotation".equals(codeString)) + return QUOTATION; + if ("source".equals(codeString)) + return SOURCE; + throw new Exception("Unknown ProvenanceEntityRole code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case DERIVATION: return "derivation"; + case REVISION: return "revision"; + case QUOTATION: return "quotation"; + case SOURCE: return "source"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DERIVATION: return ""; + case REVISION: return ""; + case QUOTATION: return ""; + case SOURCE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DERIVATION: return "A transformation of an entity into another, an update of an entity resulting in a new one, or the construction of a new entity based on a preexisting entity."; + case REVISION: return "A derivation for which the resulting entity is a revised version of some original."; + case QUOTATION: return "The repeat of (some or all of) an entity, such as text or image, by someone who may or may not be its original author."; + case SOURCE: return "A primary source for a topic refers to something produced by some agent with direct experience and knowledge about the topic, at the time of the topic's study, without benefit from hindsight."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DERIVATION: return "Derivation"; + case REVISION: return "Revision"; + case QUOTATION: return "Quotation"; + case SOURCE: return "Source"; + default: return "?"; + } + } + } + + public static class ProvenanceEntityRoleEnumFactory implements EnumFactory { + public ProvenanceEntityRole fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("derivation".equals(codeString)) + return ProvenanceEntityRole.DERIVATION; + if ("revision".equals(codeString)) + return ProvenanceEntityRole.REVISION; + if ("quotation".equals(codeString)) + return ProvenanceEntityRole.QUOTATION; + if ("source".equals(codeString)) + return ProvenanceEntityRole.SOURCE; + throw new IllegalArgumentException("Unknown ProvenanceEntityRole code '"+codeString+"'"); + } + public String toCode(ProvenanceEntityRole code) { + if (code == ProvenanceEntityRole.DERIVATION) + return "derivation"; + if (code == ProvenanceEntityRole.REVISION) + return "revision"; + if (code == ProvenanceEntityRole.QUOTATION) + return "quotation"; + if (code == ProvenanceEntityRole.SOURCE) + return "source"; + return "?"; + } + } + + @Block() + public static class ProvenanceAgentComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The function of the agent with respect to the activity. + */ + @Child(name = "role", type = {Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Agents Role", formalDefinition="The function of the agent with respect to the activity." ) + protected Coding role; + + /** + * The type of participation of the agent. + */ + @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Agent Type", formalDefinition="The type of participation of the agent." ) + protected Coding type; + + /** + * Identity of participant as a Resource or uri. + */ + @Child(name = "reference", type = {UriType.class, Practitioner.class, RelatedPerson.class, Patient.class, Device.class}, order=3, min=0, max=1) + @Description(shortDefinition="Identity of agent", formalDefinition="Identity of participant as a Resource or uri." ) + protected Type reference; + + /** + * Human-readable description of the participant. + */ + @Child(name = "display", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Human description of participant", formalDefinition="Human-readable description of the participant." ) + protected StringType display; + + private static final long serialVersionUID = -689391376L; + + /* + * Constructor + */ + public ProvenanceAgentComponent() { + super(); + } + + /* + * Constructor + */ + public ProvenanceAgentComponent(Coding role, Coding type) { + super(); + this.role = role; + this.type = type; + } + + /** + * @return {@link #role} (The function of the agent with respect to the activity.) + */ + public Coding getRole() { + if (this.role == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceAgentComponent.role"); + else if (Configuration.doAutoCreate()) + this.role = new Coding(); // cc + return this.role; + } + + public boolean hasRole() { + return this.role != null && !this.role.isEmpty(); + } + + /** + * @param value {@link #role} (The function of the agent with respect to the activity.) + */ + public ProvenanceAgentComponent setRole(Coding value) { + this.role = value; + return this; + } + + /** + * @return {@link #type} (The type of participation of the agent.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceAgentComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of participation of the agent.) + */ + public ProvenanceAgentComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #reference} (Identity of participant as a Resource or uri.) + */ + public Type getReference() { + return this.reference; + } + + /** + * @return {@link #reference} (Identity of participant as a Resource or uri.) + */ + public UriType getReferenceUriType() throws Exception { + if (!(this.reference instanceof UriType)) + throw new Exception("Type mismatch: the type UriType was expected, but "+this.reference.getClass().getName()+" was encountered"); + return (UriType) this.reference; + } + + /** + * @return {@link #reference} (Identity of participant as a Resource or uri.) + */ + public Reference getReferenceReference() throws Exception { + if (!(this.reference instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.reference.getClass().getName()+" was encountered"); + return (Reference) this.reference; + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (Identity of participant as a Resource or uri.) + */ + public ProvenanceAgentComponent setReference(Type value) { + this.reference = value; + return this; + } + + /** + * @return {@link #display} (Human-readable description of the participant.). 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 ProvenanceAgentComponent.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); // bb + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (Human-readable description of the participant.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public ProvenanceAgentComponent setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return Human-readable description of the participant. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value Human-readable description of the participant. + */ + public ProvenanceAgentComponent 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("role", "Coding", "The function of the agent with respect to the activity.", 0, java.lang.Integer.MAX_VALUE, role)); + childrenList.add(new Property("type", "Coding", "The type of participation of the agent.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("reference[x]", "uri|Reference(Practitioner|RelatedPerson|Patient|Device)", "Identity of participant as a Resource or uri.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("display", "string", "Human-readable description of the participant.", 0, java.lang.Integer.MAX_VALUE, display)); + } + + public ProvenanceAgentComponent copy() { + ProvenanceAgentComponent dst = new ProvenanceAgentComponent(); + copyValues(dst); + dst.role = role == null ? null : role.copy(); + dst.type = type == null ? null : type.copy(); + dst.reference = reference == null ? null : reference.copy(); + dst.display = display == null ? null : display.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProvenanceAgentComponent)) + return false; + ProvenanceAgentComponent o = (ProvenanceAgentComponent) other; + return compareDeep(role, o.role, true) && compareDeep(type, o.type, true) && compareDeep(reference, o.reference, true) + && compareDeep(display, o.display, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProvenanceAgentComponent)) + return false; + ProvenanceAgentComponent o = (ProvenanceAgentComponent) other; + return compareValues(display, o.display, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (role == null || role.isEmpty()) && (type == null || type.isEmpty()) + && (reference == null || reference.isEmpty()) && (display == null || display.isEmpty()); + } + + } + + @Block() + public static class ProvenanceEntityComponent extends BackboneElement implements IBaseBackboneElement { + /** + * How the entity was used during the activity. + */ + @Child(name = "role", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="derivation | revision | quotation | source", formalDefinition="How the entity was used during the activity." ) + protected Enumeration role; + + /** + * The type of the entity. If the entity is a resource, then this is a resource type. + */ + @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Entity Type", formalDefinition="The type of the entity. If the entity is a resource, then this is a resource type." ) + protected Coding type; + + /** + * Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative. + */ + @Child(name = "reference", type = {UriType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Identity of entity", formalDefinition="Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative." ) + protected UriType reference; + + /** + * Human-readable description of the entity. + */ + @Child(name = "display", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Human description of entity", formalDefinition="Human-readable description of the entity." ) + protected StringType display; + + /** + * The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity. + */ + @Child(name = "agent", type = {ProvenanceAgentComponent.class}, order=5, min=0, max=1) + @Description(shortDefinition="Entity is attributed to this agent", formalDefinition="The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity." ) + protected ProvenanceAgentComponent agent; + + private static final long serialVersionUID = 1533729633L; + + /* + * Constructor + */ + public ProvenanceEntityComponent() { + super(); + } + + /* + * Constructor + */ + public ProvenanceEntityComponent(Enumeration role, Coding type, UriType reference) { + super(); + this.role = role; + this.type = type; + this.reference = reference; + } + + /** + * @return {@link #role} (How the entity was used during the activity.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value + */ + public Enumeration getRoleElement() { + if (this.role == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceEntityComponent.role"); + else if (Configuration.doAutoCreate()) + this.role = new Enumeration(new ProvenanceEntityRoleEnumFactory()); // bb + return this.role; + } + + public boolean hasRoleElement() { + return this.role != null && !this.role.isEmpty(); + } + + public boolean hasRole() { + return this.role != null && !this.role.isEmpty(); + } + + /** + * @param value {@link #role} (How the entity was used during the activity.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value + */ + public ProvenanceEntityComponent setRoleElement(Enumeration value) { + this.role = value; + return this; + } + + /** + * @return How the entity was used during the activity. + */ + public ProvenanceEntityRole getRole() { + return this.role == null ? null : this.role.getValue(); + } + + /** + * @param value How the entity was used during the activity. + */ + public ProvenanceEntityComponent setRole(ProvenanceEntityRole value) { + if (this.role == null) + this.role = new Enumeration(new ProvenanceEntityRoleEnumFactory()); + this.role.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of the entity. If the entity is a resource, then this is a resource type.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceEntityComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of the entity. If the entity is a resource, then this is a resource type.) + */ + public ProvenanceEntityComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #reference} (Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public UriType getReferenceElement() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceEntityComponent.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new UriType(); // bb + return this.reference; + } + + public boolean hasReferenceElement() { + return this.reference != null && !this.reference.isEmpty(); + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public ProvenanceEntityComponent setReferenceElement(UriType value) { + this.reference = value; + return this; + } + + /** + * @return Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative. + */ + public String getReference() { + return this.reference == null ? null : this.reference.getValue(); + } + + /** + * @param value Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative. + */ + public ProvenanceEntityComponent setReference(String value) { + if (this.reference == null) + this.reference = new UriType(); + this.reference.setValue(value); + return this; + } + + /** + * @return {@link #display} (Human-readable description of the entity.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceEntityComponent.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); // bb + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (Human-readable description of the entity.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public ProvenanceEntityComponent setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return Human-readable description of the entity. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value Human-readable description of the entity. + */ + public ProvenanceEntityComponent setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + /** + * @return {@link #agent} (The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.) + */ + public ProvenanceAgentComponent getAgent() { + if (this.agent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceEntityComponent.agent"); + else if (Configuration.doAutoCreate()) + this.agent = new ProvenanceAgentComponent(); // cc + return this.agent; + } + + public boolean hasAgent() { + return this.agent != null && !this.agent.isEmpty(); + } + + /** + * @param value {@link #agent} (The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.) + */ + public ProvenanceEntityComponent setAgent(ProvenanceAgentComponent value) { + this.agent = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("role", "code", "How the entity was used during the activity.", 0, java.lang.Integer.MAX_VALUE, role)); + childrenList.add(new Property("type", "Coding", "The type of the entity. If the entity is a resource, then this is a resource type.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("reference", "uri", "Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("display", "string", "Human-readable description of the entity.", 0, java.lang.Integer.MAX_VALUE, display)); + childrenList.add(new Property("agent", "@Provenance.agent", "The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.", 0, java.lang.Integer.MAX_VALUE, agent)); + } + + public ProvenanceEntityComponent copy() { + ProvenanceEntityComponent dst = new ProvenanceEntityComponent(); + copyValues(dst); + dst.role = role == null ? null : role.copy(); + dst.type = type == null ? null : type.copy(); + dst.reference = reference == null ? null : reference.copy(); + dst.display = display == null ? null : display.copy(); + dst.agent = agent == null ? null : agent.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProvenanceEntityComponent)) + return false; + ProvenanceEntityComponent o = (ProvenanceEntityComponent) other; + return compareDeep(role, o.role, true) && compareDeep(type, o.type, true) && compareDeep(reference, o.reference, true) + && compareDeep(display, o.display, true) && compareDeep(agent, o.agent, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProvenanceEntityComponent)) + return false; + ProvenanceEntityComponent o = (ProvenanceEntityComponent) other; + return compareValues(role, o.role, true) && compareValues(reference, o.reference, true) && compareValues(display, o.display, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (role == null || role.isEmpty()) && (type == null || type.isEmpty()) + && (reference == null || reference.isEmpty()) && (display == null || display.isEmpty()) && (agent == null || agent.isEmpty()) + ; + } + + } + + /** + * The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity. + */ + @Child(name = "target", type = {}, order=0, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Target Reference(s) (usually version specific)", formalDefinition="The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity." ) + protected List target; + /** + * The actual objects that are the target of the reference (The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.) + */ + protected List targetTarget; + + + /** + * The period during which the activity occurred. + */ + @Child(name = "period", type = {Period.class}, order=1, min=0, max=1) + @Description(shortDefinition="When the activity occurred", formalDefinition="The period during which the activity occurred." ) + protected Period period; + + /** + * The instant of time at which the activity was recorded. + */ + @Child(name = "recorded", type = {InstantType.class}, order=2, min=1, max=1) + @Description(shortDefinition="When the activity was recorded / updated", formalDefinition="The instant of time at which the activity was recorded." ) + protected InstantType recorded; + + /** + * The reason that the activity was taking place. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Reason the activity is occurring", formalDefinition="The reason that the activity was taking place." ) + protected CodeableConcept reason; + + /** + * Where the activity occurred, if relevant. + */ + @Child(name = "location", type = {Location.class}, order=4, min=0, max=1) + @Description(shortDefinition="Where the activity occurred, if relevant", formalDefinition="Where the activity occurred, if relevant." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (Where the activity occurred, if relevant.) + */ + protected Location locationTarget; + + /** + * Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc. + */ + @Child(name = "policy", type = {UriType.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Policy or plan the activity was defined by", formalDefinition="Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc." ) + protected List policy; + + /** + * An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, an organization, software, or other entities that may be ascribed responsibility. + */ + @Child(name = "agent", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Agents involved in creating resource", formalDefinition="An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, an organization, software, or other entities that may be ascribed responsibility." ) + protected List agent; + + /** + * An entity used in this activity. + */ + @Child(name = "entity", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="An entity used in this activity", formalDefinition="An entity used in this activity." ) + protected List entity; + + /** + * A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated. + */ + @Child(name = "signature", type = {Signature.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Signature on target", formalDefinition="A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated." ) + protected List signature; + + private static final long serialVersionUID = 800452939L; + + /* + * Constructor + */ + public Provenance() { + super(); + } + + /* + * Constructor + */ + public Provenance(InstantType recorded) { + super(); + this.recorded = recorded; + } + + /** + * @return {@link #target} (The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.) + */ + public List getTarget() { + if (this.target == null) + this.target = new ArrayList(); + return this.target; + } + + public boolean hasTarget() { + if (this.target == null) + return false; + for (Reference item : this.target) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #target} (The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.) + */ + // syntactic sugar + public Reference addTarget() { //3 + Reference t = new Reference(); + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return t; + } + + // syntactic sugar + public Provenance addTarget(Reference t) { //3 + if (t == null) + return this; + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return this; + } + + /** + * @return {@link #target} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.) + */ + public List getTargetTarget() { + if (this.targetTarget == null) + this.targetTarget = new ArrayList(); + return this.targetTarget; + } + + /** + * @return {@link #period} (The period during which the activity occurred.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Provenance.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period during which the activity occurred.) + */ + public Provenance setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #recorded} (The instant of time at which the activity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value + */ + public InstantType getRecordedElement() { + if (this.recorded == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Provenance.recorded"); + else if (Configuration.doAutoCreate()) + this.recorded = new InstantType(); // bb + return this.recorded; + } + + public boolean hasRecordedElement() { + return this.recorded != null && !this.recorded.isEmpty(); + } + + public boolean hasRecorded() { + return this.recorded != null && !this.recorded.isEmpty(); + } + + /** + * @param value {@link #recorded} (The instant of time at which the activity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value + */ + public Provenance setRecordedElement(InstantType value) { + this.recorded = value; + return this; + } + + /** + * @return The instant of time at which the activity was recorded. + */ + public Date getRecorded() { + return this.recorded == null ? null : this.recorded.getValue(); + } + + /** + * @param value The instant of time at which the activity was recorded. + */ + public Provenance setRecorded(Date value) { + if (this.recorded == null) + this.recorded = new InstantType(); + this.recorded.setValue(value); + return this; + } + + /** + * @return {@link #reason} (The reason that the activity was taking place.) + */ + public CodeableConcept getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Provenance.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new CodeableConcept(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (The reason that the activity was taking place.) + */ + public Provenance setReason(CodeableConcept value) { + this.reason = value; + return this; + } + + /** + * @return {@link #location} (Where the activity occurred, if relevant.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Provenance.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); // cc + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (Where the activity occurred, if relevant.) + */ + public Provenance setLocation(Reference value) { + this.location = value; + return this; + } + + /** + * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Where the activity occurred, if relevant.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Provenance.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); // aa + return this.locationTarget; + } + + /** + * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Where the activity occurred, if relevant.) + */ + public Provenance setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.) + */ + public List getPolicy() { + if (this.policy == null) + this.policy = new ArrayList(); + return this.policy; + } + + public boolean hasPolicy() { + if (this.policy == null) + return false; + for (UriType item : this.policy) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.) + */ + // syntactic sugar + public UriType addPolicyElement() {//2 + UriType t = new UriType(); + if (this.policy == null) + this.policy = new ArrayList(); + this.policy.add(t); + return t; + } + + /** + * @param value {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.) + */ + public Provenance addPolicy(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.policy == null) + this.policy = new ArrayList(); + this.policy.add(t); + return this; + } + + /** + * @param value {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.) + */ + public boolean hasPolicy(String value) { + if (this.policy == null) + return false; + for (UriType v : this.policy) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #agent} (An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, an organization, software, or other entities that may be ascribed responsibility.) + */ + public List getAgent() { + if (this.agent == null) + this.agent = new ArrayList(); + return this.agent; + } + + public boolean hasAgent() { + if (this.agent == null) + return false; + for (ProvenanceAgentComponent item : this.agent) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #agent} (An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, an organization, software, or other entities that may be ascribed responsibility.) + */ + // syntactic sugar + public ProvenanceAgentComponent addAgent() { //3 + ProvenanceAgentComponent t = new ProvenanceAgentComponent(); + if (this.agent == null) + this.agent = new ArrayList(); + this.agent.add(t); + return t; + } + + // syntactic sugar + public Provenance addAgent(ProvenanceAgentComponent t) { //3 + if (t == null) + return this; + if (this.agent == null) + this.agent = new ArrayList(); + this.agent.add(t); + return this; + } + + /** + * @return {@link #entity} (An entity used in this activity.) + */ + public List getEntity() { + if (this.entity == null) + this.entity = new ArrayList(); + return this.entity; + } + + public boolean hasEntity() { + if (this.entity == null) + return false; + for (ProvenanceEntityComponent item : this.entity) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #entity} (An entity used in this activity.) + */ + // syntactic sugar + public ProvenanceEntityComponent addEntity() { //3 + ProvenanceEntityComponent t = new ProvenanceEntityComponent(); + if (this.entity == null) + this.entity = new ArrayList(); + this.entity.add(t); + return t; + } + + // syntactic sugar + public Provenance addEntity(ProvenanceEntityComponent t) { //3 + if (t == null) + return this; + if (this.entity == null) + this.entity = new ArrayList(); + this.entity.add(t); + return this; + } + + /** + * @return {@link #signature} (A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.) + */ + public List getSignature() { + if (this.signature == null) + this.signature = new ArrayList(); + return this.signature; + } + + public boolean hasSignature() { + if (this.signature == null) + return false; + for (Signature item : this.signature) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #signature} (A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.) + */ + // syntactic sugar + public Signature addSignature() { //3 + Signature t = new Signature(); + if (this.signature == null) + this.signature = new ArrayList(); + this.signature.add(t); + return t; + } + + // syntactic sugar + public Provenance addSignature(Signature t) { //3 + if (t == null) + return this; + if (this.signature == null) + this.signature = new ArrayList(); + this.signature.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("target", "Reference(Any)", "The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("period", "Period", "The period during which the activity occurred.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("recorded", "instant", "The instant of time at which the activity was recorded.", 0, java.lang.Integer.MAX_VALUE, recorded)); + childrenList.add(new Property("reason", "CodeableConcept", "The reason that the activity was taking place.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("location", "Reference(Location)", "Where the activity occurred, if relevant.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("policy", "uri", "Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.", 0, java.lang.Integer.MAX_VALUE, policy)); + childrenList.add(new Property("agent", "", "An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, an organization, software, or other entities that may be ascribed responsibility.", 0, java.lang.Integer.MAX_VALUE, agent)); + childrenList.add(new Property("entity", "", "An entity used in this activity.", 0, java.lang.Integer.MAX_VALUE, entity)); + childrenList.add(new Property("signature", "Signature", "A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.", 0, java.lang.Integer.MAX_VALUE, signature)); + } + + public Provenance copy() { + Provenance dst = new Provenance(); + copyValues(dst); + if (target != null) { + dst.target = new ArrayList(); + for (Reference i : target) + dst.target.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + dst.recorded = recorded == null ? null : recorded.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.location = location == null ? null : location.copy(); + if (policy != null) { + dst.policy = new ArrayList(); + for (UriType i : policy) + dst.policy.add(i.copy()); + }; + if (agent != null) { + dst.agent = new ArrayList(); + for (ProvenanceAgentComponent i : agent) + dst.agent.add(i.copy()); + }; + if (entity != null) { + dst.entity = new ArrayList(); + for (ProvenanceEntityComponent i : entity) + dst.entity.add(i.copy()); + }; + if (signature != null) { + dst.signature = new ArrayList(); + for (Signature i : signature) + dst.signature.add(i.copy()); + }; + return dst; + } + + protected Provenance typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Provenance)) + return false; + Provenance o = (Provenance) other; + return compareDeep(target, o.target, true) && compareDeep(period, o.period, true) && compareDeep(recorded, o.recorded, true) + && compareDeep(reason, o.reason, true) && compareDeep(location, o.location, true) && compareDeep(policy, o.policy, true) + && compareDeep(agent, o.agent, true) && compareDeep(entity, o.entity, true) && compareDeep(signature, o.signature, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Provenance)) + return false; + Provenance o = (Provenance) other; + return compareValues(recorded, o.recorded, true) && compareValues(policy, o.policy, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (target == null || target.isEmpty()) && (period == null || period.isEmpty()) + && (recorded == null || recorded.isEmpty()) && (reason == null || reason.isEmpty()) && (location == null || location.isEmpty()) + && (policy == null || policy.isEmpty()) && (agent == null || agent.isEmpty()) && (entity == null || entity.isEmpty()) + && (signature == null || signature.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Provenance; + } + + @SearchParamDefinition(name="sigtype", path="Provenance.signature.type", description="Indication of the reason the entity signed the object(s)", type="token" ) + public static final String SP_SIGTYPE = "sigtype"; + @SearchParamDefinition(name="patient", path="", description="A patient that the target resource(s) refer to", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="start", path="Provenance.period.start", description="Starting time with inclusive boundary", type="date" ) + public static final String SP_START = "start"; + @SearchParamDefinition(name="end", path="Provenance.period.end", description="End time with inclusive boundary, if not ongoing", type="date" ) + public static final String SP_END = "end"; + @SearchParamDefinition(name="location", path="Provenance.location", description="Where the activity occurred, if relevant", type="reference" ) + public static final String SP_LOCATION = "location"; + @SearchParamDefinition(name="partytype", path="Provenance.agent.type", description="Agent Type", type="token" ) + public static final String SP_PARTYTYPE = "partytype"; + @SearchParamDefinition(name="party", path="Provenance.agent.reference[x]", description="Identity of agent", type="reference" ) + public static final String SP_PARTY = "party"; + @SearchParamDefinition(name="target", path="Provenance.target", description="Target Reference(s) (usually version specific)", type="reference" ) + public static final String SP_TARGET = "target"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Quantity.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Quantity.java index e4d956ca55b..d1c23f0e6e4 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Quantity.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Quantity.java @@ -1,513 +1,492 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import java.util.*; - -import java.math.*; -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; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. - */ -@DatatypeDef(name="Quantity") -public class Quantity extends Type implements ICompositeType { - - public enum QuantityComparator { - /** - * The actual value is less than the given value. - */ - LESS_THAN, - /** - * The actual value is less than or equal to the given value. - */ - LESS_OR_EQUAL, - /** - * The actual value is greater than or equal to the given value. - */ - GREATER_OR_EQUAL, - /** - * The actual value is greater than the given value. - */ - GREATER_THAN, - /** - * added to help the parsers - */ - NULL; - public static QuantityComparator fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("<".equals(codeString)) - return LESS_THAN; - if ("<=".equals(codeString)) - return LESS_OR_EQUAL; - if (">=".equals(codeString)) - return GREATER_OR_EQUAL; - if (">".equals(codeString)) - return GREATER_THAN; - throw new Exception("Unknown QuantityComparator code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case LESS_THAN: return "<"; - case LESS_OR_EQUAL: return "<="; - case GREATER_OR_EQUAL: return ">="; - case GREATER_THAN: return ">"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case LESS_THAN: return ""; - case LESS_OR_EQUAL: return ""; - case GREATER_OR_EQUAL: return ""; - case GREATER_THAN: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case LESS_THAN: return "The actual value is less than the given value."; - case LESS_OR_EQUAL: return "The actual value is less than or equal to the given value."; - case GREATER_OR_EQUAL: return "The actual value is greater than or equal to the given value."; - case GREATER_THAN: return "The actual value is greater than the given value."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case LESS_THAN: return " "; - case LESS_OR_EQUAL: return " "; - case GREATER_OR_EQUAL: return " "; - case GREATER_THAN: return " "; - default: return "?"; - } - } - } - - public static class QuantityComparatorEnumFactory implements EnumFactory { - public QuantityComparator fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("<".equals(codeString)) - return QuantityComparator.LESS_THAN; - if ("<=".equals(codeString)) - return QuantityComparator.LESS_OR_EQUAL; - if (">=".equals(codeString)) - return QuantityComparator.GREATER_OR_EQUAL; - if (">".equals(codeString)) - return QuantityComparator.GREATER_THAN; - throw new IllegalArgumentException("Unknown QuantityComparator code '"+codeString+"'"); - } - public String toCode(QuantityComparator code) { - if (code == QuantityComparator.LESS_THAN) - return "<"; - if (code == QuantityComparator.LESS_OR_EQUAL) - return "<="; - if (code == QuantityComparator.GREATER_OR_EQUAL) - return ">="; - if (code == QuantityComparator.GREATER_THAN) - return ">"; - return "?"; - } - } - - /** - * The value of the measured amount. The value includes an implicit precision in the presentation of the value. - */ - @Child(name = "value", type = {DecimalType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Numerical value (with implicit precision)", formalDefinition="The value of the measured amount. The value includes an implicit precision in the presentation of the value." ) - protected DecimalType value; - - /** - * How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value. - */ - @Child(name = "comparator", type = {CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="< | <= | >= | > - how to understand the value", formalDefinition="How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is '<' , then the real value is < stated value." ) - protected Enumeration comparator; - - /** - * A human-readable form of the units. - */ - @Child(name = "units", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Unit representation", formalDefinition="A human-readable form of the units." ) - protected StringType units; - - /** - * The identification of the system that provides the coded form of the unit. - */ - @Child(name = "system", type = {UriType.class}, order=3, min=0, max=1) - @Description(shortDefinition="System that defines coded unit form", formalDefinition="The identification of the system that provides the coded form of the unit." ) - protected UriType system; - - /** - * A computer processable form of the units in some unit representation system. - */ - @Child(name = "code", type = {CodeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Coded form of the unit", formalDefinition="A computer processable form of the units in some unit representation system." ) - protected CodeType code; - - private static final long serialVersionUID = -483422721L; - - /* - * Constructor - */ - public Quantity() { - super(); - } - - /** - * @return {@link #value} (The value of the measured amount. The value includes an implicit precision in the presentation of the value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Quantity.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value of the measured amount. The value includes an implicit precision in the presentation of the value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public Quantity setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return The value of the measured amount. The value includes an implicit precision in the presentation of the value. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The value of the measured amount. The value includes an implicit precision in the presentation of the value. - */ - public Quantity setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - /** - * @return {@link #comparator} (How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value.). This is the underlying object with id, value and extensions. The accessor "getComparator" gives direct access to the value - */ - public Enumeration getComparatorElement() { - if (this.comparator == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Quantity.comparator"); - else if (Configuration.doAutoCreate()) - this.comparator = new Enumeration(new QuantityComparatorEnumFactory()); // bb - return this.comparator; - } - - public boolean hasComparatorElement() { - return this.comparator != null && !this.comparator.isEmpty(); - } - - public boolean hasComparator() { - return this.comparator != null && !this.comparator.isEmpty(); - } - - /** - * @param value {@link #comparator} (How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value.). This is the underlying object with id, value and extensions. The accessor "getComparator" gives direct access to the value - */ - public Quantity setComparatorElement(Enumeration value) { - this.comparator = value; - return this; - } - - /** - * @return How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value. - */ - public QuantityComparator getComparator() { - return this.comparator == null ? null : this.comparator.getValue(); - } - - /** - * @param value How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value. - */ - public Quantity setComparator(QuantityComparator value) { - if (value == null) - this.comparator = null; - else { - if (this.comparator == null) - this.comparator = new Enumeration(new QuantityComparatorEnumFactory()); - this.comparator.setValue(value); - } - return this; - } - - /** - * @return {@link #units} (A human-readable form of the units.). This is the underlying object with id, value and extensions. The accessor "getUnits" gives direct access to the value - */ - public StringType getUnitsElement() { - if (this.units == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Quantity.units"); - else if (Configuration.doAutoCreate()) - this.units = new StringType(); // bb - return this.units; - } - - public boolean hasUnitsElement() { - return this.units != null && !this.units.isEmpty(); - } - - public boolean hasUnits() { - return this.units != null && !this.units.isEmpty(); - } - - /** - * @param value {@link #units} (A human-readable form of the units.). This is the underlying object with id, value and extensions. The accessor "getUnits" gives direct access to the value - */ - public Quantity setUnitsElement(StringType value) { - this.units = value; - return this; - } - - /** - * @return A human-readable form of the units. - */ - public String getUnits() { - return this.units == null ? null : this.units.getValue(); - } - - /** - * @param value A human-readable form of the units. - */ - public Quantity setUnits(String value) { - if (Utilities.noString(value)) - this.units = null; - else { - if (this.units == null) - this.units = new StringType(); - this.units.setValue(value); - } - return this; - } - - /** - * @return {@link #system} (The identification of the system that provides the coded form of the unit.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public UriType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Quantity.system"); - else if (Configuration.doAutoCreate()) - this.system = new UriType(); // bb - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (The identification of the system that provides the coded form of the unit.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public Quantity setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return The identification of the system that provides the coded form of the unit. - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value The identification of the system that provides the coded form of the unit. - */ - public Quantity setSystem(String value) { - if (Utilities.noString(value)) - this.system = null; - else { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (A computer processable form of the units in some unit representation system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Quantity.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A computer processable form of the units in some unit representation system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Quantity setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return A computer processable form of the units in some unit representation system. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value A computer processable form of the units in some unit representation system. - */ - public Quantity setCode(String value) { - if (Utilities.noString(value)) - this.code = null; - else { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("value", "decimal", "The value of the measured amount. The value includes an implicit precision in the presentation of the value.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("comparator", "code", "How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is '<' , then the real value is < stated value.", 0, java.lang.Integer.MAX_VALUE, comparator)); - childrenList.add(new Property("units", "string", "A human-readable form of the units.", 0, java.lang.Integer.MAX_VALUE, units)); - childrenList.add(new Property("system", "uri", "The identification of the system that provides the coded form of the unit.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("code", "code", "A computer processable form of the units in some unit representation system.", 0, java.lang.Integer.MAX_VALUE, code)); - } - - public Quantity copy() { - Quantity dst = new Quantity(); - 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 Quantity typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Quantity)) - return false; - Quantity o = (Quantity) other; - return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(units, o.units, true) - && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Quantity)) - return false; - Quantity o = (Quantity) other; - return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(units, o.units, true) - && compareValues(system, o.system, true) && compareValues(code, o.code, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) - && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import java.util.*; + +import java.math.*; +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; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. + */ +@DatatypeDef(name="Quantity") +public class Quantity extends Type implements ICompositeType { + + public enum QuantityComparator { + /** + * The actual value is less than the given value. + */ + LESS_THAN, + /** + * The actual value is less than or equal to the given value. + */ + LESS_OR_EQUAL, + /** + * The actual value is greater than or equal to the given value. + */ + GREATER_OR_EQUAL, + /** + * The actual value is greater than the given value. + */ + GREATER_THAN, + /** + * added to help the parsers + */ + NULL; + public static QuantityComparator fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("<".equals(codeString)) + return LESS_THAN; + if ("<=".equals(codeString)) + return LESS_OR_EQUAL; + if (">=".equals(codeString)) + return GREATER_OR_EQUAL; + if (">".equals(codeString)) + return GREATER_THAN; + throw new Exception("Unknown QuantityComparator code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case LESS_THAN: return "<"; + case LESS_OR_EQUAL: return "<="; + case GREATER_OR_EQUAL: return ">="; + case GREATER_THAN: return ">"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case LESS_THAN: return ""; + case LESS_OR_EQUAL: return ""; + case GREATER_OR_EQUAL: return ""; + case GREATER_THAN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case LESS_THAN: return "The actual value is less than the given value."; + case LESS_OR_EQUAL: return "The actual value is less than or equal to the given value."; + case GREATER_OR_EQUAL: return "The actual value is greater than or equal to the given value."; + case GREATER_THAN: return "The actual value is greater than the given value."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case LESS_THAN: return " "; + case LESS_OR_EQUAL: return " "; + case GREATER_OR_EQUAL: return " "; + case GREATER_THAN: return " "; + default: return "?"; + } + } + } + + public static class QuantityComparatorEnumFactory implements EnumFactory { + public QuantityComparator fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("<".equals(codeString)) + return QuantityComparator.LESS_THAN; + if ("<=".equals(codeString)) + return QuantityComparator.LESS_OR_EQUAL; + if (">=".equals(codeString)) + return QuantityComparator.GREATER_OR_EQUAL; + if (">".equals(codeString)) + return QuantityComparator.GREATER_THAN; + throw new IllegalArgumentException("Unknown QuantityComparator code '"+codeString+"'"); + } + public String toCode(QuantityComparator code) { + if (code == QuantityComparator.LESS_THAN) + return "<"; + if (code == QuantityComparator.LESS_OR_EQUAL) + return "<="; + if (code == QuantityComparator.GREATER_OR_EQUAL) + return ">="; + if (code == QuantityComparator.GREATER_THAN) + return ">"; + return "?"; + } + } + + /** + * The value of the measured amount. The value includes an implicit precision in the presentation of the value. + */ + @Child(name = "value", type = {DecimalType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Numerical value (with implicit precision)", formalDefinition="The value of the measured amount. The value includes an implicit precision in the presentation of the value." ) + protected DecimalType value; + + /** + * How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value. + */ + @Child(name = "comparator", type = {CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="< | <= | >= | > - how to understand the value", formalDefinition="How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is '<' , then the real value is < stated value." ) + protected Enumeration comparator; + + /** + * A human-readable form of the units. + */ + @Child(name = "units", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Unit representation", formalDefinition="A human-readable form of the units." ) + protected StringType units; + + /** + * The identification of the system that provides the coded form of the unit. + */ + @Child(name = "system", type = {UriType.class}, order=3, min=0, max=1) + @Description(shortDefinition="System that defines coded unit form", formalDefinition="The identification of the system that provides the coded form of the unit." ) + protected UriType system; + + /** + * A computer processable form of the units in some unit representation system. + */ + @Child(name = "code", type = {CodeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Coded form of the unit", formalDefinition="A computer processable form of the units in some unit representation system." ) + protected CodeType code; + + private static final long serialVersionUID = -483422721L; + + /* + * Constructor + */ + public Quantity() { + super(); + } + + /** + * @return {@link #value} (The value of the measured amount. The value includes an implicit precision in the presentation of the value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Quantity.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value of the measured amount. The value includes an implicit precision in the presentation of the value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public Quantity setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return The value of the measured amount. The value includes an implicit precision in the presentation of the value. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The value of the measured amount. The value includes an implicit precision in the presentation of the value. + */ + public Quantity setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + /** + * @return {@link #comparator} (How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value.). This is the underlying object with id, value and extensions. The accessor "getComparator" gives direct access to the value + */ + public Enumeration getComparatorElement() { + if (this.comparator == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Quantity.comparator"); + else if (Configuration.doAutoCreate()) + this.comparator = new Enumeration(new QuantityComparatorEnumFactory()); // bb + return this.comparator; + } + + public boolean hasComparatorElement() { + return this.comparator != null && !this.comparator.isEmpty(); + } + + public boolean hasComparator() { + return this.comparator != null && !this.comparator.isEmpty(); + } + + /** + * @param value {@link #comparator} (How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value.). This is the underlying object with id, value and extensions. The accessor "getComparator" gives direct access to the value + */ + public Quantity setComparatorElement(Enumeration value) { + this.comparator = value; + return this; + } + + /** + * @return How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value. + */ + public QuantityComparator getComparator() { + return this.comparator == null ? null : this.comparator.getValue(); + } + + /** + * @param value How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value. + */ + public Quantity setComparator(QuantityComparator value) { + if (value == null) + this.comparator = null; + else { + if (this.comparator == null) + this.comparator = new Enumeration(new QuantityComparatorEnumFactory()); + this.comparator.setValue(value); + } + return this; + } + + /** + * @return {@link #units} (A human-readable form of the units.). This is the underlying object with id, value and extensions. The accessor "getUnits" gives direct access to the value + */ + public StringType getUnitsElement() { + if (this.units == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Quantity.units"); + else if (Configuration.doAutoCreate()) + this.units = new StringType(); // bb + return this.units; + } + + public boolean hasUnitsElement() { + return this.units != null && !this.units.isEmpty(); + } + + public boolean hasUnits() { + return this.units != null && !this.units.isEmpty(); + } + + /** + * @param value {@link #units} (A human-readable form of the units.). This is the underlying object with id, value and extensions. The accessor "getUnits" gives direct access to the value + */ + public Quantity setUnitsElement(StringType value) { + this.units = value; + return this; + } + + /** + * @return A human-readable form of the units. + */ + public String getUnits() { + return this.units == null ? null : this.units.getValue(); + } + + /** + * @param value A human-readable form of the units. + */ + public Quantity setUnits(String value) { + if (Utilities.noString(value)) + this.units = null; + else { + if (this.units == null) + this.units = new StringType(); + this.units.setValue(value); + } + return this; + } + + /** + * @return {@link #system} (The identification of the system that provides the coded form of the unit.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public UriType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Quantity.system"); + else if (Configuration.doAutoCreate()) + this.system = new UriType(); // bb + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (The identification of the system that provides the coded form of the unit.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public Quantity setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return The identification of the system that provides the coded form of the unit. + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value The identification of the system that provides the coded form of the unit. + */ + public Quantity setSystem(String value) { + if (Utilities.noString(value)) + this.system = null; + else { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (A computer processable form of the units in some unit representation system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Quantity.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A computer processable form of the units in some unit representation system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Quantity setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return A computer processable form of the units in some unit representation system. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value A computer processable form of the units in some unit representation system. + */ + public Quantity setCode(String value) { + if (Utilities.noString(value)) + this.code = null; + else { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("value", "decimal", "The value of the measured amount. The value includes an implicit precision in the presentation of the value.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("comparator", "code", "How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is '<' , then the real value is < stated value.", 0, java.lang.Integer.MAX_VALUE, comparator)); + childrenList.add(new Property("units", "string", "A human-readable form of the units.", 0, java.lang.Integer.MAX_VALUE, units)); + childrenList.add(new Property("system", "uri", "The identification of the system that provides the coded form of the unit.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("code", "code", "A computer processable form of the units in some unit representation system.", 0, java.lang.Integer.MAX_VALUE, code)); + } + + public Quantity copy() { + Quantity dst = new Quantity(); + 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 Quantity typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Quantity)) + return false; + Quantity o = (Quantity) other; + return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(units, o.units, true) + && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Quantity)) + return false; + Quantity o = (Quantity) other; + return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(units, o.units, true) + && compareValues(system, o.system, true) && compareValues(code, o.code, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) + && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Questionnaire.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Questionnaire.java index f36483b224c..356c64d0a76 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Questionnaire.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Questionnaire.java @@ -1,1852 +1,1831 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. - */ -@ResourceDef(name="Questionnaire", profile="http://hl7.org/fhir/Profile/Questionnaire") -public class Questionnaire extends DomainResource { - - public enum QuestionnaireStatus { - /** - * This Questionnaire is not ready for official use. - */ - DRAFT, - /** - * This Questionnaire is ready for use. - */ - PUBLISHED, - /** - * This Questionnaire should no longer be used to gather data. - */ - RETIRED, - /** - * added to help the parsers - */ - NULL; - public static QuestionnaireStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return DRAFT; - if ("published".equals(codeString)) - return PUBLISHED; - if ("retired".equals(codeString)) - return RETIRED; - throw new Exception("Unknown QuestionnaireStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case DRAFT: return "draft"; - case PUBLISHED: return "published"; - case RETIRED: return "retired"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DRAFT: return ""; - case PUBLISHED: return ""; - case RETIRED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DRAFT: return "This Questionnaire is not ready for official use."; - case PUBLISHED: return "This Questionnaire is ready for use."; - case RETIRED: return "This Questionnaire should no longer be used to gather data."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DRAFT: return "draft"; - case PUBLISHED: return "published"; - case RETIRED: return "retired"; - default: return "?"; - } - } - } - - public static class QuestionnaireStatusEnumFactory implements EnumFactory { - public QuestionnaireStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return QuestionnaireStatus.DRAFT; - if ("published".equals(codeString)) - return QuestionnaireStatus.PUBLISHED; - if ("retired".equals(codeString)) - return QuestionnaireStatus.RETIRED; - throw new IllegalArgumentException("Unknown QuestionnaireStatus code '"+codeString+"'"); - } - public String toCode(QuestionnaireStatus code) { - if (code == QuestionnaireStatus.DRAFT) - return "draft"; - if (code == QuestionnaireStatus.PUBLISHED) - return "published"; - if (code == QuestionnaireStatus.RETIRED) - return "retired"; - return "?"; - } - } - - public enum AnswerFormat { - /** - * Answer is a yes/no answer. - */ - BOOLEAN, - /** - * Answer is a floating point number. - */ - DECIMAL, - /** - * Answer is an integer. - */ - INTEGER, - /** - * Answer is a date. - */ - DATE, - /** - * Answer is a date and time. - */ - DATETIME, - /** - * Answer is a system timestamp. - */ - INSTANT, - /** - * Answer is a time independent of date. - */ - TIME, - /** - * Answer is a short (few words to short sentence) free-text entry. - */ - STRING, - /** - * Answer is a long (potentially multi-paragram) free-text entry. - */ - TEXT, - /** - * Answer is a url (website, FTP site, etc.). - */ - URL, - /** - * Answer is a choice from a list of options. - */ - CHOICE, - /** - * Answer is a choice from a list of options or a free-text entry. - */ - OPENCHOICE, - /** - * Answer is binary content such as a image, PDF, etc. - */ - ATTACHMENT, - /** - * Answer is a reference to another resource (practitioner, organization, etc.). - */ - REFERENCE, - /** - * Answer is a combination of a numeric value and unit. - */ - QUANTITY, - /** - * added to help the parsers - */ - NULL; - public static AnswerFormat fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("boolean".equals(codeString)) - return BOOLEAN; - if ("decimal".equals(codeString)) - return DECIMAL; - if ("integer".equals(codeString)) - return INTEGER; - if ("date".equals(codeString)) - return DATE; - if ("dateTime".equals(codeString)) - return DATETIME; - if ("instant".equals(codeString)) - return INSTANT; - if ("time".equals(codeString)) - return TIME; - if ("string".equals(codeString)) - return STRING; - if ("text".equals(codeString)) - return TEXT; - if ("url".equals(codeString)) - return URL; - if ("choice".equals(codeString)) - return CHOICE; - if ("open-choice".equals(codeString)) - return OPENCHOICE; - if ("attachment".equals(codeString)) - return ATTACHMENT; - if ("reference".equals(codeString)) - return REFERENCE; - if ("quantity".equals(codeString)) - return QUANTITY; - throw new Exception("Unknown AnswerFormat code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case BOOLEAN: return "boolean"; - case DECIMAL: return "decimal"; - case INTEGER: return "integer"; - case DATE: return "date"; - case DATETIME: return "dateTime"; - case INSTANT: return "instant"; - case TIME: return "time"; - case STRING: return "string"; - case TEXT: return "text"; - case URL: return "url"; - case CHOICE: return "choice"; - case OPENCHOICE: return "open-choice"; - case ATTACHMENT: return "attachment"; - case REFERENCE: return "reference"; - case QUANTITY: return "quantity"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case BOOLEAN: return ""; - case DECIMAL: return ""; - case INTEGER: return ""; - case DATE: return ""; - case DATETIME: return ""; - case INSTANT: return ""; - case TIME: return ""; - case STRING: return ""; - case TEXT: return ""; - case URL: return ""; - case CHOICE: return ""; - case OPENCHOICE: return ""; - case ATTACHMENT: return ""; - case REFERENCE: return ""; - case QUANTITY: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case BOOLEAN: return "Answer is a yes/no answer."; - case DECIMAL: return "Answer is a floating point number."; - case INTEGER: return "Answer is an integer."; - case DATE: return "Answer is a date."; - case DATETIME: return "Answer is a date and time."; - case INSTANT: return "Answer is a system timestamp."; - case TIME: return "Answer is a time independent of date."; - case STRING: return "Answer is a short (few words to short sentence) free-text entry."; - case TEXT: return "Answer is a long (potentially multi-paragram) free-text entry."; - case URL: return "Answer is a url (website, FTP site, etc.)."; - case CHOICE: return "Answer is a choice from a list of options."; - case OPENCHOICE: return "Answer is a choice from a list of options or a free-text entry."; - case ATTACHMENT: return "Answer is binary content such as a image, PDF, etc."; - case REFERENCE: return "Answer is a reference to another resource (practitioner, organization, etc.)."; - case QUANTITY: return "Answer is a combination of a numeric value and unit."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case BOOLEAN: return "Boolean"; - case DECIMAL: return "Decimal"; - case INTEGER: return "Integer"; - case DATE: return "Date"; - case DATETIME: return "Date Time"; - case INSTANT: return "Instant"; - case TIME: return "Time"; - case STRING: return "String"; - case TEXT: return "Text"; - case URL: return "Url"; - case CHOICE: return "Choice"; - case OPENCHOICE: return "Open Choice"; - case ATTACHMENT: return "Attachment"; - case REFERENCE: return "Reference"; - case QUANTITY: return "Quantity"; - default: return "?"; - } - } - } - - public static class AnswerFormatEnumFactory implements EnumFactory { - public AnswerFormat fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("boolean".equals(codeString)) - return AnswerFormat.BOOLEAN; - if ("decimal".equals(codeString)) - return AnswerFormat.DECIMAL; - if ("integer".equals(codeString)) - return AnswerFormat.INTEGER; - if ("date".equals(codeString)) - return AnswerFormat.DATE; - if ("dateTime".equals(codeString)) - return AnswerFormat.DATETIME; - if ("instant".equals(codeString)) - return AnswerFormat.INSTANT; - if ("time".equals(codeString)) - return AnswerFormat.TIME; - if ("string".equals(codeString)) - return AnswerFormat.STRING; - if ("text".equals(codeString)) - return AnswerFormat.TEXT; - if ("url".equals(codeString)) - return AnswerFormat.URL; - if ("choice".equals(codeString)) - return AnswerFormat.CHOICE; - if ("open-choice".equals(codeString)) - return AnswerFormat.OPENCHOICE; - if ("attachment".equals(codeString)) - return AnswerFormat.ATTACHMENT; - if ("reference".equals(codeString)) - return AnswerFormat.REFERENCE; - if ("quantity".equals(codeString)) - return AnswerFormat.QUANTITY; - throw new IllegalArgumentException("Unknown AnswerFormat code '"+codeString+"'"); - } - public String toCode(AnswerFormat code) { - if (code == AnswerFormat.BOOLEAN) - return "boolean"; - if (code == AnswerFormat.DECIMAL) - return "decimal"; - if (code == AnswerFormat.INTEGER) - return "integer"; - if (code == AnswerFormat.DATE) - return "date"; - if (code == AnswerFormat.DATETIME) - return "dateTime"; - if (code == AnswerFormat.INSTANT) - return "instant"; - if (code == AnswerFormat.TIME) - return "time"; - if (code == AnswerFormat.STRING) - return "string"; - if (code == AnswerFormat.TEXT) - return "text"; - if (code == AnswerFormat.URL) - return "url"; - if (code == AnswerFormat.CHOICE) - return "choice"; - if (code == AnswerFormat.OPENCHOICE) - return "open-choice"; - if (code == AnswerFormat.ATTACHMENT) - return "attachment"; - if (code == AnswerFormat.REFERENCE) - return "reference"; - if (code == AnswerFormat.QUANTITY) - return "quantity"; - return "?"; - } - } - - @Block() - public static class GroupComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource. - */ - @Child(name = "linkId", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="To link questionnaire with questionnaire answers", formalDefinition="An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource." ) - protected StringType linkId; - - /** - * The human-readable name for this section of the questionnaire. - */ - @Child(name = "title", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Name to be displayed for group", formalDefinition="The human-readable name for this section of the questionnaire." ) - protected StringType title; - - /** - * Identifies a how this group of questions is known in a particular terminology such as LOINC. - */ - @Child(name = "concept", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Concept that represents this section on a questionnaire", formalDefinition="Identifies a how this group of questions is known in a particular terminology such as LOINC." ) - protected List concept; - - /** - * Additional text for the group, used for display purposes. - */ - @Child(name = "text", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Additional text for the group", formalDefinition="Additional text for the group, used for display purposes." ) - protected StringType text; - - /** - * If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire. - */ - @Child(name = "required", type = {BooleanType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Must group be included in data results?", formalDefinition="If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire." ) - protected BooleanType required; - - /** - * Whether the group may occur multiple times in the instance, containing multiple sets of answers. - */ - @Child(name = "repeats", type = {BooleanType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Whether the group may repeat", formalDefinition="Whether the group may occur multiple times in the instance, containing multiple sets of answers." ) - protected BooleanType repeats; - - /** - * A sub-group within a group. The ordering of groups within this group is relevant. - */ - @Child(name = "group", type = {GroupComponent.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Nested questionnaire group", formalDefinition="A sub-group within a group. The ordering of groups within this group is relevant." ) - protected List group; - - /** - * Set of questions within this group. The order of questions within the group is relevant. - */ - @Child(name = "question", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Questions in this group", formalDefinition="Set of questions within this group. The order of questions within the group is relevant." ) - protected List question; - - private static final long serialVersionUID = 494129548L; - - /* - * Constructor - */ - public GroupComponent() { - super(); - } - - /** - * @return {@link #linkId} (An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public StringType getLinkIdElement() { - if (this.linkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupComponent.linkId"); - else if (Configuration.doAutoCreate()) - this.linkId = new StringType(); // bb - return this.linkId; - } - - public boolean hasLinkIdElement() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - public boolean hasLinkId() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - /** - * @param value {@link #linkId} (An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public GroupComponent setLinkIdElement(StringType value) { - this.linkId = value; - return this; - } - - /** - * @return An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource. - */ - public String getLinkId() { - return this.linkId == null ? null : this.linkId.getValue(); - } - - /** - * @param value An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource. - */ - public GroupComponent setLinkId(String value) { - if (Utilities.noString(value)) - this.linkId = null; - else { - if (this.linkId == null) - this.linkId = new StringType(); - this.linkId.setValue(value); - } - return this; - } - - /** - * @return {@link #title} (The human-readable name for this section of the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupComponent.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); // bb - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (The human-readable name for this section of the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public GroupComponent setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return The human-readable name for this section of the questionnaire. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value The human-readable name for this section of the questionnaire. - */ - public GroupComponent setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #concept} (Identifies a how this group of questions is known in a particular terminology such as LOINC.) - */ - public List getConcept() { - if (this.concept == null) - this.concept = new ArrayList(); - return this.concept; - } - - public boolean hasConcept() { - if (this.concept == null) - return false; - for (Coding item : this.concept) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #concept} (Identifies a how this group of questions is known in a particular terminology such as LOINC.) - */ - // syntactic sugar - public Coding addConcept() { //3 - Coding t = new Coding(); - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return t; - } - - // syntactic sugar - public GroupComponent addConcept(Coding t) { //3 - if (t == null) - return this; - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return this; - } - - /** - * @return {@link #text} (Additional text for the group, used for display purposes.). 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 GroupComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (Additional text for the group, used for display purposes.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public GroupComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return Additional text for the group, used for display purposes. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value Additional text for the group, used for display purposes. - */ - public GroupComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #required} (If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value - */ - public BooleanType getRequiredElement() { - if (this.required == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupComponent.required"); - else if (Configuration.doAutoCreate()) - this.required = new BooleanType(); // bb - return this.required; - } - - public boolean hasRequiredElement() { - return this.required != null && !this.required.isEmpty(); - } - - public boolean hasRequired() { - return this.required != null && !this.required.isEmpty(); - } - - /** - * @param value {@link #required} (If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value - */ - public GroupComponent setRequiredElement(BooleanType value) { - this.required = value; - return this; - } - - /** - * @return If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire. - */ - public boolean getRequired() { - return this.required == null || this.required.isEmpty() ? false : this.required.getValue(); - } - - /** - * @param value If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire. - */ - public GroupComponent setRequired(boolean value) { - if (this.required == null) - this.required = new BooleanType(); - this.required.setValue(value); - return this; - } - - /** - * @return {@link #repeats} (Whether the group may occur multiple times in the instance, containing multiple sets of answers.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value - */ - public BooleanType getRepeatsElement() { - if (this.repeats == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupComponent.repeats"); - else if (Configuration.doAutoCreate()) - this.repeats = new BooleanType(); // bb - return this.repeats; - } - - public boolean hasRepeatsElement() { - return this.repeats != null && !this.repeats.isEmpty(); - } - - public boolean hasRepeats() { - return this.repeats != null && !this.repeats.isEmpty(); - } - - /** - * @param value {@link #repeats} (Whether the group may occur multiple times in the instance, containing multiple sets of answers.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value - */ - public GroupComponent setRepeatsElement(BooleanType value) { - this.repeats = value; - return this; - } - - /** - * @return Whether the group may occur multiple times in the instance, containing multiple sets of answers. - */ - public boolean getRepeats() { - return this.repeats == null || this.repeats.isEmpty() ? false : this.repeats.getValue(); - } - - /** - * @param value Whether the group may occur multiple times in the instance, containing multiple sets of answers. - */ - public GroupComponent setRepeats(boolean value) { - if (this.repeats == null) - this.repeats = new BooleanType(); - this.repeats.setValue(value); - return this; - } - - /** - * @return {@link #group} (A sub-group within a group. The ordering of groups within this group is relevant.) - */ - public List getGroup() { - if (this.group == null) - this.group = new ArrayList(); - return this.group; - } - - public boolean hasGroup() { - if (this.group == null) - return false; - for (GroupComponent item : this.group) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #group} (A sub-group within a group. The ordering of groups within this group is relevant.) - */ - // syntactic sugar - public GroupComponent addGroup() { //3 - GroupComponent t = new GroupComponent(); - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return t; - } - - // syntactic sugar - public GroupComponent addGroup(GroupComponent t) { //3 - if (t == null) - return this; - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return this; - } - - /** - * @return {@link #question} (Set of questions within this group. The order of questions within the group is relevant.) - */ - public List getQuestion() { - if (this.question == null) - this.question = new ArrayList(); - return this.question; - } - - public boolean hasQuestion() { - if (this.question == null) - return false; - for (QuestionComponent item : this.question) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #question} (Set of questions within this group. The order of questions within the group is relevant.) - */ - // syntactic sugar - public QuestionComponent addQuestion() { //3 - QuestionComponent t = new QuestionComponent(); - if (this.question == null) - this.question = new ArrayList(); - this.question.add(t); - return t; - } - - // syntactic sugar - public GroupComponent addQuestion(QuestionComponent t) { //3 - if (t == null) - return this; - if (this.question == null) - this.question = new ArrayList(); - this.question.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("linkId", "string", "An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource.", 0, java.lang.Integer.MAX_VALUE, linkId)); - childrenList.add(new Property("title", "string", "The human-readable name for this section of the questionnaire.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("concept", "Coding", "Identifies a how this group of questions is known in a particular terminology such as LOINC.", 0, java.lang.Integer.MAX_VALUE, concept)); - childrenList.add(new Property("text", "string", "Additional text for the group, used for display purposes.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("required", "boolean", "If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire.", 0, java.lang.Integer.MAX_VALUE, required)); - childrenList.add(new Property("repeats", "boolean", "Whether the group may occur multiple times in the instance, containing multiple sets of answers.", 0, java.lang.Integer.MAX_VALUE, repeats)); - childrenList.add(new Property("group", "@Questionnaire.group", "A sub-group within a group. The ordering of groups within this group is relevant.", 0, java.lang.Integer.MAX_VALUE, group)); - childrenList.add(new Property("question", "", "Set of questions within this group. The order of questions within the group is relevant.", 0, java.lang.Integer.MAX_VALUE, question)); - } - - public GroupComponent copy() { - GroupComponent dst = new GroupComponent(); - copyValues(dst); - dst.linkId = linkId == null ? null : linkId.copy(); - dst.title = title == null ? null : title.copy(); - if (concept != null) { - dst.concept = new ArrayList(); - for (Coding i : concept) - dst.concept.add(i.copy()); - }; - dst.text = text == null ? null : text.copy(); - dst.required = required == null ? null : required.copy(); - dst.repeats = repeats == null ? null : repeats.copy(); - if (group != null) { - dst.group = new ArrayList(); - for (GroupComponent i : group) - dst.group.add(i.copy()); - }; - if (question != null) { - dst.question = new ArrayList(); - for (QuestionComponent i : question) - dst.question.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof GroupComponent)) - return false; - GroupComponent o = (GroupComponent) other; - return compareDeep(linkId, o.linkId, true) && compareDeep(title, o.title, true) && compareDeep(concept, o.concept, true) - && compareDeep(text, o.text, true) && compareDeep(required, o.required, true) && compareDeep(repeats, o.repeats, true) - && compareDeep(group, o.group, true) && compareDeep(question, o.question, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof GroupComponent)) - return false; - GroupComponent o = (GroupComponent) other; - return compareValues(linkId, o.linkId, true) && compareValues(title, o.title, true) && compareValues(text, o.text, true) - && compareValues(required, o.required, true) && compareValues(repeats, o.repeats, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (title == null || title.isEmpty()) - && (concept == null || concept.isEmpty()) && (text == null || text.isEmpty()) && (required == null || required.isEmpty()) - && (repeats == null || repeats.isEmpty()) && (group == null || group.isEmpty()) && (question == null || question.isEmpty()) - ; - } - - } - - @Block() - public static class QuestionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource. - */ - @Child(name = "linkId", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="To link questionnaire with questionnaire answers", formalDefinition="An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource." ) - protected StringType linkId; - - /** - * Identifies a how this question is known in a particular terminology such as LOINC. - */ - @Child(name = "concept", type = {Coding.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Concept that represents this question on a questionnaire", formalDefinition="Identifies a how this question is known in a particular terminology such as LOINC." ) - protected List concept; - - /** - * The actual question as shown to the user to prompt them for an answer. - */ - @Child(name = "text", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Text of the question as it is shown to the user", formalDefinition="The actual question as shown to the user to prompt them for an answer." ) - protected StringType text; - - /** - * The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected. - */ - @Child(name = "type", type = {CodeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="boolean | decimal | integer | date | dateTime +", formalDefinition="The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected." ) - protected Enumeration type; - - /** - * If true, indicates that the question must be answered and have required groups within it also present. If false, the question and any contained groups may be skipped when answering the questionnaire. - */ - @Child(name = "required", type = {BooleanType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Must question be answered in data results?", formalDefinition="If true, indicates that the question must be answered and have required groups within it also present. If false, the question and any contained groups may be skipped when answering the questionnaire." ) - protected BooleanType required; - - /** - * If true, the question may have more than one answer. - */ - @Child(name = "repeats", type = {BooleanType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Can question have multiple answers?", formalDefinition="If true, the question may have more than one answer." ) - protected BooleanType repeats; - - /** - * Reference to a valueset containing the possible options. - */ - @Child(name = "options", type = {ValueSet.class}, order=7, min=0, max=1) - @Description(shortDefinition="Valueset containing the possible options", formalDefinition="Reference to a valueset containing the possible options." ) - protected Reference options; - - /** - * The actual object that is the target of the reference (Reference to a valueset containing the possible options.) - */ - protected ValueSet optionsTarget; - - /** - * Nested group, containing nested question for this question. The order of groups within the question is relevant. - */ - @Child(name = "group", type = {GroupComponent.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Nested questionnaire group", formalDefinition="Nested group, containing nested question for this question. The order of groups within the question is relevant." ) - protected List group; - - private static final long serialVersionUID = 1655002985L; - - /* - * Constructor - */ - public QuestionComponent() { - super(); - } - - /** - * @return {@link #linkId} (An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public StringType getLinkIdElement() { - if (this.linkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionComponent.linkId"); - else if (Configuration.doAutoCreate()) - this.linkId = new StringType(); // bb - return this.linkId; - } - - public boolean hasLinkIdElement() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - public boolean hasLinkId() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - /** - * @param value {@link #linkId} (An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public QuestionComponent setLinkIdElement(StringType value) { - this.linkId = value; - return this; - } - - /** - * @return An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource. - */ - public String getLinkId() { - return this.linkId == null ? null : this.linkId.getValue(); - } - - /** - * @param value An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource. - */ - public QuestionComponent setLinkId(String value) { - if (Utilities.noString(value)) - this.linkId = null; - else { - if (this.linkId == null) - this.linkId = new StringType(); - this.linkId.setValue(value); - } - return this; - } - - /** - * @return {@link #concept} (Identifies a how this question is known in a particular terminology such as LOINC.) - */ - public List getConcept() { - if (this.concept == null) - this.concept = new ArrayList(); - return this.concept; - } - - public boolean hasConcept() { - if (this.concept == null) - return false; - for (Coding item : this.concept) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #concept} (Identifies a how this question is known in a particular terminology such as LOINC.) - */ - // syntactic sugar - public Coding addConcept() { //3 - Coding t = new Coding(); - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return t; - } - - // syntactic sugar - public QuestionComponent addConcept(Coding t) { //3 - if (t == null) - return this; - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return this; - } - - /** - * @return {@link #text} (The actual question as shown to the user to prompt them for an answer.). 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 QuestionComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (The actual question as shown to the user to prompt them for an answer.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public QuestionComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return The actual question as shown to the user to prompt them for an answer. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value The actual question as shown to the user to prompt them for an answer. - */ - public QuestionComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new AnswerFormatEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public QuestionComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected. - */ - public AnswerFormat getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected. - */ - public QuestionComponent setType(AnswerFormat value) { - if (value == null) - this.type = null; - else { - if (this.type == null) - this.type = new Enumeration(new AnswerFormatEnumFactory()); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #required} (If true, indicates that the question must be answered and have required groups within it also present. If false, the question and any contained groups may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value - */ - public BooleanType getRequiredElement() { - if (this.required == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionComponent.required"); - else if (Configuration.doAutoCreate()) - this.required = new BooleanType(); // bb - return this.required; - } - - public boolean hasRequiredElement() { - return this.required != null && !this.required.isEmpty(); - } - - public boolean hasRequired() { - return this.required != null && !this.required.isEmpty(); - } - - /** - * @param value {@link #required} (If true, indicates that the question must be answered and have required groups within it also present. If false, the question and any contained groups may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value - */ - public QuestionComponent setRequiredElement(BooleanType value) { - this.required = value; - return this; - } - - /** - * @return If true, indicates that the question must be answered and have required groups within it also present. If false, the question and any contained groups may be skipped when answering the questionnaire. - */ - public boolean getRequired() { - return this.required == null || this.required.isEmpty() ? false : this.required.getValue(); - } - - /** - * @param value If true, indicates that the question must be answered and have required groups within it also present. If false, the question and any contained groups may be skipped when answering the questionnaire. - */ - public QuestionComponent setRequired(boolean value) { - if (this.required == null) - this.required = new BooleanType(); - this.required.setValue(value); - return this; - } - - /** - * @return {@link #repeats} (If true, the question may have more than one answer.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value - */ - public BooleanType getRepeatsElement() { - if (this.repeats == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionComponent.repeats"); - else if (Configuration.doAutoCreate()) - this.repeats = new BooleanType(); // bb - return this.repeats; - } - - public boolean hasRepeatsElement() { - return this.repeats != null && !this.repeats.isEmpty(); - } - - public boolean hasRepeats() { - return this.repeats != null && !this.repeats.isEmpty(); - } - - /** - * @param value {@link #repeats} (If true, the question may have more than one answer.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value - */ - public QuestionComponent setRepeatsElement(BooleanType value) { - this.repeats = value; - return this; - } - - /** - * @return If true, the question may have more than one answer. - */ - public boolean getRepeats() { - return this.repeats == null || this.repeats.isEmpty() ? false : this.repeats.getValue(); - } - - /** - * @param value If true, the question may have more than one answer. - */ - public QuestionComponent setRepeats(boolean value) { - if (this.repeats == null) - this.repeats = new BooleanType(); - this.repeats.setValue(value); - return this; - } - - /** - * @return {@link #options} (Reference to a valueset containing the possible options.) - */ - public Reference getOptions() { - if (this.options == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionComponent.options"); - else if (Configuration.doAutoCreate()) - this.options = new Reference(); // cc - return this.options; - } - - public boolean hasOptions() { - return this.options != null && !this.options.isEmpty(); - } - - /** - * @param value {@link #options} (Reference to a valueset containing the possible options.) - */ - public QuestionComponent setOptions(Reference value) { - this.options = value; - return this; - } - - /** - * @return {@link #options} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to a valueset containing the possible options.) - */ - public ValueSet getOptionsTarget() { - if (this.optionsTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionComponent.options"); - else if (Configuration.doAutoCreate()) - this.optionsTarget = new ValueSet(); // aa - return this.optionsTarget; - } - - /** - * @param value {@link #options} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to a valueset containing the possible options.) - */ - public QuestionComponent setOptionsTarget(ValueSet value) { - this.optionsTarget = value; - return this; - } - - /** - * @return {@link #group} (Nested group, containing nested question for this question. The order of groups within the question is relevant.) - */ - public List getGroup() { - if (this.group == null) - this.group = new ArrayList(); - return this.group; - } - - public boolean hasGroup() { - if (this.group == null) - return false; - for (GroupComponent item : this.group) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #group} (Nested group, containing nested question for this question. The order of groups within the question is relevant.) - */ - // syntactic sugar - public GroupComponent addGroup() { //3 - GroupComponent t = new GroupComponent(); - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return t; - } - - // syntactic sugar - public QuestionComponent addGroup(GroupComponent t) { //3 - if (t == null) - return this; - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("linkId", "string", "An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource.", 0, java.lang.Integer.MAX_VALUE, linkId)); - childrenList.add(new Property("concept", "Coding", "Identifies a how this question is known in a particular terminology such as LOINC.", 0, java.lang.Integer.MAX_VALUE, concept)); - childrenList.add(new Property("text", "string", "The actual question as shown to the user to prompt them for an answer.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("type", "code", "The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("required", "boolean", "If true, indicates that the question must be answered and have required groups within it also present. If false, the question and any contained groups may be skipped when answering the questionnaire.", 0, java.lang.Integer.MAX_VALUE, required)); - childrenList.add(new Property("repeats", "boolean", "If true, the question may have more than one answer.", 0, java.lang.Integer.MAX_VALUE, repeats)); - childrenList.add(new Property("options", "Reference(ValueSet)", "Reference to a valueset containing the possible options.", 0, java.lang.Integer.MAX_VALUE, options)); - childrenList.add(new Property("group", "@Questionnaire.group", "Nested group, containing nested question for this question. The order of groups within the question is relevant.", 0, java.lang.Integer.MAX_VALUE, group)); - } - - public QuestionComponent copy() { - QuestionComponent dst = new QuestionComponent(); - copyValues(dst); - dst.linkId = linkId == null ? null : linkId.copy(); - if (concept != null) { - dst.concept = new ArrayList(); - for (Coding i : concept) - dst.concept.add(i.copy()); - }; - dst.text = text == null ? null : text.copy(); - dst.type = type == null ? null : type.copy(); - dst.required = required == null ? null : required.copy(); - dst.repeats = repeats == null ? null : repeats.copy(); - dst.options = options == null ? null : options.copy(); - if (group != null) { - dst.group = new ArrayList(); - for (GroupComponent i : group) - dst.group.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof QuestionComponent)) - return false; - QuestionComponent o = (QuestionComponent) other; - return compareDeep(linkId, o.linkId, true) && compareDeep(concept, o.concept, true) && compareDeep(text, o.text, true) - && compareDeep(type, o.type, true) && compareDeep(required, o.required, true) && compareDeep(repeats, o.repeats, true) - && compareDeep(options, o.options, true) && compareDeep(group, o.group, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof QuestionComponent)) - return false; - QuestionComponent o = (QuestionComponent) other; - return compareValues(linkId, o.linkId, true) && compareValues(text, o.text, true) && compareValues(type, o.type, true) - && compareValues(required, o.required, true) && compareValues(repeats, o.repeats, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (concept == null || concept.isEmpty()) - && (text == null || text.isEmpty()) && (type == null || type.isEmpty()) && (required == null || required.isEmpty()) - && (repeats == null || repeats.isEmpty()) && (options == null || options.isEmpty()) && (group == null || group.isEmpty()) - ; - } - - } - - /** - * This records identifiers associated with this question set that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External Ids for this questionnaire", formalDefinition="This records identifiers associated with this question set that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) - protected List identifier; - - /** - * The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated. - */ - @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Logical id for this version of Questionnaire", formalDefinition="The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated." ) - protected StringType version; - - /** - * The lifecycle status of the questionnaire as a whole. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="draft | published | retired", formalDefinition="The lifecycle status of the questionnaire as a whole." ) - protected Enumeration status; - - /** - * The date that this questionnaire was last changed. - */ - @Child(name = "date", type = {DateTimeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Date this version was authored", formalDefinition="The date that this questionnaire was last changed." ) - protected DateTimeType date; - - /** - * Organization or person responsible for developing and maintaining the questionnaire. - */ - @Child(name = "publisher", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Organization/individual who designed the questionnaire", formalDefinition="Organization or person responsible for developing and maintaining the questionnaire." ) - protected StringType publisher; - - /** - * Contact details to assist a user in finding and communicating with the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact information of the publisher", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." ) - protected List telecom; - - /** - * A collection of related questions (or further groupings of questions). - */ - @Child(name = "group", type = {}, order=6, min=1, max=1) - @Description(shortDefinition="Grouped questions", formalDefinition="A collection of related questions (or further groupings of questions)." ) - protected GroupComponent group; - - private static final long serialVersionUID = -852096969L; - - /* - * Constructor - */ - public Questionnaire() { - super(); - } - - /* - * Constructor - */ - public Questionnaire(Enumeration status, GroupComponent group) { - super(); - this.status = status; - this.group = group; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this question set that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this question set that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Questionnaire addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #version} (The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Questionnaire.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public Questionnaire setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated. - */ - public Questionnaire setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The lifecycle status of the questionnaire as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Questionnaire.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new QuestionnaireStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The lifecycle status of the questionnaire as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Questionnaire setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The lifecycle status of the questionnaire as a whole. - */ - public QuestionnaireStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The lifecycle status of the questionnaire as a whole. - */ - public Questionnaire setStatus(QuestionnaireStatus value) { - if (this.status == null) - this.status = new Enumeration(new QuestionnaireStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #date} (The date that this questionnaire was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Questionnaire.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date that this questionnaire was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public Questionnaire setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date that this questionnaire was last changed. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date that this questionnaire was last changed. - */ - public Questionnaire setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #publisher} (Organization or person responsible for developing and maintaining the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Questionnaire.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (Organization or person responsible for developing and maintaining the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public Questionnaire setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return Organization or person responsible for developing and maintaining the questionnaire. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value Organization or person responsible for developing and maintaining the questionnaire. - */ - public Questionnaire setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public Questionnaire addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #group} (A collection of related questions (or further groupings of questions).) - */ - public GroupComponent getGroup() { - if (this.group == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Questionnaire.group"); - else if (Configuration.doAutoCreate()) - this.group = new GroupComponent(); // cc - return this.group; - } - - public boolean hasGroup() { - return this.group != null && !this.group.isEmpty(); - } - - /** - * @param value {@link #group} (A collection of related questions (or further groupings of questions).) - */ - public Questionnaire setGroup(GroupComponent value) { - this.group = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this question set that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("status", "code", "The lifecycle status of the questionnaire as a whole.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("date", "dateTime", "The date that this questionnaire was last changed.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("publisher", "string", "Organization or person responsible for developing and maintaining the questionnaire.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("group", "", "A collection of related questions (or further groupings of questions).", 0, java.lang.Integer.MAX_VALUE, group)); - } - - public Questionnaire copy() { - Questionnaire dst = new Questionnaire(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.version = version == null ? null : version.copy(); - dst.status = status == null ? null : status.copy(); - dst.date = date == null ? null : date.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.group = group == null ? null : group.copy(); - return dst; - } - - protected Questionnaire typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Questionnaire)) - return false; - Questionnaire o = (Questionnaire) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) && compareDeep(status, o.status, true) - && compareDeep(date, o.date, true) && compareDeep(publisher, o.publisher, true) && compareDeep(telecom, o.telecom, true) - && compareDeep(group, o.group, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Questionnaire)) - return false; - Questionnaire o = (Questionnaire) other; - return compareValues(version, o.version, true) && compareValues(status, o.status, true) && compareValues(date, o.date, true) - && compareValues(publisher, o.publisher, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (version == null || version.isEmpty()) - && (status == null || status.isEmpty()) && (date == null || date.isEmpty()) && (publisher == null || publisher.isEmpty()) - && (telecom == null || telecom.isEmpty()) && (group == null || group.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Questionnaire; - } - - @SearchParamDefinition(name="title", path="", description="All or part of the name of the questionnaire (title for the root group of the questionnaire)", type="string" ) - public static final String SP_TITLE = "title"; - @SearchParamDefinition(name="status", path="Questionnaire.status", description="The status of the questionnaire", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="code", path="Questionnaire.group.concept", description="A code that corresponds to the questionnaire or one of its groups", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="date", path="Questionnaire.date", description="When the questionnaire was last changed", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="identifier", path="Questionnaire.identifier", description="An identifier for the questionnaire", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="version", path="Questionnaire.version", description="The business version of the questionnaire", type="string" ) - public static final String SP_VERSION = "version"; - @SearchParamDefinition(name="publisher", path="Questionnaire.publisher", description="The author of the questionnaire", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + */ +@ResourceDef(name="Questionnaire", profile="http://hl7.org/fhir/Profile/Questionnaire") +public class Questionnaire extends DomainResource { + + public enum QuestionnaireStatus { + /** + * This Questionnaire is not ready for official use. + */ + DRAFT, + /** + * This Questionnaire is ready for use. + */ + PUBLISHED, + /** + * This Questionnaire should no longer be used to gather data. + */ + RETIRED, + /** + * added to help the parsers + */ + NULL; + public static QuestionnaireStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return DRAFT; + if ("published".equals(codeString)) + return PUBLISHED; + if ("retired".equals(codeString)) + return RETIRED; + throw new Exception("Unknown QuestionnaireStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case DRAFT: return "draft"; + case PUBLISHED: return "published"; + case RETIRED: return "retired"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DRAFT: return ""; + case PUBLISHED: return ""; + case RETIRED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DRAFT: return "This Questionnaire is not ready for official use."; + case PUBLISHED: return "This Questionnaire is ready for use."; + case RETIRED: return "This Questionnaire should no longer be used to gather data."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DRAFT: return "draft"; + case PUBLISHED: return "published"; + case RETIRED: return "retired"; + default: return "?"; + } + } + } + + public static class QuestionnaireStatusEnumFactory implements EnumFactory { + public QuestionnaireStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return QuestionnaireStatus.DRAFT; + if ("published".equals(codeString)) + return QuestionnaireStatus.PUBLISHED; + if ("retired".equals(codeString)) + return QuestionnaireStatus.RETIRED; + throw new IllegalArgumentException("Unknown QuestionnaireStatus code '"+codeString+"'"); + } + public String toCode(QuestionnaireStatus code) { + if (code == QuestionnaireStatus.DRAFT) + return "draft"; + if (code == QuestionnaireStatus.PUBLISHED) + return "published"; + if (code == QuestionnaireStatus.RETIRED) + return "retired"; + return "?"; + } + } + + public enum AnswerFormat { + /** + * Answer is a yes/no answer. + */ + BOOLEAN, + /** + * Answer is a floating point number. + */ + DECIMAL, + /** + * Answer is an integer. + */ + INTEGER, + /** + * Answer is a date. + */ + DATE, + /** + * Answer is a date and time. + */ + DATETIME, + /** + * Answer is a system timestamp. + */ + INSTANT, + /** + * Answer is a time independent of date. + */ + TIME, + /** + * Answer is a short (few words to short sentence) free-text entry. + */ + STRING, + /** + * Answer is a long (potentially multi-paragram) free-text entry. + */ + TEXT, + /** + * Answer is a url (website, FTP site, etc.). + */ + URL, + /** + * Answer is a choice from a list of options. + */ + CHOICE, + /** + * Answer is a choice from a list of options or a free-text entry. + */ + OPENCHOICE, + /** + * Answer is binary content such as a image, PDF, etc. + */ + ATTACHMENT, + /** + * Answer is a reference to another resource (practitioner, organization, etc.). + */ + REFERENCE, + /** + * Answer is a combination of a numeric value and unit. + */ + QUANTITY, + /** + * added to help the parsers + */ + NULL; + public static AnswerFormat fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("boolean".equals(codeString)) + return BOOLEAN; + if ("decimal".equals(codeString)) + return DECIMAL; + if ("integer".equals(codeString)) + return INTEGER; + if ("date".equals(codeString)) + return DATE; + if ("dateTime".equals(codeString)) + return DATETIME; + if ("instant".equals(codeString)) + return INSTANT; + if ("time".equals(codeString)) + return TIME; + if ("string".equals(codeString)) + return STRING; + if ("text".equals(codeString)) + return TEXT; + if ("url".equals(codeString)) + return URL; + if ("choice".equals(codeString)) + return CHOICE; + if ("open-choice".equals(codeString)) + return OPENCHOICE; + if ("attachment".equals(codeString)) + return ATTACHMENT; + if ("reference".equals(codeString)) + return REFERENCE; + if ("quantity".equals(codeString)) + return QUANTITY; + throw new Exception("Unknown AnswerFormat code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case BOOLEAN: return "boolean"; + case DECIMAL: return "decimal"; + case INTEGER: return "integer"; + case DATE: return "date"; + case DATETIME: return "dateTime"; + case INSTANT: return "instant"; + case TIME: return "time"; + case STRING: return "string"; + case TEXT: return "text"; + case URL: return "url"; + case CHOICE: return "choice"; + case OPENCHOICE: return "open-choice"; + case ATTACHMENT: return "attachment"; + case REFERENCE: return "reference"; + case QUANTITY: return "quantity"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case BOOLEAN: return ""; + case DECIMAL: return ""; + case INTEGER: return ""; + case DATE: return ""; + case DATETIME: return ""; + case INSTANT: return ""; + case TIME: return ""; + case STRING: return ""; + case TEXT: return ""; + case URL: return ""; + case CHOICE: return ""; + case OPENCHOICE: return ""; + case ATTACHMENT: return ""; + case REFERENCE: return ""; + case QUANTITY: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case BOOLEAN: return "Answer is a yes/no answer."; + case DECIMAL: return "Answer is a floating point number."; + case INTEGER: return "Answer is an integer."; + case DATE: return "Answer is a date."; + case DATETIME: return "Answer is a date and time."; + case INSTANT: return "Answer is a system timestamp."; + case TIME: return "Answer is a time independent of date."; + case STRING: return "Answer is a short (few words to short sentence) free-text entry."; + case TEXT: return "Answer is a long (potentially multi-paragram) free-text entry."; + case URL: return "Answer is a url (website, FTP site, etc.)."; + case CHOICE: return "Answer is a choice from a list of options."; + case OPENCHOICE: return "Answer is a choice from a list of options or a free-text entry."; + case ATTACHMENT: return "Answer is binary content such as a image, PDF, etc."; + case REFERENCE: return "Answer is a reference to another resource (practitioner, organization, etc.)."; + case QUANTITY: return "Answer is a combination of a numeric value and unit."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case BOOLEAN: return "Boolean"; + case DECIMAL: return "Decimal"; + case INTEGER: return "Integer"; + case DATE: return "Date"; + case DATETIME: return "Date Time"; + case INSTANT: return "Instant"; + case TIME: return "Time"; + case STRING: return "String"; + case TEXT: return "Text"; + case URL: return "Url"; + case CHOICE: return "Choice"; + case OPENCHOICE: return "Open Choice"; + case ATTACHMENT: return "Attachment"; + case REFERENCE: return "Reference"; + case QUANTITY: return "Quantity"; + default: return "?"; + } + } + } + + public static class AnswerFormatEnumFactory implements EnumFactory { + public AnswerFormat fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("boolean".equals(codeString)) + return AnswerFormat.BOOLEAN; + if ("decimal".equals(codeString)) + return AnswerFormat.DECIMAL; + if ("integer".equals(codeString)) + return AnswerFormat.INTEGER; + if ("date".equals(codeString)) + return AnswerFormat.DATE; + if ("dateTime".equals(codeString)) + return AnswerFormat.DATETIME; + if ("instant".equals(codeString)) + return AnswerFormat.INSTANT; + if ("time".equals(codeString)) + return AnswerFormat.TIME; + if ("string".equals(codeString)) + return AnswerFormat.STRING; + if ("text".equals(codeString)) + return AnswerFormat.TEXT; + if ("url".equals(codeString)) + return AnswerFormat.URL; + if ("choice".equals(codeString)) + return AnswerFormat.CHOICE; + if ("open-choice".equals(codeString)) + return AnswerFormat.OPENCHOICE; + if ("attachment".equals(codeString)) + return AnswerFormat.ATTACHMENT; + if ("reference".equals(codeString)) + return AnswerFormat.REFERENCE; + if ("quantity".equals(codeString)) + return AnswerFormat.QUANTITY; + throw new IllegalArgumentException("Unknown AnswerFormat code '"+codeString+"'"); + } + public String toCode(AnswerFormat code) { + if (code == AnswerFormat.BOOLEAN) + return "boolean"; + if (code == AnswerFormat.DECIMAL) + return "decimal"; + if (code == AnswerFormat.INTEGER) + return "integer"; + if (code == AnswerFormat.DATE) + return "date"; + if (code == AnswerFormat.DATETIME) + return "dateTime"; + if (code == AnswerFormat.INSTANT) + return "instant"; + if (code == AnswerFormat.TIME) + return "time"; + if (code == AnswerFormat.STRING) + return "string"; + if (code == AnswerFormat.TEXT) + return "text"; + if (code == AnswerFormat.URL) + return "url"; + if (code == AnswerFormat.CHOICE) + return "choice"; + if (code == AnswerFormat.OPENCHOICE) + return "open-choice"; + if (code == AnswerFormat.ATTACHMENT) + return "attachment"; + if (code == AnswerFormat.REFERENCE) + return "reference"; + if (code == AnswerFormat.QUANTITY) + return "quantity"; + return "?"; + } + } + + @Block() + public static class GroupComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource. + */ + @Child(name = "linkId", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="To link questionnaire with questionnaire answers", formalDefinition="An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource." ) + protected StringType linkId; + + /** + * The human-readable name for this section of the questionnaire. + */ + @Child(name = "title", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Name to be displayed for group", formalDefinition="The human-readable name for this section of the questionnaire." ) + protected StringType title; + + /** + * Identifies a how this group of questions is known in a particular terminology such as LOINC. + */ + @Child(name = "concept", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Concept that represents this section on a questionnaire", formalDefinition="Identifies a how this group of questions is known in a particular terminology such as LOINC." ) + protected List concept; + + /** + * Additional text for the group, used for display purposes. + */ + @Child(name = "text", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Additional text for the group", formalDefinition="Additional text for the group, used for display purposes." ) + protected StringType text; + + /** + * If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire. + */ + @Child(name = "required", type = {BooleanType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Must group be included in data results?", formalDefinition="If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire." ) + protected BooleanType required; + + /** + * Whether the group may occur multiple times in the instance, containing multiple sets of answers. + */ + @Child(name = "repeats", type = {BooleanType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Whether the group may repeat", formalDefinition="Whether the group may occur multiple times in the instance, containing multiple sets of answers." ) + protected BooleanType repeats; + + /** + * A sub-group within a group. The ordering of groups within this group is relevant. + */ + @Child(name = "group", type = {GroupComponent.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Nested questionnaire group", formalDefinition="A sub-group within a group. The ordering of groups within this group is relevant." ) + protected List group; + + /** + * Set of questions within this group. The order of questions within the group is relevant. + */ + @Child(name = "question", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Questions in this group", formalDefinition="Set of questions within this group. The order of questions within the group is relevant." ) + protected List question; + + private static final long serialVersionUID = 494129548L; + + /* + * Constructor + */ + public GroupComponent() { + super(); + } + + /** + * @return {@link #linkId} (An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public StringType getLinkIdElement() { + if (this.linkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.linkId"); + else if (Configuration.doAutoCreate()) + this.linkId = new StringType(); // bb + return this.linkId; + } + + public boolean hasLinkIdElement() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + public boolean hasLinkId() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + /** + * @param value {@link #linkId} (An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public GroupComponent setLinkIdElement(StringType value) { + this.linkId = value; + return this; + } + + /** + * @return An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource. + */ + public String getLinkId() { + return this.linkId == null ? null : this.linkId.getValue(); + } + + /** + * @param value An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource. + */ + public GroupComponent setLinkId(String value) { + if (Utilities.noString(value)) + this.linkId = null; + else { + if (this.linkId == null) + this.linkId = new StringType(); + this.linkId.setValue(value); + } + return this; + } + + /** + * @return {@link #title} (The human-readable name for this section of the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); // bb + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (The human-readable name for this section of the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public GroupComponent setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return The human-readable name for this section of the questionnaire. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value The human-readable name for this section of the questionnaire. + */ + public GroupComponent setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #concept} (Identifies a how this group of questions is known in a particular terminology such as LOINC.) + */ + public List getConcept() { + if (this.concept == null) + this.concept = new ArrayList(); + return this.concept; + } + + public boolean hasConcept() { + if (this.concept == null) + return false; + for (Coding item : this.concept) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concept} (Identifies a how this group of questions is known in a particular terminology such as LOINC.) + */ + // syntactic sugar + public Coding addConcept() { //3 + Coding t = new Coding(); + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return t; + } + + // syntactic sugar + public GroupComponent addConcept(Coding t) { //3 + if (t == null) + return this; + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return this; + } + + /** + * @return {@link #text} (Additional text for the group, used for display purposes.). 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 GroupComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Additional text for the group, used for display purposes.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public GroupComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Additional text for the group, used for display purposes. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Additional text for the group, used for display purposes. + */ + public GroupComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #required} (If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value + */ + public BooleanType getRequiredElement() { + if (this.required == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.required"); + else if (Configuration.doAutoCreate()) + this.required = new BooleanType(); // bb + return this.required; + } + + public boolean hasRequiredElement() { + return this.required != null && !this.required.isEmpty(); + } + + public boolean hasRequired() { + return this.required != null && !this.required.isEmpty(); + } + + /** + * @param value {@link #required} (If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value + */ + public GroupComponent setRequiredElement(BooleanType value) { + this.required = value; + return this; + } + + /** + * @return If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire. + */ + public boolean getRequired() { + return this.required == null || this.required.isEmpty() ? false : this.required.getValue(); + } + + /** + * @param value If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire. + */ + public GroupComponent setRequired(boolean value) { + if (this.required == null) + this.required = new BooleanType(); + this.required.setValue(value); + return this; + } + + /** + * @return {@link #repeats} (Whether the group may occur multiple times in the instance, containing multiple sets of answers.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value + */ + public BooleanType getRepeatsElement() { + if (this.repeats == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.repeats"); + else if (Configuration.doAutoCreate()) + this.repeats = new BooleanType(); // bb + return this.repeats; + } + + public boolean hasRepeatsElement() { + return this.repeats != null && !this.repeats.isEmpty(); + } + + public boolean hasRepeats() { + return this.repeats != null && !this.repeats.isEmpty(); + } + + /** + * @param value {@link #repeats} (Whether the group may occur multiple times in the instance, containing multiple sets of answers.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value + */ + public GroupComponent setRepeatsElement(BooleanType value) { + this.repeats = value; + return this; + } + + /** + * @return Whether the group may occur multiple times in the instance, containing multiple sets of answers. + */ + public boolean getRepeats() { + return this.repeats == null || this.repeats.isEmpty() ? false : this.repeats.getValue(); + } + + /** + * @param value Whether the group may occur multiple times in the instance, containing multiple sets of answers. + */ + public GroupComponent setRepeats(boolean value) { + if (this.repeats == null) + this.repeats = new BooleanType(); + this.repeats.setValue(value); + return this; + } + + /** + * @return {@link #group} (A sub-group within a group. The ordering of groups within this group is relevant.) + */ + public List getGroup() { + if (this.group == null) + this.group = new ArrayList(); + return this.group; + } + + public boolean hasGroup() { + if (this.group == null) + return false; + for (GroupComponent item : this.group) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #group} (A sub-group within a group. The ordering of groups within this group is relevant.) + */ + // syntactic sugar + public GroupComponent addGroup() { //3 + GroupComponent t = new GroupComponent(); + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return t; + } + + // syntactic sugar + public GroupComponent addGroup(GroupComponent t) { //3 + if (t == null) + return this; + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return this; + } + + /** + * @return {@link #question} (Set of questions within this group. The order of questions within the group is relevant.) + */ + public List getQuestion() { + if (this.question == null) + this.question = new ArrayList(); + return this.question; + } + + public boolean hasQuestion() { + if (this.question == null) + return false; + for (QuestionComponent item : this.question) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #question} (Set of questions within this group. The order of questions within the group is relevant.) + */ + // syntactic sugar + public QuestionComponent addQuestion() { //3 + QuestionComponent t = new QuestionComponent(); + if (this.question == null) + this.question = new ArrayList(); + this.question.add(t); + return t; + } + + // syntactic sugar + public GroupComponent addQuestion(QuestionComponent t) { //3 + if (t == null) + return this; + if (this.question == null) + this.question = new ArrayList(); + this.question.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("linkId", "string", "An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource.", 0, java.lang.Integer.MAX_VALUE, linkId)); + childrenList.add(new Property("title", "string", "The human-readable name for this section of the questionnaire.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("concept", "Coding", "Identifies a how this group of questions is known in a particular terminology such as LOINC.", 0, java.lang.Integer.MAX_VALUE, concept)); + childrenList.add(new Property("text", "string", "Additional text for the group, used for display purposes.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("required", "boolean", "If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire.", 0, java.lang.Integer.MAX_VALUE, required)); + childrenList.add(new Property("repeats", "boolean", "Whether the group may occur multiple times in the instance, containing multiple sets of answers.", 0, java.lang.Integer.MAX_VALUE, repeats)); + childrenList.add(new Property("group", "@Questionnaire.group", "A sub-group within a group. The ordering of groups within this group is relevant.", 0, java.lang.Integer.MAX_VALUE, group)); + childrenList.add(new Property("question", "", "Set of questions within this group. The order of questions within the group is relevant.", 0, java.lang.Integer.MAX_VALUE, question)); + } + + public GroupComponent copy() { + GroupComponent dst = new GroupComponent(); + copyValues(dst); + dst.linkId = linkId == null ? null : linkId.copy(); + dst.title = title == null ? null : title.copy(); + if (concept != null) { + dst.concept = new ArrayList(); + for (Coding i : concept) + dst.concept.add(i.copy()); + }; + dst.text = text == null ? null : text.copy(); + dst.required = required == null ? null : required.copy(); + dst.repeats = repeats == null ? null : repeats.copy(); + if (group != null) { + dst.group = new ArrayList(); + for (GroupComponent i : group) + dst.group.add(i.copy()); + }; + if (question != null) { + dst.question = new ArrayList(); + for (QuestionComponent i : question) + dst.question.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof GroupComponent)) + return false; + GroupComponent o = (GroupComponent) other; + return compareDeep(linkId, o.linkId, true) && compareDeep(title, o.title, true) && compareDeep(concept, o.concept, true) + && compareDeep(text, o.text, true) && compareDeep(required, o.required, true) && compareDeep(repeats, o.repeats, true) + && compareDeep(group, o.group, true) && compareDeep(question, o.question, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof GroupComponent)) + return false; + GroupComponent o = (GroupComponent) other; + return compareValues(linkId, o.linkId, true) && compareValues(title, o.title, true) && compareValues(text, o.text, true) + && compareValues(required, o.required, true) && compareValues(repeats, o.repeats, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (title == null || title.isEmpty()) + && (concept == null || concept.isEmpty()) && (text == null || text.isEmpty()) && (required == null || required.isEmpty()) + && (repeats == null || repeats.isEmpty()) && (group == null || group.isEmpty()) && (question == null || question.isEmpty()) + ; + } + + } + + @Block() + public static class QuestionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource. + */ + @Child(name = "linkId", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="To link questionnaire with questionnaire answers", formalDefinition="An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource." ) + protected StringType linkId; + + /** + * Identifies a how this question is known in a particular terminology such as LOINC. + */ + @Child(name = "concept", type = {Coding.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Concept that represents this question on a questionnaire", formalDefinition="Identifies a how this question is known in a particular terminology such as LOINC." ) + protected List concept; + + /** + * The actual question as shown to the user to prompt them for an answer. + */ + @Child(name = "text", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Text of the question as it is shown to the user", formalDefinition="The actual question as shown to the user to prompt them for an answer." ) + protected StringType text; + + /** + * The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected. + */ + @Child(name = "type", type = {CodeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="boolean | decimal | integer | date | dateTime +", formalDefinition="The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected." ) + protected Enumeration type; + + /** + * If true, indicates that the question must be answered and have required groups within it also present. If false, the question and any contained groups may be skipped when answering the questionnaire. + */ + @Child(name = "required", type = {BooleanType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Must question be answered in data results?", formalDefinition="If true, indicates that the question must be answered and have required groups within it also present. If false, the question and any contained groups may be skipped when answering the questionnaire." ) + protected BooleanType required; + + /** + * If true, the question may have more than one answer. + */ + @Child(name = "repeats", type = {BooleanType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Can question have multiple answers?", formalDefinition="If true, the question may have more than one answer." ) + protected BooleanType repeats; + + /** + * Reference to a valueset containing the possible options. + */ + @Child(name = "options", type = {ValueSet.class}, order=7, min=0, max=1) + @Description(shortDefinition="Valueset containing the possible options", formalDefinition="Reference to a valueset containing the possible options." ) + protected Reference options; + + /** + * The actual object that is the target of the reference (Reference to a valueset containing the possible options.) + */ + protected ValueSet optionsTarget; + + /** + * Nested group, containing nested question for this question. The order of groups within the question is relevant. + */ + @Child(name = "group", type = {GroupComponent.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Nested questionnaire group", formalDefinition="Nested group, containing nested question for this question. The order of groups within the question is relevant." ) + protected List group; + + private static final long serialVersionUID = 1655002985L; + + /* + * Constructor + */ + public QuestionComponent() { + super(); + } + + /** + * @return {@link #linkId} (An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public StringType getLinkIdElement() { + if (this.linkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionComponent.linkId"); + else if (Configuration.doAutoCreate()) + this.linkId = new StringType(); // bb + return this.linkId; + } + + public boolean hasLinkIdElement() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + public boolean hasLinkId() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + /** + * @param value {@link #linkId} (An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public QuestionComponent setLinkIdElement(StringType value) { + this.linkId = value; + return this; + } + + /** + * @return An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource. + */ + public String getLinkId() { + return this.linkId == null ? null : this.linkId.getValue(); + } + + /** + * @param value An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource. + */ + public QuestionComponent setLinkId(String value) { + if (Utilities.noString(value)) + this.linkId = null; + else { + if (this.linkId == null) + this.linkId = new StringType(); + this.linkId.setValue(value); + } + return this; + } + + /** + * @return {@link #concept} (Identifies a how this question is known in a particular terminology such as LOINC.) + */ + public List getConcept() { + if (this.concept == null) + this.concept = new ArrayList(); + return this.concept; + } + + public boolean hasConcept() { + if (this.concept == null) + return false; + for (Coding item : this.concept) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concept} (Identifies a how this question is known in a particular terminology such as LOINC.) + */ + // syntactic sugar + public Coding addConcept() { //3 + Coding t = new Coding(); + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return t; + } + + // syntactic sugar + public QuestionComponent addConcept(Coding t) { //3 + if (t == null) + return this; + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return this; + } + + /** + * @return {@link #text} (The actual question as shown to the user to prompt them for an answer.). 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 QuestionComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (The actual question as shown to the user to prompt them for an answer.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public QuestionComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return The actual question as shown to the user to prompt them for an answer. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value The actual question as shown to the user to prompt them for an answer. + */ + public QuestionComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new AnswerFormatEnumFactory()); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public QuestionComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected. + */ + public AnswerFormat getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected. + */ + public QuestionComponent setType(AnswerFormat value) { + if (value == null) + this.type = null; + else { + if (this.type == null) + this.type = new Enumeration(new AnswerFormatEnumFactory()); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #required} (If true, indicates that the question must be answered and have required groups within it also present. If false, the question and any contained groups may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value + */ + public BooleanType getRequiredElement() { + if (this.required == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionComponent.required"); + else if (Configuration.doAutoCreate()) + this.required = new BooleanType(); // bb + return this.required; + } + + public boolean hasRequiredElement() { + return this.required != null && !this.required.isEmpty(); + } + + public boolean hasRequired() { + return this.required != null && !this.required.isEmpty(); + } + + /** + * @param value {@link #required} (If true, indicates that the question must be answered and have required groups within it also present. If false, the question and any contained groups may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value + */ + public QuestionComponent setRequiredElement(BooleanType value) { + this.required = value; + return this; + } + + /** + * @return If true, indicates that the question must be answered and have required groups within it also present. If false, the question and any contained groups may be skipped when answering the questionnaire. + */ + public boolean getRequired() { + return this.required == null || this.required.isEmpty() ? false : this.required.getValue(); + } + + /** + * @param value If true, indicates that the question must be answered and have required groups within it also present. If false, the question and any contained groups may be skipped when answering the questionnaire. + */ + public QuestionComponent setRequired(boolean value) { + if (this.required == null) + this.required = new BooleanType(); + this.required.setValue(value); + return this; + } + + /** + * @return {@link #repeats} (If true, the question may have more than one answer.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value + */ + public BooleanType getRepeatsElement() { + if (this.repeats == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionComponent.repeats"); + else if (Configuration.doAutoCreate()) + this.repeats = new BooleanType(); // bb + return this.repeats; + } + + public boolean hasRepeatsElement() { + return this.repeats != null && !this.repeats.isEmpty(); + } + + public boolean hasRepeats() { + return this.repeats != null && !this.repeats.isEmpty(); + } + + /** + * @param value {@link #repeats} (If true, the question may have more than one answer.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value + */ + public QuestionComponent setRepeatsElement(BooleanType value) { + this.repeats = value; + return this; + } + + /** + * @return If true, the question may have more than one answer. + */ + public boolean getRepeats() { + return this.repeats == null || this.repeats.isEmpty() ? false : this.repeats.getValue(); + } + + /** + * @param value If true, the question may have more than one answer. + */ + public QuestionComponent setRepeats(boolean value) { + if (this.repeats == null) + this.repeats = new BooleanType(); + this.repeats.setValue(value); + return this; + } + + /** + * @return {@link #options} (Reference to a valueset containing the possible options.) + */ + public Reference getOptions() { + if (this.options == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionComponent.options"); + else if (Configuration.doAutoCreate()) + this.options = new Reference(); // cc + return this.options; + } + + public boolean hasOptions() { + return this.options != null && !this.options.isEmpty(); + } + + /** + * @param value {@link #options} (Reference to a valueset containing the possible options.) + */ + public QuestionComponent setOptions(Reference value) { + this.options = value; + return this; + } + + /** + * @return {@link #options} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to a valueset containing the possible options.) + */ + public ValueSet getOptionsTarget() { + if (this.optionsTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionComponent.options"); + else if (Configuration.doAutoCreate()) + this.optionsTarget = new ValueSet(); // aa + return this.optionsTarget; + } + + /** + * @param value {@link #options} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to a valueset containing the possible options.) + */ + public QuestionComponent setOptionsTarget(ValueSet value) { + this.optionsTarget = value; + return this; + } + + /** + * @return {@link #group} (Nested group, containing nested question for this question. The order of groups within the question is relevant.) + */ + public List getGroup() { + if (this.group == null) + this.group = new ArrayList(); + return this.group; + } + + public boolean hasGroup() { + if (this.group == null) + return false; + for (GroupComponent item : this.group) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #group} (Nested group, containing nested question for this question. The order of groups within the question is relevant.) + */ + // syntactic sugar + public GroupComponent addGroup() { //3 + GroupComponent t = new GroupComponent(); + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return t; + } + + // syntactic sugar + public QuestionComponent addGroup(GroupComponent t) { //3 + if (t == null) + return this; + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("linkId", "string", "An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource.", 0, java.lang.Integer.MAX_VALUE, linkId)); + childrenList.add(new Property("concept", "Coding", "Identifies a how this question is known in a particular terminology such as LOINC.", 0, java.lang.Integer.MAX_VALUE, concept)); + childrenList.add(new Property("text", "string", "The actual question as shown to the user to prompt them for an answer.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("type", "code", "The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("required", "boolean", "If true, indicates that the question must be answered and have required groups within it also present. If false, the question and any contained groups may be skipped when answering the questionnaire.", 0, java.lang.Integer.MAX_VALUE, required)); + childrenList.add(new Property("repeats", "boolean", "If true, the question may have more than one answer.", 0, java.lang.Integer.MAX_VALUE, repeats)); + childrenList.add(new Property("options", "Reference(ValueSet)", "Reference to a valueset containing the possible options.", 0, java.lang.Integer.MAX_VALUE, options)); + childrenList.add(new Property("group", "@Questionnaire.group", "Nested group, containing nested question for this question. The order of groups within the question is relevant.", 0, java.lang.Integer.MAX_VALUE, group)); + } + + public QuestionComponent copy() { + QuestionComponent dst = new QuestionComponent(); + copyValues(dst); + dst.linkId = linkId == null ? null : linkId.copy(); + if (concept != null) { + dst.concept = new ArrayList(); + for (Coding i : concept) + dst.concept.add(i.copy()); + }; + dst.text = text == null ? null : text.copy(); + dst.type = type == null ? null : type.copy(); + dst.required = required == null ? null : required.copy(); + dst.repeats = repeats == null ? null : repeats.copy(); + dst.options = options == null ? null : options.copy(); + if (group != null) { + dst.group = new ArrayList(); + for (GroupComponent i : group) + dst.group.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof QuestionComponent)) + return false; + QuestionComponent o = (QuestionComponent) other; + return compareDeep(linkId, o.linkId, true) && compareDeep(concept, o.concept, true) && compareDeep(text, o.text, true) + && compareDeep(type, o.type, true) && compareDeep(required, o.required, true) && compareDeep(repeats, o.repeats, true) + && compareDeep(options, o.options, true) && compareDeep(group, o.group, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof QuestionComponent)) + return false; + QuestionComponent o = (QuestionComponent) other; + return compareValues(linkId, o.linkId, true) && compareValues(text, o.text, true) && compareValues(type, o.type, true) + && compareValues(required, o.required, true) && compareValues(repeats, o.repeats, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (concept == null || concept.isEmpty()) + && (text == null || text.isEmpty()) && (type == null || type.isEmpty()) && (required == null || required.isEmpty()) + && (repeats == null || repeats.isEmpty()) && (options == null || options.isEmpty()) && (group == null || group.isEmpty()) + ; + } + + } + + /** + * This records identifiers associated with this question set that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Ids for this questionnaire", formalDefinition="This records identifiers associated with this question set that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) + protected List identifier; + + /** + * The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated. + */ + @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Logical id for this version of Questionnaire", formalDefinition="The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated." ) + protected StringType version; + + /** + * The lifecycle status of the questionnaire as a whole. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="draft | published | retired", formalDefinition="The lifecycle status of the questionnaire as a whole." ) + protected Enumeration status; + + /** + * The date that this questionnaire was last changed. + */ + @Child(name = "date", type = {DateTimeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Date this version was authored", formalDefinition="The date that this questionnaire was last changed." ) + protected DateTimeType date; + + /** + * Organization or person responsible for developing and maintaining the questionnaire. + */ + @Child(name = "publisher", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Organization/individual who designed the questionnaire", formalDefinition="Organization or person responsible for developing and maintaining the questionnaire." ) + protected StringType publisher; + + /** + * Contact details to assist a user in finding and communicating with the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact information of the publisher", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." ) + protected List telecom; + + /** + * A collection of related questions (or further groupings of questions). + */ + @Child(name = "group", type = {}, order=6, min=1, max=1) + @Description(shortDefinition="Grouped questions", formalDefinition="A collection of related questions (or further groupings of questions)." ) + protected GroupComponent group; + + private static final long serialVersionUID = -852096969L; + + /* + * Constructor + */ + public Questionnaire() { + super(); + } + + /* + * Constructor + */ + public Questionnaire(Enumeration status, GroupComponent group) { + super(); + this.status = status; + this.group = group; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this question set that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this question set that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Questionnaire addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #version} (The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Questionnaire.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public Questionnaire setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated. + */ + public Questionnaire setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The lifecycle status of the questionnaire as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Questionnaire.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new QuestionnaireStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The lifecycle status of the questionnaire as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Questionnaire setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The lifecycle status of the questionnaire as a whole. + */ + public QuestionnaireStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The lifecycle status of the questionnaire as a whole. + */ + public Questionnaire setStatus(QuestionnaireStatus value) { + if (this.status == null) + this.status = new Enumeration(new QuestionnaireStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #date} (The date that this questionnaire was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Questionnaire.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date that this questionnaire was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public Questionnaire setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date that this questionnaire was last changed. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date that this questionnaire was last changed. + */ + public Questionnaire setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #publisher} (Organization or person responsible for developing and maintaining the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Questionnaire.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (Organization or person responsible for developing and maintaining the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public Questionnaire setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return Organization or person responsible for developing and maintaining the questionnaire. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value Organization or person responsible for developing and maintaining the questionnaire. + */ + public Questionnaire setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public Questionnaire addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @return {@link #group} (A collection of related questions (or further groupings of questions).) + */ + public GroupComponent getGroup() { + if (this.group == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Questionnaire.group"); + else if (Configuration.doAutoCreate()) + this.group = new GroupComponent(); // cc + return this.group; + } + + public boolean hasGroup() { + return this.group != null && !this.group.isEmpty(); + } + + /** + * @param value {@link #group} (A collection of related questions (or further groupings of questions).) + */ + public Questionnaire setGroup(GroupComponent value) { + this.group = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this question set that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("status", "code", "The lifecycle status of the questionnaire as a whole.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("date", "dateTime", "The date that this questionnaire was last changed.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("publisher", "string", "Organization or person responsible for developing and maintaining the questionnaire.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("group", "", "A collection of related questions (or further groupings of questions).", 0, java.lang.Integer.MAX_VALUE, group)); + } + + public Questionnaire copy() { + Questionnaire dst = new Questionnaire(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.version = version == null ? null : version.copy(); + dst.status = status == null ? null : status.copy(); + dst.date = date == null ? null : date.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.group = group == null ? null : group.copy(); + return dst; + } + + protected Questionnaire typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Questionnaire)) + return false; + Questionnaire o = (Questionnaire) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) && compareDeep(status, o.status, true) + && compareDeep(date, o.date, true) && compareDeep(publisher, o.publisher, true) && compareDeep(telecom, o.telecom, true) + && compareDeep(group, o.group, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Questionnaire)) + return false; + Questionnaire o = (Questionnaire) other; + return compareValues(version, o.version, true) && compareValues(status, o.status, true) && compareValues(date, o.date, true) + && compareValues(publisher, o.publisher, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (version == null || version.isEmpty()) + && (status == null || status.isEmpty()) && (date == null || date.isEmpty()) && (publisher == null || publisher.isEmpty()) + && (telecom == null || telecom.isEmpty()) && (group == null || group.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Questionnaire; + } + + @SearchParamDefinition(name="date", path="Questionnaire.date", description="When the questionnaire was last changed", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="Questionnaire.identifier", description="An identifier for the questionnaire", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="code", path="Questionnaire.group.concept", description="A code that corresponds to the questionnaire or one of its groups", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="publisher", path="Questionnaire.publisher", description="The author of the questionnaire", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + @SearchParamDefinition(name="title", path="", description="All or part of the name of the questionnaire (title for the root group of the questionnaire)", type="string" ) + public static final String SP_TITLE = "title"; + @SearchParamDefinition(name="version", path="Questionnaire.version", description="The business version of the questionnaire", type="string" ) + public static final String SP_VERSION = "version"; + @SearchParamDefinition(name="status", path="Questionnaire.status", description="The status of the questionnaire", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/QuestionnaireAnswers.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/QuestionnaireAnswers.java index 314ab98c4b8..2062dfe67b9 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/QuestionnaireAnswers.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/QuestionnaireAnswers.java @@ -1,1541 +1,1520 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. - */ -@ResourceDef(name="QuestionnaireAnswers", profile="http://hl7.org/fhir/Profile/QuestionnaireAnswers") -public class QuestionnaireAnswers extends DomainResource { - - public enum QuestionnaireAnswersStatus { - /** - * This QuestionnaireAnswers has been partially filled out with answers, but changes or additions are still expected to be made to it. - */ - INPROGRESS, - /** - * This QuestionnaireAnswers has been filled out with answers, and the current content is regarded as definitive. - */ - COMPLETED, - /** - * This QuestionnaireAnswers has been filled out with answers, then marked as complete, yet changes or additions have been made to it afterwards. - */ - AMENDED, - /** - * added to help the parsers - */ - NULL; - public static QuestionnaireAnswersStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("completed".equals(codeString)) - return COMPLETED; - if ("amended".equals(codeString)) - return AMENDED; - throw new Exception("Unknown QuestionnaireAnswersStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INPROGRESS: return "in-progress"; - case COMPLETED: return "completed"; - case AMENDED: return "amended"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPROGRESS: return ""; - case COMPLETED: return ""; - case AMENDED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPROGRESS: return "This QuestionnaireAnswers has been partially filled out with answers, but changes or additions are still expected to be made to it."; - case COMPLETED: return "This QuestionnaireAnswers has been filled out with answers, and the current content is regarded as definitive."; - case AMENDED: return "This QuestionnaireAnswers has been filled out with answers, then marked as complete, yet changes or additions have been made to it afterwards."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPROGRESS: return "in-progress"; - case COMPLETED: return "completed"; - case AMENDED: return "amended"; - default: return "?"; - } - } - } - - public static class QuestionnaireAnswersStatusEnumFactory implements EnumFactory { - public QuestionnaireAnswersStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return QuestionnaireAnswersStatus.INPROGRESS; - if ("completed".equals(codeString)) - return QuestionnaireAnswersStatus.COMPLETED; - if ("amended".equals(codeString)) - return QuestionnaireAnswersStatus.AMENDED; - throw new IllegalArgumentException("Unknown QuestionnaireAnswersStatus code '"+codeString+"'"); - } - public String toCode(QuestionnaireAnswersStatus code) { - if (code == QuestionnaireAnswersStatus.INPROGRESS) - return "in-progress"; - if (code == QuestionnaireAnswersStatus.COMPLETED) - return "completed"; - if (code == QuestionnaireAnswersStatus.AMENDED) - return "amended"; - return "?"; - } - } - - @Block() - public static class GroupComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource. - */ - @Child(name = "linkId", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Corresponding group within Questionnaire", formalDefinition="Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource." ) - protected StringType linkId; - - /** - * Text that is displayed above the contents of the group. - */ - @Child(name = "title", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Name for this group", formalDefinition="Text that is displayed above the contents of the group." ) - protected StringType title; - - /** - * Additional text for the group, used for display purposes. - */ - @Child(name = "text", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Additional text for the group", formalDefinition="Additional text for the group, used for display purposes." ) - protected StringType text; - - /** - * More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers. - */ - @Child(name = "subject", type = {}, order=4, min=0, max=1) - @Description(shortDefinition="The subject this group's answers are about", formalDefinition="More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.) - */ - protected Resource subjectTarget; - - /** - * A sub-group within a group. The ordering of groups within this group is relevant. - */ - @Child(name = "group", type = {GroupComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Nested questionnaire answers group", formalDefinition="A sub-group within a group. The ordering of groups within this group is relevant." ) - protected List group; - - /** - * Set of questions within this group. The order of questions within the group is relevant. - */ - @Child(name = "question", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Questions in this group", formalDefinition="Set of questions within this group. The order of questions within the group is relevant." ) - protected List question; - - private static final long serialVersionUID = -1045990435L; - - /* - * Constructor - */ - public GroupComponent() { - super(); - } - - /** - * @return {@link #linkId} (Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public StringType getLinkIdElement() { - if (this.linkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupComponent.linkId"); - else if (Configuration.doAutoCreate()) - this.linkId = new StringType(); // bb - return this.linkId; - } - - public boolean hasLinkIdElement() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - public boolean hasLinkId() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - /** - * @param value {@link #linkId} (Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public GroupComponent setLinkIdElement(StringType value) { - this.linkId = value; - return this; - } - - /** - * @return Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource. - */ - public String getLinkId() { - return this.linkId == null ? null : this.linkId.getValue(); - } - - /** - * @param value Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource. - */ - public GroupComponent setLinkId(String value) { - if (Utilities.noString(value)) - this.linkId = null; - else { - if (this.linkId == null) - this.linkId = new StringType(); - this.linkId.setValue(value); - } - return this; - } - - /** - * @return {@link #title} (Text that is displayed above the contents of the group.). 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 GroupComponent.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); // bb - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (Text that is displayed above the contents of the group.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public GroupComponent setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return Text that is displayed above the contents of the group. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value Text that is displayed above the contents of the group. - */ - public GroupComponent setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #text} (Additional text for the group, used for display purposes.). 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 GroupComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (Additional text for the group, used for display purposes.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public GroupComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return Additional text for the group, used for display purposes. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value Additional text for the group, used for display purposes. - */ - public GroupComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #subject} (More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupComponent.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.) - */ - public GroupComponent setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.) - */ - public GroupComponent setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #group} (A sub-group within a group. The ordering of groups within this group is relevant.) - */ - public List getGroup() { - if (this.group == null) - this.group = new ArrayList(); - return this.group; - } - - public boolean hasGroup() { - if (this.group == null) - return false; - for (GroupComponent item : this.group) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #group} (A sub-group within a group. The ordering of groups within this group is relevant.) - */ - // syntactic sugar - public GroupComponent addGroup() { //3 - GroupComponent t = new GroupComponent(); - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return t; - } - - // syntactic sugar - public GroupComponent addGroup(GroupComponent t) { //3 - if (t == null) - return this; - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return this; - } - - /** - * @return {@link #question} (Set of questions within this group. The order of questions within the group is relevant.) - */ - public List getQuestion() { - if (this.question == null) - this.question = new ArrayList(); - return this.question; - } - - public boolean hasQuestion() { - if (this.question == null) - return false; - for (QuestionComponent item : this.question) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #question} (Set of questions within this group. The order of questions within the group is relevant.) - */ - // syntactic sugar - public QuestionComponent addQuestion() { //3 - QuestionComponent t = new QuestionComponent(); - if (this.question == null) - this.question = new ArrayList(); - this.question.add(t); - return t; - } - - // syntactic sugar - public GroupComponent addQuestion(QuestionComponent t) { //3 - if (t == null) - return this; - if (this.question == null) - this.question = new ArrayList(); - this.question.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("linkId", "string", "Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource.", 0, java.lang.Integer.MAX_VALUE, linkId)); - childrenList.add(new Property("title", "string", "Text that is displayed above the contents of the group.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("text", "string", "Additional text for the group, used for display purposes.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("subject", "Reference(Any)", "More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("group", "@QuestionnaireAnswers.group", "A sub-group within a group. The ordering of groups within this group is relevant.", 0, java.lang.Integer.MAX_VALUE, group)); - childrenList.add(new Property("question", "", "Set of questions within this group. The order of questions within the group is relevant.", 0, java.lang.Integer.MAX_VALUE, question)); - } - - public GroupComponent copy() { - GroupComponent dst = new GroupComponent(); - copyValues(dst); - dst.linkId = linkId == null ? null : linkId.copy(); - dst.title = title == null ? null : title.copy(); - dst.text = text == null ? null : text.copy(); - dst.subject = subject == null ? null : subject.copy(); - if (group != null) { - dst.group = new ArrayList(); - for (GroupComponent i : group) - dst.group.add(i.copy()); - }; - if (question != null) { - dst.question = new ArrayList(); - for (QuestionComponent i : question) - dst.question.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof GroupComponent)) - return false; - GroupComponent o = (GroupComponent) other; - return compareDeep(linkId, o.linkId, true) && compareDeep(title, o.title, true) && compareDeep(text, o.text, true) - && compareDeep(subject, o.subject, true) && compareDeep(group, o.group, true) && compareDeep(question, o.question, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof GroupComponent)) - return false; - GroupComponent o = (GroupComponent) other; - return compareValues(linkId, o.linkId, true) && compareValues(title, o.title, true) && compareValues(text, o.text, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (title == null || title.isEmpty()) - && (text == null || text.isEmpty()) && (subject == null || subject.isEmpty()) && (group == null || group.isEmpty()) - && (question == null || question.isEmpty()); - } - - } - - @Block() - public static class QuestionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource. - */ - @Child(name = "linkId", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Corresponding question within Questionnaire", formalDefinition="Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource." ) - protected StringType linkId; - - /** - * The actual question as shown to the user to prompt them for an answer. - */ - @Child(name = "text", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Text of the question as it is shown to the user", formalDefinition="The actual question as shown to the user to prompt them for an answer." ) - protected StringType text; - - /** - * The respondent's answer(s) to the question. - */ - @Child(name = "answer", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The response(s) to the question", formalDefinition="The respondent's answer(s) to the question." ) - protected List answer; - - /** - * Nested group, containing nested question for this question. The order of groups within the question is relevant. - */ - @Child(name = "group", type = {GroupComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Nested questionnaire group", formalDefinition="Nested group, containing nested question for this question. The order of groups within the question is relevant." ) - protected List group; - - private static final long serialVersionUID = -564009278L; - - /* - * Constructor - */ - public QuestionComponent() { - super(); - } - - /** - * @return {@link #linkId} (Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public StringType getLinkIdElement() { - if (this.linkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionComponent.linkId"); - else if (Configuration.doAutoCreate()) - this.linkId = new StringType(); // bb - return this.linkId; - } - - public boolean hasLinkIdElement() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - public boolean hasLinkId() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - /** - * @param value {@link #linkId} (Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public QuestionComponent setLinkIdElement(StringType value) { - this.linkId = value; - return this; - } - - /** - * @return Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource. - */ - public String getLinkId() { - return this.linkId == null ? null : this.linkId.getValue(); - } - - /** - * @param value Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource. - */ - public QuestionComponent setLinkId(String value) { - if (Utilities.noString(value)) - this.linkId = null; - else { - if (this.linkId == null) - this.linkId = new StringType(); - this.linkId.setValue(value); - } - return this; - } - - /** - * @return {@link #text} (The actual question as shown to the user to prompt them for an answer.). 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 QuestionComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (The actual question as shown to the user to prompt them for an answer.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public QuestionComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return The actual question as shown to the user to prompt them for an answer. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value The actual question as shown to the user to prompt them for an answer. - */ - public QuestionComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #answer} (The respondent's answer(s) to the question.) - */ - public List getAnswer() { - if (this.answer == null) - this.answer = new ArrayList(); - return this.answer; - } - - public boolean hasAnswer() { - if (this.answer == null) - return false; - for (QuestionAnswerComponent item : this.answer) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #answer} (The respondent's answer(s) to the question.) - */ - // syntactic sugar - public QuestionAnswerComponent addAnswer() { //3 - QuestionAnswerComponent t = new QuestionAnswerComponent(); - if (this.answer == null) - this.answer = new ArrayList(); - this.answer.add(t); - return t; - } - - // syntactic sugar - public QuestionComponent addAnswer(QuestionAnswerComponent t) { //3 - if (t == null) - return this; - if (this.answer == null) - this.answer = new ArrayList(); - this.answer.add(t); - return this; - } - - /** - * @return {@link #group} (Nested group, containing nested question for this question. The order of groups within the question is relevant.) - */ - public List getGroup() { - if (this.group == null) - this.group = new ArrayList(); - return this.group; - } - - public boolean hasGroup() { - if (this.group == null) - return false; - for (GroupComponent item : this.group) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #group} (Nested group, containing nested question for this question. The order of groups within the question is relevant.) - */ - // syntactic sugar - public GroupComponent addGroup() { //3 - GroupComponent t = new GroupComponent(); - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return t; - } - - // syntactic sugar - public QuestionComponent addGroup(GroupComponent t) { //3 - if (t == null) - return this; - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("linkId", "string", "Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource.", 0, java.lang.Integer.MAX_VALUE, linkId)); - childrenList.add(new Property("text", "string", "The actual question as shown to the user to prompt them for an answer.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("answer", "", "The respondent's answer(s) to the question.", 0, java.lang.Integer.MAX_VALUE, answer)); - childrenList.add(new Property("group", "@QuestionnaireAnswers.group", "Nested group, containing nested question for this question. The order of groups within the question is relevant.", 0, java.lang.Integer.MAX_VALUE, group)); - } - - public QuestionComponent copy() { - QuestionComponent dst = new QuestionComponent(); - copyValues(dst); - dst.linkId = linkId == null ? null : linkId.copy(); - dst.text = text == null ? null : text.copy(); - if (answer != null) { - dst.answer = new ArrayList(); - for (QuestionAnswerComponent i : answer) - dst.answer.add(i.copy()); - }; - if (group != null) { - dst.group = new ArrayList(); - for (GroupComponent i : group) - dst.group.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof QuestionComponent)) - return false; - QuestionComponent o = (QuestionComponent) other; - return compareDeep(linkId, o.linkId, true) && compareDeep(text, o.text, true) && compareDeep(answer, o.answer, true) - && compareDeep(group, o.group, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof QuestionComponent)) - return false; - QuestionComponent o = (QuestionComponent) other; - return compareValues(linkId, o.linkId, true) && compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (text == null || text.isEmpty()) - && (answer == null || answer.isEmpty()) && (group == null || group.isEmpty()); - } - - } - - @Block() - public static class QuestionAnswerComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The answer (or one of the answers) provided by the respondant to the question. - */ - @Child(name = "value", type = {BooleanType.class, DecimalType.class, IntegerType.class, DateType.class, DateTimeType.class, InstantType.class, TimeType.class, StringType.class, UriType.class, Attachment.class, Coding.class, Quantity.class}, order=1, min=0, max=1) - @Description(shortDefinition="Single-valued answer to the question", formalDefinition="The answer (or one of the answers) provided by the respondant to the question." ) - protected Type value; - - private static final long serialVersionUID = -732981989L; - - /* - * Constructor - */ - public QuestionAnswerComponent() { - super(); - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) - */ - public Type getValue() { - return this.value; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) - */ - public BooleanType getValueBooleanType() throws Exception { - if (!(this.value instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (BooleanType) this.value; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) - */ - public DecimalType getValueDecimalType() throws Exception { - if (!(this.value instanceof DecimalType)) - throw new Exception("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (DecimalType) this.value; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) - */ - public IntegerType getValueIntegerType() throws Exception { - if (!(this.value instanceof IntegerType)) - throw new Exception("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (IntegerType) this.value; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) - */ - public DateType getValueDateType() throws Exception { - if (!(this.value instanceof DateType)) - throw new Exception("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (DateType) this.value; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) - */ - public DateTimeType getValueDateTimeType() throws Exception { - if (!(this.value instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (DateTimeType) this.value; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) - */ - public InstantType getValueInstantType() throws Exception { - if (!(this.value instanceof InstantType)) - throw new Exception("Type mismatch: the type InstantType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (InstantType) this.value; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) - */ - public TimeType getValueTimeType() throws Exception { - if (!(this.value instanceof TimeType)) - throw new Exception("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (TimeType) this.value; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) - */ - public StringType getValueStringType() throws Exception { - if (!(this.value instanceof StringType)) - throw new Exception("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (StringType) this.value; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) - */ - public UriType getValueUriType() throws Exception { - if (!(this.value instanceof UriType)) - throw new Exception("Type mismatch: the type UriType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (UriType) this.value; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) - */ - public Attachment getValueAttachment() throws Exception { - if (!(this.value instanceof Attachment)) - throw new Exception("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Attachment) this.value; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) - */ - public Coding getValueCoding() throws Exception { - if (!(this.value instanceof Coding)) - throw new Exception("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Coding) this.value; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) - */ - public Quantity getValueQuantity() throws Exception { - if (!(this.value instanceof Quantity)) - throw new Exception("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Quantity) this.value; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) - */ - public Reference getValueReference() throws Exception { - if (!(this.value instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Reference) this.value; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) - */ - public QuestionAnswerComponent setValue(Type value) { - this.value = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("value[x]", "boolean|decimal|integer|date|dateTime|instant|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The answer (or one of the answers) provided by the respondant to the question.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public QuestionAnswerComponent copy() { - QuestionAnswerComponent dst = new QuestionAnswerComponent(); - copyValues(dst); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof QuestionAnswerComponent)) - return false; - QuestionAnswerComponent o = (QuestionAnswerComponent) other; - return compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof QuestionAnswerComponent)) - return false; - QuestionAnswerComponent o = (QuestionAnswerComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()); - } - - } - - /** - * A business identifier assigned to a particular completed (or partially completed) questionnaire. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1) - @Description(shortDefinition="Unique id for this set of answers", formalDefinition="A business identifier assigned to a particular completed (or partially completed) questionnaire." ) - protected Identifier identifier; - - /** - * Indicates the Questionnaire resource that defines the form for which answers are being provided. - */ - @Child(name = "questionnaire", type = {Questionnaire.class}, order=1, min=0, max=1) - @Description(shortDefinition="Form being answered", formalDefinition="Indicates the Questionnaire resource that defines the form for which answers are being provided." ) - protected Reference questionnaire; - - /** - * The actual object that is the target of the reference (Indicates the Questionnaire resource that defines the form for which answers are being provided.) - */ - protected Questionnaire questionnaireTarget; - - /** - * The lifecycle status of the questionnaire answers as a whole. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="in-progress | completed | amended", formalDefinition="The lifecycle status of the questionnaire answers as a whole." ) - protected Enumeration status; - - /** - * The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information. - */ - @Child(name = "subject", type = {}, order=3, min=0, max=1) - @Description(shortDefinition="The subject of the questions", formalDefinition="The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) - */ - protected Resource subjectTarget; - - /** - * Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system. - */ - @Child(name = "author", type = {Device.class, Practitioner.class, Patient.class, RelatedPerson.class}, order=4, min=0, max=1) - @Description(shortDefinition="Person who received and recorded the answers", formalDefinition="Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.) - */ - protected Resource authorTarget; - - /** - * The date and/or time that this version of the questionnaire answers was authored. - */ - @Child(name = "authored", type = {DateTimeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Date this version was authored", formalDefinition="The date and/or time that this version of the questionnaire answers was authored." ) - protected DateTimeType authored; - - /** - * The person who answered the questions about the subject. - */ - @Child(name = "source", type = {Patient.class, Practitioner.class, RelatedPerson.class}, order=6, min=0, max=1) - @Description(shortDefinition="The person who answered the questions", formalDefinition="The person who answered the questions about the subject." ) - protected Reference source; - - /** - * The actual object that is the target of the reference (The person who answered the questions about the subject.) - */ - protected Resource sourceTarget; - - /** - * Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers. - */ - @Child(name = "encounter", type = {Encounter.class}, order=7, min=0, max=1) - @Description(shortDefinition="Primary encounter during which the answers were collected", formalDefinition="Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) - */ - protected Encounter encounterTarget; - - /** - * A group of questions to a possibly similarly grouped set of questions in the questionnaire answers. - */ - @Child(name = "group", type = {}, order=8, min=0, max=1) - @Description(shortDefinition="Grouped questions", formalDefinition="A group of questions to a possibly similarly grouped set of questions in the questionnaire answers." ) - protected GroupComponent group; - - private static final long serialVersionUID = -949684393L; - - /* - * Constructor - */ - public QuestionnaireAnswers() { - super(); - } - - /* - * Constructor - */ - public QuestionnaireAnswers(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #identifier} (A business identifier assigned to a particular completed (or partially completed) questionnaire.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (A business identifier assigned to a particular completed (or partially completed) questionnaire.) - */ - public QuestionnaireAnswers setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #questionnaire} (Indicates the Questionnaire resource that defines the form for which answers are being provided.) - */ - public Reference getQuestionnaire() { - if (this.questionnaire == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.questionnaire"); - else if (Configuration.doAutoCreate()) - this.questionnaire = new Reference(); // cc - return this.questionnaire; - } - - public boolean hasQuestionnaire() { - return this.questionnaire != null && !this.questionnaire.isEmpty(); - } - - /** - * @param value {@link #questionnaire} (Indicates the Questionnaire resource that defines the form for which answers are being provided.) - */ - public QuestionnaireAnswers setQuestionnaire(Reference value) { - this.questionnaire = value; - return this; - } - - /** - * @return {@link #questionnaire} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates the Questionnaire resource that defines the form for which answers are being provided.) - */ - public Questionnaire getQuestionnaireTarget() { - if (this.questionnaireTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.questionnaire"); - else if (Configuration.doAutoCreate()) - this.questionnaireTarget = new Questionnaire(); // aa - return this.questionnaireTarget; - } - - /** - * @param value {@link #questionnaire} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates the Questionnaire resource that defines the form for which answers are being provided.) - */ - public QuestionnaireAnswers setQuestionnaireTarget(Questionnaire value) { - this.questionnaireTarget = value; - return this; - } - - /** - * @return {@link #status} (The lifecycle status of the questionnaire answers as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new QuestionnaireAnswersStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The lifecycle status of the questionnaire answers as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public QuestionnaireAnswers setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The lifecycle status of the questionnaire answers as a whole. - */ - public QuestionnaireAnswersStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The lifecycle status of the questionnaire answers as a whole. - */ - public QuestionnaireAnswers setStatus(QuestionnaireAnswersStatus value) { - if (this.status == null) - this.status = new Enumeration(new QuestionnaireAnswersStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #subject} (The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) - */ - public QuestionnaireAnswers setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) - */ - public QuestionnaireAnswers setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #author} (Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); // cc - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.) - */ - public QuestionnaireAnswers setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.) - */ - public Resource getAuthorTarget() { - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.) - */ - public QuestionnaireAnswers setAuthorTarget(Resource value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #authored} (The date and/or time that this version of the questionnaire answers was authored.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value - */ - public DateTimeType getAuthoredElement() { - if (this.authored == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.authored"); - else if (Configuration.doAutoCreate()) - this.authored = new DateTimeType(); // bb - return this.authored; - } - - public boolean hasAuthoredElement() { - return this.authored != null && !this.authored.isEmpty(); - } - - public boolean hasAuthored() { - return this.authored != null && !this.authored.isEmpty(); - } - - /** - * @param value {@link #authored} (The date and/or time that this version of the questionnaire answers was authored.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value - */ - public QuestionnaireAnswers setAuthoredElement(DateTimeType value) { - this.authored = value; - return this; - } - - /** - * @return The date and/or time that this version of the questionnaire answers was authored. - */ - public Date getAuthored() { - return this.authored == null ? null : this.authored.getValue(); - } - - /** - * @param value The date and/or time that this version of the questionnaire answers was authored. - */ - public QuestionnaireAnswers setAuthored(Date value) { - if (value == null) - this.authored = null; - else { - if (this.authored == null) - this.authored = new DateTimeType(); - this.authored.setValue(value); - } - return this; - } - - /** - * @return {@link #source} (The person who answered the questions about the subject.) - */ - public Reference getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.source"); - else if (Configuration.doAutoCreate()) - this.source = new Reference(); // cc - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (The person who answered the questions about the subject.) - */ - public QuestionnaireAnswers setSource(Reference value) { - this.source = value; - return this; - } - - /** - * @return {@link #source} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person who answered the questions about the subject.) - */ - public Resource getSourceTarget() { - return this.sourceTarget; - } - - /** - * @param value {@link #source} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person who answered the questions about the subject.) - */ - public QuestionnaireAnswers setSourceTarget(Resource value) { - this.sourceTarget = value; - return this; - } - - /** - * @return {@link #encounter} (Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) - */ - public QuestionnaireAnswers setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) - */ - public QuestionnaireAnswers setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #group} (A group of questions to a possibly similarly grouped set of questions in the questionnaire answers.) - */ - public GroupComponent getGroup() { - if (this.group == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.group"); - else if (Configuration.doAutoCreate()) - this.group = new GroupComponent(); // cc - return this.group; - } - - public boolean hasGroup() { - return this.group != null && !this.group.isEmpty(); - } - - /** - * @param value {@link #group} (A group of questions to a possibly similarly grouped set of questions in the questionnaire answers.) - */ - public QuestionnaireAnswers setGroup(GroupComponent value) { - this.group = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "A business identifier assigned to a particular completed (or partially completed) questionnaire.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("questionnaire", "Reference(Questionnaire)", "Indicates the Questionnaire resource that defines the form for which answers are being provided.", 0, java.lang.Integer.MAX_VALUE, questionnaire)); - childrenList.add(new Property("status", "code", "The lifecycle status of the questionnaire answers as a whole.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("subject", "Reference(Any)", "The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("author", "Reference(Device|Practitioner|Patient|RelatedPerson)", "Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("authored", "dateTime", "The date and/or time that this version of the questionnaire answers was authored.", 0, java.lang.Integer.MAX_VALUE, authored)); - childrenList.add(new Property("source", "Reference(Patient|Practitioner|RelatedPerson)", "The person who answered the questions about the subject.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("group", "", "A group of questions to a possibly similarly grouped set of questions in the questionnaire answers.", 0, java.lang.Integer.MAX_VALUE, group)); - } - - public QuestionnaireAnswers copy() { - QuestionnaireAnswers dst = new QuestionnaireAnswers(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.questionnaire = questionnaire == null ? null : questionnaire.copy(); - dst.status = status == null ? null : status.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.author = author == null ? null : author.copy(); - dst.authored = authored == null ? null : authored.copy(); - dst.source = source == null ? null : source.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.group = group == null ? null : group.copy(); - return dst; - } - - protected QuestionnaireAnswers typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof QuestionnaireAnswers)) - return false; - QuestionnaireAnswers o = (QuestionnaireAnswers) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(questionnaire, o.questionnaire, true) - && compareDeep(status, o.status, true) && compareDeep(subject, o.subject, true) && compareDeep(author, o.author, true) - && compareDeep(authored, o.authored, true) && compareDeep(source, o.source, true) && compareDeep(encounter, o.encounter, true) - && compareDeep(group, o.group, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof QuestionnaireAnswers)) - return false; - QuestionnaireAnswers o = (QuestionnaireAnswers) other; - return compareValues(status, o.status, true) && compareValues(authored, o.authored, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (questionnaire == null || questionnaire.isEmpty()) - && (status == null || status.isEmpty()) && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) - && (authored == null || authored.isEmpty()) && (source == null || source.isEmpty()) && (encounter == null || encounter.isEmpty()) - && (group == null || group.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.QuestionnaireAnswers; - } - - @SearchParamDefinition(name="author", path="QuestionnaireAnswers.author", description="The author of the questionnaire", type="reference" ) - public static final String SP_AUTHOR = "author"; - @SearchParamDefinition(name="questionnaire", path="QuestionnaireAnswers.questionnaire", description="The questionnaire the answers are provided for", type="reference" ) - public static final String SP_QUESTIONNAIRE = "questionnaire"; - @SearchParamDefinition(name="patient", path="QuestionnaireAnswers.subject", description="The patient that is the subject of the questionnaire", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="authored", path="QuestionnaireAnswers.authored", description="When the questionnaire was authored", type="date" ) - public static final String SP_AUTHORED = "authored"; - @SearchParamDefinition(name="source", path="QuestionnaireAnswers.source", description="The person who answered the questions", type="reference" ) - public static final String SP_SOURCE = "source"; - @SearchParamDefinition(name="status", path="QuestionnaireAnswers.status", description="The status of the questionnaire answers", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="subject", path="QuestionnaireAnswers.subject", description="The subject of the questionnaire", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="encounter", path="QuestionnaireAnswers.encounter", description="Encounter during which questionnaire was authored", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + */ +@ResourceDef(name="QuestionnaireAnswers", profile="http://hl7.org/fhir/Profile/QuestionnaireAnswers") +public class QuestionnaireAnswers extends DomainResource { + + public enum QuestionnaireAnswersStatus { + /** + * This QuestionnaireAnswers has been partially filled out with answers, but changes or additions are still expected to be made to it. + */ + INPROGRESS, + /** + * This QuestionnaireAnswers has been filled out with answers, and the current content is regarded as definitive. + */ + COMPLETED, + /** + * This QuestionnaireAnswers has been filled out with answers, then marked as complete, yet changes or additions have been made to it afterwards. + */ + AMENDED, + /** + * added to help the parsers + */ + NULL; + public static QuestionnaireAnswersStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("completed".equals(codeString)) + return COMPLETED; + if ("amended".equals(codeString)) + return AMENDED; + throw new Exception("Unknown QuestionnaireAnswersStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INPROGRESS: return "in-progress"; + case COMPLETED: return "completed"; + case AMENDED: return "amended"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return ""; + case COMPLETED: return ""; + case AMENDED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "This QuestionnaireAnswers has been partially filled out with answers, but changes or additions are still expected to be made to it."; + case COMPLETED: return "This QuestionnaireAnswers has been filled out with answers, and the current content is regarded as definitive."; + case AMENDED: return "This QuestionnaireAnswers has been filled out with answers, then marked as complete, yet changes or additions have been made to it afterwards."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "in-progress"; + case COMPLETED: return "completed"; + case AMENDED: return "amended"; + default: return "?"; + } + } + } + + public static class QuestionnaireAnswersStatusEnumFactory implements EnumFactory { + public QuestionnaireAnswersStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return QuestionnaireAnswersStatus.INPROGRESS; + if ("completed".equals(codeString)) + return QuestionnaireAnswersStatus.COMPLETED; + if ("amended".equals(codeString)) + return QuestionnaireAnswersStatus.AMENDED; + throw new IllegalArgumentException("Unknown QuestionnaireAnswersStatus code '"+codeString+"'"); + } + public String toCode(QuestionnaireAnswersStatus code) { + if (code == QuestionnaireAnswersStatus.INPROGRESS) + return "in-progress"; + if (code == QuestionnaireAnswersStatus.COMPLETED) + return "completed"; + if (code == QuestionnaireAnswersStatus.AMENDED) + return "amended"; + return "?"; + } + } + + @Block() + public static class GroupComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource. + */ + @Child(name = "linkId", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Corresponding group within Questionnaire", formalDefinition="Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource." ) + protected StringType linkId; + + /** + * Text that is displayed above the contents of the group. + */ + @Child(name = "title", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Name for this group", formalDefinition="Text that is displayed above the contents of the group." ) + protected StringType title; + + /** + * Additional text for the group, used for display purposes. + */ + @Child(name = "text", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Additional text for the group", formalDefinition="Additional text for the group, used for display purposes." ) + protected StringType text; + + /** + * More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers. + */ + @Child(name = "subject", type = {}, order=4, min=0, max=1) + @Description(shortDefinition="The subject this group's answers are about", formalDefinition="More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.) + */ + protected Resource subjectTarget; + + /** + * A sub-group within a group. The ordering of groups within this group is relevant. + */ + @Child(name = "group", type = {GroupComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Nested questionnaire answers group", formalDefinition="A sub-group within a group. The ordering of groups within this group is relevant." ) + protected List group; + + /** + * Set of questions within this group. The order of questions within the group is relevant. + */ + @Child(name = "question", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Questions in this group", formalDefinition="Set of questions within this group. The order of questions within the group is relevant." ) + protected List question; + + private static final long serialVersionUID = -1045990435L; + + /* + * Constructor + */ + public GroupComponent() { + super(); + } + + /** + * @return {@link #linkId} (Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public StringType getLinkIdElement() { + if (this.linkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.linkId"); + else if (Configuration.doAutoCreate()) + this.linkId = new StringType(); // bb + return this.linkId; + } + + public boolean hasLinkIdElement() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + public boolean hasLinkId() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + /** + * @param value {@link #linkId} (Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public GroupComponent setLinkIdElement(StringType value) { + this.linkId = value; + return this; + } + + /** + * @return Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource. + */ + public String getLinkId() { + return this.linkId == null ? null : this.linkId.getValue(); + } + + /** + * @param value Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource. + */ + public GroupComponent setLinkId(String value) { + if (Utilities.noString(value)) + this.linkId = null; + else { + if (this.linkId == null) + this.linkId = new StringType(); + this.linkId.setValue(value); + } + return this; + } + + /** + * @return {@link #title} (Text that is displayed above the contents of the group.). 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 GroupComponent.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); // bb + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (Text that is displayed above the contents of the group.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public GroupComponent setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return Text that is displayed above the contents of the group. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value Text that is displayed above the contents of the group. + */ + public GroupComponent setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #text} (Additional text for the group, used for display purposes.). 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 GroupComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Additional text for the group, used for display purposes.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public GroupComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Additional text for the group, used for display purposes. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Additional text for the group, used for display purposes. + */ + public GroupComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #subject} (More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.) + */ + public GroupComponent setSubject(Reference value) { + this.subject = value; + return this; + } + + /** + * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.) + */ + public Resource getSubjectTarget() { + return this.subjectTarget; + } + + /** + * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.) + */ + public GroupComponent setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #group} (A sub-group within a group. The ordering of groups within this group is relevant.) + */ + public List getGroup() { + if (this.group == null) + this.group = new ArrayList(); + return this.group; + } + + public boolean hasGroup() { + if (this.group == null) + return false; + for (GroupComponent item : this.group) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #group} (A sub-group within a group. The ordering of groups within this group is relevant.) + */ + // syntactic sugar + public GroupComponent addGroup() { //3 + GroupComponent t = new GroupComponent(); + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return t; + } + + // syntactic sugar + public GroupComponent addGroup(GroupComponent t) { //3 + if (t == null) + return this; + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return this; + } + + /** + * @return {@link #question} (Set of questions within this group. The order of questions within the group is relevant.) + */ + public List getQuestion() { + if (this.question == null) + this.question = new ArrayList(); + return this.question; + } + + public boolean hasQuestion() { + if (this.question == null) + return false; + for (QuestionComponent item : this.question) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #question} (Set of questions within this group. The order of questions within the group is relevant.) + */ + // syntactic sugar + public QuestionComponent addQuestion() { //3 + QuestionComponent t = new QuestionComponent(); + if (this.question == null) + this.question = new ArrayList(); + this.question.add(t); + return t; + } + + // syntactic sugar + public GroupComponent addQuestion(QuestionComponent t) { //3 + if (t == null) + return this; + if (this.question == null) + this.question = new ArrayList(); + this.question.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("linkId", "string", "Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource.", 0, java.lang.Integer.MAX_VALUE, linkId)); + childrenList.add(new Property("title", "string", "Text that is displayed above the contents of the group.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("text", "string", "Additional text for the group, used for display purposes.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("subject", "Reference(Any)", "More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("group", "@QuestionnaireAnswers.group", "A sub-group within a group. The ordering of groups within this group is relevant.", 0, java.lang.Integer.MAX_VALUE, group)); + childrenList.add(new Property("question", "", "Set of questions within this group. The order of questions within the group is relevant.", 0, java.lang.Integer.MAX_VALUE, question)); + } + + public GroupComponent copy() { + GroupComponent dst = new GroupComponent(); + copyValues(dst); + dst.linkId = linkId == null ? null : linkId.copy(); + dst.title = title == null ? null : title.copy(); + dst.text = text == null ? null : text.copy(); + dst.subject = subject == null ? null : subject.copy(); + if (group != null) { + dst.group = new ArrayList(); + for (GroupComponent i : group) + dst.group.add(i.copy()); + }; + if (question != null) { + dst.question = new ArrayList(); + for (QuestionComponent i : question) + dst.question.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof GroupComponent)) + return false; + GroupComponent o = (GroupComponent) other; + return compareDeep(linkId, o.linkId, true) && compareDeep(title, o.title, true) && compareDeep(text, o.text, true) + && compareDeep(subject, o.subject, true) && compareDeep(group, o.group, true) && compareDeep(question, o.question, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof GroupComponent)) + return false; + GroupComponent o = (GroupComponent) other; + return compareValues(linkId, o.linkId, true) && compareValues(title, o.title, true) && compareValues(text, o.text, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (title == null || title.isEmpty()) + && (text == null || text.isEmpty()) && (subject == null || subject.isEmpty()) && (group == null || group.isEmpty()) + && (question == null || question.isEmpty()); + } + + } + + @Block() + public static class QuestionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource. + */ + @Child(name = "linkId", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Corresponding question within Questionnaire", formalDefinition="Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource." ) + protected StringType linkId; + + /** + * The actual question as shown to the user to prompt them for an answer. + */ + @Child(name = "text", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Text of the question as it is shown to the user", formalDefinition="The actual question as shown to the user to prompt them for an answer." ) + protected StringType text; + + /** + * The respondent's answer(s) to the question. + */ + @Child(name = "answer", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The response(s) to the question", formalDefinition="The respondent's answer(s) to the question." ) + protected List answer; + + /** + * Nested group, containing nested question for this question. The order of groups within the question is relevant. + */ + @Child(name = "group", type = {GroupComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Nested questionnaire group", formalDefinition="Nested group, containing nested question for this question. The order of groups within the question is relevant." ) + protected List group; + + private static final long serialVersionUID = -564009278L; + + /* + * Constructor + */ + public QuestionComponent() { + super(); + } + + /** + * @return {@link #linkId} (Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public StringType getLinkIdElement() { + if (this.linkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionComponent.linkId"); + else if (Configuration.doAutoCreate()) + this.linkId = new StringType(); // bb + return this.linkId; + } + + public boolean hasLinkIdElement() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + public boolean hasLinkId() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + /** + * @param value {@link #linkId} (Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public QuestionComponent setLinkIdElement(StringType value) { + this.linkId = value; + return this; + } + + /** + * @return Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource. + */ + public String getLinkId() { + return this.linkId == null ? null : this.linkId.getValue(); + } + + /** + * @param value Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource. + */ + public QuestionComponent setLinkId(String value) { + if (Utilities.noString(value)) + this.linkId = null; + else { + if (this.linkId == null) + this.linkId = new StringType(); + this.linkId.setValue(value); + } + return this; + } + + /** + * @return {@link #text} (The actual question as shown to the user to prompt them for an answer.). 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 QuestionComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (The actual question as shown to the user to prompt them for an answer.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public QuestionComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return The actual question as shown to the user to prompt them for an answer. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value The actual question as shown to the user to prompt them for an answer. + */ + public QuestionComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #answer} (The respondent's answer(s) to the question.) + */ + public List getAnswer() { + if (this.answer == null) + this.answer = new ArrayList(); + return this.answer; + } + + public boolean hasAnswer() { + if (this.answer == null) + return false; + for (QuestionAnswerComponent item : this.answer) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #answer} (The respondent's answer(s) to the question.) + */ + // syntactic sugar + public QuestionAnswerComponent addAnswer() { //3 + QuestionAnswerComponent t = new QuestionAnswerComponent(); + if (this.answer == null) + this.answer = new ArrayList(); + this.answer.add(t); + return t; + } + + // syntactic sugar + public QuestionComponent addAnswer(QuestionAnswerComponent t) { //3 + if (t == null) + return this; + if (this.answer == null) + this.answer = new ArrayList(); + this.answer.add(t); + return this; + } + + /** + * @return {@link #group} (Nested group, containing nested question for this question. The order of groups within the question is relevant.) + */ + public List getGroup() { + if (this.group == null) + this.group = new ArrayList(); + return this.group; + } + + public boolean hasGroup() { + if (this.group == null) + return false; + for (GroupComponent item : this.group) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #group} (Nested group, containing nested question for this question. The order of groups within the question is relevant.) + */ + // syntactic sugar + public GroupComponent addGroup() { //3 + GroupComponent t = new GroupComponent(); + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return t; + } + + // syntactic sugar + public QuestionComponent addGroup(GroupComponent t) { //3 + if (t == null) + return this; + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("linkId", "string", "Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource.", 0, java.lang.Integer.MAX_VALUE, linkId)); + childrenList.add(new Property("text", "string", "The actual question as shown to the user to prompt them for an answer.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("answer", "", "The respondent's answer(s) to the question.", 0, java.lang.Integer.MAX_VALUE, answer)); + childrenList.add(new Property("group", "@QuestionnaireAnswers.group", "Nested group, containing nested question for this question. The order of groups within the question is relevant.", 0, java.lang.Integer.MAX_VALUE, group)); + } + + public QuestionComponent copy() { + QuestionComponent dst = new QuestionComponent(); + copyValues(dst); + dst.linkId = linkId == null ? null : linkId.copy(); + dst.text = text == null ? null : text.copy(); + if (answer != null) { + dst.answer = new ArrayList(); + for (QuestionAnswerComponent i : answer) + dst.answer.add(i.copy()); + }; + if (group != null) { + dst.group = new ArrayList(); + for (GroupComponent i : group) + dst.group.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof QuestionComponent)) + return false; + QuestionComponent o = (QuestionComponent) other; + return compareDeep(linkId, o.linkId, true) && compareDeep(text, o.text, true) && compareDeep(answer, o.answer, true) + && compareDeep(group, o.group, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof QuestionComponent)) + return false; + QuestionComponent o = (QuestionComponent) other; + return compareValues(linkId, o.linkId, true) && compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (text == null || text.isEmpty()) + && (answer == null || answer.isEmpty()) && (group == null || group.isEmpty()); + } + + } + + @Block() + public static class QuestionAnswerComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The answer (or one of the answers) provided by the respondant to the question. + */ + @Child(name = "value", type = {BooleanType.class, DecimalType.class, IntegerType.class, DateType.class, DateTimeType.class, InstantType.class, TimeType.class, StringType.class, UriType.class, Attachment.class, Coding.class, Quantity.class}, order=1, min=0, max=1) + @Description(shortDefinition="Single-valued answer to the question", formalDefinition="The answer (or one of the answers) provided by the respondant to the question." ) + protected Type value; + + private static final long serialVersionUID = -732981989L; + + /* + * Constructor + */ + public QuestionAnswerComponent() { + super(); + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) + */ + public Type getValue() { + return this.value; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) + */ + public BooleanType getValueBooleanType() throws Exception { + if (!(this.value instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (BooleanType) this.value; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) + */ + public DecimalType getValueDecimalType() throws Exception { + if (!(this.value instanceof DecimalType)) + throw new Exception("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (DecimalType) this.value; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) + */ + public IntegerType getValueIntegerType() throws Exception { + if (!(this.value instanceof IntegerType)) + throw new Exception("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (IntegerType) this.value; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) + */ + public DateType getValueDateType() throws Exception { + if (!(this.value instanceof DateType)) + throw new Exception("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (DateType) this.value; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) + */ + public DateTimeType getValueDateTimeType() throws Exception { + if (!(this.value instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (DateTimeType) this.value; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) + */ + public InstantType getValueInstantType() throws Exception { + if (!(this.value instanceof InstantType)) + throw new Exception("Type mismatch: the type InstantType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (InstantType) this.value; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) + */ + public TimeType getValueTimeType() throws Exception { + if (!(this.value instanceof TimeType)) + throw new Exception("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (TimeType) this.value; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) + */ + public StringType getValueStringType() throws Exception { + if (!(this.value instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (StringType) this.value; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) + */ + public UriType getValueUriType() throws Exception { + if (!(this.value instanceof UriType)) + throw new Exception("Type mismatch: the type UriType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (UriType) this.value; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) + */ + public Attachment getValueAttachment() throws Exception { + if (!(this.value instanceof Attachment)) + throw new Exception("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Attachment) this.value; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) + */ + public Coding getValueCoding() throws Exception { + if (!(this.value instanceof Coding)) + throw new Exception("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Coding) this.value; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) + */ + public Quantity getValueQuantity() throws Exception { + if (!(this.value instanceof Quantity)) + throw new Exception("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Quantity) this.value; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) + */ + public Reference getValueReference() throws Exception { + if (!(this.value instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Reference) this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The answer (or one of the answers) provided by the respondant to the question.) + */ + public QuestionAnswerComponent setValue(Type value) { + this.value = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("value[x]", "boolean|decimal|integer|date|dateTime|instant|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The answer (or one of the answers) provided by the respondant to the question.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public QuestionAnswerComponent copy() { + QuestionAnswerComponent dst = new QuestionAnswerComponent(); + copyValues(dst); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof QuestionAnswerComponent)) + return false; + QuestionAnswerComponent o = (QuestionAnswerComponent) other; + return compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof QuestionAnswerComponent)) + return false; + QuestionAnswerComponent o = (QuestionAnswerComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()); + } + + } + + /** + * A business identifier assigned to a particular completed (or partially completed) questionnaire. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1) + @Description(shortDefinition="Unique id for this set of answers", formalDefinition="A business identifier assigned to a particular completed (or partially completed) questionnaire." ) + protected Identifier identifier; + + /** + * Indicates the Questionnaire resource that defines the form for which answers are being provided. + */ + @Child(name = "questionnaire", type = {Questionnaire.class}, order=1, min=0, max=1) + @Description(shortDefinition="Form being answered", formalDefinition="Indicates the Questionnaire resource that defines the form for which answers are being provided." ) + protected Reference questionnaire; + + /** + * The actual object that is the target of the reference (Indicates the Questionnaire resource that defines the form for which answers are being provided.) + */ + protected Questionnaire questionnaireTarget; + + /** + * The lifecycle status of the questionnaire answers as a whole. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="in-progress | completed | amended", formalDefinition="The lifecycle status of the questionnaire answers as a whole." ) + protected Enumeration status; + + /** + * The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information. + */ + @Child(name = "subject", type = {}, order=3, min=0, max=1) + @Description(shortDefinition="The subject of the questions", formalDefinition="The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) + */ + protected Resource subjectTarget; + + /** + * Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system. + */ + @Child(name = "author", type = {Device.class, Practitioner.class, Patient.class, RelatedPerson.class}, order=4, min=0, max=1) + @Description(shortDefinition="Person who received and recorded the answers", formalDefinition="Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.) + */ + protected Resource authorTarget; + + /** + * The date and/or time that this version of the questionnaire answers was authored. + */ + @Child(name = "authored", type = {DateTimeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Date this version was authored", formalDefinition="The date and/or time that this version of the questionnaire answers was authored." ) + protected DateTimeType authored; + + /** + * The person who answered the questions about the subject. + */ + @Child(name = "source", type = {Patient.class, Practitioner.class, RelatedPerson.class}, order=6, min=0, max=1) + @Description(shortDefinition="The person who answered the questions", formalDefinition="The person who answered the questions about the subject." ) + protected Reference source; + + /** + * The actual object that is the target of the reference (The person who answered the questions about the subject.) + */ + protected Resource sourceTarget; + + /** + * Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers. + */ + @Child(name = "encounter", type = {Encounter.class}, order=7, min=0, max=1) + @Description(shortDefinition="Primary encounter during which the answers were collected", formalDefinition="Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) + */ + protected Encounter encounterTarget; + + /** + * A group of questions to a possibly similarly grouped set of questions in the questionnaire answers. + */ + @Child(name = "group", type = {}, order=8, min=0, max=1) + @Description(shortDefinition="Grouped questions", formalDefinition="A group of questions to a possibly similarly grouped set of questions in the questionnaire answers." ) + protected GroupComponent group; + + private static final long serialVersionUID = -949684393L; + + /* + * Constructor + */ + public QuestionnaireAnswers() { + super(); + } + + /* + * Constructor + */ + public QuestionnaireAnswers(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #identifier} (A business identifier assigned to a particular completed (or partially completed) questionnaire.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (A business identifier assigned to a particular completed (or partially completed) questionnaire.) + */ + public QuestionnaireAnswers setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #questionnaire} (Indicates the Questionnaire resource that defines the form for which answers are being provided.) + */ + public Reference getQuestionnaire() { + if (this.questionnaire == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.questionnaire"); + else if (Configuration.doAutoCreate()) + this.questionnaire = new Reference(); // cc + return this.questionnaire; + } + + public boolean hasQuestionnaire() { + return this.questionnaire != null && !this.questionnaire.isEmpty(); + } + + /** + * @param value {@link #questionnaire} (Indicates the Questionnaire resource that defines the form for which answers are being provided.) + */ + public QuestionnaireAnswers setQuestionnaire(Reference value) { + this.questionnaire = value; + return this; + } + + /** + * @return {@link #questionnaire} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates the Questionnaire resource that defines the form for which answers are being provided.) + */ + public Questionnaire getQuestionnaireTarget() { + if (this.questionnaireTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.questionnaire"); + else if (Configuration.doAutoCreate()) + this.questionnaireTarget = new Questionnaire(); // aa + return this.questionnaireTarget; + } + + /** + * @param value {@link #questionnaire} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates the Questionnaire resource that defines the form for which answers are being provided.) + */ + public QuestionnaireAnswers setQuestionnaireTarget(Questionnaire value) { + this.questionnaireTarget = value; + return this; + } + + /** + * @return {@link #status} (The lifecycle status of the questionnaire answers as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new QuestionnaireAnswersStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The lifecycle status of the questionnaire answers as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public QuestionnaireAnswers setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The lifecycle status of the questionnaire answers as a whole. + */ + public QuestionnaireAnswersStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The lifecycle status of the questionnaire answers as a whole. + */ + public QuestionnaireAnswers setStatus(QuestionnaireAnswersStatus value) { + if (this.status == null) + this.status = new Enumeration(new QuestionnaireAnswersStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #subject} (The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) + */ + public QuestionnaireAnswers setSubject(Reference value) { + this.subject = value; + return this; + } + + /** + * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) + */ + public Resource getSubjectTarget() { + return this.subjectTarget; + } + + /** + * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) + */ + public QuestionnaireAnswers setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #author} (Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); // cc + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.) + */ + public QuestionnaireAnswers setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.) + */ + public Resource getAuthorTarget() { + return this.authorTarget; + } + + /** + * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.) + */ + public QuestionnaireAnswers setAuthorTarget(Resource value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #authored} (The date and/or time that this version of the questionnaire answers was authored.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value + */ + public DateTimeType getAuthoredElement() { + if (this.authored == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.authored"); + else if (Configuration.doAutoCreate()) + this.authored = new DateTimeType(); // bb + return this.authored; + } + + public boolean hasAuthoredElement() { + return this.authored != null && !this.authored.isEmpty(); + } + + public boolean hasAuthored() { + return this.authored != null && !this.authored.isEmpty(); + } + + /** + * @param value {@link #authored} (The date and/or time that this version of the questionnaire answers was authored.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value + */ + public QuestionnaireAnswers setAuthoredElement(DateTimeType value) { + this.authored = value; + return this; + } + + /** + * @return The date and/or time that this version of the questionnaire answers was authored. + */ + public Date getAuthored() { + return this.authored == null ? null : this.authored.getValue(); + } + + /** + * @param value The date and/or time that this version of the questionnaire answers was authored. + */ + public QuestionnaireAnswers setAuthored(Date value) { + if (value == null) + this.authored = null; + else { + if (this.authored == null) + this.authored = new DateTimeType(); + this.authored.setValue(value); + } + return this; + } + + /** + * @return {@link #source} (The person who answered the questions about the subject.) + */ + public Reference getSource() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.source"); + else if (Configuration.doAutoCreate()) + this.source = new Reference(); // cc + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (The person who answered the questions about the subject.) + */ + public QuestionnaireAnswers setSource(Reference value) { + this.source = value; + return this; + } + + /** + * @return {@link #source} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person who answered the questions about the subject.) + */ + public Resource getSourceTarget() { + return this.sourceTarget; + } + + /** + * @param value {@link #source} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person who answered the questions about the subject.) + */ + public QuestionnaireAnswers setSourceTarget(Resource value) { + this.sourceTarget = value; + return this; + } + + /** + * @return {@link #encounter} (Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) + */ + public QuestionnaireAnswers setEncounter(Reference value) { + this.encounter = value; + return this; + } + + /** + * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + return this.encounterTarget; + } + + /** + * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) + */ + public QuestionnaireAnswers setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #group} (A group of questions to a possibly similarly grouped set of questions in the questionnaire answers.) + */ + public GroupComponent getGroup() { + if (this.group == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.group"); + else if (Configuration.doAutoCreate()) + this.group = new GroupComponent(); // cc + return this.group; + } + + public boolean hasGroup() { + return this.group != null && !this.group.isEmpty(); + } + + /** + * @param value {@link #group} (A group of questions to a possibly similarly grouped set of questions in the questionnaire answers.) + */ + public QuestionnaireAnswers setGroup(GroupComponent value) { + this.group = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "A business identifier assigned to a particular completed (or partially completed) questionnaire.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("questionnaire", "Reference(Questionnaire)", "Indicates the Questionnaire resource that defines the form for which answers are being provided.", 0, java.lang.Integer.MAX_VALUE, questionnaire)); + childrenList.add(new Property("status", "code", "The lifecycle status of the questionnaire answers as a whole.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("subject", "Reference(Any)", "The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("author", "Reference(Device|Practitioner|Patient|RelatedPerson)", "Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("authored", "dateTime", "The date and/or time that this version of the questionnaire answers was authored.", 0, java.lang.Integer.MAX_VALUE, authored)); + childrenList.add(new Property("source", "Reference(Patient|Practitioner|RelatedPerson)", "The person who answered the questions about the subject.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("group", "", "A group of questions to a possibly similarly grouped set of questions in the questionnaire answers.", 0, java.lang.Integer.MAX_VALUE, group)); + } + + public QuestionnaireAnswers copy() { + QuestionnaireAnswers dst = new QuestionnaireAnswers(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.questionnaire = questionnaire == null ? null : questionnaire.copy(); + dst.status = status == null ? null : status.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.author = author == null ? null : author.copy(); + dst.authored = authored == null ? null : authored.copy(); + dst.source = source == null ? null : source.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.group = group == null ? null : group.copy(); + return dst; + } + + protected QuestionnaireAnswers typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof QuestionnaireAnswers)) + return false; + QuestionnaireAnswers o = (QuestionnaireAnswers) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(questionnaire, o.questionnaire, true) + && compareDeep(status, o.status, true) && compareDeep(subject, o.subject, true) && compareDeep(author, o.author, true) + && compareDeep(authored, o.authored, true) && compareDeep(source, o.source, true) && compareDeep(encounter, o.encounter, true) + && compareDeep(group, o.group, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof QuestionnaireAnswers)) + return false; + QuestionnaireAnswers o = (QuestionnaireAnswers) other; + return compareValues(status, o.status, true) && compareValues(authored, o.authored, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (questionnaire == null || questionnaire.isEmpty()) + && (status == null || status.isEmpty()) && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) + && (authored == null || authored.isEmpty()) && (source == null || source.isEmpty()) && (encounter == null || encounter.isEmpty()) + && (group == null || group.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.QuestionnaireAnswers; + } + + @SearchParamDefinition(name="authored", path="QuestionnaireAnswers.authored", description="When the questionnaire was authored", type="date" ) + public static final String SP_AUTHORED = "authored"; + @SearchParamDefinition(name="questionnaire", path="QuestionnaireAnswers.questionnaire", description="The questionnaire the answers are provided for", type="reference" ) + public static final String SP_QUESTIONNAIRE = "questionnaire"; + @SearchParamDefinition(name="subject", path="QuestionnaireAnswers.subject", description="The subject of the questionnaire", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="author", path="QuestionnaireAnswers.author", description="The author of the questionnaire", type="reference" ) + public static final String SP_AUTHOR = "author"; + @SearchParamDefinition(name="patient", path="QuestionnaireAnswers.subject", description="The patient that is the subject of the questionnaire", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="encounter", path="QuestionnaireAnswers.encounter", description="Encounter during which questionnaire was authored", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + @SearchParamDefinition(name="source", path="QuestionnaireAnswers.source", description="The person who answered the questions", type="reference" ) + public static final String SP_SOURCE = "source"; + @SearchParamDefinition(name="status", path="QuestionnaireAnswers.status", description="The status of the questionnaire answers", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Range.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Range.java index 553fb462740..0e795628e06 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Range.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Range.java @@ -1,184 +1,163 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A set of ordered Quantities defined by a low and high limit. - */ -@DatatypeDef(name="Range") -public class Range extends Type implements ICompositeType { - - /** - * The low limit. The boundary is inclusive. - */ - @Child(name = "low", type = {Quantity.class}, order=0, min=0, max=1) - @Description(shortDefinition="Low limit", formalDefinition="The low limit. The boundary is inclusive." ) - protected Quantity low; - - /** - * The high limit. The boundary is inclusive. - */ - @Child(name = "high", type = {Quantity.class}, order=1, min=0, max=1) - @Description(shortDefinition="High limit", formalDefinition="The high limit. The boundary is inclusive." ) - protected Quantity high; - - private static final long serialVersionUID = -474933350L; - - /* - * Constructor - */ - public Range() { - super(); - } - - /** - * @return {@link #low} (The low limit. The boundary is inclusive.) - */ - public Quantity getLow() { - if (this.low == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Range.low"); - else if (Configuration.doAutoCreate()) - this.low = new Quantity(); // cc - return this.low; - } - - public boolean hasLow() { - return this.low != null && !this.low.isEmpty(); - } - - /** - * @param value {@link #low} (The low limit. The boundary is inclusive.) - */ - public Range setLow(Quantity value) { - this.low = value; - return this; - } - - /** - * @return {@link #high} (The high limit. The boundary is inclusive.) - */ - public Quantity getHigh() { - if (this.high == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Range.high"); - else if (Configuration.doAutoCreate()) - this.high = new Quantity(); // cc - return this.high; - } - - public boolean hasHigh() { - return this.high != null && !this.high.isEmpty(); - } - - /** - * @param value {@link #high} (The high limit. The boundary is inclusive.) - */ - public Range setHigh(Quantity value) { - this.high = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("low", "Quantity", "The low limit. The boundary is inclusive.", 0, java.lang.Integer.MAX_VALUE, low)); - childrenList.add(new Property("high", "Quantity", "The high limit. The boundary is inclusive.", 0, java.lang.Integer.MAX_VALUE, high)); - } - - public Range copy() { - Range dst = new Range(); - copyValues(dst); - dst.low = low == null ? null : low.copy(); - dst.high = high == null ? null : high.copy(); - return dst; - } - - protected Range typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Range)) - return false; - Range o = (Range) other; - return compareDeep(low, o.low, true) && compareDeep(high, o.high, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Range)) - return false; - Range o = (Range) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (low == null || low.isEmpty()) && (high == null || high.isEmpty()) - ; - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A set of ordered Quantities defined by a low and high limit. + */ +@DatatypeDef(name="Range") +public class Range extends Type implements ICompositeType { + + /** + * The low limit. The boundary is inclusive. + */ + @Child(name = "low", type = {Quantity.class}, order=0, min=0, max=1) + @Description(shortDefinition="Low limit", formalDefinition="The low limit. The boundary is inclusive." ) + protected Quantity low; + + /** + * The high limit. The boundary is inclusive. + */ + @Child(name = "high", type = {Quantity.class}, order=1, min=0, max=1) + @Description(shortDefinition="High limit", formalDefinition="The high limit. The boundary is inclusive." ) + protected Quantity high; + + private static final long serialVersionUID = -474933350L; + + /* + * Constructor + */ + public Range() { + super(); + } + + /** + * @return {@link #low} (The low limit. The boundary is inclusive.) + */ + public Quantity getLow() { + if (this.low == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Range.low"); + else if (Configuration.doAutoCreate()) + this.low = new Quantity(); // cc + return this.low; + } + + public boolean hasLow() { + return this.low != null && !this.low.isEmpty(); + } + + /** + * @param value {@link #low} (The low limit. The boundary is inclusive.) + */ + public Range setLow(Quantity value) { + this.low = value; + return this; + } + + /** + * @return {@link #high} (The high limit. The boundary is inclusive.) + */ + public Quantity getHigh() { + if (this.high == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Range.high"); + else if (Configuration.doAutoCreate()) + this.high = new Quantity(); // cc + return this.high; + } + + public boolean hasHigh() { + return this.high != null && !this.high.isEmpty(); + } + + /** + * @param value {@link #high} (The high limit. The boundary is inclusive.) + */ + public Range setHigh(Quantity value) { + this.high = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("low", "Quantity", "The low limit. The boundary is inclusive.", 0, java.lang.Integer.MAX_VALUE, low)); + childrenList.add(new Property("high", "Quantity", "The high limit. The boundary is inclusive.", 0, java.lang.Integer.MAX_VALUE, high)); + } + + public Range copy() { + Range dst = new Range(); + copyValues(dst); + dst.low = low == null ? null : low.copy(); + dst.high = high == null ? null : high.copy(); + return dst; + } + + protected Range typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Range)) + return false; + Range o = (Range) other; + return compareDeep(low, o.low, true) && compareDeep(high, o.high, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Range)) + return false; + Range o = (Range) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (low == null || low.isEmpty()) && (high == null || high.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Ratio.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Ratio.java index ce9a5a9e49e..e43560a1720 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Ratio.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Ratio.java @@ -1,185 +1,164 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A relationship of two Quantity values - expressed as a numerator and a denominator. - */ -@DatatypeDef(name="Ratio") -public class Ratio extends Type implements ICompositeType { - - /** - * The value of the numerator. - */ - @Child(name = "numerator", type = {Quantity.class}, order=0, min=0, max=1) - @Description(shortDefinition="Numerator value", formalDefinition="The value of the numerator." ) - protected Quantity numerator; - - /** - * The value of the denominator. - */ - @Child(name = "denominator", type = {Quantity.class}, order=1, min=0, max=1) - @Description(shortDefinition="Denominator value", formalDefinition="The value of the denominator." ) - protected Quantity denominator; - - private static final long serialVersionUID = 479922563L; - - /* - * Constructor - */ - public Ratio() { - super(); - } - - /** - * @return {@link #numerator} (The value of the numerator.) - */ - public Quantity getNumerator() { - if (this.numerator == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Ratio.numerator"); - else if (Configuration.doAutoCreate()) - this.numerator = new Quantity(); // cc - return this.numerator; - } - - public boolean hasNumerator() { - return this.numerator != null && !this.numerator.isEmpty(); - } - - /** - * @param value {@link #numerator} (The value of the numerator.) - */ - public Ratio setNumerator(Quantity value) { - this.numerator = value; - return this; - } - - /** - * @return {@link #denominator} (The value of the denominator.) - */ - public Quantity getDenominator() { - if (this.denominator == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Ratio.denominator"); - else if (Configuration.doAutoCreate()) - this.denominator = new Quantity(); // cc - return this.denominator; - } - - public boolean hasDenominator() { - return this.denominator != null && !this.denominator.isEmpty(); - } - - /** - * @param value {@link #denominator} (The value of the denominator.) - */ - public Ratio setDenominator(Quantity value) { - this.denominator = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("numerator", "Quantity", "The value of the numerator.", 0, java.lang.Integer.MAX_VALUE, numerator)); - childrenList.add(new Property("denominator", "Quantity", "The value of the denominator.", 0, java.lang.Integer.MAX_VALUE, denominator)); - } - - public Ratio copy() { - Ratio dst = new Ratio(); - copyValues(dst); - dst.numerator = numerator == null ? null : numerator.copy(); - dst.denominator = denominator == null ? null : denominator.copy(); - return dst; - } - - protected Ratio typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Ratio)) - return false; - Ratio o = (Ratio) other; - return compareDeep(numerator, o.numerator, true) && compareDeep(denominator, o.denominator, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Ratio)) - return false; - Ratio o = (Ratio) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (numerator == null || numerator.isEmpty()) && (denominator == null || denominator.isEmpty()) - ; - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A relationship of two Quantity values - expressed as a numerator and a denominator. + */ +@DatatypeDef(name="Ratio") +public class Ratio extends Type implements ICompositeType { + + /** + * The value of the numerator. + */ + @Child(name = "numerator", type = {Quantity.class}, order=0, min=0, max=1) + @Description(shortDefinition="Numerator value", formalDefinition="The value of the numerator." ) + protected Quantity numerator; + + /** + * The value of the denominator. + */ + @Child(name = "denominator", type = {Quantity.class}, order=1, min=0, max=1) + @Description(shortDefinition="Denominator value", formalDefinition="The value of the denominator." ) + protected Quantity denominator; + + private static final long serialVersionUID = 479922563L; + + /* + * Constructor + */ + public Ratio() { + super(); + } + + /** + * @return {@link #numerator} (The value of the numerator.) + */ + public Quantity getNumerator() { + if (this.numerator == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Ratio.numerator"); + else if (Configuration.doAutoCreate()) + this.numerator = new Quantity(); // cc + return this.numerator; + } + + public boolean hasNumerator() { + return this.numerator != null && !this.numerator.isEmpty(); + } + + /** + * @param value {@link #numerator} (The value of the numerator.) + */ + public Ratio setNumerator(Quantity value) { + this.numerator = value; + return this; + } + + /** + * @return {@link #denominator} (The value of the denominator.) + */ + public Quantity getDenominator() { + if (this.denominator == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Ratio.denominator"); + else if (Configuration.doAutoCreate()) + this.denominator = new Quantity(); // cc + return this.denominator; + } + + public boolean hasDenominator() { + return this.denominator != null && !this.denominator.isEmpty(); + } + + /** + * @param value {@link #denominator} (The value of the denominator.) + */ + public Ratio setDenominator(Quantity value) { + this.denominator = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("numerator", "Quantity", "The value of the numerator.", 0, java.lang.Integer.MAX_VALUE, numerator)); + childrenList.add(new Property("denominator", "Quantity", "The value of the denominator.", 0, java.lang.Integer.MAX_VALUE, denominator)); + } + + public Ratio copy() { + Ratio dst = new Ratio(); + copyValues(dst); + dst.numerator = numerator == null ? null : numerator.copy(); + dst.denominator = denominator == null ? null : denominator.copy(); + return dst; + } + + protected Ratio typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Ratio)) + return false; + Ratio o = (Ratio) other; + return compareDeep(numerator, o.numerator, true) && compareDeep(denominator, o.denominator, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Ratio)) + return false; + Ratio o = (Ratio) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (numerator == null || numerator.isEmpty()) && (denominator == null || denominator.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Reference.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Reference.java index a49ecfa77d4..42b2322291e 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Reference.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Reference.java @@ -1,253 +1,232 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A reference from one resource to another. - */ -@DatatypeDef(name="Reference") -public class Reference extends BaseReference implements IBaseReference, ICompositeType { - - /** - * A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources. - */ - @Child(name = "reference", type = {StringType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Relative, internal or absolute URL reference", formalDefinition="A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources." ) - protected StringType reference; - - /** - * Plain text narrative that identifies the resource in addition to the resource reference. - */ - @Child(name = "display", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Text alternative for the resource", formalDefinition="Plain text narrative that identifies the resource in addition to the resource reference." ) - protected StringType display; - - private static final long serialVersionUID = 22777321L; - - /* - * Constructor - */ - public Reference() { - super(); - } - - /** - * Constructor - * - * @param theReference The given reference string (e.g. "Patient/123" or "http://example.com/Patient/123") - */ - public Reference(String theReference) { - super(theReference); - } - - /** - * Constructor - * - * @param theReference The given reference as an IdType (e.g. "Patient/123" or "http://example.com/Patient/123") - */ - public Reference(IdType theReference) { - super(theReference); - } - - /** - * Constructor - * - * @param theResource The resource represented by this reference - */ - public Reference(IRefImplResource theResource) { - super(theResource); - } - - /** - * @return {@link #reference} (A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public boolean hasReferenceElement() { - return this.reference != null && !this.reference.isEmpty(); - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public Reference setReferenceElement(StringType value) { - this.reference = value; - return this; - } - - /** - * @return A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources. - */ - public String getReference() { - return this.reference == null ? null : this.reference.getValue(); - } - - /** - * @param value A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources. - */ - public Reference setReference(String value) { - if (Utilities.noString(value)) - this.reference = null; - else { - if (this.reference == null) - this.reference = new StringType(); - this.reference.setValue(value); - } - return this; - } - - /** - * @return {@link #display} (Plain text narrative that identifies the resource in addition to the resource reference.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Reference.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); // bb - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (Plain text narrative that identifies the resource in addition to the resource reference.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public Reference setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return Plain text narrative that identifies the resource in addition to the resource reference. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value Plain text narrative that identifies the resource in addition to the resource reference. - */ - public Reference setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("reference", "string", "A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("display", "string", "Plain text narrative that identifies the resource in addition to the resource reference.", 0, java.lang.Integer.MAX_VALUE, display)); - } - - public Reference copy() { - Reference dst = new Reference(); - copyValues(dst); - dst.reference = reference == null ? null : reference.copy(); - dst.display = display == null ? null : display.copy(); - return dst; - } - - protected Reference typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Reference)) - return false; - Reference o = (Reference) other; - return compareDeep(reference, o.reference, true) && compareDeep(display, o.display, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Reference)) - return false; - Reference o = (Reference) other; - return compareValues(reference, o.reference, true) && compareValues(display, o.display, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (reference == null || reference.isEmpty()) && (display == null || display.isEmpty()) - ; - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A reference from one resource to another. + */ +@DatatypeDef(name="Reference") +public class Reference extends BaseReference implements IBaseReference, ICompositeType { + + /** + * A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources. + */ + @Child(name = "reference", type = {StringType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Relative, internal or absolute URL reference", formalDefinition="A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources." ) + protected StringType reference; + + /** + * Plain text narrative that identifies the resource in addition to the resource reference. + */ + @Child(name = "display", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Text alternative for the resource", formalDefinition="Plain text narrative that identifies the resource in addition to the resource reference." ) + protected StringType display; + + private static final long serialVersionUID = 22777321L; + + /* + * Constructor + */ + public Reference() { + super(); + } + + /** + * Constructor + * + * @param theReference The given reference string (e.g. "Patient/123" or "http://example.com/Patient/123") + */ + public Reference(String theReference) { + super(theReference); + } + + /** + * Constructor + * + * @param theReference The given reference as an IdType (e.g. "Patient/123" or "http://example.com/Patient/123") + */ + public Reference(IdType theReference) { + super(theReference); + } + + /** + * Constructor + * + * @param theResource The resource represented by this reference + */ + public Reference(IAnyResource theResource) { + super(theResource); + } + + /** + * @return {@link #reference} (A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public boolean hasReferenceElement() { + return this.reference != null && !this.reference.isEmpty(); + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public Reference setReferenceElement(StringType value) { + this.reference = value; + return this; + } + + /** + * @return A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources. + */ + public String getReference() { + return this.reference == null ? null : this.reference.getValue(); + } + + /** + * @param value A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources. + */ + public Reference setReference(String value) { + if (Utilities.noString(value)) + this.reference = null; + else { + if (this.reference == null) + this.reference = new StringType(); + this.reference.setValue(value); + } + return this; + } + + /** + * @return {@link #display} (Plain text narrative that identifies the resource in addition to the resource reference.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Reference.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); // bb + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (Plain text narrative that identifies the resource in addition to the resource reference.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public Reference setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return Plain text narrative that identifies the resource in addition to the resource reference. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value Plain text narrative that identifies the resource in addition to the resource reference. + */ + public Reference setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("reference", "string", "A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("display", "string", "Plain text narrative that identifies the resource in addition to the resource reference.", 0, java.lang.Integer.MAX_VALUE, display)); + } + + public Reference copy() { + Reference dst = new Reference(); + copyValues(dst); + dst.reference = reference == null ? null : reference.copy(); + dst.display = display == null ? null : display.copy(); + return dst; + } + + protected Reference typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Reference)) + return false; + Reference o = (Reference) other; + return compareDeep(reference, o.reference, true) && compareDeep(display, o.display, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Reference)) + return false; + Reference o = (Reference) other; + return compareValues(reference, o.reference, true) && compareValues(display, o.display, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (reference == null || reference.isEmpty()) && (display == null || display.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ReferralRequest.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ReferralRequest.java index 83342d56d7a..77091ce9526 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ReferralRequest.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ReferralRequest.java @@ -1,1044 +1,1023 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organisation. - */ -@ResourceDef(name="ReferralRequest", profile="http://hl7.org/fhir/Profile/ReferralRequest") -public class ReferralRequest extends DomainResource { - - public enum Referralstatus { - /** - * A draft referral that has yet to be send. - */ - DRAFT, - /** - * The referral has been transmitted, but not yet acknowledged by the recipient. - */ - REQUESTED, - /** - * The referral has been acknowledged by the recipient, and is in the process of being actioned. - */ - ACTIVE, - /** - * The referral has been cancelled without being completed. For example it is no longer needed. - */ - CANCELLED, - /** - * The recipient has agreed to deliver the care requested by the referral. - */ - ACCEPTED, - /** - * The recipient has declined to accept the referral. - */ - REJECTED, - /** - * The referral has been completely actioned. - */ - COMPLETED, - /** - * added to help the parsers - */ - NULL; - public static Referralstatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return DRAFT; - if ("requested".equals(codeString)) - return REQUESTED; - if ("active".equals(codeString)) - return ACTIVE; - if ("cancelled".equals(codeString)) - return CANCELLED; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("rejected".equals(codeString)) - return REJECTED; - if ("completed".equals(codeString)) - return COMPLETED; - throw new Exception("Unknown Referralstatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case DRAFT: return "draft"; - case REQUESTED: return "requested"; - case ACTIVE: return "active"; - case CANCELLED: return "cancelled"; - case ACCEPTED: return "accepted"; - case REJECTED: return "rejected"; - case COMPLETED: return "completed"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DRAFT: return ""; - case REQUESTED: return ""; - case ACTIVE: return ""; - case CANCELLED: return ""; - case ACCEPTED: return ""; - case REJECTED: return ""; - case COMPLETED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DRAFT: return "A draft referral that has yet to be send."; - case REQUESTED: return "The referral has been transmitted, but not yet acknowledged by the recipient."; - case ACTIVE: return "The referral has been acknowledged by the recipient, and is in the process of being actioned."; - case CANCELLED: return "The referral has been cancelled without being completed. For example it is no longer needed."; - case ACCEPTED: return "The recipient has agreed to deliver the care requested by the referral."; - case REJECTED: return "The recipient has declined to accept the referral."; - case COMPLETED: return "The referral has been completely actioned."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DRAFT: return "Draft"; - case REQUESTED: return "Requested"; - case ACTIVE: return "Active"; - case CANCELLED: return "Cancelled"; - case ACCEPTED: return "Accepted"; - case REJECTED: return "Rejected"; - case COMPLETED: return "Completed"; - default: return "?"; - } - } - } - - public static class ReferralstatusEnumFactory implements EnumFactory { - public Referralstatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return Referralstatus.DRAFT; - if ("requested".equals(codeString)) - return Referralstatus.REQUESTED; - if ("active".equals(codeString)) - return Referralstatus.ACTIVE; - if ("cancelled".equals(codeString)) - return Referralstatus.CANCELLED; - if ("accepted".equals(codeString)) - return Referralstatus.ACCEPTED; - if ("rejected".equals(codeString)) - return Referralstatus.REJECTED; - if ("completed".equals(codeString)) - return Referralstatus.COMPLETED; - throw new IllegalArgumentException("Unknown Referralstatus code '"+codeString+"'"); - } - public String toCode(Referralstatus code) { - if (code == Referralstatus.DRAFT) - return "draft"; - if (code == Referralstatus.REQUESTED) - return "requested"; - if (code == Referralstatus.ACTIVE) - return "active"; - if (code == Referralstatus.CANCELLED) - return "cancelled"; - if (code == Referralstatus.ACCEPTED) - return "accepted"; - if (code == Referralstatus.REJECTED) - return "rejected"; - if (code == Referralstatus.COMPLETED) - return "completed"; - return "?"; - } - } - - /** - * The workflow status of the referral or transfer of care request. - */ - @Child(name = "status", type = {CodeType.class}, order=0, min=1, max=1) - @Description(shortDefinition="draft | requested | active | cancelled | accepted | rejected | completed", formalDefinition="The workflow status of the referral or transfer of care request." ) - protected Enumeration status; - - /** - * Business Id that uniquely identifies the referral/care transfer request instance. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Identifier of request", formalDefinition="Business Id that uniquely identifies the referral/care transfer request instance." ) - protected List identifier; - - /** - * An indication of the type of referral (or where applicable the type of transfer of care) request. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Referral/Transition of care request type", formalDefinition="An indication of the type of referral (or where applicable the type of transfer of care) request." ) - protected CodeableConcept type; - - /** - * Indication of the clinical domain or discipline to which the referral or transfer of care request is sent. - */ - @Child(name = "specialty", type = {CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="The clinical specialty (discipline) that the referral is requested for", formalDefinition="Indication of the clinical domain or discipline to which the referral or transfer of care request is sent." ) - protected CodeableConcept specialty; - - /** - * An indication of the urgency of referral (or where applicable the type of transfer of care) request. - */ - @Child(name = "priority", type = {CodeableConcept.class}, order=4, min=0, max=1) - @Description(shortDefinition="Urgency of referral / transfer of care request", formalDefinition="An indication of the urgency of referral (or where applicable the type of transfer of care) request." ) - protected CodeableConcept priority; - - /** - * The patient who is the subject of a referral or transfer of care request. - */ - @Child(name = "patient", type = {Patient.class}, order=5, min=0, max=1) - @Description(shortDefinition="Patient referred to care or transfer", formalDefinition="The patient who is the subject of a referral or transfer of care request." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient who is the subject of a referral or transfer of care request.) - */ - protected Patient patientTarget; - - /** - * The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral). - */ - @Child(name = "requester", type = {Practitioner.class, Organization.class, Patient.class}, order=6, min=0, max=1) - @Description(shortDefinition="Requester of referral / transfer of care", formalDefinition="The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral)." ) - protected Reference requester; - - /** - * The actual object that is the target of the reference (The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).) - */ - protected Resource requesterTarget; - - /** - * The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request. - */ - @Child(name = "recipient", type = {Practitioner.class, Organization.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Receiver of referral / transfer of care request", formalDefinition="The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request." ) - protected List recipient; - /** - * The actual objects that are the target of the reference (The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) - */ - protected List recipientTarget; - - - /** - * The encounter at which the request for referral or transfer of care is initiated. - */ - @Child(name = "encounter", type = {Encounter.class}, order=8, min=0, max=1) - @Description(shortDefinition="Encounter", formalDefinition="The encounter at which the request for referral or transfer of care is initiated." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The encounter at which the request for referral or transfer of care is initiated.) - */ - protected Encounter encounterTarget; - - /** - * Date/DateTime the request for referral or transfer of care is sent by the author. - */ - @Child(name = "dateSent", type = {DateTimeType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Date referral/transfer of care request is sent", formalDefinition="Date/DateTime the request for referral or transfer of care is sent by the author." ) - protected DateTimeType dateSent; - - /** - * Description of clinical condition indicating why referral/transfer of care is requested. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=10, min=0, max=1) - @Description(shortDefinition="Reason for referral / Transfer of care request", formalDefinition="Description of clinical condition indicating why referral/transfer of care is requested." ) - protected CodeableConcept reason; - - /** - * The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary. - */ - @Child(name = "description", type = {StringType.class}, order=11, min=0, max=1) - @Description(shortDefinition="A textual description of the referral", formalDefinition="The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary." ) - protected StringType description; - - /** - * The service(s) that is/are requested to be provided to the patient. - */ - @Child(name = "serviceRequested", type = {CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Service(s) requested", formalDefinition="The service(s) that is/are requested to be provided to the patient." ) - protected List serviceRequested; - - /** - * Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care. - */ - @Child(name = "supportingInformation", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Additonal information to support referral or transfer of care request", formalDefinition="Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care." ) - protected List supportingInformation; - /** - * The actual objects that are the target of the reference (Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.) - */ - protected List supportingInformationTarget; - - - /** - * The period of time within which the services identified in the referral/transfer of care is specified or required to occur. - */ - @Child(name = "fulfillmentTime", type = {Period.class}, order=14, min=0, max=1) - @Description(shortDefinition="Requested service(s) fulfillment time", formalDefinition="The period of time within which the services identified in the referral/transfer of care is specified or required to occur." ) - protected Period fulfillmentTime; - - private static final long serialVersionUID = -1139252216L; - - /* - * Constructor - */ - public ReferralRequest() { - super(); - } - - /* - * Constructor - */ - public ReferralRequest(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #status} (The workflow status of the referral or transfer of care request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ReferralstatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The workflow status of the referral or transfer of care request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public ReferralRequest setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The workflow status of the referral or transfer of care request. - */ - public Referralstatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The workflow status of the referral or transfer of care request. - */ - public ReferralRequest setStatus(Referralstatus value) { - if (this.status == null) - this.status = new Enumeration(new ReferralstatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #identifier} (Business Id that uniquely identifies the referral/care transfer request instance.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Business Id that uniquely identifies the referral/care transfer request instance.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public ReferralRequest addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #type} (An indication of the type of referral (or where applicable the type of transfer of care) request.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (An indication of the type of referral (or where applicable the type of transfer of care) request.) - */ - public ReferralRequest setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #specialty} (Indication of the clinical domain or discipline to which the referral or transfer of care request is sent.) - */ - public CodeableConcept getSpecialty() { - if (this.specialty == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.specialty"); - else if (Configuration.doAutoCreate()) - this.specialty = new CodeableConcept(); // cc - return this.specialty; - } - - public boolean hasSpecialty() { - return this.specialty != null && !this.specialty.isEmpty(); - } - - /** - * @param value {@link #specialty} (Indication of the clinical domain or discipline to which the referral or transfer of care request is sent.) - */ - public ReferralRequest setSpecialty(CodeableConcept value) { - this.specialty = value; - return this; - } - - /** - * @return {@link #priority} (An indication of the urgency of referral (or where applicable the type of transfer of care) request.) - */ - public CodeableConcept getPriority() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new CodeableConcept(); // cc - return this.priority; - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (An indication of the urgency of referral (or where applicable the type of transfer of care) request.) - */ - public ReferralRequest setPriority(CodeableConcept value) { - this.priority = value; - return this; - } - - /** - * @return {@link #patient} (The patient who is the subject of a referral or transfer of care request.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The patient who is the subject of a referral or transfer of care request.) - */ - public ReferralRequest setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who is the subject of a referral or transfer of care request.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who is the subject of a referral or transfer of care request.) - */ - public ReferralRequest setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #requester} (The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).) - */ - public Reference getRequester() { - if (this.requester == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.requester"); - else if (Configuration.doAutoCreate()) - this.requester = new Reference(); // cc - return this.requester; - } - - public boolean hasRequester() { - return this.requester != null && !this.requester.isEmpty(); - } - - /** - * @param value {@link #requester} (The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).) - */ - public ReferralRequest setRequester(Reference value) { - this.requester = value; - return this; - } - - /** - * @return {@link #requester} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).) - */ - public Resource getRequesterTarget() { - return this.requesterTarget; - } - - /** - * @param value {@link #requester} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).) - */ - public ReferralRequest setRequesterTarget(Resource value) { - this.requesterTarget = value; - return this; - } - - /** - * @return {@link #recipient} (The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) - */ - public List getRecipient() { - if (this.recipient == null) - this.recipient = new ArrayList(); - return this.recipient; - } - - public boolean hasRecipient() { - if (this.recipient == null) - return false; - for (Reference item : this.recipient) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #recipient} (The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) - */ - // syntactic sugar - public Reference addRecipient() { //3 - Reference t = new Reference(); - if (this.recipient == null) - this.recipient = new ArrayList(); - this.recipient.add(t); - return t; - } - - // syntactic sugar - public ReferralRequest addRecipient(Reference t) { //3 - if (t == null) - return this; - if (this.recipient == null) - this.recipient = new ArrayList(); - this.recipient.add(t); - return this; - } - - /** - * @return {@link #recipient} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) - */ - public List getRecipientTarget() { - if (this.recipientTarget == null) - this.recipientTarget = new ArrayList(); - return this.recipientTarget; - } - - /** - * @return {@link #encounter} (The encounter at which the request for referral or transfer of care is initiated.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (The encounter at which the request for referral or transfer of care is initiated.) - */ - public ReferralRequest setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter at which the request for referral or transfer of care is initiated.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter at which the request for referral or transfer of care is initiated.) - */ - public ReferralRequest setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #dateSent} (Date/DateTime the request for referral or transfer of care is sent by the author.). This is the underlying object with id, value and extensions. The accessor "getDateSent" gives direct access to the value - */ - public DateTimeType getDateSentElement() { - if (this.dateSent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.dateSent"); - else if (Configuration.doAutoCreate()) - this.dateSent = new DateTimeType(); // bb - return this.dateSent; - } - - public boolean hasDateSentElement() { - return this.dateSent != null && !this.dateSent.isEmpty(); - } - - public boolean hasDateSent() { - return this.dateSent != null && !this.dateSent.isEmpty(); - } - - /** - * @param value {@link #dateSent} (Date/DateTime the request for referral or transfer of care is sent by the author.). This is the underlying object with id, value and extensions. The accessor "getDateSent" gives direct access to the value - */ - public ReferralRequest setDateSentElement(DateTimeType value) { - this.dateSent = value; - return this; - } - - /** - * @return Date/DateTime the request for referral or transfer of care is sent by the author. - */ - public Date getDateSent() { - return this.dateSent == null ? null : this.dateSent.getValue(); - } - - /** - * @param value Date/DateTime the request for referral or transfer of care is sent by the author. - */ - public ReferralRequest setDateSent(Date value) { - if (value == null) - this.dateSent = null; - else { - if (this.dateSent == null) - this.dateSent = new DateTimeType(); - this.dateSent.setValue(value); - } - return this; - } - - /** - * @return {@link #reason} (Description of clinical condition indicating why referral/transfer of care is requested.) - */ - public CodeableConcept getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new CodeableConcept(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Description of clinical condition indicating why referral/transfer of care is requested.) - */ - public ReferralRequest setReason(CodeableConcept value) { - this.reason = value; - return this; - } - - /** - * @return {@link #description} (The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ReferralRequest setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary. - */ - public ReferralRequest setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #serviceRequested} (The service(s) that is/are requested to be provided to the patient.) - */ - public List getServiceRequested() { - if (this.serviceRequested == null) - this.serviceRequested = new ArrayList(); - return this.serviceRequested; - } - - public boolean hasServiceRequested() { - if (this.serviceRequested == null) - return false; - for (CodeableConcept item : this.serviceRequested) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #serviceRequested} (The service(s) that is/are requested to be provided to the patient.) - */ - // syntactic sugar - public CodeableConcept addServiceRequested() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.serviceRequested == null) - this.serviceRequested = new ArrayList(); - this.serviceRequested.add(t); - return t; - } - - // syntactic sugar - public ReferralRequest addServiceRequested(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.serviceRequested == null) - this.serviceRequested = new ArrayList(); - this.serviceRequested.add(t); - return this; - } - - /** - * @return {@link #supportingInformation} (Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.) - */ - public List getSupportingInformation() { - if (this.supportingInformation == null) - this.supportingInformation = new ArrayList(); - return this.supportingInformation; - } - - public boolean hasSupportingInformation() { - if (this.supportingInformation == null) - return false; - for (Reference item : this.supportingInformation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #supportingInformation} (Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.) - */ - // syntactic sugar - public Reference addSupportingInformation() { //3 - Reference t = new Reference(); - if (this.supportingInformation == null) - this.supportingInformation = new ArrayList(); - this.supportingInformation.add(t); - return t; - } - - // syntactic sugar - public ReferralRequest addSupportingInformation(Reference t) { //3 - if (t == null) - return this; - if (this.supportingInformation == null) - this.supportingInformation = new ArrayList(); - this.supportingInformation.add(t); - return this; - } - - /** - * @return {@link #supportingInformation} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.) - */ - public List getSupportingInformationTarget() { - if (this.supportingInformationTarget == null) - this.supportingInformationTarget = new ArrayList(); - return this.supportingInformationTarget; - } - - /** - * @return {@link #fulfillmentTime} (The period of time within which the services identified in the referral/transfer of care is specified or required to occur.) - */ - public Period getFulfillmentTime() { - if (this.fulfillmentTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.fulfillmentTime"); - else if (Configuration.doAutoCreate()) - this.fulfillmentTime = new Period(); // cc - return this.fulfillmentTime; - } - - public boolean hasFulfillmentTime() { - return this.fulfillmentTime != null && !this.fulfillmentTime.isEmpty(); - } - - /** - * @param value {@link #fulfillmentTime} (The period of time within which the services identified in the referral/transfer of care is specified or required to occur.) - */ - public ReferralRequest setFulfillmentTime(Period value) { - this.fulfillmentTime = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("status", "code", "The workflow status of the referral or transfer of care request.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("identifier", "Identifier", "Business Id that uniquely identifies the referral/care transfer request instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("type", "CodeableConcept", "An indication of the type of referral (or where applicable the type of transfer of care) request.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("specialty", "CodeableConcept", "Indication of the clinical domain or discipline to which the referral or transfer of care request is sent.", 0, java.lang.Integer.MAX_VALUE, specialty)); - childrenList.add(new Property("priority", "CodeableConcept", "An indication of the urgency of referral (or where applicable the type of transfer of care) request.", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient who is the subject of a referral or transfer of care request.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("requester", "Reference(Practitioner|Organization|Patient)", "The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).", 0, java.lang.Integer.MAX_VALUE, requester)); - childrenList.add(new Property("recipient", "Reference(Practitioner|Organization)", "The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.", 0, java.lang.Integer.MAX_VALUE, recipient)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter at which the request for referral or transfer of care is initiated.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("dateSent", "dateTime", "Date/DateTime the request for referral or transfer of care is sent by the author.", 0, java.lang.Integer.MAX_VALUE, dateSent)); - childrenList.add(new Property("reason", "CodeableConcept", "Description of clinical condition indicating why referral/transfer of care is requested.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("description", "string", "The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("serviceRequested", "CodeableConcept", "The service(s) that is/are requested to be provided to the patient.", 0, java.lang.Integer.MAX_VALUE, serviceRequested)); - childrenList.add(new Property("supportingInformation", "Reference(Any)", "Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.", 0, java.lang.Integer.MAX_VALUE, supportingInformation)); - childrenList.add(new Property("fulfillmentTime", "Period", "The period of time within which the services identified in the referral/transfer of care is specified or required to occur.", 0, java.lang.Integer.MAX_VALUE, fulfillmentTime)); - } - - public ReferralRequest copy() { - ReferralRequest dst = new ReferralRequest(); - copyValues(dst); - dst.status = status == null ? null : status.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - dst.specialty = specialty == null ? null : specialty.copy(); - dst.priority = priority == null ? null : priority.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.requester = requester == null ? null : requester.copy(); - if (recipient != null) { - dst.recipient = new ArrayList(); - for (Reference i : recipient) - dst.recipient.add(i.copy()); - }; - dst.encounter = encounter == null ? null : encounter.copy(); - dst.dateSent = dateSent == null ? null : dateSent.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.description = description == null ? null : description.copy(); - if (serviceRequested != null) { - dst.serviceRequested = new ArrayList(); - for (CodeableConcept i : serviceRequested) - dst.serviceRequested.add(i.copy()); - }; - if (supportingInformation != null) { - dst.supportingInformation = new ArrayList(); - for (Reference i : supportingInformation) - dst.supportingInformation.add(i.copy()); - }; - dst.fulfillmentTime = fulfillmentTime == null ? null : fulfillmentTime.copy(); - return dst; - } - - protected ReferralRequest typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ReferralRequest)) - return false; - ReferralRequest o = (ReferralRequest) other; - return compareDeep(status, o.status, true) && compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) - && compareDeep(specialty, o.specialty, true) && compareDeep(priority, o.priority, true) && compareDeep(patient, o.patient, true) - && compareDeep(requester, o.requester, true) && compareDeep(recipient, o.recipient, true) && compareDeep(encounter, o.encounter, true) - && compareDeep(dateSent, o.dateSent, true) && compareDeep(reason, o.reason, true) && compareDeep(description, o.description, true) - && compareDeep(serviceRequested, o.serviceRequested, true) && compareDeep(supportingInformation, o.supportingInformation, true) - && compareDeep(fulfillmentTime, o.fulfillmentTime, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ReferralRequest)) - return false; - ReferralRequest o = (ReferralRequest) other; - return compareValues(status, o.status, true) && compareValues(dateSent, o.dateSent, true) && compareValues(description, o.description, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (status == null || status.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (type == null || type.isEmpty()) && (specialty == null || specialty.isEmpty()) && (priority == null || priority.isEmpty()) - && (patient == null || patient.isEmpty()) && (requester == null || requester.isEmpty()) && (recipient == null || recipient.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (dateSent == null || dateSent.isEmpty()) - && (reason == null || reason.isEmpty()) && (description == null || description.isEmpty()) - && (serviceRequested == null || serviceRequested.isEmpty()) && (supportingInformation == null || supportingInformation.isEmpty()) - && (fulfillmentTime == null || fulfillmentTime.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ReferralRequest; - } - - @SearchParamDefinition(name="requester", path="ReferralRequest.requester", description="Requester of referral / transfer of care", type="reference" ) - public static final String SP_REQUESTER = "requester"; - @SearchParamDefinition(name="patient", path="ReferralRequest.patient", description="Who the referral is about", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="status", path="ReferralRequest.status", description="The status of the referral", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="priority", path="ReferralRequest.priority", description="The priority assigned to the referral", type="token" ) - public static final String SP_PRIORITY = "priority"; - @SearchParamDefinition(name="type", path="ReferralRequest.type", description="The type of the referral", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="specialty", path="ReferralRequest.specialty", description="The specialty that the referral is for", type="token" ) - public static final String SP_SPECIALTY = "specialty"; - @SearchParamDefinition(name="recipient", path="ReferralRequest.recipient", description="The person that the referral was sent to", type="reference" ) - public static final String SP_RECIPIENT = "recipient"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organisation. + */ +@ResourceDef(name="ReferralRequest", profile="http://hl7.org/fhir/Profile/ReferralRequest") +public class ReferralRequest extends DomainResource { + + public enum Referralstatus { + /** + * A draft referral that has yet to be send. + */ + DRAFT, + /** + * The referral has been transmitted, but not yet acknowledged by the recipient. + */ + REQUESTED, + /** + * The referral has been acknowledged by the recipient, and is in the process of being actioned. + */ + ACTIVE, + /** + * The referral has been cancelled without being completed. For example it is no longer needed. + */ + CANCELLED, + /** + * The recipient has agreed to deliver the care requested by the referral. + */ + ACCEPTED, + /** + * The recipient has declined to accept the referral. + */ + REJECTED, + /** + * The referral has been completely actioned. + */ + COMPLETED, + /** + * added to help the parsers + */ + NULL; + public static Referralstatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return DRAFT; + if ("requested".equals(codeString)) + return REQUESTED; + if ("active".equals(codeString)) + return ACTIVE; + if ("cancelled".equals(codeString)) + return CANCELLED; + if ("accepted".equals(codeString)) + return ACCEPTED; + if ("rejected".equals(codeString)) + return REJECTED; + if ("completed".equals(codeString)) + return COMPLETED; + throw new Exception("Unknown Referralstatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case DRAFT: return "draft"; + case REQUESTED: return "requested"; + case ACTIVE: return "active"; + case CANCELLED: return "cancelled"; + case ACCEPTED: return "accepted"; + case REJECTED: return "rejected"; + case COMPLETED: return "completed"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DRAFT: return ""; + case REQUESTED: return ""; + case ACTIVE: return ""; + case CANCELLED: return ""; + case ACCEPTED: return ""; + case REJECTED: return ""; + case COMPLETED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DRAFT: return "A draft referral that has yet to be send."; + case REQUESTED: return "The referral has been transmitted, but not yet acknowledged by the recipient."; + case ACTIVE: return "The referral has been acknowledged by the recipient, and is in the process of being actioned."; + case CANCELLED: return "The referral has been cancelled without being completed. For example it is no longer needed."; + case ACCEPTED: return "The recipient has agreed to deliver the care requested by the referral."; + case REJECTED: return "The recipient has declined to accept the referral."; + case COMPLETED: return "The referral has been completely actioned."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DRAFT: return "Draft"; + case REQUESTED: return "Requested"; + case ACTIVE: return "Active"; + case CANCELLED: return "Cancelled"; + case ACCEPTED: return "Accepted"; + case REJECTED: return "Rejected"; + case COMPLETED: return "Completed"; + default: return "?"; + } + } + } + + public static class ReferralstatusEnumFactory implements EnumFactory { + public Referralstatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return Referralstatus.DRAFT; + if ("requested".equals(codeString)) + return Referralstatus.REQUESTED; + if ("active".equals(codeString)) + return Referralstatus.ACTIVE; + if ("cancelled".equals(codeString)) + return Referralstatus.CANCELLED; + if ("accepted".equals(codeString)) + return Referralstatus.ACCEPTED; + if ("rejected".equals(codeString)) + return Referralstatus.REJECTED; + if ("completed".equals(codeString)) + return Referralstatus.COMPLETED; + throw new IllegalArgumentException("Unknown Referralstatus code '"+codeString+"'"); + } + public String toCode(Referralstatus code) { + if (code == Referralstatus.DRAFT) + return "draft"; + if (code == Referralstatus.REQUESTED) + return "requested"; + if (code == Referralstatus.ACTIVE) + return "active"; + if (code == Referralstatus.CANCELLED) + return "cancelled"; + if (code == Referralstatus.ACCEPTED) + return "accepted"; + if (code == Referralstatus.REJECTED) + return "rejected"; + if (code == Referralstatus.COMPLETED) + return "completed"; + return "?"; + } + } + + /** + * The workflow status of the referral or transfer of care request. + */ + @Child(name = "status", type = {CodeType.class}, order=0, min=1, max=1) + @Description(shortDefinition="draft | requested | active | cancelled | accepted | rejected | completed", formalDefinition="The workflow status of the referral or transfer of care request." ) + protected Enumeration status; + + /** + * Business Id that uniquely identifies the referral/care transfer request instance. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Identifier of request", formalDefinition="Business Id that uniquely identifies the referral/care transfer request instance." ) + protected List identifier; + + /** + * An indication of the type of referral (or where applicable the type of transfer of care) request. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Referral/Transition of care request type", formalDefinition="An indication of the type of referral (or where applicable the type of transfer of care) request." ) + protected CodeableConcept type; + + /** + * Indication of the clinical domain or discipline to which the referral or transfer of care request is sent. + */ + @Child(name = "specialty", type = {CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="The clinical specialty (discipline) that the referral is requested for", formalDefinition="Indication of the clinical domain or discipline to which the referral or transfer of care request is sent." ) + protected CodeableConcept specialty; + + /** + * An indication of the urgency of referral (or where applicable the type of transfer of care) request. + */ + @Child(name = "priority", type = {CodeableConcept.class}, order=4, min=0, max=1) + @Description(shortDefinition="Urgency of referral / transfer of care request", formalDefinition="An indication of the urgency of referral (or where applicable the type of transfer of care) request." ) + protected CodeableConcept priority; + + /** + * The patient who is the subject of a referral or transfer of care request. + */ + @Child(name = "patient", type = {Patient.class}, order=5, min=0, max=1) + @Description(shortDefinition="Patient referred to care or transfer", formalDefinition="The patient who is the subject of a referral or transfer of care request." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient who is the subject of a referral or transfer of care request.) + */ + protected Patient patientTarget; + + /** + * The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral). + */ + @Child(name = "requester", type = {Practitioner.class, Organization.class, Patient.class}, order=6, min=0, max=1) + @Description(shortDefinition="Requester of referral / transfer of care", formalDefinition="The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral)." ) + protected Reference requester; + + /** + * The actual object that is the target of the reference (The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).) + */ + protected Resource requesterTarget; + + /** + * The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request. + */ + @Child(name = "recipient", type = {Practitioner.class, Organization.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Receiver of referral / transfer of care request", formalDefinition="The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request." ) + protected List recipient; + /** + * The actual objects that are the target of the reference (The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) + */ + protected List recipientTarget; + + + /** + * The encounter at which the request for referral or transfer of care is initiated. + */ + @Child(name = "encounter", type = {Encounter.class}, order=8, min=0, max=1) + @Description(shortDefinition="Encounter", formalDefinition="The encounter at which the request for referral or transfer of care is initiated." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The encounter at which the request for referral or transfer of care is initiated.) + */ + protected Encounter encounterTarget; + + /** + * Date/DateTime the request for referral or transfer of care is sent by the author. + */ + @Child(name = "dateSent", type = {DateTimeType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Date referral/transfer of care request is sent", formalDefinition="Date/DateTime the request for referral or transfer of care is sent by the author." ) + protected DateTimeType dateSent; + + /** + * Description of clinical condition indicating why referral/transfer of care is requested. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=10, min=0, max=1) + @Description(shortDefinition="Reason for referral / Transfer of care request", formalDefinition="Description of clinical condition indicating why referral/transfer of care is requested." ) + protected CodeableConcept reason; + + /** + * The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary. + */ + @Child(name = "description", type = {StringType.class}, order=11, min=0, max=1) + @Description(shortDefinition="A textual description of the referral", formalDefinition="The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary." ) + protected StringType description; + + /** + * The service(s) that is/are requested to be provided to the patient. + */ + @Child(name = "serviceRequested", type = {CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Service(s) requested", formalDefinition="The service(s) that is/are requested to be provided to the patient." ) + protected List serviceRequested; + + /** + * Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care. + */ + @Child(name = "supportingInformation", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additonal information to support referral or transfer of care request", formalDefinition="Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care." ) + protected List supportingInformation; + /** + * The actual objects that are the target of the reference (Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.) + */ + protected List supportingInformationTarget; + + + /** + * The period of time within which the services identified in the referral/transfer of care is specified or required to occur. + */ + @Child(name = "fulfillmentTime", type = {Period.class}, order=14, min=0, max=1) + @Description(shortDefinition="Requested service(s) fulfillment time", formalDefinition="The period of time within which the services identified in the referral/transfer of care is specified or required to occur." ) + protected Period fulfillmentTime; + + private static final long serialVersionUID = -1139252216L; + + /* + * Constructor + */ + public ReferralRequest() { + super(); + } + + /* + * Constructor + */ + public ReferralRequest(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #status} (The workflow status of the referral or transfer of care request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ReferralstatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The workflow status of the referral or transfer of care request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public ReferralRequest setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The workflow status of the referral or transfer of care request. + */ + public Referralstatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The workflow status of the referral or transfer of care request. + */ + public ReferralRequest setStatus(Referralstatus value) { + if (this.status == null) + this.status = new Enumeration(new ReferralstatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #identifier} (Business Id that uniquely identifies the referral/care transfer request instance.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Business Id that uniquely identifies the referral/care transfer request instance.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public ReferralRequest addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #type} (An indication of the type of referral (or where applicable the type of transfer of care) request.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (An indication of the type of referral (or where applicable the type of transfer of care) request.) + */ + public ReferralRequest setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #specialty} (Indication of the clinical domain or discipline to which the referral or transfer of care request is sent.) + */ + public CodeableConcept getSpecialty() { + if (this.specialty == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.specialty"); + else if (Configuration.doAutoCreate()) + this.specialty = new CodeableConcept(); // cc + return this.specialty; + } + + public boolean hasSpecialty() { + return this.specialty != null && !this.specialty.isEmpty(); + } + + /** + * @param value {@link #specialty} (Indication of the clinical domain or discipline to which the referral or transfer of care request is sent.) + */ + public ReferralRequest setSpecialty(CodeableConcept value) { + this.specialty = value; + return this; + } + + /** + * @return {@link #priority} (An indication of the urgency of referral (or where applicable the type of transfer of care) request.) + */ + public CodeableConcept getPriority() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new CodeableConcept(); // cc + return this.priority; + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (An indication of the urgency of referral (or where applicable the type of transfer of care) request.) + */ + public ReferralRequest setPriority(CodeableConcept value) { + this.priority = value; + return this; + } + + /** + * @return {@link #patient} (The patient who is the subject of a referral or transfer of care request.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The patient who is the subject of a referral or transfer of care request.) + */ + public ReferralRequest setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who is the subject of a referral or transfer of care request.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who is the subject of a referral or transfer of care request.) + */ + public ReferralRequest setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #requester} (The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).) + */ + public Reference getRequester() { + if (this.requester == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.requester"); + else if (Configuration.doAutoCreate()) + this.requester = new Reference(); // cc + return this.requester; + } + + public boolean hasRequester() { + return this.requester != null && !this.requester.isEmpty(); + } + + /** + * @param value {@link #requester} (The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).) + */ + public ReferralRequest setRequester(Reference value) { + this.requester = value; + return this; + } + + /** + * @return {@link #requester} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).) + */ + public Resource getRequesterTarget() { + return this.requesterTarget; + } + + /** + * @param value {@link #requester} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).) + */ + public ReferralRequest setRequesterTarget(Resource value) { + this.requesterTarget = value; + return this; + } + + /** + * @return {@link #recipient} (The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) + */ + public List getRecipient() { + if (this.recipient == null) + this.recipient = new ArrayList(); + return this.recipient; + } + + public boolean hasRecipient() { + if (this.recipient == null) + return false; + for (Reference item : this.recipient) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #recipient} (The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) + */ + // syntactic sugar + public Reference addRecipient() { //3 + Reference t = new Reference(); + if (this.recipient == null) + this.recipient = new ArrayList(); + this.recipient.add(t); + return t; + } + + // syntactic sugar + public ReferralRequest addRecipient(Reference t) { //3 + if (t == null) + return this; + if (this.recipient == null) + this.recipient = new ArrayList(); + this.recipient.add(t); + return this; + } + + /** + * @return {@link #recipient} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) + */ + public List getRecipientTarget() { + if (this.recipientTarget == null) + this.recipientTarget = new ArrayList(); + return this.recipientTarget; + } + + /** + * @return {@link #encounter} (The encounter at which the request for referral or transfer of care is initiated.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (The encounter at which the request for referral or transfer of care is initiated.) + */ + public ReferralRequest setEncounter(Reference value) { + this.encounter = value; + return this; + } + + /** + * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter at which the request for referral or transfer of care is initiated.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + return this.encounterTarget; + } + + /** + * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter at which the request for referral or transfer of care is initiated.) + */ + public ReferralRequest setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #dateSent} (Date/DateTime the request for referral or transfer of care is sent by the author.). This is the underlying object with id, value and extensions. The accessor "getDateSent" gives direct access to the value + */ + public DateTimeType getDateSentElement() { + if (this.dateSent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.dateSent"); + else if (Configuration.doAutoCreate()) + this.dateSent = new DateTimeType(); // bb + return this.dateSent; + } + + public boolean hasDateSentElement() { + return this.dateSent != null && !this.dateSent.isEmpty(); + } + + public boolean hasDateSent() { + return this.dateSent != null && !this.dateSent.isEmpty(); + } + + /** + * @param value {@link #dateSent} (Date/DateTime the request for referral or transfer of care is sent by the author.). This is the underlying object with id, value and extensions. The accessor "getDateSent" gives direct access to the value + */ + public ReferralRequest setDateSentElement(DateTimeType value) { + this.dateSent = value; + return this; + } + + /** + * @return Date/DateTime the request for referral or transfer of care is sent by the author. + */ + public Date getDateSent() { + return this.dateSent == null ? null : this.dateSent.getValue(); + } + + /** + * @param value Date/DateTime the request for referral or transfer of care is sent by the author. + */ + public ReferralRequest setDateSent(Date value) { + if (value == null) + this.dateSent = null; + else { + if (this.dateSent == null) + this.dateSent = new DateTimeType(); + this.dateSent.setValue(value); + } + return this; + } + + /** + * @return {@link #reason} (Description of clinical condition indicating why referral/transfer of care is requested.) + */ + public CodeableConcept getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new CodeableConcept(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Description of clinical condition indicating why referral/transfer of care is requested.) + */ + public ReferralRequest setReason(CodeableConcept value) { + this.reason = value; + return this; + } + + /** + * @return {@link #description} (The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ReferralRequest setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary. + */ + public ReferralRequest setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #serviceRequested} (The service(s) that is/are requested to be provided to the patient.) + */ + public List getServiceRequested() { + if (this.serviceRequested == null) + this.serviceRequested = new ArrayList(); + return this.serviceRequested; + } + + public boolean hasServiceRequested() { + if (this.serviceRequested == null) + return false; + for (CodeableConcept item : this.serviceRequested) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #serviceRequested} (The service(s) that is/are requested to be provided to the patient.) + */ + // syntactic sugar + public CodeableConcept addServiceRequested() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.serviceRequested == null) + this.serviceRequested = new ArrayList(); + this.serviceRequested.add(t); + return t; + } + + // syntactic sugar + public ReferralRequest addServiceRequested(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.serviceRequested == null) + this.serviceRequested = new ArrayList(); + this.serviceRequested.add(t); + return this; + } + + /** + * @return {@link #supportingInformation} (Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.) + */ + public List getSupportingInformation() { + if (this.supportingInformation == null) + this.supportingInformation = new ArrayList(); + return this.supportingInformation; + } + + public boolean hasSupportingInformation() { + if (this.supportingInformation == null) + return false; + for (Reference item : this.supportingInformation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #supportingInformation} (Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.) + */ + // syntactic sugar + public Reference addSupportingInformation() { //3 + Reference t = new Reference(); + if (this.supportingInformation == null) + this.supportingInformation = new ArrayList(); + this.supportingInformation.add(t); + return t; + } + + // syntactic sugar + public ReferralRequest addSupportingInformation(Reference t) { //3 + if (t == null) + return this; + if (this.supportingInformation == null) + this.supportingInformation = new ArrayList(); + this.supportingInformation.add(t); + return this; + } + + /** + * @return {@link #supportingInformation} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.) + */ + public List getSupportingInformationTarget() { + if (this.supportingInformationTarget == null) + this.supportingInformationTarget = new ArrayList(); + return this.supportingInformationTarget; + } + + /** + * @return {@link #fulfillmentTime} (The period of time within which the services identified in the referral/transfer of care is specified or required to occur.) + */ + public Period getFulfillmentTime() { + if (this.fulfillmentTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.fulfillmentTime"); + else if (Configuration.doAutoCreate()) + this.fulfillmentTime = new Period(); // cc + return this.fulfillmentTime; + } + + public boolean hasFulfillmentTime() { + return this.fulfillmentTime != null && !this.fulfillmentTime.isEmpty(); + } + + /** + * @param value {@link #fulfillmentTime} (The period of time within which the services identified in the referral/transfer of care is specified or required to occur.) + */ + public ReferralRequest setFulfillmentTime(Period value) { + this.fulfillmentTime = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("status", "code", "The workflow status of the referral or transfer of care request.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("identifier", "Identifier", "Business Id that uniquely identifies the referral/care transfer request instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("type", "CodeableConcept", "An indication of the type of referral (or where applicable the type of transfer of care) request.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("specialty", "CodeableConcept", "Indication of the clinical domain or discipline to which the referral or transfer of care request is sent.", 0, java.lang.Integer.MAX_VALUE, specialty)); + childrenList.add(new Property("priority", "CodeableConcept", "An indication of the urgency of referral (or where applicable the type of transfer of care) request.", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient who is the subject of a referral or transfer of care request.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("requester", "Reference(Practitioner|Organization|Patient)", "The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).", 0, java.lang.Integer.MAX_VALUE, requester)); + childrenList.add(new Property("recipient", "Reference(Practitioner|Organization)", "The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.", 0, java.lang.Integer.MAX_VALUE, recipient)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter at which the request for referral or transfer of care is initiated.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("dateSent", "dateTime", "Date/DateTime the request for referral or transfer of care is sent by the author.", 0, java.lang.Integer.MAX_VALUE, dateSent)); + childrenList.add(new Property("reason", "CodeableConcept", "Description of clinical condition indicating why referral/transfer of care is requested.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("description", "string", "The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("serviceRequested", "CodeableConcept", "The service(s) that is/are requested to be provided to the patient.", 0, java.lang.Integer.MAX_VALUE, serviceRequested)); + childrenList.add(new Property("supportingInformation", "Reference(Any)", "Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.", 0, java.lang.Integer.MAX_VALUE, supportingInformation)); + childrenList.add(new Property("fulfillmentTime", "Period", "The period of time within which the services identified in the referral/transfer of care is specified or required to occur.", 0, java.lang.Integer.MAX_VALUE, fulfillmentTime)); + } + + public ReferralRequest copy() { + ReferralRequest dst = new ReferralRequest(); + copyValues(dst); + dst.status = status == null ? null : status.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + dst.specialty = specialty == null ? null : specialty.copy(); + dst.priority = priority == null ? null : priority.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.requester = requester == null ? null : requester.copy(); + if (recipient != null) { + dst.recipient = new ArrayList(); + for (Reference i : recipient) + dst.recipient.add(i.copy()); + }; + dst.encounter = encounter == null ? null : encounter.copy(); + dst.dateSent = dateSent == null ? null : dateSent.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.description = description == null ? null : description.copy(); + if (serviceRequested != null) { + dst.serviceRequested = new ArrayList(); + for (CodeableConcept i : serviceRequested) + dst.serviceRequested.add(i.copy()); + }; + if (supportingInformation != null) { + dst.supportingInformation = new ArrayList(); + for (Reference i : supportingInformation) + dst.supportingInformation.add(i.copy()); + }; + dst.fulfillmentTime = fulfillmentTime == null ? null : fulfillmentTime.copy(); + return dst; + } + + protected ReferralRequest typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ReferralRequest)) + return false; + ReferralRequest o = (ReferralRequest) other; + return compareDeep(status, o.status, true) && compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) + && compareDeep(specialty, o.specialty, true) && compareDeep(priority, o.priority, true) && compareDeep(patient, o.patient, true) + && compareDeep(requester, o.requester, true) && compareDeep(recipient, o.recipient, true) && compareDeep(encounter, o.encounter, true) + && compareDeep(dateSent, o.dateSent, true) && compareDeep(reason, o.reason, true) && compareDeep(description, o.description, true) + && compareDeep(serviceRequested, o.serviceRequested, true) && compareDeep(supportingInformation, o.supportingInformation, true) + && compareDeep(fulfillmentTime, o.fulfillmentTime, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ReferralRequest)) + return false; + ReferralRequest o = (ReferralRequest) other; + return compareValues(status, o.status, true) && compareValues(dateSent, o.dateSent, true) && compareValues(description, o.description, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (status == null || status.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (type == null || type.isEmpty()) && (specialty == null || specialty.isEmpty()) && (priority == null || priority.isEmpty()) + && (patient == null || patient.isEmpty()) && (requester == null || requester.isEmpty()) && (recipient == null || recipient.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (dateSent == null || dateSent.isEmpty()) + && (reason == null || reason.isEmpty()) && (description == null || description.isEmpty()) + && (serviceRequested == null || serviceRequested.isEmpty()) && (supportingInformation == null || supportingInformation.isEmpty()) + && (fulfillmentTime == null || fulfillmentTime.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ReferralRequest; + } + + @SearchParamDefinition(name="requester", path="ReferralRequest.requester", description="Requester of referral / transfer of care", type="reference" ) + public static final String SP_REQUESTER = "requester"; + @SearchParamDefinition(name="specialty", path="ReferralRequest.specialty", description="The specialty that the referral is for", type="token" ) + public static final String SP_SPECIALTY = "specialty"; + @SearchParamDefinition(name="patient", path="ReferralRequest.patient", description="Who the referral is about", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="recipient", path="ReferralRequest.recipient", description="The person that the referral was sent to", type="reference" ) + public static final String SP_RECIPIENT = "recipient"; + @SearchParamDefinition(name="type", path="ReferralRequest.type", description="The type of the referral", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="priority", path="ReferralRequest.priority", description="The priority assigned to the referral", type="token" ) + public static final String SP_PRIORITY = "priority"; + @SearchParamDefinition(name="status", path="ReferralRequest.status", description="The status of the referral", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/RelatedPerson.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/RelatedPerson.java index 624b48c5ff4..4e1b6b60d1c 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/RelatedPerson.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/RelatedPerson.java @@ -1,659 +1,638 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process. - */ -@ResourceDef(name="RelatedPerson", profile="http://hl7.org/fhir/Profile/RelatedPerson") -public class RelatedPerson extends DomainResource { - - public enum AdministrativeGender { - /** - * Male - */ - MALE, - /** - * Female - */ - FEMALE, - /** - * Other - */ - OTHER, - /** - * Unknown - */ - UNKNOWN, - /** - * added to help the parsers - */ - NULL; - public static AdministrativeGender fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return MALE; - if ("female".equals(codeString)) - return FEMALE; - if ("other".equals(codeString)) - return OTHER; - if ("unknown".equals(codeString)) - return UNKNOWN; - throw new Exception("Unknown AdministrativeGender code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case MALE: return "male"; - case FEMALE: return "female"; - case OTHER: return "other"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MALE: return ""; - case FEMALE: return ""; - case OTHER: return ""; - case UNKNOWN: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MALE: return "Male"; - case FEMALE: return "Female"; - case OTHER: return "Other"; - case UNKNOWN: return "Unknown"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MALE: return "Male"; - case FEMALE: return "Female"; - case OTHER: return "Other"; - case UNKNOWN: return "Unknown"; - default: return "?"; - } - } - } - - public static class AdministrativeGenderEnumFactory implements EnumFactory { - public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return AdministrativeGender.MALE; - if ("female".equals(codeString)) - return AdministrativeGender.FEMALE; - if ("other".equals(codeString)) - return AdministrativeGender.OTHER; - if ("unknown".equals(codeString)) - return AdministrativeGender.UNKNOWN; - throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); - } - public String toCode(AdministrativeGender code) { - if (code == AdministrativeGender.MALE) - return "male"; - if (code == AdministrativeGender.FEMALE) - return "female"; - if (code == AdministrativeGender.OTHER) - return "other"; - if (code == AdministrativeGender.UNKNOWN) - return "unknown"; - return "?"; - } - } - - /** - * Identifier for a person within a particular scope. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A Human identifier for this person", formalDefinition="Identifier for a person within a particular scope." ) - protected List identifier; - - /** - * The patient this person is related to. - */ - @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1) - @Description(shortDefinition="The patient this person is related to", formalDefinition="The patient this person is related to." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient this person is related to.) - */ - protected Patient patientTarget; - - /** - * The nature of the relationship between a patient and the related person. - */ - @Child(name = "relationship", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="The nature of the relationship", formalDefinition="The nature of the relationship between a patient and the related person." ) - protected CodeableConcept relationship; - - /** - * A name associated with the person. - */ - @Child(name = "name", type = {HumanName.class}, order=3, min=0, max=1) - @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." ) - protected HumanName name; - - /** - * A contact detail for the person, e.g. a telephone number or an email address. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." ) - protected List telecom; - - /** - * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - @Child(name = "gender", type = {CodeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." ) - protected Enumeration gender; - - /** - * Address where the related person can be contacted or visited. - */ - @Child(name = "address", type = {Address.class}, order=6, min=0, max=1) - @Description(shortDefinition="Address where the related person can be contacted or visited", formalDefinition="Address where the related person can be contacted or visited." ) - protected Address address; - - /** - * Image of the person. - */ - @Child(name = "photo", type = {Attachment.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Image of the person", formalDefinition="Image of the person." ) - protected List photo; - - /** - * The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown. - */ - @Child(name = "period", type = {Period.class}, order=8, min=0, max=1) - @Description(shortDefinition="Period of time that this relationship is considered valid", formalDefinition="The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown." ) - protected Period period; - - private static final long serialVersionUID = 1871047258L; - - /* - * Constructor - */ - public RelatedPerson() { - super(); - } - - /* - * Constructor - */ - public RelatedPerson(Reference patient) { - super(); - this.patient = patient; - } - - /** - * @return {@link #identifier} (Identifier for a person within a particular scope.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifier for a person within a particular scope.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public RelatedPerson addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #patient} (The patient this person is related to.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedPerson.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The patient this person is related to.) - */ - public RelatedPerson setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient this person is related to.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedPerson.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient this person is related to.) - */ - public RelatedPerson setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #relationship} (The nature of the relationship between a patient and the related person.) - */ - public CodeableConcept getRelationship() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedPerson.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new CodeableConcept(); // cc - return this.relationship; - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (The nature of the relationship between a patient and the related person.) - */ - public RelatedPerson setRelationship(CodeableConcept value) { - this.relationship = value; - return this; - } - - /** - * @return {@link #name} (A name associated with the person.) - */ - public HumanName getName() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedPerson.name"); - else if (Configuration.doAutoCreate()) - this.name = new HumanName(); // cc - return this.name; - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A name associated with the person.) - */ - public RelatedPerson setName(HumanName value) { - this.name = value; - return this; - } - - /** - * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public RelatedPerson addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Enumeration getGenderElement() { - if (this.gender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedPerson.gender"); - else if (Configuration.doAutoCreate()) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb - return this.gender; - } - - public boolean hasGenderElement() { - return this.gender != null && !this.gender.isEmpty(); - } - - public boolean hasGender() { - return this.gender != null && !this.gender.isEmpty(); - } - - /** - * @param value {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public RelatedPerson setGenderElement(Enumeration value) { - this.gender = value; - return this; - } - - /** - * @return Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - public AdministrativeGender getGender() { - return this.gender == null ? null : this.gender.getValue(); - } - - /** - * @param value Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - public RelatedPerson setGender(AdministrativeGender value) { - if (value == null) - this.gender = null; - else { - if (this.gender == null) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); - this.gender.setValue(value); - } - return this; - } - - /** - * @return {@link #address} (Address where the related person can be contacted or visited.) - */ - public Address getAddress() { - if (this.address == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedPerson.address"); - else if (Configuration.doAutoCreate()) - this.address = new Address(); // cc - return this.address; - } - - public boolean hasAddress() { - return this.address != null && !this.address.isEmpty(); - } - - /** - * @param value {@link #address} (Address where the related person can be contacted or visited.) - */ - public RelatedPerson setAddress(Address value) { - this.address = value; - return this; - } - - /** - * @return {@link #photo} (Image of the person.) - */ - public List getPhoto() { - if (this.photo == null) - this.photo = new ArrayList(); - return this.photo; - } - - public boolean hasPhoto() { - if (this.photo == null) - return false; - for (Attachment item : this.photo) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #photo} (Image of the person.) - */ - // syntactic sugar - public Attachment addPhoto() { //3 - Attachment t = new Attachment(); - if (this.photo == null) - this.photo = new ArrayList(); - this.photo.add(t); - return t; - } - - // syntactic sugar - public RelatedPerson addPhoto(Attachment t) { //3 - if (t == null) - return this; - if (this.photo == null) - this.photo = new ArrayList(); - this.photo.add(t); - return this; - } - - /** - * @return {@link #period} (The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedPerson.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.) - */ - public RelatedPerson setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier for a person within a particular scope.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient this person is related to.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("relationship", "CodeableConcept", "The nature of the relationship between a patient and the related person.", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the person, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); - childrenList.add(new Property("address", "Address", "Address where the related person can be contacted or visited.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("photo", "Attachment", "Image of the person.", 0, java.lang.Integer.MAX_VALUE, photo)); - childrenList.add(new Property("period", "Period", "The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - public RelatedPerson copy() { - RelatedPerson dst = new RelatedPerson(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.gender = gender == null ? null : gender.copy(); - dst.address = address == null ? null : address.copy(); - if (photo != null) { - dst.photo = new ArrayList(); - for (Attachment i : photo) - dst.photo.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - return dst; - } - - protected RelatedPerson typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof RelatedPerson)) - return false; - RelatedPerson o = (RelatedPerson) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(relationship, o.relationship, true) - && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) && compareDeep(gender, o.gender, true) - && compareDeep(address, o.address, true) && compareDeep(photo, o.photo, true) && compareDeep(period, o.period, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof RelatedPerson)) - return false; - RelatedPerson o = (RelatedPerson) other; - return compareValues(gender, o.gender, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) - && (relationship == null || relationship.isEmpty()) && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - && (gender == null || gender.isEmpty()) && (address == null || address.isEmpty()) && (photo == null || photo.isEmpty()) - && (period == null || period.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.RelatedPerson; - } - - @SearchParamDefinition(name="patient", path="RelatedPerson.patient", description="The patient this person is related to", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="phonetic", path="", description="A portion of name using some kind of phonetic matching algorithm", type="string" ) - public static final String SP_PHONETIC = "phonetic"; - @SearchParamDefinition(name="address", path="RelatedPerson.address", description="An address in any kind of address/part", type="string" ) - public static final String SP_ADDRESS = "address"; - @SearchParamDefinition(name="name", path="RelatedPerson.name", description="A portion of name in any name part", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="telecom", path="RelatedPerson.telecom", description="The value in any kind of contact", type="token" ) - public static final String SP_TELECOM = "telecom"; - @SearchParamDefinition(name="gender", path="RelatedPerson.gender", description="Gender of the person", type="token" ) - public static final String SP_GENDER = "gender"; - @SearchParamDefinition(name="identifier", path="RelatedPerson.identifier", description="A patient Identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process. + */ +@ResourceDef(name="RelatedPerson", profile="http://hl7.org/fhir/Profile/RelatedPerson") +public class RelatedPerson extends DomainResource { + + public enum AdministrativeGender { + /** + * Male + */ + MALE, + /** + * Female + */ + FEMALE, + /** + * Other + */ + OTHER, + /** + * Unknown + */ + UNKNOWN, + /** + * added to help the parsers + */ + NULL; + public static AdministrativeGender fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return MALE; + if ("female".equals(codeString)) + return FEMALE; + if ("other".equals(codeString)) + return OTHER; + if ("unknown".equals(codeString)) + return UNKNOWN; + throw new Exception("Unknown AdministrativeGender code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case MALE: return "male"; + case FEMALE: return "female"; + case OTHER: return "other"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MALE: return ""; + case FEMALE: return ""; + case OTHER: return ""; + case UNKNOWN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MALE: return "Male"; + case FEMALE: return "Female"; + case OTHER: return "Other"; + case UNKNOWN: return "Unknown"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MALE: return "Male"; + case FEMALE: return "Female"; + case OTHER: return "Other"; + case UNKNOWN: return "Unknown"; + default: return "?"; + } + } + } + + public static class AdministrativeGenderEnumFactory implements EnumFactory { + public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return AdministrativeGender.MALE; + if ("female".equals(codeString)) + return AdministrativeGender.FEMALE; + if ("other".equals(codeString)) + return AdministrativeGender.OTHER; + if ("unknown".equals(codeString)) + return AdministrativeGender.UNKNOWN; + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); + } + public String toCode(AdministrativeGender code) { + if (code == AdministrativeGender.MALE) + return "male"; + if (code == AdministrativeGender.FEMALE) + return "female"; + if (code == AdministrativeGender.OTHER) + return "other"; + if (code == AdministrativeGender.UNKNOWN) + return "unknown"; + return "?"; + } + } + + /** + * Identifier for a person within a particular scope. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A Human identifier for this person", formalDefinition="Identifier for a person within a particular scope." ) + protected List identifier; + + /** + * The patient this person is related to. + */ + @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1) + @Description(shortDefinition="The patient this person is related to", formalDefinition="The patient this person is related to." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient this person is related to.) + */ + protected Patient patientTarget; + + /** + * The nature of the relationship between a patient and the related person. + */ + @Child(name = "relationship", type = {CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="The nature of the relationship", formalDefinition="The nature of the relationship between a patient and the related person." ) + protected CodeableConcept relationship; + + /** + * A name associated with the person. + */ + @Child(name = "name", type = {HumanName.class}, order=3, min=0, max=1) + @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." ) + protected HumanName name; + + /** + * A contact detail for the person, e.g. a telephone number or an email address. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." ) + protected List telecom; + + /** + * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + @Child(name = "gender", type = {CodeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." ) + protected Enumeration gender; + + /** + * Address where the related person can be contacted or visited. + */ + @Child(name = "address", type = {Address.class}, order=6, min=0, max=1) + @Description(shortDefinition="Address where the related person can be contacted or visited", formalDefinition="Address where the related person can be contacted or visited." ) + protected Address address; + + /** + * Image of the person. + */ + @Child(name = "photo", type = {Attachment.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Image of the person", formalDefinition="Image of the person." ) + protected List photo; + + /** + * The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown. + */ + @Child(name = "period", type = {Period.class}, order=8, min=0, max=1) + @Description(shortDefinition="Period of time that this relationship is considered valid", formalDefinition="The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown." ) + protected Period period; + + private static final long serialVersionUID = 1871047258L; + + /* + * Constructor + */ + public RelatedPerson() { + super(); + } + + /* + * Constructor + */ + public RelatedPerson(Reference patient) { + super(); + this.patient = patient; + } + + /** + * @return {@link #identifier} (Identifier for a person within a particular scope.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Identifier for a person within a particular scope.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public RelatedPerson addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #patient} (The patient this person is related to.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedPerson.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The patient this person is related to.) + */ + public RelatedPerson setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient this person is related to.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedPerson.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient this person is related to.) + */ + public RelatedPerson setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #relationship} (The nature of the relationship between a patient and the related person.) + */ + public CodeableConcept getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedPerson.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new CodeableConcept(); // cc + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The nature of the relationship between a patient and the related person.) + */ + public RelatedPerson setRelationship(CodeableConcept value) { + this.relationship = value; + return this; + } + + /** + * @return {@link #name} (A name associated with the person.) + */ + public HumanName getName() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedPerson.name"); + else if (Configuration.doAutoCreate()) + this.name = new HumanName(); // cc + return this.name; + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A name associated with the person.) + */ + public RelatedPerson setName(HumanName value) { + this.name = value; + return this; + } + + /** + * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public RelatedPerson addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @return {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Enumeration getGenderElement() { + if (this.gender == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedPerson.gender"); + else if (Configuration.doAutoCreate()) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb + return this.gender; + } + + public boolean hasGenderElement() { + return this.gender != null && !this.gender.isEmpty(); + } + + public boolean hasGender() { + return this.gender != null && !this.gender.isEmpty(); + } + + /** + * @param value {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public RelatedPerson setGenderElement(Enumeration value) { + this.gender = value; + return this; + } + + /** + * @return Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + public AdministrativeGender getGender() { + return this.gender == null ? null : this.gender.getValue(); + } + + /** + * @param value Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + public RelatedPerson setGender(AdministrativeGender value) { + if (value == null) + this.gender = null; + else { + if (this.gender == null) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); + this.gender.setValue(value); + } + return this; + } + + /** + * @return {@link #address} (Address where the related person can be contacted or visited.) + */ + public Address getAddress() { + if (this.address == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedPerson.address"); + else if (Configuration.doAutoCreate()) + this.address = new Address(); // cc + return this.address; + } + + public boolean hasAddress() { + return this.address != null && !this.address.isEmpty(); + } + + /** + * @param value {@link #address} (Address where the related person can be contacted or visited.) + */ + public RelatedPerson setAddress(Address value) { + this.address = value; + return this; + } + + /** + * @return {@link #photo} (Image of the person.) + */ + public List getPhoto() { + if (this.photo == null) + this.photo = new ArrayList(); + return this.photo; + } + + public boolean hasPhoto() { + if (this.photo == null) + return false; + for (Attachment item : this.photo) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #photo} (Image of the person.) + */ + // syntactic sugar + public Attachment addPhoto() { //3 + Attachment t = new Attachment(); + if (this.photo == null) + this.photo = new ArrayList(); + this.photo.add(t); + return t; + } + + // syntactic sugar + public RelatedPerson addPhoto(Attachment t) { //3 + if (t == null) + return this; + if (this.photo == null) + this.photo = new ArrayList(); + this.photo.add(t); + return this; + } + + /** + * @return {@link #period} (The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedPerson.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.) + */ + public RelatedPerson setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier for a person within a particular scope.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient this person is related to.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("relationship", "CodeableConcept", "The nature of the relationship between a patient and the related person.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the person, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); + childrenList.add(new Property("address", "Address", "Address where the related person can be contacted or visited.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("photo", "Attachment", "Image of the person.", 0, java.lang.Integer.MAX_VALUE, photo)); + childrenList.add(new Property("period", "Period", "The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + public RelatedPerson copy() { + RelatedPerson dst = new RelatedPerson(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.gender = gender == null ? null : gender.copy(); + dst.address = address == null ? null : address.copy(); + if (photo != null) { + dst.photo = new ArrayList(); + for (Attachment i : photo) + dst.photo.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + return dst; + } + + protected RelatedPerson typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof RelatedPerson)) + return false; + RelatedPerson o = (RelatedPerson) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(relationship, o.relationship, true) + && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) && compareDeep(gender, o.gender, true) + && compareDeep(address, o.address, true) && compareDeep(photo, o.photo, true) && compareDeep(period, o.period, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof RelatedPerson)) + return false; + RelatedPerson o = (RelatedPerson) other; + return compareValues(gender, o.gender, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) + && (relationship == null || relationship.isEmpty()) && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + && (gender == null || gender.isEmpty()) && (address == null || address.isEmpty()) && (photo == null || photo.isEmpty()) + && (period == null || period.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.RelatedPerson; + } + + @SearchParamDefinition(name="identifier", path="RelatedPerson.identifier", description="A patient Identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="phonetic", path="", description="A portion of name using some kind of phonetic matching algorithm", type="string" ) + public static final String SP_PHONETIC = "phonetic"; + @SearchParamDefinition(name="address", path="RelatedPerson.address", description="An address in any kind of address/part", type="string" ) + public static final String SP_ADDRESS = "address"; + @SearchParamDefinition(name="gender", path="RelatedPerson.gender", description="Gender of the person", type="token" ) + public static final String SP_GENDER = "gender"; + @SearchParamDefinition(name="patient", path="RelatedPerson.patient", description="The patient this person is related to", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="name", path="RelatedPerson.name", description="A portion of name in any name part", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="telecom", path="RelatedPerson.telecom", description="The value in any kind of contact", type="token" ) + public static final String SP_TELECOM = "telecom"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Resource.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Resource.java index eda5f7657dc..0ffc11c9e1d 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Resource.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Resource.java @@ -1,323 +1,302 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Base Resource for everything. - */ -public abstract class Resource extends BaseResource implements IRefImplResource { - - /** - * The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes. - */ - @Child(name = "id", type = {IdType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Logical id of this artefact", formalDefinition="The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes." ) - protected IdType id; - - /** - * The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource. - */ - @Child(name = "meta", type = {Meta.class}, order=1, min=0, max=1) - @Description(shortDefinition="Metadata about the resource", formalDefinition="The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource." ) - protected Meta meta; - - /** - * A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. - */ - @Child(name = "implicitRules", type = {UriType.class}, order=2, min=0, max=1) - @Description(shortDefinition="A set of rules under which this content was created", formalDefinition="A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content." ) - protected UriType implicitRules; - - /** - * The base language in which the resource is written. - */ - @Child(name = "language", type = {CodeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Language of the resource content", formalDefinition="The base language in which the resource is written." ) - protected CodeType language; - - private static final long serialVersionUID = -559462759L; - - /* - * Constructor - */ - public Resource() { - super(); - } - - /** - * @return {@link #id} (The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes.). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value - */ - public IdType getIdElement() { - if (this.id == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Resource.id"); - else if (Configuration.doAutoCreate()) - this.id = new IdType(); // bb - return this.id; - } - - public boolean hasIdElement() { - return this.id != null && !this.id.isEmpty(); - } - - public boolean hasId() { - return this.id != null && !this.id.isEmpty(); - } - - /** - * @param value {@link #id} (The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes.). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value - */ - public Resource setIdElement(IdType value) { - this.id = value; - return this; - } - - /** - * @return The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes. - */ - public String getId() { - return this.id == null ? null : this.id.getValue(); - } - - /** - * @param value The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes. - */ - public Resource setId(String value) { - if (Utilities.noString(value)) - this.id = null; - else { - if (this.id == null) - this.id = new IdType(); - this.id.setValue(value); - } - return this; - } - - /** - * @return {@link #meta} (The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.) - */ - public Meta getMeta() { - if (this.meta == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Resource.meta"); - else if (Configuration.doAutoCreate()) - this.meta = new Meta(); // cc - return this.meta; - } - - public boolean hasMeta() { - return this.meta != null && !this.meta.isEmpty(); - } - - /** - * @param value {@link #meta} (The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.) - */ - public Resource setMeta(Meta value) { - this.meta = value; - return this; - } - - /** - * @return {@link #implicitRules} (A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.). This is the underlying object with id, value and extensions. The accessor "getImplicitRules" gives direct access to the value - */ - public UriType getImplicitRulesElement() { - if (this.implicitRules == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Resource.implicitRules"); - else if (Configuration.doAutoCreate()) - this.implicitRules = new UriType(); // bb - return this.implicitRules; - } - - public boolean hasImplicitRulesElement() { - return this.implicitRules != null && !this.implicitRules.isEmpty(); - } - - public boolean hasImplicitRules() { - return this.implicitRules != null && !this.implicitRules.isEmpty(); - } - - /** - * @param value {@link #implicitRules} (A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.). This is the underlying object with id, value and extensions. The accessor "getImplicitRules" gives direct access to the value - */ - public Resource setImplicitRulesElement(UriType value) { - this.implicitRules = value; - return this; - } - - /** - * @return A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. - */ - public String getImplicitRules() { - return this.implicitRules == null ? null : this.implicitRules.getValue(); - } - - /** - * @param value A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. - */ - public Resource setImplicitRules(String value) { - if (Utilities.noString(value)) - this.implicitRules = null; - else { - if (this.implicitRules == null) - this.implicitRules = new UriType(); - this.implicitRules.setValue(value); - } - return this; - } - - /** - * @return {@link #language} (The base language in which the resource is written.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public CodeType getLanguageElement() { - if (this.language == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Resource.language"); - else if (Configuration.doAutoCreate()) - this.language = new CodeType(); // bb - return this.language; - } - - public boolean hasLanguageElement() { - return this.language != null && !this.language.isEmpty(); - } - - public boolean hasLanguage() { - return this.language != null && !this.language.isEmpty(); - } - - /** - * @param value {@link #language} (The base language in which the resource is written.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public Resource setLanguageElement(CodeType value) { - this.language = value; - return this; - } - - /** - * @return The base language in which the resource is written. - */ - public String getLanguage() { - return this.language == null ? null : this.language.getValue(); - } - - /** - * @param value The base language in which the resource is written. - */ - public Resource setLanguage(String value) { - if (Utilities.noString(value)) - this.language = null; - else { - if (this.language == null) - this.language = new CodeType(); - this.language.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - childrenList.add(new Property("id", "id", "The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes.", 0, java.lang.Integer.MAX_VALUE, id)); - childrenList.add(new Property("meta", "Meta", "The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.", 0, java.lang.Integer.MAX_VALUE, meta)); - childrenList.add(new Property("implicitRules", "uri", "A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.", 0, java.lang.Integer.MAX_VALUE, implicitRules)); - childrenList.add(new Property("language", "code", "The base language in which the resource is written.", 0, java.lang.Integer.MAX_VALUE, language)); - } - - public abstract Resource copy(); - - public void copyValues(Resource dst) { - dst.id = id == null ? null : id.copy(); - dst.meta = meta == null ? null : meta.copy(); - dst.implicitRules = implicitRules == null ? null : implicitRules.copy(); - dst.language = language == null ? null : language.copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Resource)) - return false; - Resource o = (Resource) other; - return compareDeep(id, o.id, true) && compareDeep(meta, o.meta, true) && compareDeep(implicitRules, o.implicitRules, true) - && compareDeep(language, o.language, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Resource)) - return false; - Resource o = (Resource) other; - return compareValues(id, o.id, true) && compareValues(implicitRules, o.implicitRules, true) && compareValues(language, o.language, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (id == null || id.isEmpty()) && (meta == null || meta.isEmpty()) && (implicitRules == null || implicitRules.isEmpty()) - && (language == null || language.isEmpty()); - } - - public abstract ResourceType getResourceType(); - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Base Resource for everything. + */ +public abstract class Resource extends BaseResource implements IAnyResource { + + /** + * The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes. + */ + @Child(name = "id", type = {IdType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Logical id of this artefact", formalDefinition="The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes." ) + protected IdType id; + + /** + * The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource. + */ + @Child(name = "meta", type = {Meta.class}, order=1, min=0, max=1) + @Description(shortDefinition="Metadata about the resource", formalDefinition="The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource." ) + protected Meta meta; + + /** + * A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. + */ + @Child(name = "implicitRules", type = {UriType.class}, order=2, min=0, max=1) + @Description(shortDefinition="A set of rules under which this content was created", formalDefinition="A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content." ) + protected UriType implicitRules; + + /** + * The base language in which the resource is written. + */ + @Child(name = "language", type = {CodeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Language of the resource content", formalDefinition="The base language in which the resource is written." ) + protected CodeType language; + + private static final long serialVersionUID = -559462759L; + + /* + * Constructor + */ + public Resource() { + super(); + } + + /** + * @return {@link #id} (The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes.). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value + */ + public IdType getIdElement() { + if (this.id == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Resource.id"); + else if (Configuration.doAutoCreate()) + this.id = new IdType(); // bb + return this.id; + } + + public boolean hasIdElement() { + return this.id != null && !this.id.isEmpty(); + } + + public boolean hasId() { + return this.id != null && !this.id.isEmpty(); + } + + /** + * @param value {@link #id} (The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes.). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value + */ + public Resource setIdElement(IdType value) { + this.id = value; + return this; + } + + /** + * @return The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes. + */ + public String getId() { + return this.id == null ? null : this.id.getValue(); + } + + /** + * @param value The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes. + */ + public Resource setId(String value) { + if (Utilities.noString(value)) + this.id = null; + else { + if (this.id == null) + this.id = new IdType(); + this.id.setValue(value); + } + return this; + } + + /** + * @return {@link #meta} (The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.) + */ + public Meta getMeta() { + if (this.meta == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Resource.meta"); + else if (Configuration.doAutoCreate()) + this.meta = new Meta(); // cc + return this.meta; + } + + public boolean hasMeta() { + return this.meta != null && !this.meta.isEmpty(); + } + + /** + * @param value {@link #meta} (The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.) + */ + public Resource setMeta(Meta value) { + this.meta = value; + return this; + } + + /** + * @return {@link #implicitRules} (A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.). This is the underlying object with id, value and extensions. The accessor "getImplicitRules" gives direct access to the value + */ + public UriType getImplicitRulesElement() { + if (this.implicitRules == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Resource.implicitRules"); + else if (Configuration.doAutoCreate()) + this.implicitRules = new UriType(); // bb + return this.implicitRules; + } + + public boolean hasImplicitRulesElement() { + return this.implicitRules != null && !this.implicitRules.isEmpty(); + } + + public boolean hasImplicitRules() { + return this.implicitRules != null && !this.implicitRules.isEmpty(); + } + + /** + * @param value {@link #implicitRules} (A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.). This is the underlying object with id, value and extensions. The accessor "getImplicitRules" gives direct access to the value + */ + public Resource setImplicitRulesElement(UriType value) { + this.implicitRules = value; + return this; + } + + /** + * @return A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. + */ + public String getImplicitRules() { + return this.implicitRules == null ? null : this.implicitRules.getValue(); + } + + /** + * @param value A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. + */ + public Resource setImplicitRules(String value) { + if (Utilities.noString(value)) + this.implicitRules = null; + else { + if (this.implicitRules == null) + this.implicitRules = new UriType(); + this.implicitRules.setValue(value); + } + return this; + } + + /** + * @return {@link #language} (The base language in which the resource is written.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public CodeType getLanguageElement() { + if (this.language == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Resource.language"); + else if (Configuration.doAutoCreate()) + this.language = new CodeType(); // bb + return this.language; + } + + public boolean hasLanguageElement() { + return this.language != null && !this.language.isEmpty(); + } + + public boolean hasLanguage() { + return this.language != null && !this.language.isEmpty(); + } + + /** + * @param value {@link #language} (The base language in which the resource is written.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public Resource setLanguageElement(CodeType value) { + this.language = value; + return this; + } + + /** + * @return The base language in which the resource is written. + */ + public String getLanguage() { + return this.language == null ? null : this.language.getValue(); + } + + /** + * @param value The base language in which the resource is written. + */ + public Resource setLanguage(String value) { + if (Utilities.noString(value)) + this.language = null; + else { + if (this.language == null) + this.language = new CodeType(); + this.language.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + childrenList.add(new Property("id", "id", "The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes.", 0, java.lang.Integer.MAX_VALUE, id)); + childrenList.add(new Property("meta", "Meta", "The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.", 0, java.lang.Integer.MAX_VALUE, meta)); + childrenList.add(new Property("implicitRules", "uri", "A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.", 0, java.lang.Integer.MAX_VALUE, implicitRules)); + childrenList.add(new Property("language", "code", "The base language in which the resource is written.", 0, java.lang.Integer.MAX_VALUE, language)); + } + + public abstract Resource copy(); + + public void copyValues(Resource dst) { + dst.id = id == null ? null : id.copy(); + dst.meta = meta == null ? null : meta.copy(); + dst.implicitRules = implicitRules == null ? null : implicitRules.copy(); + dst.language = language == null ? null : language.copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Resource)) + return false; + Resource o = (Resource) other; + return compareDeep(id, o.id, true) && compareDeep(meta, o.meta, true) && compareDeep(implicitRules, o.implicitRules, true) + && compareDeep(language, o.language, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Resource)) + return false; + Resource o = (Resource) other; + return compareValues(id, o.id, true) && compareValues(implicitRules, o.implicitRules, true) && compareValues(language, o.language, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (id == null || id.isEmpty()) && (meta == null || meta.isEmpty()) && (implicitRules == null || implicitRules.isEmpty()) + && (language == null || language.isEmpty()); + } + + public abstract ResourceType getResourceType(); + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ResourceEnumerations.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ResourceEnumerations.java index 261ab636cdf..390f3b1d63e 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ResourceEnumerations.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ResourceEnumerations.java @@ -1,37 +1,16 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -public class ResourceEnumerations { - - @SuppressWarnings("rawtypes") - public static EnumFactory getEnumFactory(Class clss) { - if (clss == HumanName.NameUse.class) - return new HumanName.NameUseEnumFactory(); - if (clss == Observation.ObservationReliability.class) - return new Observation.ObservationReliabilityEnumFactory(); - if (clss == Observation.ObservationStatus.class) - return new Observation.ObservationStatusEnumFactory(); - return null; - } - -} +package org.hl7.fhir.instance.model; + +public class ResourceEnumerations { + + @SuppressWarnings("rawtypes") + public static EnumFactory getEnumFactory(Class clss) { + if (clss == HumanName.NameUse.class) + return new HumanName.NameUseEnumFactory(); + if (clss == Observation.ObservationReliability.class) + return new Observation.ObservationReliabilityEnumFactory(); + if (clss == Observation.ObservationStatus.class) + return new Observation.ObservationStatusEnumFactory(); + return null; + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ResourceFactory.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ResourceFactory.java index 0fe5de32535..c79c08415d3 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ResourceFactory.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ResourceFactory.java @@ -1,300 +1,281 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -public class ResourceFactory extends Factory { - - public static Resource createReference(String name) throws Exception { - if ("Condition".equals(name)) - return new Condition(); - if ("Parameters".equals(name)) - return new Parameters(); - if ("Supply".equals(name)) - return new Supply(); - if ("ProcedureRequest".equals(name)) - return new ProcedureRequest(); - if ("DeviceComponent".equals(name)) - return new DeviceComponent(); - if ("DeviceMetric".equals(name)) - return new DeviceMetric(); - if ("Communication".equals(name)) - return new Communication(); - if ("Organization".equals(name)) - return new Organization(); - if ("ProcessRequest".equals(name)) - return new ProcessRequest(); - if ("Group".equals(name)) - return new Group(); - if ("ValueSet".equals(name)) - return new ValueSet(); - if ("ImmunizationRecommendation".equals(name)) - return new ImmunizationRecommendation(); - if ("Coverage".equals(name)) - return new Coverage(); - if ("Appointment".equals(name)) - return new Appointment(); - if ("MedicationDispense".equals(name)) - return new MedicationDispense(); - if ("MedicationPrescription".equals(name)) - return new MedicationPrescription(); - if ("Slot".equals(name)) - return new Slot(); - if ("Contraindication".equals(name)) - return new Contraindication(); - if ("PaymentNotice".equals(name)) - return new PaymentNotice(); - if ("MedicationStatement".equals(name)) - return new MedicationStatement(); - if ("AppointmentResponse".equals(name)) - return new AppointmentResponse(); - if ("Composition".equals(name)) - return new Composition(); - if ("Questionnaire".equals(name)) - return new Questionnaire(); - if ("EpisodeOfCare".equals(name)) - return new EpisodeOfCare(); - if ("OperationOutcome".equals(name)) - return new OperationOutcome(); - if ("Conformance".equals(name)) - return new Conformance(); - if ("FamilyMemberHistory".equals(name)) - return new FamilyMemberHistory(); - if ("NamingSystem".equals(name)) - return new NamingSystem(); - if ("Media".equals(name)) - return new Media(); - if ("Binary".equals(name)) - return new Binary(); - if ("HealthcareService".equals(name)) - return new HealthcareService(); - if ("VisionPrescription".equals(name)) - return new VisionPrescription(); - if ("DocumentReference".equals(name)) - return new DocumentReference(); - if ("Immunization".equals(name)) - return new Immunization(); - if ("Bundle".equals(name)) - return new Bundle(); - if ("Subscription".equals(name)) - return new Subscription(); - if ("OrderResponse".equals(name)) - return new OrderResponse(); - if ("ConceptMap".equals(name)) - return new ConceptMap(); - if ("ImagingStudy".equals(name)) - return new ImagingStudy(); - if ("Practitioner".equals(name)) - return new Practitioner(); - if ("CarePlan".equals(name)) - return new CarePlan(); - if ("Provenance".equals(name)) - return new Provenance(); - if ("Device".equals(name)) - return new Device(); - if ("StructureDefinition".equals(name)) - return new StructureDefinition(); - if ("Order".equals(name)) - return new Order(); - if ("Procedure".equals(name)) - return new Procedure(); - if ("Substance".equals(name)) - return new Substance(); - if ("DeviceUseRequest".equals(name)) - return new DeviceUseRequest(); - if ("DiagnosticReport".equals(name)) - return new DiagnosticReport(); - if ("Medication".equals(name)) - return new Medication(); - if ("MessageHeader".equals(name)) - return new MessageHeader(); - if ("DataElement".equals(name)) - return new DataElement(); - if ("DocumentManifest".equals(name)) - return new DocumentManifest(); - if ("Schedule".equals(name)) - return new Schedule(); - if ("SupplyDelivery".equals(name)) - return new SupplyDelivery(); - if ("EligibilityRequest".equals(name)) - return new EligibilityRequest(); - if ("MedicationAdministration".equals(name)) - return new MedicationAdministration(); - if ("QuestionnaireAnswers".equals(name)) - return new QuestionnaireAnswers(); - if ("Encounter".equals(name)) - return new Encounter(); - if ("PaymentReconciliation".equals(name)) - return new PaymentReconciliation(); - if ("List".equals(name)) - return new List_(); - if ("DeviceUseStatement".equals(name)) - return new DeviceUseStatement(); - if ("ImagingObjectSelection".equals(name)) - return new ImagingObjectSelection(); - if ("Goal".equals(name)) - return new Goal(); - if ("OperationDefinition".equals(name)) - return new OperationDefinition(); - if ("NutritionOrder".equals(name)) - return new NutritionOrder(); - if ("SearchParameter".equals(name)) - return new SearchParameter(); - if ("ClaimResponse".equals(name)) - return new ClaimResponse(); - if ("ClinicalImpression".equals(name)) - return new ClinicalImpression(); - if ("ReferralRequest".equals(name)) - return new ReferralRequest(); - if ("Flag".equals(name)) - return new Flag(); - if ("BodySite".equals(name)) - return new BodySite(); - if ("CommunicationRequest".equals(name)) - return new CommunicationRequest(); - if ("RiskAssessment".equals(name)) - return new RiskAssessment(); - if ("Claim".equals(name)) - return new Claim(); - if ("EnrollmentRequest".equals(name)) - return new EnrollmentRequest(); - if ("Location".equals(name)) - return new Location(); - if ("Observation".equals(name)) - return new Observation(); - if ("AllergyIntolerance".equals(name)) - return new AllergyIntolerance(); - if ("ExplanationOfBenefit".equals(name)) - return new ExplanationOfBenefit(); - if ("Contract".equals(name)) - return new Contract(); - if ("RelatedPerson".equals(name)) - return new RelatedPerson(); - if ("Basic".equals(name)) - return new Basic(); - if ("ProcessResponse".equals(name)) - return new ProcessResponse(); - if ("Specimen".equals(name)) - return new Specimen(); - if ("AuditEvent".equals(name)) - return new AuditEvent(); - if ("EnrollmentResponse".equals(name)) - return new EnrollmentResponse(); - if ("Patient".equals(name)) - return new Patient(); - if ("SupplyRequest".equals(name)) - return new SupplyRequest(); - if ("EligibilityResponse".equals(name)) - return new EligibilityResponse(); - if ("Person".equals(name)) - return new Person(); - if ("DiagnosticOrder".equals(name)) - return new DiagnosticOrder(); - else - throw new Exception("Unknown Resource Name '"+name+"'"); - } - - public static Element createType(String name) throws Exception { - if ("Timing".equals(name)) - return new Timing(); - if ("Period".equals(name)) - return new Period(); - if ("Coding".equals(name)) - return new Coding(); - if ("Age".equals(name)) - return new Age(); - if ("Range".equals(name)) - return new Range(); - if ("Count".equals(name)) - return new Count(); - if ("Quantity".equals(name)) - return new Quantity(); - if ("Attachment".equals(name)) - return new Attachment(); - if ("Money".equals(name)) - return new Money(); - if ("Distance".equals(name)) - return new Distance(); - if ("Signature".equals(name)) - return new Signature(); - if ("ContactPoint".equals(name)) - return new ContactPoint(); - if ("ElementDefinition".equals(name)) - return new ElementDefinition(); - if ("Extension".equals(name)) - return new Extension(); - if ("HumanName".equals(name)) - return new HumanName(); - if ("Address".equals(name)) - return new Address(); - if ("Duration".equals(name)) - return new Duration(); - if ("Ratio".equals(name)) - return new Ratio(); - if ("Meta".equals(name)) - return new Meta(); - if ("SampledData".equals(name)) - return new SampledData(); - if ("Reference".equals(name)) - return new Reference(); - if ("CodeableConcept".equals(name)) - return new CodeableConcept(); - if ("Identifier".equals(name)) - return new Identifier(); - if ("Narrative".equals(name)) - return new Narrative(); - else - throw new Exception("Unknown Type Name '"+name+"'"); - } - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +public class ResourceFactory extends Factory { + + public static Resource createReference(String name) throws Exception { + if ("Appointment".equals(name)) + return new Appointment(); + if ("ReferralRequest".equals(name)) + return new ReferralRequest(); + if ("Provenance".equals(name)) + return new Provenance(); + if ("Questionnaire".equals(name)) + return new Questionnaire(); + if ("ExplanationOfBenefit".equals(name)) + return new ExplanationOfBenefit(); + if ("DocumentManifest".equals(name)) + return new DocumentManifest(); + if ("Specimen".equals(name)) + return new Specimen(); + if ("AllergyIntolerance".equals(name)) + return new AllergyIntolerance(); + if ("CarePlan".equals(name)) + return new CarePlan(); + if ("Goal".equals(name)) + return new Goal(); + if ("StructureDefinition".equals(name)) + return new StructureDefinition(); + if ("EnrollmentRequest".equals(name)) + return new EnrollmentRequest(); + if ("EpisodeOfCare".equals(name)) + return new EpisodeOfCare(); + if ("MedicationPrescription".equals(name)) + return new MedicationPrescription(); + if ("OperationOutcome".equals(name)) + return new OperationOutcome(); + if ("Medication".equals(name)) + return new Medication(); + if ("Procedure".equals(name)) + return new Procedure(); + if ("List".equals(name)) + return new List_(); + if ("ConceptMap".equals(name)) + return new ConceptMap(); + if ("Subscription".equals(name)) + return new Subscription(); + if ("ValueSet".equals(name)) + return new ValueSet(); + if ("OperationDefinition".equals(name)) + return new OperationDefinition(); + if ("DocumentReference".equals(name)) + return new DocumentReference(); + if ("Order".equals(name)) + return new Order(); + if ("Immunization".equals(name)) + return new Immunization(); + if ("Parameters".equals(name)) + return new Parameters(); + if ("Device".equals(name)) + return new Device(); + if ("VisionPrescription".equals(name)) + return new VisionPrescription(); + if ("Media".equals(name)) + return new Media(); + if ("Conformance".equals(name)) + return new Conformance(); + if ("ProcedureRequest".equals(name)) + return new ProcedureRequest(); + if ("EligibilityResponse".equals(name)) + return new EligibilityResponse(); + if ("DeviceUseRequest".equals(name)) + return new DeviceUseRequest(); + if ("DeviceMetric".equals(name)) + return new DeviceMetric(); + if ("Flag".equals(name)) + return new Flag(); + if ("RelatedPerson".equals(name)) + return new RelatedPerson(); + if ("SupplyRequest".equals(name)) + return new SupplyRequest(); + if ("Practitioner".equals(name)) + return new Practitioner(); + if ("AppointmentResponse".equals(name)) + return new AppointmentResponse(); + if ("Observation".equals(name)) + return new Observation(); + if ("MedicationAdministration".equals(name)) + return new MedicationAdministration(); + if ("Slot".equals(name)) + return new Slot(); + if ("Contraindication".equals(name)) + return new Contraindication(); + if ("EnrollmentResponse".equals(name)) + return new EnrollmentResponse(); + if ("Binary".equals(name)) + return new Binary(); + if ("MedicationStatement".equals(name)) + return new MedicationStatement(); + if ("Contract".equals(name)) + return new Contract(); + if ("Person".equals(name)) + return new Person(); + if ("CommunicationRequest".equals(name)) + return new CommunicationRequest(); + if ("RiskAssessment".equals(name)) + return new RiskAssessment(); + if ("TestScript".equals(name)) + return new TestScript(); + if ("Basic".equals(name)) + return new Basic(); + if ("Group".equals(name)) + return new Group(); + if ("PaymentNotice".equals(name)) + return new PaymentNotice(); + if ("Organization".equals(name)) + return new Organization(); + if ("ClaimResponse".equals(name)) + return new ClaimResponse(); + if ("EligibilityRequest".equals(name)) + return new EligibilityRequest(); + if ("ProcessRequest".equals(name)) + return new ProcessRequest(); + if ("MedicationDispense".equals(name)) + return new MedicationDispense(); + if ("Supply".equals(name)) + return new Supply(); + if ("DiagnosticReport".equals(name)) + return new DiagnosticReport(); + if ("ImagingStudy".equals(name)) + return new ImagingStudy(); + if ("ImagingObjectSelection".equals(name)) + return new ImagingObjectSelection(); + if ("HealthcareService".equals(name)) + return new HealthcareService(); + if ("DataElement".equals(name)) + return new DataElement(); + if ("DeviceComponent".equals(name)) + return new DeviceComponent(); + if ("FamilyMemberHistory".equals(name)) + return new FamilyMemberHistory(); + if ("QuestionnaireAnswers".equals(name)) + return new QuestionnaireAnswers(); + if ("NutritionOrder".equals(name)) + return new NutritionOrder(); + if ("Encounter".equals(name)) + return new Encounter(); + if ("Substance".equals(name)) + return new Substance(); + if ("AuditEvent".equals(name)) + return new AuditEvent(); + if ("SearchParameter".equals(name)) + return new SearchParameter(); + if ("PaymentReconciliation".equals(name)) + return new PaymentReconciliation(); + if ("Communication".equals(name)) + return new Communication(); + if ("Condition".equals(name)) + return new Condition(); + if ("Composition".equals(name)) + return new Composition(); + if ("Bundle".equals(name)) + return new Bundle(); + if ("DiagnosticOrder".equals(name)) + return new DiagnosticOrder(); + if ("Patient".equals(name)) + return new Patient(); + if ("OrderResponse".equals(name)) + return new OrderResponse(); + if ("Coverage".equals(name)) + return new Coverage(); + if ("DeviceUseStatement".equals(name)) + return new DeviceUseStatement(); + if ("ProcessResponse".equals(name)) + return new ProcessResponse(); + if ("NamingSystem".equals(name)) + return new NamingSystem(); + if ("Schedule".equals(name)) + return new Schedule(); + if ("SupplyDelivery".equals(name)) + return new SupplyDelivery(); + if ("ClinicalImpression".equals(name)) + return new ClinicalImpression(); + if ("MessageHeader".equals(name)) + return new MessageHeader(); + if ("Claim".equals(name)) + return new Claim(); + if ("ImmunizationRecommendation".equals(name)) + return new ImmunizationRecommendation(); + if ("Location".equals(name)) + return new Location(); + if ("BodySite".equals(name)) + return new BodySite(); + else + throw new Exception("Unknown Resource Name '"+name+"'"); + } + + public static Element createType(String name) throws Exception { + if ("Meta".equals(name)) + return new Meta(); + if ("Address".equals(name)) + return new Address(); + if ("Reference".equals(name)) + return new Reference(); + if ("Quantity".equals(name)) + return new Quantity(); + if ("Period".equals(name)) + return new Period(); + if ("Attachment".equals(name)) + return new Attachment(); + if ("Duration".equals(name)) + return new Duration(); + if ("Count".equals(name)) + return new Count(); + if ("Range".equals(name)) + return new Range(); + if ("Extension".equals(name)) + return new Extension(); + if ("Money".equals(name)) + return new Money(); + if ("HumanName".equals(name)) + return new HumanName(); + if ("ContactPoint".equals(name)) + return new ContactPoint(); + if ("Identifier".equals(name)) + return new Identifier(); + if ("Narrative".equals(name)) + return new Narrative(); + if ("Coding".equals(name)) + return new Coding(); + if ("Signature".equals(name)) + return new Signature(); + if ("SampledData".equals(name)) + return new SampledData(); + if ("Ratio".equals(name)) + return new Ratio(); + if ("Timing".equals(name)) + return new Timing(); + if ("ElementDefinition".equals(name)) + return new ElementDefinition(); + if ("Distance".equals(name)) + return new Distance(); + if ("Age".equals(name)) + return new Age(); + if ("CodeableConcept".equals(name)) + return new CodeableConcept(); + else + throw new Exception("Unknown Type Name '"+name+"'"); + } + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ResourceType.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ResourceType.java index b9e3655a601..ce6117218ab 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ResourceType.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ResourceType.java @@ -1,311 +1,293 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -// Generated on Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -public enum ResourceType { - Condition, - Supply, - ProcedureRequest, - DeviceComponent, - DeviceMetric, - Communication, - Organization, - ProcessRequest, - Group, - ValueSet, - Coverage, - ImmunizationRecommendation, - Appointment, - MedicationDispense, - MedicationPrescription, - Slot, - PaymentNotice, - Contraindication, - AppointmentResponse, - MedicationStatement, - EpisodeOfCare, - Questionnaire, - Composition, - OperationOutcome, - Conformance, - FamilyMemberHistory, - NamingSystem, - Media, - Binary, - HealthcareService, - VisionPrescription, - DocumentReference, - Immunization, - Bundle, - Subscription, - OrderResponse, - ConceptMap, - ImagingStudy, - Practitioner, - CarePlan, - Provenance, - Device, - StructureDefinition, - Order, - Procedure, - Substance, - DeviceUseRequest, - DiagnosticReport, - Medication, - MessageHeader, - SupplyDelivery, - Schedule, - DocumentManifest, - DataElement, - EligibilityRequest, - QuestionnaireAnswers, - MedicationAdministration, - Encounter, - PaymentReconciliation, - List, - DeviceUseStatement, - OperationDefinition, - Goal, - ImagingObjectSelection, - SearchParameter, - NutritionOrder, - ClaimResponse, - ReferralRequest, - ClinicalImpression, - BodySite, - Flag, - CommunicationRequest, - Claim, - RiskAssessment, - EnrollmentRequest, - Location, - ExplanationOfBenefit, - AllergyIntolerance, - Observation, - Contract, - RelatedPerson, - Basic, - ProcessResponse, - Specimen, - AuditEvent, - EnrollmentResponse, - SupplyRequest, - Patient, - EligibilityResponse, - Person, - DiagnosticOrder, - Parameters; - - - public String getPath() {; - switch (this) { - case Condition: - return "condition"; - case Supply: - return "supply"; - case ProcedureRequest: - return "procedurerequest"; - case DeviceComponent: - return "devicecomponent"; - case DeviceMetric: - return "devicemetric"; - case Communication: - return "communication"; - case Organization: - return "organization"; - case ProcessRequest: - return "processrequest"; - case Group: - return "group"; - case ValueSet: - return "valueset"; - case Coverage: - return "coverage"; - case ImmunizationRecommendation: - return "immunizationrecommendation"; - case Appointment: - return "appointment"; - case MedicationDispense: - return "medicationdispense"; - case MedicationPrescription: - return "medicationprescription"; - case Slot: - return "slot"; - case PaymentNotice: - return "paymentnotice"; - case Contraindication: - return "contraindication"; - case AppointmentResponse: - return "appointmentresponse"; - case MedicationStatement: - return "medicationstatement"; - case EpisodeOfCare: - return "episodeofcare"; - case Questionnaire: - return "questionnaire"; - case Composition: - return "composition"; - case OperationOutcome: - return "operationoutcome"; - case Conformance: - return "conformance"; - case FamilyMemberHistory: - return "familymemberhistory"; - case NamingSystem: - return "namingsystem"; - case Media: - return "media"; - case Binary: - return "binary"; - case HealthcareService: - return "healthcareservice"; - case VisionPrescription: - return "visionprescription"; - case DocumentReference: - return "documentreference"; - case Immunization: - return "immunization"; - case Bundle: - return "bundle"; - case Subscription: - return "subscription"; - case OrderResponse: - return "orderresponse"; - case ConceptMap: - return "conceptmap"; - case ImagingStudy: - return "imagingstudy"; - case Practitioner: - return "practitioner"; - case CarePlan: - return "careplan"; - case Provenance: - return "provenance"; - case Device: - return "device"; - case StructureDefinition: - return "structuredefinition"; - case Order: - return "order"; - case Procedure: - return "procedure"; - case Substance: - return "substance"; - case DeviceUseRequest: - return "deviceuserequest"; - case DiagnosticReport: - return "diagnosticreport"; - case Medication: - return "medication"; - case MessageHeader: - return "messageheader"; - case SupplyDelivery: - return "supplydelivery"; - case Schedule: - return "schedule"; - case DocumentManifest: - return "documentmanifest"; - case DataElement: - return "dataelement"; - case EligibilityRequest: - return "eligibilityrequest"; - case QuestionnaireAnswers: - return "questionnaireanswers"; - case MedicationAdministration: - return "medicationadministration"; - case Encounter: - return "encounter"; - case PaymentReconciliation: - return "paymentreconciliation"; - case List: - return "list"; - case DeviceUseStatement: - return "deviceusestatement"; - case OperationDefinition: - return "operationdefinition"; - case Goal: - return "goal"; - case ImagingObjectSelection: - return "imagingobjectselection"; - case SearchParameter: - return "searchparameter"; - case NutritionOrder: - return "nutritionorder"; - case ClaimResponse: - return "claimresponse"; - case ReferralRequest: - return "referralrequest"; - case ClinicalImpression: - return "clinicalimpression"; - case BodySite: - return "bodysite"; - case Flag: - return "flag"; - case CommunicationRequest: - return "communicationrequest"; - case Claim: - return "claim"; - case RiskAssessment: - return "riskassessment"; - case EnrollmentRequest: - return "enrollmentrequest"; - case Location: - return "location"; - case ExplanationOfBenefit: - return "explanationofbenefit"; - case AllergyIntolerance: - return "allergyintolerance"; - case Observation: - return "observation"; - case Contract: - return "contract"; - case RelatedPerson: - return "relatedperson"; - case Basic: - return "basic"; - case ProcessResponse: - return "processresponse"; - case Specimen: - return "specimen"; - case AuditEvent: - return "auditevent"; - case EnrollmentResponse: - return "enrollmentresponse"; - case SupplyRequest: - return "supplyrequest"; - case Patient: - return "patient"; - case EligibilityResponse: - return "eligibilityresponse"; - case Person: - return "person"; - case DiagnosticOrder: - return "diagnosticorder"; - case Parameters: - return "parameters"; - } - return null; - } - -} +package org.hl7.fhir.instance.model; + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +public enum ResourceType { + Appointment, + ReferralRequest, + Provenance, + Questionnaire, + ExplanationOfBenefit, + DocumentManifest, + Specimen, + AllergyIntolerance, + CarePlan, + Goal, + StructureDefinition, + EnrollmentRequest, + EpisodeOfCare, + MedicationPrescription, + OperationOutcome, + Medication, + Procedure, + List, + ConceptMap, + Subscription, + ValueSet, + OperationDefinition, + DocumentReference, + Order, + Immunization, + Device, + VisionPrescription, + Media, + Conformance, + ProcedureRequest, + EligibilityResponse, + DeviceUseRequest, + DeviceMetric, + Flag, + RelatedPerson, + SupplyRequest, + Practitioner, + AppointmentResponse, + Observation, + MedicationAdministration, + Slot, + Contraindication, + EnrollmentResponse, + Binary, + MedicationStatement, + Contract, + Person, + CommunicationRequest, + RiskAssessment, + TestScript, + Basic, + Group, + PaymentNotice, + Organization, + ClaimResponse, + EligibilityRequest, + ProcessRequest, + MedicationDispense, + Supply, + DiagnosticReport, + ImagingStudy, + ImagingObjectSelection, + HealthcareService, + DataElement, + DeviceComponent, + FamilyMemberHistory, + QuestionnaireAnswers, + NutritionOrder, + Encounter, + Substance, + AuditEvent, + SearchParameter, + PaymentReconciliation, + Communication, + Condition, + Composition, + Bundle, + DiagnosticOrder, + Patient, + OrderResponse, + Coverage, + DeviceUseStatement, + ProcessResponse, + NamingSystem, + Schedule, + SupplyDelivery, + ClinicalImpression, + MessageHeader, + Claim, + ImmunizationRecommendation, + Location, + BodySite, + Parameters; + + + public String getPath() {; + switch (this) { + case Appointment: + return "appointment"; + case ReferralRequest: + return "referralrequest"; + case Provenance: + return "provenance"; + case Questionnaire: + return "questionnaire"; + case ExplanationOfBenefit: + return "explanationofbenefit"; + case DocumentManifest: + return "documentmanifest"; + case Specimen: + return "specimen"; + case AllergyIntolerance: + return "allergyintolerance"; + case CarePlan: + return "careplan"; + case Goal: + return "goal"; + case StructureDefinition: + return "structuredefinition"; + case EnrollmentRequest: + return "enrollmentrequest"; + case EpisodeOfCare: + return "episodeofcare"; + case MedicationPrescription: + return "medicationprescription"; + case OperationOutcome: + return "operationoutcome"; + case Medication: + return "medication"; + case Procedure: + return "procedure"; + case List: + return "list"; + case ConceptMap: + return "conceptmap"; + case Subscription: + return "subscription"; + case ValueSet: + return "valueset"; + case OperationDefinition: + return "operationdefinition"; + case DocumentReference: + return "documentreference"; + case Order: + return "order"; + case Immunization: + return "immunization"; + case Device: + return "device"; + case VisionPrescription: + return "visionprescription"; + case Media: + return "media"; + case Conformance: + return "conformance"; + case ProcedureRequest: + return "procedurerequest"; + case EligibilityResponse: + return "eligibilityresponse"; + case DeviceUseRequest: + return "deviceuserequest"; + case DeviceMetric: + return "devicemetric"; + case Flag: + return "flag"; + case RelatedPerson: + return "relatedperson"; + case SupplyRequest: + return "supplyrequest"; + case Practitioner: + return "practitioner"; + case AppointmentResponse: + return "appointmentresponse"; + case Observation: + return "observation"; + case MedicationAdministration: + return "medicationadministration"; + case Slot: + return "slot"; + case Contraindication: + return "contraindication"; + case EnrollmentResponse: + return "enrollmentresponse"; + case Binary: + return "binary"; + case MedicationStatement: + return "medicationstatement"; + case Contract: + return "contract"; + case Person: + return "person"; + case CommunicationRequest: + return "communicationrequest"; + case RiskAssessment: + return "riskassessment"; + case TestScript: + return "testscript"; + case Basic: + return "basic"; + case Group: + return "group"; + case PaymentNotice: + return "paymentnotice"; + case Organization: + return "organization"; + case ClaimResponse: + return "claimresponse"; + case EligibilityRequest: + return "eligibilityrequest"; + case ProcessRequest: + return "processrequest"; + case MedicationDispense: + return "medicationdispense"; + case Supply: + return "supply"; + case DiagnosticReport: + return "diagnosticreport"; + case ImagingStudy: + return "imagingstudy"; + case ImagingObjectSelection: + return "imagingobjectselection"; + case HealthcareService: + return "healthcareservice"; + case DataElement: + return "dataelement"; + case DeviceComponent: + return "devicecomponent"; + case FamilyMemberHistory: + return "familymemberhistory"; + case QuestionnaireAnswers: + return "questionnaireanswers"; + case NutritionOrder: + return "nutritionorder"; + case Encounter: + return "encounter"; + case Substance: + return "substance"; + case AuditEvent: + return "auditevent"; + case SearchParameter: + return "searchparameter"; + case PaymentReconciliation: + return "paymentreconciliation"; + case Communication: + return "communication"; + case Condition: + return "condition"; + case Composition: + return "composition"; + case Bundle: + return "bundle"; + case DiagnosticOrder: + return "diagnosticorder"; + case Patient: + return "patient"; + case OrderResponse: + return "orderresponse"; + case Coverage: + return "coverage"; + case DeviceUseStatement: + return "deviceusestatement"; + case ProcessResponse: + return "processresponse"; + case NamingSystem: + return "namingsystem"; + case Schedule: + return "schedule"; + case SupplyDelivery: + return "supplydelivery"; + case ClinicalImpression: + return "clinicalimpression"; + case MessageHeader: + return "messageheader"; + case Claim: + return "claim"; + case ImmunizationRecommendation: + return "immunizationrecommendation"; + case Location: + return "location"; + case BodySite: + return "bodysite"; + case Parameters: + return "parameters"; + } + return null; + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/RiskAssessment.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/RiskAssessment.java index d32c725d529..ffb933961f1 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/RiskAssessment.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/RiskAssessment.java @@ -1,921 +1,900 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import java.util.*; - -import java.math.*; -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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. - */ -@ResourceDef(name="RiskAssessment", profile="http://hl7.org/fhir/Profile/RiskAssessment") -public class RiskAssessment extends DomainResource { - - @Block() - public static class RiskAssessmentPredictionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * One of the potential outcomes for the patient (e.g. remission, death, a particular condition). - */ - @Child(name = "outcome", type = {CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Possible outcome for the subject", formalDefinition="One of the potential outcomes for the patient (e.g. remission, death, a particular condition)." ) - protected CodeableConcept outcome; - - /** - * How likely is the outcome (in the specified timeframe). - */ - @Child(name = "probability", type = {DecimalType.class, Range.class, CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Likelihood of specified outcome", formalDefinition="How likely is the outcome (in the specified timeframe)." ) - protected Type probability; - - /** - * Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). - */ - @Child(name = "relativeRisk", type = {DecimalType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Relative likelihood", formalDefinition="Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.)." ) - protected DecimalType relativeRisk; - - /** - * Indicates the period of time or age range of the subject to which the specified probability applies. - */ - @Child(name = "when", type = {Period.class, Range.class}, order=4, min=0, max=1) - @Description(shortDefinition="Timeframe or age range", formalDefinition="Indicates the period of time or age range of the subject to which the specified probability applies." ) - protected Type when; - - /** - * Additional information explaining the basis for the prediction. - */ - @Child(name = "rationale", type = {StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Explanation of prediction", formalDefinition="Additional information explaining the basis for the prediction." ) - protected StringType rationale; - - private static final long serialVersionUID = 647967428L; - - /* - * Constructor - */ - public RiskAssessmentPredictionComponent() { - super(); - } - - /* - * Constructor - */ - public RiskAssessmentPredictionComponent(CodeableConcept outcome) { - super(); - this.outcome = outcome; - } - - /** - * @return {@link #outcome} (One of the potential outcomes for the patient (e.g. remission, death, a particular condition).) - */ - public CodeableConcept getOutcome() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new CodeableConcept(); // cc - return this.outcome; - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (One of the potential outcomes for the patient (e.g. remission, death, a particular condition).) - */ - public RiskAssessmentPredictionComponent setOutcome(CodeableConcept value) { - this.outcome = value; - return this; - } - - /** - * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) - */ - public Type getProbability() { - return this.probability; - } - - /** - * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) - */ - public DecimalType getProbabilityDecimalType() throws Exception { - if (!(this.probability instanceof DecimalType)) - throw new Exception("Type mismatch: the type DecimalType was expected, but "+this.probability.getClass().getName()+" was encountered"); - return (DecimalType) this.probability; - } - - /** - * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) - */ - public Range getProbabilityRange() throws Exception { - if (!(this.probability instanceof Range)) - throw new Exception("Type mismatch: the type Range was expected, but "+this.probability.getClass().getName()+" was encountered"); - return (Range) this.probability; - } - - /** - * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) - */ - public CodeableConcept getProbabilityCodeableConcept() throws Exception { - if (!(this.probability instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.probability.getClass().getName()+" was encountered"); - return (CodeableConcept) this.probability; - } - - public boolean hasProbability() { - return this.probability != null && !this.probability.isEmpty(); - } - - /** - * @param value {@link #probability} (How likely is the outcome (in the specified timeframe).) - */ - public RiskAssessmentPredictionComponent setProbability(Type value) { - this.probability = value; - return this; - } - - /** - * @return {@link #relativeRisk} (Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).). This is the underlying object with id, value and extensions. The accessor "getRelativeRisk" gives direct access to the value - */ - public DecimalType getRelativeRiskElement() { - if (this.relativeRisk == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.relativeRisk"); - else if (Configuration.doAutoCreate()) - this.relativeRisk = new DecimalType(); // bb - return this.relativeRisk; - } - - public boolean hasRelativeRiskElement() { - return this.relativeRisk != null && !this.relativeRisk.isEmpty(); - } - - public boolean hasRelativeRisk() { - return this.relativeRisk != null && !this.relativeRisk.isEmpty(); - } - - /** - * @param value {@link #relativeRisk} (Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).). This is the underlying object with id, value and extensions. The accessor "getRelativeRisk" gives direct access to the value - */ - public RiskAssessmentPredictionComponent setRelativeRiskElement(DecimalType value) { - this.relativeRisk = value; - return this; - } - - /** - * @return Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). - */ - public BigDecimal getRelativeRisk() { - return this.relativeRisk == null ? null : this.relativeRisk.getValue(); - } - - /** - * @param value Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). - */ - public RiskAssessmentPredictionComponent setRelativeRisk(BigDecimal value) { - if (value == null) - this.relativeRisk = null; - else { - if (this.relativeRisk == null) - this.relativeRisk = new DecimalType(); - this.relativeRisk.setValue(value); - } - return this; - } - - /** - * @return {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) - */ - public Type getWhen() { - return this.when; - } - - /** - * @return {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) - */ - public Period getWhenPeriod() throws Exception { - if (!(this.when instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.when.getClass().getName()+" was encountered"); - return (Period) this.when; - } - - /** - * @return {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) - */ - public Range getWhenRange() throws Exception { - if (!(this.when instanceof Range)) - throw new Exception("Type mismatch: the type Range was expected, but "+this.when.getClass().getName()+" was encountered"); - return (Range) this.when; - } - - public boolean hasWhen() { - return this.when != null && !this.when.isEmpty(); - } - - /** - * @param value {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) - */ - public RiskAssessmentPredictionComponent setWhen(Type value) { - this.when = value; - return this; - } - - /** - * @return {@link #rationale} (Additional information explaining the basis for the prediction.). This is the underlying object with id, value and extensions. The accessor "getRationale" gives direct access to the value - */ - public StringType getRationaleElement() { - if (this.rationale == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.rationale"); - else if (Configuration.doAutoCreate()) - this.rationale = new StringType(); // bb - return this.rationale; - } - - public boolean hasRationaleElement() { - return this.rationale != null && !this.rationale.isEmpty(); - } - - public boolean hasRationale() { - return this.rationale != null && !this.rationale.isEmpty(); - } - - /** - * @param value {@link #rationale} (Additional information explaining the basis for the prediction.). This is the underlying object with id, value and extensions. The accessor "getRationale" gives direct access to the value - */ - public RiskAssessmentPredictionComponent setRationaleElement(StringType value) { - this.rationale = value; - return this; - } - - /** - * @return Additional information explaining the basis for the prediction. - */ - public String getRationale() { - return this.rationale == null ? null : this.rationale.getValue(); - } - - /** - * @param value Additional information explaining the basis for the prediction. - */ - public RiskAssessmentPredictionComponent setRationale(String value) { - if (Utilities.noString(value)) - this.rationale = null; - else { - if (this.rationale == null) - this.rationale = new StringType(); - this.rationale.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("outcome", "CodeableConcept", "One of the potential outcomes for the patient (e.g. remission, death, a particular condition).", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("probability[x]", "decimal|Range|CodeableConcept", "How likely is the outcome (in the specified timeframe).", 0, java.lang.Integer.MAX_VALUE, probability)); - childrenList.add(new Property("relativeRisk", "decimal", "Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).", 0, java.lang.Integer.MAX_VALUE, relativeRisk)); - childrenList.add(new Property("when[x]", "Period|Range", "Indicates the period of time or age range of the subject to which the specified probability applies.", 0, java.lang.Integer.MAX_VALUE, when)); - childrenList.add(new Property("rationale", "string", "Additional information explaining the basis for the prediction.", 0, java.lang.Integer.MAX_VALUE, rationale)); - } - - public RiskAssessmentPredictionComponent copy() { - RiskAssessmentPredictionComponent dst = new RiskAssessmentPredictionComponent(); - copyValues(dst); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.probability = probability == null ? null : probability.copy(); - dst.relativeRisk = relativeRisk == null ? null : relativeRisk.copy(); - dst.when = when == null ? null : when.copy(); - dst.rationale = rationale == null ? null : rationale.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof RiskAssessmentPredictionComponent)) - return false; - RiskAssessmentPredictionComponent o = (RiskAssessmentPredictionComponent) other; - return compareDeep(outcome, o.outcome, true) && compareDeep(probability, o.probability, true) && compareDeep(relativeRisk, o.relativeRisk, true) - && compareDeep(when, o.when, true) && compareDeep(rationale, o.rationale, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof RiskAssessmentPredictionComponent)) - return false; - RiskAssessmentPredictionComponent o = (RiskAssessmentPredictionComponent) other; - return compareValues(relativeRisk, o.relativeRisk, true) && compareValues(rationale, o.rationale, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (outcome == null || outcome.isEmpty()) && (probability == null || probability.isEmpty()) - && (relativeRisk == null || relativeRisk.isEmpty()) && (when == null || when.isEmpty()) && (rationale == null || rationale.isEmpty()) - ; - } - - } - - /** - * The patient or group the risk assessment applies to. - */ - @Child(name = "subject", type = {Patient.class, Group.class}, order=0, min=0, max=1) - @Description(shortDefinition="Who/what does assessment apply to?", formalDefinition="The patient or group the risk assessment applies to." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient or group the risk assessment applies to.) - */ - protected Resource subjectTarget; - - /** - * The date (and possibly time) the risk assessment was performed. - */ - @Child(name = "date", type = {DateTimeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="When was assessment made?", formalDefinition="The date (and possibly time) the risk assessment was performed." ) - protected DateTimeType date; - - /** - * For assessments or prognosis specific to a particular condition, indicates the condition being assessed. - */ - @Child(name = "condition", type = {Condition.class}, order=2, min=0, max=1) - @Description(shortDefinition="Condition assessed", formalDefinition="For assessments or prognosis specific to a particular condition, indicates the condition being assessed." ) - protected Reference condition; - - /** - * The actual object that is the target of the reference (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) - */ - protected Condition conditionTarget; - - /** - * The provider or software application that performed the assessment. - */ - @Child(name = "performer", type = {Practitioner.class, Device.class}, order=3, min=0, max=1) - @Description(shortDefinition="Who did assessment?", formalDefinition="The provider or software application that performed the assessment." ) - protected Reference performer; - - /** - * The actual object that is the target of the reference (The provider or software application that performed the assessment.) - */ - protected Resource performerTarget; - - /** - * Business identifier assigned to the risk assessment. - */ - @Child(name = "identifier", type = {Identifier.class}, order=4, min=0, max=1) - @Description(shortDefinition="Unique identifier for the assessment", formalDefinition="Business identifier assigned to the risk assessment." ) - protected Identifier identifier; - - /** - * The algorithm, processs or mechanism used to evaluate the risk. - */ - @Child(name = "method", type = {CodeableConcept.class}, order=5, min=0, max=1) - @Description(shortDefinition="Evaluation mechanism", formalDefinition="The algorithm, processs or mechanism used to evaluate the risk." ) - protected CodeableConcept method; - - /** - * Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.). - */ - @Child(name = "basis", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Information used in assessment", formalDefinition="Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.)." ) - protected List basis; - /** - * The actual objects that are the target of the reference (Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) - */ - protected List basisTarget; - - - /** - * Describes the expected outcome for the subject. - */ - @Child(name = "prediction", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Outcome predicted", formalDefinition="Describes the expected outcome for the subject." ) - protected List prediction; - - /** - * A description of the steps that might be taken to reduce the identified risk(s). - */ - @Child(name = "mitigation", type = {StringType.class}, order=8, min=0, max=1) - @Description(shortDefinition="How to reduce risk", formalDefinition="A description of the steps that might be taken to reduce the identified risk(s)." ) - protected StringType mitigation; - - private static final long serialVersionUID = -1516167658L; - - /* - * Constructor - */ - public RiskAssessment() { - super(); - } - - /** - * @return {@link #subject} (The patient or group the risk assessment applies to.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (The patient or group the risk assessment applies to.) - */ - public RiskAssessment setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient or group the risk assessment applies to.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient or group the risk assessment applies to.) - */ - public RiskAssessment setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #date} (The date (and possibly time) the risk assessment was performed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date (and possibly time) the risk assessment was performed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public RiskAssessment setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date (and possibly time) the risk assessment was performed. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date (and possibly time) the risk assessment was performed. - */ - public RiskAssessment setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #condition} (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) - */ - public Reference getCondition() { - if (this.condition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.condition"); - else if (Configuration.doAutoCreate()) - this.condition = new Reference(); // cc - return this.condition; - } - - public boolean hasCondition() { - return this.condition != null && !this.condition.isEmpty(); - } - - /** - * @param value {@link #condition} (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) - */ - public RiskAssessment setCondition(Reference value) { - this.condition = value; - return this; - } - - /** - * @return {@link #condition} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) - */ - public Condition getConditionTarget() { - if (this.conditionTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.condition"); - else if (Configuration.doAutoCreate()) - this.conditionTarget = new Condition(); // aa - return this.conditionTarget; - } - - /** - * @param value {@link #condition} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) - */ - public RiskAssessment setConditionTarget(Condition value) { - this.conditionTarget = value; - return this; - } - - /** - * @return {@link #performer} (The provider or software application that performed the assessment.) - */ - public Reference getPerformer() { - if (this.performer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.performer"); - else if (Configuration.doAutoCreate()) - this.performer = new Reference(); // cc - return this.performer; - } - - public boolean hasPerformer() { - return this.performer != null && !this.performer.isEmpty(); - } - - /** - * @param value {@link #performer} (The provider or software application that performed the assessment.) - */ - public RiskAssessment setPerformer(Reference value) { - this.performer = value; - return this; - } - - /** - * @return {@link #performer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The provider or software application that performed the assessment.) - */ - public Resource getPerformerTarget() { - return this.performerTarget; - } - - /** - * @param value {@link #performer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The provider or software application that performed the assessment.) - */ - public RiskAssessment setPerformerTarget(Resource value) { - this.performerTarget = value; - return this; - } - - /** - * @return {@link #identifier} (Business identifier assigned to the risk assessment.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Business identifier assigned to the risk assessment.) - */ - public RiskAssessment setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #method} (The algorithm, processs or mechanism used to evaluate the risk.) - */ - public CodeableConcept getMethod() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.method"); - else if (Configuration.doAutoCreate()) - this.method = new CodeableConcept(); // cc - return this.method; - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** - * @param value {@link #method} (The algorithm, processs or mechanism used to evaluate the risk.) - */ - public RiskAssessment setMethod(CodeableConcept value) { - this.method = value; - return this; - } - - /** - * @return {@link #basis} (Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) - */ - public List getBasis() { - if (this.basis == null) - this.basis = new ArrayList(); - return this.basis; - } - - public boolean hasBasis() { - if (this.basis == null) - return false; - for (Reference item : this.basis) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #basis} (Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) - */ - // syntactic sugar - public Reference addBasis() { //3 - Reference t = new Reference(); - if (this.basis == null) - this.basis = new ArrayList(); - this.basis.add(t); - return t; - } - - // syntactic sugar - public RiskAssessment addBasis(Reference t) { //3 - if (t == null) - return this; - if (this.basis == null) - this.basis = new ArrayList(); - this.basis.add(t); - return this; - } - - /** - * @return {@link #basis} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) - */ - public List getBasisTarget() { - if (this.basisTarget == null) - this.basisTarget = new ArrayList(); - return this.basisTarget; - } - - /** - * @return {@link #prediction} (Describes the expected outcome for the subject.) - */ - public List getPrediction() { - if (this.prediction == null) - this.prediction = new ArrayList(); - return this.prediction; - } - - public boolean hasPrediction() { - if (this.prediction == null) - return false; - for (RiskAssessmentPredictionComponent item : this.prediction) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #prediction} (Describes the expected outcome for the subject.) - */ - // syntactic sugar - public RiskAssessmentPredictionComponent addPrediction() { //3 - RiskAssessmentPredictionComponent t = new RiskAssessmentPredictionComponent(); - if (this.prediction == null) - this.prediction = new ArrayList(); - this.prediction.add(t); - return t; - } - - // syntactic sugar - public RiskAssessment addPrediction(RiskAssessmentPredictionComponent t) { //3 - if (t == null) - return this; - if (this.prediction == null) - this.prediction = new ArrayList(); - this.prediction.add(t); - return this; - } - - /** - * @return {@link #mitigation} (A description of the steps that might be taken to reduce the identified risk(s).). This is the underlying object with id, value and extensions. The accessor "getMitigation" gives direct access to the value - */ - public StringType getMitigationElement() { - if (this.mitigation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.mitigation"); - else if (Configuration.doAutoCreate()) - this.mitigation = new StringType(); // bb - return this.mitigation; - } - - public boolean hasMitigationElement() { - return this.mitigation != null && !this.mitigation.isEmpty(); - } - - public boolean hasMitigation() { - return this.mitigation != null && !this.mitigation.isEmpty(); - } - - /** - * @param value {@link #mitigation} (A description of the steps that might be taken to reduce the identified risk(s).). This is the underlying object with id, value and extensions. The accessor "getMitigation" gives direct access to the value - */ - public RiskAssessment setMitigationElement(StringType value) { - this.mitigation = value; - return this; - } - - /** - * @return A description of the steps that might be taken to reduce the identified risk(s). - */ - public String getMitigation() { - return this.mitigation == null ? null : this.mitigation.getValue(); - } - - /** - * @param value A description of the steps that might be taken to reduce the identified risk(s). - */ - public RiskAssessment setMitigation(String value) { - if (Utilities.noString(value)) - this.mitigation = null; - else { - if (this.mitigation == null) - this.mitigation = new StringType(); - this.mitigation.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("subject", "Reference(Patient|Group)", "The patient or group the risk assessment applies to.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("date", "dateTime", "The date (and possibly time) the risk assessment was performed.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("condition", "Reference(Condition)", "For assessments or prognosis specific to a particular condition, indicates the condition being assessed.", 0, java.lang.Integer.MAX_VALUE, condition)); - childrenList.add(new Property("performer", "Reference(Practitioner|Device)", "The provider or software application that performed the assessment.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("identifier", "Identifier", "Business identifier assigned to the risk assessment.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("method", "CodeableConcept", "The algorithm, processs or mechanism used to evaluate the risk.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("basis", "Reference(Any)", "Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).", 0, java.lang.Integer.MAX_VALUE, basis)); - childrenList.add(new Property("prediction", "", "Describes the expected outcome for the subject.", 0, java.lang.Integer.MAX_VALUE, prediction)); - childrenList.add(new Property("mitigation", "string", "A description of the steps that might be taken to reduce the identified risk(s).", 0, java.lang.Integer.MAX_VALUE, mitigation)); - } - - public RiskAssessment copy() { - RiskAssessment dst = new RiskAssessment(); - copyValues(dst); - dst.subject = subject == null ? null : subject.copy(); - dst.date = date == null ? null : date.copy(); - dst.condition = condition == null ? null : condition.copy(); - dst.performer = performer == null ? null : performer.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.method = method == null ? null : method.copy(); - if (basis != null) { - dst.basis = new ArrayList(); - for (Reference i : basis) - dst.basis.add(i.copy()); - }; - if (prediction != null) { - dst.prediction = new ArrayList(); - for (RiskAssessmentPredictionComponent i : prediction) - dst.prediction.add(i.copy()); - }; - dst.mitigation = mitigation == null ? null : mitigation.copy(); - return dst; - } - - protected RiskAssessment typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof RiskAssessment)) - return false; - RiskAssessment o = (RiskAssessment) other; - return compareDeep(subject, o.subject, true) && compareDeep(date, o.date, true) && compareDeep(condition, o.condition, true) - && compareDeep(performer, o.performer, true) && compareDeep(identifier, o.identifier, true) && compareDeep(method, o.method, true) - && compareDeep(basis, o.basis, true) && compareDeep(prediction, o.prediction, true) && compareDeep(mitigation, o.mitigation, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof RiskAssessment)) - return false; - RiskAssessment o = (RiskAssessment) other; - return compareValues(date, o.date, true) && compareValues(mitigation, o.mitigation, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (subject == null || subject.isEmpty()) && (date == null || date.isEmpty()) - && (condition == null || condition.isEmpty()) && (performer == null || performer.isEmpty()) - && (identifier == null || identifier.isEmpty()) && (method == null || method.isEmpty()) && (basis == null || basis.isEmpty()) - && (prediction == null || prediction.isEmpty()) && (mitigation == null || mitigation.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.RiskAssessment; - } - - @SearchParamDefinition(name="patient", path="RiskAssessment.subject", description="Who/what does assessment apply to?", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="condition", path="RiskAssessment.condition", description="Condition assessed", type="reference" ) - public static final String SP_CONDITION = "condition"; - @SearchParamDefinition(name="subject", path="RiskAssessment.subject", description="Who/what does assessment apply to?", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="performer", path="RiskAssessment.performer", description="Who did assessment?", type="reference" ) - public static final String SP_PERFORMER = "performer"; - @SearchParamDefinition(name="method", path="RiskAssessment.method", description="Evaluation mechanism", type="token" ) - public static final String SP_METHOD = "method"; - @SearchParamDefinition(name="date", path="RiskAssessment.date", description="When was assessment made?", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="identifier", path="RiskAssessment.identifier", description="Unique identifier for the assessment", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import java.util.*; + +import java.math.*; +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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. + */ +@ResourceDef(name="RiskAssessment", profile="http://hl7.org/fhir/Profile/RiskAssessment") +public class RiskAssessment extends DomainResource { + + @Block() + public static class RiskAssessmentPredictionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * One of the potential outcomes for the patient (e.g. remission, death, a particular condition). + */ + @Child(name = "outcome", type = {CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Possible outcome for the subject", formalDefinition="One of the potential outcomes for the patient (e.g. remission, death, a particular condition)." ) + protected CodeableConcept outcome; + + /** + * How likely is the outcome (in the specified timeframe). + */ + @Child(name = "probability", type = {DecimalType.class, Range.class, CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Likelihood of specified outcome", formalDefinition="How likely is the outcome (in the specified timeframe)." ) + protected Type probability; + + /** + * Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). + */ + @Child(name = "relativeRisk", type = {DecimalType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Relative likelihood", formalDefinition="Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.)." ) + protected DecimalType relativeRisk; + + /** + * Indicates the period of time or age range of the subject to which the specified probability applies. + */ + @Child(name = "when", type = {Period.class, Range.class}, order=4, min=0, max=1) + @Description(shortDefinition="Timeframe or age range", formalDefinition="Indicates the period of time or age range of the subject to which the specified probability applies." ) + protected Type when; + + /** + * Additional information explaining the basis for the prediction. + */ + @Child(name = "rationale", type = {StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Explanation of prediction", formalDefinition="Additional information explaining the basis for the prediction." ) + protected StringType rationale; + + private static final long serialVersionUID = 647967428L; + + /* + * Constructor + */ + public RiskAssessmentPredictionComponent() { + super(); + } + + /* + * Constructor + */ + public RiskAssessmentPredictionComponent(CodeableConcept outcome) { + super(); + this.outcome = outcome; + } + + /** + * @return {@link #outcome} (One of the potential outcomes for the patient (e.g. remission, death, a particular condition).) + */ + public CodeableConcept getOutcome() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new CodeableConcept(); // cc + return this.outcome; + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (One of the potential outcomes for the patient (e.g. remission, death, a particular condition).) + */ + public RiskAssessmentPredictionComponent setOutcome(CodeableConcept value) { + this.outcome = value; + return this; + } + + /** + * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) + */ + public Type getProbability() { + return this.probability; + } + + /** + * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) + */ + public DecimalType getProbabilityDecimalType() throws Exception { + if (!(this.probability instanceof DecimalType)) + throw new Exception("Type mismatch: the type DecimalType was expected, but "+this.probability.getClass().getName()+" was encountered"); + return (DecimalType) this.probability; + } + + /** + * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) + */ + public Range getProbabilityRange() throws Exception { + if (!(this.probability instanceof Range)) + throw new Exception("Type mismatch: the type Range was expected, but "+this.probability.getClass().getName()+" was encountered"); + return (Range) this.probability; + } + + /** + * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) + */ + public CodeableConcept getProbabilityCodeableConcept() throws Exception { + if (!(this.probability instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.probability.getClass().getName()+" was encountered"); + return (CodeableConcept) this.probability; + } + + public boolean hasProbability() { + return this.probability != null && !this.probability.isEmpty(); + } + + /** + * @param value {@link #probability} (How likely is the outcome (in the specified timeframe).) + */ + public RiskAssessmentPredictionComponent setProbability(Type value) { + this.probability = value; + return this; + } + + /** + * @return {@link #relativeRisk} (Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).). This is the underlying object with id, value and extensions. The accessor "getRelativeRisk" gives direct access to the value + */ + public DecimalType getRelativeRiskElement() { + if (this.relativeRisk == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.relativeRisk"); + else if (Configuration.doAutoCreate()) + this.relativeRisk = new DecimalType(); // bb + return this.relativeRisk; + } + + public boolean hasRelativeRiskElement() { + return this.relativeRisk != null && !this.relativeRisk.isEmpty(); + } + + public boolean hasRelativeRisk() { + return this.relativeRisk != null && !this.relativeRisk.isEmpty(); + } + + /** + * @param value {@link #relativeRisk} (Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).). This is the underlying object with id, value and extensions. The accessor "getRelativeRisk" gives direct access to the value + */ + public RiskAssessmentPredictionComponent setRelativeRiskElement(DecimalType value) { + this.relativeRisk = value; + return this; + } + + /** + * @return Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). + */ + public BigDecimal getRelativeRisk() { + return this.relativeRisk == null ? null : this.relativeRisk.getValue(); + } + + /** + * @param value Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). + */ + public RiskAssessmentPredictionComponent setRelativeRisk(BigDecimal value) { + if (value == null) + this.relativeRisk = null; + else { + if (this.relativeRisk == null) + this.relativeRisk = new DecimalType(); + this.relativeRisk.setValue(value); + } + return this; + } + + /** + * @return {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) + */ + public Type getWhen() { + return this.when; + } + + /** + * @return {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) + */ + public Period getWhenPeriod() throws Exception { + if (!(this.when instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.when.getClass().getName()+" was encountered"); + return (Period) this.when; + } + + /** + * @return {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) + */ + public Range getWhenRange() throws Exception { + if (!(this.when instanceof Range)) + throw new Exception("Type mismatch: the type Range was expected, but "+this.when.getClass().getName()+" was encountered"); + return (Range) this.when; + } + + public boolean hasWhen() { + return this.when != null && !this.when.isEmpty(); + } + + /** + * @param value {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) + */ + public RiskAssessmentPredictionComponent setWhen(Type value) { + this.when = value; + return this; + } + + /** + * @return {@link #rationale} (Additional information explaining the basis for the prediction.). This is the underlying object with id, value and extensions. The accessor "getRationale" gives direct access to the value + */ + public StringType getRationaleElement() { + if (this.rationale == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.rationale"); + else if (Configuration.doAutoCreate()) + this.rationale = new StringType(); // bb + return this.rationale; + } + + public boolean hasRationaleElement() { + return this.rationale != null && !this.rationale.isEmpty(); + } + + public boolean hasRationale() { + return this.rationale != null && !this.rationale.isEmpty(); + } + + /** + * @param value {@link #rationale} (Additional information explaining the basis for the prediction.). This is the underlying object with id, value and extensions. The accessor "getRationale" gives direct access to the value + */ + public RiskAssessmentPredictionComponent setRationaleElement(StringType value) { + this.rationale = value; + return this; + } + + /** + * @return Additional information explaining the basis for the prediction. + */ + public String getRationale() { + return this.rationale == null ? null : this.rationale.getValue(); + } + + /** + * @param value Additional information explaining the basis for the prediction. + */ + public RiskAssessmentPredictionComponent setRationale(String value) { + if (Utilities.noString(value)) + this.rationale = null; + else { + if (this.rationale == null) + this.rationale = new StringType(); + this.rationale.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("outcome", "CodeableConcept", "One of the potential outcomes for the patient (e.g. remission, death, a particular condition).", 0, java.lang.Integer.MAX_VALUE, outcome)); + childrenList.add(new Property("probability[x]", "decimal|Range|CodeableConcept", "How likely is the outcome (in the specified timeframe).", 0, java.lang.Integer.MAX_VALUE, probability)); + childrenList.add(new Property("relativeRisk", "decimal", "Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).", 0, java.lang.Integer.MAX_VALUE, relativeRisk)); + childrenList.add(new Property("when[x]", "Period|Range", "Indicates the period of time or age range of the subject to which the specified probability applies.", 0, java.lang.Integer.MAX_VALUE, when)); + childrenList.add(new Property("rationale", "string", "Additional information explaining the basis for the prediction.", 0, java.lang.Integer.MAX_VALUE, rationale)); + } + + public RiskAssessmentPredictionComponent copy() { + RiskAssessmentPredictionComponent dst = new RiskAssessmentPredictionComponent(); + copyValues(dst); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.probability = probability == null ? null : probability.copy(); + dst.relativeRisk = relativeRisk == null ? null : relativeRisk.copy(); + dst.when = when == null ? null : when.copy(); + dst.rationale = rationale == null ? null : rationale.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof RiskAssessmentPredictionComponent)) + return false; + RiskAssessmentPredictionComponent o = (RiskAssessmentPredictionComponent) other; + return compareDeep(outcome, o.outcome, true) && compareDeep(probability, o.probability, true) && compareDeep(relativeRisk, o.relativeRisk, true) + && compareDeep(when, o.when, true) && compareDeep(rationale, o.rationale, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof RiskAssessmentPredictionComponent)) + return false; + RiskAssessmentPredictionComponent o = (RiskAssessmentPredictionComponent) other; + return compareValues(relativeRisk, o.relativeRisk, true) && compareValues(rationale, o.rationale, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (outcome == null || outcome.isEmpty()) && (probability == null || probability.isEmpty()) + && (relativeRisk == null || relativeRisk.isEmpty()) && (when == null || when.isEmpty()) && (rationale == null || rationale.isEmpty()) + ; + } + + } + + /** + * The patient or group the risk assessment applies to. + */ + @Child(name = "subject", type = {Patient.class, Group.class}, order=0, min=0, max=1) + @Description(shortDefinition="Who/what does assessment apply to?", formalDefinition="The patient or group the risk assessment applies to." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient or group the risk assessment applies to.) + */ + protected Resource subjectTarget; + + /** + * The date (and possibly time) the risk assessment was performed. + */ + @Child(name = "date", type = {DateTimeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="When was assessment made?", formalDefinition="The date (and possibly time) the risk assessment was performed." ) + protected DateTimeType date; + + /** + * For assessments or prognosis specific to a particular condition, indicates the condition being assessed. + */ + @Child(name = "condition", type = {Condition.class}, order=2, min=0, max=1) + @Description(shortDefinition="Condition assessed", formalDefinition="For assessments or prognosis specific to a particular condition, indicates the condition being assessed." ) + protected Reference condition; + + /** + * The actual object that is the target of the reference (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) + */ + protected Condition conditionTarget; + + /** + * The provider or software application that performed the assessment. + */ + @Child(name = "performer", type = {Practitioner.class, Device.class}, order=3, min=0, max=1) + @Description(shortDefinition="Who did assessment?", formalDefinition="The provider or software application that performed the assessment." ) + protected Reference performer; + + /** + * The actual object that is the target of the reference (The provider or software application that performed the assessment.) + */ + protected Resource performerTarget; + + /** + * Business identifier assigned to the risk assessment. + */ + @Child(name = "identifier", type = {Identifier.class}, order=4, min=0, max=1) + @Description(shortDefinition="Unique identifier for the assessment", formalDefinition="Business identifier assigned to the risk assessment." ) + protected Identifier identifier; + + /** + * The algorithm, processs or mechanism used to evaluate the risk. + */ + @Child(name = "method", type = {CodeableConcept.class}, order=5, min=0, max=1) + @Description(shortDefinition="Evaluation mechanism", formalDefinition="The algorithm, processs or mechanism used to evaluate the risk." ) + protected CodeableConcept method; + + /** + * Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.). + */ + @Child(name = "basis", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Information used in assessment", formalDefinition="Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.)." ) + protected List basis; + /** + * The actual objects that are the target of the reference (Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) + */ + protected List basisTarget; + + + /** + * Describes the expected outcome for the subject. + */ + @Child(name = "prediction", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Outcome predicted", formalDefinition="Describes the expected outcome for the subject." ) + protected List prediction; + + /** + * A description of the steps that might be taken to reduce the identified risk(s). + */ + @Child(name = "mitigation", type = {StringType.class}, order=8, min=0, max=1) + @Description(shortDefinition="How to reduce risk", formalDefinition="A description of the steps that might be taken to reduce the identified risk(s)." ) + protected StringType mitigation; + + private static final long serialVersionUID = -1516167658L; + + /* + * Constructor + */ + public RiskAssessment() { + super(); + } + + /** + * @return {@link #subject} (The patient or group the risk assessment applies to.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The patient or group the risk assessment applies to.) + */ + public RiskAssessment setSubject(Reference value) { + this.subject = value; + return this; + } + + /** + * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient or group the risk assessment applies to.) + */ + public Resource getSubjectTarget() { + return this.subjectTarget; + } + + /** + * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient or group the risk assessment applies to.) + */ + public RiskAssessment setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #date} (The date (and possibly time) the risk assessment was performed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date (and possibly time) the risk assessment was performed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public RiskAssessment setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date (and possibly time) the risk assessment was performed. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date (and possibly time) the risk assessment was performed. + */ + public RiskAssessment setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #condition} (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) + */ + public Reference getCondition() { + if (this.condition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.condition"); + else if (Configuration.doAutoCreate()) + this.condition = new Reference(); // cc + return this.condition; + } + + public boolean hasCondition() { + return this.condition != null && !this.condition.isEmpty(); + } + + /** + * @param value {@link #condition} (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) + */ + public RiskAssessment setCondition(Reference value) { + this.condition = value; + return this; + } + + /** + * @return {@link #condition} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) + */ + public Condition getConditionTarget() { + if (this.conditionTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.condition"); + else if (Configuration.doAutoCreate()) + this.conditionTarget = new Condition(); // aa + return this.conditionTarget; + } + + /** + * @param value {@link #condition} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) + */ + public RiskAssessment setConditionTarget(Condition value) { + this.conditionTarget = value; + return this; + } + + /** + * @return {@link #performer} (The provider or software application that performed the assessment.) + */ + public Reference getPerformer() { + if (this.performer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.performer"); + else if (Configuration.doAutoCreate()) + this.performer = new Reference(); // cc + return this.performer; + } + + public boolean hasPerformer() { + return this.performer != null && !this.performer.isEmpty(); + } + + /** + * @param value {@link #performer} (The provider or software application that performed the assessment.) + */ + public RiskAssessment setPerformer(Reference value) { + this.performer = value; + return this; + } + + /** + * @return {@link #performer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The provider or software application that performed the assessment.) + */ + public Resource getPerformerTarget() { + return this.performerTarget; + } + + /** + * @param value {@link #performer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The provider or software application that performed the assessment.) + */ + public RiskAssessment setPerformerTarget(Resource value) { + this.performerTarget = value; + return this; + } + + /** + * @return {@link #identifier} (Business identifier assigned to the risk assessment.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Business identifier assigned to the risk assessment.) + */ + public RiskAssessment setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #method} (The algorithm, processs or mechanism used to evaluate the risk.) + */ + public CodeableConcept getMethod() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.method"); + else if (Configuration.doAutoCreate()) + this.method = new CodeableConcept(); // cc + return this.method; + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** + * @param value {@link #method} (The algorithm, processs or mechanism used to evaluate the risk.) + */ + public RiskAssessment setMethod(CodeableConcept value) { + this.method = value; + return this; + } + + /** + * @return {@link #basis} (Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) + */ + public List getBasis() { + if (this.basis == null) + this.basis = new ArrayList(); + return this.basis; + } + + public boolean hasBasis() { + if (this.basis == null) + return false; + for (Reference item : this.basis) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #basis} (Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) + */ + // syntactic sugar + public Reference addBasis() { //3 + Reference t = new Reference(); + if (this.basis == null) + this.basis = new ArrayList(); + this.basis.add(t); + return t; + } + + // syntactic sugar + public RiskAssessment addBasis(Reference t) { //3 + if (t == null) + return this; + if (this.basis == null) + this.basis = new ArrayList(); + this.basis.add(t); + return this; + } + + /** + * @return {@link #basis} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) + */ + public List getBasisTarget() { + if (this.basisTarget == null) + this.basisTarget = new ArrayList(); + return this.basisTarget; + } + + /** + * @return {@link #prediction} (Describes the expected outcome for the subject.) + */ + public List getPrediction() { + if (this.prediction == null) + this.prediction = new ArrayList(); + return this.prediction; + } + + public boolean hasPrediction() { + if (this.prediction == null) + return false; + for (RiskAssessmentPredictionComponent item : this.prediction) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #prediction} (Describes the expected outcome for the subject.) + */ + // syntactic sugar + public RiskAssessmentPredictionComponent addPrediction() { //3 + RiskAssessmentPredictionComponent t = new RiskAssessmentPredictionComponent(); + if (this.prediction == null) + this.prediction = new ArrayList(); + this.prediction.add(t); + return t; + } + + // syntactic sugar + public RiskAssessment addPrediction(RiskAssessmentPredictionComponent t) { //3 + if (t == null) + return this; + if (this.prediction == null) + this.prediction = new ArrayList(); + this.prediction.add(t); + return this; + } + + /** + * @return {@link #mitigation} (A description of the steps that might be taken to reduce the identified risk(s).). This is the underlying object with id, value and extensions. The accessor "getMitigation" gives direct access to the value + */ + public StringType getMitigationElement() { + if (this.mitigation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.mitigation"); + else if (Configuration.doAutoCreate()) + this.mitigation = new StringType(); // bb + return this.mitigation; + } + + public boolean hasMitigationElement() { + return this.mitigation != null && !this.mitigation.isEmpty(); + } + + public boolean hasMitigation() { + return this.mitigation != null && !this.mitigation.isEmpty(); + } + + /** + * @param value {@link #mitigation} (A description of the steps that might be taken to reduce the identified risk(s).). This is the underlying object with id, value and extensions. The accessor "getMitigation" gives direct access to the value + */ + public RiskAssessment setMitigationElement(StringType value) { + this.mitigation = value; + return this; + } + + /** + * @return A description of the steps that might be taken to reduce the identified risk(s). + */ + public String getMitigation() { + return this.mitigation == null ? null : this.mitigation.getValue(); + } + + /** + * @param value A description of the steps that might be taken to reduce the identified risk(s). + */ + public RiskAssessment setMitigation(String value) { + if (Utilities.noString(value)) + this.mitigation = null; + else { + if (this.mitigation == null) + this.mitigation = new StringType(); + this.mitigation.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("subject", "Reference(Patient|Group)", "The patient or group the risk assessment applies to.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("date", "dateTime", "The date (and possibly time) the risk assessment was performed.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("condition", "Reference(Condition)", "For assessments or prognosis specific to a particular condition, indicates the condition being assessed.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("performer", "Reference(Practitioner|Device)", "The provider or software application that performed the assessment.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("identifier", "Identifier", "Business identifier assigned to the risk assessment.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("method", "CodeableConcept", "The algorithm, processs or mechanism used to evaluate the risk.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("basis", "Reference(Any)", "Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).", 0, java.lang.Integer.MAX_VALUE, basis)); + childrenList.add(new Property("prediction", "", "Describes the expected outcome for the subject.", 0, java.lang.Integer.MAX_VALUE, prediction)); + childrenList.add(new Property("mitigation", "string", "A description of the steps that might be taken to reduce the identified risk(s).", 0, java.lang.Integer.MAX_VALUE, mitigation)); + } + + public RiskAssessment copy() { + RiskAssessment dst = new RiskAssessment(); + copyValues(dst); + dst.subject = subject == null ? null : subject.copy(); + dst.date = date == null ? null : date.copy(); + dst.condition = condition == null ? null : condition.copy(); + dst.performer = performer == null ? null : performer.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.method = method == null ? null : method.copy(); + if (basis != null) { + dst.basis = new ArrayList(); + for (Reference i : basis) + dst.basis.add(i.copy()); + }; + if (prediction != null) { + dst.prediction = new ArrayList(); + for (RiskAssessmentPredictionComponent i : prediction) + dst.prediction.add(i.copy()); + }; + dst.mitigation = mitigation == null ? null : mitigation.copy(); + return dst; + } + + protected RiskAssessment typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof RiskAssessment)) + return false; + RiskAssessment o = (RiskAssessment) other; + return compareDeep(subject, o.subject, true) && compareDeep(date, o.date, true) && compareDeep(condition, o.condition, true) + && compareDeep(performer, o.performer, true) && compareDeep(identifier, o.identifier, true) && compareDeep(method, o.method, true) + && compareDeep(basis, o.basis, true) && compareDeep(prediction, o.prediction, true) && compareDeep(mitigation, o.mitigation, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof RiskAssessment)) + return false; + RiskAssessment o = (RiskAssessment) other; + return compareValues(date, o.date, true) && compareValues(mitigation, o.mitigation, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (subject == null || subject.isEmpty()) && (date == null || date.isEmpty()) + && (condition == null || condition.isEmpty()) && (performer == null || performer.isEmpty()) + && (identifier == null || identifier.isEmpty()) && (method == null || method.isEmpty()) && (basis == null || basis.isEmpty()) + && (prediction == null || prediction.isEmpty()) && (mitigation == null || mitigation.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.RiskAssessment; + } + + @SearchParamDefinition(name="date", path="RiskAssessment.date", description="When was assessment made?", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="RiskAssessment.identifier", description="Unique identifier for the assessment", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="condition", path="RiskAssessment.condition", description="Condition assessed", type="reference" ) + public static final String SP_CONDITION = "condition"; + @SearchParamDefinition(name="performer", path="RiskAssessment.performer", description="Who did assessment?", type="reference" ) + public static final String SP_PERFORMER = "performer"; + @SearchParamDefinition(name="method", path="RiskAssessment.method", description="Evaluation mechanism", type="token" ) + public static final String SP_METHOD = "method"; + @SearchParamDefinition(name="subject", path="RiskAssessment.subject", description="Who/what does assessment apply to?", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="patient", path="RiskAssessment.subject", description="Who/what does assessment apply to?", type="reference" ) + public static final String SP_PATIENT = "patient"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/SampledData.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/SampledData.java index 4e106bbef6f..85f7caadc3a 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/SampledData.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/SampledData.java @@ -1,505 +1,484 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import java.util.*; - -import java.math.*; -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; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. - */ -@DatatypeDef(name="SampledData") -public class SampledData extends Type implements ICompositeType { - - /** - * The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series. - */ - @Child(name = "origin", type = {Quantity.class}, order=0, min=1, max=1) - @Description(shortDefinition="Zero value and units", formalDefinition="The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series." ) - protected Quantity origin; - - /** - * The length of time between sampling times, measured in milliseconds. - */ - @Child(name = "period", type = {DecimalType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Number of milliseconds between samples", formalDefinition="The length of time between sampling times, measured in milliseconds." ) - protected DecimalType period; - - /** - * A correction factor that is applied to the sampled data points before they are added to the origin. - */ - @Child(name = "factor", type = {DecimalType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Multiply data by this before adding to origin", formalDefinition="A correction factor that is applied to the sampled data points before they are added to the origin." ) - protected DecimalType factor; - - /** - * The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). - */ - @Child(name = "lowerLimit", type = {DecimalType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Lower limit of detection", formalDefinition="The lower limit of detection of the measured points. This is needed if any of the data points have the value 'L' (lower than detection limit)." ) - protected DecimalType lowerLimit; - - /** - * The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). - */ - @Child(name = "upperLimit", type = {DecimalType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Upper limit of detection", formalDefinition="The upper limit of detection of the measured points. This is needed if any of the data points have the value 'U' (higher than detection limit)." ) - protected DecimalType upperLimit; - - /** - * The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once. - */ - @Child(name = "dimensions", type = {PositiveIntType.class}, order=5, min=1, max=1) - @Description(shortDefinition="Number of sample points at each time point", formalDefinition="The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once." ) - protected PositiveIntType dimensions; - - /** - * A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value. - */ - @Child(name = "data", type = {StringType.class}, order=6, min=1, max=1) - @Description(shortDefinition="Decimal values with spaces, or 'E' | 'U' | 'L'", formalDefinition="A series of data points which are decimal values separated by a single space (character u20). The special values 'E' (error), 'L' (below detection limit) and 'U' (above detection limit) can also be used in place of a decimal value." ) - protected StringType data; - - private static final long serialVersionUID = -1984181262L; - - /* - * Constructor - */ - public SampledData() { - super(); - } - - /* - * Constructor - */ - public SampledData(Quantity origin, DecimalType period, PositiveIntType dimensions, StringType data) { - super(); - this.origin = origin; - this.period = period; - this.dimensions = dimensions; - this.data = data; - } - - /** - * @return {@link #origin} (The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.) - */ - public Quantity getOrigin() { - if (this.origin == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SampledData.origin"); - else if (Configuration.doAutoCreate()) - this.origin = new Quantity(); // cc - return this.origin; - } - - public boolean hasOrigin() { - return this.origin != null && !this.origin.isEmpty(); - } - - /** - * @param value {@link #origin} (The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.) - */ - public SampledData setOrigin(Quantity value) { - this.origin = value; - return this; - } - - /** - * @return {@link #period} (The length of time between sampling times, measured in milliseconds.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value - */ - public DecimalType getPeriodElement() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SampledData.period"); - else if (Configuration.doAutoCreate()) - this.period = new DecimalType(); // bb - return this.period; - } - - public boolean hasPeriodElement() { - return this.period != null && !this.period.isEmpty(); - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The length of time between sampling times, measured in milliseconds.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value - */ - public SampledData setPeriodElement(DecimalType value) { - this.period = value; - return this; - } - - /** - * @return The length of time between sampling times, measured in milliseconds. - */ - public BigDecimal getPeriod() { - return this.period == null ? null : this.period.getValue(); - } - - /** - * @param value The length of time between sampling times, measured in milliseconds. - */ - public SampledData setPeriod(BigDecimal value) { - if (this.period == null) - this.period = new DecimalType(); - this.period.setValue(value); - return this; - } - - /** - * @return {@link #factor} (A correction factor that is applied to the sampled data points before they are added to the origin.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SampledData.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); // bb - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (A correction factor that is applied to the sampled data points before they are added to the origin.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public SampledData setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return A correction factor that is applied to the sampled data points before they are added to the origin. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value A correction factor that is applied to the sampled data points before they are added to the origin. - */ - public SampledData setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #lowerLimit} (The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).). This is the underlying object with id, value and extensions. The accessor "getLowerLimit" gives direct access to the value - */ - public DecimalType getLowerLimitElement() { - if (this.lowerLimit == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SampledData.lowerLimit"); - else if (Configuration.doAutoCreate()) - this.lowerLimit = new DecimalType(); // bb - return this.lowerLimit; - } - - public boolean hasLowerLimitElement() { - return this.lowerLimit != null && !this.lowerLimit.isEmpty(); - } - - public boolean hasLowerLimit() { - return this.lowerLimit != null && !this.lowerLimit.isEmpty(); - } - - /** - * @param value {@link #lowerLimit} (The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).). This is the underlying object with id, value and extensions. The accessor "getLowerLimit" gives direct access to the value - */ - public SampledData setLowerLimitElement(DecimalType value) { - this.lowerLimit = value; - return this; - } - - /** - * @return The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). - */ - public BigDecimal getLowerLimit() { - return this.lowerLimit == null ? null : this.lowerLimit.getValue(); - } - - /** - * @param value The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). - */ - public SampledData setLowerLimit(BigDecimal value) { - if (value == null) - this.lowerLimit = null; - else { - if (this.lowerLimit == null) - this.lowerLimit = new DecimalType(); - this.lowerLimit.setValue(value); - } - return this; - } - - /** - * @return {@link #upperLimit} (The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).). This is the underlying object with id, value and extensions. The accessor "getUpperLimit" gives direct access to the value - */ - public DecimalType getUpperLimitElement() { - if (this.upperLimit == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SampledData.upperLimit"); - else if (Configuration.doAutoCreate()) - this.upperLimit = new DecimalType(); // bb - return this.upperLimit; - } - - public boolean hasUpperLimitElement() { - return this.upperLimit != null && !this.upperLimit.isEmpty(); - } - - public boolean hasUpperLimit() { - return this.upperLimit != null && !this.upperLimit.isEmpty(); - } - - /** - * @param value {@link #upperLimit} (The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).). This is the underlying object with id, value and extensions. The accessor "getUpperLimit" gives direct access to the value - */ - public SampledData setUpperLimitElement(DecimalType value) { - this.upperLimit = value; - return this; - } - - /** - * @return The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). - */ - public BigDecimal getUpperLimit() { - return this.upperLimit == null ? null : this.upperLimit.getValue(); - } - - /** - * @param value The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). - */ - public SampledData setUpperLimit(BigDecimal value) { - if (value == null) - this.upperLimit = null; - else { - if (this.upperLimit == null) - this.upperLimit = new DecimalType(); - this.upperLimit.setValue(value); - } - return this; - } - - /** - * @return {@link #dimensions} (The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.). This is the underlying object with id, value and extensions. The accessor "getDimensions" gives direct access to the value - */ - public PositiveIntType getDimensionsElement() { - if (this.dimensions == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SampledData.dimensions"); - else if (Configuration.doAutoCreate()) - this.dimensions = new PositiveIntType(); // bb - return this.dimensions; - } - - public boolean hasDimensionsElement() { - return this.dimensions != null && !this.dimensions.isEmpty(); - } - - public boolean hasDimensions() { - return this.dimensions != null && !this.dimensions.isEmpty(); - } - - /** - * @param value {@link #dimensions} (The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.). This is the underlying object with id, value and extensions. The accessor "getDimensions" gives direct access to the value - */ - public SampledData setDimensionsElement(PositiveIntType value) { - this.dimensions = value; - return this; - } - - /** - * @return The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once. - */ - public int getDimensions() { - return this.dimensions == null || this.dimensions.isEmpty() ? 0 : this.dimensions.getValue(); - } - - /** - * @param value The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once. - */ - public SampledData setDimensions(int value) { - if (this.dimensions == null) - this.dimensions = new PositiveIntType(); - this.dimensions.setValue(value); - return this; - } - - /** - * @return {@link #data} (A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value - */ - public StringType getDataElement() { - if (this.data == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SampledData.data"); - else if (Configuration.doAutoCreate()) - this.data = new StringType(); // bb - return this.data; - } - - public boolean hasDataElement() { - return this.data != null && !this.data.isEmpty(); - } - - public boolean hasData() { - return this.data != null && !this.data.isEmpty(); - } - - /** - * @param value {@link #data} (A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value - */ - public SampledData setDataElement(StringType value) { - this.data = value; - return this; - } - - /** - * @return A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value. - */ - public String getData() { - return this.data == null ? null : this.data.getValue(); - } - - /** - * @param value A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value. - */ - public SampledData setData(String value) { - if (this.data == null) - this.data = new StringType(); - this.data.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("origin", "Quantity", "The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.", 0, java.lang.Integer.MAX_VALUE, origin)); - childrenList.add(new Property("period", "decimal", "The length of time between sampling times, measured in milliseconds.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("factor", "decimal", "A correction factor that is applied to the sampled data points before they are added to the origin.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("lowerLimit", "decimal", "The lower limit of detection of the measured points. This is needed if any of the data points have the value 'L' (lower than detection limit).", 0, java.lang.Integer.MAX_VALUE, lowerLimit)); - childrenList.add(new Property("upperLimit", "decimal", "The upper limit of detection of the measured points. This is needed if any of the data points have the value 'U' (higher than detection limit).", 0, java.lang.Integer.MAX_VALUE, upperLimit)); - childrenList.add(new Property("dimensions", "positiveInt", "The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.", 0, java.lang.Integer.MAX_VALUE, dimensions)); - childrenList.add(new Property("data", "string", "A series of data points which are decimal values separated by a single space (character u20). The special values 'E' (error), 'L' (below detection limit) and 'U' (above detection limit) can also be used in place of a decimal value.", 0, java.lang.Integer.MAX_VALUE, data)); - } - - public SampledData copy() { - SampledData dst = new SampledData(); - copyValues(dst); - dst.origin = origin == null ? null : origin.copy(); - dst.period = period == null ? null : period.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.lowerLimit = lowerLimit == null ? null : lowerLimit.copy(); - dst.upperLimit = upperLimit == null ? null : upperLimit.copy(); - dst.dimensions = dimensions == null ? null : dimensions.copy(); - dst.data = data == null ? null : data.copy(); - return dst; - } - - protected SampledData typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SampledData)) - return false; - SampledData o = (SampledData) other; - return compareDeep(origin, o.origin, true) && compareDeep(period, o.period, true) && compareDeep(factor, o.factor, true) - && compareDeep(lowerLimit, o.lowerLimit, true) && compareDeep(upperLimit, o.upperLimit, true) && compareDeep(dimensions, o.dimensions, true) - && compareDeep(data, o.data, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SampledData)) - return false; - SampledData o = (SampledData) other; - return compareValues(period, o.period, true) && compareValues(factor, o.factor, true) && compareValues(lowerLimit, o.lowerLimit, true) - && compareValues(upperLimit, o.upperLimit, true) && compareValues(dimensions, o.dimensions, true) && compareValues(data, o.data, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (origin == null || origin.isEmpty()) && (period == null || period.isEmpty()) - && (factor == null || factor.isEmpty()) && (lowerLimit == null || lowerLimit.isEmpty()) && (upperLimit == null || upperLimit.isEmpty()) - && (dimensions == null || dimensions.isEmpty()) && (data == null || data.isEmpty()); - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import java.util.*; + +import java.math.*; +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; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. + */ +@DatatypeDef(name="SampledData") +public class SampledData extends Type implements ICompositeType { + + /** + * The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series. + */ + @Child(name = "origin", type = {Quantity.class}, order=0, min=1, max=1) + @Description(shortDefinition="Zero value and units", formalDefinition="The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series." ) + protected Quantity origin; + + /** + * The length of time between sampling times, measured in milliseconds. + */ + @Child(name = "period", type = {DecimalType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Number of milliseconds between samples", formalDefinition="The length of time between sampling times, measured in milliseconds." ) + protected DecimalType period; + + /** + * A correction factor that is applied to the sampled data points before they are added to the origin. + */ + @Child(name = "factor", type = {DecimalType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Multiply data by this before adding to origin", formalDefinition="A correction factor that is applied to the sampled data points before they are added to the origin." ) + protected DecimalType factor; + + /** + * The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). + */ + @Child(name = "lowerLimit", type = {DecimalType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Lower limit of detection", formalDefinition="The lower limit of detection of the measured points. This is needed if any of the data points have the value 'L' (lower than detection limit)." ) + protected DecimalType lowerLimit; + + /** + * The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). + */ + @Child(name = "upperLimit", type = {DecimalType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Upper limit of detection", formalDefinition="The upper limit of detection of the measured points. This is needed if any of the data points have the value 'U' (higher than detection limit)." ) + protected DecimalType upperLimit; + + /** + * The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once. + */ + @Child(name = "dimensions", type = {PositiveIntType.class}, order=5, min=1, max=1) + @Description(shortDefinition="Number of sample points at each time point", formalDefinition="The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once." ) + protected PositiveIntType dimensions; + + /** + * A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value. + */ + @Child(name = "data", type = {StringType.class}, order=6, min=1, max=1) + @Description(shortDefinition="Decimal values with spaces, or 'E' | 'U' | 'L'", formalDefinition="A series of data points which are decimal values separated by a single space (character u20). The special values 'E' (error), 'L' (below detection limit) and 'U' (above detection limit) can also be used in place of a decimal value." ) + protected StringType data; + + private static final long serialVersionUID = -1984181262L; + + /* + * Constructor + */ + public SampledData() { + super(); + } + + /* + * Constructor + */ + public SampledData(Quantity origin, DecimalType period, PositiveIntType dimensions, StringType data) { + super(); + this.origin = origin; + this.period = period; + this.dimensions = dimensions; + this.data = data; + } + + /** + * @return {@link #origin} (The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.) + */ + public Quantity getOrigin() { + if (this.origin == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SampledData.origin"); + else if (Configuration.doAutoCreate()) + this.origin = new Quantity(); // cc + return this.origin; + } + + public boolean hasOrigin() { + return this.origin != null && !this.origin.isEmpty(); + } + + /** + * @param value {@link #origin} (The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.) + */ + public SampledData setOrigin(Quantity value) { + this.origin = value; + return this; + } + + /** + * @return {@link #period} (The length of time between sampling times, measured in milliseconds.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value + */ + public DecimalType getPeriodElement() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SampledData.period"); + else if (Configuration.doAutoCreate()) + this.period = new DecimalType(); // bb + return this.period; + } + + public boolean hasPeriodElement() { + return this.period != null && !this.period.isEmpty(); + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The length of time between sampling times, measured in milliseconds.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value + */ + public SampledData setPeriodElement(DecimalType value) { + this.period = value; + return this; + } + + /** + * @return The length of time between sampling times, measured in milliseconds. + */ + public BigDecimal getPeriod() { + return this.period == null ? null : this.period.getValue(); + } + + /** + * @param value The length of time between sampling times, measured in milliseconds. + */ + public SampledData setPeriod(BigDecimal value) { + if (this.period == null) + this.period = new DecimalType(); + this.period.setValue(value); + return this; + } + + /** + * @return {@link #factor} (A correction factor that is applied to the sampled data points before they are added to the origin.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SampledData.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); // bb + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (A correction factor that is applied to the sampled data points before they are added to the origin.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public SampledData setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A correction factor that is applied to the sampled data points before they are added to the origin. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value A correction factor that is applied to the sampled data points before they are added to the origin. + */ + public SampledData setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #lowerLimit} (The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).). This is the underlying object with id, value and extensions. The accessor "getLowerLimit" gives direct access to the value + */ + public DecimalType getLowerLimitElement() { + if (this.lowerLimit == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SampledData.lowerLimit"); + else if (Configuration.doAutoCreate()) + this.lowerLimit = new DecimalType(); // bb + return this.lowerLimit; + } + + public boolean hasLowerLimitElement() { + return this.lowerLimit != null && !this.lowerLimit.isEmpty(); + } + + public boolean hasLowerLimit() { + return this.lowerLimit != null && !this.lowerLimit.isEmpty(); + } + + /** + * @param value {@link #lowerLimit} (The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).). This is the underlying object with id, value and extensions. The accessor "getLowerLimit" gives direct access to the value + */ + public SampledData setLowerLimitElement(DecimalType value) { + this.lowerLimit = value; + return this; + } + + /** + * @return The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). + */ + public BigDecimal getLowerLimit() { + return this.lowerLimit == null ? null : this.lowerLimit.getValue(); + } + + /** + * @param value The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). + */ + public SampledData setLowerLimit(BigDecimal value) { + if (value == null) + this.lowerLimit = null; + else { + if (this.lowerLimit == null) + this.lowerLimit = new DecimalType(); + this.lowerLimit.setValue(value); + } + return this; + } + + /** + * @return {@link #upperLimit} (The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).). This is the underlying object with id, value and extensions. The accessor "getUpperLimit" gives direct access to the value + */ + public DecimalType getUpperLimitElement() { + if (this.upperLimit == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SampledData.upperLimit"); + else if (Configuration.doAutoCreate()) + this.upperLimit = new DecimalType(); // bb + return this.upperLimit; + } + + public boolean hasUpperLimitElement() { + return this.upperLimit != null && !this.upperLimit.isEmpty(); + } + + public boolean hasUpperLimit() { + return this.upperLimit != null && !this.upperLimit.isEmpty(); + } + + /** + * @param value {@link #upperLimit} (The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).). This is the underlying object with id, value and extensions. The accessor "getUpperLimit" gives direct access to the value + */ + public SampledData setUpperLimitElement(DecimalType value) { + this.upperLimit = value; + return this; + } + + /** + * @return The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). + */ + public BigDecimal getUpperLimit() { + return this.upperLimit == null ? null : this.upperLimit.getValue(); + } + + /** + * @param value The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). + */ + public SampledData setUpperLimit(BigDecimal value) { + if (value == null) + this.upperLimit = null; + else { + if (this.upperLimit == null) + this.upperLimit = new DecimalType(); + this.upperLimit.setValue(value); + } + return this; + } + + /** + * @return {@link #dimensions} (The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.). This is the underlying object with id, value and extensions. The accessor "getDimensions" gives direct access to the value + */ + public PositiveIntType getDimensionsElement() { + if (this.dimensions == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SampledData.dimensions"); + else if (Configuration.doAutoCreate()) + this.dimensions = new PositiveIntType(); // bb + return this.dimensions; + } + + public boolean hasDimensionsElement() { + return this.dimensions != null && !this.dimensions.isEmpty(); + } + + public boolean hasDimensions() { + return this.dimensions != null && !this.dimensions.isEmpty(); + } + + /** + * @param value {@link #dimensions} (The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.). This is the underlying object with id, value and extensions. The accessor "getDimensions" gives direct access to the value + */ + public SampledData setDimensionsElement(PositiveIntType value) { + this.dimensions = value; + return this; + } + + /** + * @return The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once. + */ + public int getDimensions() { + return this.dimensions == null || this.dimensions.isEmpty() ? 0 : this.dimensions.getValue(); + } + + /** + * @param value The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once. + */ + public SampledData setDimensions(int value) { + if (this.dimensions == null) + this.dimensions = new PositiveIntType(); + this.dimensions.setValue(value); + return this; + } + + /** + * @return {@link #data} (A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value + */ + public StringType getDataElement() { + if (this.data == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SampledData.data"); + else if (Configuration.doAutoCreate()) + this.data = new StringType(); // bb + return this.data; + } + + public boolean hasDataElement() { + return this.data != null && !this.data.isEmpty(); + } + + public boolean hasData() { + return this.data != null && !this.data.isEmpty(); + } + + /** + * @param value {@link #data} (A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value + */ + public SampledData setDataElement(StringType value) { + this.data = value; + return this; + } + + /** + * @return A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value. + */ + public String getData() { + return this.data == null ? null : this.data.getValue(); + } + + /** + * @param value A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value. + */ + public SampledData setData(String value) { + if (this.data == null) + this.data = new StringType(); + this.data.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("origin", "Quantity", "The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.", 0, java.lang.Integer.MAX_VALUE, origin)); + childrenList.add(new Property("period", "decimal", "The length of time between sampling times, measured in milliseconds.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("factor", "decimal", "A correction factor that is applied to the sampled data points before they are added to the origin.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("lowerLimit", "decimal", "The lower limit of detection of the measured points. This is needed if any of the data points have the value 'L' (lower than detection limit).", 0, java.lang.Integer.MAX_VALUE, lowerLimit)); + childrenList.add(new Property("upperLimit", "decimal", "The upper limit of detection of the measured points. This is needed if any of the data points have the value 'U' (higher than detection limit).", 0, java.lang.Integer.MAX_VALUE, upperLimit)); + childrenList.add(new Property("dimensions", "positiveInt", "The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.", 0, java.lang.Integer.MAX_VALUE, dimensions)); + childrenList.add(new Property("data", "string", "A series of data points which are decimal values separated by a single space (character u20). The special values 'E' (error), 'L' (below detection limit) and 'U' (above detection limit) can also be used in place of a decimal value.", 0, java.lang.Integer.MAX_VALUE, data)); + } + + public SampledData copy() { + SampledData dst = new SampledData(); + copyValues(dst); + dst.origin = origin == null ? null : origin.copy(); + dst.period = period == null ? null : period.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.lowerLimit = lowerLimit == null ? null : lowerLimit.copy(); + dst.upperLimit = upperLimit == null ? null : upperLimit.copy(); + dst.dimensions = dimensions == null ? null : dimensions.copy(); + dst.data = data == null ? null : data.copy(); + return dst; + } + + protected SampledData typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SampledData)) + return false; + SampledData o = (SampledData) other; + return compareDeep(origin, o.origin, true) && compareDeep(period, o.period, true) && compareDeep(factor, o.factor, true) + && compareDeep(lowerLimit, o.lowerLimit, true) && compareDeep(upperLimit, o.upperLimit, true) && compareDeep(dimensions, o.dimensions, true) + && compareDeep(data, o.data, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SampledData)) + return false; + SampledData o = (SampledData) other; + return compareValues(period, o.period, true) && compareValues(factor, o.factor, true) && compareValues(lowerLimit, o.lowerLimit, true) + && compareValues(upperLimit, o.upperLimit, true) && compareValues(dimensions, o.dimensions, true) && compareValues(data, o.data, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (origin == null || origin.isEmpty()) && (period == null || period.isEmpty()) + && (factor == null || factor.isEmpty()) && (lowerLimit == null || lowerLimit.isEmpty()) && (upperLimit == null || upperLimit.isEmpty()) + && (dimensions == null || dimensions.isEmpty()) && (data == null || data.isEmpty()); + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Schedule.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Schedule.java index fbd03f00201..42cd5a63735 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Schedule.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Schedule.java @@ -1,392 +1,371 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A container for slot(s) of time that may be available for booking appointments. - */ -@ResourceDef(name="Schedule", profile="http://hl7.org/fhir/Profile/Schedule") -public class Schedule extends DomainResource { - - /** - * External Ids for this item. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External Ids for this item", formalDefinition="External Ids for this item." ) - protected List identifier; - - /** - * The schedule type can be used for the categorization of healthcare services or other appointment types. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, 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 type; - - /** - * The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson. - */ - @Child(name = "actor", type = {}, order=2, min=1, max=1) - @Description(shortDefinition="The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson", formalDefinition="The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson." ) - protected Reference actor; - - /** - * The actual object that is the target of the reference (The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) - */ - protected Resource actorTarget; - - /** - * The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates. - */ - @Child(name = "planningHorizon", type = {Period.class}, order=3, min=0, max=1) - @Description(shortDefinition="The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a 'template' for planning outside these dates", formalDefinition="The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a 'template' for planning outside these dates." ) - protected Period planningHorizon; - - /** - * Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated. - */ - @Child(name = "comment", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated", formalDefinition="Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated." ) - protected StringType comment; - - private static final long serialVersionUID = 158030926L; - - /* - * Constructor - */ - public Schedule() { - super(); - } - - /* - * Constructor - */ - public Schedule(Reference actor) { - super(); - this.actor = actor; - } - - /** - * @return {@link #identifier} (External Ids for this item.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (External Ids for this item.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Schedule addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #type} (The schedule type can be used for the categorization of healthcare services or other appointment types.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (CodeableConcept item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (The 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(); - this.type.add(t); - return t; - } - - // syntactic sugar - public Schedule addType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - /** - * @return {@link #actor} (The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) - */ - public Reference getActor() { - if (this.actor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Schedule.actor"); - else if (Configuration.doAutoCreate()) - this.actor = new Reference(); // cc - return this.actor; - } - - public boolean hasActor() { - return this.actor != null && !this.actor.isEmpty(); - } - - /** - * @param value {@link #actor} (The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) - */ - public Schedule setActor(Reference value) { - this.actor = value; - return this; - } - - /** - * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) - */ - public Resource getActorTarget() { - return this.actorTarget; - } - - /** - * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) - */ - public Schedule setActorTarget(Resource value) { - this.actorTarget = value; - return this; - } - - /** - * @return {@link #planningHorizon} (The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates.) - */ - public Period getPlanningHorizon() { - if (this.planningHorizon == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Schedule.planningHorizon"); - else if (Configuration.doAutoCreate()) - this.planningHorizon = new Period(); // cc - return this.planningHorizon; - } - - public boolean hasPlanningHorizon() { - return this.planningHorizon != null && !this.planningHorizon.isEmpty(); - } - - /** - * @param value {@link #planningHorizon} (The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates.) - */ - public Schedule setPlanningHorizon(Period value) { - this.planningHorizon = value; - return this; - } - - /** - * @return {@link #comment} (Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Schedule.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); // bb - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public Schedule setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated. - */ - public Schedule setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "External Ids for this item.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("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 Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.", 0, java.lang.Integer.MAX_VALUE, actor)); - childrenList.add(new Property("planningHorizon", "Period", "The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a 'template' for planning outside these dates.", 0, java.lang.Integer.MAX_VALUE, planningHorizon)); - childrenList.add(new Property("comment", "string", "Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated.", 0, java.lang.Integer.MAX_VALUE, comment)); - } - - public Schedule copy() { - Schedule dst = new Schedule(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - if (type != null) { - dst.type = new ArrayList(); - 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(); - return dst; - } - - protected Schedule typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Schedule)) - return false; - Schedule o = (Schedule) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(actor, o.actor, true) - && compareDeep(planningHorizon, o.planningHorizon, true) && compareDeep(comment, o.comment, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Schedule)) - return false; - Schedule o = (Schedule) other; - return compareValues(comment, o.comment, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) - && (actor == null || actor.isEmpty()) && (planningHorizon == null || planningHorizon.isEmpty()) - && (comment == null || comment.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Schedule; - } - - @SearchParamDefinition(name="actor", path="Schedule.actor", description="The individual(HealthcareService, Practitioner, Location, ...) to find a Schedule for", type="reference" ) - public static final String SP_ACTOR = "actor"; - @SearchParamDefinition(name="date", path="Schedule.planningHorizon", description="Search for Schedule resources that have a period that contains this date specified", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="type", path="Schedule.type", description="The type of appointments that can be booked into associated slot(s)", type="token" ) - public static final String SP_TYPE = "type"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A container for slot(s) of time that may be available for booking appointments. + */ +@ResourceDef(name="Schedule", profile="http://hl7.org/fhir/Profile/Schedule") +public class Schedule extends DomainResource { + + /** + * External Ids for this item. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Ids for this item", formalDefinition="External Ids for this item." ) + protected List identifier; + + /** + * The schedule type can be used for the categorization of healthcare services or other appointment types. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, 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 type; + + /** + * The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson. + */ + @Child(name = "actor", type = {}, order=2, min=1, max=1) + @Description(shortDefinition="The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson", formalDefinition="The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson." ) + protected Reference actor; + + /** + * The actual object that is the target of the reference (The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) + */ + protected Resource actorTarget; + + /** + * The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates. + */ + @Child(name = "planningHorizon", type = {Period.class}, order=3, min=0, max=1) + @Description(shortDefinition="The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a 'template' for planning outside these dates", formalDefinition="The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a 'template' for planning outside these dates." ) + protected Period planningHorizon; + + /** + * Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated. + */ + @Child(name = "comment", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated", formalDefinition="Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated." ) + protected StringType comment; + + private static final long serialVersionUID = 158030926L; + + /* + * Constructor + */ + public Schedule() { + super(); + } + + /* + * Constructor + */ + public Schedule(Reference actor) { + super(); + this.actor = actor; + } + + /** + * @return {@link #identifier} (External Ids for this item.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (External Ids for this item.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Schedule addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #type} (The schedule type can be used for the categorization of healthcare services or other appointment types.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (CodeableConcept item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (The 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(); + this.type.add(t); + return t; + } + + // syntactic sugar + public Schedule addType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + /** + * @return {@link #actor} (The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) + */ + public Reference getActor() { + if (this.actor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Schedule.actor"); + else if (Configuration.doAutoCreate()) + this.actor = new Reference(); // cc + return this.actor; + } + + public boolean hasActor() { + return this.actor != null && !this.actor.isEmpty(); + } + + /** + * @param value {@link #actor} (The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) + */ + public Schedule setActor(Reference value) { + this.actor = value; + return this; + } + + /** + * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) + */ + public Resource getActorTarget() { + return this.actorTarget; + } + + /** + * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) + */ + public Schedule setActorTarget(Resource value) { + this.actorTarget = value; + return this; + } + + /** + * @return {@link #planningHorizon} (The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates.) + */ + public Period getPlanningHorizon() { + if (this.planningHorizon == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Schedule.planningHorizon"); + else if (Configuration.doAutoCreate()) + this.planningHorizon = new Period(); // cc + return this.planningHorizon; + } + + public boolean hasPlanningHorizon() { + return this.planningHorizon != null && !this.planningHorizon.isEmpty(); + } + + /** + * @param value {@link #planningHorizon} (The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates.) + */ + public Schedule setPlanningHorizon(Period value) { + this.planningHorizon = value; + return this; + } + + /** + * @return {@link #comment} (Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Schedule.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); // bb + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public Schedule setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated. + */ + public Schedule setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "External Ids for this item.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("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 Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.", 0, java.lang.Integer.MAX_VALUE, actor)); + childrenList.add(new Property("planningHorizon", "Period", "The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a 'template' for planning outside these dates.", 0, java.lang.Integer.MAX_VALUE, planningHorizon)); + childrenList.add(new Property("comment", "string", "Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated.", 0, java.lang.Integer.MAX_VALUE, comment)); + } + + public Schedule copy() { + Schedule dst = new Schedule(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + if (type != null) { + dst.type = new ArrayList(); + 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(); + return dst; + } + + protected Schedule typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Schedule)) + return false; + Schedule o = (Schedule) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(actor, o.actor, true) + && compareDeep(planningHorizon, o.planningHorizon, true) && compareDeep(comment, o.comment, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Schedule)) + return false; + Schedule o = (Schedule) other; + return compareValues(comment, o.comment, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) + && (actor == null || actor.isEmpty()) && (planningHorizon == null || planningHorizon.isEmpty()) + && (comment == null || comment.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Schedule; + } + + @SearchParamDefinition(name="actor", path="Schedule.actor", description="The individual(HealthcareService, Practitioner, Location, ...) to find a Schedule for", type="reference" ) + public static final String SP_ACTOR = "actor"; + @SearchParamDefinition(name="date", path="Schedule.planningHorizon", description="Search for Schedule resources that have a period that contains this date specified", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="type", path="Schedule.type", description="The type of appointments that can be booked into associated slot(s)", type="token" ) + public static final String SP_TYPE = "type"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/SearchParameter.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/SearchParameter.java index ea86d16e687..461bb7707e1 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/SearchParameter.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/SearchParameter.java @@ -1,1211 +1,1190 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import java.util.*; - -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.instance.model.Enumerations.*; -import org.hl7.fhir.instance.model.annotations.ResourceDef; -import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; -import org.hl7.fhir.instance.model.annotations.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A Search Parameter that defines a named search item that can be used to search/filter on a resource. - */ -@ResourceDef(name="SearchParameter", profile="http://hl7.org/fhir/Profile/SearchParameter") -public class SearchParameter extends DomainResource { - - public enum SearchParamType { - /** - * Search parameter SHALL be a number (a whole number, or a decimal). - */ - NUMBER, - /** - * Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported. - */ - DATE, - /** - * Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces. - */ - STRING, - /** - * Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a "|", depending on the modifier used. - */ - TOKEN, - /** - * A reference to another resource. - */ - REFERENCE, - /** - * A composite search parameter that combines a search on two values together. - */ - COMPOSITE, - /** - * A search parameter that searches on a quantity. - */ - QUANTITY, - /** - * A search parameter that searches on a URI (RFC 3986). - */ - URI, - /** - * added to help the parsers - */ - NULL; - public static SearchParamType fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("number".equals(codeString)) - return NUMBER; - if ("date".equals(codeString)) - return DATE; - if ("string".equals(codeString)) - return STRING; - if ("token".equals(codeString)) - return TOKEN; - if ("reference".equals(codeString)) - return REFERENCE; - if ("composite".equals(codeString)) - return COMPOSITE; - if ("quantity".equals(codeString)) - return QUANTITY; - if ("uri".equals(codeString)) - return URI; - throw new Exception("Unknown SearchParamType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case NUMBER: return "number"; - case DATE: return "date"; - case STRING: return "string"; - case TOKEN: return "token"; - case REFERENCE: return "reference"; - case COMPOSITE: return "composite"; - case QUANTITY: return "quantity"; - case URI: return "uri"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case NUMBER: return ""; - case DATE: return ""; - case STRING: return ""; - case TOKEN: return ""; - case REFERENCE: return ""; - case COMPOSITE: return ""; - case QUANTITY: return ""; - case URI: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case NUMBER: return "Search parameter SHALL be a number (a whole number, or a decimal)."; - case DATE: return "Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported."; - case STRING: return "Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces."; - case TOKEN: return "Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a '|', depending on the modifier used."; - case REFERENCE: return "A reference to another resource."; - case COMPOSITE: return "A composite search parameter that combines a search on two values together."; - case QUANTITY: return "A search parameter that searches on a quantity."; - case URI: return "A search parameter that searches on a URI (RFC 3986)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case NUMBER: return "Number"; - case DATE: return "Date/DateTime"; - case STRING: return "String"; - case TOKEN: return "Token"; - case REFERENCE: return "Reference"; - case COMPOSITE: return "Composite"; - case QUANTITY: return "Quantity"; - case URI: return "URI"; - default: return "?"; - } - } - } - - public static class SearchParamTypeEnumFactory implements EnumFactory { - public SearchParamType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("number".equals(codeString)) - return SearchParamType.NUMBER; - if ("date".equals(codeString)) - return SearchParamType.DATE; - if ("string".equals(codeString)) - return SearchParamType.STRING; - if ("token".equals(codeString)) - return SearchParamType.TOKEN; - if ("reference".equals(codeString)) - return SearchParamType.REFERENCE; - if ("composite".equals(codeString)) - return SearchParamType.COMPOSITE; - if ("quantity".equals(codeString)) - return SearchParamType.QUANTITY; - if ("uri".equals(codeString)) - return SearchParamType.URI; - throw new IllegalArgumentException("Unknown SearchParamType code '"+codeString+"'"); - } - public String toCode(SearchParamType code) { - if (code == SearchParamType.NUMBER) - return "number"; - if (code == SearchParamType.DATE) - return "date"; - if (code == SearchParamType.STRING) - return "string"; - if (code == SearchParamType.TOKEN) - return "token"; - if (code == SearchParamType.REFERENCE) - return "reference"; - if (code == SearchParamType.COMPOSITE) - return "composite"; - if (code == SearchParamType.QUANTITY) - return "quantity"; - if (code == SearchParamType.URI) - return "uri"; - return "?"; - } - } - - @Block() - public static class SearchParameterContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the search parameter. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Name of a individual to contact", formalDefinition="The name of an individual to contact regarding the search parameter." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /* - * Constructor - */ - public SearchParameterContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameterContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public SearchParameterContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the search parameter. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the search parameter. - */ - public SearchParameterContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public SearchParameterContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the search parameter.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - public SearchParameterContactComponent copy() { - SearchParameterContactComponent dst = new SearchParameterContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SearchParameterContactComponent)) - return false; - SearchParameterContactComponent o = (SearchParameterContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SearchParameterContactComponent)) - return false; - SearchParameterContactComponent o = (SearchParameterContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - } - - /** - * An absolute URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements. - */ - @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1) - @Description(shortDefinition="Literal URL used to reference this search parameter", formalDefinition="An absolute URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements." ) - protected UriType url; - - /** - * The name of the standard or custom search parameter. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Name of search parameter", formalDefinition="The name of the standard or custom search parameter." ) - protected StringType name; - - /** - * The name of the individual or organization that published the search parameter. - */ - @Child(name = "publisher", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the search parameter." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * The Scope and Usage that this search parameter was created to meet. - */ - @Child(name = "requirements", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Why this search parameter is defined", formalDefinition="The Scope and Usage that this search parameter was created to meet." ) - protected StringType requirements; - - /** - * The status of this search parameter definition. - */ - @Child(name = "status", type = {CodeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of this search parameter definition." ) - protected Enumeration status; - - /** - * A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name = "experimental", type = {BooleanType.class}, order=6, min=0, max=1) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The date (and optionally time) when the search parameter definition was published. - */ - @Child(name = "date", type = {DateTimeType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Publication Date(/time)", formalDefinition="The date (and optionally time) when the search parameter definition was published." ) - protected DateTimeType date; - - /** - * The base resource type that this search parameter refers to. - */ - @Child(name = "base", type = {CodeType.class}, order=8, min=1, max=1) - @Description(shortDefinition="The resource type this search parameter applies to", formalDefinition="The base resource type that this search parameter refers to." ) - protected CodeType base; - - /** - * The type of value a search parameter refers to, and how the content is interpreted. - */ - @Child(name = "type", type = {CodeType.class}, order=9, min=1, max=1) - @Description(shortDefinition="number | date | string | token | reference | composite | quantity | uri", formalDefinition="The type of value a search parameter refers to, and how the content is interpreted." ) - protected Enumeration type; - - /** - * A description of the search parameters and how it used. - */ - @Child(name = "description", type = {StringType.class}, order=10, min=1, max=1) - @Description(shortDefinition="Documentation for search parameter", formalDefinition="A description of the search parameters and how it used." ) - protected StringType description; - - /** - * An XPath expression that returns a set of elements for the search parameter. - */ - @Child(name = "xpath", type = {StringType.class}, order=11, min=0, max=1) - @Description(shortDefinition="XPath that extracts the values", formalDefinition="An XPath expression that returns a set of elements for the search parameter." ) - protected StringType xpath; - - /** - * Types of resource (if a resource is referenced). - */ - @Child(name = "target", type = {CodeType.class}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Types of resource (if a resource reference)", formalDefinition="Types of resource (if a resource is referenced)." ) - protected List target; - - private static final long serialVersionUID = 1984222207L; - - /* - * Constructor - */ - public SearchParameter() { - super(); - } - - /* - * Constructor - */ - public SearchParameter(UriType url, StringType name, CodeType base, Enumeration type, StringType description) { - super(); - this.url = url; - this.name = name; - this.base = base; - this.type = type; - this.description = description; - } - - /** - * @return {@link #url} (An absolute URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public SearchParameter setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements. - */ - public SearchParameter setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - /** - * @return {@link #name} (The name of the standard or custom search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of the standard or custom search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public SearchParameter setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of the standard or custom search parameter. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of the standard or custom search parameter. - */ - public SearchParameter setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the search parameter.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the search parameter.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public SearchParameter setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the search parameter. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the search parameter. - */ - public SearchParameter setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (SearchParameterContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public SearchParameterContactComponent addContact() { //3 - SearchParameterContactComponent t = new SearchParameterContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public SearchParameter addContact(SearchParameterContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #requirements} (The Scope and Usage that this search parameter was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); // bb - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (The Scope and Usage that this search parameter was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public SearchParameter setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return The Scope and Usage that this search parameter was created to meet. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value The Scope and Usage that this search parameter was created to meet. - */ - public SearchParameter setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of this search parameter definition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of this search parameter definition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public SearchParameter setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of this search parameter definition. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of this search parameter definition. - */ - public SearchParameter setStatus(ConformanceResourceStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #experimental} (A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); // bb - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public SearchParameter setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); - } - - /** - * @param value A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public SearchParameter setExperimental(boolean value) { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - return this; - } - - /** - * @return {@link #date} (The date (and optionally time) when the search parameter definition was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date (and optionally time) when the search parameter definition was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public SearchParameter setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date (and optionally time) when the search parameter definition was published. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date (and optionally time) when the search parameter definition was published. - */ - public SearchParameter setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #base} (The base resource type that this search parameter refers to.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public CodeType getBaseElement() { - if (this.base == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.base"); - else if (Configuration.doAutoCreate()) - this.base = new CodeType(); // bb - return this.base; - } - - public boolean hasBaseElement() { - return this.base != null && !this.base.isEmpty(); - } - - public boolean hasBase() { - return this.base != null && !this.base.isEmpty(); - } - - /** - * @param value {@link #base} (The base resource type that this search parameter refers to.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public SearchParameter setBaseElement(CodeType value) { - this.base = value; - return this; - } - - /** - * @return The base resource type that this search parameter refers to. - */ - public String getBase() { - return this.base == null ? null : this.base.getValue(); - } - - /** - * @param value The base resource type that this search parameter refers to. - */ - public SearchParameter setBase(String value) { - if (this.base == null) - this.base = new CodeType(); - this.base.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new SearchParamTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public SearchParameter setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The type of value a search parameter refers to, and how the content is interpreted. - */ - public SearchParamType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of value a search parameter refers to, and how the content is interpreted. - */ - public SearchParameter setType(SearchParamType value) { - if (this.type == null) - this.type = new Enumeration(new SearchParamTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #description} (A description of the search parameters and how it used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A description of the search parameters and how it used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public SearchParameter setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A description of the search parameters and how it used. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A description of the search parameters and how it used. - */ - public SearchParameter setDescription(String value) { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - return this; - } - - /** - * @return {@link #xpath} (An XPath expression that returns a set of elements for the search parameter.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value - */ - public StringType getXpathElement() { - if (this.xpath == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.xpath"); - else if (Configuration.doAutoCreate()) - this.xpath = new StringType(); // bb - return this.xpath; - } - - public boolean hasXpathElement() { - return this.xpath != null && !this.xpath.isEmpty(); - } - - public boolean hasXpath() { - return this.xpath != null && !this.xpath.isEmpty(); - } - - /** - * @param value {@link #xpath} (An XPath expression that returns a set of elements for the search parameter.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value - */ - public SearchParameter setXpathElement(StringType value) { - this.xpath = value; - return this; - } - - /** - * @return An XPath expression that returns a set of elements for the search parameter. - */ - public String getXpath() { - return this.xpath == null ? null : this.xpath.getValue(); - } - - /** - * @param value An XPath expression that returns a set of elements for the search parameter. - */ - public SearchParameter setXpath(String value) { - if (Utilities.noString(value)) - this.xpath = null; - else { - if (this.xpath == null) - this.xpath = new StringType(); - this.xpath.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (Types of resource (if a resource is referenced).) - */ - public List getTarget() { - if (this.target == null) - this.target = new ArrayList(); - return this.target; - } - - public boolean hasTarget() { - if (this.target == null) - return false; - for (CodeType item : this.target) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #target} (Types of resource (if a resource is referenced).) - */ - // syntactic sugar - public CodeType addTargetElement() {//2 - CodeType t = new CodeType(); - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return t; - } - - /** - * @param value {@link #target} (Types of resource (if a resource is referenced).) - */ - public SearchParameter addTarget(String value) { //1 - CodeType t = new CodeType(); - t.setValue(value); - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return this; - } - - /** - * @param value {@link #target} (Types of resource (if a resource is referenced).) - */ - public boolean hasTarget(String value) { - if (this.target == null) - return false; - for (CodeType v : this.target) - if (v.equals(value)) // code - return true; - return false; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("name", "string", "The name of the standard or custom search parameter.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the search parameter.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("requirements", "string", "The Scope and Usage that this search parameter was created to meet.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("status", "code", "The status of this search parameter definition.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("date", "dateTime", "The date (and optionally time) when the search parameter definition was published.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("base", "code", "The base resource type that this search parameter refers to.", 0, java.lang.Integer.MAX_VALUE, base)); - childrenList.add(new Property("type", "code", "The type of value a search parameter refers to, and how the content is interpreted.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("description", "string", "A description of the search parameters and how it used.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("xpath", "string", "An XPath expression that returns a set of elements for the search parameter.", 0, java.lang.Integer.MAX_VALUE, xpath)); - childrenList.add(new Property("target", "code", "Types of resource (if a resource is referenced).", 0, java.lang.Integer.MAX_VALUE, target)); - } - - public SearchParameter copy() { - SearchParameter dst = new SearchParameter(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.name = name == null ? null : name.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (SearchParameterContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.requirements = requirements == null ? null : requirements.copy(); - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.date = date == null ? null : date.copy(); - dst.base = base == null ? null : base.copy(); - dst.type = type == null ? null : type.copy(); - dst.description = description == null ? null : description.copy(); - dst.xpath = xpath == null ? null : xpath.copy(); - if (target != null) { - dst.target = new ArrayList(); - for (CodeType i : target) - dst.target.add(i.copy()); - }; - return dst; - } - - protected SearchParameter typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SearchParameter)) - return false; - SearchParameter o = (SearchParameter) other; - return compareDeep(url, o.url, true) && compareDeep(name, o.name, true) && compareDeep(publisher, o.publisher, true) - && compareDeep(contact, o.contact, true) && compareDeep(requirements, o.requirements, true) && compareDeep(status, o.status, true) - && compareDeep(experimental, o.experimental, true) && compareDeep(date, o.date, true) && compareDeep(base, o.base, true) - && compareDeep(type, o.type, true) && compareDeep(description, o.description, true) && compareDeep(xpath, o.xpath, true) - && compareDeep(target, o.target, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SearchParameter)) - return false; - SearchParameter o = (SearchParameter) other; - return compareValues(url, o.url, true) && compareValues(name, o.name, true) && compareValues(publisher, o.publisher, true) - && compareValues(requirements, o.requirements, true) && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) - && compareValues(date, o.date, true) && compareValues(base, o.base, true) && compareValues(type, o.type, true) - && compareValues(description, o.description, true) && compareValues(xpath, o.xpath, true) && compareValues(target, o.target, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (name == null || name.isEmpty()) - && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) && (requirements == null || requirements.isEmpty()) - && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) - && (date == null || date.isEmpty()) && (base == null || base.isEmpty()) && (type == null || type.isEmpty()) - && (description == null || description.isEmpty()) && (xpath == null || xpath.isEmpty()) && (target == null || target.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.SearchParameter; - } - - @SearchParamDefinition(name="description", path="SearchParameter.description", description="Documentation for search parameter", type="string" ) - public static final String SP_DESCRIPTION = "description"; - @SearchParamDefinition(name="name", path="SearchParameter.name", description="Name of search parameter", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="target", path="SearchParameter.target", description="Types of resource (if a resource reference)", type="token" ) - public static final String SP_TARGET = "target"; - @SearchParamDefinition(name="base", path="SearchParameter.base", description="The resource type this search parameter applies to", type="token" ) - public static final String SP_BASE = "base"; - @SearchParamDefinition(name="type", path="SearchParameter.type", description="number | date | string | token | reference | composite | quantity | uri", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="url", path="SearchParameter.url", description="Literal URL used to reference this search parameter", type="uri" ) - public static final String SP_URL = "url"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import java.util.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.Enumerations.*; +import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A Search Parameter that defines a named search item that can be used to search/filter on a resource. + */ +@ResourceDef(name="SearchParameter", profile="http://hl7.org/fhir/Profile/SearchParameter") +public class SearchParameter extends DomainResource { + + public enum SearchParamType { + /** + * Search parameter SHALL be a number (a whole number, or a decimal). + */ + NUMBER, + /** + * Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported. + */ + DATE, + /** + * Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces. + */ + STRING, + /** + * Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a "|", depending on the modifier used. + */ + TOKEN, + /** + * A reference to another resource. + */ + REFERENCE, + /** + * A composite search parameter that combines a search on two values together. + */ + COMPOSITE, + /** + * A search parameter that searches on a quantity. + */ + QUANTITY, + /** + * A search parameter that searches on a URI (RFC 3986). + */ + URI, + /** + * added to help the parsers + */ + NULL; + public static SearchParamType fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("number".equals(codeString)) + return NUMBER; + if ("date".equals(codeString)) + return DATE; + if ("string".equals(codeString)) + return STRING; + if ("token".equals(codeString)) + return TOKEN; + if ("reference".equals(codeString)) + return REFERENCE; + if ("composite".equals(codeString)) + return COMPOSITE; + if ("quantity".equals(codeString)) + return QUANTITY; + if ("uri".equals(codeString)) + return URI; + throw new Exception("Unknown SearchParamType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case NUMBER: return "number"; + case DATE: return "date"; + case STRING: return "string"; + case TOKEN: return "token"; + case REFERENCE: return "reference"; + case COMPOSITE: return "composite"; + case QUANTITY: return "quantity"; + case URI: return "uri"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case NUMBER: return ""; + case DATE: return ""; + case STRING: return ""; + case TOKEN: return ""; + case REFERENCE: return ""; + case COMPOSITE: return ""; + case QUANTITY: return ""; + case URI: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case NUMBER: return "Search parameter SHALL be a number (a whole number, or a decimal)."; + case DATE: return "Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported."; + case STRING: return "Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces."; + case TOKEN: return "Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a '|', depending on the modifier used."; + case REFERENCE: return "A reference to another resource."; + case COMPOSITE: return "A composite search parameter that combines a search on two values together."; + case QUANTITY: return "A search parameter that searches on a quantity."; + case URI: return "A search parameter that searches on a URI (RFC 3986)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NUMBER: return "Number"; + case DATE: return "Date/DateTime"; + case STRING: return "String"; + case TOKEN: return "Token"; + case REFERENCE: return "Reference"; + case COMPOSITE: return "Composite"; + case QUANTITY: return "Quantity"; + case URI: return "URI"; + default: return "?"; + } + } + } + + public static class SearchParamTypeEnumFactory implements EnumFactory { + public SearchParamType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("number".equals(codeString)) + return SearchParamType.NUMBER; + if ("date".equals(codeString)) + return SearchParamType.DATE; + if ("string".equals(codeString)) + return SearchParamType.STRING; + if ("token".equals(codeString)) + return SearchParamType.TOKEN; + if ("reference".equals(codeString)) + return SearchParamType.REFERENCE; + if ("composite".equals(codeString)) + return SearchParamType.COMPOSITE; + if ("quantity".equals(codeString)) + return SearchParamType.QUANTITY; + if ("uri".equals(codeString)) + return SearchParamType.URI; + throw new IllegalArgumentException("Unknown SearchParamType code '"+codeString+"'"); + } + public String toCode(SearchParamType code) { + if (code == SearchParamType.NUMBER) + return "number"; + if (code == SearchParamType.DATE) + return "date"; + if (code == SearchParamType.STRING) + return "string"; + if (code == SearchParamType.TOKEN) + return "token"; + if (code == SearchParamType.REFERENCE) + return "reference"; + if (code == SearchParamType.COMPOSITE) + return "composite"; + if (code == SearchParamType.QUANTITY) + return "quantity"; + if (code == SearchParamType.URI) + return "uri"; + return "?"; + } + } + + @Block() + public static class SearchParameterContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the search parameter. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Name of a individual to contact", formalDefinition="The name of an individual to contact regarding the search parameter." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /* + * Constructor + */ + public SearchParameterContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameterContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The name of an individual to contact regarding the search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public SearchParameterContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the search parameter. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the search parameter. + */ + public SearchParameterContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public SearchParameterContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the search parameter.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + public SearchParameterContactComponent copy() { + SearchParameterContactComponent dst = new SearchParameterContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SearchParameterContactComponent)) + return false; + SearchParameterContactComponent o = (SearchParameterContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SearchParameterContactComponent)) + return false; + SearchParameterContactComponent o = (SearchParameterContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + } + + /** + * An absolute URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements. + */ + @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1) + @Description(shortDefinition="Literal URL used to reference this search parameter", formalDefinition="An absolute URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements." ) + protected UriType url; + + /** + * The name of the standard or custom search parameter. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Name of search parameter", formalDefinition="The name of the standard or custom search parameter." ) + protected StringType name; + + /** + * The name of the individual or organization that published the search parameter. + */ + @Child(name = "publisher", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the search parameter." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * The Scope and Usage that this search parameter was created to meet. + */ + @Child(name = "requirements", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Why this search parameter is defined", formalDefinition="The Scope and Usage that this search parameter was created to meet." ) + protected StringType requirements; + + /** + * The status of this search parameter definition. + */ + @Child(name = "status", type = {CodeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of this search parameter definition." ) + protected Enumeration status; + + /** + * A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name = "experimental", type = {BooleanType.class}, order=6, min=0, max=1) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The date (and optionally time) when the search parameter definition was published. + */ + @Child(name = "date", type = {DateTimeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Publication Date(/time)", formalDefinition="The date (and optionally time) when the search parameter definition was published." ) + protected DateTimeType date; + + /** + * The base resource type that this search parameter refers to. + */ + @Child(name = "base", type = {CodeType.class}, order=8, min=1, max=1) + @Description(shortDefinition="The resource type this search parameter applies to", formalDefinition="The base resource type that this search parameter refers to." ) + protected CodeType base; + + /** + * The type of value a search parameter refers to, and how the content is interpreted. + */ + @Child(name = "type", type = {CodeType.class}, order=9, min=1, max=1) + @Description(shortDefinition="number | date | string | token | reference | composite | quantity | uri", formalDefinition="The type of value a search parameter refers to, and how the content is interpreted." ) + protected Enumeration type; + + /** + * A description of the search parameters and how it used. + */ + @Child(name = "description", type = {StringType.class}, order=10, min=1, max=1) + @Description(shortDefinition="Documentation for search parameter", formalDefinition="A description of the search parameters and how it used." ) + protected StringType description; + + /** + * An XPath expression that returns a set of elements for the search parameter. + */ + @Child(name = "xpath", type = {StringType.class}, order=11, min=0, max=1) + @Description(shortDefinition="XPath that extracts the values", formalDefinition="An XPath expression that returns a set of elements for the search parameter." ) + protected StringType xpath; + + /** + * Types of resource (if a resource is referenced). + */ + @Child(name = "target", type = {CodeType.class}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Types of resource (if a resource reference)", formalDefinition="Types of resource (if a resource is referenced)." ) + protected List target; + + private static final long serialVersionUID = 1984222207L; + + /* + * Constructor + */ + public SearchParameter() { + super(); + } + + /* + * Constructor + */ + public SearchParameter(UriType url, StringType name, CodeType base, Enumeration type, StringType description) { + super(); + this.url = url; + this.name = name; + this.base = base; + this.type = type; + this.description = description; + } + + /** + * @return {@link #url} (An absolute URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public SearchParameter setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements. + */ + public SearchParameter setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + /** + * @return {@link #name} (The name of the standard or custom search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The name of the standard or custom search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public SearchParameter setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of the standard or custom search parameter. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of the standard or custom search parameter. + */ + public SearchParameter setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the search parameter.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the search parameter.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public SearchParameter setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the search parameter. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the search parameter. + */ + public SearchParameter setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (SearchParameterContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public SearchParameterContactComponent addContact() { //3 + SearchParameterContactComponent t = new SearchParameterContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public SearchParameter addContact(SearchParameterContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #requirements} (The Scope and Usage that this search parameter was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); // bb + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (The Scope and Usage that this search parameter was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public SearchParameter setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return The Scope and Usage that this search parameter was created to meet. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value The Scope and Usage that this search parameter was created to meet. + */ + public SearchParameter setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of this search parameter definition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status of this search parameter definition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public SearchParameter setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of this search parameter definition. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of this search parameter definition. + */ + public SearchParameter setStatus(ConformanceResourceStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #experimental} (A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public SearchParameter setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public SearchParameter setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #date} (The date (and optionally time) when the search parameter definition was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date (and optionally time) when the search parameter definition was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public SearchParameter setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date (and optionally time) when the search parameter definition was published. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date (and optionally time) when the search parameter definition was published. + */ + public SearchParameter setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #base} (The base resource type that this search parameter refers to.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public CodeType getBaseElement() { + if (this.base == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.base"); + else if (Configuration.doAutoCreate()) + this.base = new CodeType(); // bb + return this.base; + } + + public boolean hasBaseElement() { + return this.base != null && !this.base.isEmpty(); + } + + public boolean hasBase() { + return this.base != null && !this.base.isEmpty(); + } + + /** + * @param value {@link #base} (The base resource type that this search parameter refers to.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public SearchParameter setBaseElement(CodeType value) { + this.base = value; + return this; + } + + /** + * @return The base resource type that this search parameter refers to. + */ + public String getBase() { + return this.base == null ? null : this.base.getValue(); + } + + /** + * @param value The base resource type that this search parameter refers to. + */ + public SearchParameter setBase(String value) { + if (this.base == null) + this.base = new CodeType(); + this.base.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new SearchParamTypeEnumFactory()); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public SearchParameter setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The type of value a search parameter refers to, and how the content is interpreted. + */ + public SearchParamType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of value a search parameter refers to, and how the content is interpreted. + */ + public SearchParameter setType(SearchParamType value) { + if (this.type == null) + this.type = new Enumeration(new SearchParamTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #description} (A description of the search parameters and how it used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (A description of the search parameters and how it used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public SearchParameter setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A description of the search parameters and how it used. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A description of the search parameters and how it used. + */ + public SearchParameter setDescription(String value) { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + return this; + } + + /** + * @return {@link #xpath} (An XPath expression that returns a set of elements for the search parameter.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value + */ + public StringType getXpathElement() { + if (this.xpath == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.xpath"); + else if (Configuration.doAutoCreate()) + this.xpath = new StringType(); // bb + return this.xpath; + } + + public boolean hasXpathElement() { + return this.xpath != null && !this.xpath.isEmpty(); + } + + public boolean hasXpath() { + return this.xpath != null && !this.xpath.isEmpty(); + } + + /** + * @param value {@link #xpath} (An XPath expression that returns a set of elements for the search parameter.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value + */ + public SearchParameter setXpathElement(StringType value) { + this.xpath = value; + return this; + } + + /** + * @return An XPath expression that returns a set of elements for the search parameter. + */ + public String getXpath() { + return this.xpath == null ? null : this.xpath.getValue(); + } + + /** + * @param value An XPath expression that returns a set of elements for the search parameter. + */ + public SearchParameter setXpath(String value) { + if (Utilities.noString(value)) + this.xpath = null; + else { + if (this.xpath == null) + this.xpath = new StringType(); + this.xpath.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (Types of resource (if a resource is referenced).) + */ + public List getTarget() { + if (this.target == null) + this.target = new ArrayList(); + return this.target; + } + + public boolean hasTarget() { + if (this.target == null) + return false; + for (CodeType item : this.target) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #target} (Types of resource (if a resource is referenced).) + */ + // syntactic sugar + public CodeType addTargetElement() {//2 + CodeType t = new CodeType(); + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return t; + } + + /** + * @param value {@link #target} (Types of resource (if a resource is referenced).) + */ + public SearchParameter addTarget(String value) { //1 + CodeType t = new CodeType(); + t.setValue(value); + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return this; + } + + /** + * @param value {@link #target} (Types of resource (if a resource is referenced).) + */ + public boolean hasTarget(String value) { + if (this.target == null) + return false; + for (CodeType v : this.target) + if (v.equals(value)) // code + return true; + return false; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("name", "string", "The name of the standard or custom search parameter.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the search parameter.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("requirements", "string", "The Scope and Usage that this search parameter was created to meet.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("status", "code", "The status of this search parameter definition.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("date", "dateTime", "The date (and optionally time) when the search parameter definition was published.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("base", "code", "The base resource type that this search parameter refers to.", 0, java.lang.Integer.MAX_VALUE, base)); + childrenList.add(new Property("type", "code", "The type of value a search parameter refers to, and how the content is interpreted.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("description", "string", "A description of the search parameters and how it used.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("xpath", "string", "An XPath expression that returns a set of elements for the search parameter.", 0, java.lang.Integer.MAX_VALUE, xpath)); + childrenList.add(new Property("target", "code", "Types of resource (if a resource is referenced).", 0, java.lang.Integer.MAX_VALUE, target)); + } + + public SearchParameter copy() { + SearchParameter dst = new SearchParameter(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.name = name == null ? null : name.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (SearchParameterContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.requirements = requirements == null ? null : requirements.copy(); + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.date = date == null ? null : date.copy(); + dst.base = base == null ? null : base.copy(); + dst.type = type == null ? null : type.copy(); + dst.description = description == null ? null : description.copy(); + dst.xpath = xpath == null ? null : xpath.copy(); + if (target != null) { + dst.target = new ArrayList(); + for (CodeType i : target) + dst.target.add(i.copy()); + }; + return dst; + } + + protected SearchParameter typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SearchParameter)) + return false; + SearchParameter o = (SearchParameter) other; + return compareDeep(url, o.url, true) && compareDeep(name, o.name, true) && compareDeep(publisher, o.publisher, true) + && compareDeep(contact, o.contact, true) && compareDeep(requirements, o.requirements, true) && compareDeep(status, o.status, true) + && compareDeep(experimental, o.experimental, true) && compareDeep(date, o.date, true) && compareDeep(base, o.base, true) + && compareDeep(type, o.type, true) && compareDeep(description, o.description, true) && compareDeep(xpath, o.xpath, true) + && compareDeep(target, o.target, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SearchParameter)) + return false; + SearchParameter o = (SearchParameter) other; + return compareValues(url, o.url, true) && compareValues(name, o.name, true) && compareValues(publisher, o.publisher, true) + && compareValues(requirements, o.requirements, true) && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) + && compareValues(date, o.date, true) && compareValues(base, o.base, true) && compareValues(type, o.type, true) + && compareValues(description, o.description, true) && compareValues(xpath, o.xpath, true) && compareValues(target, o.target, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (name == null || name.isEmpty()) + && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) && (requirements == null || requirements.isEmpty()) + && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) + && (date == null || date.isEmpty()) && (base == null || base.isEmpty()) && (type == null || type.isEmpty()) + && (description == null || description.isEmpty()) && (xpath == null || xpath.isEmpty()) && (target == null || target.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.SearchParameter; + } + + @SearchParamDefinition(name="name", path="SearchParameter.name", description="Name of search parameter", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="description", path="SearchParameter.description", description="Documentation for search parameter", type="string" ) + public static final String SP_DESCRIPTION = "description"; + @SearchParamDefinition(name="type", path="SearchParameter.type", description="number | date | string | token | reference | composite | quantity | uri", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="url", path="SearchParameter.url", description="Literal URL used to reference this search parameter", type="uri" ) + public static final String SP_URL = "url"; + @SearchParamDefinition(name="base", path="SearchParameter.base", description="The resource type this search parameter applies to", type="token" ) + public static final String SP_BASE = "base"; + @SearchParamDefinition(name="target", path="SearchParameter.target", description="Types of resource (if a resource reference)", type="token" ) + public static final String SP_TARGET = "target"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/SidType.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/SidType.java index 14e05fc95b1..87a8e081ecb 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/SidType.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/SidType.java @@ -1,56 +1,35 @@ -/* -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; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -public class SidType extends UriType { - - private static final long serialVersionUID = 5486832330986493589L; - -} +/* +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; + +public class SidType extends UriType { + + private static final long serialVersionUID = 5486832330986493589L; + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Signature.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Signature.java index b7c52bf44e1..2c4ebe34997 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Signature.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Signature.java @@ -1,336 +1,315 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * An XML digital signature along with supporting context. - */ -@DatatypeDef(name="Signature") -public class Signature extends Type implements ICompositeType { - - /** - * An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document. - */ - @Child(name = "type", type = {Coding.class}, order=0, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Indication of the reason the entity signed the object(s)", formalDefinition="An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document." ) - protected List type; - - /** - * When the digital signature was signed. - */ - @Child(name = "when", type = {InstantType.class}, order=1, min=1, max=1) - @Description(shortDefinition="When the signature was created", formalDefinition="When the digital signature was signed." ) - protected InstantType when; - - /** - * A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key). - */ - @Child(name = "who", type = {UriType.class, Practitioner.class, RelatedPerson.class, Patient.class}, order=2, min=1, max=1) - @Description(shortDefinition="Who signed the signature", formalDefinition="A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key)." ) - protected Type who; - - /** - * The base64 encoding of the XML-Signature. - */ - @Child(name = "blob", type = {Base64BinaryType.class}, order=3, min=1, max=1) - @Description(shortDefinition="The actual XML Dig-Sig", formalDefinition="The base64 encoding of the XML-Signature." ) - protected Base64BinaryType blob; - - private static final long serialVersionUID = 1072581988L; - - /* - * Constructor - */ - public Signature() { - super(); - } - - /* - * Constructor - */ - public Signature(InstantType when, Type who, Base64BinaryType blob) { - super(); - this.when = when; - this.who = who; - this.blob = blob; - } - - /** - * @return {@link #type} (An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (Coding item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document.) - */ - // syntactic sugar - public Coding addType() { //3 - Coding t = new Coding(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - // syntactic sugar - public Signature addType(Coding t) { //3 - if (t == null) - return this; - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - /** - * @return {@link #when} (When the digital signature was signed.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value - */ - public InstantType getWhenElement() { - if (this.when == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Signature.when"); - else if (Configuration.doAutoCreate()) - this.when = new InstantType(); // bb - return this.when; - } - - public boolean hasWhenElement() { - return this.when != null && !this.when.isEmpty(); - } - - public boolean hasWhen() { - return this.when != null && !this.when.isEmpty(); - } - - /** - * @param value {@link #when} (When the digital signature was signed.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value - */ - public Signature setWhenElement(InstantType value) { - this.when = value; - return this; - } - - /** - * @return When the digital signature was signed. - */ - public Date getWhen() { - return this.when == null ? null : this.when.getValue(); - } - - /** - * @param value When the digital signature was signed. - */ - public Signature setWhen(Date value) { - if (this.when == null) - this.when = new InstantType(); - this.when.setValue(value); - return this; - } - - /** - * @return {@link #who} (A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).) - */ - public Type getWho() { - return this.who; - } - - /** - * @return {@link #who} (A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).) - */ - public UriType getWhoUriType() throws Exception { - if (!(this.who instanceof UriType)) - throw new Exception("Type mismatch: the type UriType was expected, but "+this.who.getClass().getName()+" was encountered"); - return (UriType) this.who; - } - - /** - * @return {@link #who} (A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).) - */ - public Reference getWhoReference() throws Exception { - if (!(this.who instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.who.getClass().getName()+" was encountered"); - return (Reference) this.who; - } - - public boolean hasWho() { - return this.who != null && !this.who.isEmpty(); - } - - /** - * @param value {@link #who} (A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).) - */ - public Signature setWho(Type value) { - this.who = value; - return this; - } - - /** - * @return {@link #blob} (The base64 encoding of the XML-Signature.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value - */ - public Base64BinaryType getBlobElement() { - if (this.blob == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Signature.blob"); - else if (Configuration.doAutoCreate()) - this.blob = new Base64BinaryType(); // bb - return this.blob; - } - - public boolean hasBlobElement() { - return this.blob != null && !this.blob.isEmpty(); - } - - public boolean hasBlob() { - return this.blob != null && !this.blob.isEmpty(); - } - - /** - * @param value {@link #blob} (The base64 encoding of the XML-Signature.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value - */ - public Signature setBlobElement(Base64BinaryType value) { - this.blob = value; - return this; - } - - /** - * @return The base64 encoding of the XML-Signature. - */ - public byte[] getBlob() { - return this.blob == null ? null : this.blob.getValue(); - } - - /** - * @param value The base64 encoding of the XML-Signature. - */ - public Signature setBlob(byte[] value) { - if (this.blob == null) - this.blob = new Base64BinaryType(); - this.blob.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("when", "instant", "When the digital signature was signed.", 0, java.lang.Integer.MAX_VALUE, when)); - childrenList.add(new Property("who[x]", "uri|Reference(Practitioner|RelatedPerson|Patient)", "A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).", 0, java.lang.Integer.MAX_VALUE, who)); - childrenList.add(new Property("blob", "base64Binary", "The base64 encoding of the XML-Signature.", 0, java.lang.Integer.MAX_VALUE, blob)); - } - - public Signature copy() { - Signature dst = new Signature(); - copyValues(dst); - if (type != null) { - dst.type = new ArrayList(); - for (Coding i : type) - dst.type.add(i.copy()); - }; - dst.when = when == null ? null : when.copy(); - dst.who = who == null ? null : who.copy(); - dst.blob = blob == null ? null : blob.copy(); - return dst; - } - - protected Signature typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Signature)) - return false; - Signature o = (Signature) other; - return compareDeep(type, o.type, true) && compareDeep(when, o.when, true) && compareDeep(who, o.who, true) - && compareDeep(blob, o.blob, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Signature)) - return false; - Signature o = (Signature) other; - return compareValues(when, o.when, true) && compareValues(blob, o.blob, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (when == null || when.isEmpty()) - && (who == null || who.isEmpty()) && (blob == null || blob.isEmpty()); - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * An XML digital signature along with supporting context. + */ +@DatatypeDef(name="Signature") +public class Signature extends Type implements ICompositeType { + + /** + * An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document. + */ + @Child(name = "type", type = {Coding.class}, order=0, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Indication of the reason the entity signed the object(s)", formalDefinition="An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document." ) + protected List type; + + /** + * When the digital signature was signed. + */ + @Child(name = "when", type = {InstantType.class}, order=1, min=1, max=1) + @Description(shortDefinition="When the signature was created", formalDefinition="When the digital signature was signed." ) + protected InstantType when; + + /** + * A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key). + */ + @Child(name = "who", type = {UriType.class, Practitioner.class, RelatedPerson.class, Patient.class}, order=2, min=1, max=1) + @Description(shortDefinition="Who signed the signature", formalDefinition="A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key)." ) + protected Type who; + + /** + * The base64 encoding of the XML-Signature. + */ + @Child(name = "blob", type = {Base64BinaryType.class}, order=3, min=1, max=1) + @Description(shortDefinition="The actual XML Dig-Sig", formalDefinition="The base64 encoding of the XML-Signature." ) + protected Base64BinaryType blob; + + private static final long serialVersionUID = 1072581988L; + + /* + * Constructor + */ + public Signature() { + super(); + } + + /* + * Constructor + */ + public Signature(InstantType when, Type who, Base64BinaryType blob) { + super(); + this.when = when; + this.who = who; + this.blob = blob; + } + + /** + * @return {@link #type} (An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (Coding item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document.) + */ + // syntactic sugar + public Coding addType() { //3 + Coding t = new Coding(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + // syntactic sugar + public Signature addType(Coding t) { //3 + if (t == null) + return this; + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + /** + * @return {@link #when} (When the digital signature was signed.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value + */ + public InstantType getWhenElement() { + if (this.when == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Signature.when"); + else if (Configuration.doAutoCreate()) + this.when = new InstantType(); // bb + return this.when; + } + + public boolean hasWhenElement() { + return this.when != null && !this.when.isEmpty(); + } + + public boolean hasWhen() { + return this.when != null && !this.when.isEmpty(); + } + + /** + * @param value {@link #when} (When the digital signature was signed.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value + */ + public Signature setWhenElement(InstantType value) { + this.when = value; + return this; + } + + /** + * @return When the digital signature was signed. + */ + public Date getWhen() { + return this.when == null ? null : this.when.getValue(); + } + + /** + * @param value When the digital signature was signed. + */ + public Signature setWhen(Date value) { + if (this.when == null) + this.when = new InstantType(); + this.when.setValue(value); + return this; + } + + /** + * @return {@link #who} (A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).) + */ + public Type getWho() { + return this.who; + } + + /** + * @return {@link #who} (A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).) + */ + public UriType getWhoUriType() throws Exception { + if (!(this.who instanceof UriType)) + throw new Exception("Type mismatch: the type UriType was expected, but "+this.who.getClass().getName()+" was encountered"); + return (UriType) this.who; + } + + /** + * @return {@link #who} (A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).) + */ + public Reference getWhoReference() throws Exception { + if (!(this.who instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.who.getClass().getName()+" was encountered"); + return (Reference) this.who; + } + + public boolean hasWho() { + return this.who != null && !this.who.isEmpty(); + } + + /** + * @param value {@link #who} (A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).) + */ + public Signature setWho(Type value) { + this.who = value; + return this; + } + + /** + * @return {@link #blob} (The base64 encoding of the XML-Signature.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value + */ + public Base64BinaryType getBlobElement() { + if (this.blob == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Signature.blob"); + else if (Configuration.doAutoCreate()) + this.blob = new Base64BinaryType(); // bb + return this.blob; + } + + public boolean hasBlobElement() { + return this.blob != null && !this.blob.isEmpty(); + } + + public boolean hasBlob() { + return this.blob != null && !this.blob.isEmpty(); + } + + /** + * @param value {@link #blob} (The base64 encoding of the XML-Signature.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value + */ + public Signature setBlobElement(Base64BinaryType value) { + this.blob = value; + return this; + } + + /** + * @return The base64 encoding of the XML-Signature. + */ + public byte[] getBlob() { + return this.blob == null ? null : this.blob.getValue(); + } + + /** + * @param value The base64 encoding of the XML-Signature. + */ + public Signature setBlob(byte[] value) { + if (this.blob == null) + this.blob = new Base64BinaryType(); + this.blob.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("when", "instant", "When the digital signature was signed.", 0, java.lang.Integer.MAX_VALUE, when)); + childrenList.add(new Property("who[x]", "uri|Reference(Practitioner|RelatedPerson|Patient)", "A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).", 0, java.lang.Integer.MAX_VALUE, who)); + childrenList.add(new Property("blob", "base64Binary", "The base64 encoding of the XML-Signature.", 0, java.lang.Integer.MAX_VALUE, blob)); + } + + public Signature copy() { + Signature dst = new Signature(); + copyValues(dst); + if (type != null) { + dst.type = new ArrayList(); + for (Coding i : type) + dst.type.add(i.copy()); + }; + dst.when = when == null ? null : when.copy(); + dst.who = who == null ? null : who.copy(); + dst.blob = blob == null ? null : blob.copy(); + return dst; + } + + protected Signature typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Signature)) + return false; + Signature o = (Signature) other; + return compareDeep(type, o.type, true) && compareDeep(when, o.when, true) && compareDeep(who, o.who, true) + && compareDeep(blob, o.blob, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Signature)) + return false; + Signature o = (Signature) other; + return compareValues(when, o.when, true) && compareValues(blob, o.blob, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (when == null || when.isEmpty()) + && (who == null || who.isEmpty()) && (blob == null || blob.isEmpty()); + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Slot.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Slot.java index 9b6feb3e64d..dc7fcb0674c 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Slot.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Slot.java @@ -1,667 +1,646 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A slot of time on a schedule that may be available for booking appointments. - */ -@ResourceDef(name="Slot", profile="http://hl7.org/fhir/Profile/Slot") -public class Slot extends DomainResource { - - public enum Slotstatus { - /** - * Indicates that the time interval is busy because one or more events have been scheduled for that interval. - */ - BUSY, - /** - * Indicates that the time interval is free for scheduling. - */ - FREE, - /** - * Indicates that the time interval is busy and that the interval can not be scheduled. - */ - BUSYUNAVAILABLE, - /** - * Indicates that the time interval is busy because one or more events have been tentatively scheduled for that interval. - */ - BUSYTENTATIVE, - /** - * added to help the parsers - */ - NULL; - public static Slotstatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("BUSY".equals(codeString)) - return BUSY; - if ("FREE".equals(codeString)) - return FREE; - if ("BUSY-UNAVAILABLE".equals(codeString)) - return BUSYUNAVAILABLE; - if ("BUSY-TENTATIVE".equals(codeString)) - return BUSYTENTATIVE; - throw new Exception("Unknown Slotstatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case BUSY: return "BUSY"; - case FREE: return "FREE"; - case BUSYUNAVAILABLE: return "BUSY-UNAVAILABLE"; - case BUSYTENTATIVE: return "BUSY-TENTATIVE"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case BUSY: return ""; - case FREE: return ""; - case BUSYUNAVAILABLE: return ""; - case BUSYTENTATIVE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case BUSY: return "Indicates that the time interval is busy because one or more events have been scheduled for that interval."; - case FREE: return "Indicates that the time interval is free for scheduling."; - case BUSYUNAVAILABLE: return "Indicates that the time interval is busy and that the interval can not be scheduled."; - case BUSYTENTATIVE: return "Indicates that the time interval is busy because one or more events have been tentatively scheduled for that interval."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case BUSY: return "B U S Y"; - case FREE: return "F R E E"; - case BUSYUNAVAILABLE: return "B U S Y U N A V A I L A B L E"; - case BUSYTENTATIVE: return "B U S Y T E N T A T I V E"; - default: return "?"; - } - } - } - - public static class SlotstatusEnumFactory implements EnumFactory { - public Slotstatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("BUSY".equals(codeString)) - return Slotstatus.BUSY; - if ("FREE".equals(codeString)) - return Slotstatus.FREE; - if ("BUSY-UNAVAILABLE".equals(codeString)) - return Slotstatus.BUSYUNAVAILABLE; - if ("BUSY-TENTATIVE".equals(codeString)) - return Slotstatus.BUSYTENTATIVE; - throw new IllegalArgumentException("Unknown Slotstatus code '"+codeString+"'"); - } - public String toCode(Slotstatus code) { - if (code == Slotstatus.BUSY) - return "BUSY"; - if (code == Slotstatus.FREE) - return "FREE"; - if (code == Slotstatus.BUSYUNAVAILABLE) - return "BUSY-UNAVAILABLE"; - if (code == Slotstatus.BUSYTENTATIVE) - return "BUSY-TENTATIVE"; - return "?"; - } - } - - /** - * External Ids for this item. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External Ids for this item", formalDefinition="External Ids for this item." ) - protected List identifier; - - /** - * The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource", formalDefinition="The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource." ) - protected CodeableConcept type; - - /** - * The schedule resource that this slot defines an interval of status information. - */ - @Child(name = "schedule", type = {Schedule.class}, order=2, min=1, max=1) - @Description(shortDefinition="The schedule resource that this slot defines an interval of status information", formalDefinition="The schedule resource that this slot defines an interval of status information." ) - protected Reference schedule; - - /** - * The actual object that is the target of the reference (The schedule resource that this slot defines an interval of status information.) - */ - protected Schedule scheduleTarget; - - /** - * BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE. - */ - @Child(name = "freeBusyType", type = {CodeType.class}, order=3, min=1, max=1) - @Description(shortDefinition="BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE", formalDefinition="BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE." ) - protected Enumeration freeBusyType; - - /** - * Date/Time that the slot is to begin. - */ - @Child(name = "start", type = {InstantType.class}, order=4, min=1, max=1) - @Description(shortDefinition="Date/Time that the slot is to begin", formalDefinition="Date/Time that the slot is to begin." ) - protected InstantType start; - - /** - * Date/Time that the slot is to conclude. - */ - @Child(name = "end", type = {InstantType.class}, order=5, min=1, max=1) - @Description(shortDefinition="Date/Time that the slot is to conclude", formalDefinition="Date/Time that the slot is to conclude." ) - protected InstantType end; - - /** - * This slot has already been overbooked, appointments are unlikely to be accepted for this time. - */ - @Child(name = "overbooked", type = {BooleanType.class}, order=6, min=0, max=1) - @Description(shortDefinition="This slot has already been overbooked, appointments are unlikely to be accepted for this time", formalDefinition="This slot has already been overbooked, appointments are unlikely to be accepted for this time." ) - protected BooleanType overbooked; - - /** - * Comments on the slot to describe any extended information. Such as custom constraints on the slot. - */ - @Child(name = "comment", type = {StringType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Comments on the slot to describe any extended information. Such as custom constraints on the slot", formalDefinition="Comments on the slot to describe any extended information. Such as custom constraints on the slot." ) - protected StringType comment; - - private static final long serialVersionUID = 1371243539L; - - /* - * Constructor - */ - public Slot() { - super(); - } - - /* - * Constructor - */ - public Slot(Reference schedule, Enumeration freeBusyType, InstantType start, InstantType end) { - super(); - this.schedule = schedule; - this.freeBusyType = freeBusyType; - this.start = start; - this.end = end; - } - - /** - * @return {@link #identifier} (External Ids for this item.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (External Ids for this item.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Slot addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #type} (The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource.) - */ - public Slot setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #schedule} (The schedule resource that this slot defines an interval of status information.) - */ - public Reference getSchedule() { - if (this.schedule == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.schedule"); - else if (Configuration.doAutoCreate()) - this.schedule = new Reference(); // cc - return this.schedule; - } - - public boolean hasSchedule() { - return this.schedule != null && !this.schedule.isEmpty(); - } - - /** - * @param value {@link #schedule} (The schedule resource that this slot defines an interval of status information.) - */ - public Slot setSchedule(Reference value) { - this.schedule = value; - return this; - } - - /** - * @return {@link #schedule} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The schedule resource that this slot defines an interval of status information.) - */ - public Schedule getScheduleTarget() { - if (this.scheduleTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.schedule"); - else if (Configuration.doAutoCreate()) - this.scheduleTarget = new Schedule(); // aa - return this.scheduleTarget; - } - - /** - * @param value {@link #schedule} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The schedule resource that this slot defines an interval of status information.) - */ - public Slot setScheduleTarget(Schedule value) { - this.scheduleTarget = value; - return this; - } - - /** - * @return {@link #freeBusyType} (BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE.). This is the underlying object with id, value and extensions. The accessor "getFreeBusyType" gives direct access to the value - */ - public Enumeration getFreeBusyTypeElement() { - if (this.freeBusyType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.freeBusyType"); - else if (Configuration.doAutoCreate()) - this.freeBusyType = new Enumeration(new SlotstatusEnumFactory()); // bb - return this.freeBusyType; - } - - public boolean hasFreeBusyTypeElement() { - return this.freeBusyType != null && !this.freeBusyType.isEmpty(); - } - - public boolean hasFreeBusyType() { - return this.freeBusyType != null && !this.freeBusyType.isEmpty(); - } - - /** - * @param value {@link #freeBusyType} (BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE.). This is the underlying object with id, value and extensions. The accessor "getFreeBusyType" gives direct access to the value - */ - public Slot setFreeBusyTypeElement(Enumeration value) { - this.freeBusyType = value; - return this; - } - - /** - * @return BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE. - */ - public Slotstatus getFreeBusyType() { - return this.freeBusyType == null ? null : this.freeBusyType.getValue(); - } - - /** - * @param value BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE. - */ - public Slot setFreeBusyType(Slotstatus value) { - if (this.freeBusyType == null) - this.freeBusyType = new Enumeration(new SlotstatusEnumFactory()); - this.freeBusyType.setValue(value); - return this; - } - - /** - * @return {@link #start} (Date/Time that the slot is to begin.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public InstantType getStartElement() { - if (this.start == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.start"); - else if (Configuration.doAutoCreate()) - this.start = new InstantType(); // bb - return this.start; - } - - public boolean hasStartElement() { - return this.start != null && !this.start.isEmpty(); - } - - public boolean hasStart() { - return this.start != null && !this.start.isEmpty(); - } - - /** - * @param value {@link #start} (Date/Time that the slot is to begin.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public Slot setStartElement(InstantType value) { - this.start = value; - return this; - } - - /** - * @return Date/Time that the slot is to begin. - */ - public Date getStart() { - return this.start == null ? null : this.start.getValue(); - } - - /** - * @param value Date/Time that the slot is to begin. - */ - public Slot setStart(Date value) { - if (this.start == null) - this.start = new InstantType(); - this.start.setValue(value); - return this; - } - - /** - * @return {@link #end} (Date/Time that the slot is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public InstantType getEndElement() { - if (this.end == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.end"); - else if (Configuration.doAutoCreate()) - this.end = new InstantType(); // bb - return this.end; - } - - public boolean hasEndElement() { - return this.end != null && !this.end.isEmpty(); - } - - public boolean hasEnd() { - return this.end != null && !this.end.isEmpty(); - } - - /** - * @param value {@link #end} (Date/Time that the slot is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public Slot setEndElement(InstantType value) { - this.end = value; - return this; - } - - /** - * @return Date/Time that the slot is to conclude. - */ - public Date getEnd() { - return this.end == null ? null : this.end.getValue(); - } - - /** - * @param value Date/Time that the slot is to conclude. - */ - public Slot setEnd(Date value) { - if (this.end == null) - this.end = new InstantType(); - this.end.setValue(value); - return this; - } - - /** - * @return {@link #overbooked} (This slot has already been overbooked, appointments are unlikely to be accepted for this time.). This is the underlying object with id, value and extensions. The accessor "getOverbooked" gives direct access to the value - */ - public BooleanType getOverbookedElement() { - if (this.overbooked == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.overbooked"); - else if (Configuration.doAutoCreate()) - this.overbooked = new BooleanType(); // bb - return this.overbooked; - } - - public boolean hasOverbookedElement() { - return this.overbooked != null && !this.overbooked.isEmpty(); - } - - public boolean hasOverbooked() { - return this.overbooked != null && !this.overbooked.isEmpty(); - } - - /** - * @param value {@link #overbooked} (This slot has already been overbooked, appointments are unlikely to be accepted for this time.). This is the underlying object with id, value and extensions. The accessor "getOverbooked" gives direct access to the value - */ - public Slot setOverbookedElement(BooleanType value) { - this.overbooked = value; - return this; - } - - /** - * @return This slot has already been overbooked, appointments are unlikely to be accepted for this time. - */ - public boolean getOverbooked() { - return this.overbooked == null || this.overbooked.isEmpty() ? false : this.overbooked.getValue(); - } - - /** - * @param value This slot has already been overbooked, appointments are unlikely to be accepted for this time. - */ - public Slot setOverbooked(boolean value) { - if (this.overbooked == null) - this.overbooked = new BooleanType(); - this.overbooked.setValue(value); - return this; - } - - /** - * @return {@link #comment} (Comments on the slot to describe any extended information. Such as custom constraints on the slot.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); // bb - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (Comments on the slot to describe any extended information. Such as custom constraints on the slot.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public Slot setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return Comments on the slot to describe any extended information. Such as custom constraints on the slot. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value Comments on the slot to describe any extended information. Such as custom constraints on the slot. - */ - public Slot setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "External Ids for this item.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("type", "CodeableConcept", "The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("schedule", "Reference(Schedule)", "The schedule resource that this slot defines an interval of status information.", 0, java.lang.Integer.MAX_VALUE, schedule)); - childrenList.add(new Property("freeBusyType", "code", "BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE.", 0, java.lang.Integer.MAX_VALUE, freeBusyType)); - childrenList.add(new Property("start", "instant", "Date/Time that the slot is to begin.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("end", "instant", "Date/Time that the slot is to conclude.", 0, java.lang.Integer.MAX_VALUE, end)); - childrenList.add(new Property("overbooked", "boolean", "This slot has already been overbooked, appointments are unlikely to be accepted for this time.", 0, java.lang.Integer.MAX_VALUE, overbooked)); - childrenList.add(new Property("comment", "string", "Comments on the slot to describe any extended information. Such as custom constraints on the slot.", 0, java.lang.Integer.MAX_VALUE, comment)); - } - - public Slot copy() { - Slot dst = new Slot(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - dst.schedule = schedule == null ? null : schedule.copy(); - dst.freeBusyType = freeBusyType == null ? null : freeBusyType.copy(); - dst.start = start == null ? null : start.copy(); - dst.end = end == null ? null : end.copy(); - dst.overbooked = overbooked == null ? null : overbooked.copy(); - dst.comment = comment == null ? null : comment.copy(); - return dst; - } - - protected Slot typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Slot)) - return false; - Slot o = (Slot) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(schedule, o.schedule, true) - && compareDeep(freeBusyType, o.freeBusyType, true) && compareDeep(start, o.start, true) && compareDeep(end, o.end, true) - && compareDeep(overbooked, o.overbooked, true) && compareDeep(comment, o.comment, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Slot)) - return false; - Slot o = (Slot) other; - return compareValues(freeBusyType, o.freeBusyType, true) && compareValues(start, o.start, true) && compareValues(end, o.end, true) - && compareValues(overbooked, o.overbooked, true) && compareValues(comment, o.comment, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) - && (schedule == null || schedule.isEmpty()) && (freeBusyType == null || freeBusyType.isEmpty()) - && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) && (overbooked == null || overbooked.isEmpty()) - && (comment == null || comment.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Slot; - } - - @SearchParamDefinition(name="schedule", path="Slot.schedule", description="The Schedule Resource that we are seeking a slot within", type="reference" ) - public static final String SP_SCHEDULE = "schedule"; - @SearchParamDefinition(name="start", path="Slot.start", description="Appointment date/time.", type="date" ) - public static final String SP_START = "start"; - @SearchParamDefinition(name="slottype", path="Slot.type", description="The type of appointments that can be booked into the slot", type="token" ) - public static final String SP_SLOTTYPE = "slottype"; - @SearchParamDefinition(name="fbtype", path="Slot.freeBusyType", description="The free/busy status of the appointment", type="token" ) - public static final String SP_FBTYPE = "fbtype"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A slot of time on a schedule that may be available for booking appointments. + */ +@ResourceDef(name="Slot", profile="http://hl7.org/fhir/Profile/Slot") +public class Slot extends DomainResource { + + public enum Slotstatus { + /** + * Indicates that the time interval is busy because one or more events have been scheduled for that interval. + */ + BUSY, + /** + * Indicates that the time interval is free for scheduling. + */ + FREE, + /** + * Indicates that the time interval is busy and that the interval can not be scheduled. + */ + BUSYUNAVAILABLE, + /** + * Indicates that the time interval is busy because one or more events have been tentatively scheduled for that interval. + */ + BUSYTENTATIVE, + /** + * added to help the parsers + */ + NULL; + public static Slotstatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("BUSY".equals(codeString)) + return BUSY; + if ("FREE".equals(codeString)) + return FREE; + if ("BUSY-UNAVAILABLE".equals(codeString)) + return BUSYUNAVAILABLE; + if ("BUSY-TENTATIVE".equals(codeString)) + return BUSYTENTATIVE; + throw new Exception("Unknown Slotstatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case BUSY: return "BUSY"; + case FREE: return "FREE"; + case BUSYUNAVAILABLE: return "BUSY-UNAVAILABLE"; + case BUSYTENTATIVE: return "BUSY-TENTATIVE"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case BUSY: return ""; + case FREE: return ""; + case BUSYUNAVAILABLE: return ""; + case BUSYTENTATIVE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case BUSY: return "Indicates that the time interval is busy because one or more events have been scheduled for that interval."; + case FREE: return "Indicates that the time interval is free for scheduling."; + case BUSYUNAVAILABLE: return "Indicates that the time interval is busy and that the interval can not be scheduled."; + case BUSYTENTATIVE: return "Indicates that the time interval is busy because one or more events have been tentatively scheduled for that interval."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case BUSY: return "B U S Y"; + case FREE: return "F R E E"; + case BUSYUNAVAILABLE: return "B U S Y U N A V A I L A B L E"; + case BUSYTENTATIVE: return "B U S Y T E N T A T I V E"; + default: return "?"; + } + } + } + + public static class SlotstatusEnumFactory implements EnumFactory { + public Slotstatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("BUSY".equals(codeString)) + return Slotstatus.BUSY; + if ("FREE".equals(codeString)) + return Slotstatus.FREE; + if ("BUSY-UNAVAILABLE".equals(codeString)) + return Slotstatus.BUSYUNAVAILABLE; + if ("BUSY-TENTATIVE".equals(codeString)) + return Slotstatus.BUSYTENTATIVE; + throw new IllegalArgumentException("Unknown Slotstatus code '"+codeString+"'"); + } + public String toCode(Slotstatus code) { + if (code == Slotstatus.BUSY) + return "BUSY"; + if (code == Slotstatus.FREE) + return "FREE"; + if (code == Slotstatus.BUSYUNAVAILABLE) + return "BUSY-UNAVAILABLE"; + if (code == Slotstatus.BUSYTENTATIVE) + return "BUSY-TENTATIVE"; + return "?"; + } + } + + /** + * External Ids for this item. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Ids for this item", formalDefinition="External Ids for this item." ) + protected List identifier; + + /** + * The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource", formalDefinition="The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource." ) + protected CodeableConcept type; + + /** + * The schedule resource that this slot defines an interval of status information. + */ + @Child(name = "schedule", type = {Schedule.class}, order=2, min=1, max=1) + @Description(shortDefinition="The schedule resource that this slot defines an interval of status information", formalDefinition="The schedule resource that this slot defines an interval of status information." ) + protected Reference schedule; + + /** + * The actual object that is the target of the reference (The schedule resource that this slot defines an interval of status information.) + */ + protected Schedule scheduleTarget; + + /** + * BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE. + */ + @Child(name = "freeBusyType", type = {CodeType.class}, order=3, min=1, max=1) + @Description(shortDefinition="BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE", formalDefinition="BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE." ) + protected Enumeration freeBusyType; + + /** + * Date/Time that the slot is to begin. + */ + @Child(name = "start", type = {InstantType.class}, order=4, min=1, max=1) + @Description(shortDefinition="Date/Time that the slot is to begin", formalDefinition="Date/Time that the slot is to begin." ) + protected InstantType start; + + /** + * Date/Time that the slot is to conclude. + */ + @Child(name = "end", type = {InstantType.class}, order=5, min=1, max=1) + @Description(shortDefinition="Date/Time that the slot is to conclude", formalDefinition="Date/Time that the slot is to conclude." ) + protected InstantType end; + + /** + * This slot has already been overbooked, appointments are unlikely to be accepted for this time. + */ + @Child(name = "overbooked", type = {BooleanType.class}, order=6, min=0, max=1) + @Description(shortDefinition="This slot has already been overbooked, appointments are unlikely to be accepted for this time", formalDefinition="This slot has already been overbooked, appointments are unlikely to be accepted for this time." ) + protected BooleanType overbooked; + + /** + * Comments on the slot to describe any extended information. Such as custom constraints on the slot. + */ + @Child(name = "comment", type = {StringType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Comments on the slot to describe any extended information. Such as custom constraints on the slot", formalDefinition="Comments on the slot to describe any extended information. Such as custom constraints on the slot." ) + protected StringType comment; + + private static final long serialVersionUID = 1371243539L; + + /* + * Constructor + */ + public Slot() { + super(); + } + + /* + * Constructor + */ + public Slot(Reference schedule, Enumeration freeBusyType, InstantType start, InstantType end) { + super(); + this.schedule = schedule; + this.freeBusyType = freeBusyType; + this.start = start; + this.end = end; + } + + /** + * @return {@link #identifier} (External Ids for this item.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (External Ids for this item.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Slot addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #type} (The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource.) + */ + public Slot setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #schedule} (The schedule resource that this slot defines an interval of status information.) + */ + public Reference getSchedule() { + if (this.schedule == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.schedule"); + else if (Configuration.doAutoCreate()) + this.schedule = new Reference(); // cc + return this.schedule; + } + + public boolean hasSchedule() { + return this.schedule != null && !this.schedule.isEmpty(); + } + + /** + * @param value {@link #schedule} (The schedule resource that this slot defines an interval of status information.) + */ + public Slot setSchedule(Reference value) { + this.schedule = value; + return this; + } + + /** + * @return {@link #schedule} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The schedule resource that this slot defines an interval of status information.) + */ + public Schedule getScheduleTarget() { + if (this.scheduleTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.schedule"); + else if (Configuration.doAutoCreate()) + this.scheduleTarget = new Schedule(); // aa + return this.scheduleTarget; + } + + /** + * @param value {@link #schedule} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The schedule resource that this slot defines an interval of status information.) + */ + public Slot setScheduleTarget(Schedule value) { + this.scheduleTarget = value; + return this; + } + + /** + * @return {@link #freeBusyType} (BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE.). This is the underlying object with id, value and extensions. The accessor "getFreeBusyType" gives direct access to the value + */ + public Enumeration getFreeBusyTypeElement() { + if (this.freeBusyType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.freeBusyType"); + else if (Configuration.doAutoCreate()) + this.freeBusyType = new Enumeration(new SlotstatusEnumFactory()); // bb + return this.freeBusyType; + } + + public boolean hasFreeBusyTypeElement() { + return this.freeBusyType != null && !this.freeBusyType.isEmpty(); + } + + public boolean hasFreeBusyType() { + return this.freeBusyType != null && !this.freeBusyType.isEmpty(); + } + + /** + * @param value {@link #freeBusyType} (BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE.). This is the underlying object with id, value and extensions. The accessor "getFreeBusyType" gives direct access to the value + */ + public Slot setFreeBusyTypeElement(Enumeration value) { + this.freeBusyType = value; + return this; + } + + /** + * @return BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE. + */ + public Slotstatus getFreeBusyType() { + return this.freeBusyType == null ? null : this.freeBusyType.getValue(); + } + + /** + * @param value BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE. + */ + public Slot setFreeBusyType(Slotstatus value) { + if (this.freeBusyType == null) + this.freeBusyType = new Enumeration(new SlotstatusEnumFactory()); + this.freeBusyType.setValue(value); + return this; + } + + /** + * @return {@link #start} (Date/Time that the slot is to begin.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public InstantType getStartElement() { + if (this.start == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.start"); + else if (Configuration.doAutoCreate()) + this.start = new InstantType(); // bb + return this.start; + } + + public boolean hasStartElement() { + return this.start != null && !this.start.isEmpty(); + } + + public boolean hasStart() { + return this.start != null && !this.start.isEmpty(); + } + + /** + * @param value {@link #start} (Date/Time that the slot is to begin.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public Slot setStartElement(InstantType value) { + this.start = value; + return this; + } + + /** + * @return Date/Time that the slot is to begin. + */ + public Date getStart() { + return this.start == null ? null : this.start.getValue(); + } + + /** + * @param value Date/Time that the slot is to begin. + */ + public Slot setStart(Date value) { + if (this.start == null) + this.start = new InstantType(); + this.start.setValue(value); + return this; + } + + /** + * @return {@link #end} (Date/Time that the slot is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public InstantType getEndElement() { + if (this.end == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.end"); + else if (Configuration.doAutoCreate()) + this.end = new InstantType(); // bb + return this.end; + } + + public boolean hasEndElement() { + return this.end != null && !this.end.isEmpty(); + } + + public boolean hasEnd() { + return this.end != null && !this.end.isEmpty(); + } + + /** + * @param value {@link #end} (Date/Time that the slot is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public Slot setEndElement(InstantType value) { + this.end = value; + return this; + } + + /** + * @return Date/Time that the slot is to conclude. + */ + public Date getEnd() { + return this.end == null ? null : this.end.getValue(); + } + + /** + * @param value Date/Time that the slot is to conclude. + */ + public Slot setEnd(Date value) { + if (this.end == null) + this.end = new InstantType(); + this.end.setValue(value); + return this; + } + + /** + * @return {@link #overbooked} (This slot has already been overbooked, appointments are unlikely to be accepted for this time.). This is the underlying object with id, value and extensions. The accessor "getOverbooked" gives direct access to the value + */ + public BooleanType getOverbookedElement() { + if (this.overbooked == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.overbooked"); + else if (Configuration.doAutoCreate()) + this.overbooked = new BooleanType(); // bb + return this.overbooked; + } + + public boolean hasOverbookedElement() { + return this.overbooked != null && !this.overbooked.isEmpty(); + } + + public boolean hasOverbooked() { + return this.overbooked != null && !this.overbooked.isEmpty(); + } + + /** + * @param value {@link #overbooked} (This slot has already been overbooked, appointments are unlikely to be accepted for this time.). This is the underlying object with id, value and extensions. The accessor "getOverbooked" gives direct access to the value + */ + public Slot setOverbookedElement(BooleanType value) { + this.overbooked = value; + return this; + } + + /** + * @return This slot has already been overbooked, appointments are unlikely to be accepted for this time. + */ + public boolean getOverbooked() { + return this.overbooked == null || this.overbooked.isEmpty() ? false : this.overbooked.getValue(); + } + + /** + * @param value This slot has already been overbooked, appointments are unlikely to be accepted for this time. + */ + public Slot setOverbooked(boolean value) { + if (this.overbooked == null) + this.overbooked = new BooleanType(); + this.overbooked.setValue(value); + return this; + } + + /** + * @return {@link #comment} (Comments on the slot to describe any extended information. Such as custom constraints on the slot.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); // bb + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (Comments on the slot to describe any extended information. Such as custom constraints on the slot.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public Slot setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return Comments on the slot to describe any extended information. Such as custom constraints on the slot. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value Comments on the slot to describe any extended information. Such as custom constraints on the slot. + */ + public Slot setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "External Ids for this item.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("type", "CodeableConcept", "The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("schedule", "Reference(Schedule)", "The schedule resource that this slot defines an interval of status information.", 0, java.lang.Integer.MAX_VALUE, schedule)); + childrenList.add(new Property("freeBusyType", "code", "BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE.", 0, java.lang.Integer.MAX_VALUE, freeBusyType)); + childrenList.add(new Property("start", "instant", "Date/Time that the slot is to begin.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("end", "instant", "Date/Time that the slot is to conclude.", 0, java.lang.Integer.MAX_VALUE, end)); + childrenList.add(new Property("overbooked", "boolean", "This slot has already been overbooked, appointments are unlikely to be accepted for this time.", 0, java.lang.Integer.MAX_VALUE, overbooked)); + childrenList.add(new Property("comment", "string", "Comments on the slot to describe any extended information. Such as custom constraints on the slot.", 0, java.lang.Integer.MAX_VALUE, comment)); + } + + public Slot copy() { + Slot dst = new Slot(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + dst.schedule = schedule == null ? null : schedule.copy(); + dst.freeBusyType = freeBusyType == null ? null : freeBusyType.copy(); + dst.start = start == null ? null : start.copy(); + dst.end = end == null ? null : end.copy(); + dst.overbooked = overbooked == null ? null : overbooked.copy(); + dst.comment = comment == null ? null : comment.copy(); + return dst; + } + + protected Slot typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Slot)) + return false; + Slot o = (Slot) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(schedule, o.schedule, true) + && compareDeep(freeBusyType, o.freeBusyType, true) && compareDeep(start, o.start, true) && compareDeep(end, o.end, true) + && compareDeep(overbooked, o.overbooked, true) && compareDeep(comment, o.comment, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Slot)) + return false; + Slot o = (Slot) other; + return compareValues(freeBusyType, o.freeBusyType, true) && compareValues(start, o.start, true) && compareValues(end, o.end, true) + && compareValues(overbooked, o.overbooked, true) && compareValues(comment, o.comment, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) + && (schedule == null || schedule.isEmpty()) && (freeBusyType == null || freeBusyType.isEmpty()) + && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) && (overbooked == null || overbooked.isEmpty()) + && (comment == null || comment.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Slot; + } + + @SearchParamDefinition(name="schedule", path="Slot.schedule", description="The Schedule Resource that we are seeking a slot within", type="reference" ) + public static final String SP_SCHEDULE = "schedule"; + @SearchParamDefinition(name="slottype", path="Slot.type", description="The type of appointments that can be booked into the slot", type="token" ) + public static final String SP_SLOTTYPE = "slottype"; + @SearchParamDefinition(name="start", path="Slot.start", description="Appointment date/time.", type="date" ) + public static final String SP_START = "start"; + @SearchParamDefinition(name="fbtype", path="Slot.freeBusyType", description="The free/busy status of the appointment", type="token" ) + public static final String SP_FBTYPE = "fbtype"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Specimen.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Specimen.java index 0dc8ccbc14d..de4a20d1ee7 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Specimen.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Specimen.java @@ -1,1471 +1,1450 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Sample for analysis. - */ -@ResourceDef(name="Specimen", profile="http://hl7.org/fhir/Profile/Specimen") -public class Specimen extends DomainResource { - - @Block() - public static class SpecimenCollectionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Person who collected the specimen. - */ - @Child(name = "collector", type = {Practitioner.class}, order=1, min=0, max=1) - @Description(shortDefinition="Who collected the specimen", formalDefinition="Person who collected the specimen." ) - protected Reference collector; - - /** - * The actual object that is the target of the reference (Person who collected the specimen.) - */ - protected Practitioner collectorTarget; - - /** - * To communicate any details or issues encountered during the specimen collection procedure. - */ - @Child(name = "comment", type = {StringType.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Collector comments", formalDefinition="To communicate any details or issues encountered during the specimen collection procedure." ) - protected List comment; - - /** - * Time when specimen was collected from subject - the physiologically relevant time. - */ - @Child(name = "collected", type = {DateTimeType.class, Period.class}, order=3, min=0, max=1) - @Description(shortDefinition="Collection time", formalDefinition="Time when specimen was collected from subject - the physiologically relevant time." ) - protected Type collected; - - /** - * The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample. - */ - @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1) - @Description(shortDefinition="The quantity of specimen collected", formalDefinition="The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample." ) - protected Quantity quantity; - - /** - * A coded value specifying the technique that is used to perform the procedure. - */ - @Child(name = "method", type = {CodeableConcept.class}, order=5, min=0, max=1) - @Description(shortDefinition="Technique used to perform collection", formalDefinition="A coded value specifying the technique that is used to perform the procedure." ) - protected CodeableConcept method; - - /** - * Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens. - */ - @Child(name = "bodySite", type = {CodeableConcept.class, BodySite.class}, order=6, min=0, max=1) - @Description(shortDefinition="Anatomical collection site", formalDefinition="Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens." ) - protected Type bodySite; - - private static final long serialVersionUID = 2117268554L; - - /* - * Constructor - */ - public SpecimenCollectionComponent() { - super(); - } - - /** - * @return {@link #collector} (Person who collected the specimen.) - */ - public Reference getCollector() { - if (this.collector == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenCollectionComponent.collector"); - else if (Configuration.doAutoCreate()) - this.collector = new Reference(); // cc - return this.collector; - } - - public boolean hasCollector() { - return this.collector != null && !this.collector.isEmpty(); - } - - /** - * @param value {@link #collector} (Person who collected the specimen.) - */ - public SpecimenCollectionComponent setCollector(Reference value) { - this.collector = value; - return this; - } - - /** - * @return {@link #collector} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Person who collected the specimen.) - */ - public Practitioner getCollectorTarget() { - if (this.collectorTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenCollectionComponent.collector"); - else if (Configuration.doAutoCreate()) - this.collectorTarget = new Practitioner(); // aa - return this.collectorTarget; - } - - /** - * @param value {@link #collector} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Person who collected the specimen.) - */ - public SpecimenCollectionComponent setCollectorTarget(Practitioner value) { - this.collectorTarget = value; - return this; - } - - /** - * @return {@link #comment} (To communicate any details or issues encountered during the specimen collection procedure.) - */ - public List getComment() { - if (this.comment == null) - this.comment = new ArrayList(); - return this.comment; - } - - public boolean hasComment() { - if (this.comment == null) - return false; - for (StringType item : this.comment) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #comment} (To communicate any details or issues encountered during the specimen collection procedure.) - */ - // syntactic sugar - public StringType addCommentElement() {//2 - StringType t = new StringType(); - if (this.comment == null) - this.comment = new ArrayList(); - this.comment.add(t); - return t; - } - - /** - * @param value {@link #comment} (To communicate any details or issues encountered during the specimen collection procedure.) - */ - public SpecimenCollectionComponent addComment(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.comment == null) - this.comment = new ArrayList(); - this.comment.add(t); - return this; - } - - /** - * @param value {@link #comment} (To communicate any details or issues encountered during the specimen collection procedure.) - */ - public boolean hasComment(String value) { - if (this.comment == null) - return false; - for (StringType v : this.comment) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) - */ - public Type getCollected() { - return this.collected; - } - - /** - * @return {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) - */ - public DateTimeType getCollectedDateTimeType() throws Exception { - if (!(this.collected instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.collected.getClass().getName()+" was encountered"); - return (DateTimeType) this.collected; - } - - /** - * @return {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) - */ - public Period getCollectedPeriod() throws Exception { - if (!(this.collected instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.collected.getClass().getName()+" was encountered"); - return (Period) this.collected; - } - - public boolean hasCollected() { - return this.collected != null && !this.collected.isEmpty(); - } - - /** - * @param value {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) - */ - public SpecimenCollectionComponent setCollected(Type value) { - this.collected = value; - return this; - } - - /** - * @return {@link #quantity} (The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenCollectionComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.) - */ - public SpecimenCollectionComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #method} (A coded value specifying the technique that is used to perform the procedure.) - */ - public CodeableConcept getMethod() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenCollectionComponent.method"); - else if (Configuration.doAutoCreate()) - this.method = new CodeableConcept(); // cc - return this.method; - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** - * @param value {@link #method} (A coded value specifying the technique that is used to perform the procedure.) - */ - public SpecimenCollectionComponent setMethod(CodeableConcept value) { - this.method = value; - return this; - } - - /** - * @return {@link #bodySite} (Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens.) - */ - public Type getBodySite() { - return this.bodySite; - } - - /** - * @return {@link #bodySite} (Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens.) - */ - public CodeableConcept getBodySiteCodeableConcept() throws Exception { - if (!(this.bodySite instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.bodySite.getClass().getName()+" was encountered"); - return (CodeableConcept) this.bodySite; - } - - /** - * @return {@link #bodySite} (Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens.) - */ - public Reference getBodySiteReference() throws Exception { - if (!(this.bodySite instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.bodySite.getClass().getName()+" was encountered"); - return (Reference) this.bodySite; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens.) - */ - public SpecimenCollectionComponent setBodySite(Type value) { - this.bodySite = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("collector", "Reference(Practitioner)", "Person who collected the specimen.", 0, java.lang.Integer.MAX_VALUE, collector)); - childrenList.add(new Property("comment", "string", "To communicate any details or issues encountered during the specimen collection procedure.", 0, java.lang.Integer.MAX_VALUE, comment)); - childrenList.add(new Property("collected[x]", "dateTime|Period", "Time when specimen was collected from subject - the physiologically relevant time.", 0, java.lang.Integer.MAX_VALUE, collected)); - childrenList.add(new Property("quantity", "Quantity", "The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("method", "CodeableConcept", "A coded value specifying the technique that is used to perform the procedure.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("bodySite[x]", "CodeableConcept|Reference(BodySite)", "Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens.", 0, java.lang.Integer.MAX_VALUE, bodySite)); - } - - public SpecimenCollectionComponent copy() { - SpecimenCollectionComponent dst = new SpecimenCollectionComponent(); - copyValues(dst); - dst.collector = collector == null ? null : collector.copy(); - if (comment != null) { - dst.comment = new ArrayList(); - for (StringType i : comment) - dst.comment.add(i.copy()); - }; - dst.collected = collected == null ? null : collected.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.method = method == null ? null : method.copy(); - dst.bodySite = bodySite == null ? null : bodySite.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SpecimenCollectionComponent)) - return false; - SpecimenCollectionComponent o = (SpecimenCollectionComponent) other; - return compareDeep(collector, o.collector, true) && compareDeep(comment, o.comment, true) && compareDeep(collected, o.collected, true) - && compareDeep(quantity, o.quantity, true) && compareDeep(method, o.method, true) && compareDeep(bodySite, o.bodySite, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SpecimenCollectionComponent)) - return false; - SpecimenCollectionComponent o = (SpecimenCollectionComponent) other; - return compareValues(comment, o.comment, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (collector == null || collector.isEmpty()) && (comment == null || comment.isEmpty()) - && (collected == null || collected.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (method == null || method.isEmpty()) && (bodySite == null || bodySite.isEmpty()); - } - - } - - @Block() - public static class SpecimenTreatmentComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Textual description of procedure. - */ - @Child(name = "description", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Textual description of procedure", formalDefinition="Textual description of procedure." ) - protected StringType description; - - /** - * A coded value specifying the procedure used to process the specimen. - */ - @Child(name = "procedure", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Indicates the treatment or processing step applied to the specimen", formalDefinition="A coded value specifying the procedure used to process the specimen." ) - protected CodeableConcept procedure; - - /** - * Material used in the processing step. - */ - @Child(name = "additive", type = {Substance.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Material used in the processing step", formalDefinition="Material used in the processing step." ) - protected List additive; - /** - * The actual objects that are the target of the reference (Material used in the processing step.) - */ - protected List additiveTarget; - - - private static final long serialVersionUID = -373251521L; - - /* - * Constructor - */ - public SpecimenTreatmentComponent() { - super(); - } - - /** - * @return {@link #description} (Textual description of procedure.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenTreatmentComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Textual description of procedure.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public SpecimenTreatmentComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Textual description of procedure. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Textual description of procedure. - */ - public SpecimenTreatmentComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #procedure} (A coded value specifying the procedure used to process the specimen.) - */ - public CodeableConcept getProcedure() { - if (this.procedure == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenTreatmentComponent.procedure"); - else if (Configuration.doAutoCreate()) - this.procedure = new CodeableConcept(); // cc - return this.procedure; - } - - public boolean hasProcedure() { - return this.procedure != null && !this.procedure.isEmpty(); - } - - /** - * @param value {@link #procedure} (A coded value specifying the procedure used to process the specimen.) - */ - public SpecimenTreatmentComponent setProcedure(CodeableConcept value) { - this.procedure = value; - return this; - } - - /** - * @return {@link #additive} (Material used in the processing step.) - */ - public List getAdditive() { - if (this.additive == null) - this.additive = new ArrayList(); - return this.additive; - } - - public boolean hasAdditive() { - if (this.additive == null) - return false; - for (Reference item : this.additive) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #additive} (Material used in the processing step.) - */ - // syntactic sugar - public Reference addAdditive() { //3 - Reference t = new Reference(); - if (this.additive == null) - this.additive = new ArrayList(); - this.additive.add(t); - return t; - } - - // syntactic sugar - public SpecimenTreatmentComponent addAdditive(Reference t) { //3 - if (t == null) - return this; - if (this.additive == null) - this.additive = new ArrayList(); - this.additive.add(t); - return this; - } - - /** - * @return {@link #additive} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Material used in the processing step.) - */ - public List getAdditiveTarget() { - if (this.additiveTarget == null) - this.additiveTarget = new ArrayList(); - return this.additiveTarget; - } - - // syntactic sugar - /** - * @return {@link #additive} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Material used in the processing step.) - */ - public Substance addAdditiveTarget() { - Substance r = new Substance(); - if (this.additiveTarget == null) - this.additiveTarget = new ArrayList(); - this.additiveTarget.add(r); - return r; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("description", "string", "Textual description of procedure.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("procedure", "CodeableConcept", "A coded value specifying the procedure used to process the specimen.", 0, java.lang.Integer.MAX_VALUE, procedure)); - childrenList.add(new Property("additive", "Reference(Substance)", "Material used in the processing step.", 0, java.lang.Integer.MAX_VALUE, additive)); - } - - public SpecimenTreatmentComponent copy() { - SpecimenTreatmentComponent dst = new SpecimenTreatmentComponent(); - copyValues(dst); - dst.description = description == null ? null : description.copy(); - dst.procedure = procedure == null ? null : procedure.copy(); - if (additive != null) { - dst.additive = new ArrayList(); - for (Reference i : additive) - dst.additive.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SpecimenTreatmentComponent)) - return false; - SpecimenTreatmentComponent o = (SpecimenTreatmentComponent) other; - return compareDeep(description, o.description, true) && compareDeep(procedure, o.procedure, true) - && compareDeep(additive, o.additive, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SpecimenTreatmentComponent)) - return false; - SpecimenTreatmentComponent o = (SpecimenTreatmentComponent) other; - return compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (description == null || description.isEmpty()) && (procedure == null || procedure.isEmpty()) - && (additive == null || additive.isEmpty()); - } - - } - - @Block() - public static class SpecimenContainerComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Id for the container", formalDefinition="Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances." ) - protected List identifier; - - /** - * Textual description of the container. - */ - @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Textual description of the container", formalDefinition="Textual description of the container." ) - protected StringType description; - - /** - * The type of container associated with the specimen (e.g. slide, aliquot, etc). - */ - @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Kind of container directly associated with specimen", formalDefinition="The type of container associated with the specimen (e.g. slide, aliquot, etc)." ) - protected CodeableConcept type; - - /** - * The capacity (volume or other measure) the container may contain. - */ - @Child(name = "capacity", type = {Quantity.class}, order=4, min=0, max=1) - @Description(shortDefinition="Container volume or size", formalDefinition="The capacity (volume or other measure) the container may contain." ) - protected Quantity capacity; - - /** - * The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type. - */ - @Child(name = "specimenQuantity", type = {Quantity.class}, order=5, min=0, max=1) - @Description(shortDefinition="Quantity of specimen within container", formalDefinition="The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type." ) - protected Quantity specimenQuantity; - - /** - * Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA. - */ - @Child(name = "additive", type = {CodeableConcept.class, Substance.class}, order=6, min=0, max=1) - @Description(shortDefinition="Additive associated with container", formalDefinition="Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA." ) - protected Type additive; - - private static final long serialVersionUID = -1608132325L; - - /* - * Constructor - */ - public SpecimenContainerComponent() { - super(); - } - - /** - * @return {@link #identifier} (Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public SpecimenContainerComponent addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #description} (Textual description of the container.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenContainerComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Textual description of the container.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public SpecimenContainerComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Textual description of the container. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Textual description of the container. - */ - public SpecimenContainerComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The type of container associated with the specimen (e.g. slide, aliquot, etc).) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenContainerComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of container associated with the specimen (e.g. slide, aliquot, etc).) - */ - public SpecimenContainerComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #capacity} (The capacity (volume or other measure) the container may contain.) - */ - public Quantity getCapacity() { - if (this.capacity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenContainerComponent.capacity"); - else if (Configuration.doAutoCreate()) - this.capacity = new Quantity(); // cc - return this.capacity; - } - - public boolean hasCapacity() { - return this.capacity != null && !this.capacity.isEmpty(); - } - - /** - * @param value {@link #capacity} (The capacity (volume or other measure) the container may contain.) - */ - public SpecimenContainerComponent setCapacity(Quantity value) { - this.capacity = value; - return this; - } - - /** - * @return {@link #specimenQuantity} (The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.) - */ - public Quantity getSpecimenQuantity() { - if (this.specimenQuantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenContainerComponent.specimenQuantity"); - else if (Configuration.doAutoCreate()) - this.specimenQuantity = new Quantity(); // cc - return this.specimenQuantity; - } - - public boolean hasSpecimenQuantity() { - return this.specimenQuantity != null && !this.specimenQuantity.isEmpty(); - } - - /** - * @param value {@link #specimenQuantity} (The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.) - */ - public SpecimenContainerComponent setSpecimenQuantity(Quantity value) { - this.specimenQuantity = value; - return this; - } - - /** - * @return {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA.) - */ - public Type getAdditive() { - return this.additive; - } - - /** - * @return {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA.) - */ - public CodeableConcept getAdditiveCodeableConcept() throws Exception { - if (!(this.additive instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.additive.getClass().getName()+" was encountered"); - return (CodeableConcept) this.additive; - } - - /** - * @return {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA.) - */ - public Reference getAdditiveReference() throws Exception { - if (!(this.additive instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.additive.getClass().getName()+" was encountered"); - return (Reference) this.additive; - } - - public boolean hasAdditive() { - return this.additive != null && !this.additive.isEmpty(); - } - - /** - * @param value {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA.) - */ - public SpecimenContainerComponent setAdditive(Type value) { - this.additive = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("description", "string", "Textual description of the container.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("type", "CodeableConcept", "The type of container associated with the specimen (e.g. slide, aliquot, etc).", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("capacity", "Quantity", "The capacity (volume or other measure) the container may contain.", 0, java.lang.Integer.MAX_VALUE, capacity)); - childrenList.add(new Property("specimenQuantity", "Quantity", "The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.", 0, java.lang.Integer.MAX_VALUE, specimenQuantity)); - childrenList.add(new Property("additive[x]", "CodeableConcept|Reference(Substance)", "Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA.", 0, java.lang.Integer.MAX_VALUE, additive)); - } - - public SpecimenContainerComponent copy() { - SpecimenContainerComponent dst = new SpecimenContainerComponent(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - dst.type = type == null ? null : type.copy(); - dst.capacity = capacity == null ? null : capacity.copy(); - dst.specimenQuantity = specimenQuantity == null ? null : specimenQuantity.copy(); - dst.additive = additive == null ? null : additive.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SpecimenContainerComponent)) - return false; - SpecimenContainerComponent o = (SpecimenContainerComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(description, o.description, true) - && compareDeep(type, o.type, true) && compareDeep(capacity, o.capacity, true) && compareDeep(specimenQuantity, o.specimenQuantity, true) - && compareDeep(additive, o.additive, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SpecimenContainerComponent)) - return false; - SpecimenContainerComponent o = (SpecimenContainerComponent) other; - return compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (description == null || description.isEmpty()) - && (type == null || type.isEmpty()) && (capacity == null || capacity.isEmpty()) && (specimenQuantity == null || specimenQuantity.isEmpty()) - && (additive == null || additive.isEmpty()); - } - - } - - /** - * Id for specimen. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External Identifier", formalDefinition="Id for specimen." ) - protected List identifier; - - /** - * The kind of material that forms the specimen. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Kind of material that forms the specimen", formalDefinition="The kind of material that forms the specimen." ) - protected CodeableConcept type; - - /** - * Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of a another specimen. - */ - @Child(name = "parent", type = {Specimen.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Specimen from which this specimen originated", formalDefinition="Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of a another specimen." ) - protected List parent; - /** - * The actual objects that are the target of the reference (Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of a another specimen.) - */ - protected List parentTarget; - - - /** - * Where the specimen came from. This may be from the patient(s) or from the environment or a device. - */ - @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Substance.class}, order=3, min=1, max=1) - @Description(shortDefinition="Where the specimen came from. This may be from the patient(s) or from the environment or a device", formalDefinition="Where the specimen came from. This may be from the patient(s) or from the environment or a device." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Where the specimen came from. This may be from the patient(s) or from the environment or a device.) - */ - protected Resource subjectTarget; - - /** - * The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures. - */ - @Child(name = "accessionIdentifier", type = {Identifier.class}, order=4, min=0, max=1) - @Description(shortDefinition="Identifier assigned by the lab", formalDefinition="The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures." ) - protected Identifier accessionIdentifier; - - /** - * Time when specimen was received for processing or testing. - */ - @Child(name = "receivedTime", type = {DateTimeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="The time when specimen was received for processing", formalDefinition="Time when specimen was received for processing or testing." ) - protected DateTimeType receivedTime; - - /** - * Details concerning the specimen collection. - */ - @Child(name = "collection", type = {}, order=6, min=0, max=1) - @Description(shortDefinition="Collection details", formalDefinition="Details concerning the specimen collection." ) - protected SpecimenCollectionComponent collection; - - /** - * Details concerning treatment and processing steps for the specimen. - */ - @Child(name = "treatment", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Treatment and processing step details", formalDefinition="Details concerning treatment and processing steps for the specimen." ) - protected List treatment; - - /** - * The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here. - */ - @Child(name = "container", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Direct container of specimen (tube/slide, etc)", formalDefinition="The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here." ) - protected List container; - - private static final long serialVersionUID = -1070246507L; - - /* - * Constructor - */ - public Specimen() { - super(); - } - - /* - * Constructor - */ - public Specimen(Reference subject) { - super(); - this.subject = subject; - } - - /** - * @return {@link #identifier} (Id for specimen.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Id for specimen.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Specimen addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #type} (The kind of material that forms the specimen.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Specimen.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The kind of material that forms the specimen.) - */ - public Specimen setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #parent} (Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of a another specimen.) - */ - public List getParent() { - if (this.parent == null) - this.parent = new ArrayList(); - return this.parent; - } - - public boolean hasParent() { - if (this.parent == null) - return false; - for (Reference item : this.parent) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #parent} (Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of a another specimen.) - */ - // syntactic sugar - public Reference addParent() { //3 - Reference t = new Reference(); - if (this.parent == null) - this.parent = new ArrayList(); - this.parent.add(t); - return t; - } - - // syntactic sugar - public Specimen addParent(Reference t) { //3 - if (t == null) - return this; - if (this.parent == null) - this.parent = new ArrayList(); - this.parent.add(t); - return this; - } - - /** - * @return {@link #parent} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of a another specimen.) - */ - public List getParentTarget() { - if (this.parentTarget == null) - this.parentTarget = new ArrayList(); - return this.parentTarget; - } - - // syntactic sugar - /** - * @return {@link #parent} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of a another specimen.) - */ - public Specimen addParentTarget() { - Specimen r = new Specimen(); - if (this.parentTarget == null) - this.parentTarget = new ArrayList(); - this.parentTarget.add(r); - return r; - } - - /** - * @return {@link #subject} (Where the specimen came from. This may be from the patient(s) or from the environment or a device.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Specimen.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (Where the specimen came from. This may be from the patient(s) or from the environment or a device.) - */ - public Specimen setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Where the specimen came from. This may be from the patient(s) or from the environment or a device.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Where the specimen came from. This may be from the patient(s) or from the environment or a device.) - */ - public Specimen setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #accessionIdentifier} (The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures.) - */ - public Identifier getAccessionIdentifier() { - if (this.accessionIdentifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Specimen.accessionIdentifier"); - else if (Configuration.doAutoCreate()) - this.accessionIdentifier = new Identifier(); // cc - return this.accessionIdentifier; - } - - public boolean hasAccessionIdentifier() { - return this.accessionIdentifier != null && !this.accessionIdentifier.isEmpty(); - } - - /** - * @param value {@link #accessionIdentifier} (The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures.) - */ - public Specimen setAccessionIdentifier(Identifier value) { - this.accessionIdentifier = value; - return this; - } - - /** - * @return {@link #receivedTime} (Time when specimen was received for processing or testing.). This is the underlying object with id, value and extensions. The accessor "getReceivedTime" gives direct access to the value - */ - public DateTimeType getReceivedTimeElement() { - if (this.receivedTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Specimen.receivedTime"); - else if (Configuration.doAutoCreate()) - this.receivedTime = new DateTimeType(); // bb - return this.receivedTime; - } - - public boolean hasReceivedTimeElement() { - return this.receivedTime != null && !this.receivedTime.isEmpty(); - } - - public boolean hasReceivedTime() { - return this.receivedTime != null && !this.receivedTime.isEmpty(); - } - - /** - * @param value {@link #receivedTime} (Time when specimen was received for processing or testing.). This is the underlying object with id, value and extensions. The accessor "getReceivedTime" gives direct access to the value - */ - public Specimen setReceivedTimeElement(DateTimeType value) { - this.receivedTime = value; - return this; - } - - /** - * @return Time when specimen was received for processing or testing. - */ - public Date getReceivedTime() { - return this.receivedTime == null ? null : this.receivedTime.getValue(); - } - - /** - * @param value Time when specimen was received for processing or testing. - */ - public Specimen setReceivedTime(Date value) { - if (value == null) - this.receivedTime = null; - else { - if (this.receivedTime == null) - this.receivedTime = new DateTimeType(); - this.receivedTime.setValue(value); - } - return this; - } - - /** - * @return {@link #collection} (Details concerning the specimen collection.) - */ - public SpecimenCollectionComponent getCollection() { - if (this.collection == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Specimen.collection"); - else if (Configuration.doAutoCreate()) - this.collection = new SpecimenCollectionComponent(); // cc - return this.collection; - } - - public boolean hasCollection() { - return this.collection != null && !this.collection.isEmpty(); - } - - /** - * @param value {@link #collection} (Details concerning the specimen collection.) - */ - public Specimen setCollection(SpecimenCollectionComponent value) { - this.collection = value; - return this; - } - - /** - * @return {@link #treatment} (Details concerning treatment and processing steps for the specimen.) - */ - public List getTreatment() { - if (this.treatment == null) - this.treatment = new ArrayList(); - return this.treatment; - } - - public boolean hasTreatment() { - if (this.treatment == null) - return false; - for (SpecimenTreatmentComponent item : this.treatment) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #treatment} (Details concerning treatment and processing steps for the specimen.) - */ - // syntactic sugar - public SpecimenTreatmentComponent addTreatment() { //3 - SpecimenTreatmentComponent t = new SpecimenTreatmentComponent(); - if (this.treatment == null) - this.treatment = new ArrayList(); - this.treatment.add(t); - return t; - } - - // syntactic sugar - public Specimen addTreatment(SpecimenTreatmentComponent t) { //3 - if (t == null) - return this; - if (this.treatment == null) - this.treatment = new ArrayList(); - this.treatment.add(t); - return this; - } - - /** - * @return {@link #container} (The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.) - */ - public List getContainer() { - if (this.container == null) - this.container = new ArrayList(); - return this.container; - } - - public boolean hasContainer() { - if (this.container == null) - return false; - for (SpecimenContainerComponent item : this.container) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #container} (The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.) - */ - // syntactic sugar - public SpecimenContainerComponent addContainer() { //3 - SpecimenContainerComponent t = new SpecimenContainerComponent(); - if (this.container == null) - this.container = new ArrayList(); - this.container.add(t); - return t; - } - - // syntactic sugar - public Specimen addContainer(SpecimenContainerComponent t) { //3 - if (t == null) - return this; - if (this.container == null) - this.container = new ArrayList(); - this.container.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Id for specimen.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("type", "CodeableConcept", "The kind of material that forms the specimen.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("parent", "Reference(Specimen)", "Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of a another specimen.", 0, java.lang.Integer.MAX_VALUE, parent)); - childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Substance)", "Where the specimen came from. This may be from the patient(s) or from the environment or a device.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("accessionIdentifier", "Identifier", "The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures.", 0, java.lang.Integer.MAX_VALUE, accessionIdentifier)); - childrenList.add(new Property("receivedTime", "dateTime", "Time when specimen was received for processing or testing.", 0, java.lang.Integer.MAX_VALUE, receivedTime)); - childrenList.add(new Property("collection", "", "Details concerning the specimen collection.", 0, java.lang.Integer.MAX_VALUE, collection)); - childrenList.add(new Property("treatment", "", "Details concerning treatment and processing steps for the specimen.", 0, java.lang.Integer.MAX_VALUE, treatment)); - childrenList.add(new Property("container", "", "The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.", 0, java.lang.Integer.MAX_VALUE, container)); - } - - public Specimen copy() { - Specimen dst = new Specimen(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - if (parent != null) { - dst.parent = new ArrayList(); - for (Reference i : parent) - dst.parent.add(i.copy()); - }; - dst.subject = subject == null ? null : subject.copy(); - dst.accessionIdentifier = accessionIdentifier == null ? null : accessionIdentifier.copy(); - dst.receivedTime = receivedTime == null ? null : receivedTime.copy(); - dst.collection = collection == null ? null : collection.copy(); - if (treatment != null) { - dst.treatment = new ArrayList(); - for (SpecimenTreatmentComponent i : treatment) - dst.treatment.add(i.copy()); - }; - if (container != null) { - dst.container = new ArrayList(); - for (SpecimenContainerComponent i : container) - dst.container.add(i.copy()); - }; - return dst; - } - - protected Specimen typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Specimen)) - return false; - Specimen o = (Specimen) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(parent, o.parent, true) - && compareDeep(subject, o.subject, true) && compareDeep(accessionIdentifier, o.accessionIdentifier, true) - && compareDeep(receivedTime, o.receivedTime, true) && compareDeep(collection, o.collection, true) - && compareDeep(treatment, o.treatment, true) && compareDeep(container, o.container, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Specimen)) - return false; - Specimen o = (Specimen) other; - return compareValues(receivedTime, o.receivedTime, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) - && (parent == null || parent.isEmpty()) && (subject == null || subject.isEmpty()) && (accessionIdentifier == null || accessionIdentifier.isEmpty()) - && (receivedTime == null || receivedTime.isEmpty()) && (collection == null || collection.isEmpty()) - && (treatment == null || treatment.isEmpty()) && (container == null || container.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Specimen; - } - - @SearchParamDefinition(name="collector", path="Specimen.collection.collector", description="Who collected the specimen", type="reference" ) - public static final String SP_COLLECTOR = "collector"; - @SearchParamDefinition(name="patient", path="Specimen.subject", description="The patient the specimen comes from", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="site-code", path="Specimen.collection.bodySiteCodeableConcept", description="The code for the body site from where the specimen originated", type="token" ) - public static final String SP_SITECODE = "site-code"; - @SearchParamDefinition(name="container", path="Specimen.container.type", description="The kind of specimen container", type="token" ) - public static final String SP_CONTAINER = "container"; - @SearchParamDefinition(name="collected", path="Specimen.collection.collected[x]", description="The date the specimen was collected", type="date" ) - public static final String SP_COLLECTED = "collected"; - @SearchParamDefinition(name="subject", path="Specimen.subject", description="The subject of the specimen", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="containerid", path="Specimen.container.identifier", description="The unique identifier associated with the specimen container", type="token" ) - public static final String SP_CONTAINERID = "containerid"; - @SearchParamDefinition(name="site-reference", path="Specimen.collection.bodySiteReference", description="BodySite resource for the body site from where the specimen originated", type="reference" ) - public static final String SP_SITEREFERENCE = "site-reference"; - @SearchParamDefinition(name="accession", path="Specimen.accessionIdentifier", description="The accession number associated with the specimen", type="token" ) - public static final String SP_ACCESSION = "accession"; - @SearchParamDefinition(name="parent", path="Specimen.parent", description="The parent of the specimen", type="reference" ) - public static final String SP_PARENT = "parent"; - @SearchParamDefinition(name="type", path="Specimen.type", description="The specimen type", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="identifier", path="Specimen.identifier", description="The unique identifier associated with the specimen", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Sample for analysis. + */ +@ResourceDef(name="Specimen", profile="http://hl7.org/fhir/Profile/Specimen") +public class Specimen extends DomainResource { + + @Block() + public static class SpecimenCollectionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Person who collected the specimen. + */ + @Child(name = "collector", type = {Practitioner.class}, order=1, min=0, max=1) + @Description(shortDefinition="Who collected the specimen", formalDefinition="Person who collected the specimen." ) + protected Reference collector; + + /** + * The actual object that is the target of the reference (Person who collected the specimen.) + */ + protected Practitioner collectorTarget; + + /** + * To communicate any details or issues encountered during the specimen collection procedure. + */ + @Child(name = "comment", type = {StringType.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Collector comments", formalDefinition="To communicate any details or issues encountered during the specimen collection procedure." ) + protected List comment; + + /** + * Time when specimen was collected from subject - the physiologically relevant time. + */ + @Child(name = "collected", type = {DateTimeType.class, Period.class}, order=3, min=0, max=1) + @Description(shortDefinition="Collection time", formalDefinition="Time when specimen was collected from subject - the physiologically relevant time." ) + protected Type collected; + + /** + * The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample. + */ + @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="The quantity of specimen collected", formalDefinition="The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample." ) + protected Quantity quantity; + + /** + * A coded value specifying the technique that is used to perform the procedure. + */ + @Child(name = "method", type = {CodeableConcept.class}, order=5, min=0, max=1) + @Description(shortDefinition="Technique used to perform collection", formalDefinition="A coded value specifying the technique that is used to perform the procedure." ) + protected CodeableConcept method; + + /** + * Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens. + */ + @Child(name = "bodySite", type = {CodeableConcept.class, BodySite.class}, order=6, min=0, max=1) + @Description(shortDefinition="Anatomical collection site", formalDefinition="Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens." ) + protected Type bodySite; + + private static final long serialVersionUID = 2117268554L; + + /* + * Constructor + */ + public SpecimenCollectionComponent() { + super(); + } + + /** + * @return {@link #collector} (Person who collected the specimen.) + */ + public Reference getCollector() { + if (this.collector == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenCollectionComponent.collector"); + else if (Configuration.doAutoCreate()) + this.collector = new Reference(); // cc + return this.collector; + } + + public boolean hasCollector() { + return this.collector != null && !this.collector.isEmpty(); + } + + /** + * @param value {@link #collector} (Person who collected the specimen.) + */ + public SpecimenCollectionComponent setCollector(Reference value) { + this.collector = value; + return this; + } + + /** + * @return {@link #collector} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Person who collected the specimen.) + */ + public Practitioner getCollectorTarget() { + if (this.collectorTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenCollectionComponent.collector"); + else if (Configuration.doAutoCreate()) + this.collectorTarget = new Practitioner(); // aa + return this.collectorTarget; + } + + /** + * @param value {@link #collector} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Person who collected the specimen.) + */ + public SpecimenCollectionComponent setCollectorTarget(Practitioner value) { + this.collectorTarget = value; + return this; + } + + /** + * @return {@link #comment} (To communicate any details or issues encountered during the specimen collection procedure.) + */ + public List getComment() { + if (this.comment == null) + this.comment = new ArrayList(); + return this.comment; + } + + public boolean hasComment() { + if (this.comment == null) + return false; + for (StringType item : this.comment) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #comment} (To communicate any details or issues encountered during the specimen collection procedure.) + */ + // syntactic sugar + public StringType addCommentElement() {//2 + StringType t = new StringType(); + if (this.comment == null) + this.comment = new ArrayList(); + this.comment.add(t); + return t; + } + + /** + * @param value {@link #comment} (To communicate any details or issues encountered during the specimen collection procedure.) + */ + public SpecimenCollectionComponent addComment(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.comment == null) + this.comment = new ArrayList(); + this.comment.add(t); + return this; + } + + /** + * @param value {@link #comment} (To communicate any details or issues encountered during the specimen collection procedure.) + */ + public boolean hasComment(String value) { + if (this.comment == null) + return false; + for (StringType v : this.comment) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) + */ + public Type getCollected() { + return this.collected; + } + + /** + * @return {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) + */ + public DateTimeType getCollectedDateTimeType() throws Exception { + if (!(this.collected instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.collected.getClass().getName()+" was encountered"); + return (DateTimeType) this.collected; + } + + /** + * @return {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) + */ + public Period getCollectedPeriod() throws Exception { + if (!(this.collected instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.collected.getClass().getName()+" was encountered"); + return (Period) this.collected; + } + + public boolean hasCollected() { + return this.collected != null && !this.collected.isEmpty(); + } + + /** + * @param value {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) + */ + public SpecimenCollectionComponent setCollected(Type value) { + this.collected = value; + return this; + } + + /** + * @return {@link #quantity} (The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenCollectionComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.) + */ + public SpecimenCollectionComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #method} (A coded value specifying the technique that is used to perform the procedure.) + */ + public CodeableConcept getMethod() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenCollectionComponent.method"); + else if (Configuration.doAutoCreate()) + this.method = new CodeableConcept(); // cc + return this.method; + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** + * @param value {@link #method} (A coded value specifying the technique that is used to perform the procedure.) + */ + public SpecimenCollectionComponent setMethod(CodeableConcept value) { + this.method = value; + return this; + } + + /** + * @return {@link #bodySite} (Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens.) + */ + public Type getBodySite() { + return this.bodySite; + } + + /** + * @return {@link #bodySite} (Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens.) + */ + public CodeableConcept getBodySiteCodeableConcept() throws Exception { + if (!(this.bodySite instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.bodySite.getClass().getName()+" was encountered"); + return (CodeableConcept) this.bodySite; + } + + /** + * @return {@link #bodySite} (Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens.) + */ + public Reference getBodySiteReference() throws Exception { + if (!(this.bodySite instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.bodySite.getClass().getName()+" was encountered"); + return (Reference) this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens.) + */ + public SpecimenCollectionComponent setBodySite(Type value) { + this.bodySite = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("collector", "Reference(Practitioner)", "Person who collected the specimen.", 0, java.lang.Integer.MAX_VALUE, collector)); + childrenList.add(new Property("comment", "string", "To communicate any details or issues encountered during the specimen collection procedure.", 0, java.lang.Integer.MAX_VALUE, comment)); + childrenList.add(new Property("collected[x]", "dateTime|Period", "Time when specimen was collected from subject - the physiologically relevant time.", 0, java.lang.Integer.MAX_VALUE, collected)); + childrenList.add(new Property("quantity", "Quantity", "The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("method", "CodeableConcept", "A coded value specifying the technique that is used to perform the procedure.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("bodySite[x]", "CodeableConcept|Reference(BodySite)", "Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens.", 0, java.lang.Integer.MAX_VALUE, bodySite)); + } + + public SpecimenCollectionComponent copy() { + SpecimenCollectionComponent dst = new SpecimenCollectionComponent(); + copyValues(dst); + dst.collector = collector == null ? null : collector.copy(); + if (comment != null) { + dst.comment = new ArrayList(); + for (StringType i : comment) + dst.comment.add(i.copy()); + }; + dst.collected = collected == null ? null : collected.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.method = method == null ? null : method.copy(); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SpecimenCollectionComponent)) + return false; + SpecimenCollectionComponent o = (SpecimenCollectionComponent) other; + return compareDeep(collector, o.collector, true) && compareDeep(comment, o.comment, true) && compareDeep(collected, o.collected, true) + && compareDeep(quantity, o.quantity, true) && compareDeep(method, o.method, true) && compareDeep(bodySite, o.bodySite, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SpecimenCollectionComponent)) + return false; + SpecimenCollectionComponent o = (SpecimenCollectionComponent) other; + return compareValues(comment, o.comment, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (collector == null || collector.isEmpty()) && (comment == null || comment.isEmpty()) + && (collected == null || collected.isEmpty()) && (quantity == null || quantity.isEmpty()) + && (method == null || method.isEmpty()) && (bodySite == null || bodySite.isEmpty()); + } + + } + + @Block() + public static class SpecimenTreatmentComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Textual description of procedure. + */ + @Child(name = "description", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Textual description of procedure", formalDefinition="Textual description of procedure." ) + protected StringType description; + + /** + * A coded value specifying the procedure used to process the specimen. + */ + @Child(name = "procedure", type = {CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Indicates the treatment or processing step applied to the specimen", formalDefinition="A coded value specifying the procedure used to process the specimen." ) + protected CodeableConcept procedure; + + /** + * Material used in the processing step. + */ + @Child(name = "additive", type = {Substance.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Material used in the processing step", formalDefinition="Material used in the processing step." ) + protected List additive; + /** + * The actual objects that are the target of the reference (Material used in the processing step.) + */ + protected List additiveTarget; + + + private static final long serialVersionUID = -373251521L; + + /* + * Constructor + */ + public SpecimenTreatmentComponent() { + super(); + } + + /** + * @return {@link #description} (Textual description of procedure.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenTreatmentComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Textual description of procedure.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public SpecimenTreatmentComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Textual description of procedure. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Textual description of procedure. + */ + public SpecimenTreatmentComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #procedure} (A coded value specifying the procedure used to process the specimen.) + */ + public CodeableConcept getProcedure() { + if (this.procedure == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenTreatmentComponent.procedure"); + else if (Configuration.doAutoCreate()) + this.procedure = new CodeableConcept(); // cc + return this.procedure; + } + + public boolean hasProcedure() { + return this.procedure != null && !this.procedure.isEmpty(); + } + + /** + * @param value {@link #procedure} (A coded value specifying the procedure used to process the specimen.) + */ + public SpecimenTreatmentComponent setProcedure(CodeableConcept value) { + this.procedure = value; + return this; + } + + /** + * @return {@link #additive} (Material used in the processing step.) + */ + public List getAdditive() { + if (this.additive == null) + this.additive = new ArrayList(); + return this.additive; + } + + public boolean hasAdditive() { + if (this.additive == null) + return false; + for (Reference item : this.additive) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #additive} (Material used in the processing step.) + */ + // syntactic sugar + public Reference addAdditive() { //3 + Reference t = new Reference(); + if (this.additive == null) + this.additive = new ArrayList(); + this.additive.add(t); + return t; + } + + // syntactic sugar + public SpecimenTreatmentComponent addAdditive(Reference t) { //3 + if (t == null) + return this; + if (this.additive == null) + this.additive = new ArrayList(); + this.additive.add(t); + return this; + } + + /** + * @return {@link #additive} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Material used in the processing step.) + */ + public List getAdditiveTarget() { + if (this.additiveTarget == null) + this.additiveTarget = new ArrayList(); + return this.additiveTarget; + } + + // syntactic sugar + /** + * @return {@link #additive} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Material used in the processing step.) + */ + public Substance addAdditiveTarget() { + Substance r = new Substance(); + if (this.additiveTarget == null) + this.additiveTarget = new ArrayList(); + this.additiveTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("description", "string", "Textual description of procedure.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("procedure", "CodeableConcept", "A coded value specifying the procedure used to process the specimen.", 0, java.lang.Integer.MAX_VALUE, procedure)); + childrenList.add(new Property("additive", "Reference(Substance)", "Material used in the processing step.", 0, java.lang.Integer.MAX_VALUE, additive)); + } + + public SpecimenTreatmentComponent copy() { + SpecimenTreatmentComponent dst = new SpecimenTreatmentComponent(); + copyValues(dst); + dst.description = description == null ? null : description.copy(); + dst.procedure = procedure == null ? null : procedure.copy(); + if (additive != null) { + dst.additive = new ArrayList(); + for (Reference i : additive) + dst.additive.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SpecimenTreatmentComponent)) + return false; + SpecimenTreatmentComponent o = (SpecimenTreatmentComponent) other; + return compareDeep(description, o.description, true) && compareDeep(procedure, o.procedure, true) + && compareDeep(additive, o.additive, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SpecimenTreatmentComponent)) + return false; + SpecimenTreatmentComponent o = (SpecimenTreatmentComponent) other; + return compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (description == null || description.isEmpty()) && (procedure == null || procedure.isEmpty()) + && (additive == null || additive.isEmpty()); + } + + } + + @Block() + public static class SpecimenContainerComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Id for the container", formalDefinition="Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances." ) + protected List identifier; + + /** + * Textual description of the container. + */ + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Textual description of the container", formalDefinition="Textual description of the container." ) + protected StringType description; + + /** + * The type of container associated with the specimen (e.g. slide, aliquot, etc). + */ + @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Kind of container directly associated with specimen", formalDefinition="The type of container associated with the specimen (e.g. slide, aliquot, etc)." ) + protected CodeableConcept type; + + /** + * The capacity (volume or other measure) the container may contain. + */ + @Child(name = "capacity", type = {Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Container volume or size", formalDefinition="The capacity (volume or other measure) the container may contain." ) + protected Quantity capacity; + + /** + * The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type. + */ + @Child(name = "specimenQuantity", type = {Quantity.class}, order=5, min=0, max=1) + @Description(shortDefinition="Quantity of specimen within container", formalDefinition="The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type." ) + protected Quantity specimenQuantity; + + /** + * Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA. + */ + @Child(name = "additive", type = {CodeableConcept.class, Substance.class}, order=6, min=0, max=1) + @Description(shortDefinition="Additive associated with container", formalDefinition="Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA." ) + protected Type additive; + + private static final long serialVersionUID = -1608132325L; + + /* + * Constructor + */ + public SpecimenContainerComponent() { + super(); + } + + /** + * @return {@link #identifier} (Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public SpecimenContainerComponent addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #description} (Textual description of the container.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenContainerComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Textual description of the container.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public SpecimenContainerComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Textual description of the container. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Textual description of the container. + */ + public SpecimenContainerComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (The type of container associated with the specimen (e.g. slide, aliquot, etc).) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenContainerComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of container associated with the specimen (e.g. slide, aliquot, etc).) + */ + public SpecimenContainerComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #capacity} (The capacity (volume or other measure) the container may contain.) + */ + public Quantity getCapacity() { + if (this.capacity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenContainerComponent.capacity"); + else if (Configuration.doAutoCreate()) + this.capacity = new Quantity(); // cc + return this.capacity; + } + + public boolean hasCapacity() { + return this.capacity != null && !this.capacity.isEmpty(); + } + + /** + * @param value {@link #capacity} (The capacity (volume or other measure) the container may contain.) + */ + public SpecimenContainerComponent setCapacity(Quantity value) { + this.capacity = value; + return this; + } + + /** + * @return {@link #specimenQuantity} (The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.) + */ + public Quantity getSpecimenQuantity() { + if (this.specimenQuantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenContainerComponent.specimenQuantity"); + else if (Configuration.doAutoCreate()) + this.specimenQuantity = new Quantity(); // cc + return this.specimenQuantity; + } + + public boolean hasSpecimenQuantity() { + return this.specimenQuantity != null && !this.specimenQuantity.isEmpty(); + } + + /** + * @param value {@link #specimenQuantity} (The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.) + */ + public SpecimenContainerComponent setSpecimenQuantity(Quantity value) { + this.specimenQuantity = value; + return this; + } + + /** + * @return {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA.) + */ + public Type getAdditive() { + return this.additive; + } + + /** + * @return {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA.) + */ + public CodeableConcept getAdditiveCodeableConcept() throws Exception { + if (!(this.additive instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.additive.getClass().getName()+" was encountered"); + return (CodeableConcept) this.additive; + } + + /** + * @return {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA.) + */ + public Reference getAdditiveReference() throws Exception { + if (!(this.additive instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.additive.getClass().getName()+" was encountered"); + return (Reference) this.additive; + } + + public boolean hasAdditive() { + return this.additive != null && !this.additive.isEmpty(); + } + + /** + * @param value {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA.) + */ + public SpecimenContainerComponent setAdditive(Type value) { + this.additive = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("description", "string", "Textual description of the container.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("type", "CodeableConcept", "The type of container associated with the specimen (e.g. slide, aliquot, etc).", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("capacity", "Quantity", "The capacity (volume or other measure) the container may contain.", 0, java.lang.Integer.MAX_VALUE, capacity)); + childrenList.add(new Property("specimenQuantity", "Quantity", "The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.", 0, java.lang.Integer.MAX_VALUE, specimenQuantity)); + childrenList.add(new Property("additive[x]", "CodeableConcept|Reference(Substance)", "Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA.", 0, java.lang.Integer.MAX_VALUE, additive)); + } + + public SpecimenContainerComponent copy() { + SpecimenContainerComponent dst = new SpecimenContainerComponent(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + dst.type = type == null ? null : type.copy(); + dst.capacity = capacity == null ? null : capacity.copy(); + dst.specimenQuantity = specimenQuantity == null ? null : specimenQuantity.copy(); + dst.additive = additive == null ? null : additive.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SpecimenContainerComponent)) + return false; + SpecimenContainerComponent o = (SpecimenContainerComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(description, o.description, true) + && compareDeep(type, o.type, true) && compareDeep(capacity, o.capacity, true) && compareDeep(specimenQuantity, o.specimenQuantity, true) + && compareDeep(additive, o.additive, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SpecimenContainerComponent)) + return false; + SpecimenContainerComponent o = (SpecimenContainerComponent) other; + return compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (description == null || description.isEmpty()) + && (type == null || type.isEmpty()) && (capacity == null || capacity.isEmpty()) && (specimenQuantity == null || specimenQuantity.isEmpty()) + && (additive == null || additive.isEmpty()); + } + + } + + /** + * Id for specimen. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Identifier", formalDefinition="Id for specimen." ) + protected List identifier; + + /** + * The kind of material that forms the specimen. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Kind of material that forms the specimen", formalDefinition="The kind of material that forms the specimen." ) + protected CodeableConcept type; + + /** + * Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of a another specimen. + */ + @Child(name = "parent", type = {Specimen.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Specimen from which this specimen originated", formalDefinition="Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of a another specimen." ) + protected List parent; + /** + * The actual objects that are the target of the reference (Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of a another specimen.) + */ + protected List parentTarget; + + + /** + * Where the specimen came from. This may be from the patient(s) or from the environment or a device. + */ + @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Substance.class}, order=3, min=1, max=1) + @Description(shortDefinition="Where the specimen came from. This may be from the patient(s) or from the environment or a device", formalDefinition="Where the specimen came from. This may be from the patient(s) or from the environment or a device." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Where the specimen came from. This may be from the patient(s) or from the environment or a device.) + */ + protected Resource subjectTarget; + + /** + * The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures. + */ + @Child(name = "accessionIdentifier", type = {Identifier.class}, order=4, min=0, max=1) + @Description(shortDefinition="Identifier assigned by the lab", formalDefinition="The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures." ) + protected Identifier accessionIdentifier; + + /** + * Time when specimen was received for processing or testing. + */ + @Child(name = "receivedTime", type = {DateTimeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="The time when specimen was received for processing", formalDefinition="Time when specimen was received for processing or testing." ) + protected DateTimeType receivedTime; + + /** + * Details concerning the specimen collection. + */ + @Child(name = "collection", type = {}, order=6, min=0, max=1) + @Description(shortDefinition="Collection details", formalDefinition="Details concerning the specimen collection." ) + protected SpecimenCollectionComponent collection; + + /** + * Details concerning treatment and processing steps for the specimen. + */ + @Child(name = "treatment", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Treatment and processing step details", formalDefinition="Details concerning treatment and processing steps for the specimen." ) + protected List treatment; + + /** + * The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here. + */ + @Child(name = "container", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Direct container of specimen (tube/slide, etc)", formalDefinition="The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here." ) + protected List container; + + private static final long serialVersionUID = -1070246507L; + + /* + * Constructor + */ + public Specimen() { + super(); + } + + /* + * Constructor + */ + public Specimen(Reference subject) { + super(); + this.subject = subject; + } + + /** + * @return {@link #identifier} (Id for specimen.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Id for specimen.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Specimen addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #type} (The kind of material that forms the specimen.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Specimen.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The kind of material that forms the specimen.) + */ + public Specimen setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #parent} (Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of a another specimen.) + */ + public List getParent() { + if (this.parent == null) + this.parent = new ArrayList(); + return this.parent; + } + + public boolean hasParent() { + if (this.parent == null) + return false; + for (Reference item : this.parent) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #parent} (Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of a another specimen.) + */ + // syntactic sugar + public Reference addParent() { //3 + Reference t = new Reference(); + if (this.parent == null) + this.parent = new ArrayList(); + this.parent.add(t); + return t; + } + + // syntactic sugar + public Specimen addParent(Reference t) { //3 + if (t == null) + return this; + if (this.parent == null) + this.parent = new ArrayList(); + this.parent.add(t); + return this; + } + + /** + * @return {@link #parent} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of a another specimen.) + */ + public List getParentTarget() { + if (this.parentTarget == null) + this.parentTarget = new ArrayList(); + return this.parentTarget; + } + + // syntactic sugar + /** + * @return {@link #parent} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of a another specimen.) + */ + public Specimen addParentTarget() { + Specimen r = new Specimen(); + if (this.parentTarget == null) + this.parentTarget = new ArrayList(); + this.parentTarget.add(r); + return r; + } + + /** + * @return {@link #subject} (Where the specimen came from. This may be from the patient(s) or from the environment or a device.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Specimen.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Where the specimen came from. This may be from the patient(s) or from the environment or a device.) + */ + public Specimen setSubject(Reference value) { + this.subject = value; + return this; + } + + /** + * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Where the specimen came from. This may be from the patient(s) or from the environment or a device.) + */ + public Resource getSubjectTarget() { + return this.subjectTarget; + } + + /** + * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Where the specimen came from. This may be from the patient(s) or from the environment or a device.) + */ + public Specimen setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #accessionIdentifier} (The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures.) + */ + public Identifier getAccessionIdentifier() { + if (this.accessionIdentifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Specimen.accessionIdentifier"); + else if (Configuration.doAutoCreate()) + this.accessionIdentifier = new Identifier(); // cc + return this.accessionIdentifier; + } + + public boolean hasAccessionIdentifier() { + return this.accessionIdentifier != null && !this.accessionIdentifier.isEmpty(); + } + + /** + * @param value {@link #accessionIdentifier} (The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures.) + */ + public Specimen setAccessionIdentifier(Identifier value) { + this.accessionIdentifier = value; + return this; + } + + /** + * @return {@link #receivedTime} (Time when specimen was received for processing or testing.). This is the underlying object with id, value and extensions. The accessor "getReceivedTime" gives direct access to the value + */ + public DateTimeType getReceivedTimeElement() { + if (this.receivedTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Specimen.receivedTime"); + else if (Configuration.doAutoCreate()) + this.receivedTime = new DateTimeType(); // bb + return this.receivedTime; + } + + public boolean hasReceivedTimeElement() { + return this.receivedTime != null && !this.receivedTime.isEmpty(); + } + + public boolean hasReceivedTime() { + return this.receivedTime != null && !this.receivedTime.isEmpty(); + } + + /** + * @param value {@link #receivedTime} (Time when specimen was received for processing or testing.). This is the underlying object with id, value and extensions. The accessor "getReceivedTime" gives direct access to the value + */ + public Specimen setReceivedTimeElement(DateTimeType value) { + this.receivedTime = value; + return this; + } + + /** + * @return Time when specimen was received for processing or testing. + */ + public Date getReceivedTime() { + return this.receivedTime == null ? null : this.receivedTime.getValue(); + } + + /** + * @param value Time when specimen was received for processing or testing. + */ + public Specimen setReceivedTime(Date value) { + if (value == null) + this.receivedTime = null; + else { + if (this.receivedTime == null) + this.receivedTime = new DateTimeType(); + this.receivedTime.setValue(value); + } + return this; + } + + /** + * @return {@link #collection} (Details concerning the specimen collection.) + */ + public SpecimenCollectionComponent getCollection() { + if (this.collection == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Specimen.collection"); + else if (Configuration.doAutoCreate()) + this.collection = new SpecimenCollectionComponent(); // cc + return this.collection; + } + + public boolean hasCollection() { + return this.collection != null && !this.collection.isEmpty(); + } + + /** + * @param value {@link #collection} (Details concerning the specimen collection.) + */ + public Specimen setCollection(SpecimenCollectionComponent value) { + this.collection = value; + return this; + } + + /** + * @return {@link #treatment} (Details concerning treatment and processing steps for the specimen.) + */ + public List getTreatment() { + if (this.treatment == null) + this.treatment = new ArrayList(); + return this.treatment; + } + + public boolean hasTreatment() { + if (this.treatment == null) + return false; + for (SpecimenTreatmentComponent item : this.treatment) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #treatment} (Details concerning treatment and processing steps for the specimen.) + */ + // syntactic sugar + public SpecimenTreatmentComponent addTreatment() { //3 + SpecimenTreatmentComponent t = new SpecimenTreatmentComponent(); + if (this.treatment == null) + this.treatment = new ArrayList(); + this.treatment.add(t); + return t; + } + + // syntactic sugar + public Specimen addTreatment(SpecimenTreatmentComponent t) { //3 + if (t == null) + return this; + if (this.treatment == null) + this.treatment = new ArrayList(); + this.treatment.add(t); + return this; + } + + /** + * @return {@link #container} (The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.) + */ + public List getContainer() { + if (this.container == null) + this.container = new ArrayList(); + return this.container; + } + + public boolean hasContainer() { + if (this.container == null) + return false; + for (SpecimenContainerComponent item : this.container) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #container} (The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.) + */ + // syntactic sugar + public SpecimenContainerComponent addContainer() { //3 + SpecimenContainerComponent t = new SpecimenContainerComponent(); + if (this.container == null) + this.container = new ArrayList(); + this.container.add(t); + return t; + } + + // syntactic sugar + public Specimen addContainer(SpecimenContainerComponent t) { //3 + if (t == null) + return this; + if (this.container == null) + this.container = new ArrayList(); + this.container.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Id for specimen.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("type", "CodeableConcept", "The kind of material that forms the specimen.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("parent", "Reference(Specimen)", "Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of a another specimen.", 0, java.lang.Integer.MAX_VALUE, parent)); + childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Substance)", "Where the specimen came from. This may be from the patient(s) or from the environment or a device.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("accessionIdentifier", "Identifier", "The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures.", 0, java.lang.Integer.MAX_VALUE, accessionIdentifier)); + childrenList.add(new Property("receivedTime", "dateTime", "Time when specimen was received for processing or testing.", 0, java.lang.Integer.MAX_VALUE, receivedTime)); + childrenList.add(new Property("collection", "", "Details concerning the specimen collection.", 0, java.lang.Integer.MAX_VALUE, collection)); + childrenList.add(new Property("treatment", "", "Details concerning treatment and processing steps for the specimen.", 0, java.lang.Integer.MAX_VALUE, treatment)); + childrenList.add(new Property("container", "", "The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.", 0, java.lang.Integer.MAX_VALUE, container)); + } + + public Specimen copy() { + Specimen dst = new Specimen(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + if (parent != null) { + dst.parent = new ArrayList(); + for (Reference i : parent) + dst.parent.add(i.copy()); + }; + dst.subject = subject == null ? null : subject.copy(); + dst.accessionIdentifier = accessionIdentifier == null ? null : accessionIdentifier.copy(); + dst.receivedTime = receivedTime == null ? null : receivedTime.copy(); + dst.collection = collection == null ? null : collection.copy(); + if (treatment != null) { + dst.treatment = new ArrayList(); + for (SpecimenTreatmentComponent i : treatment) + dst.treatment.add(i.copy()); + }; + if (container != null) { + dst.container = new ArrayList(); + for (SpecimenContainerComponent i : container) + dst.container.add(i.copy()); + }; + return dst; + } + + protected Specimen typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Specimen)) + return false; + Specimen o = (Specimen) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(parent, o.parent, true) + && compareDeep(subject, o.subject, true) && compareDeep(accessionIdentifier, o.accessionIdentifier, true) + && compareDeep(receivedTime, o.receivedTime, true) && compareDeep(collection, o.collection, true) + && compareDeep(treatment, o.treatment, true) && compareDeep(container, o.container, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Specimen)) + return false; + Specimen o = (Specimen) other; + return compareValues(receivedTime, o.receivedTime, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) + && (parent == null || parent.isEmpty()) && (subject == null || subject.isEmpty()) && (accessionIdentifier == null || accessionIdentifier.isEmpty()) + && (receivedTime == null || receivedTime.isEmpty()) && (collection == null || collection.isEmpty()) + && (treatment == null || treatment.isEmpty()) && (container == null || container.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Specimen; + } + + @SearchParamDefinition(name="container", path="Specimen.container.type", description="The kind of specimen container", type="token" ) + public static final String SP_CONTAINER = "container"; + @SearchParamDefinition(name="identifier", path="Specimen.identifier", description="The unique identifier associated with the specimen", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="parent", path="Specimen.parent", description="The parent of the specimen", type="reference" ) + public static final String SP_PARENT = "parent"; + @SearchParamDefinition(name="subject", path="Specimen.subject", description="The subject of the specimen", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="patient", path="Specimen.subject", description="The patient the specimen comes from", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="site-reference", path="Specimen.collection.bodySiteReference", description="BodySite resource for the body site from where the specimen originated", type="reference" ) + public static final String SP_SITEREFERENCE = "site-reference"; + @SearchParamDefinition(name="collected", path="Specimen.collection.collected[x]", description="The date the specimen was collected", type="date" ) + public static final String SP_COLLECTED = "collected"; + @SearchParamDefinition(name="accession", path="Specimen.accessionIdentifier", description="The accession number associated with the specimen", type="token" ) + public static final String SP_ACCESSION = "accession"; + @SearchParamDefinition(name="type", path="Specimen.type", description="The specimen type", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="containerid", path="Specimen.container.identifier", description="The unique identifier associated with the specimen container", type="token" ) + public static final String SP_CONTAINERID = "containerid"; + @SearchParamDefinition(name="site-code", path="Specimen.collection.bodySiteCodeableConcept", description="The code for the body site from where the specimen originated", type="token" ) + public static final String SP_SITECODE = "site-code"; + @SearchParamDefinition(name="collector", path="Specimen.collection.collector", description="Who collected the specimen", type="reference" ) + public static final String SP_COLLECTOR = "collector"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/StringType.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/StringType.java index a972093935d..80fb4ade02f 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/StringType.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/StringType.java @@ -1,111 +1,90 @@ -/* -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; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import org.apache.commons.lang3.StringUtils; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; - - -/** - * Primitive type "string" in FHIR - any sequence of unicode characters less than 1MB in length - */ -@DatatypeDef(name = "string") -public class StringType extends PrimitiveType { - - private static final long serialVersionUID = 3L; - - /** - * Create a new String - */ - public StringType() { - super(); - } - - /** - * Create a new String - */ - public StringType(String theValue) { - setValue(theValue); - } - - /** - * Returns the value of this StringType, or an empty string ("") if the - * value is null. This method is provided as a convenience to - * users of this API. - */ - public String getValueNotNull() { - return StringUtils.defaultString(getValue()); - } - - /** - * Returns the value of this string, or null if no value - * is present - */ - @Override - public String toString() { - return getValue(); - } - - @Override - protected String parse(String theValue) { - return theValue; - } - - @Override - protected String encode(String theValue) { - return theValue; - } - - @Override - public StringType copy() { - return new StringType(getValue()); - } - -} +/* +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; + +import org.apache.commons.lang3.StringUtils; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; + + +/** + * Primitive type "string" in FHIR - any sequence of unicode characters less than 1MB in length + */ +@DatatypeDef(name = "string") +public class StringType extends PrimitiveType { + + private static final long serialVersionUID = 3L; + + /** + * Create a new String + */ + public StringType() { + super(); + } + + /** + * Create a new String + */ + public StringType(String theValue) { + setValue(theValue); + } + + /** + * Returns the value of this StringType, or an empty string ("") if the + * value is null. This method is provided as a convenience to + * users of this API. + */ + public String getValueNotNull() { + return StringUtils.defaultString(getValue()); + } + + /** + * Returns the value of this string, or null if no value + * is present + */ + @Override + public String toString() { + return getValue(); + } + + @Override + protected String parse(String theValue) { + return theValue; + } + + @Override + protected String encode(String theValue) { + return theValue; + } + + @Override + public StringType copy() { + return new StringType(getValue()); + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/StructureDefinition.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/StructureDefinition.java index 4fe52892baa..3c6999dfcc5 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/StructureDefinition.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/StructureDefinition.java @@ -1,2345 +1,2324 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import java.util.*; - -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.instance.model.Enumerations.*; -import org.hl7.fhir.instance.model.annotations.ResourceDef; -import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; -import org.hl7.fhir.instance.model.annotations.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types. - */ -@ResourceDef(name="StructureDefinition", profile="http://hl7.org/fhir/Profile/StructureDefinition") -public class StructureDefinition extends DomainResource { - - public enum StructureDefinitionType { - /** - * A data type - either a primitive or complex structure that defines a set of data elements. These can be used throughout Resource and extension definitions. - */ - TYPE, - /** - * A resource defined by the FHIR specification. - */ - RESOURCE, - /** - * A set of constraints on a resource or data type that describe how it is used for a particular use. - */ - CONSTRAINT, - /** - * A definition of an extension that can be used in a FHIR resource (or a set of constraints on an exsting extension). - */ - EXTENSION, - /** - * added to help the parsers - */ - NULL; - public static StructureDefinitionType fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("type".equals(codeString)) - return TYPE; - if ("resource".equals(codeString)) - return RESOURCE; - if ("constraint".equals(codeString)) - return CONSTRAINT; - if ("extension".equals(codeString)) - return EXTENSION; - throw new Exception("Unknown StructureDefinitionType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case TYPE: return "type"; - case RESOURCE: return "resource"; - case CONSTRAINT: return "constraint"; - case EXTENSION: return "extension"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case TYPE: return ""; - case RESOURCE: return ""; - case CONSTRAINT: return ""; - case EXTENSION: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case TYPE: return "A data type - either a primitive or complex structure that defines a set of data elements. These can be used throughout Resource and extension definitions."; - case RESOURCE: return "A resource defined by the FHIR specification."; - case CONSTRAINT: return "A set of constraints on a resource or data type that describe how it is used for a particular use."; - case EXTENSION: return "A definition of an extension that can be used in a FHIR resource (or a set of constraints on an exsting extension)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case TYPE: return "Data Type"; - case RESOURCE: return "Resource"; - case CONSTRAINT: return "Constrained Type"; - case EXTENSION: return "Extension Definition"; - default: return "?"; - } - } - } - - public static class StructureDefinitionTypeEnumFactory implements EnumFactory { - public StructureDefinitionType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("type".equals(codeString)) - return StructureDefinitionType.TYPE; - if ("resource".equals(codeString)) - return StructureDefinitionType.RESOURCE; - if ("constraint".equals(codeString)) - return StructureDefinitionType.CONSTRAINT; - if ("extension".equals(codeString)) - return StructureDefinitionType.EXTENSION; - throw new IllegalArgumentException("Unknown StructureDefinitionType code '"+codeString+"'"); - } - public String toCode(StructureDefinitionType code) { - if (code == StructureDefinitionType.TYPE) - return "type"; - if (code == StructureDefinitionType.RESOURCE) - return "resource"; - if (code == StructureDefinitionType.CONSTRAINT) - return "constraint"; - if (code == StructureDefinitionType.EXTENSION) - return "extension"; - return "?"; - } - } - - public enum ExtensionContext { - /** - * The context is all elements matching a particular resource element path. - */ - RESOURCE, - /** - * The context is all nodes matching a particular data type element path (root or repeating element) or all elements referencing a particular primitive data type (expressed as the datatype name). - */ - DATATYPE, - /** - * The context is all nodes whose mapping to a specified reference model corresponds to a particular mapping structure. The context identifies the mapping target. The mapping should clearly identify where such an extension could be used. - */ - MAPPING, - /** - * The context is a particular extension from a particular profile. Expressed as uri#name, where uri identifies the profile and #name identifies the extension code. - */ - EXTENSION, - /** - * added to help the parsers - */ - NULL; - public static ExtensionContext fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("resource".equals(codeString)) - return RESOURCE; - if ("datatype".equals(codeString)) - return DATATYPE; - if ("mapping".equals(codeString)) - return MAPPING; - if ("extension".equals(codeString)) - return EXTENSION; - throw new Exception("Unknown ExtensionContext code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case RESOURCE: return "resource"; - case DATATYPE: return "datatype"; - case MAPPING: return "mapping"; - case EXTENSION: return "extension"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case RESOURCE: return ""; - case DATATYPE: return ""; - case MAPPING: return ""; - case EXTENSION: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case RESOURCE: return "The context is all elements matching a particular resource element path."; - case DATATYPE: return "The context is all nodes matching a particular data type element path (root or repeating element) or all elements referencing a particular primitive data type (expressed as the datatype name)."; - case MAPPING: return "The context is all nodes whose mapping to a specified reference model corresponds to a particular mapping structure. The context identifies the mapping target. The mapping should clearly identify where such an extension could be used."; - case EXTENSION: return "The context is a particular extension from a particular profile. Expressed as uri#name, where uri identifies the profile and #name identifies the extension code."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case RESOURCE: return "Resource"; - case DATATYPE: return "Datatype"; - case MAPPING: return "Mapping"; - case EXTENSION: return "Extension"; - default: return "?"; - } - } - } - - public static class ExtensionContextEnumFactory implements EnumFactory { - public ExtensionContext fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("resource".equals(codeString)) - return ExtensionContext.RESOURCE; - if ("datatype".equals(codeString)) - return ExtensionContext.DATATYPE; - if ("mapping".equals(codeString)) - return ExtensionContext.MAPPING; - if ("extension".equals(codeString)) - return ExtensionContext.EXTENSION; - throw new IllegalArgumentException("Unknown ExtensionContext code '"+codeString+"'"); - } - public String toCode(ExtensionContext code) { - if (code == ExtensionContext.RESOURCE) - return "resource"; - if (code == ExtensionContext.DATATYPE) - return "datatype"; - if (code == ExtensionContext.MAPPING) - return "mapping"; - if (code == ExtensionContext.EXTENSION) - return "extension"; - return "?"; - } - } - - @Block() - public static class StructureDefinitionContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the structure definition. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Name of a individual to contact", formalDefinition="The name of an individual to contact regarding the structure definition." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /* - * Constructor - */ - public StructureDefinitionContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the structure definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinitionContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the structure definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StructureDefinitionContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the structure definition. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the structure definition. - */ - public StructureDefinitionContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public StructureDefinitionContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the structure definition.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - public StructureDefinitionContactComponent copy() { - StructureDefinitionContactComponent dst = new StructureDefinitionContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StructureDefinitionContactComponent)) - return false; - StructureDefinitionContactComponent o = (StructureDefinitionContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StructureDefinitionContactComponent)) - return false; - StructureDefinitionContactComponent o = (StructureDefinitionContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - } - - @Block() - public static class StructureDefinitionMappingComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An Internal id that is used to identify this mapping set when specific mappings are made. - */ - @Child(name = "identity", type = {IdType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Internal id when this mapping is used", formalDefinition="An Internal id that is used to identify this mapping set when specific mappings are made." ) - protected IdType identity; - - /** - * An absolute URI that identifies the specification that this mapping is expressed to. - */ - @Child(name = "uri", type = {UriType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Identifies what this mapping refers to", formalDefinition="An absolute URI that identifies the specification that this mapping is expressed to." ) - protected UriType uri; - - /** - * A name for the specification that is being mapped to. - */ - @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Names what this mapping refers to", formalDefinition="A name for the specification that is being mapped to." ) - protected StringType name; - - /** - * Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. - */ - @Child(name = "comments", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Versions, Issues, Scope limitations etc", formalDefinition="Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage." ) - protected StringType comments; - - private static final long serialVersionUID = 299630820L; - - /* - * Constructor - */ - public StructureDefinitionMappingComponent() { - super(); - } - - /* - * Constructor - */ - public StructureDefinitionMappingComponent(IdType identity) { - super(); - this.identity = identity; - } - - /** - * @return {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value - */ - public IdType getIdentityElement() { - if (this.identity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinitionMappingComponent.identity"); - else if (Configuration.doAutoCreate()) - this.identity = new IdType(); // bb - return this.identity; - } - - public boolean hasIdentityElement() { - return this.identity != null && !this.identity.isEmpty(); - } - - public boolean hasIdentity() { - return this.identity != null && !this.identity.isEmpty(); - } - - /** - * @param value {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value - */ - public StructureDefinitionMappingComponent setIdentityElement(IdType value) { - this.identity = value; - return this; - } - - /** - * @return An Internal id that is used to identify this mapping set when specific mappings are made. - */ - public String getIdentity() { - return this.identity == null ? null : this.identity.getValue(); - } - - /** - * @param value An Internal id that is used to identify this mapping set when specific mappings are made. - */ - public StructureDefinitionMappingComponent setIdentity(String value) { - if (this.identity == null) - this.identity = new IdType(); - this.identity.setValue(value); - return this; - } - - /** - * @return {@link #uri} (An absolute URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value - */ - public UriType getUriElement() { - if (this.uri == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinitionMappingComponent.uri"); - else if (Configuration.doAutoCreate()) - this.uri = new UriType(); // bb - return this.uri; - } - - public boolean hasUriElement() { - return this.uri != null && !this.uri.isEmpty(); - } - - public boolean hasUri() { - return this.uri != null && !this.uri.isEmpty(); - } - - /** - * @param value {@link #uri} (An absolute URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value - */ - public StructureDefinitionMappingComponent setUriElement(UriType value) { - this.uri = value; - return this; - } - - /** - * @return An absolute URI that identifies the specification that this mapping is expressed to. - */ - public String getUri() { - return this.uri == null ? null : this.uri.getValue(); - } - - /** - * @param value An absolute URI that identifies the specification that this mapping is expressed to. - */ - public StructureDefinitionMappingComponent setUri(String value) { - if (Utilities.noString(value)) - this.uri = null; - else { - if (this.uri == null) - this.uri = new UriType(); - this.uri.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A name for the specification that is being mapped to.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinitionMappingComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A name for the specification that is being mapped to.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StructureDefinitionMappingComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A name for the specification that is being mapped to. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A name for the specification that is being mapped to. - */ - public StructureDefinitionMappingComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public StringType getCommentsElement() { - if (this.comments == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinitionMappingComponent.comments"); - else if (Configuration.doAutoCreate()) - this.comments = new StringType(); // bb - return this.comments; - } - - public boolean hasCommentsElement() { - return this.comments != null && !this.comments.isEmpty(); - } - - public boolean hasComments() { - return this.comments != null && !this.comments.isEmpty(); - } - - /** - * @param value {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public StructureDefinitionMappingComponent setCommentsElement(StringType value) { - this.comments = value; - return this; - } - - /** - * @return Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. - */ - public String getComments() { - return this.comments == null ? null : this.comments.getValue(); - } - - /** - * @param value Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. - */ - public StructureDefinitionMappingComponent setComments(String value) { - if (Utilities.noString(value)) - this.comments = null; - else { - if (this.comments == null) - this.comments = new StringType(); - this.comments.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identity", "id", "An Internal id that is used to identify this mapping set when specific mappings are made.", 0, java.lang.Integer.MAX_VALUE, identity)); - childrenList.add(new Property("uri", "uri", "An absolute URI that identifies the specification that this mapping is expressed to.", 0, java.lang.Integer.MAX_VALUE, uri)); - childrenList.add(new Property("name", "string", "A name for the specification that is being mapped to.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("comments", "string", "Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.", 0, java.lang.Integer.MAX_VALUE, comments)); - } - - public StructureDefinitionMappingComponent copy() { - StructureDefinitionMappingComponent dst = new StructureDefinitionMappingComponent(); - copyValues(dst); - dst.identity = identity == null ? null : identity.copy(); - dst.uri = uri == null ? null : uri.copy(); - dst.name = name == null ? null : name.copy(); - dst.comments = comments == null ? null : comments.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StructureDefinitionMappingComponent)) - return false; - StructureDefinitionMappingComponent o = (StructureDefinitionMappingComponent) other; - return compareDeep(identity, o.identity, true) && compareDeep(uri, o.uri, true) && compareDeep(name, o.name, true) - && compareDeep(comments, o.comments, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StructureDefinitionMappingComponent)) - return false; - StructureDefinitionMappingComponent o = (StructureDefinitionMappingComponent) other; - return compareValues(identity, o.identity, true) && compareValues(uri, o.uri, true) && compareValues(name, o.name, true) - && compareValues(comments, o.comments, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identity == null || identity.isEmpty()) && (uri == null || uri.isEmpty()) - && (name == null || name.isEmpty()) && (comments == null || comments.isEmpty()); - } - - } - - @Block() - public static class StructureDefinitionSnapshotComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Captures constraints on each element within the resource. - */ - @Child(name = "element", type = {ElementDefinition.class}, order=1, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Definition of elements in the resource (if no StructureDefinition)", formalDefinition="Captures constraints on each element within the resource." ) - protected List element; - - private static final long serialVersionUID = 53896641L; - - /* - * Constructor - */ - public StructureDefinitionSnapshotComponent() { - super(); - } - - /** - * @return {@link #element} (Captures constraints on each element within the resource.) - */ - public List getElement() { - if (this.element == null) - this.element = new ArrayList(); - return this.element; - } - - public boolean hasElement() { - if (this.element == null) - return false; - for (ElementDefinition item : this.element) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #element} (Captures constraints on each element within the resource.) - */ - // syntactic sugar - public ElementDefinition addElement() { //3 - ElementDefinition t = new ElementDefinition(); - if (this.element == null) - this.element = new ArrayList(); - this.element.add(t); - return t; - } - - // syntactic sugar - public StructureDefinitionSnapshotComponent addElement(ElementDefinition t) { //3 - if (t == null) - return this; - if (this.element == null) - this.element = new ArrayList(); - this.element.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("element", "ElementDefinition", "Captures constraints on each element within the resource.", 0, java.lang.Integer.MAX_VALUE, element)); - } - - public StructureDefinitionSnapshotComponent copy() { - StructureDefinitionSnapshotComponent dst = new StructureDefinitionSnapshotComponent(); - copyValues(dst); - if (element != null) { - dst.element = new ArrayList(); - for (ElementDefinition i : element) - dst.element.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StructureDefinitionSnapshotComponent)) - return false; - StructureDefinitionSnapshotComponent o = (StructureDefinitionSnapshotComponent) other; - return compareDeep(element, o.element, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StructureDefinitionSnapshotComponent)) - return false; - StructureDefinitionSnapshotComponent o = (StructureDefinitionSnapshotComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (element == null || element.isEmpty()); - } - - } - - @Block() - public static class StructureDefinitionDifferentialComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Captures constraints on each element within the resource. - */ - @Child(name = "element", type = {ElementDefinition.class}, order=1, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Definition of elements in the resource (if no StructureDefinition)", formalDefinition="Captures constraints on each element within the resource." ) - protected List element; - - private static final long serialVersionUID = 53896641L; - - /* - * Constructor - */ - public StructureDefinitionDifferentialComponent() { - super(); - } - - /** - * @return {@link #element} (Captures constraints on each element within the resource.) - */ - public List getElement() { - if (this.element == null) - this.element = new ArrayList(); - return this.element; - } - - public boolean hasElement() { - if (this.element == null) - return false; - for (ElementDefinition item : this.element) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #element} (Captures constraints on each element within the resource.) - */ - // syntactic sugar - public ElementDefinition addElement() { //3 - ElementDefinition t = new ElementDefinition(); - if (this.element == null) - this.element = new ArrayList(); - this.element.add(t); - return t; - } - - // syntactic sugar - public StructureDefinitionDifferentialComponent addElement(ElementDefinition t) { //3 - if (t == null) - return this; - if (this.element == null) - this.element = new ArrayList(); - this.element.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("element", "ElementDefinition", "Captures constraints on each element within the resource.", 0, java.lang.Integer.MAX_VALUE, element)); - } - - public StructureDefinitionDifferentialComponent copy() { - StructureDefinitionDifferentialComponent dst = new StructureDefinitionDifferentialComponent(); - copyValues(dst); - if (element != null) { - dst.element = new ArrayList(); - for (ElementDefinition i : element) - dst.element.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StructureDefinitionDifferentialComponent)) - return false; - StructureDefinitionDifferentialComponent o = (StructureDefinitionDifferentialComponent) other; - return compareDeep(element, o.element, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StructureDefinitionDifferentialComponent)) - return false; - StructureDefinitionDifferentialComponent o = (StructureDefinitionDifferentialComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (element == null || element.isEmpty()); - } - - } - - /** - * An absolute URL at which this StructureDefinition is (or will be) published, and which is used to reference this StructureDefinition in extension urls and tag values in operational FHIR systems. - */ - @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1) - @Description(shortDefinition="Literal URL used to reference this StructureDefinition", formalDefinition="An absolute URL at which this StructureDefinition is (or will be) published, and which is used to reference this StructureDefinition in extension urls and tag values in operational FHIR systems." ) - protected UriType url; - - /** - * Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI). - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Other identifiers for the StructureDefinition", formalDefinition="Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI)." ) - protected List identifier; - - /** - * The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Logical id for this version of the StructureDefinition", formalDefinition="The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually." ) - protected StringType version; - - /** - * A free text natural language name identifying the StructureDefinition. - */ - @Child(name = "name", type = {StringType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Informal name for this StructureDefinition", formalDefinition="A free text natural language name identifying the StructureDefinition." ) - protected StringType name; - - /** - * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions. - */ - @Child(name = "useContext", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions." ) - protected List useContext; - - /** - * Defined so that applications can use this name when displaying the value of the extension to the user. - */ - @Child(name = "display", type = {StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Use this name when displaying the value", formalDefinition="Defined so that applications can use this name when displaying the value of the extension to the user." ) - protected StringType display; - - /** - * The name of the individual or organization that published the structure definition. - */ - @Child(name = "publisher", type = {StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the structure definition." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * A free text natural language description of the StructureDefinition and its use. - */ - @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Natural language description of the StructureDefinition", formalDefinition="A free text natural language description of the StructureDefinition and its use." ) - protected StringType description; - - /** - * Explains why this structure definition is needed and why it's been constrained as it has. - */ - @Child(name = "requirements", type = {StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Scope and Usage this structure definition is for", formalDefinition="Explains why this structure definition is needed and why it's been constrained as it has." ) - protected StringType requirements; - - /** - * A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. - */ - @Child(name = "copyright", type = {StringType.class}, order=10, min=0, max=1) - @Description(shortDefinition="Use and/or Publishing restrictions", formalDefinition="A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings." ) - protected StringType copyright; - - /** - * A set of terms from external terminologies that may be used to assist with indexing and searching of templates. - */ - @Child(name = "code", type = {Coding.class}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Assist with indexing and finding", formalDefinition="A set of terms from external terminologies that may be used to assist with indexing and searching of templates." ) - protected List code; - - /** - * The status of the StructureDefinition. - */ - @Child(name = "status", type = {CodeType.class}, order=12, min=1, max=1) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the StructureDefinition." ) - protected Enumeration status; - - /** - * This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name = "experimental", type = {BooleanType.class}, order=13, min=0, max=1) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The date that this version of the StructureDefinition was published. - */ - @Child(name = "date", type = {DateTimeType.class}, order=14, min=0, max=1) - @Description(shortDefinition="Date for this version of the StructureDefinition", formalDefinition="The date that this version of the StructureDefinition was published." ) - protected DateTimeType date; - - /** - * The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.5.0 for this version. - */ - @Child(name = "fhirVersion", type = {IdType.class}, order=15, min=0, max=1) - @Description(shortDefinition="FHIR Version this StructureDefinition targets", formalDefinition="The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.5.0 for this version." ) - protected IdType fhirVersion; - - /** - * An external specification that the content is mapped to. - */ - @Child(name = "mapping", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External specification that the content is mapped to", formalDefinition="An external specification that the content is mapped to." ) - protected List mapping; - - /** - * Defines the type of structure that this definition is describing. - */ - @Child(name = "type", type = {CodeType.class}, order=17, min=1, max=1) - @Description(shortDefinition="type | resource | constraint | extension", formalDefinition="Defines the type of structure that this definition is describing." ) - protected Enumeration type; - - /** - * Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type. - */ - @Child(name = "abstract_", type = {BooleanType.class}, order=18, min=1, max=1) - @Description(shortDefinition="Whether the structure is abstract", formalDefinition="Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type." ) - protected BooleanType abstract_; - - /** - * If this is an extension, Identifies the context within FHIR resources where the extension can be used. - */ - @Child(name = "contextType", type = {CodeType.class}, order=19, min=0, max=1) - @Description(shortDefinition="resource | datatype | mapping | extension", formalDefinition="If this is an extension, Identifies the context within FHIR resources where the extension can be used." ) - protected Enumeration contextType; - - /** - * Identifies the types of resource or data type elements to which the extension can be applied. - */ - @Child(name = "context", type = {StringType.class}, order=20, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Where the extension can be used in instances", formalDefinition="Identifies the types of resource or data type elements to which the extension can be applied." ) - protected List context; - - /** - * An absolute URI that is the base structure from which this set of constraints is derived. - */ - @Child(name = "base", type = {UriType.class}, order=21, min=0, max=1) - @Description(shortDefinition="Structure that this set of constraints applies to", formalDefinition="An absolute URI that is the base structure from which this set of constraints is derived." ) - protected UriType base; - - /** - * A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition. - */ - @Child(name = "snapshot", type = {}, order=22, min=0, max=1) - @Description(shortDefinition="Snapshot view of the structure", formalDefinition="A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition." ) - protected StructureDefinitionSnapshotComponent snapshot; - - /** - * A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies. - */ - @Child(name = "differential", type = {}, order=23, min=0, max=1) - @Description(shortDefinition="Differential view of the structure", formalDefinition="A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies." ) - protected StructureDefinitionDifferentialComponent differential; - - private static final long serialVersionUID = -1935809660L; - - /* - * Constructor - */ - public StructureDefinition() { - super(); - } - - /* - * Constructor - */ - public StructureDefinition(UriType url, StringType name, Enumeration status, Enumeration type, BooleanType abstract_) { - super(); - this.url = url; - this.name = name; - this.status = status; - this.type = type; - this.abstract_ = abstract_; - } - - /** - * @return {@link #url} (An absolute URL at which this StructureDefinition is (or will be) published, and which is used to reference this StructureDefinition in extension urls and tag values in operational FHIR systems.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute URL at which this StructureDefinition is (or will be) published, and which is used to reference this StructureDefinition in extension urls and tag values in operational FHIR systems.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public StructureDefinition setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute URL at which this StructureDefinition is (or will be) published, and which is used to reference this StructureDefinition in extension urls and tag values in operational FHIR systems. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute URL at which this StructureDefinition is (or will be) published, and which is used to reference this StructureDefinition in extension urls and tag values in operational FHIR systems. - */ - public StructureDefinition setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - /** - * @return {@link #identifier} (Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public StructureDefinition addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #version} (The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StructureDefinition setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually. - */ - public StructureDefinition setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A free text natural language name identifying the StructureDefinition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A free text natural language name identifying the StructureDefinition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StructureDefinition setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name identifying the StructureDefinition. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name identifying the StructureDefinition. - */ - public StructureDefinition setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions.) - */ - public List getUseContext() { - if (this.useContext == null) - this.useContext = new ArrayList(); - return this.useContext; - } - - public boolean hasUseContext() { - if (this.useContext == null) - return false; - for (CodeableConcept item : this.useContext) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions.) - */ - // syntactic sugar - public CodeableConcept addUseContext() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return t; - } - - // syntactic sugar - public StructureDefinition addUseContext(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return this; - } - - /** - * @return {@link #display} (Defined so that applications can use this name when displaying the value of the extension to the user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); // bb - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (Defined so that applications can use this name when displaying the value of the extension to the user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StructureDefinition setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return Defined so that applications can use this name when displaying the value of the extension to the user. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value Defined so that applications can use this name when displaying the value of the extension to the user. - */ - public StructureDefinition setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the structure definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the structure definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StructureDefinition setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the structure definition. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the structure definition. - */ - public StructureDefinition setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (StructureDefinitionContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public StructureDefinitionContactComponent addContact() { //3 - StructureDefinitionContactComponent t = new StructureDefinitionContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public StructureDefinition addContact(StructureDefinitionContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #description} (A free text natural language description of the StructureDefinition and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A free text natural language description of the StructureDefinition and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StructureDefinition setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the StructureDefinition and its use. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the StructureDefinition and its use. - */ - public StructureDefinition setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #requirements} (Explains why this structure definition is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); // bb - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (Explains why this structure definition is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StructureDefinition setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return Explains why this structure definition is needed and why it's been constrained as it has. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value Explains why this structure definition is needed and why it's been constrained as it has. - */ - public StructureDefinition setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #copyright} (A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public StringType getCopyrightElement() { - if (this.copyright == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.copyright"); - else if (Configuration.doAutoCreate()) - this.copyright = new StringType(); // bb - return this.copyright; - } - - public boolean hasCopyrightElement() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - public boolean hasCopyright() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - /** - * @param value {@link #copyright} (A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public StructureDefinition setCopyrightElement(StringType value) { - this.copyright = value; - return this; - } - - /** - * @return A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. - */ - public String getCopyright() { - return this.copyright == null ? null : this.copyright.getValue(); - } - - /** - * @param value A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. - */ - public StructureDefinition setCopyright(String value) { - if (Utilities.noString(value)) - this.copyright = null; - else { - if (this.copyright == null) - this.copyright = new StringType(); - this.copyright.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (A set of terms from external terminologies that may be used to assist with indexing and searching of templates.) - */ - public List getCode() { - if (this.code == null) - this.code = new ArrayList(); - return this.code; - } - - public boolean hasCode() { - if (this.code == null) - return false; - for (Coding item : this.code) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #code} (A set of terms from external terminologies that may be used to assist with indexing and searching of templates.) - */ - // syntactic sugar - public Coding addCode() { //3 - Coding t = new Coding(); - if (this.code == null) - this.code = new ArrayList(); - this.code.add(t); - return t; - } - - // syntactic sugar - public StructureDefinition addCode(Coding t) { //3 - if (t == null) - return this; - if (this.code == null) - this.code = new ArrayList(); - this.code.add(t); - return this; - } - - /** - * @return {@link #status} (The status of the StructureDefinition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the StructureDefinition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public StructureDefinition setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the StructureDefinition. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the StructureDefinition. - */ - public StructureDefinition setStatus(ConformanceResourceStatus value) { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #experimental} (This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); // bb - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public StructureDefinition setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); - } - - /** - * @param value This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public StructureDefinition setExperimental(boolean value) { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - return this; - } - - /** - * @return {@link #date} (The date that this version of the StructureDefinition was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date that this version of the StructureDefinition was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public StructureDefinition setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date that this version of the StructureDefinition was published. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date that this version of the StructureDefinition was published. - */ - public StructureDefinition setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #fhirVersion} (The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.5.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value - */ - public IdType getFhirVersionElement() { - if (this.fhirVersion == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.fhirVersion"); - else if (Configuration.doAutoCreate()) - this.fhirVersion = new IdType(); // bb - return this.fhirVersion; - } - - public boolean hasFhirVersionElement() { - return this.fhirVersion != null && !this.fhirVersion.isEmpty(); - } - - public boolean hasFhirVersion() { - return this.fhirVersion != null && !this.fhirVersion.isEmpty(); - } - - /** - * @param value {@link #fhirVersion} (The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.5.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value - */ - public StructureDefinition setFhirVersionElement(IdType value) { - this.fhirVersion = value; - return this; - } - - /** - * @return The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.5.0 for this version. - */ - public String getFhirVersion() { - return this.fhirVersion == null ? null : this.fhirVersion.getValue(); - } - - /** - * @param value The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.5.0 for this version. - */ - public StructureDefinition setFhirVersion(String value) { - if (Utilities.noString(value)) - this.fhirVersion = null; - else { - if (this.fhirVersion == null) - this.fhirVersion = new IdType(); - this.fhirVersion.setValue(value); - } - return this; - } - - /** - * @return {@link #mapping} (An external specification that the content is mapped to.) - */ - public List getMapping() { - if (this.mapping == null) - this.mapping = new ArrayList(); - return this.mapping; - } - - public boolean hasMapping() { - if (this.mapping == null) - return false; - for (StructureDefinitionMappingComponent item : this.mapping) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #mapping} (An external specification that the content is mapped to.) - */ - // syntactic sugar - public StructureDefinitionMappingComponent addMapping() { //3 - StructureDefinitionMappingComponent t = new StructureDefinitionMappingComponent(); - if (this.mapping == null) - this.mapping = new ArrayList(); - this.mapping.add(t); - return t; - } - - // syntactic sugar - public StructureDefinition addMapping(StructureDefinitionMappingComponent t) { //3 - if (t == null) - return this; - if (this.mapping == null) - this.mapping = new ArrayList(); - this.mapping.add(t); - return this; - } - - /** - * @return {@link #type} (Defines the type of structure that this definition is describing.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new StructureDefinitionTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Defines the type of structure that this definition is describing.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public StructureDefinition setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Defines the type of structure that this definition is describing. - */ - public StructureDefinitionType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Defines the type of structure that this definition is describing. - */ - public StructureDefinition setType(StructureDefinitionType value) { - if (this.type == null) - this.type = new Enumeration(new StructureDefinitionTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #abstract_} (Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value - */ - public BooleanType getAbstractElement() { - if (this.abstract_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.abstract_"); - else if (Configuration.doAutoCreate()) - this.abstract_ = new BooleanType(); // bb - return this.abstract_; - } - - public boolean hasAbstractElement() { - return this.abstract_ != null && !this.abstract_.isEmpty(); - } - - public boolean hasAbstract() { - return this.abstract_ != null && !this.abstract_.isEmpty(); - } - - /** - * @param value {@link #abstract_} (Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value - */ - public StructureDefinition setAbstractElement(BooleanType value) { - this.abstract_ = value; - return this; - } - - /** - * @return Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type. - */ - public boolean getAbstract() { - return this.abstract_ == null || this.abstract_.isEmpty() ? false : this.abstract_.getValue(); - } - - /** - * @param value Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type. - */ - public StructureDefinition setAbstract(boolean value) { - if (this.abstract_ == null) - this.abstract_ = new BooleanType(); - this.abstract_.setValue(value); - return this; - } - - /** - * @return {@link #contextType} (If this is an extension, Identifies the context within FHIR resources where the extension can be used.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value - */ - public Enumeration getContextTypeElement() { - if (this.contextType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.contextType"); - else if (Configuration.doAutoCreate()) - this.contextType = new Enumeration(new ExtensionContextEnumFactory()); // bb - return this.contextType; - } - - public boolean hasContextTypeElement() { - return this.contextType != null && !this.contextType.isEmpty(); - } - - public boolean hasContextType() { - return this.contextType != null && !this.contextType.isEmpty(); - } - - /** - * @param value {@link #contextType} (If this is an extension, Identifies the context within FHIR resources where the extension can be used.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value - */ - public StructureDefinition setContextTypeElement(Enumeration value) { - this.contextType = value; - return this; - } - - /** - * @return If this is an extension, Identifies the context within FHIR resources where the extension can be used. - */ - public ExtensionContext getContextType() { - return this.contextType == null ? null : this.contextType.getValue(); - } - - /** - * @param value If this is an extension, Identifies the context within FHIR resources where the extension can be used. - */ - public StructureDefinition setContextType(ExtensionContext value) { - if (value == null) - this.contextType = null; - else { - if (this.contextType == null) - this.contextType = new Enumeration(new ExtensionContextEnumFactory()); - this.contextType.setValue(value); - } - return this; - } - - /** - * @return {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) - */ - public List getContext() { - if (this.context == null) - this.context = new ArrayList(); - return this.context; - } - - public boolean hasContext() { - if (this.context == null) - return false; - for (StringType item : this.context) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) - */ - // syntactic sugar - public StringType addContextElement() {//2 - StringType t = new StringType(); - if (this.context == null) - this.context = new ArrayList(); - this.context.add(t); - return t; - } - - /** - * @param value {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) - */ - public StructureDefinition addContext(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.context == null) - this.context = new ArrayList(); - this.context.add(t); - return this; - } - - /** - * @param value {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) - */ - public boolean hasContext(String value) { - if (this.context == null) - return false; - for (StringType v : this.context) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #base} (An absolute URI that is the base structure from which this set of constraints is derived.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public UriType getBaseElement() { - if (this.base == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.base"); - else if (Configuration.doAutoCreate()) - this.base = new UriType(); // bb - return this.base; - } - - public boolean hasBaseElement() { - return this.base != null && !this.base.isEmpty(); - } - - public boolean hasBase() { - return this.base != null && !this.base.isEmpty(); - } - - /** - * @param value {@link #base} (An absolute URI that is the base structure from which this set of constraints is derived.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public StructureDefinition setBaseElement(UriType value) { - this.base = value; - return this; - } - - /** - * @return An absolute URI that is the base structure from which this set of constraints is derived. - */ - public String getBase() { - return this.base == null ? null : this.base.getValue(); - } - - /** - * @param value An absolute URI that is the base structure from which this set of constraints is derived. - */ - public StructureDefinition setBase(String value) { - if (Utilities.noString(value)) - this.base = null; - else { - if (this.base == null) - this.base = new UriType(); - this.base.setValue(value); - } - return this; - } - - /** - * @return {@link #snapshot} (A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition.) - */ - public StructureDefinitionSnapshotComponent getSnapshot() { - if (this.snapshot == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.snapshot"); - else if (Configuration.doAutoCreate()) - this.snapshot = new StructureDefinitionSnapshotComponent(); // cc - return this.snapshot; - } - - public boolean hasSnapshot() { - return this.snapshot != null && !this.snapshot.isEmpty(); - } - - /** - * @param value {@link #snapshot} (A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition.) - */ - public StructureDefinition setSnapshot(StructureDefinitionSnapshotComponent value) { - this.snapshot = value; - return this; - } - - /** - * @return {@link #differential} (A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies.) - */ - public StructureDefinitionDifferentialComponent getDifferential() { - if (this.differential == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.differential"); - else if (Configuration.doAutoCreate()) - this.differential = new StructureDefinitionDifferentialComponent(); // cc - return this.differential; - } - - public boolean hasDifferential() { - return this.differential != null && !this.differential.isEmpty(); - } - - /** - * @param value {@link #differential} (A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies.) - */ - public StructureDefinition setDifferential(StructureDefinitionDifferentialComponent value) { - this.differential = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute URL at which this StructureDefinition is (or will be) published, and which is used to reference this StructureDefinition in extension urls and tag values in operational FHIR systems.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("name", "string", "A free text natural language name identifying the StructureDefinition.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions.", 0, java.lang.Integer.MAX_VALUE, useContext)); - childrenList.add(new Property("display", "string", "Defined so that applications can use this name when displaying the value of the extension to the user.", 0, java.lang.Integer.MAX_VALUE, display)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the structure definition.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("description", "string", "A free text natural language description of the StructureDefinition and its use.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("requirements", "string", "Explains why this structure definition is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("copyright", "string", "A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.", 0, java.lang.Integer.MAX_VALUE, copyright)); - childrenList.add(new Property("code", "Coding", "A set of terms from external terminologies that may be used to assist with indexing and searching of templates.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("status", "code", "The status of the StructureDefinition.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("date", "dateTime", "The date that this version of the StructureDefinition was published.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.5.0 for this version.", 0, java.lang.Integer.MAX_VALUE, fhirVersion)); - childrenList.add(new Property("mapping", "", "An external specification that the content is mapped to.", 0, java.lang.Integer.MAX_VALUE, mapping)); - childrenList.add(new Property("type", "code", "Defines the type of structure that this definition is describing.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("abstract", "boolean", "Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type.", 0, java.lang.Integer.MAX_VALUE, abstract_)); - childrenList.add(new Property("contextType", "code", "If this is an extension, Identifies the context within FHIR resources where the extension can be used.", 0, java.lang.Integer.MAX_VALUE, contextType)); - childrenList.add(new Property("context", "string", "Identifies the types of resource or data type elements to which the extension can be applied.", 0, java.lang.Integer.MAX_VALUE, context)); - childrenList.add(new Property("base", "uri", "An absolute URI that is the base structure from which this set of constraints is derived.", 0, java.lang.Integer.MAX_VALUE, base)); - childrenList.add(new Property("snapshot", "", "A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition.", 0, java.lang.Integer.MAX_VALUE, snapshot)); - childrenList.add(new Property("differential", "", "A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies.", 0, java.lang.Integer.MAX_VALUE, differential)); - } - - public StructureDefinition copy() { - StructureDefinition dst = new StructureDefinition(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.version = version == null ? null : version.copy(); - dst.name = name == null ? null : name.copy(); - if (useContext != null) { - dst.useContext = new ArrayList(); - for (CodeableConcept i : useContext) - dst.useContext.add(i.copy()); - }; - dst.display = display == null ? null : display.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (StructureDefinitionContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - dst.requirements = requirements == null ? null : requirements.copy(); - dst.copyright = copyright == null ? null : copyright.copy(); - if (code != null) { - dst.code = new ArrayList(); - for (Coding i : code) - dst.code.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.date = date == null ? null : date.copy(); - dst.fhirVersion = fhirVersion == null ? null : fhirVersion.copy(); - if (mapping != null) { - dst.mapping = new ArrayList(); - for (StructureDefinitionMappingComponent i : mapping) - dst.mapping.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - dst.abstract_ = abstract_ == null ? null : abstract_.copy(); - dst.contextType = contextType == null ? null : contextType.copy(); - if (context != null) { - dst.context = new ArrayList(); - for (StringType i : context) - dst.context.add(i.copy()); - }; - dst.base = base == null ? null : base.copy(); - dst.snapshot = snapshot == null ? null : snapshot.copy(); - dst.differential = differential == null ? null : differential.copy(); - return dst; - } - - protected StructureDefinition typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StructureDefinition)) - return false; - StructureDefinition o = (StructureDefinition) other; - return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) - && compareDeep(name, o.name, true) && compareDeep(useContext, o.useContext, true) && compareDeep(display, o.display, true) - && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(description, o.description, true) - && compareDeep(requirements, o.requirements, true) && compareDeep(copyright, o.copyright, true) - && compareDeep(code, o.code, true) && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) - && compareDeep(date, o.date, true) && compareDeep(fhirVersion, o.fhirVersion, true) && compareDeep(mapping, o.mapping, true) - && compareDeep(type, o.type, true) && compareDeep(abstract_, o.abstract_, true) && compareDeep(contextType, o.contextType, true) - && compareDeep(context, o.context, true) && compareDeep(base, o.base, true) && compareDeep(snapshot, o.snapshot, true) - && compareDeep(differential, o.differential, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StructureDefinition)) - return false; - StructureDefinition o = (StructureDefinition) other; - return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) - && compareValues(display, o.display, true) && compareValues(publisher, o.publisher, true) && compareValues(description, o.description, true) - && compareValues(requirements, o.requirements, true) && compareValues(copyright, o.copyright, true) - && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(date, o.date, true) - && compareValues(fhirVersion, o.fhirVersion, true) && compareValues(type, o.type, true) && compareValues(abstract_, o.abstract_, true) - && compareValues(contextType, o.contextType, true) && compareValues(context, o.context, true) && compareValues(base, o.base, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (useContext == null || useContext.isEmpty()) - && (display == null || display.isEmpty()) && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) - && (description == null || description.isEmpty()) && (requirements == null || requirements.isEmpty()) - && (copyright == null || copyright.isEmpty()) && (code == null || code.isEmpty()) && (status == null || status.isEmpty()) - && (experimental == null || experimental.isEmpty()) && (date == null || date.isEmpty()) && (fhirVersion == null || fhirVersion.isEmpty()) - && (mapping == null || mapping.isEmpty()) && (type == null || type.isEmpty()) && (abstract_ == null || abstract_.isEmpty()) - && (contextType == null || contextType.isEmpty()) && (context == null || context.isEmpty()) - && (base == null || base.isEmpty()) && (snapshot == null || snapshot.isEmpty()) && (differential == null || differential.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.StructureDefinition; - } - - @SearchParamDefinition(name="abstract", path="StructureDefinition.abstract", description="Whether the structure is abstract", type="token" ) - public static final String SP_ABSTRACT = "abstract"; - @SearchParamDefinition(name="status", path="StructureDefinition.status", description="The current status of the profile", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="experimental", path="StructureDefinition.experimental", description="If for testing purposes, not real usage", type="token" ) - public static final String SP_EXPERIMENTAL = "experimental"; - @SearchParamDefinition(name="display", path="StructureDefinition.display", description="Use this name when displaying the value", type="string" ) - public static final String SP_DISPLAY = "display"; - @SearchParamDefinition(name="ext-context", path="StructureDefinition.context", description="Where the extension can be used in instances", type="string" ) - public static final String SP_EXTCONTEXT = "ext-context"; - @SearchParamDefinition(name="code", path="StructureDefinition.code", description="A code for the profile", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="date", path="StructureDefinition.date", description="The profile publication date", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="type", path="StructureDefinition.type", description="type | resource | constraint | extension", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="url", path="StructureDefinition.url", description="Literal URL used to reference this StructureDefinition", type="uri" ) - public static final String SP_URL = "url"; - @SearchParamDefinition(name="version", path="StructureDefinition.version", description="The version identifier of the profile", type="token" ) - public static final String SP_VERSION = "version"; - @SearchParamDefinition(name="publisher", path="StructureDefinition.publisher", description="Name of the publisher of the profile", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - @SearchParamDefinition(name="valueset", path="StructureDefinition.snapshot.element.binding.valueSet[x]", description="A vocabulary binding reference", type="reference" ) - public static final String SP_VALUESET = "valueset"; - @SearchParamDefinition(name="context-type", path="StructureDefinition.contextType", description="resource | datatype | mapping | extension", type="token" ) - public static final String SP_CONTEXTTYPE = "context-type"; - @SearchParamDefinition(name="description", path="StructureDefinition.description", description="Text search in the description of the profile", type="string" ) - public static final String SP_DESCRIPTION = "description"; - @SearchParamDefinition(name="name", path="StructureDefinition.name", description="Name of the profile", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="base", path="StructureDefinition.base", description="Structure that this set of constraints applies to", type="uri" ) - public static final String SP_BASE = "base"; - @SearchParamDefinition(name="context", path="StructureDefinition.useContext", description="A use context assigned to the structure", type="token" ) - public static final String SP_CONTEXT = "context"; - @SearchParamDefinition(name="path", path="StructureDefinition.snapshot.element.path|StructureDefinition.differential.element.path", description="A path that is constrained in the profile", type="token" ) - public static final String SP_PATH = "path"; - @SearchParamDefinition(name="identifier", path="StructureDefinition.identifier", description="The identifier of the profile", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import java.util.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.Enumerations.*; +import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types. + */ +@ResourceDef(name="StructureDefinition", profile="http://hl7.org/fhir/Profile/StructureDefinition") +public class StructureDefinition extends DomainResource { + + public enum StructureDefinitionType { + /** + * A data type - either a primitive or complex structure that defines a set of data elements. These can be used throughout Resource and extension definitions. + */ + TYPE, + /** + * A resource defined by the FHIR specification. + */ + RESOURCE, + /** + * A set of constraints on a resource or data type that describe how it is used for a particular use. + */ + CONSTRAINT, + /** + * A definition of an extension that can be used in a FHIR resource (or a set of constraints on an exsting extension). + */ + EXTENSION, + /** + * added to help the parsers + */ + NULL; + public static StructureDefinitionType fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("type".equals(codeString)) + return TYPE; + if ("resource".equals(codeString)) + return RESOURCE; + if ("constraint".equals(codeString)) + return CONSTRAINT; + if ("extension".equals(codeString)) + return EXTENSION; + throw new Exception("Unknown StructureDefinitionType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case TYPE: return "type"; + case RESOURCE: return "resource"; + case CONSTRAINT: return "constraint"; + case EXTENSION: return "extension"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case TYPE: return ""; + case RESOURCE: return ""; + case CONSTRAINT: return ""; + case EXTENSION: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case TYPE: return "A data type - either a primitive or complex structure that defines a set of data elements. These can be used throughout Resource and extension definitions."; + case RESOURCE: return "A resource defined by the FHIR specification."; + case CONSTRAINT: return "A set of constraints on a resource or data type that describe how it is used for a particular use."; + case EXTENSION: return "A definition of an extension that can be used in a FHIR resource (or a set of constraints on an exsting extension)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case TYPE: return "Data Type"; + case RESOURCE: return "Resource"; + case CONSTRAINT: return "Constrained Type"; + case EXTENSION: return "Extension Definition"; + default: return "?"; + } + } + } + + public static class StructureDefinitionTypeEnumFactory implements EnumFactory { + public StructureDefinitionType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("type".equals(codeString)) + return StructureDefinitionType.TYPE; + if ("resource".equals(codeString)) + return StructureDefinitionType.RESOURCE; + if ("constraint".equals(codeString)) + return StructureDefinitionType.CONSTRAINT; + if ("extension".equals(codeString)) + return StructureDefinitionType.EXTENSION; + throw new IllegalArgumentException("Unknown StructureDefinitionType code '"+codeString+"'"); + } + public String toCode(StructureDefinitionType code) { + if (code == StructureDefinitionType.TYPE) + return "type"; + if (code == StructureDefinitionType.RESOURCE) + return "resource"; + if (code == StructureDefinitionType.CONSTRAINT) + return "constraint"; + if (code == StructureDefinitionType.EXTENSION) + return "extension"; + return "?"; + } + } + + public enum ExtensionContext { + /** + * The context is all elements matching a particular resource element path. + */ + RESOURCE, + /** + * The context is all nodes matching a particular data type element path (root or repeating element) or all elements referencing a particular primitive data type (expressed as the datatype name). + */ + DATATYPE, + /** + * The context is all nodes whose mapping to a specified reference model corresponds to a particular mapping structure. The context identifies the mapping target. The mapping should clearly identify where such an extension could be used. + */ + MAPPING, + /** + * The context is a particular extension from a particular profile. Expressed as uri#name, where uri identifies the profile and #name identifies the extension code. + */ + EXTENSION, + /** + * added to help the parsers + */ + NULL; + public static ExtensionContext fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("resource".equals(codeString)) + return RESOURCE; + if ("datatype".equals(codeString)) + return DATATYPE; + if ("mapping".equals(codeString)) + return MAPPING; + if ("extension".equals(codeString)) + return EXTENSION; + throw new Exception("Unknown ExtensionContext code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case RESOURCE: return "resource"; + case DATATYPE: return "datatype"; + case MAPPING: return "mapping"; + case EXTENSION: return "extension"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case RESOURCE: return ""; + case DATATYPE: return ""; + case MAPPING: return ""; + case EXTENSION: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case RESOURCE: return "The context is all elements matching a particular resource element path."; + case DATATYPE: return "The context is all nodes matching a particular data type element path (root or repeating element) or all elements referencing a particular primitive data type (expressed as the datatype name)."; + case MAPPING: return "The context is all nodes whose mapping to a specified reference model corresponds to a particular mapping structure. The context identifies the mapping target. The mapping should clearly identify where such an extension could be used."; + case EXTENSION: return "The context is a particular extension from a particular profile. Expressed as uri#name, where uri identifies the profile and #name identifies the extension code."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case RESOURCE: return "Resource"; + case DATATYPE: return "Datatype"; + case MAPPING: return "Mapping"; + case EXTENSION: return "Extension"; + default: return "?"; + } + } + } + + public static class ExtensionContextEnumFactory implements EnumFactory { + public ExtensionContext fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("resource".equals(codeString)) + return ExtensionContext.RESOURCE; + if ("datatype".equals(codeString)) + return ExtensionContext.DATATYPE; + if ("mapping".equals(codeString)) + return ExtensionContext.MAPPING; + if ("extension".equals(codeString)) + return ExtensionContext.EXTENSION; + throw new IllegalArgumentException("Unknown ExtensionContext code '"+codeString+"'"); + } + public String toCode(ExtensionContext code) { + if (code == ExtensionContext.RESOURCE) + return "resource"; + if (code == ExtensionContext.DATATYPE) + return "datatype"; + if (code == ExtensionContext.MAPPING) + return "mapping"; + if (code == ExtensionContext.EXTENSION) + return "extension"; + return "?"; + } + } + + @Block() + public static class StructureDefinitionContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the structure definition. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Name of a individual to contact", formalDefinition="The name of an individual to contact regarding the structure definition." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /* + * Constructor + */ + public StructureDefinitionContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the structure definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinitionContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The name of an individual to contact regarding the structure definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StructureDefinitionContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the structure definition. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the structure definition. + */ + public StructureDefinitionContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public StructureDefinitionContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the structure definition.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + public StructureDefinitionContactComponent copy() { + StructureDefinitionContactComponent dst = new StructureDefinitionContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StructureDefinitionContactComponent)) + return false; + StructureDefinitionContactComponent o = (StructureDefinitionContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StructureDefinitionContactComponent)) + return false; + StructureDefinitionContactComponent o = (StructureDefinitionContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + } + + @Block() + public static class StructureDefinitionMappingComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An Internal id that is used to identify this mapping set when specific mappings are made. + */ + @Child(name = "identity", type = {IdType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Internal id when this mapping is used", formalDefinition="An Internal id that is used to identify this mapping set when specific mappings are made." ) + protected IdType identity; + + /** + * An absolute URI that identifies the specification that this mapping is expressed to. + */ + @Child(name = "uri", type = {UriType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Identifies what this mapping refers to", formalDefinition="An absolute URI that identifies the specification that this mapping is expressed to." ) + protected UriType uri; + + /** + * A name for the specification that is being mapped to. + */ + @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Names what this mapping refers to", formalDefinition="A name for the specification that is being mapped to." ) + protected StringType name; + + /** + * Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. + */ + @Child(name = "comments", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Versions, Issues, Scope limitations etc", formalDefinition="Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage." ) + protected StringType comments; + + private static final long serialVersionUID = 299630820L; + + /* + * Constructor + */ + public StructureDefinitionMappingComponent() { + super(); + } + + /* + * Constructor + */ + public StructureDefinitionMappingComponent(IdType identity) { + super(); + this.identity = identity; + } + + /** + * @return {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value + */ + public IdType getIdentityElement() { + if (this.identity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinitionMappingComponent.identity"); + else if (Configuration.doAutoCreate()) + this.identity = new IdType(); // bb + return this.identity; + } + + public boolean hasIdentityElement() { + return this.identity != null && !this.identity.isEmpty(); + } + + public boolean hasIdentity() { + return this.identity != null && !this.identity.isEmpty(); + } + + /** + * @param value {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value + */ + public StructureDefinitionMappingComponent setIdentityElement(IdType value) { + this.identity = value; + return this; + } + + /** + * @return An Internal id that is used to identify this mapping set when specific mappings are made. + */ + public String getIdentity() { + return this.identity == null ? null : this.identity.getValue(); + } + + /** + * @param value An Internal id that is used to identify this mapping set when specific mappings are made. + */ + public StructureDefinitionMappingComponent setIdentity(String value) { + if (this.identity == null) + this.identity = new IdType(); + this.identity.setValue(value); + return this; + } + + /** + * @return {@link #uri} (An absolute URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value + */ + public UriType getUriElement() { + if (this.uri == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinitionMappingComponent.uri"); + else if (Configuration.doAutoCreate()) + this.uri = new UriType(); // bb + return this.uri; + } + + public boolean hasUriElement() { + return this.uri != null && !this.uri.isEmpty(); + } + + public boolean hasUri() { + return this.uri != null && !this.uri.isEmpty(); + } + + /** + * @param value {@link #uri} (An absolute URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value + */ + public StructureDefinitionMappingComponent setUriElement(UriType value) { + this.uri = value; + return this; + } + + /** + * @return An absolute URI that identifies the specification that this mapping is expressed to. + */ + public String getUri() { + return this.uri == null ? null : this.uri.getValue(); + } + + /** + * @param value An absolute URI that identifies the specification that this mapping is expressed to. + */ + public StructureDefinitionMappingComponent setUri(String value) { + if (Utilities.noString(value)) + this.uri = null; + else { + if (this.uri == null) + this.uri = new UriType(); + this.uri.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A name for the specification that is being mapped to.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinitionMappingComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A name for the specification that is being mapped to.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StructureDefinitionMappingComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A name for the specification that is being mapped to. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A name for the specification that is being mapped to. + */ + public StructureDefinitionMappingComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public StringType getCommentsElement() { + if (this.comments == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinitionMappingComponent.comments"); + else if (Configuration.doAutoCreate()) + this.comments = new StringType(); // bb + return this.comments; + } + + public boolean hasCommentsElement() { + return this.comments != null && !this.comments.isEmpty(); + } + + public boolean hasComments() { + return this.comments != null && !this.comments.isEmpty(); + } + + /** + * @param value {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public StructureDefinitionMappingComponent setCommentsElement(StringType value) { + this.comments = value; + return this; + } + + /** + * @return Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. + */ + public String getComments() { + return this.comments == null ? null : this.comments.getValue(); + } + + /** + * @param value Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. + */ + public StructureDefinitionMappingComponent setComments(String value) { + if (Utilities.noString(value)) + this.comments = null; + else { + if (this.comments == null) + this.comments = new StringType(); + this.comments.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identity", "id", "An Internal id that is used to identify this mapping set when specific mappings are made.", 0, java.lang.Integer.MAX_VALUE, identity)); + childrenList.add(new Property("uri", "uri", "An absolute URI that identifies the specification that this mapping is expressed to.", 0, java.lang.Integer.MAX_VALUE, uri)); + childrenList.add(new Property("name", "string", "A name for the specification that is being mapped to.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("comments", "string", "Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.", 0, java.lang.Integer.MAX_VALUE, comments)); + } + + public StructureDefinitionMappingComponent copy() { + StructureDefinitionMappingComponent dst = new StructureDefinitionMappingComponent(); + copyValues(dst); + dst.identity = identity == null ? null : identity.copy(); + dst.uri = uri == null ? null : uri.copy(); + dst.name = name == null ? null : name.copy(); + dst.comments = comments == null ? null : comments.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StructureDefinitionMappingComponent)) + return false; + StructureDefinitionMappingComponent o = (StructureDefinitionMappingComponent) other; + return compareDeep(identity, o.identity, true) && compareDeep(uri, o.uri, true) && compareDeep(name, o.name, true) + && compareDeep(comments, o.comments, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StructureDefinitionMappingComponent)) + return false; + StructureDefinitionMappingComponent o = (StructureDefinitionMappingComponent) other; + return compareValues(identity, o.identity, true) && compareValues(uri, o.uri, true) && compareValues(name, o.name, true) + && compareValues(comments, o.comments, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identity == null || identity.isEmpty()) && (uri == null || uri.isEmpty()) + && (name == null || name.isEmpty()) && (comments == null || comments.isEmpty()); + } + + } + + @Block() + public static class StructureDefinitionSnapshotComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Captures constraints on each element within the resource. + */ + @Child(name = "element", type = {ElementDefinition.class}, order=1, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Definition of elements in the resource (if no StructureDefinition)", formalDefinition="Captures constraints on each element within the resource." ) + protected List element; + + private static final long serialVersionUID = 53896641L; + + /* + * Constructor + */ + public StructureDefinitionSnapshotComponent() { + super(); + } + + /** + * @return {@link #element} (Captures constraints on each element within the resource.) + */ + public List getElement() { + if (this.element == null) + this.element = new ArrayList(); + return this.element; + } + + public boolean hasElement() { + if (this.element == null) + return false; + for (ElementDefinition item : this.element) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #element} (Captures constraints on each element within the resource.) + */ + // syntactic sugar + public ElementDefinition addElement() { //3 + ElementDefinition t = new ElementDefinition(); + if (this.element == null) + this.element = new ArrayList(); + this.element.add(t); + return t; + } + + // syntactic sugar + public StructureDefinitionSnapshotComponent addElement(ElementDefinition t) { //3 + if (t == null) + return this; + if (this.element == null) + this.element = new ArrayList(); + this.element.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("element", "ElementDefinition", "Captures constraints on each element within the resource.", 0, java.lang.Integer.MAX_VALUE, element)); + } + + public StructureDefinitionSnapshotComponent copy() { + StructureDefinitionSnapshotComponent dst = new StructureDefinitionSnapshotComponent(); + copyValues(dst); + if (element != null) { + dst.element = new ArrayList(); + for (ElementDefinition i : element) + dst.element.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StructureDefinitionSnapshotComponent)) + return false; + StructureDefinitionSnapshotComponent o = (StructureDefinitionSnapshotComponent) other; + return compareDeep(element, o.element, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StructureDefinitionSnapshotComponent)) + return false; + StructureDefinitionSnapshotComponent o = (StructureDefinitionSnapshotComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (element == null || element.isEmpty()); + } + + } + + @Block() + public static class StructureDefinitionDifferentialComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Captures constraints on each element within the resource. + */ + @Child(name = "element", type = {ElementDefinition.class}, order=1, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Definition of elements in the resource (if no StructureDefinition)", formalDefinition="Captures constraints on each element within the resource." ) + protected List element; + + private static final long serialVersionUID = 53896641L; + + /* + * Constructor + */ + public StructureDefinitionDifferentialComponent() { + super(); + } + + /** + * @return {@link #element} (Captures constraints on each element within the resource.) + */ + public List getElement() { + if (this.element == null) + this.element = new ArrayList(); + return this.element; + } + + public boolean hasElement() { + if (this.element == null) + return false; + for (ElementDefinition item : this.element) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #element} (Captures constraints on each element within the resource.) + */ + // syntactic sugar + public ElementDefinition addElement() { //3 + ElementDefinition t = new ElementDefinition(); + if (this.element == null) + this.element = new ArrayList(); + this.element.add(t); + return t; + } + + // syntactic sugar + public StructureDefinitionDifferentialComponent addElement(ElementDefinition t) { //3 + if (t == null) + return this; + if (this.element == null) + this.element = new ArrayList(); + this.element.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("element", "ElementDefinition", "Captures constraints on each element within the resource.", 0, java.lang.Integer.MAX_VALUE, element)); + } + + public StructureDefinitionDifferentialComponent copy() { + StructureDefinitionDifferentialComponent dst = new StructureDefinitionDifferentialComponent(); + copyValues(dst); + if (element != null) { + dst.element = new ArrayList(); + for (ElementDefinition i : element) + dst.element.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StructureDefinitionDifferentialComponent)) + return false; + StructureDefinitionDifferentialComponent o = (StructureDefinitionDifferentialComponent) other; + return compareDeep(element, o.element, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StructureDefinitionDifferentialComponent)) + return false; + StructureDefinitionDifferentialComponent o = (StructureDefinitionDifferentialComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (element == null || element.isEmpty()); + } + + } + + /** + * An absolute URL at which this StructureDefinition is (or will be) published, and which is used to reference this StructureDefinition in extension urls and tag values in operational FHIR systems. + */ + @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1) + @Description(shortDefinition="Literal URL used to reference this StructureDefinition", formalDefinition="An absolute URL at which this StructureDefinition is (or will be) published, and which is used to reference this StructureDefinition in extension urls and tag values in operational FHIR systems." ) + protected UriType url; + + /** + * Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI). + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Other identifiers for the StructureDefinition", formalDefinition="Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI)." ) + protected List identifier; + + /** + * The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Logical id for this version of the StructureDefinition", formalDefinition="The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually." ) + protected StringType version; + + /** + * A free text natural language name identifying the StructureDefinition. + */ + @Child(name = "name", type = {StringType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Informal name for this StructureDefinition", formalDefinition="A free text natural language name identifying the StructureDefinition." ) + protected StringType name; + + /** + * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions. + */ + @Child(name = "useContext", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions." ) + protected List useContext; + + /** + * Defined so that applications can use this name when displaying the value of the extension to the user. + */ + @Child(name = "display", type = {StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Use this name when displaying the value", formalDefinition="Defined so that applications can use this name when displaying the value of the extension to the user." ) + protected StringType display; + + /** + * The name of the individual or organization that published the structure definition. + */ + @Child(name = "publisher", type = {StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the structure definition." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * A free text natural language description of the StructureDefinition and its use. + */ + @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Natural language description of the StructureDefinition", formalDefinition="A free text natural language description of the StructureDefinition and its use." ) + protected StringType description; + + /** + * Explains why this structure definition is needed and why it's been constrained as it has. + */ + @Child(name = "requirements", type = {StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Scope and Usage this structure definition is for", formalDefinition="Explains why this structure definition is needed and why it's been constrained as it has." ) + protected StringType requirements; + + /** + * A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. + */ + @Child(name = "copyright", type = {StringType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Use and/or Publishing restrictions", formalDefinition="A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings." ) + protected StringType copyright; + + /** + * A set of terms from external terminologies that may be used to assist with indexing and searching of templates. + */ + @Child(name = "code", type = {Coding.class}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Assist with indexing and finding", formalDefinition="A set of terms from external terminologies that may be used to assist with indexing and searching of templates." ) + protected List code; + + /** + * The status of the StructureDefinition. + */ + @Child(name = "status", type = {CodeType.class}, order=12, min=1, max=1) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the StructureDefinition." ) + protected Enumeration status; + + /** + * This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name = "experimental", type = {BooleanType.class}, order=13, min=0, max=1) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The date that this version of the StructureDefinition was published. + */ + @Child(name = "date", type = {DateTimeType.class}, order=14, min=0, max=1) + @Description(shortDefinition="Date for this version of the StructureDefinition", formalDefinition="The date that this version of the StructureDefinition was published." ) + protected DateTimeType date; + + /** + * The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.5.0 for this version. + */ + @Child(name = "fhirVersion", type = {IdType.class}, order=15, min=0, max=1) + @Description(shortDefinition="FHIR Version this StructureDefinition targets", formalDefinition="The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.5.0 for this version." ) + protected IdType fhirVersion; + + /** + * An external specification that the content is mapped to. + */ + @Child(name = "mapping", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External specification that the content is mapped to", formalDefinition="An external specification that the content is mapped to." ) + protected List mapping; + + /** + * Defines the type of structure that this definition is describing. + */ + @Child(name = "type", type = {CodeType.class}, order=17, min=1, max=1) + @Description(shortDefinition="type | resource | constraint | extension", formalDefinition="Defines the type of structure that this definition is describing." ) + protected Enumeration type; + + /** + * Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type. + */ + @Child(name = "abstract_", type = {BooleanType.class}, order=18, min=1, max=1) + @Description(shortDefinition="Whether the structure is abstract", formalDefinition="Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type." ) + protected BooleanType abstract_; + + /** + * If this is an extension, Identifies the context within FHIR resources where the extension can be used. + */ + @Child(name = "contextType", type = {CodeType.class}, order=19, min=0, max=1) + @Description(shortDefinition="resource | datatype | mapping | extension", formalDefinition="If this is an extension, Identifies the context within FHIR resources where the extension can be used." ) + protected Enumeration contextType; + + /** + * Identifies the types of resource or data type elements to which the extension can be applied. + */ + @Child(name = "context", type = {StringType.class}, order=20, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Where the extension can be used in instances", formalDefinition="Identifies the types of resource or data type elements to which the extension can be applied." ) + protected List context; + + /** + * An absolute URI that is the base structure from which this set of constraints is derived. + */ + @Child(name = "base", type = {UriType.class}, order=21, min=0, max=1) + @Description(shortDefinition="Structure that this set of constraints applies to", formalDefinition="An absolute URI that is the base structure from which this set of constraints is derived." ) + protected UriType base; + + /** + * A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition. + */ + @Child(name = "snapshot", type = {}, order=22, min=0, max=1) + @Description(shortDefinition="Snapshot view of the structure", formalDefinition="A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition." ) + protected StructureDefinitionSnapshotComponent snapshot; + + /** + * A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies. + */ + @Child(name = "differential", type = {}, order=23, min=0, max=1) + @Description(shortDefinition="Differential view of the structure", formalDefinition="A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies." ) + protected StructureDefinitionDifferentialComponent differential; + + private static final long serialVersionUID = -1935809660L; + + /* + * Constructor + */ + public StructureDefinition() { + super(); + } + + /* + * Constructor + */ + public StructureDefinition(UriType url, StringType name, Enumeration status, Enumeration type, BooleanType abstract_) { + super(); + this.url = url; + this.name = name; + this.status = status; + this.type = type; + this.abstract_ = abstract_; + } + + /** + * @return {@link #url} (An absolute URL at which this StructureDefinition is (or will be) published, and which is used to reference this StructureDefinition in extension urls and tag values in operational FHIR systems.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute URL at which this StructureDefinition is (or will be) published, and which is used to reference this StructureDefinition in extension urls and tag values in operational FHIR systems.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public StructureDefinition setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute URL at which this StructureDefinition is (or will be) published, and which is used to reference this StructureDefinition in extension urls and tag values in operational FHIR systems. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute URL at which this StructureDefinition is (or will be) published, and which is used to reference this StructureDefinition in extension urls and tag values in operational FHIR systems. + */ + public StructureDefinition setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + /** + * @return {@link #identifier} (Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public StructureDefinition addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #version} (The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StructureDefinition setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually. + */ + public StructureDefinition setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A free text natural language name identifying the StructureDefinition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A free text natural language name identifying the StructureDefinition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StructureDefinition setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name identifying the StructureDefinition. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name identifying the StructureDefinition. + */ + public StructureDefinition setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions.) + */ + public List getUseContext() { + if (this.useContext == null) + this.useContext = new ArrayList(); + return this.useContext; + } + + public boolean hasUseContext() { + if (this.useContext == null) + return false; + for (CodeableConcept item : this.useContext) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions.) + */ + // syntactic sugar + public CodeableConcept addUseContext() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return t; + } + + // syntactic sugar + public StructureDefinition addUseContext(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return this; + } + + /** + * @return {@link #display} (Defined so that applications can use this name when displaying the value of the extension to the user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); // bb + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (Defined so that applications can use this name when displaying the value of the extension to the user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StructureDefinition setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return Defined so that applications can use this name when displaying the value of the extension to the user. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value Defined so that applications can use this name when displaying the value of the extension to the user. + */ + public StructureDefinition setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the structure definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the structure definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StructureDefinition setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the structure definition. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the structure definition. + */ + public StructureDefinition setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (StructureDefinitionContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public StructureDefinitionContactComponent addContact() { //3 + StructureDefinitionContactComponent t = new StructureDefinitionContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public StructureDefinition addContact(StructureDefinitionContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #description} (A free text natural language description of the StructureDefinition and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (A free text natural language description of the StructureDefinition and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StructureDefinition setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the StructureDefinition and its use. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the StructureDefinition and its use. + */ + public StructureDefinition setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #requirements} (Explains why this structure definition is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); // bb + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (Explains why this structure definition is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StructureDefinition setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return Explains why this structure definition is needed and why it's been constrained as it has. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value Explains why this structure definition is needed and why it's been constrained as it has. + */ + public StructureDefinition setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #copyright} (A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public StringType getCopyrightElement() { + if (this.copyright == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.copyright"); + else if (Configuration.doAutoCreate()) + this.copyright = new StringType(); // bb + return this.copyright; + } + + public boolean hasCopyrightElement() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + public boolean hasCopyright() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + /** + * @param value {@link #copyright} (A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public StructureDefinition setCopyrightElement(StringType value) { + this.copyright = value; + return this; + } + + /** + * @return A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. + */ + public String getCopyright() { + return this.copyright == null ? null : this.copyright.getValue(); + } + + /** + * @param value A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. + */ + public StructureDefinition setCopyright(String value) { + if (Utilities.noString(value)) + this.copyright = null; + else { + if (this.copyright == null) + this.copyright = new StringType(); + this.copyright.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (A set of terms from external terminologies that may be used to assist with indexing and searching of templates.) + */ + public List getCode() { + if (this.code == null) + this.code = new ArrayList(); + return this.code; + } + + public boolean hasCode() { + if (this.code == null) + return false; + for (Coding item : this.code) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #code} (A set of terms from external terminologies that may be used to assist with indexing and searching of templates.) + */ + // syntactic sugar + public Coding addCode() { //3 + Coding t = new Coding(); + if (this.code == null) + this.code = new ArrayList(); + this.code.add(t); + return t; + } + + // syntactic sugar + public StructureDefinition addCode(Coding t) { //3 + if (t == null) + return this; + if (this.code == null) + this.code = new ArrayList(); + this.code.add(t); + return this; + } + + /** + * @return {@link #status} (The status of the StructureDefinition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status of the StructureDefinition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public StructureDefinition setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the StructureDefinition. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the StructureDefinition. + */ + public StructureDefinition setStatus(ConformanceResourceStatus value) { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #experimental} (This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public StructureDefinition setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public StructureDefinition setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #date} (The date that this version of the StructureDefinition was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date that this version of the StructureDefinition was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public StructureDefinition setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date that this version of the StructureDefinition was published. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date that this version of the StructureDefinition was published. + */ + public StructureDefinition setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #fhirVersion} (The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.5.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value + */ + public IdType getFhirVersionElement() { + if (this.fhirVersion == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.fhirVersion"); + else if (Configuration.doAutoCreate()) + this.fhirVersion = new IdType(); // bb + return this.fhirVersion; + } + + public boolean hasFhirVersionElement() { + return this.fhirVersion != null && !this.fhirVersion.isEmpty(); + } + + public boolean hasFhirVersion() { + return this.fhirVersion != null && !this.fhirVersion.isEmpty(); + } + + /** + * @param value {@link #fhirVersion} (The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.5.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value + */ + public StructureDefinition setFhirVersionElement(IdType value) { + this.fhirVersion = value; + return this; + } + + /** + * @return The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.5.0 for this version. + */ + public String getFhirVersion() { + return this.fhirVersion == null ? null : this.fhirVersion.getValue(); + } + + /** + * @param value The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.5.0 for this version. + */ + public StructureDefinition setFhirVersion(String value) { + if (Utilities.noString(value)) + this.fhirVersion = null; + else { + if (this.fhirVersion == null) + this.fhirVersion = new IdType(); + this.fhirVersion.setValue(value); + } + return this; + } + + /** + * @return {@link #mapping} (An external specification that the content is mapped to.) + */ + public List getMapping() { + if (this.mapping == null) + this.mapping = new ArrayList(); + return this.mapping; + } + + public boolean hasMapping() { + if (this.mapping == null) + return false; + for (StructureDefinitionMappingComponent item : this.mapping) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #mapping} (An external specification that the content is mapped to.) + */ + // syntactic sugar + public StructureDefinitionMappingComponent addMapping() { //3 + StructureDefinitionMappingComponent t = new StructureDefinitionMappingComponent(); + if (this.mapping == null) + this.mapping = new ArrayList(); + this.mapping.add(t); + return t; + } + + // syntactic sugar + public StructureDefinition addMapping(StructureDefinitionMappingComponent t) { //3 + if (t == null) + return this; + if (this.mapping == null) + this.mapping = new ArrayList(); + this.mapping.add(t); + return this; + } + + /** + * @return {@link #type} (Defines the type of structure that this definition is describing.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new StructureDefinitionTypeEnumFactory()); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Defines the type of structure that this definition is describing.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public StructureDefinition setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Defines the type of structure that this definition is describing. + */ + public StructureDefinitionType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Defines the type of structure that this definition is describing. + */ + public StructureDefinition setType(StructureDefinitionType value) { + if (this.type == null) + this.type = new Enumeration(new StructureDefinitionTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #abstract_} (Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value + */ + public BooleanType getAbstractElement() { + if (this.abstract_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.abstract_"); + else if (Configuration.doAutoCreate()) + this.abstract_ = new BooleanType(); // bb + return this.abstract_; + } + + public boolean hasAbstractElement() { + return this.abstract_ != null && !this.abstract_.isEmpty(); + } + + public boolean hasAbstract() { + return this.abstract_ != null && !this.abstract_.isEmpty(); + } + + /** + * @param value {@link #abstract_} (Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value + */ + public StructureDefinition setAbstractElement(BooleanType value) { + this.abstract_ = value; + return this; + } + + /** + * @return Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type. + */ + public boolean getAbstract() { + return this.abstract_ == null || this.abstract_.isEmpty() ? false : this.abstract_.getValue(); + } + + /** + * @param value Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type. + */ + public StructureDefinition setAbstract(boolean value) { + if (this.abstract_ == null) + this.abstract_ = new BooleanType(); + this.abstract_.setValue(value); + return this; + } + + /** + * @return {@link #contextType} (If this is an extension, Identifies the context within FHIR resources where the extension can be used.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value + */ + public Enumeration getContextTypeElement() { + if (this.contextType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.contextType"); + else if (Configuration.doAutoCreate()) + this.contextType = new Enumeration(new ExtensionContextEnumFactory()); // bb + return this.contextType; + } + + public boolean hasContextTypeElement() { + return this.contextType != null && !this.contextType.isEmpty(); + } + + public boolean hasContextType() { + return this.contextType != null && !this.contextType.isEmpty(); + } + + /** + * @param value {@link #contextType} (If this is an extension, Identifies the context within FHIR resources where the extension can be used.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value + */ + public StructureDefinition setContextTypeElement(Enumeration value) { + this.contextType = value; + return this; + } + + /** + * @return If this is an extension, Identifies the context within FHIR resources where the extension can be used. + */ + public ExtensionContext getContextType() { + return this.contextType == null ? null : this.contextType.getValue(); + } + + /** + * @param value If this is an extension, Identifies the context within FHIR resources where the extension can be used. + */ + public StructureDefinition setContextType(ExtensionContext value) { + if (value == null) + this.contextType = null; + else { + if (this.contextType == null) + this.contextType = new Enumeration(new ExtensionContextEnumFactory()); + this.contextType.setValue(value); + } + return this; + } + + /** + * @return {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) + */ + public List getContext() { + if (this.context == null) + this.context = new ArrayList(); + return this.context; + } + + public boolean hasContext() { + if (this.context == null) + return false; + for (StringType item : this.context) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) + */ + // syntactic sugar + public StringType addContextElement() {//2 + StringType t = new StringType(); + if (this.context == null) + this.context = new ArrayList(); + this.context.add(t); + return t; + } + + /** + * @param value {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) + */ + public StructureDefinition addContext(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.context == null) + this.context = new ArrayList(); + this.context.add(t); + return this; + } + + /** + * @param value {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) + */ + public boolean hasContext(String value) { + if (this.context == null) + return false; + for (StringType v : this.context) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #base} (An absolute URI that is the base structure from which this set of constraints is derived.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public UriType getBaseElement() { + if (this.base == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.base"); + else if (Configuration.doAutoCreate()) + this.base = new UriType(); // bb + return this.base; + } + + public boolean hasBaseElement() { + return this.base != null && !this.base.isEmpty(); + } + + public boolean hasBase() { + return this.base != null && !this.base.isEmpty(); + } + + /** + * @param value {@link #base} (An absolute URI that is the base structure from which this set of constraints is derived.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public StructureDefinition setBaseElement(UriType value) { + this.base = value; + return this; + } + + /** + * @return An absolute URI that is the base structure from which this set of constraints is derived. + */ + public String getBase() { + return this.base == null ? null : this.base.getValue(); + } + + /** + * @param value An absolute URI that is the base structure from which this set of constraints is derived. + */ + public StructureDefinition setBase(String value) { + if (Utilities.noString(value)) + this.base = null; + else { + if (this.base == null) + this.base = new UriType(); + this.base.setValue(value); + } + return this; + } + + /** + * @return {@link #snapshot} (A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition.) + */ + public StructureDefinitionSnapshotComponent getSnapshot() { + if (this.snapshot == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.snapshot"); + else if (Configuration.doAutoCreate()) + this.snapshot = new StructureDefinitionSnapshotComponent(); // cc + return this.snapshot; + } + + public boolean hasSnapshot() { + return this.snapshot != null && !this.snapshot.isEmpty(); + } + + /** + * @param value {@link #snapshot} (A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition.) + */ + public StructureDefinition setSnapshot(StructureDefinitionSnapshotComponent value) { + this.snapshot = value; + return this; + } + + /** + * @return {@link #differential} (A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies.) + */ + public StructureDefinitionDifferentialComponent getDifferential() { + if (this.differential == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.differential"); + else if (Configuration.doAutoCreate()) + this.differential = new StructureDefinitionDifferentialComponent(); // cc + return this.differential; + } + + public boolean hasDifferential() { + return this.differential != null && !this.differential.isEmpty(); + } + + /** + * @param value {@link #differential} (A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies.) + */ + public StructureDefinition setDifferential(StructureDefinitionDifferentialComponent value) { + this.differential = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute URL at which this StructureDefinition is (or will be) published, and which is used to reference this StructureDefinition in extension urls and tag values in operational FHIR systems.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "A free text natural language name identifying the StructureDefinition.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions.", 0, java.lang.Integer.MAX_VALUE, useContext)); + childrenList.add(new Property("display", "string", "Defined so that applications can use this name when displaying the value of the extension to the user.", 0, java.lang.Integer.MAX_VALUE, display)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the structure definition.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("description", "string", "A free text natural language description of the StructureDefinition and its use.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("requirements", "string", "Explains why this structure definition is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("copyright", "string", "A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.", 0, java.lang.Integer.MAX_VALUE, copyright)); + childrenList.add(new Property("code", "Coding", "A set of terms from external terminologies that may be used to assist with indexing and searching of templates.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("status", "code", "The status of the StructureDefinition.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("date", "dateTime", "The date that this version of the StructureDefinition was published.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.5.0 for this version.", 0, java.lang.Integer.MAX_VALUE, fhirVersion)); + childrenList.add(new Property("mapping", "", "An external specification that the content is mapped to.", 0, java.lang.Integer.MAX_VALUE, mapping)); + childrenList.add(new Property("type", "code", "Defines the type of structure that this definition is describing.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("abstract", "boolean", "Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type.", 0, java.lang.Integer.MAX_VALUE, abstract_)); + childrenList.add(new Property("contextType", "code", "If this is an extension, Identifies the context within FHIR resources where the extension can be used.", 0, java.lang.Integer.MAX_VALUE, contextType)); + childrenList.add(new Property("context", "string", "Identifies the types of resource or data type elements to which the extension can be applied.", 0, java.lang.Integer.MAX_VALUE, context)); + childrenList.add(new Property("base", "uri", "An absolute URI that is the base structure from which this set of constraints is derived.", 0, java.lang.Integer.MAX_VALUE, base)); + childrenList.add(new Property("snapshot", "", "A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition.", 0, java.lang.Integer.MAX_VALUE, snapshot)); + childrenList.add(new Property("differential", "", "A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies.", 0, java.lang.Integer.MAX_VALUE, differential)); + } + + public StructureDefinition copy() { + StructureDefinition dst = new StructureDefinition(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + if (useContext != null) { + dst.useContext = new ArrayList(); + for (CodeableConcept i : useContext) + dst.useContext.add(i.copy()); + }; + dst.display = display == null ? null : display.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (StructureDefinitionContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + dst.requirements = requirements == null ? null : requirements.copy(); + dst.copyright = copyright == null ? null : copyright.copy(); + if (code != null) { + dst.code = new ArrayList(); + for (Coding i : code) + dst.code.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.date = date == null ? null : date.copy(); + dst.fhirVersion = fhirVersion == null ? null : fhirVersion.copy(); + if (mapping != null) { + dst.mapping = new ArrayList(); + for (StructureDefinitionMappingComponent i : mapping) + dst.mapping.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + dst.abstract_ = abstract_ == null ? null : abstract_.copy(); + dst.contextType = contextType == null ? null : contextType.copy(); + if (context != null) { + dst.context = new ArrayList(); + for (StringType i : context) + dst.context.add(i.copy()); + }; + dst.base = base == null ? null : base.copy(); + dst.snapshot = snapshot == null ? null : snapshot.copy(); + dst.differential = differential == null ? null : differential.copy(); + return dst; + } + + protected StructureDefinition typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StructureDefinition)) + return false; + StructureDefinition o = (StructureDefinition) other; + return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) + && compareDeep(name, o.name, true) && compareDeep(useContext, o.useContext, true) && compareDeep(display, o.display, true) + && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(description, o.description, true) + && compareDeep(requirements, o.requirements, true) && compareDeep(copyright, o.copyright, true) + && compareDeep(code, o.code, true) && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) + && compareDeep(date, o.date, true) && compareDeep(fhirVersion, o.fhirVersion, true) && compareDeep(mapping, o.mapping, true) + && compareDeep(type, o.type, true) && compareDeep(abstract_, o.abstract_, true) && compareDeep(contextType, o.contextType, true) + && compareDeep(context, o.context, true) && compareDeep(base, o.base, true) && compareDeep(snapshot, o.snapshot, true) + && compareDeep(differential, o.differential, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StructureDefinition)) + return false; + StructureDefinition o = (StructureDefinition) other; + return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) + && compareValues(display, o.display, true) && compareValues(publisher, o.publisher, true) && compareValues(description, o.description, true) + && compareValues(requirements, o.requirements, true) && compareValues(copyright, o.copyright, true) + && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(date, o.date, true) + && compareValues(fhirVersion, o.fhirVersion, true) && compareValues(type, o.type, true) && compareValues(abstract_, o.abstract_, true) + && compareValues(contextType, o.contextType, true) && compareValues(context, o.context, true) && compareValues(base, o.base, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (useContext == null || useContext.isEmpty()) + && (display == null || display.isEmpty()) && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) + && (description == null || description.isEmpty()) && (requirements == null || requirements.isEmpty()) + && (copyright == null || copyright.isEmpty()) && (code == null || code.isEmpty()) && (status == null || status.isEmpty()) + && (experimental == null || experimental.isEmpty()) && (date == null || date.isEmpty()) && (fhirVersion == null || fhirVersion.isEmpty()) + && (mapping == null || mapping.isEmpty()) && (type == null || type.isEmpty()) && (abstract_ == null || abstract_.isEmpty()) + && (contextType == null || contextType.isEmpty()) && (context == null || context.isEmpty()) + && (base == null || base.isEmpty()) && (snapshot == null || snapshot.isEmpty()) && (differential == null || differential.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.StructureDefinition; + } + + @SearchParamDefinition(name="date", path="StructureDefinition.date", description="The profile publication date", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="StructureDefinition.identifier", description="The identifier of the profile", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="code", path="StructureDefinition.code", description="A code for the profile", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="valueset", path="StructureDefinition.snapshot.element.binding.valueSet[x]", description="A vocabulary binding reference", type="reference" ) + public static final String SP_VALUESET = "valueset"; + @SearchParamDefinition(name="display", path="StructureDefinition.display", description="Use this name when displaying the value", type="string" ) + public static final String SP_DISPLAY = "display"; + @SearchParamDefinition(name="description", path="StructureDefinition.description", description="Text search in the description of the profile", type="string" ) + public static final String SP_DESCRIPTION = "description"; + @SearchParamDefinition(name="experimental", path="StructureDefinition.experimental", description="If for testing purposes, not real usage", type="token" ) + public static final String SP_EXPERIMENTAL = "experimental"; + @SearchParamDefinition(name="context-type", path="StructureDefinition.contextType", description="resource | datatype | mapping | extension", type="token" ) + public static final String SP_CONTEXTTYPE = "context-type"; + @SearchParamDefinition(name="abstract", path="StructureDefinition.abstract", description="Whether the structure is abstract", type="token" ) + public static final String SP_ABSTRACT = "abstract"; + @SearchParamDefinition(name="type", path="StructureDefinition.type", description="type | resource | constraint | extension", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="version", path="StructureDefinition.version", description="The version identifier of the profile", type="token" ) + public static final String SP_VERSION = "version"; + @SearchParamDefinition(name="url", path="StructureDefinition.url", description="Literal URL used to reference this StructureDefinition", type="uri" ) + public static final String SP_URL = "url"; + @SearchParamDefinition(name="path", path="StructureDefinition.snapshot.element.path|StructureDefinition.differential.element.path", description="A path that is constrained in the profile", type="token" ) + public static final String SP_PATH = "path"; + @SearchParamDefinition(name="ext-context", path="StructureDefinition.context", description="Where the extension can be used in instances", type="string" ) + public static final String SP_EXTCONTEXT = "ext-context"; + @SearchParamDefinition(name="name", path="StructureDefinition.name", description="Name of the profile", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="context", path="StructureDefinition.useContext", description="A use context assigned to the structure", type="token" ) + public static final String SP_CONTEXT = "context"; + @SearchParamDefinition(name="publisher", path="StructureDefinition.publisher", description="Name of the publisher of the profile", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + @SearchParamDefinition(name="status", path="StructureDefinition.status", description="The current status of the profile", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="base", path="StructureDefinition.base", description="Structure that this set of constraints applies to", type="uri" ) + public static final String SP_BASE = "base"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Subscription.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Subscription.java index 7610eab46ce..b019afaf05f 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Subscription.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Subscription.java @@ -1,1069 +1,1048 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system is able to take an appropriate action. - */ -@ResourceDef(name="Subscription", profile="http://hl7.org/fhir/Profile/Subscription") -public class Subscription extends DomainResource { - - public enum SubscriptionStatus { - /** - * The client has requested the subscription, and the server has not yet set it up. - */ - REQUESTED, - /** - * The subscription is active. - */ - ACTIVE, - /** - * The server has an error executing the notification. - */ - ERROR, - /** - * Too many errors have occurred or the subscription has expired. - */ - OFF, - /** - * added to help the parsers - */ - NULL; - public static SubscriptionStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return REQUESTED; - if ("active".equals(codeString)) - return ACTIVE; - if ("error".equals(codeString)) - return ERROR; - if ("off".equals(codeString)) - return OFF; - throw new Exception("Unknown SubscriptionStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case REQUESTED: return "requested"; - case ACTIVE: return "active"; - case ERROR: return "error"; - case OFF: return "off"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REQUESTED: return ""; - case ACTIVE: return ""; - case ERROR: return ""; - case OFF: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REQUESTED: return "The client has requested the subscription, and the server has not yet set it up."; - case ACTIVE: return "The subscription is active."; - case ERROR: return "The server has an error executing the notification."; - case OFF: return "Too many errors have occurred or the subscription has expired."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REQUESTED: return "Requested"; - case ACTIVE: return "Active"; - case ERROR: return "Error"; - case OFF: return "Off"; - default: return "?"; - } - } - } - - public static class SubscriptionStatusEnumFactory implements EnumFactory { - public SubscriptionStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return SubscriptionStatus.REQUESTED; - if ("active".equals(codeString)) - return SubscriptionStatus.ACTIVE; - if ("error".equals(codeString)) - return SubscriptionStatus.ERROR; - if ("off".equals(codeString)) - return SubscriptionStatus.OFF; - throw new IllegalArgumentException("Unknown SubscriptionStatus code '"+codeString+"'"); - } - public String toCode(SubscriptionStatus code) { - if (code == SubscriptionStatus.REQUESTED) - return "requested"; - if (code == SubscriptionStatus.ACTIVE) - return "active"; - if (code == SubscriptionStatus.ERROR) - return "error"; - if (code == SubscriptionStatus.OFF) - return "off"; - return "?"; - } - } - - public enum SubscriptionChannelType { - /** - * The channel is executed by making a post to the URI. If a payload is included, the URL is interpreted as the service base, and an update (PUT) is made. - */ - RESTHOOK, - /** - * The channel is executed by sending a packet across a web socket connection maintained by the client. The URL identifies the websocket, and the client binds to this URL. - */ - WEBSOCKET, - /** - * The channel is executed by sending an email to the email addressed in the URI (which must be a mailto:). - */ - EMAIL, - /** - * The channel is executed by sending an SMS message to the phone number identified in the URL (tel:). - */ - SMS, - /** - * The channel Is executed by sending a message (e.g. a Bundle with a MessageHeader resource etc) to the application identified in the URI. - */ - MESSAGE, - /** - * added to help the parsers - */ - NULL; - public static SubscriptionChannelType fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("rest-hook".equals(codeString)) - return RESTHOOK; - if ("websocket".equals(codeString)) - return WEBSOCKET; - if ("email".equals(codeString)) - return EMAIL; - if ("sms".equals(codeString)) - return SMS; - if ("message".equals(codeString)) - return MESSAGE; - throw new Exception("Unknown SubscriptionChannelType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case RESTHOOK: return "rest-hook"; - case WEBSOCKET: return "websocket"; - case EMAIL: return "email"; - case SMS: return "sms"; - case MESSAGE: return "message"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case RESTHOOK: return ""; - case WEBSOCKET: return ""; - case EMAIL: return ""; - case SMS: return ""; - case MESSAGE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case RESTHOOK: return "The channel is executed by making a post to the URI. If a payload is included, the URL is interpreted as the service base, and an update (PUT) is made."; - case WEBSOCKET: return "The channel is executed by sending a packet across a web socket connection maintained by the client. The URL identifies the websocket, and the client binds to this URL."; - case EMAIL: return "The channel is executed by sending an email to the email addressed in the URI (which must be a mailto:)."; - case SMS: return "The channel is executed by sending an SMS message to the phone number identified in the URL (tel:)."; - case MESSAGE: return "The channel Is executed by sending a message (e.g. a Bundle with a MessageHeader resource etc) to the application identified in the URI."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case RESTHOOK: return "Rest Hook"; - case WEBSOCKET: return "Websocket"; - case EMAIL: return "Email"; - case SMS: return "Sms"; - case MESSAGE: return "Message"; - default: return "?"; - } - } - } - - public static class SubscriptionChannelTypeEnumFactory implements EnumFactory { - public SubscriptionChannelType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("rest-hook".equals(codeString)) - return SubscriptionChannelType.RESTHOOK; - if ("websocket".equals(codeString)) - return SubscriptionChannelType.WEBSOCKET; - if ("email".equals(codeString)) - return SubscriptionChannelType.EMAIL; - if ("sms".equals(codeString)) - return SubscriptionChannelType.SMS; - if ("message".equals(codeString)) - return SubscriptionChannelType.MESSAGE; - throw new IllegalArgumentException("Unknown SubscriptionChannelType code '"+codeString+"'"); - } - public String toCode(SubscriptionChannelType code) { - if (code == SubscriptionChannelType.RESTHOOK) - return "rest-hook"; - if (code == SubscriptionChannelType.WEBSOCKET) - return "websocket"; - if (code == SubscriptionChannelType.EMAIL) - return "email"; - if (code == SubscriptionChannelType.SMS) - return "sms"; - if (code == SubscriptionChannelType.MESSAGE) - return "message"; - return "?"; - } - } - - @Block() - public static class SubscriptionChannelComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The type of channel to send notififcations on. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="rest-hook | websocket | email | sms | message", formalDefinition="The type of channel to send notififcations on." ) - protected Enumeration type; - - /** - * The uri that describes tha actual end point to send messages to. - */ - @Child(name = "endpoint", type = {UriType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Where the channel points to", formalDefinition="The uri that describes tha actual end point to send messages to." ) - protected UriType endpoint; - - /** - * The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification. - */ - @Child(name = "payload", type = {StringType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Mimetype to send, or blank for no payload", formalDefinition="The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification." ) - protected StringType payload; - - /** - * Additional headers / information to send as part of the notification. - */ - @Child(name = "header", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Usage depends on the channel type", formalDefinition="Additional headers / information to send as part of the notification." ) - protected StringType header; - - private static final long serialVersionUID = -279715391L; - - /* - * Constructor - */ - public SubscriptionChannelComponent() { - super(); - } - - /* - * Constructor - */ - public SubscriptionChannelComponent(Enumeration type, StringType payload) { - super(); - this.type = type; - this.payload = payload; - } - - /** - * @return {@link #type} (The type of channel to send notififcations on.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubscriptionChannelComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new SubscriptionChannelTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of channel to send notififcations on.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public SubscriptionChannelComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The type of channel to send notififcations on. - */ - public SubscriptionChannelType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of channel to send notififcations on. - */ - public SubscriptionChannelComponent setType(SubscriptionChannelType value) { - if (this.type == null) - this.type = new Enumeration(new SubscriptionChannelTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #endpoint} (The uri that describes tha actual end point to send messages to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value - */ - public UriType getEndpointElement() { - if (this.endpoint == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubscriptionChannelComponent.endpoint"); - else if (Configuration.doAutoCreate()) - this.endpoint = new UriType(); // bb - return this.endpoint; - } - - public boolean hasEndpointElement() { - return this.endpoint != null && !this.endpoint.isEmpty(); - } - - public boolean hasEndpoint() { - return this.endpoint != null && !this.endpoint.isEmpty(); - } - - /** - * @param value {@link #endpoint} (The uri that describes tha actual end point to send messages to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value - */ - public SubscriptionChannelComponent setEndpointElement(UriType value) { - this.endpoint = value; - return this; - } - - /** - * @return The uri that describes tha actual end point to send messages to. - */ - public String getEndpoint() { - return this.endpoint == null ? null : this.endpoint.getValue(); - } - - /** - * @param value The uri that describes tha actual end point to send messages to. - */ - public SubscriptionChannelComponent setEndpoint(String value) { - if (Utilities.noString(value)) - this.endpoint = null; - else { - if (this.endpoint == null) - this.endpoint = new UriType(); - this.endpoint.setValue(value); - } - return this; - } - - /** - * @return {@link #payload} (The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification.). This is the underlying object with id, value and extensions. The accessor "getPayload" gives direct access to the value - */ - public StringType getPayloadElement() { - if (this.payload == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubscriptionChannelComponent.payload"); - else if (Configuration.doAutoCreate()) - this.payload = new StringType(); // bb - return this.payload; - } - - public boolean hasPayloadElement() { - return this.payload != null && !this.payload.isEmpty(); - } - - public boolean hasPayload() { - return this.payload != null && !this.payload.isEmpty(); - } - - /** - * @param value {@link #payload} (The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification.). This is the underlying object with id, value and extensions. The accessor "getPayload" gives direct access to the value - */ - public SubscriptionChannelComponent setPayloadElement(StringType value) { - this.payload = value; - return this; - } - - /** - * @return The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification. - */ - public String getPayload() { - return this.payload == null ? null : this.payload.getValue(); - } - - /** - * @param value The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification. - */ - public SubscriptionChannelComponent setPayload(String value) { - if (this.payload == null) - this.payload = new StringType(); - this.payload.setValue(value); - return this; - } - - /** - * @return {@link #header} (Additional headers / information to send as part of the notification.). This is the underlying object with id, value and extensions. The accessor "getHeader" gives direct access to the value - */ - public StringType getHeaderElement() { - if (this.header == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubscriptionChannelComponent.header"); - else if (Configuration.doAutoCreate()) - this.header = new StringType(); // bb - return this.header; - } - - public boolean hasHeaderElement() { - return this.header != null && !this.header.isEmpty(); - } - - public boolean hasHeader() { - return this.header != null && !this.header.isEmpty(); - } - - /** - * @param value {@link #header} (Additional headers / information to send as part of the notification.). This is the underlying object with id, value and extensions. The accessor "getHeader" gives direct access to the value - */ - public SubscriptionChannelComponent setHeaderElement(StringType value) { - this.header = value; - return this; - } - - /** - * @return Additional headers / information to send as part of the notification. - */ - public String getHeader() { - return this.header == null ? null : this.header.getValue(); - } - - /** - * @param value Additional headers / information to send as part of the notification. - */ - public SubscriptionChannelComponent setHeader(String value) { - if (Utilities.noString(value)) - this.header = null; - else { - if (this.header == null) - this.header = new StringType(); - this.header.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "The type of channel to send notififcations on.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("endpoint", "uri", "The uri that describes tha actual end point to send messages to.", 0, java.lang.Integer.MAX_VALUE, endpoint)); - childrenList.add(new Property("payload", "string", "The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification.", 0, java.lang.Integer.MAX_VALUE, payload)); - childrenList.add(new Property("header", "string", "Additional headers / information to send as part of the notification.", 0, java.lang.Integer.MAX_VALUE, header)); - } - - public SubscriptionChannelComponent copy() { - SubscriptionChannelComponent dst = new SubscriptionChannelComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.endpoint = endpoint == null ? null : endpoint.copy(); - dst.payload = payload == null ? null : payload.copy(); - dst.header = header == null ? null : header.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SubscriptionChannelComponent)) - return false; - SubscriptionChannelComponent o = (SubscriptionChannelComponent) other; - return compareDeep(type, o.type, true) && compareDeep(endpoint, o.endpoint, true) && compareDeep(payload, o.payload, true) - && compareDeep(header, o.header, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SubscriptionChannelComponent)) - return false; - SubscriptionChannelComponent o = (SubscriptionChannelComponent) other; - return compareValues(type, o.type, true) && compareValues(endpoint, o.endpoint, true) && compareValues(payload, o.payload, true) - && compareValues(header, o.header, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (endpoint == null || endpoint.isEmpty()) - && (payload == null || payload.isEmpty()) && (header == null || header.isEmpty()); - } - - } - - /** - * The rules that the server should use to determine when to generate notifications for this subscription. - */ - @Child(name = "criteria", type = {StringType.class}, order=0, min=1, max=1) - @Description(shortDefinition="Rule for server push criteria", formalDefinition="The rules that the server should use to determine when to generate notifications for this subscription." ) - protected StringType criteria; - - /** - * Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting. - */ - @Child(name = "contact", type = {ContactPoint.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details for source (e.g. troubleshooting)", formalDefinition="Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting." ) - protected List contact; - - /** - * A description of why this subscription is defined. - */ - @Child(name = "reason", type = {StringType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Description of why this subscription was created", formalDefinition="A description of why this subscription is defined." ) - protected StringType reason; - - /** - * The status of the subscription, which marks the server state for managing the subscription. - */ - @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1) - @Description(shortDefinition="requested | active | error | off", formalDefinition="The status of the subscription, which marks the server state for managing the subscription." ) - protected Enumeration status; - - /** - * A record of the last error that occurred when the server processed a notification. - */ - @Child(name = "error", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Latest error note", formalDefinition="A record of the last error that occurred when the server processed a notification." ) - protected StringType error; - - /** - * Details where to send notifications when resources are received that meet the criteria. - */ - @Child(name = "channel", type = {}, order=5, min=1, max=1) - @Description(shortDefinition="The channel on which to report matches to the criteria", formalDefinition="Details where to send notifications when resources are received that meet the criteria." ) - protected SubscriptionChannelComponent channel; - - /** - * The time for the server to turn the subscription off. - */ - @Child(name = "end", type = {InstantType.class}, order=6, min=0, max=1) - @Description(shortDefinition="When to automatically delete the subscription", formalDefinition="The time for the server to turn the subscription off." ) - protected InstantType end; - - /** - * A tag to add to any resource that matches the criteria, after the subscription is processed. - */ - @Child(name = "tag", type = {Coding.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A tag to add to matching resources", formalDefinition="A tag to add to any resource that matches the criteria, after the subscription is processed." ) - protected List tag; - - private static final long serialVersionUID = -1390870804L; - - /* - * Constructor - */ - public Subscription() { - super(); - } - - /* - * Constructor - */ - public Subscription(StringType criteria, StringType reason, Enumeration status, SubscriptionChannelComponent channel) { - super(); - this.criteria = criteria; - this.reason = reason; - this.status = status; - this.channel = channel; - } - - /** - * @return {@link #criteria} (The rules that the server should use to determine when to generate notifications for this subscription.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value - */ - public StringType getCriteriaElement() { - if (this.criteria == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Subscription.criteria"); - else if (Configuration.doAutoCreate()) - this.criteria = new StringType(); // bb - return this.criteria; - } - - public boolean hasCriteriaElement() { - return this.criteria != null && !this.criteria.isEmpty(); - } - - public boolean hasCriteria() { - return this.criteria != null && !this.criteria.isEmpty(); - } - - /** - * @param value {@link #criteria} (The rules that the server should use to determine when to generate notifications for this subscription.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value - */ - public Subscription setCriteriaElement(StringType value) { - this.criteria = value; - return this; - } - - /** - * @return The rules that the server should use to determine when to generate notifications for this subscription. - */ - public String getCriteria() { - return this.criteria == null ? null : this.criteria.getValue(); - } - - /** - * @param value The rules that the server should use to determine when to generate notifications for this subscription. - */ - public Subscription setCriteria(String value) { - if (this.criteria == null) - this.criteria = new StringType(); - this.criteria.setValue(value); - return this; - } - - /** - * @return {@link #contact} (Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (ContactPoint item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting.) - */ - // syntactic sugar - public ContactPoint addContact() { //3 - ContactPoint t = new ContactPoint(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public Subscription addContact(ContactPoint t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #reason} (A description of why this subscription is defined.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value - */ - public StringType getReasonElement() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Subscription.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new StringType(); // bb - return this.reason; - } - - public boolean hasReasonElement() { - return this.reason != null && !this.reason.isEmpty(); - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (A description of why this subscription is defined.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value - */ - public Subscription setReasonElement(StringType value) { - this.reason = value; - return this; - } - - /** - * @return A description of why this subscription is defined. - */ - public String getReason() { - return this.reason == null ? null : this.reason.getValue(); - } - - /** - * @param value A description of why this subscription is defined. - */ - public Subscription setReason(String value) { - if (this.reason == null) - this.reason = new StringType(); - this.reason.setValue(value); - return this; - } - - /** - * @return {@link #status} (The status of the subscription, which marks the server state for managing the subscription.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Subscription.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new SubscriptionStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the subscription, which marks the server state for managing the subscription.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Subscription setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the subscription, which marks the server state for managing the subscription. - */ - public SubscriptionStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the subscription, which marks the server state for managing the subscription. - */ - public Subscription setStatus(SubscriptionStatus value) { - if (this.status == null) - this.status = new Enumeration(new SubscriptionStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #error} (A record of the last error that occurred when the server processed a notification.). This is the underlying object with id, value and extensions. The accessor "getError" gives direct access to the value - */ - public StringType getErrorElement() { - if (this.error == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Subscription.error"); - else if (Configuration.doAutoCreate()) - this.error = new StringType(); // bb - return this.error; - } - - public boolean hasErrorElement() { - return this.error != null && !this.error.isEmpty(); - } - - public boolean hasError() { - return this.error != null && !this.error.isEmpty(); - } - - /** - * @param value {@link #error} (A record of the last error that occurred when the server processed a notification.). This is the underlying object with id, value and extensions. The accessor "getError" gives direct access to the value - */ - public Subscription setErrorElement(StringType value) { - this.error = value; - return this; - } - - /** - * @return A record of the last error that occurred when the server processed a notification. - */ - public String getError() { - return this.error == null ? null : this.error.getValue(); - } - - /** - * @param value A record of the last error that occurred when the server processed a notification. - */ - public Subscription setError(String value) { - if (Utilities.noString(value)) - this.error = null; - else { - if (this.error == null) - this.error = new StringType(); - this.error.setValue(value); - } - return this; - } - - /** - * @return {@link #channel} (Details where to send notifications when resources are received that meet the criteria.) - */ - public SubscriptionChannelComponent getChannel() { - if (this.channel == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Subscription.channel"); - else if (Configuration.doAutoCreate()) - this.channel = new SubscriptionChannelComponent(); // cc - return this.channel; - } - - public boolean hasChannel() { - return this.channel != null && !this.channel.isEmpty(); - } - - /** - * @param value {@link #channel} (Details where to send notifications when resources are received that meet the criteria.) - */ - public Subscription setChannel(SubscriptionChannelComponent value) { - this.channel = value; - return this; - } - - /** - * @return {@link #end} (The time for the server to turn the subscription off.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public InstantType getEndElement() { - if (this.end == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Subscription.end"); - else if (Configuration.doAutoCreate()) - this.end = new InstantType(); // bb - return this.end; - } - - public boolean hasEndElement() { - return this.end != null && !this.end.isEmpty(); - } - - public boolean hasEnd() { - return this.end != null && !this.end.isEmpty(); - } - - /** - * @param value {@link #end} (The time for the server to turn the subscription off.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public Subscription setEndElement(InstantType value) { - this.end = value; - return this; - } - - /** - * @return The time for the server to turn the subscription off. - */ - public Date getEnd() { - return this.end == null ? null : this.end.getValue(); - } - - /** - * @param value The time for the server to turn the subscription off. - */ - public Subscription setEnd(Date value) { - if (value == null) - this.end = null; - else { - if (this.end == null) - this.end = new InstantType(); - this.end.setValue(value); - } - return this; - } - - /** - * @return {@link #tag} (A tag to add to any resource that matches the criteria, after the subscription is processed.) - */ - public List getTag() { - if (this.tag == null) - this.tag = new ArrayList(); - return this.tag; - } - - public boolean hasTag() { - if (this.tag == null) - return false; - for (Coding item : this.tag) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #tag} (A tag to add to any resource that matches the criteria, after the subscription is processed.) - */ - // syntactic sugar - public Coding addTag() { //3 - Coding t = new Coding(); - if (this.tag == null) - this.tag = new ArrayList(); - this.tag.add(t); - return t; - } - - // syntactic sugar - public Subscription addTag(Coding t) { //3 - if (t == null) - return this; - if (this.tag == null) - this.tag = new ArrayList(); - this.tag.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("criteria", "string", "The rules that the server should use to determine when to generate notifications for this subscription.", 0, java.lang.Integer.MAX_VALUE, criteria)); - childrenList.add(new Property("contact", "ContactPoint", "Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("reason", "string", "A description of why this subscription is defined.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("status", "code", "The status of the subscription, which marks the server state for managing the subscription.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("error", "string", "A record of the last error that occurred when the server processed a notification.", 0, java.lang.Integer.MAX_VALUE, error)); - childrenList.add(new Property("channel", "", "Details where to send notifications when resources are received that meet the criteria.", 0, java.lang.Integer.MAX_VALUE, channel)); - childrenList.add(new Property("end", "instant", "The time for the server to turn the subscription off.", 0, java.lang.Integer.MAX_VALUE, end)); - childrenList.add(new Property("tag", "Coding", "A tag to add to any resource that matches the criteria, after the subscription is processed.", 0, java.lang.Integer.MAX_VALUE, tag)); - } - - public Subscription copy() { - Subscription dst = new Subscription(); - copyValues(dst); - dst.criteria = criteria == null ? null : criteria.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (ContactPoint i : contact) - dst.contact.add(i.copy()); - }; - dst.reason = reason == null ? null : reason.copy(); - dst.status = status == null ? null : status.copy(); - dst.error = error == null ? null : error.copy(); - dst.channel = channel == null ? null : channel.copy(); - dst.end = end == null ? null : end.copy(); - if (tag != null) { - dst.tag = new ArrayList(); - for (Coding i : tag) - dst.tag.add(i.copy()); - }; - return dst; - } - - protected Subscription typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Subscription)) - return false; - Subscription o = (Subscription) other; - return compareDeep(criteria, o.criteria, true) && compareDeep(contact, o.contact, true) && compareDeep(reason, o.reason, true) - && compareDeep(status, o.status, true) && compareDeep(error, o.error, true) && compareDeep(channel, o.channel, true) - && compareDeep(end, o.end, true) && compareDeep(tag, o.tag, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Subscription)) - return false; - Subscription o = (Subscription) other; - return compareValues(criteria, o.criteria, true) && compareValues(reason, o.reason, true) && compareValues(status, o.status, true) - && compareValues(error, o.error, true) && compareValues(end, o.end, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (criteria == null || criteria.isEmpty()) && (contact == null || contact.isEmpty()) - && (reason == null || reason.isEmpty()) && (status == null || status.isEmpty()) && (error == null || error.isEmpty()) - && (channel == null || channel.isEmpty()) && (end == null || end.isEmpty()) && (tag == null || tag.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Subscription; - } - - @SearchParamDefinition(name="criteria", path="Subscription.criteria", description="Rule for server push criteria", type="string" ) - public static final String SP_CRITERIA = "criteria"; - @SearchParamDefinition(name="status", path="Subscription.status", description="requested | active | error | off", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="tag", path="Subscription.tag", description="A tag to add to matching resources", type="token" ) - public static final String SP_TAG = "tag"; - @SearchParamDefinition(name="payload", path="Subscription.channel.payload", description="Mimetype to send, or blank for no payload", type="string" ) - public static final String SP_PAYLOAD = "payload"; - @SearchParamDefinition(name="type", path="Subscription.channel.type", description="rest-hook | websocket | email | sms | message", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="contact", path="Subscription.contact", description="Contact details for source (e.g. troubleshooting)", type="token" ) - public static final String SP_CONTACT = "contact"; - @SearchParamDefinition(name="url", path="Subscription.channel.endpoint", description="Where the channel points to", type="uri" ) - public static final String SP_URL = "url"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system is able to take an appropriate action. + */ +@ResourceDef(name="Subscription", profile="http://hl7.org/fhir/Profile/Subscription") +public class Subscription extends DomainResource { + + public enum SubscriptionStatus { + /** + * The client has requested the subscription, and the server has not yet set it up. + */ + REQUESTED, + /** + * The subscription is active. + */ + ACTIVE, + /** + * The server has an error executing the notification. + */ + ERROR, + /** + * Too many errors have occurred or the subscription has expired. + */ + OFF, + /** + * added to help the parsers + */ + NULL; + public static SubscriptionStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return REQUESTED; + if ("active".equals(codeString)) + return ACTIVE; + if ("error".equals(codeString)) + return ERROR; + if ("off".equals(codeString)) + return OFF; + throw new Exception("Unknown SubscriptionStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case REQUESTED: return "requested"; + case ACTIVE: return "active"; + case ERROR: return "error"; + case OFF: return "off"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REQUESTED: return ""; + case ACTIVE: return ""; + case ERROR: return ""; + case OFF: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REQUESTED: return "The client has requested the subscription, and the server has not yet set it up."; + case ACTIVE: return "The subscription is active."; + case ERROR: return "The server has an error executing the notification."; + case OFF: return "Too many errors have occurred or the subscription has expired."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REQUESTED: return "Requested"; + case ACTIVE: return "Active"; + case ERROR: return "Error"; + case OFF: return "Off"; + default: return "?"; + } + } + } + + public static class SubscriptionStatusEnumFactory implements EnumFactory { + public SubscriptionStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return SubscriptionStatus.REQUESTED; + if ("active".equals(codeString)) + return SubscriptionStatus.ACTIVE; + if ("error".equals(codeString)) + return SubscriptionStatus.ERROR; + if ("off".equals(codeString)) + return SubscriptionStatus.OFF; + throw new IllegalArgumentException("Unknown SubscriptionStatus code '"+codeString+"'"); + } + public String toCode(SubscriptionStatus code) { + if (code == SubscriptionStatus.REQUESTED) + return "requested"; + if (code == SubscriptionStatus.ACTIVE) + return "active"; + if (code == SubscriptionStatus.ERROR) + return "error"; + if (code == SubscriptionStatus.OFF) + return "off"; + return "?"; + } + } + + public enum SubscriptionChannelType { + /** + * The channel is executed by making a post to the URI. If a payload is included, the URL is interpreted as the service base, and an update (PUT) is made. + */ + RESTHOOK, + /** + * The channel is executed by sending a packet across a web socket connection maintained by the client. The URL identifies the websocket, and the client binds to this URL. + */ + WEBSOCKET, + /** + * The channel is executed by sending an email to the email addressed in the URI (which must be a mailto:). + */ + EMAIL, + /** + * The channel is executed by sending an SMS message to the phone number identified in the URL (tel:). + */ + SMS, + /** + * The channel Is executed by sending a message (e.g. a Bundle with a MessageHeader resource etc) to the application identified in the URI. + */ + MESSAGE, + /** + * added to help the parsers + */ + NULL; + public static SubscriptionChannelType fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("rest-hook".equals(codeString)) + return RESTHOOK; + if ("websocket".equals(codeString)) + return WEBSOCKET; + if ("email".equals(codeString)) + return EMAIL; + if ("sms".equals(codeString)) + return SMS; + if ("message".equals(codeString)) + return MESSAGE; + throw new Exception("Unknown SubscriptionChannelType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case RESTHOOK: return "rest-hook"; + case WEBSOCKET: return "websocket"; + case EMAIL: return "email"; + case SMS: return "sms"; + case MESSAGE: return "message"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case RESTHOOK: return ""; + case WEBSOCKET: return ""; + case EMAIL: return ""; + case SMS: return ""; + case MESSAGE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case RESTHOOK: return "The channel is executed by making a post to the URI. If a payload is included, the URL is interpreted as the service base, and an update (PUT) is made."; + case WEBSOCKET: return "The channel is executed by sending a packet across a web socket connection maintained by the client. The URL identifies the websocket, and the client binds to this URL."; + case EMAIL: return "The channel is executed by sending an email to the email addressed in the URI (which must be a mailto:)."; + case SMS: return "The channel is executed by sending an SMS message to the phone number identified in the URL (tel:)."; + case MESSAGE: return "The channel Is executed by sending a message (e.g. a Bundle with a MessageHeader resource etc) to the application identified in the URI."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case RESTHOOK: return "Rest Hook"; + case WEBSOCKET: return "Websocket"; + case EMAIL: return "Email"; + case SMS: return "Sms"; + case MESSAGE: return "Message"; + default: return "?"; + } + } + } + + public static class SubscriptionChannelTypeEnumFactory implements EnumFactory { + public SubscriptionChannelType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("rest-hook".equals(codeString)) + return SubscriptionChannelType.RESTHOOK; + if ("websocket".equals(codeString)) + return SubscriptionChannelType.WEBSOCKET; + if ("email".equals(codeString)) + return SubscriptionChannelType.EMAIL; + if ("sms".equals(codeString)) + return SubscriptionChannelType.SMS; + if ("message".equals(codeString)) + return SubscriptionChannelType.MESSAGE; + throw new IllegalArgumentException("Unknown SubscriptionChannelType code '"+codeString+"'"); + } + public String toCode(SubscriptionChannelType code) { + if (code == SubscriptionChannelType.RESTHOOK) + return "rest-hook"; + if (code == SubscriptionChannelType.WEBSOCKET) + return "websocket"; + if (code == SubscriptionChannelType.EMAIL) + return "email"; + if (code == SubscriptionChannelType.SMS) + return "sms"; + if (code == SubscriptionChannelType.MESSAGE) + return "message"; + return "?"; + } + } + + @Block() + public static class SubscriptionChannelComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The type of channel to send notififcations on. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="rest-hook | websocket | email | sms | message", formalDefinition="The type of channel to send notififcations on." ) + protected Enumeration type; + + /** + * The uri that describes tha actual end point to send messages to. + */ + @Child(name = "endpoint", type = {UriType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Where the channel points to", formalDefinition="The uri that describes tha actual end point to send messages to." ) + protected UriType endpoint; + + /** + * The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification. + */ + @Child(name = "payload", type = {StringType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Mimetype to send, or blank for no payload", formalDefinition="The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification." ) + protected StringType payload; + + /** + * Additional headers / information to send as part of the notification. + */ + @Child(name = "header", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Usage depends on the channel type", formalDefinition="Additional headers / information to send as part of the notification." ) + protected StringType header; + + private static final long serialVersionUID = -279715391L; + + /* + * Constructor + */ + public SubscriptionChannelComponent() { + super(); + } + + /* + * Constructor + */ + public SubscriptionChannelComponent(Enumeration type, StringType payload) { + super(); + this.type = type; + this.payload = payload; + } + + /** + * @return {@link #type} (The type of channel to send notififcations on.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubscriptionChannelComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new SubscriptionChannelTypeEnumFactory()); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of channel to send notififcations on.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public SubscriptionChannelComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The type of channel to send notififcations on. + */ + public SubscriptionChannelType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of channel to send notififcations on. + */ + public SubscriptionChannelComponent setType(SubscriptionChannelType value) { + if (this.type == null) + this.type = new Enumeration(new SubscriptionChannelTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #endpoint} (The uri that describes tha actual end point to send messages to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value + */ + public UriType getEndpointElement() { + if (this.endpoint == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubscriptionChannelComponent.endpoint"); + else if (Configuration.doAutoCreate()) + this.endpoint = new UriType(); // bb + return this.endpoint; + } + + public boolean hasEndpointElement() { + return this.endpoint != null && !this.endpoint.isEmpty(); + } + + public boolean hasEndpoint() { + return this.endpoint != null && !this.endpoint.isEmpty(); + } + + /** + * @param value {@link #endpoint} (The uri that describes tha actual end point to send messages to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value + */ + public SubscriptionChannelComponent setEndpointElement(UriType value) { + this.endpoint = value; + return this; + } + + /** + * @return The uri that describes tha actual end point to send messages to. + */ + public String getEndpoint() { + return this.endpoint == null ? null : this.endpoint.getValue(); + } + + /** + * @param value The uri that describes tha actual end point to send messages to. + */ + public SubscriptionChannelComponent setEndpoint(String value) { + if (Utilities.noString(value)) + this.endpoint = null; + else { + if (this.endpoint == null) + this.endpoint = new UriType(); + this.endpoint.setValue(value); + } + return this; + } + + /** + * @return {@link #payload} (The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification.). This is the underlying object with id, value and extensions. The accessor "getPayload" gives direct access to the value + */ + public StringType getPayloadElement() { + if (this.payload == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubscriptionChannelComponent.payload"); + else if (Configuration.doAutoCreate()) + this.payload = new StringType(); // bb + return this.payload; + } + + public boolean hasPayloadElement() { + return this.payload != null && !this.payload.isEmpty(); + } + + public boolean hasPayload() { + return this.payload != null && !this.payload.isEmpty(); + } + + /** + * @param value {@link #payload} (The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification.). This is the underlying object with id, value and extensions. The accessor "getPayload" gives direct access to the value + */ + public SubscriptionChannelComponent setPayloadElement(StringType value) { + this.payload = value; + return this; + } + + /** + * @return The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification. + */ + public String getPayload() { + return this.payload == null ? null : this.payload.getValue(); + } + + /** + * @param value The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification. + */ + public SubscriptionChannelComponent setPayload(String value) { + if (this.payload == null) + this.payload = new StringType(); + this.payload.setValue(value); + return this; + } + + /** + * @return {@link #header} (Additional headers / information to send as part of the notification.). This is the underlying object with id, value and extensions. The accessor "getHeader" gives direct access to the value + */ + public StringType getHeaderElement() { + if (this.header == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubscriptionChannelComponent.header"); + else if (Configuration.doAutoCreate()) + this.header = new StringType(); // bb + return this.header; + } + + public boolean hasHeaderElement() { + return this.header != null && !this.header.isEmpty(); + } + + public boolean hasHeader() { + return this.header != null && !this.header.isEmpty(); + } + + /** + * @param value {@link #header} (Additional headers / information to send as part of the notification.). This is the underlying object with id, value and extensions. The accessor "getHeader" gives direct access to the value + */ + public SubscriptionChannelComponent setHeaderElement(StringType value) { + this.header = value; + return this; + } + + /** + * @return Additional headers / information to send as part of the notification. + */ + public String getHeader() { + return this.header == null ? null : this.header.getValue(); + } + + /** + * @param value Additional headers / information to send as part of the notification. + */ + public SubscriptionChannelComponent setHeader(String value) { + if (Utilities.noString(value)) + this.header = null; + else { + if (this.header == null) + this.header = new StringType(); + this.header.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "The type of channel to send notififcations on.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("endpoint", "uri", "The uri that describes tha actual end point to send messages to.", 0, java.lang.Integer.MAX_VALUE, endpoint)); + childrenList.add(new Property("payload", "string", "The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification.", 0, java.lang.Integer.MAX_VALUE, payload)); + childrenList.add(new Property("header", "string", "Additional headers / information to send as part of the notification.", 0, java.lang.Integer.MAX_VALUE, header)); + } + + public SubscriptionChannelComponent copy() { + SubscriptionChannelComponent dst = new SubscriptionChannelComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.endpoint = endpoint == null ? null : endpoint.copy(); + dst.payload = payload == null ? null : payload.copy(); + dst.header = header == null ? null : header.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SubscriptionChannelComponent)) + return false; + SubscriptionChannelComponent o = (SubscriptionChannelComponent) other; + return compareDeep(type, o.type, true) && compareDeep(endpoint, o.endpoint, true) && compareDeep(payload, o.payload, true) + && compareDeep(header, o.header, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SubscriptionChannelComponent)) + return false; + SubscriptionChannelComponent o = (SubscriptionChannelComponent) other; + return compareValues(type, o.type, true) && compareValues(endpoint, o.endpoint, true) && compareValues(payload, o.payload, true) + && compareValues(header, o.header, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (endpoint == null || endpoint.isEmpty()) + && (payload == null || payload.isEmpty()) && (header == null || header.isEmpty()); + } + + } + + /** + * The rules that the server should use to determine when to generate notifications for this subscription. + */ + @Child(name = "criteria", type = {StringType.class}, order=0, min=1, max=1) + @Description(shortDefinition="Rule for server push criteria", formalDefinition="The rules that the server should use to determine when to generate notifications for this subscription." ) + protected StringType criteria; + + /** + * Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting. + */ + @Child(name = "contact", type = {ContactPoint.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details for source (e.g. troubleshooting)", formalDefinition="Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting." ) + protected List contact; + + /** + * A description of why this subscription is defined. + */ + @Child(name = "reason", type = {StringType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Description of why this subscription was created", formalDefinition="A description of why this subscription is defined." ) + protected StringType reason; + + /** + * The status of the subscription, which marks the server state for managing the subscription. + */ + @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1) + @Description(shortDefinition="requested | active | error | off", formalDefinition="The status of the subscription, which marks the server state for managing the subscription." ) + protected Enumeration status; + + /** + * A record of the last error that occurred when the server processed a notification. + */ + @Child(name = "error", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Latest error note", formalDefinition="A record of the last error that occurred when the server processed a notification." ) + protected StringType error; + + /** + * Details where to send notifications when resources are received that meet the criteria. + */ + @Child(name = "channel", type = {}, order=5, min=1, max=1) + @Description(shortDefinition="The channel on which to report matches to the criteria", formalDefinition="Details where to send notifications when resources are received that meet the criteria." ) + protected SubscriptionChannelComponent channel; + + /** + * The time for the server to turn the subscription off. + */ + @Child(name = "end", type = {InstantType.class}, order=6, min=0, max=1) + @Description(shortDefinition="When to automatically delete the subscription", formalDefinition="The time for the server to turn the subscription off." ) + protected InstantType end; + + /** + * A tag to add to any resource that matches the criteria, after the subscription is processed. + */ + @Child(name = "tag", type = {Coding.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A tag to add to matching resources", formalDefinition="A tag to add to any resource that matches the criteria, after the subscription is processed." ) + protected List tag; + + private static final long serialVersionUID = -1390870804L; + + /* + * Constructor + */ + public Subscription() { + super(); + } + + /* + * Constructor + */ + public Subscription(StringType criteria, StringType reason, Enumeration status, SubscriptionChannelComponent channel) { + super(); + this.criteria = criteria; + this.reason = reason; + this.status = status; + this.channel = channel; + } + + /** + * @return {@link #criteria} (The rules that the server should use to determine when to generate notifications for this subscription.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value + */ + public StringType getCriteriaElement() { + if (this.criteria == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Subscription.criteria"); + else if (Configuration.doAutoCreate()) + this.criteria = new StringType(); // bb + return this.criteria; + } + + public boolean hasCriteriaElement() { + return this.criteria != null && !this.criteria.isEmpty(); + } + + public boolean hasCriteria() { + return this.criteria != null && !this.criteria.isEmpty(); + } + + /** + * @param value {@link #criteria} (The rules that the server should use to determine when to generate notifications for this subscription.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value + */ + public Subscription setCriteriaElement(StringType value) { + this.criteria = value; + return this; + } + + /** + * @return The rules that the server should use to determine when to generate notifications for this subscription. + */ + public String getCriteria() { + return this.criteria == null ? null : this.criteria.getValue(); + } + + /** + * @param value The rules that the server should use to determine when to generate notifications for this subscription. + */ + public Subscription setCriteria(String value) { + if (this.criteria == null) + this.criteria = new StringType(); + this.criteria.setValue(value); + return this; + } + + /** + * @return {@link #contact} (Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (ContactPoint item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting.) + */ + // syntactic sugar + public ContactPoint addContact() { //3 + ContactPoint t = new ContactPoint(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public Subscription addContact(ContactPoint t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #reason} (A description of why this subscription is defined.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value + */ + public StringType getReasonElement() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Subscription.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new StringType(); // bb + return this.reason; + } + + public boolean hasReasonElement() { + return this.reason != null && !this.reason.isEmpty(); + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (A description of why this subscription is defined.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value + */ + public Subscription setReasonElement(StringType value) { + this.reason = value; + return this; + } + + /** + * @return A description of why this subscription is defined. + */ + public String getReason() { + return this.reason == null ? null : this.reason.getValue(); + } + + /** + * @param value A description of why this subscription is defined. + */ + public Subscription setReason(String value) { + if (this.reason == null) + this.reason = new StringType(); + this.reason.setValue(value); + return this; + } + + /** + * @return {@link #status} (The status of the subscription, which marks the server state for managing the subscription.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Subscription.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new SubscriptionStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status of the subscription, which marks the server state for managing the subscription.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Subscription setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the subscription, which marks the server state for managing the subscription. + */ + public SubscriptionStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the subscription, which marks the server state for managing the subscription. + */ + public Subscription setStatus(SubscriptionStatus value) { + if (this.status == null) + this.status = new Enumeration(new SubscriptionStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #error} (A record of the last error that occurred when the server processed a notification.). This is the underlying object with id, value and extensions. The accessor "getError" gives direct access to the value + */ + public StringType getErrorElement() { + if (this.error == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Subscription.error"); + else if (Configuration.doAutoCreate()) + this.error = new StringType(); // bb + return this.error; + } + + public boolean hasErrorElement() { + return this.error != null && !this.error.isEmpty(); + } + + public boolean hasError() { + return this.error != null && !this.error.isEmpty(); + } + + /** + * @param value {@link #error} (A record of the last error that occurred when the server processed a notification.). This is the underlying object with id, value and extensions. The accessor "getError" gives direct access to the value + */ + public Subscription setErrorElement(StringType value) { + this.error = value; + return this; + } + + /** + * @return A record of the last error that occurred when the server processed a notification. + */ + public String getError() { + return this.error == null ? null : this.error.getValue(); + } + + /** + * @param value A record of the last error that occurred when the server processed a notification. + */ + public Subscription setError(String value) { + if (Utilities.noString(value)) + this.error = null; + else { + if (this.error == null) + this.error = new StringType(); + this.error.setValue(value); + } + return this; + } + + /** + * @return {@link #channel} (Details where to send notifications when resources are received that meet the criteria.) + */ + public SubscriptionChannelComponent getChannel() { + if (this.channel == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Subscription.channel"); + else if (Configuration.doAutoCreate()) + this.channel = new SubscriptionChannelComponent(); // cc + return this.channel; + } + + public boolean hasChannel() { + return this.channel != null && !this.channel.isEmpty(); + } + + /** + * @param value {@link #channel} (Details where to send notifications when resources are received that meet the criteria.) + */ + public Subscription setChannel(SubscriptionChannelComponent value) { + this.channel = value; + return this; + } + + /** + * @return {@link #end} (The time for the server to turn the subscription off.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public InstantType getEndElement() { + if (this.end == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Subscription.end"); + else if (Configuration.doAutoCreate()) + this.end = new InstantType(); // bb + return this.end; + } + + public boolean hasEndElement() { + return this.end != null && !this.end.isEmpty(); + } + + public boolean hasEnd() { + return this.end != null && !this.end.isEmpty(); + } + + /** + * @param value {@link #end} (The time for the server to turn the subscription off.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public Subscription setEndElement(InstantType value) { + this.end = value; + return this; + } + + /** + * @return The time for the server to turn the subscription off. + */ + public Date getEnd() { + return this.end == null ? null : this.end.getValue(); + } + + /** + * @param value The time for the server to turn the subscription off. + */ + public Subscription setEnd(Date value) { + if (value == null) + this.end = null; + else { + if (this.end == null) + this.end = new InstantType(); + this.end.setValue(value); + } + return this; + } + + /** + * @return {@link #tag} (A tag to add to any resource that matches the criteria, after the subscription is processed.) + */ + public List getTag() { + if (this.tag == null) + this.tag = new ArrayList(); + return this.tag; + } + + public boolean hasTag() { + if (this.tag == null) + return false; + for (Coding item : this.tag) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #tag} (A tag to add to any resource that matches the criteria, after the subscription is processed.) + */ + // syntactic sugar + public Coding addTag() { //3 + Coding t = new Coding(); + if (this.tag == null) + this.tag = new ArrayList(); + this.tag.add(t); + return t; + } + + // syntactic sugar + public Subscription addTag(Coding t) { //3 + if (t == null) + return this; + if (this.tag == null) + this.tag = new ArrayList(); + this.tag.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("criteria", "string", "The rules that the server should use to determine when to generate notifications for this subscription.", 0, java.lang.Integer.MAX_VALUE, criteria)); + childrenList.add(new Property("contact", "ContactPoint", "Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("reason", "string", "A description of why this subscription is defined.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("status", "code", "The status of the subscription, which marks the server state for managing the subscription.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("error", "string", "A record of the last error that occurred when the server processed a notification.", 0, java.lang.Integer.MAX_VALUE, error)); + childrenList.add(new Property("channel", "", "Details where to send notifications when resources are received that meet the criteria.", 0, java.lang.Integer.MAX_VALUE, channel)); + childrenList.add(new Property("end", "instant", "The time for the server to turn the subscription off.", 0, java.lang.Integer.MAX_VALUE, end)); + childrenList.add(new Property("tag", "Coding", "A tag to add to any resource that matches the criteria, after the subscription is processed.", 0, java.lang.Integer.MAX_VALUE, tag)); + } + + public Subscription copy() { + Subscription dst = new Subscription(); + copyValues(dst); + dst.criteria = criteria == null ? null : criteria.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (ContactPoint i : contact) + dst.contact.add(i.copy()); + }; + dst.reason = reason == null ? null : reason.copy(); + dst.status = status == null ? null : status.copy(); + dst.error = error == null ? null : error.copy(); + dst.channel = channel == null ? null : channel.copy(); + dst.end = end == null ? null : end.copy(); + if (tag != null) { + dst.tag = new ArrayList(); + for (Coding i : tag) + dst.tag.add(i.copy()); + }; + return dst; + } + + protected Subscription typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Subscription)) + return false; + Subscription o = (Subscription) other; + return compareDeep(criteria, o.criteria, true) && compareDeep(contact, o.contact, true) && compareDeep(reason, o.reason, true) + && compareDeep(status, o.status, true) && compareDeep(error, o.error, true) && compareDeep(channel, o.channel, true) + && compareDeep(end, o.end, true) && compareDeep(tag, o.tag, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Subscription)) + return false; + Subscription o = (Subscription) other; + return compareValues(criteria, o.criteria, true) && compareValues(reason, o.reason, true) && compareValues(status, o.status, true) + && compareValues(error, o.error, true) && compareValues(end, o.end, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (criteria == null || criteria.isEmpty()) && (contact == null || contact.isEmpty()) + && (reason == null || reason.isEmpty()) && (status == null || status.isEmpty()) && (error == null || error.isEmpty()) + && (channel == null || channel.isEmpty()) && (end == null || end.isEmpty()) && (tag == null || tag.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Subscription; + } + + @SearchParamDefinition(name="payload", path="Subscription.channel.payload", description="Mimetype to send, or blank for no payload", type="string" ) + public static final String SP_PAYLOAD = "payload"; + @SearchParamDefinition(name="criteria", path="Subscription.criteria", description="Rule for server push criteria", type="string" ) + public static final String SP_CRITERIA = "criteria"; + @SearchParamDefinition(name="contact", path="Subscription.contact", description="Contact details for source (e.g. troubleshooting)", type="token" ) + public static final String SP_CONTACT = "contact"; + @SearchParamDefinition(name="tag", path="Subscription.tag", description="A tag to add to matching resources", type="token" ) + public static final String SP_TAG = "tag"; + @SearchParamDefinition(name="type", path="Subscription.channel.type", description="rest-hook | websocket | email | sms | message", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="url", path="Subscription.channel.endpoint", description="Where the channel points to", type="uri" ) + public static final String SP_URL = "url"; + @SearchParamDefinition(name="status", path="Subscription.status", description="requested | active | error | off", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Substance.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Substance.java index e370430a98d..84739eb5456 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Substance.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Substance.java @@ -1,642 +1,621 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A homogeneous material with a definite composition. - */ -@ResourceDef(name="Substance", profile="http://hl7.org/fhir/Profile/Substance") -public class Substance extends DomainResource { - - @Block() - public static class SubstanceInstanceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifier associated with the package/container (usually a label affixed directly). - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) - @Description(shortDefinition="Identifier of the package/container", formalDefinition="Identifier associated with the package/container (usually a label affixed directly)." ) - protected Identifier identifier; - - /** - * When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. - */ - @Child(name = "expiry", type = {DateTimeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="When no longer valid to use", formalDefinition="When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry." ) - protected DateTimeType expiry; - - /** - * The amount of the substance. - */ - @Child(name = "quantity", type = {Quantity.class}, order=3, min=0, max=1) - @Description(shortDefinition="Amount of substance in the package", formalDefinition="The amount of the substance." ) - protected Quantity quantity; - - private static final long serialVersionUID = -1474380480L; - - /* - * Constructor - */ - public SubstanceInstanceComponent() { - super(); - } - - /** - * @return {@link #identifier} (Identifier associated with the package/container (usually a label affixed directly).) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubstanceInstanceComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifier associated with the package/container (usually a label affixed directly).) - */ - public SubstanceInstanceComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #expiry} (When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value - */ - public DateTimeType getExpiryElement() { - if (this.expiry == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubstanceInstanceComponent.expiry"); - else if (Configuration.doAutoCreate()) - this.expiry = new DateTimeType(); // bb - return this.expiry; - } - - public boolean hasExpiryElement() { - return this.expiry != null && !this.expiry.isEmpty(); - } - - public boolean hasExpiry() { - return this.expiry != null && !this.expiry.isEmpty(); - } - - /** - * @param value {@link #expiry} (When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value - */ - public SubstanceInstanceComponent setExpiryElement(DateTimeType value) { - this.expiry = value; - return this; - } - - /** - * @return When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. - */ - public Date getExpiry() { - return this.expiry == null ? null : this.expiry.getValue(); - } - - /** - * @param value When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. - */ - public SubstanceInstanceComponent setExpiry(Date value) { - if (value == null) - this.expiry = null; - else { - if (this.expiry == null) - this.expiry = new DateTimeType(); - this.expiry.setValue(value); - } - return this; - } - - /** - * @return {@link #quantity} (The amount of the substance.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubstanceInstanceComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of the substance.) - */ - public SubstanceInstanceComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier associated with the package/container (usually a label affixed directly).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("expiry", "dateTime", "When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.", 0, java.lang.Integer.MAX_VALUE, expiry)); - childrenList.add(new Property("quantity", "Quantity", "The amount of the substance.", 0, java.lang.Integer.MAX_VALUE, quantity)); - } - - public SubstanceInstanceComponent copy() { - SubstanceInstanceComponent dst = new SubstanceInstanceComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.expiry = expiry == null ? null : expiry.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SubstanceInstanceComponent)) - return false; - SubstanceInstanceComponent o = (SubstanceInstanceComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(expiry, o.expiry, true) && compareDeep(quantity, o.quantity, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SubstanceInstanceComponent)) - return false; - SubstanceInstanceComponent o = (SubstanceInstanceComponent) other; - return compareValues(expiry, o.expiry, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (expiry == null || expiry.isEmpty()) - && (quantity == null || quantity.isEmpty()); - } - - } - - @Block() - public static class SubstanceIngredientComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The amount of the ingredient in the substance - a concentration ratio. - */ - @Child(name = "quantity", type = {Ratio.class}, order=1, min=0, max=1) - @Description(shortDefinition="Optional amount (concentration)", formalDefinition="The amount of the ingredient in the substance - a concentration ratio." ) - protected Ratio quantity; - - /** - * Another substance that is a component of this substance. - */ - @Child(name = "substance", type = {Substance.class}, order=2, min=1, max=1) - @Description(shortDefinition="A component of the substance", formalDefinition="Another substance that is a component of this substance." ) - protected Reference substance; - - /** - * The actual object that is the target of the reference (Another substance that is a component of this substance.) - */ - protected Substance substanceTarget; - - private static final long serialVersionUID = -1783242034L; - - /* - * Constructor - */ - public SubstanceIngredientComponent() { - super(); - } - - /* - * Constructor - */ - public SubstanceIngredientComponent(Reference substance) { - super(); - this.substance = substance; - } - - /** - * @return {@link #quantity} (The amount of the ingredient in the substance - a concentration ratio.) - */ - public Ratio getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubstanceIngredientComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Ratio(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of the ingredient in the substance - a concentration ratio.) - */ - public SubstanceIngredientComponent setQuantity(Ratio value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #substance} (Another substance that is a component of this substance.) - */ - public Reference getSubstance() { - if (this.substance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubstanceIngredientComponent.substance"); - else if (Configuration.doAutoCreate()) - this.substance = new Reference(); // cc - return this.substance; - } - - public boolean hasSubstance() { - return this.substance != null && !this.substance.isEmpty(); - } - - /** - * @param value {@link #substance} (Another substance that is a component of this substance.) - */ - public SubstanceIngredientComponent setSubstance(Reference value) { - this.substance = value; - return this; - } - - /** - * @return {@link #substance} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Another substance that is a component of this substance.) - */ - public Substance getSubstanceTarget() { - if (this.substanceTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubstanceIngredientComponent.substance"); - else if (Configuration.doAutoCreate()) - this.substanceTarget = new Substance(); // aa - return this.substanceTarget; - } - - /** - * @param value {@link #substance} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Another substance that is a component of this substance.) - */ - public SubstanceIngredientComponent setSubstanceTarget(Substance value) { - this.substanceTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("quantity", "Ratio", "The amount of the ingredient in the substance - a concentration ratio.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("substance", "Reference(Substance)", "Another substance that is a component of this substance.", 0, java.lang.Integer.MAX_VALUE, substance)); - } - - public SubstanceIngredientComponent copy() { - SubstanceIngredientComponent dst = new SubstanceIngredientComponent(); - copyValues(dst); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.substance = substance == null ? null : substance.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SubstanceIngredientComponent)) - return false; - SubstanceIngredientComponent o = (SubstanceIngredientComponent) other; - return compareDeep(quantity, o.quantity, true) && compareDeep(substance, o.substance, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SubstanceIngredientComponent)) - return false; - SubstanceIngredientComponent o = (SubstanceIngredientComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (quantity == null || quantity.isEmpty()) && (substance == null || substance.isEmpty()) - ; - } - - } - - /** - * A code (or set of codes) that identify this substance. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=0, min=1, max=1) - @Description(shortDefinition="What kind of substance this is", formalDefinition="A code (or set of codes) that identify this substance." ) - protected CodeableConcept type; - - /** - * A description of the substance - its appearance, handling requirements, and other usage notes. - */ - @Child(name = "description", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Textual description of the substance, comments", formalDefinition="A description of the substance - its appearance, handling requirements, and other usage notes." ) - protected StringType description; - - /** - * Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance. - */ - @Child(name = "instance", type = {}, order=2, min=0, max=1) - @Description(shortDefinition="If this describes a specific package/container of the substance", formalDefinition="Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance." ) - protected SubstanceInstanceComponent instance; - - /** - * A substance can be composed of other substances. - */ - @Child(name = "ingredient", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Composition information about the substance", formalDefinition="A substance can be composed of other substances." ) - protected List ingredient; - - private static final long serialVersionUID = 1881086620L; - - /* - * Constructor - */ - public Substance() { - super(); - } - - /* - * Constructor - */ - public Substance(CodeableConcept type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (A code (or set of codes) that identify this substance.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Substance.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (A code (or set of codes) that identify this substance.) - */ - public Substance setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #description} (A description of the substance - its appearance, handling requirements, and other usage notes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Substance.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A description of the substance - its appearance, handling requirements, and other usage notes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public Substance setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A description of the substance - its appearance, handling requirements, and other usage notes. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A description of the substance - its appearance, handling requirements, and other usage notes. - */ - public Substance setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #instance} (Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.) - */ - public SubstanceInstanceComponent getInstance() { - if (this.instance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Substance.instance"); - else if (Configuration.doAutoCreate()) - this.instance = new SubstanceInstanceComponent(); // cc - return this.instance; - } - - public boolean hasInstance() { - return this.instance != null && !this.instance.isEmpty(); - } - - /** - * @param value {@link #instance} (Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.) - */ - public Substance setInstance(SubstanceInstanceComponent value) { - this.instance = value; - return this; - } - - /** - * @return {@link #ingredient} (A substance can be composed of other substances.) - */ - public List getIngredient() { - if (this.ingredient == null) - this.ingredient = new ArrayList(); - return this.ingredient; - } - - public boolean hasIngredient() { - if (this.ingredient == null) - return false; - for (SubstanceIngredientComponent item : this.ingredient) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #ingredient} (A substance can be composed of other substances.) - */ - // syntactic sugar - public SubstanceIngredientComponent addIngredient() { //3 - SubstanceIngredientComponent t = new SubstanceIngredientComponent(); - if (this.ingredient == null) - this.ingredient = new ArrayList(); - this.ingredient.add(t); - return t; - } - - // syntactic sugar - public Substance addIngredient(SubstanceIngredientComponent t) { //3 - if (t == null) - return this; - if (this.ingredient == null) - this.ingredient = new ArrayList(); - this.ingredient.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "A code (or set of codes) that identify this substance.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("description", "string", "A description of the substance - its appearance, handling requirements, and other usage notes.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("instance", "", "Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.", 0, java.lang.Integer.MAX_VALUE, instance)); - childrenList.add(new Property("ingredient", "", "A substance can be composed of other substances.", 0, java.lang.Integer.MAX_VALUE, ingredient)); - } - - public Substance copy() { - Substance dst = new Substance(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.description = description == null ? null : description.copy(); - dst.instance = instance == null ? null : instance.copy(); - if (ingredient != null) { - dst.ingredient = new ArrayList(); - for (SubstanceIngredientComponent i : ingredient) - dst.ingredient.add(i.copy()); - }; - return dst; - } - - protected Substance typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Substance)) - return false; - Substance o = (Substance) other; - return compareDeep(type, o.type, true) && compareDeep(description, o.description, true) && compareDeep(instance, o.instance, true) - && compareDeep(ingredient, o.ingredient, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Substance)) - return false; - Substance o = (Substance) other; - return compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (description == null || description.isEmpty()) - && (instance == null || instance.isEmpty()) && (ingredient == null || ingredient.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Substance; - } - - @SearchParamDefinition(name="substance", path="Substance.ingredient.substance", description="A component of the substance", type="reference" ) - public static final String SP_SUBSTANCE = "substance"; - @SearchParamDefinition(name="quantity", path="Substance.instance.quantity", description="Amount of substance in the package", type="number" ) - public static final String SP_QUANTITY = "quantity"; - @SearchParamDefinition(name="type", path="Substance.type", description="The type of the substance", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="identifier", path="Substance.instance.identifier", description="Identifier of the package/container", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="expiry", path="Substance.instance.expiry", description="When no longer valid to use", type="date" ) - public static final String SP_EXPIRY = "expiry"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A homogeneous material with a definite composition. + */ +@ResourceDef(name="Substance", profile="http://hl7.org/fhir/Profile/Substance") +public class Substance extends DomainResource { + + @Block() + public static class SubstanceInstanceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifier associated with the package/container (usually a label affixed directly). + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) + @Description(shortDefinition="Identifier of the package/container", formalDefinition="Identifier associated with the package/container (usually a label affixed directly)." ) + protected Identifier identifier; + + /** + * When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. + */ + @Child(name = "expiry", type = {DateTimeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="When no longer valid to use", formalDefinition="When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry." ) + protected DateTimeType expiry; + + /** + * The amount of the substance. + */ + @Child(name = "quantity", type = {Quantity.class}, order=3, min=0, max=1) + @Description(shortDefinition="Amount of substance in the package", formalDefinition="The amount of the substance." ) + protected Quantity quantity; + + private static final long serialVersionUID = -1474380480L; + + /* + * Constructor + */ + public SubstanceInstanceComponent() { + super(); + } + + /** + * @return {@link #identifier} (Identifier associated with the package/container (usually a label affixed directly).) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubstanceInstanceComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifier associated with the package/container (usually a label affixed directly).) + */ + public SubstanceInstanceComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #expiry} (When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value + */ + public DateTimeType getExpiryElement() { + if (this.expiry == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubstanceInstanceComponent.expiry"); + else if (Configuration.doAutoCreate()) + this.expiry = new DateTimeType(); // bb + return this.expiry; + } + + public boolean hasExpiryElement() { + return this.expiry != null && !this.expiry.isEmpty(); + } + + public boolean hasExpiry() { + return this.expiry != null && !this.expiry.isEmpty(); + } + + /** + * @param value {@link #expiry} (When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value + */ + public SubstanceInstanceComponent setExpiryElement(DateTimeType value) { + this.expiry = value; + return this; + } + + /** + * @return When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. + */ + public Date getExpiry() { + return this.expiry == null ? null : this.expiry.getValue(); + } + + /** + * @param value When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. + */ + public SubstanceInstanceComponent setExpiry(Date value) { + if (value == null) + this.expiry = null; + else { + if (this.expiry == null) + this.expiry = new DateTimeType(); + this.expiry.setValue(value); + } + return this; + } + + /** + * @return {@link #quantity} (The amount of the substance.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubstanceInstanceComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of the substance.) + */ + public SubstanceInstanceComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier associated with the package/container (usually a label affixed directly).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("expiry", "dateTime", "When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.", 0, java.lang.Integer.MAX_VALUE, expiry)); + childrenList.add(new Property("quantity", "Quantity", "The amount of the substance.", 0, java.lang.Integer.MAX_VALUE, quantity)); + } + + public SubstanceInstanceComponent copy() { + SubstanceInstanceComponent dst = new SubstanceInstanceComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.expiry = expiry == null ? null : expiry.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SubstanceInstanceComponent)) + return false; + SubstanceInstanceComponent o = (SubstanceInstanceComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(expiry, o.expiry, true) && compareDeep(quantity, o.quantity, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SubstanceInstanceComponent)) + return false; + SubstanceInstanceComponent o = (SubstanceInstanceComponent) other; + return compareValues(expiry, o.expiry, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (expiry == null || expiry.isEmpty()) + && (quantity == null || quantity.isEmpty()); + } + + } + + @Block() + public static class SubstanceIngredientComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The amount of the ingredient in the substance - a concentration ratio. + */ + @Child(name = "quantity", type = {Ratio.class}, order=1, min=0, max=1) + @Description(shortDefinition="Optional amount (concentration)", formalDefinition="The amount of the ingredient in the substance - a concentration ratio." ) + protected Ratio quantity; + + /** + * Another substance that is a component of this substance. + */ + @Child(name = "substance", type = {Substance.class}, order=2, min=1, max=1) + @Description(shortDefinition="A component of the substance", formalDefinition="Another substance that is a component of this substance." ) + protected Reference substance; + + /** + * The actual object that is the target of the reference (Another substance that is a component of this substance.) + */ + protected Substance substanceTarget; + + private static final long serialVersionUID = -1783242034L; + + /* + * Constructor + */ + public SubstanceIngredientComponent() { + super(); + } + + /* + * Constructor + */ + public SubstanceIngredientComponent(Reference substance) { + super(); + this.substance = substance; + } + + /** + * @return {@link #quantity} (The amount of the ingredient in the substance - a concentration ratio.) + */ + public Ratio getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubstanceIngredientComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Ratio(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of the ingredient in the substance - a concentration ratio.) + */ + public SubstanceIngredientComponent setQuantity(Ratio value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #substance} (Another substance that is a component of this substance.) + */ + public Reference getSubstance() { + if (this.substance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubstanceIngredientComponent.substance"); + else if (Configuration.doAutoCreate()) + this.substance = new Reference(); // cc + return this.substance; + } + + public boolean hasSubstance() { + return this.substance != null && !this.substance.isEmpty(); + } + + /** + * @param value {@link #substance} (Another substance that is a component of this substance.) + */ + public SubstanceIngredientComponent setSubstance(Reference value) { + this.substance = value; + return this; + } + + /** + * @return {@link #substance} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Another substance that is a component of this substance.) + */ + public Substance getSubstanceTarget() { + if (this.substanceTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubstanceIngredientComponent.substance"); + else if (Configuration.doAutoCreate()) + this.substanceTarget = new Substance(); // aa + return this.substanceTarget; + } + + /** + * @param value {@link #substance} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Another substance that is a component of this substance.) + */ + public SubstanceIngredientComponent setSubstanceTarget(Substance value) { + this.substanceTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("quantity", "Ratio", "The amount of the ingredient in the substance - a concentration ratio.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("substance", "Reference(Substance)", "Another substance that is a component of this substance.", 0, java.lang.Integer.MAX_VALUE, substance)); + } + + public SubstanceIngredientComponent copy() { + SubstanceIngredientComponent dst = new SubstanceIngredientComponent(); + copyValues(dst); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.substance = substance == null ? null : substance.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SubstanceIngredientComponent)) + return false; + SubstanceIngredientComponent o = (SubstanceIngredientComponent) other; + return compareDeep(quantity, o.quantity, true) && compareDeep(substance, o.substance, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SubstanceIngredientComponent)) + return false; + SubstanceIngredientComponent o = (SubstanceIngredientComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (quantity == null || quantity.isEmpty()) && (substance == null || substance.isEmpty()) + ; + } + + } + + /** + * A code (or set of codes) that identify this substance. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=0, min=1, max=1) + @Description(shortDefinition="What kind of substance this is", formalDefinition="A code (or set of codes) that identify this substance." ) + protected CodeableConcept type; + + /** + * A description of the substance - its appearance, handling requirements, and other usage notes. + */ + @Child(name = "description", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Textual description of the substance, comments", formalDefinition="A description of the substance - its appearance, handling requirements, and other usage notes." ) + protected StringType description; + + /** + * Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance. + */ + @Child(name = "instance", type = {}, order=2, min=0, max=1) + @Description(shortDefinition="If this describes a specific package/container of the substance", formalDefinition="Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance." ) + protected SubstanceInstanceComponent instance; + + /** + * A substance can be composed of other substances. + */ + @Child(name = "ingredient", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Composition information about the substance", formalDefinition="A substance can be composed of other substances." ) + protected List ingredient; + + private static final long serialVersionUID = 1881086620L; + + /* + * Constructor + */ + public Substance() { + super(); + } + + /* + * Constructor + */ + public Substance(CodeableConcept type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (A code (or set of codes) that identify this substance.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Substance.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (A code (or set of codes) that identify this substance.) + */ + public Substance setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #description} (A description of the substance - its appearance, handling requirements, and other usage notes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Substance.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (A description of the substance - its appearance, handling requirements, and other usage notes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public Substance setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A description of the substance - its appearance, handling requirements, and other usage notes. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A description of the substance - its appearance, handling requirements, and other usage notes. + */ + public Substance setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #instance} (Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.) + */ + public SubstanceInstanceComponent getInstance() { + if (this.instance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Substance.instance"); + else if (Configuration.doAutoCreate()) + this.instance = new SubstanceInstanceComponent(); // cc + return this.instance; + } + + public boolean hasInstance() { + return this.instance != null && !this.instance.isEmpty(); + } + + /** + * @param value {@link #instance} (Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.) + */ + public Substance setInstance(SubstanceInstanceComponent value) { + this.instance = value; + return this; + } + + /** + * @return {@link #ingredient} (A substance can be composed of other substances.) + */ + public List getIngredient() { + if (this.ingredient == null) + this.ingredient = new ArrayList(); + return this.ingredient; + } + + public boolean hasIngredient() { + if (this.ingredient == null) + return false; + for (SubstanceIngredientComponent item : this.ingredient) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #ingredient} (A substance can be composed of other substances.) + */ + // syntactic sugar + public SubstanceIngredientComponent addIngredient() { //3 + SubstanceIngredientComponent t = new SubstanceIngredientComponent(); + if (this.ingredient == null) + this.ingredient = new ArrayList(); + this.ingredient.add(t); + return t; + } + + // syntactic sugar + public Substance addIngredient(SubstanceIngredientComponent t) { //3 + if (t == null) + return this; + if (this.ingredient == null) + this.ingredient = new ArrayList(); + this.ingredient.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "A code (or set of codes) that identify this substance.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("description", "string", "A description of the substance - its appearance, handling requirements, and other usage notes.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("instance", "", "Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.", 0, java.lang.Integer.MAX_VALUE, instance)); + childrenList.add(new Property("ingredient", "", "A substance can be composed of other substances.", 0, java.lang.Integer.MAX_VALUE, ingredient)); + } + + public Substance copy() { + Substance dst = new Substance(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.description = description == null ? null : description.copy(); + dst.instance = instance == null ? null : instance.copy(); + if (ingredient != null) { + dst.ingredient = new ArrayList(); + for (SubstanceIngredientComponent i : ingredient) + dst.ingredient.add(i.copy()); + }; + return dst; + } + + protected Substance typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Substance)) + return false; + Substance o = (Substance) other; + return compareDeep(type, o.type, true) && compareDeep(description, o.description, true) && compareDeep(instance, o.instance, true) + && compareDeep(ingredient, o.ingredient, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Substance)) + return false; + Substance o = (Substance) other; + return compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (description == null || description.isEmpty()) + && (instance == null || instance.isEmpty()) && (ingredient == null || ingredient.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Substance; + } + + @SearchParamDefinition(name="identifier", path="Substance.instance.identifier", description="Identifier of the package/container", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="quantity", path="Substance.instance.quantity", description="Amount of substance in the package", type="number" ) + public static final String SP_QUANTITY = "quantity"; + @SearchParamDefinition(name="substance", path="Substance.ingredient.substance", description="A component of the substance", type="reference" ) + public static final String SP_SUBSTANCE = "substance"; + @SearchParamDefinition(name="expiry", path="Substance.instance.expiry", description="When no longer valid to use", type="date" ) + public static final String SP_EXPIRY = "expiry"; + @SearchParamDefinition(name="type", path="Substance.type", description="The type of the substance", type="token" ) + public static final String SP_TYPE = "type"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Supply.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Supply.java index aa9573f5f09..f06f97adf80 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Supply.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Supply.java @@ -1,1181 +1,1160 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A supply - a request for something, and provision of what is supplied. - */ -@ResourceDef(name="Supply", profile="http://hl7.org/fhir/Profile/Supply") -public class Supply extends DomainResource { - - public enum ValuesetSupplyStatus { - /** - * Supply has been requested, but not dispensed. - */ - REQUESTED, - /** - * Supply is part of a pharmacy order and has been dispensed. - */ - DISPENSED, - /** - * Supply has been received by the requestor. - */ - RECEIVED, - /** - * The supply will not be completed because the supplier was unable or unwilling to supply the item. - */ - FAILED, - /** - * The orderer of the supply cancelled the request. - */ - CANCELLED, - /** - * added to help the parsers - */ - NULL; - public static ValuesetSupplyStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return REQUESTED; - if ("dispensed".equals(codeString)) - return DISPENSED; - if ("received".equals(codeString)) - return RECEIVED; - if ("failed".equals(codeString)) - return FAILED; - if ("cancelled".equals(codeString)) - return CANCELLED; - throw new Exception("Unknown ValuesetSupplyStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case REQUESTED: return "requested"; - case DISPENSED: return "dispensed"; - case RECEIVED: return "received"; - case FAILED: return "failed"; - case CANCELLED: return "cancelled"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REQUESTED: return ""; - case DISPENSED: return ""; - case RECEIVED: return ""; - case FAILED: return ""; - case CANCELLED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REQUESTED: return "Supply has been requested, but not dispensed."; - case DISPENSED: return "Supply is part of a pharmacy order and has been dispensed."; - case RECEIVED: return "Supply has been received by the requestor."; - case FAILED: return "The supply will not be completed because the supplier was unable or unwilling to supply the item."; - case CANCELLED: return "The orderer of the supply cancelled the request."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REQUESTED: return "Requested"; - case DISPENSED: return "Dispensed"; - case RECEIVED: return "Received"; - case FAILED: return "Failed"; - case CANCELLED: return "Cancelled"; - default: return "?"; - } - } - } - - public static class ValuesetSupplyStatusEnumFactory implements EnumFactory { - public ValuesetSupplyStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return ValuesetSupplyStatus.REQUESTED; - if ("dispensed".equals(codeString)) - return ValuesetSupplyStatus.DISPENSED; - if ("received".equals(codeString)) - return ValuesetSupplyStatus.RECEIVED; - if ("failed".equals(codeString)) - return ValuesetSupplyStatus.FAILED; - if ("cancelled".equals(codeString)) - return ValuesetSupplyStatus.CANCELLED; - throw new IllegalArgumentException("Unknown ValuesetSupplyStatus code '"+codeString+"'"); - } - public String toCode(ValuesetSupplyStatus code) { - if (code == ValuesetSupplyStatus.REQUESTED) - return "requested"; - if (code == ValuesetSupplyStatus.DISPENSED) - return "dispensed"; - if (code == ValuesetSupplyStatus.RECEIVED) - return "received"; - if (code == ValuesetSupplyStatus.FAILED) - return "failed"; - if (code == ValuesetSupplyStatus.CANCELLED) - return "cancelled"; - return "?"; - } - } - - public enum ValuesetSupplyDispenseStatus { - /** - * Supply has been requested, but not dispensed. - */ - INPROGRESS, - /** - * Supply is part of a pharmacy order and has been dispensed. - */ - DISPENSED, - /** - * Dispensing was not completed. - */ - ABANDONED, - /** - * added to help the parsers - */ - NULL; - public static ValuesetSupplyDispenseStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("dispensed".equals(codeString)) - return DISPENSED; - if ("abandoned".equals(codeString)) - return ABANDONED; - throw new Exception("Unknown ValuesetSupplyDispenseStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INPROGRESS: return "in-progress"; - case DISPENSED: return "dispensed"; - case ABANDONED: return "abandoned"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPROGRESS: return ""; - case DISPENSED: return ""; - case ABANDONED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPROGRESS: return "Supply has been requested, but not dispensed."; - case DISPENSED: return "Supply is part of a pharmacy order and has been dispensed."; - case ABANDONED: return "Dispensing was not completed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPROGRESS: return "In Progress"; - case DISPENSED: return "Dispensed"; - case ABANDONED: return "Abandoned"; - default: return "?"; - } - } - } - - public static class ValuesetSupplyDispenseStatusEnumFactory implements EnumFactory { - public ValuesetSupplyDispenseStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return ValuesetSupplyDispenseStatus.INPROGRESS; - if ("dispensed".equals(codeString)) - return ValuesetSupplyDispenseStatus.DISPENSED; - if ("abandoned".equals(codeString)) - return ValuesetSupplyDispenseStatus.ABANDONED; - throw new IllegalArgumentException("Unknown ValuesetSupplyDispenseStatus code '"+codeString+"'"); - } - public String toCode(ValuesetSupplyDispenseStatus code) { - if (code == ValuesetSupplyDispenseStatus.INPROGRESS) - return "in-progress"; - if (code == ValuesetSupplyDispenseStatus.DISPENSED) - return "dispensed"; - if (code == ValuesetSupplyDispenseStatus.ABANDONED) - return "abandoned"; - return "?"; - } - } - - @Block() - public static class SupplyDispenseComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifier assigned by the dispensing facility when the item(s) is dispensed. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) - @Description(shortDefinition="External identifier", formalDefinition="Identifier assigned by the dispensing facility when the item(s) is dispensed." ) - protected Identifier identifier; - - /** - * A code specifying the state of the dispense event. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="in-progress | dispensed | abandoned", formalDefinition="A code specifying the state of the dispense event." ) - protected Enumeration status; - - /** - * Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Category of dispense event", formalDefinition="Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc." ) - protected CodeableConcept type; - - /** - * The amount of supply that has been dispensed. Includes unit of measure. - */ - @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1) - @Description(shortDefinition="Amount dispensed", formalDefinition="The amount of supply that has been dispensed. Includes unit of measure." ) - protected Quantity quantity; - - /** - * Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list. - */ - @Child(name = "suppliedItem", type = {Medication.class, Substance.class, Device.class}, order=5, min=0, max=1) - @Description(shortDefinition="Medication, Substance, or Device supplied", formalDefinition="Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list." ) - protected Reference suppliedItem; - - /** - * The actual object that is the target of the reference (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) - */ - protected Resource suppliedItemTarget; - - /** - * The individual responsible for dispensing the medication, supplier or device. - */ - @Child(name = "supplier", type = {Practitioner.class}, order=6, min=0, max=1) - @Description(shortDefinition="Dispenser", formalDefinition="The individual responsible for dispensing the medication, supplier or device." ) - protected Reference supplier; - - /** - * The actual object that is the target of the reference (The individual responsible for dispensing the medication, supplier or device.) - */ - protected Practitioner supplierTarget; - - /** - * The time the dispense event occurred. - */ - @Child(name = "whenPrepared", type = {Period.class}, order=7, min=0, max=1) - @Description(shortDefinition="Dispensing time", formalDefinition="The time the dispense event occurred." ) - protected Period whenPrepared; - - /** - * The time the dispensed item was sent or handed to the patient (or agent). - */ - @Child(name = "whenHandedOver", type = {DateTimeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Handover time", formalDefinition="The time the dispensed item was sent or handed to the patient (or agent)." ) - protected DateTimeType whenHandedOver; - - /** - * Identification of the facility/location where the Supply was shipped to, as part of the dispense event. - */ - @Child(name = "destination", type = {Location.class}, order=9, min=0, max=1) - @Description(shortDefinition="Where the Supply was sent", formalDefinition="Identification of the facility/location where the Supply was shipped to, as part of the dispense event." ) - protected Reference destination; - - /** - * The actual object that is the target of the reference (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) - */ - protected Location destinationTarget; - - /** - * Identifies the person who picked up the Supply. - */ - @Child(name = "receiver", type = {Practitioner.class}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who collected the Supply", formalDefinition="Identifies the person who picked up the Supply." ) - protected List receiver; - /** - * The actual objects that are the target of the reference (Identifies the person who picked up the Supply.) - */ - protected List receiverTarget; - - - private static final long serialVersionUID = -1941592649L; - - /* - * Constructor - */ - public SupplyDispenseComponent() { - super(); - } - - /** - * @return {@link #identifier} (Identifier assigned by the dispensing facility when the item(s) is dispensed.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifier assigned by the dispensing facility when the item(s) is dispensed.) - */ - public SupplyDispenseComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #status} (A code specifying the state of the dispense event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ValuesetSupplyDispenseStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (A code specifying the state of the dispense event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public SupplyDispenseComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return A code specifying the state of the dispense event. - */ - public ValuesetSupplyDispenseStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value A code specifying the state of the dispense event. - */ - public SupplyDispenseComponent setStatus(ValuesetSupplyDispenseStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new ValuesetSupplyDispenseStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) - */ - public SupplyDispenseComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #quantity} (The amount of supply that has been dispensed. Includes unit of measure.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of supply that has been dispensed. Includes unit of measure.) - */ - public SupplyDispenseComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #suppliedItem} (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) - */ - public Reference getSuppliedItem() { - if (this.suppliedItem == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.suppliedItem"); - else if (Configuration.doAutoCreate()) - this.suppliedItem = new Reference(); // cc - return this.suppliedItem; - } - - public boolean hasSuppliedItem() { - return this.suppliedItem != null && !this.suppliedItem.isEmpty(); - } - - /** - * @param value {@link #suppliedItem} (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) - */ - public SupplyDispenseComponent setSuppliedItem(Reference value) { - this.suppliedItem = value; - return this; - } - - /** - * @return {@link #suppliedItem} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) - */ - public Resource getSuppliedItemTarget() { - return this.suppliedItemTarget; - } - - /** - * @param value {@link #suppliedItem} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) - */ - public SupplyDispenseComponent setSuppliedItemTarget(Resource value) { - this.suppliedItemTarget = value; - return this; - } - - /** - * @return {@link #supplier} (The individual responsible for dispensing the medication, supplier or device.) - */ - public Reference getSupplier() { - if (this.supplier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.supplier"); - else if (Configuration.doAutoCreate()) - this.supplier = new Reference(); // cc - return this.supplier; - } - - public boolean hasSupplier() { - return this.supplier != null && !this.supplier.isEmpty(); - } - - /** - * @param value {@link #supplier} (The individual responsible for dispensing the medication, supplier or device.) - */ - public SupplyDispenseComponent setSupplier(Reference value) { - this.supplier = value; - return this; - } - - /** - * @return {@link #supplier} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The individual responsible for dispensing the medication, supplier or device.) - */ - public Practitioner getSupplierTarget() { - if (this.supplierTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.supplier"); - else if (Configuration.doAutoCreate()) - this.supplierTarget = new Practitioner(); // aa - return this.supplierTarget; - } - - /** - * @param value {@link #supplier} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The individual responsible for dispensing the medication, supplier or device.) - */ - public SupplyDispenseComponent setSupplierTarget(Practitioner value) { - this.supplierTarget = value; - return this; - } - - /** - * @return {@link #whenPrepared} (The time the dispense event occurred.) - */ - public Period getWhenPrepared() { - if (this.whenPrepared == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.whenPrepared"); - else if (Configuration.doAutoCreate()) - this.whenPrepared = new Period(); // cc - return this.whenPrepared; - } - - public boolean hasWhenPrepared() { - return this.whenPrepared != null && !this.whenPrepared.isEmpty(); - } - - /** - * @param value {@link #whenPrepared} (The time the dispense event occurred.) - */ - public SupplyDispenseComponent setWhenPrepared(Period value) { - this.whenPrepared = value; - return this; - } - - /** - * @return {@link #whenHandedOver} (The time the dispensed item was sent or handed to the patient (or agent).). This is the underlying object with id, value and extensions. The accessor "getWhenHandedOver" gives direct access to the value - */ - public DateTimeType getWhenHandedOverElement() { - if (this.whenHandedOver == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.whenHandedOver"); - else if (Configuration.doAutoCreate()) - this.whenHandedOver = new DateTimeType(); // bb - return this.whenHandedOver; - } - - public boolean hasWhenHandedOverElement() { - return this.whenHandedOver != null && !this.whenHandedOver.isEmpty(); - } - - public boolean hasWhenHandedOver() { - return this.whenHandedOver != null && !this.whenHandedOver.isEmpty(); - } - - /** - * @param value {@link #whenHandedOver} (The time the dispensed item was sent or handed to the patient (or agent).). This is the underlying object with id, value and extensions. The accessor "getWhenHandedOver" gives direct access to the value - */ - public SupplyDispenseComponent setWhenHandedOverElement(DateTimeType value) { - this.whenHandedOver = value; - return this; - } - - /** - * @return The time the dispensed item was sent or handed to the patient (or agent). - */ - public Date getWhenHandedOver() { - return this.whenHandedOver == null ? null : this.whenHandedOver.getValue(); - } - - /** - * @param value The time the dispensed item was sent or handed to the patient (or agent). - */ - public SupplyDispenseComponent setWhenHandedOver(Date value) { - if (value == null) - this.whenHandedOver = null; - else { - if (this.whenHandedOver == null) - this.whenHandedOver = new DateTimeType(); - this.whenHandedOver.setValue(value); - } - return this; - } - - /** - * @return {@link #destination} (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) - */ - public Reference getDestination() { - if (this.destination == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.destination"); - else if (Configuration.doAutoCreate()) - this.destination = new Reference(); // cc - return this.destination; - } - - public boolean hasDestination() { - return this.destination != null && !this.destination.isEmpty(); - } - - /** - * @param value {@link #destination} (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) - */ - public SupplyDispenseComponent setDestination(Reference value) { - this.destination = value; - return this; - } - - /** - * @return {@link #destination} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) - */ - public Location getDestinationTarget() { - if (this.destinationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.destination"); - else if (Configuration.doAutoCreate()) - this.destinationTarget = new Location(); // aa - return this.destinationTarget; - } - - /** - * @param value {@link #destination} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) - */ - public SupplyDispenseComponent setDestinationTarget(Location value) { - this.destinationTarget = value; - return this; - } - - /** - * @return {@link #receiver} (Identifies the person who picked up the Supply.) - */ - public List getReceiver() { - if (this.receiver == null) - this.receiver = new ArrayList(); - return this.receiver; - } - - public boolean hasReceiver() { - if (this.receiver == null) - return false; - for (Reference item : this.receiver) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #receiver} (Identifies the person who picked up the Supply.) - */ - // syntactic sugar - public Reference addReceiver() { //3 - Reference t = new Reference(); - if (this.receiver == null) - this.receiver = new ArrayList(); - this.receiver.add(t); - return t; - } - - // syntactic sugar - public SupplyDispenseComponent addReceiver(Reference t) { //3 - if (t == null) - return this; - if (this.receiver == null) - this.receiver = new ArrayList(); - this.receiver.add(t); - return this; - } - - /** - * @return {@link #receiver} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies the person who picked up the Supply.) - */ - public List getReceiverTarget() { - if (this.receiverTarget == null) - this.receiverTarget = new ArrayList(); - return this.receiverTarget; - } - - // syntactic sugar - /** - * @return {@link #receiver} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Identifies the person who picked up the Supply.) - */ - public Practitioner addReceiverTarget() { - Practitioner r = new Practitioner(); - if (this.receiverTarget == null) - this.receiverTarget = new ArrayList(); - this.receiverTarget.add(r); - return r; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier assigned by the dispensing facility when the item(s) is dispensed.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "A code specifying the state of the dispense event.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("quantity", "Quantity", "The amount of supply that has been dispensed. Includes unit of measure.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("suppliedItem", "Reference(Medication|Substance|Device)", "Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.", 0, java.lang.Integer.MAX_VALUE, suppliedItem)); - childrenList.add(new Property("supplier", "Reference(Practitioner)", "The individual responsible for dispensing the medication, supplier or device.", 0, java.lang.Integer.MAX_VALUE, supplier)); - childrenList.add(new Property("whenPrepared", "Period", "The time the dispense event occurred.", 0, java.lang.Integer.MAX_VALUE, whenPrepared)); - childrenList.add(new Property("whenHandedOver", "dateTime", "The time the dispensed item was sent or handed to the patient (or agent).", 0, java.lang.Integer.MAX_VALUE, whenHandedOver)); - childrenList.add(new Property("destination", "Reference(Location)", "Identification of the facility/location where the Supply was shipped to, as part of the dispense event.", 0, java.lang.Integer.MAX_VALUE, destination)); - childrenList.add(new Property("receiver", "Reference(Practitioner)", "Identifies the person who picked up the Supply.", 0, java.lang.Integer.MAX_VALUE, receiver)); - } - - public SupplyDispenseComponent copy() { - SupplyDispenseComponent dst = new SupplyDispenseComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.status = status == null ? null : status.copy(); - dst.type = type == null ? null : type.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.suppliedItem = suppliedItem == null ? null : suppliedItem.copy(); - dst.supplier = supplier == null ? null : supplier.copy(); - dst.whenPrepared = whenPrepared == null ? null : whenPrepared.copy(); - dst.whenHandedOver = whenHandedOver == null ? null : whenHandedOver.copy(); - dst.destination = destination == null ? null : destination.copy(); - if (receiver != null) { - dst.receiver = new ArrayList(); - for (Reference i : receiver) - dst.receiver.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SupplyDispenseComponent)) - return false; - SupplyDispenseComponent o = (SupplyDispenseComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(type, o.type, true) - && compareDeep(quantity, o.quantity, true) && compareDeep(suppliedItem, o.suppliedItem, true) && compareDeep(supplier, o.supplier, true) - && compareDeep(whenPrepared, o.whenPrepared, true) && compareDeep(whenHandedOver, o.whenHandedOver, true) - && compareDeep(destination, o.destination, true) && compareDeep(receiver, o.receiver, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SupplyDispenseComponent)) - return false; - SupplyDispenseComponent o = (SupplyDispenseComponent) other; - return compareValues(status, o.status, true) && compareValues(whenHandedOver, o.whenHandedOver, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (type == null || type.isEmpty()) && (quantity == null || quantity.isEmpty()) && (suppliedItem == null || suppliedItem.isEmpty()) - && (supplier == null || supplier.isEmpty()) && (whenPrepared == null || whenPrepared.isEmpty()) - && (whenHandedOver == null || whenHandedOver.isEmpty()) && (destination == null || destination.isEmpty()) - && (receiver == null || receiver.isEmpty()); - } - - } - - /** - * Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process. - */ - @Child(name = "kind", type = {CodeableConcept.class}, order=0, min=0, max=1) - @Description(shortDefinition="The kind of supply (central, non-stock, etc)", formalDefinition="Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process." ) - protected CodeableConcept kind; - - /** - * Unique identifier for this supply request. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) - @Description(shortDefinition="Unique identifier", formalDefinition="Unique identifier for this supply request." ) - protected Identifier identifier; - - /** - * Status of the supply request. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="requested | dispensed | received | failed | cancelled", formalDefinition="Status of the supply request." ) - protected Enumeration status; - - /** - * The item that is requested to be supplied. - */ - @Child(name = "orderedItem", type = {Medication.class, Substance.class, Device.class}, order=3, min=0, max=1) - @Description(shortDefinition="Medication, Substance, or Device requested to be supplied", formalDefinition="The item that is requested to be supplied." ) - protected Reference orderedItem; - - /** - * The actual object that is the target of the reference (The item that is requested to be supplied.) - */ - protected Resource orderedItemTarget; - - /** - * A link to a resource representing the person whom the ordered item is for. - */ - @Child(name = "patient", type = {Patient.class}, order=4, min=0, max=1) - @Description(shortDefinition="Patient for whom the item is supplied", formalDefinition="A link to a resource representing the person whom the ordered item is for." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (A link to a resource representing the person whom the ordered item is for.) - */ - protected Patient patientTarget; - - /** - * Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed. - */ - @Child(name = "dispense", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Supply details", formalDefinition="Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed." ) - protected List dispense; - - private static final long serialVersionUID = 1122115505L; - - /* - * Constructor - */ - public Supply() { - super(); - } - - /** - * @return {@link #kind} (Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.) - */ - public CodeableConcept getKind() { - if (this.kind == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Supply.kind"); - else if (Configuration.doAutoCreate()) - this.kind = new CodeableConcept(); // cc - return this.kind; - } - - public boolean hasKind() { - return this.kind != null && !this.kind.isEmpty(); - } - - /** - * @param value {@link #kind} (Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.) - */ - public Supply setKind(CodeableConcept value) { - this.kind = value; - return this; - } - - /** - * @return {@link #identifier} (Unique identifier for this supply request.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Supply.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Unique identifier for this supply request.) - */ - public Supply setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #status} (Status of the supply request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Supply.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ValuesetSupplyStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Status of the supply request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Supply setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Status of the supply request. - */ - public ValuesetSupplyStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Status of the supply request. - */ - public Supply setStatus(ValuesetSupplyStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new ValuesetSupplyStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #orderedItem} (The item that is requested to be supplied.) - */ - public Reference getOrderedItem() { - if (this.orderedItem == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Supply.orderedItem"); - else if (Configuration.doAutoCreate()) - this.orderedItem = new Reference(); // cc - return this.orderedItem; - } - - public boolean hasOrderedItem() { - return this.orderedItem != null && !this.orderedItem.isEmpty(); - } - - /** - * @param value {@link #orderedItem} (The item that is requested to be supplied.) - */ - public Supply setOrderedItem(Reference value) { - this.orderedItem = value; - return this; - } - - /** - * @return {@link #orderedItem} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The item that is requested to be supplied.) - */ - public Resource getOrderedItemTarget() { - return this.orderedItemTarget; - } - - /** - * @param value {@link #orderedItem} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The item that is requested to be supplied.) - */ - public Supply setOrderedItemTarget(Resource value) { - this.orderedItemTarget = value; - return this; - } - - /** - * @return {@link #patient} (A link to a resource representing the person whom the ordered item is for.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Supply.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (A link to a resource representing the person whom the ordered item is for.) - */ - public Supply setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person whom the ordered item is for.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Supply.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person whom the ordered item is for.) - */ - public Supply setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #dispense} (Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed.) - */ - public List getDispense() { - if (this.dispense == null) - this.dispense = new ArrayList(); - return this.dispense; - } - - public boolean hasDispense() { - if (this.dispense == null) - return false; - for (SupplyDispenseComponent item : this.dispense) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dispense} (Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed.) - */ - // syntactic sugar - public SupplyDispenseComponent addDispense() { //3 - SupplyDispenseComponent t = new SupplyDispenseComponent(); - if (this.dispense == null) - this.dispense = new ArrayList(); - this.dispense.add(t); - return t; - } - - // syntactic sugar - public Supply addDispense(SupplyDispenseComponent t) { //3 - if (t == null) - return this; - if (this.dispense == null) - this.dispense = new ArrayList(); - this.dispense.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("kind", "CodeableConcept", "Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.", 0, java.lang.Integer.MAX_VALUE, kind)); - childrenList.add(new Property("identifier", "Identifier", "Unique identifier for this supply request.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "Status of the supply request.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("orderedItem", "Reference(Medication|Substance|Device)", "The item that is requested to be supplied.", 0, java.lang.Integer.MAX_VALUE, orderedItem)); - childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person whom the ordered item is for.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("dispense", "", "Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed.", 0, java.lang.Integer.MAX_VALUE, dispense)); - } - - public Supply copy() { - Supply dst = new Supply(); - copyValues(dst); - dst.kind = kind == null ? null : kind.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.status = status == null ? null : status.copy(); - dst.orderedItem = orderedItem == null ? null : orderedItem.copy(); - dst.patient = patient == null ? null : patient.copy(); - if (dispense != null) { - dst.dispense = new ArrayList(); - for (SupplyDispenseComponent i : dispense) - dst.dispense.add(i.copy()); - }; - return dst; - } - - protected Supply typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Supply)) - return false; - Supply o = (Supply) other; - return compareDeep(kind, o.kind, true) && compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) - && compareDeep(orderedItem, o.orderedItem, true) && compareDeep(patient, o.patient, true) && compareDeep(dispense, o.dispense, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Supply)) - return false; - Supply o = (Supply) other; - return compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (kind == null || kind.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (status == null || status.isEmpty()) && (orderedItem == null || orderedItem.isEmpty()) - && (patient == null || patient.isEmpty()) && (dispense == null || dispense.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Supply; - } - - @SearchParamDefinition(name="patient", path="Supply.patient", description="Patient for whom the item is supplied", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="status", path="Supply.status", description="requested | dispensed | received | failed | cancelled", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="dispenseid", path="Supply.dispense.identifier", description="External identifier", type="token" ) - public static final String SP_DISPENSEID = "dispenseid"; - @SearchParamDefinition(name="identifier", path="Supply.identifier", description="Unique identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="supplier", path="Supply.dispense.supplier", description="Dispenser", type="reference" ) - public static final String SP_SUPPLIER = "supplier"; - @SearchParamDefinition(name="kind", path="Supply.kind", description="The kind of supply (central, non-stock, etc)", type="token" ) - public static final String SP_KIND = "kind"; - @SearchParamDefinition(name="dispensestatus", path="Supply.dispense.status", description="in-progress | dispensed | abandoned", type="token" ) - public static final String SP_DISPENSESTATUS = "dispensestatus"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A supply - a request for something, and provision of what is supplied. + */ +@ResourceDef(name="Supply", profile="http://hl7.org/fhir/Profile/Supply") +public class Supply extends DomainResource { + + public enum ValuesetSupplyStatus { + /** + * Supply has been requested, but not dispensed. + */ + REQUESTED, + /** + * Supply is part of a pharmacy order and has been dispensed. + */ + DISPENSED, + /** + * Supply has been received by the requestor. + */ + RECEIVED, + /** + * The supply will not be completed because the supplier was unable or unwilling to supply the item. + */ + FAILED, + /** + * The orderer of the supply cancelled the request. + */ + CANCELLED, + /** + * added to help the parsers + */ + NULL; + public static ValuesetSupplyStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return REQUESTED; + if ("dispensed".equals(codeString)) + return DISPENSED; + if ("received".equals(codeString)) + return RECEIVED; + if ("failed".equals(codeString)) + return FAILED; + if ("cancelled".equals(codeString)) + return CANCELLED; + throw new Exception("Unknown ValuesetSupplyStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case REQUESTED: return "requested"; + case DISPENSED: return "dispensed"; + case RECEIVED: return "received"; + case FAILED: return "failed"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REQUESTED: return ""; + case DISPENSED: return ""; + case RECEIVED: return ""; + case FAILED: return ""; + case CANCELLED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REQUESTED: return "Supply has been requested, but not dispensed."; + case DISPENSED: return "Supply is part of a pharmacy order and has been dispensed."; + case RECEIVED: return "Supply has been received by the requestor."; + case FAILED: return "The supply will not be completed because the supplier was unable or unwilling to supply the item."; + case CANCELLED: return "The orderer of the supply cancelled the request."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REQUESTED: return "Requested"; + case DISPENSED: return "Dispensed"; + case RECEIVED: return "Received"; + case FAILED: return "Failed"; + case CANCELLED: return "Cancelled"; + default: return "?"; + } + } + } + + public static class ValuesetSupplyStatusEnumFactory implements EnumFactory { + public ValuesetSupplyStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return ValuesetSupplyStatus.REQUESTED; + if ("dispensed".equals(codeString)) + return ValuesetSupplyStatus.DISPENSED; + if ("received".equals(codeString)) + return ValuesetSupplyStatus.RECEIVED; + if ("failed".equals(codeString)) + return ValuesetSupplyStatus.FAILED; + if ("cancelled".equals(codeString)) + return ValuesetSupplyStatus.CANCELLED; + throw new IllegalArgumentException("Unknown ValuesetSupplyStatus code '"+codeString+"'"); + } + public String toCode(ValuesetSupplyStatus code) { + if (code == ValuesetSupplyStatus.REQUESTED) + return "requested"; + if (code == ValuesetSupplyStatus.DISPENSED) + return "dispensed"; + if (code == ValuesetSupplyStatus.RECEIVED) + return "received"; + if (code == ValuesetSupplyStatus.FAILED) + return "failed"; + if (code == ValuesetSupplyStatus.CANCELLED) + return "cancelled"; + return "?"; + } + } + + public enum ValuesetSupplyDispenseStatus { + /** + * Supply has been requested, but not dispensed. + */ + INPROGRESS, + /** + * Supply is part of a pharmacy order and has been dispensed. + */ + DISPENSED, + /** + * Dispensing was not completed. + */ + ABANDONED, + /** + * added to help the parsers + */ + NULL; + public static ValuesetSupplyDispenseStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("dispensed".equals(codeString)) + return DISPENSED; + if ("abandoned".equals(codeString)) + return ABANDONED; + throw new Exception("Unknown ValuesetSupplyDispenseStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INPROGRESS: return "in-progress"; + case DISPENSED: return "dispensed"; + case ABANDONED: return "abandoned"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return ""; + case DISPENSED: return ""; + case ABANDONED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "Supply has been requested, but not dispensed."; + case DISPENSED: return "Supply is part of a pharmacy order and has been dispensed."; + case ABANDONED: return "Dispensing was not completed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "In Progress"; + case DISPENSED: return "Dispensed"; + case ABANDONED: return "Abandoned"; + default: return "?"; + } + } + } + + public static class ValuesetSupplyDispenseStatusEnumFactory implements EnumFactory { + public ValuesetSupplyDispenseStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return ValuesetSupplyDispenseStatus.INPROGRESS; + if ("dispensed".equals(codeString)) + return ValuesetSupplyDispenseStatus.DISPENSED; + if ("abandoned".equals(codeString)) + return ValuesetSupplyDispenseStatus.ABANDONED; + throw new IllegalArgumentException("Unknown ValuesetSupplyDispenseStatus code '"+codeString+"'"); + } + public String toCode(ValuesetSupplyDispenseStatus code) { + if (code == ValuesetSupplyDispenseStatus.INPROGRESS) + return "in-progress"; + if (code == ValuesetSupplyDispenseStatus.DISPENSED) + return "dispensed"; + if (code == ValuesetSupplyDispenseStatus.ABANDONED) + return "abandoned"; + return "?"; + } + } + + @Block() + public static class SupplyDispenseComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifier assigned by the dispensing facility when the item(s) is dispensed. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) + @Description(shortDefinition="External identifier", formalDefinition="Identifier assigned by the dispensing facility when the item(s) is dispensed." ) + protected Identifier identifier; + + /** + * A code specifying the state of the dispense event. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="in-progress | dispensed | abandoned", formalDefinition="A code specifying the state of the dispense event." ) + protected Enumeration status; + + /** + * Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Category of dispense event", formalDefinition="Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc." ) + protected CodeableConcept type; + + /** + * The amount of supply that has been dispensed. Includes unit of measure. + */ + @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Amount dispensed", formalDefinition="The amount of supply that has been dispensed. Includes unit of measure." ) + protected Quantity quantity; + + /** + * Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list. + */ + @Child(name = "suppliedItem", type = {Medication.class, Substance.class, Device.class}, order=5, min=0, max=1) + @Description(shortDefinition="Medication, Substance, or Device supplied", formalDefinition="Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list." ) + protected Reference suppliedItem; + + /** + * The actual object that is the target of the reference (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) + */ + protected Resource suppliedItemTarget; + + /** + * The individual responsible for dispensing the medication, supplier or device. + */ + @Child(name = "supplier", type = {Practitioner.class}, order=6, min=0, max=1) + @Description(shortDefinition="Dispenser", formalDefinition="The individual responsible for dispensing the medication, supplier or device." ) + protected Reference supplier; + + /** + * The actual object that is the target of the reference (The individual responsible for dispensing the medication, supplier or device.) + */ + protected Practitioner supplierTarget; + + /** + * The time the dispense event occurred. + */ + @Child(name = "whenPrepared", type = {Period.class}, order=7, min=0, max=1) + @Description(shortDefinition="Dispensing time", formalDefinition="The time the dispense event occurred." ) + protected Period whenPrepared; + + /** + * The time the dispensed item was sent or handed to the patient (or agent). + */ + @Child(name = "whenHandedOver", type = {DateTimeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Handover time", formalDefinition="The time the dispensed item was sent or handed to the patient (or agent)." ) + protected DateTimeType whenHandedOver; + + /** + * Identification of the facility/location where the Supply was shipped to, as part of the dispense event. + */ + @Child(name = "destination", type = {Location.class}, order=9, min=0, max=1) + @Description(shortDefinition="Where the Supply was sent", formalDefinition="Identification of the facility/location where the Supply was shipped to, as part of the dispense event." ) + protected Reference destination; + + /** + * The actual object that is the target of the reference (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) + */ + protected Location destinationTarget; + + /** + * Identifies the person who picked up the Supply. + */ + @Child(name = "receiver", type = {Practitioner.class}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who collected the Supply", formalDefinition="Identifies the person who picked up the Supply." ) + protected List receiver; + /** + * The actual objects that are the target of the reference (Identifies the person who picked up the Supply.) + */ + protected List receiverTarget; + + + private static final long serialVersionUID = -1941592649L; + + /* + * Constructor + */ + public SupplyDispenseComponent() { + super(); + } + + /** + * @return {@link #identifier} (Identifier assigned by the dispensing facility when the item(s) is dispensed.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifier assigned by the dispensing facility when the item(s) is dispensed.) + */ + public SupplyDispenseComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #status} (A code specifying the state of the dispense event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ValuesetSupplyDispenseStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (A code specifying the state of the dispense event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public SupplyDispenseComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return A code specifying the state of the dispense event. + */ + public ValuesetSupplyDispenseStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value A code specifying the state of the dispense event. + */ + public SupplyDispenseComponent setStatus(ValuesetSupplyDispenseStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new ValuesetSupplyDispenseStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) + */ + public SupplyDispenseComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #quantity} (The amount of supply that has been dispensed. Includes unit of measure.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of supply that has been dispensed. Includes unit of measure.) + */ + public SupplyDispenseComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #suppliedItem} (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) + */ + public Reference getSuppliedItem() { + if (this.suppliedItem == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.suppliedItem"); + else if (Configuration.doAutoCreate()) + this.suppliedItem = new Reference(); // cc + return this.suppliedItem; + } + + public boolean hasSuppliedItem() { + return this.suppliedItem != null && !this.suppliedItem.isEmpty(); + } + + /** + * @param value {@link #suppliedItem} (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) + */ + public SupplyDispenseComponent setSuppliedItem(Reference value) { + this.suppliedItem = value; + return this; + } + + /** + * @return {@link #suppliedItem} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) + */ + public Resource getSuppliedItemTarget() { + return this.suppliedItemTarget; + } + + /** + * @param value {@link #suppliedItem} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) + */ + public SupplyDispenseComponent setSuppliedItemTarget(Resource value) { + this.suppliedItemTarget = value; + return this; + } + + /** + * @return {@link #supplier} (The individual responsible for dispensing the medication, supplier or device.) + */ + public Reference getSupplier() { + if (this.supplier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.supplier"); + else if (Configuration.doAutoCreate()) + this.supplier = new Reference(); // cc + return this.supplier; + } + + public boolean hasSupplier() { + return this.supplier != null && !this.supplier.isEmpty(); + } + + /** + * @param value {@link #supplier} (The individual responsible for dispensing the medication, supplier or device.) + */ + public SupplyDispenseComponent setSupplier(Reference value) { + this.supplier = value; + return this; + } + + /** + * @return {@link #supplier} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The individual responsible for dispensing the medication, supplier or device.) + */ + public Practitioner getSupplierTarget() { + if (this.supplierTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.supplier"); + else if (Configuration.doAutoCreate()) + this.supplierTarget = new Practitioner(); // aa + return this.supplierTarget; + } + + /** + * @param value {@link #supplier} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The individual responsible for dispensing the medication, supplier or device.) + */ + public SupplyDispenseComponent setSupplierTarget(Practitioner value) { + this.supplierTarget = value; + return this; + } + + /** + * @return {@link #whenPrepared} (The time the dispense event occurred.) + */ + public Period getWhenPrepared() { + if (this.whenPrepared == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.whenPrepared"); + else if (Configuration.doAutoCreate()) + this.whenPrepared = new Period(); // cc + return this.whenPrepared; + } + + public boolean hasWhenPrepared() { + return this.whenPrepared != null && !this.whenPrepared.isEmpty(); + } + + /** + * @param value {@link #whenPrepared} (The time the dispense event occurred.) + */ + public SupplyDispenseComponent setWhenPrepared(Period value) { + this.whenPrepared = value; + return this; + } + + /** + * @return {@link #whenHandedOver} (The time the dispensed item was sent or handed to the patient (or agent).). This is the underlying object with id, value and extensions. The accessor "getWhenHandedOver" gives direct access to the value + */ + public DateTimeType getWhenHandedOverElement() { + if (this.whenHandedOver == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.whenHandedOver"); + else if (Configuration.doAutoCreate()) + this.whenHandedOver = new DateTimeType(); // bb + return this.whenHandedOver; + } + + public boolean hasWhenHandedOverElement() { + return this.whenHandedOver != null && !this.whenHandedOver.isEmpty(); + } + + public boolean hasWhenHandedOver() { + return this.whenHandedOver != null && !this.whenHandedOver.isEmpty(); + } + + /** + * @param value {@link #whenHandedOver} (The time the dispensed item was sent or handed to the patient (or agent).). This is the underlying object with id, value and extensions. The accessor "getWhenHandedOver" gives direct access to the value + */ + public SupplyDispenseComponent setWhenHandedOverElement(DateTimeType value) { + this.whenHandedOver = value; + return this; + } + + /** + * @return The time the dispensed item was sent or handed to the patient (or agent). + */ + public Date getWhenHandedOver() { + return this.whenHandedOver == null ? null : this.whenHandedOver.getValue(); + } + + /** + * @param value The time the dispensed item was sent or handed to the patient (or agent). + */ + public SupplyDispenseComponent setWhenHandedOver(Date value) { + if (value == null) + this.whenHandedOver = null; + else { + if (this.whenHandedOver == null) + this.whenHandedOver = new DateTimeType(); + this.whenHandedOver.setValue(value); + } + return this; + } + + /** + * @return {@link #destination} (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) + */ + public Reference getDestination() { + if (this.destination == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.destination"); + else if (Configuration.doAutoCreate()) + this.destination = new Reference(); // cc + return this.destination; + } + + public boolean hasDestination() { + return this.destination != null && !this.destination.isEmpty(); + } + + /** + * @param value {@link #destination} (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) + */ + public SupplyDispenseComponent setDestination(Reference value) { + this.destination = value; + return this; + } + + /** + * @return {@link #destination} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) + */ + public Location getDestinationTarget() { + if (this.destinationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.destination"); + else if (Configuration.doAutoCreate()) + this.destinationTarget = new Location(); // aa + return this.destinationTarget; + } + + /** + * @param value {@link #destination} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) + */ + public SupplyDispenseComponent setDestinationTarget(Location value) { + this.destinationTarget = value; + return this; + } + + /** + * @return {@link #receiver} (Identifies the person who picked up the Supply.) + */ + public List getReceiver() { + if (this.receiver == null) + this.receiver = new ArrayList(); + return this.receiver; + } + + public boolean hasReceiver() { + if (this.receiver == null) + return false; + for (Reference item : this.receiver) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #receiver} (Identifies the person who picked up the Supply.) + */ + // syntactic sugar + public Reference addReceiver() { //3 + Reference t = new Reference(); + if (this.receiver == null) + this.receiver = new ArrayList(); + this.receiver.add(t); + return t; + } + + // syntactic sugar + public SupplyDispenseComponent addReceiver(Reference t) { //3 + if (t == null) + return this; + if (this.receiver == null) + this.receiver = new ArrayList(); + this.receiver.add(t); + return this; + } + + /** + * @return {@link #receiver} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies the person who picked up the Supply.) + */ + public List getReceiverTarget() { + if (this.receiverTarget == null) + this.receiverTarget = new ArrayList(); + return this.receiverTarget; + } + + // syntactic sugar + /** + * @return {@link #receiver} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Identifies the person who picked up the Supply.) + */ + public Practitioner addReceiverTarget() { + Practitioner r = new Practitioner(); + if (this.receiverTarget == null) + this.receiverTarget = new ArrayList(); + this.receiverTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier assigned by the dispensing facility when the item(s) is dispensed.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "A code specifying the state of the dispense event.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("quantity", "Quantity", "The amount of supply that has been dispensed. Includes unit of measure.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("suppliedItem", "Reference(Medication|Substance|Device)", "Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.", 0, java.lang.Integer.MAX_VALUE, suppliedItem)); + childrenList.add(new Property("supplier", "Reference(Practitioner)", "The individual responsible for dispensing the medication, supplier or device.", 0, java.lang.Integer.MAX_VALUE, supplier)); + childrenList.add(new Property("whenPrepared", "Period", "The time the dispense event occurred.", 0, java.lang.Integer.MAX_VALUE, whenPrepared)); + childrenList.add(new Property("whenHandedOver", "dateTime", "The time the dispensed item was sent or handed to the patient (or agent).", 0, java.lang.Integer.MAX_VALUE, whenHandedOver)); + childrenList.add(new Property("destination", "Reference(Location)", "Identification of the facility/location where the Supply was shipped to, as part of the dispense event.", 0, java.lang.Integer.MAX_VALUE, destination)); + childrenList.add(new Property("receiver", "Reference(Practitioner)", "Identifies the person who picked up the Supply.", 0, java.lang.Integer.MAX_VALUE, receiver)); + } + + public SupplyDispenseComponent copy() { + SupplyDispenseComponent dst = new SupplyDispenseComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.status = status == null ? null : status.copy(); + dst.type = type == null ? null : type.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.suppliedItem = suppliedItem == null ? null : suppliedItem.copy(); + dst.supplier = supplier == null ? null : supplier.copy(); + dst.whenPrepared = whenPrepared == null ? null : whenPrepared.copy(); + dst.whenHandedOver = whenHandedOver == null ? null : whenHandedOver.copy(); + dst.destination = destination == null ? null : destination.copy(); + if (receiver != null) { + dst.receiver = new ArrayList(); + for (Reference i : receiver) + dst.receiver.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SupplyDispenseComponent)) + return false; + SupplyDispenseComponent o = (SupplyDispenseComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(type, o.type, true) + && compareDeep(quantity, o.quantity, true) && compareDeep(suppliedItem, o.suppliedItem, true) && compareDeep(supplier, o.supplier, true) + && compareDeep(whenPrepared, o.whenPrepared, true) && compareDeep(whenHandedOver, o.whenHandedOver, true) + && compareDeep(destination, o.destination, true) && compareDeep(receiver, o.receiver, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SupplyDispenseComponent)) + return false; + SupplyDispenseComponent o = (SupplyDispenseComponent) other; + return compareValues(status, o.status, true) && compareValues(whenHandedOver, o.whenHandedOver, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (type == null || type.isEmpty()) && (quantity == null || quantity.isEmpty()) && (suppliedItem == null || suppliedItem.isEmpty()) + && (supplier == null || supplier.isEmpty()) && (whenPrepared == null || whenPrepared.isEmpty()) + && (whenHandedOver == null || whenHandedOver.isEmpty()) && (destination == null || destination.isEmpty()) + && (receiver == null || receiver.isEmpty()); + } + + } + + /** + * Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process. + */ + @Child(name = "kind", type = {CodeableConcept.class}, order=0, min=0, max=1) + @Description(shortDefinition="The kind of supply (central, non-stock, etc)", formalDefinition="Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process." ) + protected CodeableConcept kind; + + /** + * Unique identifier for this supply request. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) + @Description(shortDefinition="Unique identifier", formalDefinition="Unique identifier for this supply request." ) + protected Identifier identifier; + + /** + * Status of the supply request. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="requested | dispensed | received | failed | cancelled", formalDefinition="Status of the supply request." ) + protected Enumeration status; + + /** + * The item that is requested to be supplied. + */ + @Child(name = "orderedItem", type = {Medication.class, Substance.class, Device.class}, order=3, min=0, max=1) + @Description(shortDefinition="Medication, Substance, or Device requested to be supplied", formalDefinition="The item that is requested to be supplied." ) + protected Reference orderedItem; + + /** + * The actual object that is the target of the reference (The item that is requested to be supplied.) + */ + protected Resource orderedItemTarget; + + /** + * A link to a resource representing the person whom the ordered item is for. + */ + @Child(name = "patient", type = {Patient.class}, order=4, min=0, max=1) + @Description(shortDefinition="Patient for whom the item is supplied", formalDefinition="A link to a resource representing the person whom the ordered item is for." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (A link to a resource representing the person whom the ordered item is for.) + */ + protected Patient patientTarget; + + /** + * Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed. + */ + @Child(name = "dispense", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Supply details", formalDefinition="Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed." ) + protected List dispense; + + private static final long serialVersionUID = 1122115505L; + + /* + * Constructor + */ + public Supply() { + super(); + } + + /** + * @return {@link #kind} (Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.) + */ + public CodeableConcept getKind() { + if (this.kind == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Supply.kind"); + else if (Configuration.doAutoCreate()) + this.kind = new CodeableConcept(); // cc + return this.kind; + } + + public boolean hasKind() { + return this.kind != null && !this.kind.isEmpty(); + } + + /** + * @param value {@link #kind} (Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.) + */ + public Supply setKind(CodeableConcept value) { + this.kind = value; + return this; + } + + /** + * @return {@link #identifier} (Unique identifier for this supply request.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Supply.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Unique identifier for this supply request.) + */ + public Supply setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #status} (Status of the supply request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Supply.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ValuesetSupplyStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (Status of the supply request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Supply setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Status of the supply request. + */ + public ValuesetSupplyStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Status of the supply request. + */ + public Supply setStatus(ValuesetSupplyStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new ValuesetSupplyStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #orderedItem} (The item that is requested to be supplied.) + */ + public Reference getOrderedItem() { + if (this.orderedItem == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Supply.orderedItem"); + else if (Configuration.doAutoCreate()) + this.orderedItem = new Reference(); // cc + return this.orderedItem; + } + + public boolean hasOrderedItem() { + return this.orderedItem != null && !this.orderedItem.isEmpty(); + } + + /** + * @param value {@link #orderedItem} (The item that is requested to be supplied.) + */ + public Supply setOrderedItem(Reference value) { + this.orderedItem = value; + return this; + } + + /** + * @return {@link #orderedItem} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The item that is requested to be supplied.) + */ + public Resource getOrderedItemTarget() { + return this.orderedItemTarget; + } + + /** + * @param value {@link #orderedItem} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The item that is requested to be supplied.) + */ + public Supply setOrderedItemTarget(Resource value) { + this.orderedItemTarget = value; + return this; + } + + /** + * @return {@link #patient} (A link to a resource representing the person whom the ordered item is for.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Supply.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (A link to a resource representing the person whom the ordered item is for.) + */ + public Supply setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person whom the ordered item is for.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Supply.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person whom the ordered item is for.) + */ + public Supply setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #dispense} (Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed.) + */ + public List getDispense() { + if (this.dispense == null) + this.dispense = new ArrayList(); + return this.dispense; + } + + public boolean hasDispense() { + if (this.dispense == null) + return false; + for (SupplyDispenseComponent item : this.dispense) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dispense} (Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed.) + */ + // syntactic sugar + public SupplyDispenseComponent addDispense() { //3 + SupplyDispenseComponent t = new SupplyDispenseComponent(); + if (this.dispense == null) + this.dispense = new ArrayList(); + this.dispense.add(t); + return t; + } + + // syntactic sugar + public Supply addDispense(SupplyDispenseComponent t) { //3 + if (t == null) + return this; + if (this.dispense == null) + this.dispense = new ArrayList(); + this.dispense.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("kind", "CodeableConcept", "Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.", 0, java.lang.Integer.MAX_VALUE, kind)); + childrenList.add(new Property("identifier", "Identifier", "Unique identifier for this supply request.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "Status of the supply request.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("orderedItem", "Reference(Medication|Substance|Device)", "The item that is requested to be supplied.", 0, java.lang.Integer.MAX_VALUE, orderedItem)); + childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person whom the ordered item is for.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("dispense", "", "Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed.", 0, java.lang.Integer.MAX_VALUE, dispense)); + } + + public Supply copy() { + Supply dst = new Supply(); + copyValues(dst); + dst.kind = kind == null ? null : kind.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.status = status == null ? null : status.copy(); + dst.orderedItem = orderedItem == null ? null : orderedItem.copy(); + dst.patient = patient == null ? null : patient.copy(); + if (dispense != null) { + dst.dispense = new ArrayList(); + for (SupplyDispenseComponent i : dispense) + dst.dispense.add(i.copy()); + }; + return dst; + } + + protected Supply typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Supply)) + return false; + Supply o = (Supply) other; + return compareDeep(kind, o.kind, true) && compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) + && compareDeep(orderedItem, o.orderedItem, true) && compareDeep(patient, o.patient, true) && compareDeep(dispense, o.dispense, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Supply)) + return false; + Supply o = (Supply) other; + return compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (kind == null || kind.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (status == null || status.isEmpty()) && (orderedItem == null || orderedItem.isEmpty()) + && (patient == null || patient.isEmpty()) && (dispense == null || dispense.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Supply; + } + + @SearchParamDefinition(name="identifier", path="Supply.identifier", description="Unique identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="kind", path="Supply.kind", description="The kind of supply (central, non-stock, etc)", type="token" ) + public static final String SP_KIND = "kind"; + @SearchParamDefinition(name="patient", path="Supply.patient", description="Patient for whom the item is supplied", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="supplier", path="Supply.dispense.supplier", description="Dispenser", type="reference" ) + public static final String SP_SUPPLIER = "supplier"; + @SearchParamDefinition(name="dispenseid", path="Supply.dispense.identifier", description="External identifier", type="token" ) + public static final String SP_DISPENSEID = "dispenseid"; + @SearchParamDefinition(name="dispensestatus", path="Supply.dispense.status", description="in-progress | dispensed | abandoned", type="token" ) + public static final String SP_DISPENSESTATUS = "dispensestatus"; + @SearchParamDefinition(name="status", path="Supply.status", description="requested | dispensed | received | failed | cancelled", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/SupplyDelivery.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/SupplyDelivery.java index ce22f2058f2..bdec6ea86b0 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/SupplyDelivery.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/SupplyDelivery.java @@ -1,781 +1,760 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Record of delivery of what is supply. - */ -@ResourceDef(name="SupplyDelivery", profile="http://hl7.org/fhir/Profile/SupplyDelivery") -public class SupplyDelivery extends DomainResource { - - public enum ValuesetSupplydeliveryStatus { - /** - * Supply has been requested, but not delivered. - */ - INPROGRESS, - /** - * Supply has been delivered. ( "completed"). - */ - COMPLETED, - /** - * Dispensing was not completed. - */ - ABANDONED, - /** - * added to help the parsers - */ - NULL; - public static ValuesetSupplydeliveryStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("completed".equals(codeString)) - return COMPLETED; - if ("abandoned".equals(codeString)) - return ABANDONED; - throw new Exception("Unknown ValuesetSupplydeliveryStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INPROGRESS: return "in-progress"; - case COMPLETED: return "completed"; - case ABANDONED: return "abandoned"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPROGRESS: return ""; - case COMPLETED: return ""; - case ABANDONED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPROGRESS: return "Supply has been requested, but not delivered."; - case COMPLETED: return "Supply has been delivered. ( 'completed')."; - case ABANDONED: return "Dispensing was not completed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPROGRESS: return "In Progress"; - case COMPLETED: return "Delivered"; - case ABANDONED: return "Abandoned"; - default: return "?"; - } - } - } - - public static class ValuesetSupplydeliveryStatusEnumFactory implements EnumFactory { - public ValuesetSupplydeliveryStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return ValuesetSupplydeliveryStatus.INPROGRESS; - if ("completed".equals(codeString)) - return ValuesetSupplydeliveryStatus.COMPLETED; - if ("abandoned".equals(codeString)) - return ValuesetSupplydeliveryStatus.ABANDONED; - throw new IllegalArgumentException("Unknown ValuesetSupplydeliveryStatus code '"+codeString+"'"); - } - public String toCode(ValuesetSupplydeliveryStatus code) { - if (code == ValuesetSupplydeliveryStatus.INPROGRESS) - return "in-progress"; - if (code == ValuesetSupplydeliveryStatus.COMPLETED) - return "completed"; - if (code == ValuesetSupplydeliveryStatus.ABANDONED) - return "abandoned"; - return "?"; - } - } - - /** - * Identifier assigned by the dispensing facility when the item(s) is dispensed. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1) - @Description(shortDefinition="External identifier", formalDefinition="Identifier assigned by the dispensing facility when the item(s) is dispensed." ) - protected Identifier identifier; - - /** - * A code specifying the state of the dispense event. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="in-progress | completed | abandoned", formalDefinition="A code specifying the state of the dispense event." ) - protected Enumeration status; - - /** - * A link to a resource representing the person whom the delivered item is for. - */ - @Child(name = "patient", type = {Patient.class}, order=2, min=0, max=1) - @Description(shortDefinition="Patient for whom the item is supplied", formalDefinition="A link to a resource representing the person whom the delivered item is for." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (A link to a resource representing the person whom the delivered item is for.) - */ - protected Patient patientTarget; - - /** - * Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Category of dispense event", formalDefinition="Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc." ) - protected CodeableConcept type; - - /** - * The amount of supply that has been dispensed. Includes unit of measure. - */ - @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1) - @Description(shortDefinition="Amount dispensed", formalDefinition="The amount of supply that has been dispensed. Includes unit of measure." ) - protected Quantity quantity; - - /** - * Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list. - */ - @Child(name = "suppliedItem", type = {Medication.class, Substance.class, Device.class}, order=5, min=0, max=1) - @Description(shortDefinition="Medication, Substance, or Device supplied", formalDefinition="Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list." ) - protected Reference suppliedItem; - - /** - * The actual object that is the target of the reference (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) - */ - protected Resource suppliedItemTarget; - - /** - * The individual responsible for dispensing the medication, supplier or device. - */ - @Child(name = "supplier", type = {Practitioner.class}, order=6, min=0, max=1) - @Description(shortDefinition="Dispenser", formalDefinition="The individual responsible for dispensing the medication, supplier or device." ) - protected Reference supplier; - - /** - * The actual object that is the target of the reference (The individual responsible for dispensing the medication, supplier or device.) - */ - protected Practitioner supplierTarget; - - /** - * The time the dispense event occurred. - */ - @Child(name = "whenPrepared", type = {Period.class}, order=7, min=0, max=1) - @Description(shortDefinition="Dispensing time", formalDefinition="The time the dispense event occurred." ) - protected Period whenPrepared; - - /** - * The time the dispensed item was sent or handed to the patient (or agent). - */ - @Child(name = "time", type = {DateTimeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Handover time", formalDefinition="The time the dispensed item was sent or handed to the patient (or agent)." ) - protected DateTimeType time; - - /** - * Identification of the facility/location where the Supply was shipped to, as part of the dispense event. - */ - @Child(name = "destination", type = {Location.class}, order=9, min=0, max=1) - @Description(shortDefinition="Where the Supply was sent", formalDefinition="Identification of the facility/location where the Supply was shipped to, as part of the dispense event." ) - protected Reference destination; - - /** - * The actual object that is the target of the reference (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) - */ - protected Location destinationTarget; - - /** - * Identifies the person who picked up the Supply. - */ - @Child(name = "receiver", type = {Practitioner.class}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who collected the Supply", formalDefinition="Identifies the person who picked up the Supply." ) - protected List receiver; - /** - * The actual objects that are the target of the reference (Identifies the person who picked up the Supply.) - */ - protected List receiverTarget; - - - private static final long serialVersionUID = 1949206420L; - - /* - * Constructor - */ - public SupplyDelivery() { - super(); - } - - /** - * @return {@link #identifier} (Identifier assigned by the dispensing facility when the item(s) is dispensed.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifier assigned by the dispensing facility when the item(s) is dispensed.) - */ - public SupplyDelivery setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #status} (A code specifying the state of the dispense event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ValuesetSupplydeliveryStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (A code specifying the state of the dispense event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public SupplyDelivery setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return A code specifying the state of the dispense event. - */ - public ValuesetSupplydeliveryStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value A code specifying the state of the dispense event. - */ - public SupplyDelivery setStatus(ValuesetSupplydeliveryStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new ValuesetSupplydeliveryStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #patient} (A link to a resource representing the person whom the delivered item is for.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (A link to a resource representing the person whom the delivered item is for.) - */ - public SupplyDelivery setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person whom the delivered item is for.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person whom the delivered item is for.) - */ - public SupplyDelivery setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) - */ - public SupplyDelivery setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #quantity} (The amount of supply that has been dispensed. Includes unit of measure.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of supply that has been dispensed. Includes unit of measure.) - */ - public SupplyDelivery setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #suppliedItem} (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) - */ - public Reference getSuppliedItem() { - if (this.suppliedItem == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.suppliedItem"); - else if (Configuration.doAutoCreate()) - this.suppliedItem = new Reference(); // cc - return this.suppliedItem; - } - - public boolean hasSuppliedItem() { - return this.suppliedItem != null && !this.suppliedItem.isEmpty(); - } - - /** - * @param value {@link #suppliedItem} (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) - */ - public SupplyDelivery setSuppliedItem(Reference value) { - this.suppliedItem = value; - return this; - } - - /** - * @return {@link #suppliedItem} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) - */ - public Resource getSuppliedItemTarget() { - return this.suppliedItemTarget; - } - - /** - * @param value {@link #suppliedItem} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) - */ - public SupplyDelivery setSuppliedItemTarget(Resource value) { - this.suppliedItemTarget = value; - return this; - } - - /** - * @return {@link #supplier} (The individual responsible for dispensing the medication, supplier or device.) - */ - public Reference getSupplier() { - if (this.supplier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.supplier"); - else if (Configuration.doAutoCreate()) - this.supplier = new Reference(); // cc - return this.supplier; - } - - public boolean hasSupplier() { - return this.supplier != null && !this.supplier.isEmpty(); - } - - /** - * @param value {@link #supplier} (The individual responsible for dispensing the medication, supplier or device.) - */ - public SupplyDelivery setSupplier(Reference value) { - this.supplier = value; - return this; - } - - /** - * @return {@link #supplier} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The individual responsible for dispensing the medication, supplier or device.) - */ - public Practitioner getSupplierTarget() { - if (this.supplierTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.supplier"); - else if (Configuration.doAutoCreate()) - this.supplierTarget = new Practitioner(); // aa - return this.supplierTarget; - } - - /** - * @param value {@link #supplier} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The individual responsible for dispensing the medication, supplier or device.) - */ - public SupplyDelivery setSupplierTarget(Practitioner value) { - this.supplierTarget = value; - return this; - } - - /** - * @return {@link #whenPrepared} (The time the dispense event occurred.) - */ - public Period getWhenPrepared() { - if (this.whenPrepared == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.whenPrepared"); - else if (Configuration.doAutoCreate()) - this.whenPrepared = new Period(); // cc - return this.whenPrepared; - } - - public boolean hasWhenPrepared() { - return this.whenPrepared != null && !this.whenPrepared.isEmpty(); - } - - /** - * @param value {@link #whenPrepared} (The time the dispense event occurred.) - */ - public SupplyDelivery setWhenPrepared(Period value) { - this.whenPrepared = value; - return this; - } - - /** - * @return {@link #time} (The time the dispensed item was sent or handed to the patient (or agent).). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value - */ - public DateTimeType getTimeElement() { - if (this.time == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.time"); - else if (Configuration.doAutoCreate()) - this.time = new DateTimeType(); // bb - return this.time; - } - - public boolean hasTimeElement() { - return this.time != null && !this.time.isEmpty(); - } - - public boolean hasTime() { - return this.time != null && !this.time.isEmpty(); - } - - /** - * @param value {@link #time} (The time the dispensed item was sent or handed to the patient (or agent).). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value - */ - public SupplyDelivery setTimeElement(DateTimeType value) { - this.time = value; - return this; - } - - /** - * @return The time the dispensed item was sent or handed to the patient (or agent). - */ - public Date getTime() { - return this.time == null ? null : this.time.getValue(); - } - - /** - * @param value The time the dispensed item was sent or handed to the patient (or agent). - */ - public SupplyDelivery setTime(Date value) { - if (value == null) - this.time = null; - else { - if (this.time == null) - this.time = new DateTimeType(); - this.time.setValue(value); - } - return this; - } - - /** - * @return {@link #destination} (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) - */ - public Reference getDestination() { - if (this.destination == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.destination"); - else if (Configuration.doAutoCreate()) - this.destination = new Reference(); // cc - return this.destination; - } - - public boolean hasDestination() { - return this.destination != null && !this.destination.isEmpty(); - } - - /** - * @param value {@link #destination} (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) - */ - public SupplyDelivery setDestination(Reference value) { - this.destination = value; - return this; - } - - /** - * @return {@link #destination} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) - */ - public Location getDestinationTarget() { - if (this.destinationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.destination"); - else if (Configuration.doAutoCreate()) - this.destinationTarget = new Location(); // aa - return this.destinationTarget; - } - - /** - * @param value {@link #destination} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) - */ - public SupplyDelivery setDestinationTarget(Location value) { - this.destinationTarget = value; - return this; - } - - /** - * @return {@link #receiver} (Identifies the person who picked up the Supply.) - */ - public List getReceiver() { - if (this.receiver == null) - this.receiver = new ArrayList(); - return this.receiver; - } - - public boolean hasReceiver() { - if (this.receiver == null) - return false; - for (Reference item : this.receiver) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #receiver} (Identifies the person who picked up the Supply.) - */ - // syntactic sugar - public Reference addReceiver() { //3 - Reference t = new Reference(); - if (this.receiver == null) - this.receiver = new ArrayList(); - this.receiver.add(t); - return t; - } - - // syntactic sugar - public SupplyDelivery addReceiver(Reference t) { //3 - if (t == null) - return this; - if (this.receiver == null) - this.receiver = new ArrayList(); - this.receiver.add(t); - return this; - } - - /** - * @return {@link #receiver} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies the person who picked up the Supply.) - */ - public List getReceiverTarget() { - if (this.receiverTarget == null) - this.receiverTarget = new ArrayList(); - return this.receiverTarget; - } - - // syntactic sugar - /** - * @return {@link #receiver} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Identifies the person who picked up the Supply.) - */ - public Practitioner addReceiverTarget() { - Practitioner r = new Practitioner(); - if (this.receiverTarget == null) - this.receiverTarget = new ArrayList(); - this.receiverTarget.add(r); - return r; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier assigned by the dispensing facility when the item(s) is dispensed.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "A code specifying the state of the dispense event.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person whom the delivered item is for.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("quantity", "Quantity", "The amount of supply that has been dispensed. Includes unit of measure.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("suppliedItem", "Reference(Medication|Substance|Device)", "Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.", 0, java.lang.Integer.MAX_VALUE, suppliedItem)); - childrenList.add(new Property("supplier", "Reference(Practitioner)", "The individual responsible for dispensing the medication, supplier or device.", 0, java.lang.Integer.MAX_VALUE, supplier)); - childrenList.add(new Property("whenPrepared", "Period", "The time the dispense event occurred.", 0, java.lang.Integer.MAX_VALUE, whenPrepared)); - childrenList.add(new Property("time", "dateTime", "The time the dispensed item was sent or handed to the patient (or agent).", 0, java.lang.Integer.MAX_VALUE, time)); - childrenList.add(new Property("destination", "Reference(Location)", "Identification of the facility/location where the Supply was shipped to, as part of the dispense event.", 0, java.lang.Integer.MAX_VALUE, destination)); - childrenList.add(new Property("receiver", "Reference(Practitioner)", "Identifies the person who picked up the Supply.", 0, java.lang.Integer.MAX_VALUE, receiver)); - } - - public SupplyDelivery copy() { - SupplyDelivery dst = new SupplyDelivery(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.status = status == null ? null : status.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.type = type == null ? null : type.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.suppliedItem = suppliedItem == null ? null : suppliedItem.copy(); - dst.supplier = supplier == null ? null : supplier.copy(); - dst.whenPrepared = whenPrepared == null ? null : whenPrepared.copy(); - dst.time = time == null ? null : time.copy(); - dst.destination = destination == null ? null : destination.copy(); - if (receiver != null) { - dst.receiver = new ArrayList(); - for (Reference i : receiver) - dst.receiver.add(i.copy()); - }; - return dst; - } - - protected SupplyDelivery typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SupplyDelivery)) - return false; - SupplyDelivery o = (SupplyDelivery) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(patient, o.patient, true) - && compareDeep(type, o.type, true) && compareDeep(quantity, o.quantity, true) && compareDeep(suppliedItem, o.suppliedItem, true) - && compareDeep(supplier, o.supplier, true) && compareDeep(whenPrepared, o.whenPrepared, true) && compareDeep(time, o.time, true) - && compareDeep(destination, o.destination, true) && compareDeep(receiver, o.receiver, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SupplyDelivery)) - return false; - SupplyDelivery o = (SupplyDelivery) other; - return compareValues(status, o.status, true) && compareValues(time, o.time, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (patient == null || patient.isEmpty()) && (type == null || type.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (suppliedItem == null || suppliedItem.isEmpty()) && (supplier == null || supplier.isEmpty()) - && (whenPrepared == null || whenPrepared.isEmpty()) && (time == null || time.isEmpty()) && (destination == null || destination.isEmpty()) - && (receiver == null || receiver.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.SupplyDelivery; - } - - @SearchParamDefinition(name="patient", path="SupplyDelivery.patient", description="Patient for whom the item is supplied", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="receiver", path="SupplyDelivery.receiver", description="Who collected the Supply", type="reference" ) - public static final String SP_RECEIVER = "receiver"; - @SearchParamDefinition(name="status", path="SupplyDelivery.status", description="in-progress | completed | abandoned", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="identifier", path="SupplyDelivery.identifier", description="External identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="supplier", path="SupplyDelivery.supplier", description="Dispenser", type="reference" ) - public static final String SP_SUPPLIER = "supplier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Record of delivery of what is supply. + */ +@ResourceDef(name="SupplyDelivery", profile="http://hl7.org/fhir/Profile/SupplyDelivery") +public class SupplyDelivery extends DomainResource { + + public enum ValuesetSupplydeliveryStatus { + /** + * Supply has been requested, but not delivered. + */ + INPROGRESS, + /** + * Supply has been delivered. ( "completed"). + */ + COMPLETED, + /** + * Dispensing was not completed. + */ + ABANDONED, + /** + * added to help the parsers + */ + NULL; + public static ValuesetSupplydeliveryStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("completed".equals(codeString)) + return COMPLETED; + if ("abandoned".equals(codeString)) + return ABANDONED; + throw new Exception("Unknown ValuesetSupplydeliveryStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INPROGRESS: return "in-progress"; + case COMPLETED: return "completed"; + case ABANDONED: return "abandoned"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return ""; + case COMPLETED: return ""; + case ABANDONED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "Supply has been requested, but not delivered."; + case COMPLETED: return "Supply has been delivered. ( 'completed')."; + case ABANDONED: return "Dispensing was not completed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "In Progress"; + case COMPLETED: return "Delivered"; + case ABANDONED: return "Abandoned"; + default: return "?"; + } + } + } + + public static class ValuesetSupplydeliveryStatusEnumFactory implements EnumFactory { + public ValuesetSupplydeliveryStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return ValuesetSupplydeliveryStatus.INPROGRESS; + if ("completed".equals(codeString)) + return ValuesetSupplydeliveryStatus.COMPLETED; + if ("abandoned".equals(codeString)) + return ValuesetSupplydeliveryStatus.ABANDONED; + throw new IllegalArgumentException("Unknown ValuesetSupplydeliveryStatus code '"+codeString+"'"); + } + public String toCode(ValuesetSupplydeliveryStatus code) { + if (code == ValuesetSupplydeliveryStatus.INPROGRESS) + return "in-progress"; + if (code == ValuesetSupplydeliveryStatus.COMPLETED) + return "completed"; + if (code == ValuesetSupplydeliveryStatus.ABANDONED) + return "abandoned"; + return "?"; + } + } + + /** + * Identifier assigned by the dispensing facility when the item(s) is dispensed. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1) + @Description(shortDefinition="External identifier", formalDefinition="Identifier assigned by the dispensing facility when the item(s) is dispensed." ) + protected Identifier identifier; + + /** + * A code specifying the state of the dispense event. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="in-progress | completed | abandoned", formalDefinition="A code specifying the state of the dispense event." ) + protected Enumeration status; + + /** + * A link to a resource representing the person whom the delivered item is for. + */ + @Child(name = "patient", type = {Patient.class}, order=2, min=0, max=1) + @Description(shortDefinition="Patient for whom the item is supplied", formalDefinition="A link to a resource representing the person whom the delivered item is for." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (A link to a resource representing the person whom the delivered item is for.) + */ + protected Patient patientTarget; + + /** + * Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Category of dispense event", formalDefinition="Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc." ) + protected CodeableConcept type; + + /** + * The amount of supply that has been dispensed. Includes unit of measure. + */ + @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Amount dispensed", formalDefinition="The amount of supply that has been dispensed. Includes unit of measure." ) + protected Quantity quantity; + + /** + * Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list. + */ + @Child(name = "suppliedItem", type = {Medication.class, Substance.class, Device.class}, order=5, min=0, max=1) + @Description(shortDefinition="Medication, Substance, or Device supplied", formalDefinition="Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list." ) + protected Reference suppliedItem; + + /** + * The actual object that is the target of the reference (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) + */ + protected Resource suppliedItemTarget; + + /** + * The individual responsible for dispensing the medication, supplier or device. + */ + @Child(name = "supplier", type = {Practitioner.class}, order=6, min=0, max=1) + @Description(shortDefinition="Dispenser", formalDefinition="The individual responsible for dispensing the medication, supplier or device." ) + protected Reference supplier; + + /** + * The actual object that is the target of the reference (The individual responsible for dispensing the medication, supplier or device.) + */ + protected Practitioner supplierTarget; + + /** + * The time the dispense event occurred. + */ + @Child(name = "whenPrepared", type = {Period.class}, order=7, min=0, max=1) + @Description(shortDefinition="Dispensing time", formalDefinition="The time the dispense event occurred." ) + protected Period whenPrepared; + + /** + * The time the dispensed item was sent or handed to the patient (or agent). + */ + @Child(name = "time", type = {DateTimeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Handover time", formalDefinition="The time the dispensed item was sent or handed to the patient (or agent)." ) + protected DateTimeType time; + + /** + * Identification of the facility/location where the Supply was shipped to, as part of the dispense event. + */ + @Child(name = "destination", type = {Location.class}, order=9, min=0, max=1) + @Description(shortDefinition="Where the Supply was sent", formalDefinition="Identification of the facility/location where the Supply was shipped to, as part of the dispense event." ) + protected Reference destination; + + /** + * The actual object that is the target of the reference (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) + */ + protected Location destinationTarget; + + /** + * Identifies the person who picked up the Supply. + */ + @Child(name = "receiver", type = {Practitioner.class}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who collected the Supply", formalDefinition="Identifies the person who picked up the Supply." ) + protected List receiver; + /** + * The actual objects that are the target of the reference (Identifies the person who picked up the Supply.) + */ + protected List receiverTarget; + + + private static final long serialVersionUID = 1949206420L; + + /* + * Constructor + */ + public SupplyDelivery() { + super(); + } + + /** + * @return {@link #identifier} (Identifier assigned by the dispensing facility when the item(s) is dispensed.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifier assigned by the dispensing facility when the item(s) is dispensed.) + */ + public SupplyDelivery setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #status} (A code specifying the state of the dispense event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ValuesetSupplydeliveryStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (A code specifying the state of the dispense event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public SupplyDelivery setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return A code specifying the state of the dispense event. + */ + public ValuesetSupplydeliveryStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value A code specifying the state of the dispense event. + */ + public SupplyDelivery setStatus(ValuesetSupplydeliveryStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new ValuesetSupplydeliveryStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #patient} (A link to a resource representing the person whom the delivered item is for.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (A link to a resource representing the person whom the delivered item is for.) + */ + public SupplyDelivery setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person whom the delivered item is for.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person whom the delivered item is for.) + */ + public SupplyDelivery setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) + */ + public SupplyDelivery setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #quantity} (The amount of supply that has been dispensed. Includes unit of measure.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of supply that has been dispensed. Includes unit of measure.) + */ + public SupplyDelivery setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #suppliedItem} (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) + */ + public Reference getSuppliedItem() { + if (this.suppliedItem == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.suppliedItem"); + else if (Configuration.doAutoCreate()) + this.suppliedItem = new Reference(); // cc + return this.suppliedItem; + } + + public boolean hasSuppliedItem() { + return this.suppliedItem != null && !this.suppliedItem.isEmpty(); + } + + /** + * @param value {@link #suppliedItem} (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) + */ + public SupplyDelivery setSuppliedItem(Reference value) { + this.suppliedItem = value; + return this; + } + + /** + * @return {@link #suppliedItem} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) + */ + public Resource getSuppliedItemTarget() { + return this.suppliedItemTarget; + } + + /** + * @param value {@link #suppliedItem} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) + */ + public SupplyDelivery setSuppliedItemTarget(Resource value) { + this.suppliedItemTarget = value; + return this; + } + + /** + * @return {@link #supplier} (The individual responsible for dispensing the medication, supplier or device.) + */ + public Reference getSupplier() { + if (this.supplier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.supplier"); + else if (Configuration.doAutoCreate()) + this.supplier = new Reference(); // cc + return this.supplier; + } + + public boolean hasSupplier() { + return this.supplier != null && !this.supplier.isEmpty(); + } + + /** + * @param value {@link #supplier} (The individual responsible for dispensing the medication, supplier or device.) + */ + public SupplyDelivery setSupplier(Reference value) { + this.supplier = value; + return this; + } + + /** + * @return {@link #supplier} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The individual responsible for dispensing the medication, supplier or device.) + */ + public Practitioner getSupplierTarget() { + if (this.supplierTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.supplier"); + else if (Configuration.doAutoCreate()) + this.supplierTarget = new Practitioner(); // aa + return this.supplierTarget; + } + + /** + * @param value {@link #supplier} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The individual responsible for dispensing the medication, supplier or device.) + */ + public SupplyDelivery setSupplierTarget(Practitioner value) { + this.supplierTarget = value; + return this; + } + + /** + * @return {@link #whenPrepared} (The time the dispense event occurred.) + */ + public Period getWhenPrepared() { + if (this.whenPrepared == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.whenPrepared"); + else if (Configuration.doAutoCreate()) + this.whenPrepared = new Period(); // cc + return this.whenPrepared; + } + + public boolean hasWhenPrepared() { + return this.whenPrepared != null && !this.whenPrepared.isEmpty(); + } + + /** + * @param value {@link #whenPrepared} (The time the dispense event occurred.) + */ + public SupplyDelivery setWhenPrepared(Period value) { + this.whenPrepared = value; + return this; + } + + /** + * @return {@link #time} (The time the dispensed item was sent or handed to the patient (or agent).). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value + */ + public DateTimeType getTimeElement() { + if (this.time == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.time"); + else if (Configuration.doAutoCreate()) + this.time = new DateTimeType(); // bb + return this.time; + } + + public boolean hasTimeElement() { + return this.time != null && !this.time.isEmpty(); + } + + public boolean hasTime() { + return this.time != null && !this.time.isEmpty(); + } + + /** + * @param value {@link #time} (The time the dispensed item was sent or handed to the patient (or agent).). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value + */ + public SupplyDelivery setTimeElement(DateTimeType value) { + this.time = value; + return this; + } + + /** + * @return The time the dispensed item was sent or handed to the patient (or agent). + */ + public Date getTime() { + return this.time == null ? null : this.time.getValue(); + } + + /** + * @param value The time the dispensed item was sent or handed to the patient (or agent). + */ + public SupplyDelivery setTime(Date value) { + if (value == null) + this.time = null; + else { + if (this.time == null) + this.time = new DateTimeType(); + this.time.setValue(value); + } + return this; + } + + /** + * @return {@link #destination} (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) + */ + public Reference getDestination() { + if (this.destination == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.destination"); + else if (Configuration.doAutoCreate()) + this.destination = new Reference(); // cc + return this.destination; + } + + public boolean hasDestination() { + return this.destination != null && !this.destination.isEmpty(); + } + + /** + * @param value {@link #destination} (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) + */ + public SupplyDelivery setDestination(Reference value) { + this.destination = value; + return this; + } + + /** + * @return {@link #destination} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) + */ + public Location getDestinationTarget() { + if (this.destinationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.destination"); + else if (Configuration.doAutoCreate()) + this.destinationTarget = new Location(); // aa + return this.destinationTarget; + } + + /** + * @param value {@link #destination} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) + */ + public SupplyDelivery setDestinationTarget(Location value) { + this.destinationTarget = value; + return this; + } + + /** + * @return {@link #receiver} (Identifies the person who picked up the Supply.) + */ + public List getReceiver() { + if (this.receiver == null) + this.receiver = new ArrayList(); + return this.receiver; + } + + public boolean hasReceiver() { + if (this.receiver == null) + return false; + for (Reference item : this.receiver) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #receiver} (Identifies the person who picked up the Supply.) + */ + // syntactic sugar + public Reference addReceiver() { //3 + Reference t = new Reference(); + if (this.receiver == null) + this.receiver = new ArrayList(); + this.receiver.add(t); + return t; + } + + // syntactic sugar + public SupplyDelivery addReceiver(Reference t) { //3 + if (t == null) + return this; + if (this.receiver == null) + this.receiver = new ArrayList(); + this.receiver.add(t); + return this; + } + + /** + * @return {@link #receiver} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies the person who picked up the Supply.) + */ + public List getReceiverTarget() { + if (this.receiverTarget == null) + this.receiverTarget = new ArrayList(); + return this.receiverTarget; + } + + // syntactic sugar + /** + * @return {@link #receiver} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Identifies the person who picked up the Supply.) + */ + public Practitioner addReceiverTarget() { + Practitioner r = new Practitioner(); + if (this.receiverTarget == null) + this.receiverTarget = new ArrayList(); + this.receiverTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier assigned by the dispensing facility when the item(s) is dispensed.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "A code specifying the state of the dispense event.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person whom the delivered item is for.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("quantity", "Quantity", "The amount of supply that has been dispensed. Includes unit of measure.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("suppliedItem", "Reference(Medication|Substance|Device)", "Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.", 0, java.lang.Integer.MAX_VALUE, suppliedItem)); + childrenList.add(new Property("supplier", "Reference(Practitioner)", "The individual responsible for dispensing the medication, supplier or device.", 0, java.lang.Integer.MAX_VALUE, supplier)); + childrenList.add(new Property("whenPrepared", "Period", "The time the dispense event occurred.", 0, java.lang.Integer.MAX_VALUE, whenPrepared)); + childrenList.add(new Property("time", "dateTime", "The time the dispensed item was sent or handed to the patient (or agent).", 0, java.lang.Integer.MAX_VALUE, time)); + childrenList.add(new Property("destination", "Reference(Location)", "Identification of the facility/location where the Supply was shipped to, as part of the dispense event.", 0, java.lang.Integer.MAX_VALUE, destination)); + childrenList.add(new Property("receiver", "Reference(Practitioner)", "Identifies the person who picked up the Supply.", 0, java.lang.Integer.MAX_VALUE, receiver)); + } + + public SupplyDelivery copy() { + SupplyDelivery dst = new SupplyDelivery(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.status = status == null ? null : status.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.type = type == null ? null : type.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.suppliedItem = suppliedItem == null ? null : suppliedItem.copy(); + dst.supplier = supplier == null ? null : supplier.copy(); + dst.whenPrepared = whenPrepared == null ? null : whenPrepared.copy(); + dst.time = time == null ? null : time.copy(); + dst.destination = destination == null ? null : destination.copy(); + if (receiver != null) { + dst.receiver = new ArrayList(); + for (Reference i : receiver) + dst.receiver.add(i.copy()); + }; + return dst; + } + + protected SupplyDelivery typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SupplyDelivery)) + return false; + SupplyDelivery o = (SupplyDelivery) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(patient, o.patient, true) + && compareDeep(type, o.type, true) && compareDeep(quantity, o.quantity, true) && compareDeep(suppliedItem, o.suppliedItem, true) + && compareDeep(supplier, o.supplier, true) && compareDeep(whenPrepared, o.whenPrepared, true) && compareDeep(time, o.time, true) + && compareDeep(destination, o.destination, true) && compareDeep(receiver, o.receiver, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SupplyDelivery)) + return false; + SupplyDelivery o = (SupplyDelivery) other; + return compareValues(status, o.status, true) && compareValues(time, o.time, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (patient == null || patient.isEmpty()) && (type == null || type.isEmpty()) && (quantity == null || quantity.isEmpty()) + && (suppliedItem == null || suppliedItem.isEmpty()) && (supplier == null || supplier.isEmpty()) + && (whenPrepared == null || whenPrepared.isEmpty()) && (time == null || time.isEmpty()) && (destination == null || destination.isEmpty()) + && (receiver == null || receiver.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.SupplyDelivery; + } + + @SearchParamDefinition(name="identifier", path="SupplyDelivery.identifier", description="External identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="receiver", path="SupplyDelivery.receiver", description="Who collected the Supply", type="reference" ) + public static final String SP_RECEIVER = "receiver"; + @SearchParamDefinition(name="patient", path="SupplyDelivery.patient", description="Patient for whom the item is supplied", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="supplier", path="SupplyDelivery.supplier", description="Dispenser", type="reference" ) + public static final String SP_SUPPLIER = "supplier"; + @SearchParamDefinition(name="status", path="SupplyDelivery.status", description="in-progress | completed | abandoned", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/SupplyRequest.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/SupplyRequest.java index 3c49248bf8e..4a617cefd1e 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/SupplyRequest.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/SupplyRequest.java @@ -1,470 +1,449 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A supply - a request for something. - */ -@ResourceDef(name="SupplyRequest", profile="http://hl7.org/fhir/Profile/SupplyRequest") -public class SupplyRequest extends DomainResource { - - public enum ValuesetSupplyrequestStatus { - /** - * Supply has been requested, but not dispensed. - */ - REQUESTED, - /** - * Supply has been received by the requestor. - */ - COMPLETED, - /** - * The supply will not be completed because the supplier was unable or unwilling to supply the item. - */ - FAILED, - /** - * The orderer of the supply cancelled the request. - */ - CANCELLED, - /** - * added to help the parsers - */ - NULL; - public static ValuesetSupplyrequestStatus fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return REQUESTED; - if ("completed".equals(codeString)) - return COMPLETED; - if ("failed".equals(codeString)) - return FAILED; - if ("cancelled".equals(codeString)) - return CANCELLED; - throw new Exception("Unknown ValuesetSupplyrequestStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case REQUESTED: return "requested"; - case COMPLETED: return "completed"; - case FAILED: return "failed"; - case CANCELLED: return "cancelled"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REQUESTED: return ""; - case COMPLETED: return ""; - case FAILED: return ""; - case CANCELLED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REQUESTED: return "Supply has been requested, but not dispensed."; - case COMPLETED: return "Supply has been received by the requestor."; - case FAILED: return "The supply will not be completed because the supplier was unable or unwilling to supply the item."; - case CANCELLED: return "The orderer of the supply cancelled the request."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REQUESTED: return "Requested"; - case COMPLETED: return "Received"; - case FAILED: return "Failed"; - case CANCELLED: return "Cancelled"; - default: return "?"; - } - } - } - - public static class ValuesetSupplyrequestStatusEnumFactory implements EnumFactory { - public ValuesetSupplyrequestStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return ValuesetSupplyrequestStatus.REQUESTED; - if ("completed".equals(codeString)) - return ValuesetSupplyrequestStatus.COMPLETED; - if ("failed".equals(codeString)) - return ValuesetSupplyrequestStatus.FAILED; - if ("cancelled".equals(codeString)) - return ValuesetSupplyrequestStatus.CANCELLED; - throw new IllegalArgumentException("Unknown ValuesetSupplyrequestStatus code '"+codeString+"'"); - } - public String toCode(ValuesetSupplyrequestStatus code) { - if (code == ValuesetSupplyrequestStatus.REQUESTED) - return "requested"; - if (code == ValuesetSupplyrequestStatus.COMPLETED) - return "completed"; - if (code == ValuesetSupplyrequestStatus.FAILED) - return "failed"; - if (code == ValuesetSupplyrequestStatus.CANCELLED) - return "cancelled"; - return "?"; - } - } - - /** - * Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process. - */ - @Child(name = "kind", type = {CodeableConcept.class}, order=0, min=0, max=1) - @Description(shortDefinition="The kind of supply (central, non-stock, etc)", formalDefinition="Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process." ) - protected CodeableConcept kind; - - /** - * Unique identifier for this supply request. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) - @Description(shortDefinition="Unique identifier", formalDefinition="Unique identifier for this supply request." ) - protected Identifier identifier; - - /** - * Status of the supply request. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="requested | completed | failed | cancelled", formalDefinition="Status of the supply request." ) - protected Enumeration status; - - /** - * The item that is requested to be supplied. - */ - @Child(name = "orderedItem", type = {Medication.class, Substance.class, Device.class}, order=3, min=0, max=1) - @Description(shortDefinition="Medication, Substance, or Device requested to be supplied", formalDefinition="The item that is requested to be supplied." ) - protected Reference orderedItem; - - /** - * The actual object that is the target of the reference (The item that is requested to be supplied.) - */ - protected Resource orderedItemTarget; - - /** - * A link to a resource representing the person whom the ordered item is for. - */ - @Child(name = "patient", type = {Patient.class}, order=4, min=0, max=1) - @Description(shortDefinition="Patient for whom the item is supplied", formalDefinition="A link to a resource representing the person whom the ordered item is for." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (A link to a resource representing the person whom the ordered item is for.) - */ - protected Patient patientTarget; - - private static final long serialVersionUID = 1726524554L; - - /* - * Constructor - */ - public SupplyRequest() { - super(); - } - - /** - * @return {@link #kind} (Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.) - */ - public CodeableConcept getKind() { - if (this.kind == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyRequest.kind"); - else if (Configuration.doAutoCreate()) - this.kind = new CodeableConcept(); // cc - return this.kind; - } - - public boolean hasKind() { - return this.kind != null && !this.kind.isEmpty(); - } - - /** - * @param value {@link #kind} (Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.) - */ - public SupplyRequest setKind(CodeableConcept value) { - this.kind = value; - return this; - } - - /** - * @return {@link #identifier} (Unique identifier for this supply request.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyRequest.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Unique identifier for this supply request.) - */ - public SupplyRequest setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #status} (Status of the supply request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyRequest.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ValuesetSupplyrequestStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Status of the supply request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public SupplyRequest setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Status of the supply request. - */ - public ValuesetSupplyrequestStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Status of the supply request. - */ - public SupplyRequest setStatus(ValuesetSupplyrequestStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new ValuesetSupplyrequestStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #orderedItem} (The item that is requested to be supplied.) - */ - public Reference getOrderedItem() { - if (this.orderedItem == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyRequest.orderedItem"); - else if (Configuration.doAutoCreate()) - this.orderedItem = new Reference(); // cc - return this.orderedItem; - } - - public boolean hasOrderedItem() { - return this.orderedItem != null && !this.orderedItem.isEmpty(); - } - - /** - * @param value {@link #orderedItem} (The item that is requested to be supplied.) - */ - public SupplyRequest setOrderedItem(Reference value) { - this.orderedItem = value; - return this; - } - - /** - * @return {@link #orderedItem} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The item that is requested to be supplied.) - */ - public Resource getOrderedItemTarget() { - return this.orderedItemTarget; - } - - /** - * @param value {@link #orderedItem} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The item that is requested to be supplied.) - */ - public SupplyRequest setOrderedItemTarget(Resource value) { - this.orderedItemTarget = value; - return this; - } - - /** - * @return {@link #patient} (A link to a resource representing the person whom the ordered item is for.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyRequest.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (A link to a resource representing the person whom the ordered item is for.) - */ - public SupplyRequest setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person whom the ordered item is for.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyRequest.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person whom the ordered item is for.) - */ - public SupplyRequest setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("kind", "CodeableConcept", "Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.", 0, java.lang.Integer.MAX_VALUE, kind)); - childrenList.add(new Property("identifier", "Identifier", "Unique identifier for this supply request.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "Status of the supply request.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("orderedItem", "Reference(Medication|Substance|Device)", "The item that is requested to be supplied.", 0, java.lang.Integer.MAX_VALUE, orderedItem)); - childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person whom the ordered item is for.", 0, java.lang.Integer.MAX_VALUE, patient)); - } - - public SupplyRequest copy() { - SupplyRequest dst = new SupplyRequest(); - copyValues(dst); - dst.kind = kind == null ? null : kind.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.status = status == null ? null : status.copy(); - dst.orderedItem = orderedItem == null ? null : orderedItem.copy(); - dst.patient = patient == null ? null : patient.copy(); - return dst; - } - - protected SupplyRequest typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SupplyRequest)) - return false; - SupplyRequest o = (SupplyRequest) other; - return compareDeep(kind, o.kind, true) && compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) - && compareDeep(orderedItem, o.orderedItem, true) && compareDeep(patient, o.patient, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SupplyRequest)) - return false; - SupplyRequest o = (SupplyRequest) other; - return compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (kind == null || kind.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (status == null || status.isEmpty()) && (orderedItem == null || orderedItem.isEmpty()) - && (patient == null || patient.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.SupplyRequest; - } - - @SearchParamDefinition(name="patient", path="SupplyRequest.patient", description="Patient for whom the item is supplied", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="status", path="SupplyRequest.status", description="requested | completed | failed | cancelled", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="identifier", path="SupplyRequest.identifier", description="Unique identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="kind", path="SupplyRequest.kind", description="The kind of supply (central, non-stock, etc)", type="token" ) - public static final String SP_KIND = "kind"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A supply - a request for something. + */ +@ResourceDef(name="SupplyRequest", profile="http://hl7.org/fhir/Profile/SupplyRequest") +public class SupplyRequest extends DomainResource { + + public enum ValuesetSupplyrequestStatus { + /** + * Supply has been requested, but not dispensed. + */ + REQUESTED, + /** + * Supply has been received by the requestor. + */ + COMPLETED, + /** + * The supply will not be completed because the supplier was unable or unwilling to supply the item. + */ + FAILED, + /** + * The orderer of the supply cancelled the request. + */ + CANCELLED, + /** + * added to help the parsers + */ + NULL; + public static ValuesetSupplyrequestStatus fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return REQUESTED; + if ("completed".equals(codeString)) + return COMPLETED; + if ("failed".equals(codeString)) + return FAILED; + if ("cancelled".equals(codeString)) + return CANCELLED; + throw new Exception("Unknown ValuesetSupplyrequestStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case REQUESTED: return "requested"; + case COMPLETED: return "completed"; + case FAILED: return "failed"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REQUESTED: return ""; + case COMPLETED: return ""; + case FAILED: return ""; + case CANCELLED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REQUESTED: return "Supply has been requested, but not dispensed."; + case COMPLETED: return "Supply has been received by the requestor."; + case FAILED: return "The supply will not be completed because the supplier was unable or unwilling to supply the item."; + case CANCELLED: return "The orderer of the supply cancelled the request."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REQUESTED: return "Requested"; + case COMPLETED: return "Received"; + case FAILED: return "Failed"; + case CANCELLED: return "Cancelled"; + default: return "?"; + } + } + } + + public static class ValuesetSupplyrequestStatusEnumFactory implements EnumFactory { + public ValuesetSupplyrequestStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return ValuesetSupplyrequestStatus.REQUESTED; + if ("completed".equals(codeString)) + return ValuesetSupplyrequestStatus.COMPLETED; + if ("failed".equals(codeString)) + return ValuesetSupplyrequestStatus.FAILED; + if ("cancelled".equals(codeString)) + return ValuesetSupplyrequestStatus.CANCELLED; + throw new IllegalArgumentException("Unknown ValuesetSupplyrequestStatus code '"+codeString+"'"); + } + public String toCode(ValuesetSupplyrequestStatus code) { + if (code == ValuesetSupplyrequestStatus.REQUESTED) + return "requested"; + if (code == ValuesetSupplyrequestStatus.COMPLETED) + return "completed"; + if (code == ValuesetSupplyrequestStatus.FAILED) + return "failed"; + if (code == ValuesetSupplyrequestStatus.CANCELLED) + return "cancelled"; + return "?"; + } + } + + /** + * Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process. + */ + @Child(name = "kind", type = {CodeableConcept.class}, order=0, min=0, max=1) + @Description(shortDefinition="The kind of supply (central, non-stock, etc)", formalDefinition="Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process." ) + protected CodeableConcept kind; + + /** + * Unique identifier for this supply request. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) + @Description(shortDefinition="Unique identifier", formalDefinition="Unique identifier for this supply request." ) + protected Identifier identifier; + + /** + * Status of the supply request. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="requested | completed | failed | cancelled", formalDefinition="Status of the supply request." ) + protected Enumeration status; + + /** + * The item that is requested to be supplied. + */ + @Child(name = "orderedItem", type = {Medication.class, Substance.class, Device.class}, order=3, min=0, max=1) + @Description(shortDefinition="Medication, Substance, or Device requested to be supplied", formalDefinition="The item that is requested to be supplied." ) + protected Reference orderedItem; + + /** + * The actual object that is the target of the reference (The item that is requested to be supplied.) + */ + protected Resource orderedItemTarget; + + /** + * A link to a resource representing the person whom the ordered item is for. + */ + @Child(name = "patient", type = {Patient.class}, order=4, min=0, max=1) + @Description(shortDefinition="Patient for whom the item is supplied", formalDefinition="A link to a resource representing the person whom the ordered item is for." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (A link to a resource representing the person whom the ordered item is for.) + */ + protected Patient patientTarget; + + private static final long serialVersionUID = 1726524554L; + + /* + * Constructor + */ + public SupplyRequest() { + super(); + } + + /** + * @return {@link #kind} (Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.) + */ + public CodeableConcept getKind() { + if (this.kind == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyRequest.kind"); + else if (Configuration.doAutoCreate()) + this.kind = new CodeableConcept(); // cc + return this.kind; + } + + public boolean hasKind() { + return this.kind != null && !this.kind.isEmpty(); + } + + /** + * @param value {@link #kind} (Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.) + */ + public SupplyRequest setKind(CodeableConcept value) { + this.kind = value; + return this; + } + + /** + * @return {@link #identifier} (Unique identifier for this supply request.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyRequest.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Unique identifier for this supply request.) + */ + public SupplyRequest setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #status} (Status of the supply request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyRequest.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ValuesetSupplyrequestStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (Status of the supply request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public SupplyRequest setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Status of the supply request. + */ + public ValuesetSupplyrequestStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Status of the supply request. + */ + public SupplyRequest setStatus(ValuesetSupplyrequestStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new ValuesetSupplyrequestStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #orderedItem} (The item that is requested to be supplied.) + */ + public Reference getOrderedItem() { + if (this.orderedItem == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyRequest.orderedItem"); + else if (Configuration.doAutoCreate()) + this.orderedItem = new Reference(); // cc + return this.orderedItem; + } + + public boolean hasOrderedItem() { + return this.orderedItem != null && !this.orderedItem.isEmpty(); + } + + /** + * @param value {@link #orderedItem} (The item that is requested to be supplied.) + */ + public SupplyRequest setOrderedItem(Reference value) { + this.orderedItem = value; + return this; + } + + /** + * @return {@link #orderedItem} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The item that is requested to be supplied.) + */ + public Resource getOrderedItemTarget() { + return this.orderedItemTarget; + } + + /** + * @param value {@link #orderedItem} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The item that is requested to be supplied.) + */ + public SupplyRequest setOrderedItemTarget(Resource value) { + this.orderedItemTarget = value; + return this; + } + + /** + * @return {@link #patient} (A link to a resource representing the person whom the ordered item is for.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyRequest.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (A link to a resource representing the person whom the ordered item is for.) + */ + public SupplyRequest setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person whom the ordered item is for.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyRequest.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person whom the ordered item is for.) + */ + public SupplyRequest setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("kind", "CodeableConcept", "Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.", 0, java.lang.Integer.MAX_VALUE, kind)); + childrenList.add(new Property("identifier", "Identifier", "Unique identifier for this supply request.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "Status of the supply request.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("orderedItem", "Reference(Medication|Substance|Device)", "The item that is requested to be supplied.", 0, java.lang.Integer.MAX_VALUE, orderedItem)); + childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person whom the ordered item is for.", 0, java.lang.Integer.MAX_VALUE, patient)); + } + + public SupplyRequest copy() { + SupplyRequest dst = new SupplyRequest(); + copyValues(dst); + dst.kind = kind == null ? null : kind.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.status = status == null ? null : status.copy(); + dst.orderedItem = orderedItem == null ? null : orderedItem.copy(); + dst.patient = patient == null ? null : patient.copy(); + return dst; + } + + protected SupplyRequest typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SupplyRequest)) + return false; + SupplyRequest o = (SupplyRequest) other; + return compareDeep(kind, o.kind, true) && compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) + && compareDeep(orderedItem, o.orderedItem, true) && compareDeep(patient, o.patient, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SupplyRequest)) + return false; + SupplyRequest o = (SupplyRequest) other; + return compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (kind == null || kind.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (status == null || status.isEmpty()) && (orderedItem == null || orderedItem.isEmpty()) + && (patient == null || patient.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.SupplyRequest; + } + + @SearchParamDefinition(name="identifier", path="SupplyRequest.identifier", description="Unique identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="kind", path="SupplyRequest.kind", description="The kind of supply (central, non-stock, etc)", type="token" ) + public static final String SP_KIND = "kind"; + @SearchParamDefinition(name="patient", path="SupplyRequest.patient", description="Patient for whom the item is supplied", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="status", path="SupplyRequest.status", description="requested | completed | failed | cancelled", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/TemporalPrecisionEnum.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/TemporalPrecisionEnum.java index ae282672598..e0c6d727e46 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/TemporalPrecisionEnum.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/TemporalPrecisionEnum.java @@ -1,25 +1,5 @@ package org.hl7.fhir.instance.model; -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - import java.util.Calendar; import java.util.Date; diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/TestScript.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/TestScript.java new file mode 100644 index 00000000000..a4f9f0aacc3 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/TestScript.java @@ -0,0 +1,3711 @@ +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. + */ +@ResourceDef(name="TestScript", profile="http://hl7.org/fhir/Profile/TestScript") +public class TestScript extends DomainResource { + + public enum TestOperationCodes { + /** + * Read the current state of the resource. + */ + READ, + /** + * Read the state of a specific version of the resource. + */ + VREAD, + /** + * Update an existing resource by its id (or create it if it is new). + */ + UPDATE, + /** + * Delete a resource. + */ + DELETE, + /** + * Retrieve the update history for a particular resource or resource type. + */ + HISTORY, + /** + * Create a new resource with a server assigned id. + */ + CREATE, + /** + * Search based on some filter criteria. + */ + SEARCH, + /** + * Update, create or delete a set of resources as a single transaction. + */ + TRANSACTION, + /** + * Get a conformance statement for the system. + */ + CONFORMANCE, + /** + * Tag operations. + */ + TAGS, + /** + * Not currently supported test operation. + */ + MAILBOX, + /** + * Not currently supported test operation. + */ + DOCUMENT, + /** + * Make an assertion against the result of the last non-assertion operation. + */ + ASSERTION, + /** + * Make a negative or false assertion against the result of the last non-assertion operation. + */ + ASSERTIONFALSE, + /** + * Run an assertion function as a warning (instead of a failture) against the result of the last non-assertion operation. + */ + ASSERTIONWARNING, + /** + * added to help the parsers + */ + NULL; + public static TestOperationCodes fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("read".equals(codeString)) + return READ; + if ("vread".equals(codeString)) + return VREAD; + if ("update".equals(codeString)) + return UPDATE; + if ("delete".equals(codeString)) + return DELETE; + if ("history".equals(codeString)) + return HISTORY; + if ("create".equals(codeString)) + return CREATE; + if ("search".equals(codeString)) + return SEARCH; + if ("transaction".equals(codeString)) + return TRANSACTION; + if ("conformance".equals(codeString)) + return CONFORMANCE; + if ("tags".equals(codeString)) + return TAGS; + if ("mailbox".equals(codeString)) + return MAILBOX; + if ("document".equals(codeString)) + return DOCUMENT; + if ("assertion".equals(codeString)) + return ASSERTION; + if ("assertion_false".equals(codeString)) + return ASSERTIONFALSE; + if ("assertion_warning".equals(codeString)) + return ASSERTIONWARNING; + throw new Exception("Unknown TestOperationCodes code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case READ: return "read"; + case VREAD: return "vread"; + case UPDATE: return "update"; + case DELETE: return "delete"; + case HISTORY: return "history"; + case CREATE: return "create"; + case SEARCH: return "search"; + case TRANSACTION: return "transaction"; + case CONFORMANCE: return "conformance"; + case TAGS: return "tags"; + case MAILBOX: return "mailbox"; + case DOCUMENT: return "document"; + case ASSERTION: return "assertion"; + case ASSERTIONFALSE: return "assertion_false"; + case ASSERTIONWARNING: return "assertion_warning"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case READ: return ""; + case VREAD: return ""; + case UPDATE: return ""; + case DELETE: return ""; + case HISTORY: return ""; + case CREATE: return ""; + case SEARCH: return ""; + case TRANSACTION: return ""; + case CONFORMANCE: return ""; + case TAGS: return ""; + case MAILBOX: return ""; + case DOCUMENT: return ""; + case ASSERTION: return ""; + case ASSERTIONFALSE: return ""; + case ASSERTIONWARNING: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case READ: return "Read the current state of the resource."; + case VREAD: return "Read the state of a specific version of the resource."; + case UPDATE: return "Update an existing resource by its id (or create it if it is new)."; + case DELETE: return "Delete a resource."; + case HISTORY: return "Retrieve the update history for a particular resource or resource type."; + case CREATE: return "Create a new resource with a server assigned id."; + case SEARCH: return "Search based on some filter criteria."; + case TRANSACTION: return "Update, create or delete a set of resources as a single transaction."; + case CONFORMANCE: return "Get a conformance statement for the system."; + case TAGS: return "Tag operations."; + case MAILBOX: return "Not currently supported test operation."; + case DOCUMENT: return "Not currently supported test operation."; + case ASSERTION: return "Make an assertion against the result of the last non-assertion operation."; + case ASSERTIONFALSE: return "Make a negative or false assertion against the result of the last non-assertion operation."; + case ASSERTIONWARNING: return "Run an assertion function as a warning (instead of a failture) against the result of the last non-assertion operation."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case READ: return "read"; + case VREAD: return "vread"; + case UPDATE: return "update"; + case DELETE: return "delete"; + case HISTORY: return "history"; + case CREATE: return "create"; + case SEARCH: return "search"; + case TRANSACTION: return "transaction"; + case CONFORMANCE: return "conformance"; + case TAGS: return "tags"; + case MAILBOX: return "mailbox"; + case DOCUMENT: return "document"; + case ASSERTION: return "assertion"; + case ASSERTIONFALSE: return "assertion_false"; + case ASSERTIONWARNING: return "assertion_warning"; + default: return "?"; + } + } + } + + public static class TestOperationCodesEnumFactory implements EnumFactory { + public TestOperationCodes fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("read".equals(codeString)) + return TestOperationCodes.READ; + if ("vread".equals(codeString)) + return TestOperationCodes.VREAD; + if ("update".equals(codeString)) + return TestOperationCodes.UPDATE; + if ("delete".equals(codeString)) + return TestOperationCodes.DELETE; + if ("history".equals(codeString)) + return TestOperationCodes.HISTORY; + if ("create".equals(codeString)) + return TestOperationCodes.CREATE; + if ("search".equals(codeString)) + return TestOperationCodes.SEARCH; + if ("transaction".equals(codeString)) + return TestOperationCodes.TRANSACTION; + if ("conformance".equals(codeString)) + return TestOperationCodes.CONFORMANCE; + if ("tags".equals(codeString)) + return TestOperationCodes.TAGS; + if ("mailbox".equals(codeString)) + return TestOperationCodes.MAILBOX; + if ("document".equals(codeString)) + return TestOperationCodes.DOCUMENT; + if ("assertion".equals(codeString)) + return TestOperationCodes.ASSERTION; + if ("assertion_false".equals(codeString)) + return TestOperationCodes.ASSERTIONFALSE; + if ("assertion_warning".equals(codeString)) + return TestOperationCodes.ASSERTIONWARNING; + throw new IllegalArgumentException("Unknown TestOperationCodes code '"+codeString+"'"); + } + public String toCode(TestOperationCodes code) { + if (code == TestOperationCodes.READ) + return "read"; + if (code == TestOperationCodes.VREAD) + return "vread"; + if (code == TestOperationCodes.UPDATE) + return "update"; + if (code == TestOperationCodes.DELETE) + return "delete"; + if (code == TestOperationCodes.HISTORY) + return "history"; + if (code == TestOperationCodes.CREATE) + return "create"; + if (code == TestOperationCodes.SEARCH) + return "search"; + if (code == TestOperationCodes.TRANSACTION) + return "transaction"; + if (code == TestOperationCodes.CONFORMANCE) + return "conformance"; + if (code == TestOperationCodes.TAGS) + return "tags"; + if (code == TestOperationCodes.MAILBOX) + return "mailbox"; + if (code == TestOperationCodes.DOCUMENT) + return "document"; + if (code == TestOperationCodes.ASSERTION) + return "assertion"; + if (code == TestOperationCodes.ASSERTIONFALSE) + return "assertion_false"; + if (code == TestOperationCodes.ASSERTIONWARNING) + return "assertion_warning"; + return "?"; + } + } + + public enum ContentType { + /** + * XML content-type corresponding to the application/xml+fhir mime-type. + */ + XML, + /** + * JSON content-type corresponding to the application/json+fhir mime-type. + */ + JSON, + /** + * added to help the parsers + */ + NULL; + public static ContentType fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("xml".equals(codeString)) + return XML; + if ("json".equals(codeString)) + return JSON; + throw new Exception("Unknown ContentType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case XML: return "xml"; + case JSON: return "json"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case XML: return ""; + case JSON: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case XML: return "XML content-type corresponding to the application/xml+fhir mime-type."; + case JSON: return "JSON content-type corresponding to the application/json+fhir mime-type."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case XML: return "xml"; + case JSON: return "json"; + default: return "?"; + } + } + } + + public static class ContentTypeEnumFactory implements EnumFactory { + public ContentType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("xml".equals(codeString)) + return ContentType.XML; + if ("json".equals(codeString)) + return ContentType.JSON; + throw new IllegalArgumentException("Unknown ContentType code '"+codeString+"'"); + } + public String toCode(ContentType code) { + if (code == ContentType.XML) + return "xml"; + if (code == ContentType.JSON) + return "json"; + return "?"; + } + } + + @Block() + public static class TestScriptFixtureComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The URI of the fixture. Each fixture shall have a "uri" or "resource" but not both. The "uri" shall resolve to a valid Resource. The "uri" may be local or remote, absolute or relative. + */ + @Child(name = "uri", type = {UriType.class}, order=1, min=0, max=1) + @Description(shortDefinition="URI of the fixture", formalDefinition="The URI of the fixture. Each fixture shall have a 'uri' or 'resource' but not both. The 'uri' shall resolve to a valid Resource. The 'uri' may be local or remote, absolute or relative." ) + protected UriType uri; + + /** + * The fixture resource actually embedded in this TestScript. Each fixture should have a "uri" or "resource" but not both. + */ + @Child(name = "resource", type = {Resource.class}, order=2, min=0, max=1) + @Description(shortDefinition="Fixture resource", formalDefinition="The fixture resource actually embedded in this TestScript. Each fixture should have a 'uri' or 'resource' but not both." ) + protected Resource resource; + + /** + * Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section. + */ + @Child(name = "autocreate", type = {BooleanType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Whether or not to implicitly create the fixture during setup", formalDefinition="Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section." ) + protected BooleanType autocreate; + + /** + * Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section. + */ + @Child(name = "autodelete", type = {BooleanType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Whether or not to implicitly delete the fixture during teardown", formalDefinition="Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section." ) + protected BooleanType autodelete; + + private static final long serialVersionUID = 1455581555L; + + /* + * Constructor + */ + public TestScriptFixtureComponent() { + super(); + } + + /** + * @return {@link #uri} (The URI of the fixture. Each fixture shall have a "uri" or "resource" but not both. The "uri" shall resolve to a valid Resource. The "uri" may be local or remote, absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value + */ + public UriType getUriElement() { + if (this.uri == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptFixtureComponent.uri"); + else if (Configuration.doAutoCreate()) + this.uri = new UriType(); // bb + return this.uri; + } + + public boolean hasUriElement() { + return this.uri != null && !this.uri.isEmpty(); + } + + public boolean hasUri() { + return this.uri != null && !this.uri.isEmpty(); + } + + /** + * @param value {@link #uri} (The URI of the fixture. Each fixture shall have a "uri" or "resource" but not both. The "uri" shall resolve to a valid Resource. The "uri" may be local or remote, absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value + */ + public TestScriptFixtureComponent setUriElement(UriType value) { + this.uri = value; + return this; + } + + /** + * @return The URI of the fixture. Each fixture shall have a "uri" or "resource" but not both. The "uri" shall resolve to a valid Resource. The "uri" may be local or remote, absolute or relative. + */ + public String getUri() { + return this.uri == null ? null : this.uri.getValue(); + } + + /** + * @param value The URI of the fixture. Each fixture shall have a "uri" or "resource" but not both. The "uri" shall resolve to a valid Resource. The "uri" may be local or remote, absolute or relative. + */ + public TestScriptFixtureComponent setUri(String value) { + if (Utilities.noString(value)) + this.uri = null; + else { + if (this.uri == null) + this.uri = new UriType(); + this.uri.setValue(value); + } + return this; + } + + /** + * @return {@link #resource} (The fixture resource actually embedded in this TestScript. Each fixture should have a "uri" or "resource" but not both.) + */ + public Resource getResource() { + return this.resource; + } + + public boolean hasResource() { + return this.resource != null && !this.resource.isEmpty(); + } + + /** + * @param value {@link #resource} (The fixture resource actually embedded in this TestScript. Each fixture should have a "uri" or "resource" but not both.) + */ + public TestScriptFixtureComponent setResource(Resource value) { + this.resource = value; + return this; + } + + /** + * @return {@link #autocreate} (Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section.). This is the underlying object with id, value and extensions. The accessor "getAutocreate" gives direct access to the value + */ + public BooleanType getAutocreateElement() { + if (this.autocreate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptFixtureComponent.autocreate"); + else if (Configuration.doAutoCreate()) + this.autocreate = new BooleanType(); // bb + return this.autocreate; + } + + public boolean hasAutocreateElement() { + return this.autocreate != null && !this.autocreate.isEmpty(); + } + + public boolean hasAutocreate() { + return this.autocreate != null && !this.autocreate.isEmpty(); + } + + /** + * @param value {@link #autocreate} (Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section.). This is the underlying object with id, value and extensions. The accessor "getAutocreate" gives direct access to the value + */ + public TestScriptFixtureComponent setAutocreateElement(BooleanType value) { + this.autocreate = value; + return this; + } + + /** + * @return Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section. + */ + public boolean getAutocreate() { + return this.autocreate == null || this.autocreate.isEmpty() ? false : this.autocreate.getValue(); + } + + /** + * @param value Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section. + */ + public TestScriptFixtureComponent setAutocreate(boolean value) { + if (this.autocreate == null) + this.autocreate = new BooleanType(); + this.autocreate.setValue(value); + return this; + } + + /** + * @return {@link #autodelete} (Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section.). This is the underlying object with id, value and extensions. The accessor "getAutodelete" gives direct access to the value + */ + public BooleanType getAutodeleteElement() { + if (this.autodelete == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptFixtureComponent.autodelete"); + else if (Configuration.doAutoCreate()) + this.autodelete = new BooleanType(); // bb + return this.autodelete; + } + + public boolean hasAutodeleteElement() { + return this.autodelete != null && !this.autodelete.isEmpty(); + } + + public boolean hasAutodelete() { + return this.autodelete != null && !this.autodelete.isEmpty(); + } + + /** + * @param value {@link #autodelete} (Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section.). This is the underlying object with id, value and extensions. The accessor "getAutodelete" gives direct access to the value + */ + public TestScriptFixtureComponent setAutodeleteElement(BooleanType value) { + this.autodelete = value; + return this; + } + + /** + * @return Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section. + */ + public boolean getAutodelete() { + return this.autodelete == null || this.autodelete.isEmpty() ? false : this.autodelete.getValue(); + } + + /** + * @param value Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section. + */ + public TestScriptFixtureComponent setAutodelete(boolean value) { + if (this.autodelete == null) + this.autodelete = new BooleanType(); + this.autodelete.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("uri", "uri", "The URI of the fixture. Each fixture shall have a 'uri' or 'resource' but not both. The 'uri' shall resolve to a valid Resource. The 'uri' may be local or remote, absolute or relative.", 0, java.lang.Integer.MAX_VALUE, uri)); + childrenList.add(new Property("resource", "Resource", "The fixture resource actually embedded in this TestScript. Each fixture should have a 'uri' or 'resource' but not both.", 0, java.lang.Integer.MAX_VALUE, resource)); + childrenList.add(new Property("autocreate", "boolean", "Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section.", 0, java.lang.Integer.MAX_VALUE, autocreate)); + childrenList.add(new Property("autodelete", "boolean", "Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section.", 0, java.lang.Integer.MAX_VALUE, autodelete)); + } + + public TestScriptFixtureComponent copy() { + TestScriptFixtureComponent dst = new TestScriptFixtureComponent(); + copyValues(dst); + dst.uri = uri == null ? null : uri.copy(); + dst.resource = resource == null ? null : resource.copy(); + dst.autocreate = autocreate == null ? null : autocreate.copy(); + dst.autodelete = autodelete == null ? null : autodelete.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptFixtureComponent)) + return false; + TestScriptFixtureComponent o = (TestScriptFixtureComponent) other; + return compareDeep(uri, o.uri, true) && compareDeep(resource, o.resource, true) && compareDeep(autocreate, o.autocreate, true) + && compareDeep(autodelete, o.autodelete, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptFixtureComponent)) + return false; + TestScriptFixtureComponent o = (TestScriptFixtureComponent) other; + return compareValues(uri, o.uri, true) && compareValues(autocreate, o.autocreate, true) && compareValues(autodelete, o.autodelete, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (uri == null || uri.isEmpty()) && (resource == null || resource.isEmpty()) + && (autocreate == null || autocreate.isEmpty()) && (autodelete == null || autodelete.isEmpty()) + ; + } + + } + + @Block() + public static class TestScriptSetupComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A setup operation. + */ + @Child(name = "operation", type = {}, order=1, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A setup operation", formalDefinition="A setup operation." ) + protected List operation; + + private static final long serialVersionUID = -61721475L; + + /* + * Constructor + */ + public TestScriptSetupComponent() { + super(); + } + + /** + * @return {@link #operation} (A setup operation.) + */ + public List getOperation() { + if (this.operation == null) + this.operation = new ArrayList(); + return this.operation; + } + + public boolean hasOperation() { + if (this.operation == null) + return false; + for (TestScriptSetupOperationComponent item : this.operation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #operation} (A setup operation.) + */ + // syntactic sugar + public TestScriptSetupOperationComponent addOperation() { //3 + TestScriptSetupOperationComponent t = new TestScriptSetupOperationComponent(); + if (this.operation == null) + this.operation = new ArrayList(); + this.operation.add(t); + return t; + } + + // syntactic sugar + public TestScriptSetupComponent addOperation(TestScriptSetupOperationComponent t) { //3 + if (t == null) + return this; + if (this.operation == null) + this.operation = new ArrayList(); + this.operation.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("operation", "", "A setup operation.", 0, java.lang.Integer.MAX_VALUE, operation)); + } + + public TestScriptSetupComponent copy() { + TestScriptSetupComponent dst = new TestScriptSetupComponent(); + copyValues(dst); + if (operation != null) { + dst.operation = new ArrayList(); + for (TestScriptSetupOperationComponent i : operation) + dst.operation.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptSetupComponent)) + return false; + TestScriptSetupComponent o = (TestScriptSetupComponent) other; + return compareDeep(operation, o.operation, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptSetupComponent)) + return false; + TestScriptSetupComponent o = (TestScriptSetupComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (operation == null || operation.isEmpty()); + } + + } + + @Block() + public static class TestScriptSetupOperationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning", formalDefinition="read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning." ) + protected Enumeration type; + + /** + * The internal id of the fixture used as the body of any operation.type that results in a PUT or POST. + */ + @Child(name = "source", type = {IdType.class}, order=2, min=0, max=1) + @Description(shortDefinition="The id of the fixture used as the body in a PUT or POST", formalDefinition="The internal id of the fixture used as the body of any operation.type that results in a PUT or POST." ) + protected IdType source; + + /** + * The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET. + */ + @Child(name = "target", type = {IdType.class}, order=3, min=0, max=1) + @Description(shortDefinition="The id of the fixture used as the target of a PUT or POST, or the id of the fixture used to store the results of a GET", formalDefinition="The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET." ) + protected IdType target; + + /** + * Which server to perform the operation on. + */ + @Child(name = "destination", type = {IntegerType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Which server to perform the operation on", formalDefinition="Which server to perform the operation on." ) + protected IntegerType destination; + + /** + * Arguments to an operation. + */ + @Child(name = "parameter", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Arguments to an operation", formalDefinition="Arguments to an operation." ) + protected List parameter; + + /** + * The fixture id (maybe new) to map to the response. + */ + @Child(name = "responseId", type = {IdType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Response id", formalDefinition="The fixture id (maybe new) to map to the response." ) + protected IdType responseId; + + /** + * The content-type or mime-type to use for RESTful operation. + */ + @Child(name = "contentType", type = {CodeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="xml | json", formalDefinition="The content-type or mime-type to use for RESTful operation." ) + protected Enumeration contentType; + + private static final long serialVersionUID = -1217888318L; + + /* + * Constructor + */ + public TestScriptSetupOperationComponent() { + super(); + } + + /* + * Constructor + */ + public TestScriptSetupOperationComponent(Enumeration type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptSetupOperationComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new TestOperationCodesEnumFactory()); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public TestScriptSetupOperationComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning. + */ + public TestOperationCodes getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning. + */ + public TestScriptSetupOperationComponent setType(TestOperationCodes value) { + if (this.type == null) + this.type = new Enumeration(new TestOperationCodesEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #source} (The internal id of the fixture used as the body of any operation.type that results in a PUT or POST.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value + */ + public IdType getSourceElement() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptSetupOperationComponent.source"); + else if (Configuration.doAutoCreate()) + this.source = new IdType(); // bb + return this.source; + } + + public boolean hasSourceElement() { + return this.source != null && !this.source.isEmpty(); + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (The internal id of the fixture used as the body of any operation.type that results in a PUT or POST.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value + */ + public TestScriptSetupOperationComponent setSourceElement(IdType value) { + this.source = value; + return this; + } + + /** + * @return The internal id of the fixture used as the body of any operation.type that results in a PUT or POST. + */ + public String getSource() { + return this.source == null ? null : this.source.getValue(); + } + + /** + * @param value The internal id of the fixture used as the body of any operation.type that results in a PUT or POST. + */ + public TestScriptSetupOperationComponent setSource(String value) { + if (Utilities.noString(value)) + this.source = null; + else { + if (this.source == null) + this.source = new IdType(); + this.source.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET.). This is the underlying object with id, value and extensions. The accessor "getTarget" gives direct access to the value + */ + public IdType getTargetElement() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptSetupOperationComponent.target"); + else if (Configuration.doAutoCreate()) + this.target = new IdType(); // bb + return this.target; + } + + public boolean hasTargetElement() { + return this.target != null && !this.target.isEmpty(); + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET.). This is the underlying object with id, value and extensions. The accessor "getTarget" gives direct access to the value + */ + public TestScriptSetupOperationComponent setTargetElement(IdType value) { + this.target = value; + return this; + } + + /** + * @return The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET. + */ + public String getTarget() { + return this.target == null ? null : this.target.getValue(); + } + + /** + * @param value The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET. + */ + public TestScriptSetupOperationComponent setTarget(String value) { + if (Utilities.noString(value)) + this.target = null; + else { + if (this.target == null) + this.target = new IdType(); + this.target.setValue(value); + } + return this; + } + + /** + * @return {@link #destination} (Which server to perform the operation on.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value + */ + public IntegerType getDestinationElement() { + if (this.destination == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptSetupOperationComponent.destination"); + else if (Configuration.doAutoCreate()) + this.destination = new IntegerType(); // bb + return this.destination; + } + + public boolean hasDestinationElement() { + return this.destination != null && !this.destination.isEmpty(); + } + + public boolean hasDestination() { + return this.destination != null && !this.destination.isEmpty(); + } + + /** + * @param value {@link #destination} (Which server to perform the operation on.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value + */ + public TestScriptSetupOperationComponent setDestinationElement(IntegerType value) { + this.destination = value; + return this; + } + + /** + * @return Which server to perform the operation on. + */ + public int getDestination() { + return this.destination == null || this.destination.isEmpty() ? 0 : this.destination.getValue(); + } + + /** + * @param value Which server to perform the operation on. + */ + public TestScriptSetupOperationComponent setDestination(int value) { + if (this.destination == null) + this.destination = new IntegerType(); + this.destination.setValue(value); + return this; + } + + /** + * @return {@link #parameter} (Arguments to an operation.) + */ + public List getParameter() { + if (this.parameter == null) + this.parameter = new ArrayList(); + return this.parameter; + } + + public boolean hasParameter() { + if (this.parameter == null) + return false; + for (StringType item : this.parameter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #parameter} (Arguments to an operation.) + */ + // syntactic sugar + public StringType addParameterElement() {//2 + StringType t = new StringType(); + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return t; + } + + /** + * @param value {@link #parameter} (Arguments to an operation.) + */ + public TestScriptSetupOperationComponent addParameter(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return this; + } + + /** + * @param value {@link #parameter} (Arguments to an operation.) + */ + public boolean hasParameter(String value) { + if (this.parameter == null) + return false; + for (StringType v : this.parameter) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #responseId} (The fixture id (maybe new) to map to the response.). This is the underlying object with id, value and extensions. The accessor "getResponseId" gives direct access to the value + */ + public IdType getResponseIdElement() { + if (this.responseId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptSetupOperationComponent.responseId"); + else if (Configuration.doAutoCreate()) + this.responseId = new IdType(); // bb + return this.responseId; + } + + public boolean hasResponseIdElement() { + return this.responseId != null && !this.responseId.isEmpty(); + } + + public boolean hasResponseId() { + return this.responseId != null && !this.responseId.isEmpty(); + } + + /** + * @param value {@link #responseId} (The fixture id (maybe new) to map to the response.). This is the underlying object with id, value and extensions. The accessor "getResponseId" gives direct access to the value + */ + public TestScriptSetupOperationComponent setResponseIdElement(IdType value) { + this.responseId = value; + return this; + } + + /** + * @return The fixture id (maybe new) to map to the response. + */ + public String getResponseId() { + return this.responseId == null ? null : this.responseId.getValue(); + } + + /** + * @param value The fixture id (maybe new) to map to the response. + */ + public TestScriptSetupOperationComponent setResponseId(String value) { + if (Utilities.noString(value)) + this.responseId = null; + else { + if (this.responseId == null) + this.responseId = new IdType(); + this.responseId.setValue(value); + } + return this; + } + + /** + * @return {@link #contentType} (The content-type or mime-type to use for RESTful operation.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public Enumeration getContentTypeElement() { + if (this.contentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptSetupOperationComponent.contentType"); + else if (Configuration.doAutoCreate()) + this.contentType = new Enumeration(new ContentTypeEnumFactory()); // bb + return this.contentType; + } + + public boolean hasContentTypeElement() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + public boolean hasContentType() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + /** + * @param value {@link #contentType} (The content-type or mime-type to use for RESTful operation.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public TestScriptSetupOperationComponent setContentTypeElement(Enumeration value) { + this.contentType = value; + return this; + } + + /** + * @return The content-type or mime-type to use for RESTful operation. + */ + public ContentType getContentType() { + return this.contentType == null ? null : this.contentType.getValue(); + } + + /** + * @param value The content-type or mime-type to use for RESTful operation. + */ + public TestScriptSetupOperationComponent setContentType(ContentType value) { + if (value == null) + this.contentType = null; + else { + if (this.contentType == null) + this.contentType = new Enumeration(new ContentTypeEnumFactory()); + this.contentType.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("source", "id", "The internal id of the fixture used as the body of any operation.type that results in a PUT or POST.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("target", "id", "The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("destination", "integer", "Which server to perform the operation on.", 0, java.lang.Integer.MAX_VALUE, destination)); + childrenList.add(new Property("parameter", "string", "Arguments to an operation.", 0, java.lang.Integer.MAX_VALUE, parameter)); + childrenList.add(new Property("responseId", "id", "The fixture id (maybe new) to map to the response.", 0, java.lang.Integer.MAX_VALUE, responseId)); + childrenList.add(new Property("contentType", "code", "The content-type or mime-type to use for RESTful operation.", 0, java.lang.Integer.MAX_VALUE, contentType)); + } + + public TestScriptSetupOperationComponent copy() { + TestScriptSetupOperationComponent dst = new TestScriptSetupOperationComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.source = source == null ? null : source.copy(); + dst.target = target == null ? null : target.copy(); + dst.destination = destination == null ? null : destination.copy(); + if (parameter != null) { + dst.parameter = new ArrayList(); + for (StringType i : parameter) + dst.parameter.add(i.copy()); + }; + dst.responseId = responseId == null ? null : responseId.copy(); + dst.contentType = contentType == null ? null : contentType.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptSetupOperationComponent)) + return false; + TestScriptSetupOperationComponent o = (TestScriptSetupOperationComponent) other; + return compareDeep(type, o.type, true) && compareDeep(source, o.source, true) && compareDeep(target, o.target, true) + && compareDeep(destination, o.destination, true) && compareDeep(parameter, o.parameter, true) && compareDeep(responseId, o.responseId, true) + && compareDeep(contentType, o.contentType, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptSetupOperationComponent)) + return false; + TestScriptSetupOperationComponent o = (TestScriptSetupOperationComponent) other; + return compareValues(type, o.type, true) && compareValues(source, o.source, true) && compareValues(target, o.target, true) + && compareValues(destination, o.destination, true) && compareValues(parameter, o.parameter, true) && compareValues(responseId, o.responseId, true) + && compareValues(contentType, o.contentType, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (source == null || source.isEmpty()) + && (target == null || target.isEmpty()) && (destination == null || destination.isEmpty()) + && (parameter == null || parameter.isEmpty()) && (responseId == null || responseId.isEmpty()) + && (contentType == null || contentType.isEmpty()); + } + + } + + @Block() + public static class TestScriptTestComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of this test. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="The name of this test", formalDefinition="The name of this test." ) + protected StringType name; + + /** + * A short description of the test. + */ + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Short description of the test", formalDefinition="A short description of the test." ) + protected StringType description; + + /** + * Metadata about this Test. + */ + @Child(name = "metadata", type = {}, order=3, min=0, max=1) + @Description(shortDefinition="Metadata about this Test", formalDefinition="Metadata about this Test." ) + protected TestScriptTestMetadataComponent metadata; + + /** + * Each test must have at least one operation. Operation and assertion elements can be mixed together. + */ + @Child(name = "operation", type = {}, order=4, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Each test must have at least one operation", formalDefinition="Each test must have at least one operation. Operation and assertion elements can be mixed together." ) + protected List operation; + + private static final long serialVersionUID = -84782237L; + + /* + * Constructor + */ + public TestScriptTestComponent() { + super(); + } + + /** + * @return {@link #name} (The name of this test.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTestComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The name of this test.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public TestScriptTestComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of this test. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of this test. + */ + public TestScriptTestComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (A short description of the test.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTestComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (A short description of the test.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public TestScriptTestComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A short description of the test. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A short description of the test. + */ + public TestScriptTestComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #metadata} (Metadata about this Test.) + */ + public TestScriptTestMetadataComponent getMetadata() { + if (this.metadata == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTestComponent.metadata"); + else if (Configuration.doAutoCreate()) + this.metadata = new TestScriptTestMetadataComponent(); // cc + return this.metadata; + } + + public boolean hasMetadata() { + return this.metadata != null && !this.metadata.isEmpty(); + } + + /** + * @param value {@link #metadata} (Metadata about this Test.) + */ + public TestScriptTestComponent setMetadata(TestScriptTestMetadataComponent value) { + this.metadata = value; + return this; + } + + /** + * @return {@link #operation} (Each test must have at least one operation. Operation and assertion elements can be mixed together.) + */ + public List getOperation() { + if (this.operation == null) + this.operation = new ArrayList(); + return this.operation; + } + + public boolean hasOperation() { + if (this.operation == null) + return false; + for (TestScriptTestOperationComponent item : this.operation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #operation} (Each test must have at least one operation. Operation and assertion elements can be mixed together.) + */ + // syntactic sugar + public TestScriptTestOperationComponent addOperation() { //3 + TestScriptTestOperationComponent t = new TestScriptTestOperationComponent(); + if (this.operation == null) + this.operation = new ArrayList(); + this.operation.add(t); + return t; + } + + // syntactic sugar + public TestScriptTestComponent addOperation(TestScriptTestOperationComponent t) { //3 + if (t == null) + return this; + if (this.operation == null) + this.operation = new ArrayList(); + this.operation.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of this test.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("description", "string", "A short description of the test.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("metadata", "", "Metadata about this Test.", 0, java.lang.Integer.MAX_VALUE, metadata)); + childrenList.add(new Property("operation", "", "Each test must have at least one operation. Operation and assertion elements can be mixed together.", 0, java.lang.Integer.MAX_VALUE, operation)); + } + + public TestScriptTestComponent copy() { + TestScriptTestComponent dst = new TestScriptTestComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.description = description == null ? null : description.copy(); + dst.metadata = metadata == null ? null : metadata.copy(); + if (operation != null) { + dst.operation = new ArrayList(); + for (TestScriptTestOperationComponent i : operation) + dst.operation.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptTestComponent)) + return false; + TestScriptTestComponent o = (TestScriptTestComponent) other; + return compareDeep(name, o.name, true) && compareDeep(description, o.description, true) && compareDeep(metadata, o.metadata, true) + && compareDeep(operation, o.operation, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptTestComponent)) + return false; + TestScriptTestComponent o = (TestScriptTestComponent) other; + return compareValues(name, o.name, true) && compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (description == null || description.isEmpty()) + && (metadata == null || metadata.isEmpty()) && (operation == null || operation.isEmpty()) + ; + } + + } + + @Block() + public static class TestScriptTestMetadataComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A link to the FHIR specification that this test is covering. + */ + @Child(name = "link", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Link this test to the specification", formalDefinition="A link to the FHIR specification that this test is covering." ) + protected List link; + + /** + * The required capability must exist and is assumed to function correctly on the FHIR server being tested. + */ + @Child(name = "requires", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Required capability that is assumed to function correctly on the FHIR server being tested", formalDefinition="The required capability must exist and is assumed to function correctly on the FHIR server being tested." ) + protected List requires; + + /** + * The capability that this test verifies. + */ + @Child(name = "validates", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Capability being verified", formalDefinition="The capability that this test verifies." ) + protected List validates; + + private static final long serialVersionUID = 749998279L; + + /* + * Constructor + */ + public TestScriptTestMetadataComponent() { + super(); + } + + /** + * @return {@link #link} (A link to the FHIR specification that this test is covering.) + */ + public List getLink() { + if (this.link == null) + this.link = new ArrayList(); + return this.link; + } + + public boolean hasLink() { + if (this.link == null) + return false; + for (TestScriptTestMetadataLinkComponent item : this.link) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #link} (A link to the FHIR specification that this test is covering.) + */ + // syntactic sugar + public TestScriptTestMetadataLinkComponent addLink() { //3 + TestScriptTestMetadataLinkComponent t = new TestScriptTestMetadataLinkComponent(); + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return t; + } + + // syntactic sugar + public TestScriptTestMetadataComponent addLink(TestScriptTestMetadataLinkComponent t) { //3 + if (t == null) + return this; + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return this; + } + + /** + * @return {@link #requires} (The required capability must exist and is assumed to function correctly on the FHIR server being tested.) + */ + public List getRequires() { + if (this.requires == null) + this.requires = new ArrayList(); + return this.requires; + } + + public boolean hasRequires() { + if (this.requires == null) + return false; + for (TestScriptTestMetadataRequiresComponent item : this.requires) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #requires} (The required capability must exist and is assumed to function correctly on the FHIR server being tested.) + */ + // syntactic sugar + public TestScriptTestMetadataRequiresComponent addRequires() { //3 + TestScriptTestMetadataRequiresComponent t = new TestScriptTestMetadataRequiresComponent(); + if (this.requires == null) + this.requires = new ArrayList(); + this.requires.add(t); + return t; + } + + // syntactic sugar + public TestScriptTestMetadataComponent addRequires(TestScriptTestMetadataRequiresComponent t) { //3 + if (t == null) + return this; + if (this.requires == null) + this.requires = new ArrayList(); + this.requires.add(t); + return this; + } + + /** + * @return {@link #validates} (The capability that this test verifies.) + */ + public List getValidates() { + if (this.validates == null) + this.validates = new ArrayList(); + return this.validates; + } + + public boolean hasValidates() { + if (this.validates == null) + return false; + for (TestScriptTestMetadataValidatesComponent item : this.validates) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #validates} (The capability that this test verifies.) + */ + // syntactic sugar + public TestScriptTestMetadataValidatesComponent addValidates() { //3 + TestScriptTestMetadataValidatesComponent t = new TestScriptTestMetadataValidatesComponent(); + if (this.validates == null) + this.validates = new ArrayList(); + this.validates.add(t); + return t; + } + + // syntactic sugar + public TestScriptTestMetadataComponent addValidates(TestScriptTestMetadataValidatesComponent t) { //3 + if (t == null) + return this; + if (this.validates == null) + this.validates = new ArrayList(); + this.validates.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("link", "", "A link to the FHIR specification that this test is covering.", 0, java.lang.Integer.MAX_VALUE, link)); + childrenList.add(new Property("requires", "", "The required capability must exist and is assumed to function correctly on the FHIR server being tested.", 0, java.lang.Integer.MAX_VALUE, requires)); + childrenList.add(new Property("validates", "", "The capability that this test verifies.", 0, java.lang.Integer.MAX_VALUE, validates)); + } + + public TestScriptTestMetadataComponent copy() { + TestScriptTestMetadataComponent dst = new TestScriptTestMetadataComponent(); + copyValues(dst); + if (link != null) { + dst.link = new ArrayList(); + for (TestScriptTestMetadataLinkComponent i : link) + dst.link.add(i.copy()); + }; + if (requires != null) { + dst.requires = new ArrayList(); + for (TestScriptTestMetadataRequiresComponent i : requires) + dst.requires.add(i.copy()); + }; + if (validates != null) { + dst.validates = new ArrayList(); + for (TestScriptTestMetadataValidatesComponent i : validates) + dst.validates.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptTestMetadataComponent)) + return false; + TestScriptTestMetadataComponent o = (TestScriptTestMetadataComponent) other; + return compareDeep(link, o.link, true) && compareDeep(requires, o.requires, true) && compareDeep(validates, o.validates, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptTestMetadataComponent)) + return false; + TestScriptTestMetadataComponent o = (TestScriptTestMetadataComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (link == null || link.isEmpty()) && (requires == null || requires.isEmpty()) + && (validates == null || validates.isEmpty()); + } + + } + + @Block() + public static class TestScriptTestMetadataLinkComponent extends BackboneElement implements IBaseBackboneElement { + /** + * URL to a particular requirement or feature within the FHIR specification. + */ + @Child(name = "url", type = {UriType.class}, order=1, min=1, max=1) + @Description(shortDefinition="URL to the specification", formalDefinition="URL to a particular requirement or feature within the FHIR specification." ) + protected UriType url; + + /** + * Short description of the link. + */ + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Short description", formalDefinition="Short description of the link." ) + protected StringType description; + + private static final long serialVersionUID = 213372298L; + + /* + * Constructor + */ + public TestScriptTestMetadataLinkComponent() { + super(); + } + + /* + * Constructor + */ + public TestScriptTestMetadataLinkComponent(UriType url) { + super(); + this.url = url; + } + + /** + * @return {@link #url} (URL to a particular requirement or feature within the FHIR specification.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTestMetadataLinkComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (URL to a particular requirement or feature within the FHIR specification.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public TestScriptTestMetadataLinkComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return URL to a particular requirement or feature within the FHIR specification. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value URL to a particular requirement or feature within the FHIR specification. + */ + public TestScriptTestMetadataLinkComponent setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + /** + * @return {@link #description} (Short description of the link.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTestMetadataLinkComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Short description of the link.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public TestScriptTestMetadataLinkComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Short description of the link. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Short description of the link. + */ + public TestScriptTestMetadataLinkComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "URL to a particular requirement or feature within the FHIR specification.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("description", "string", "Short description of the link.", 0, java.lang.Integer.MAX_VALUE, description)); + } + + public TestScriptTestMetadataLinkComponent copy() { + TestScriptTestMetadataLinkComponent dst = new TestScriptTestMetadataLinkComponent(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.description = description == null ? null : description.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptTestMetadataLinkComponent)) + return false; + TestScriptTestMetadataLinkComponent o = (TestScriptTestMetadataLinkComponent) other; + return compareDeep(url, o.url, true) && compareDeep(description, o.description, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptTestMetadataLinkComponent)) + return false; + TestScriptTestMetadataLinkComponent o = (TestScriptTestMetadataLinkComponent) other; + return compareValues(url, o.url, true) && compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (description == null || description.isEmpty()) + ; + } + + } + + @Block() + public static class TestScriptTestMetadataRequiresComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The resource type that the FHIR server must support. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Required resource type", formalDefinition="The resource type that the FHIR server must support." ) + protected CodeType type; + + /** + * The operations (comma-separated) that the FHIR server must support for the specified resource type. See TestOperationType. + */ + @Child(name = "operations", type = {StringType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Required operations", formalDefinition="The operations (comma-separated) that the FHIR server must support for the specified resource type. See TestOperationType." ) + protected StringType operations; + + /** + * Which server this requirement applies to. + */ + @Child(name = "destination", type = {IntegerType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Which server this requirement applies to", formalDefinition="Which server this requirement applies to." ) + protected IntegerType destination; + + private static final long serialVersionUID = 753954308L; + + /* + * Constructor + */ + public TestScriptTestMetadataRequiresComponent() { + super(); + } + + /* + * Constructor + */ + public TestScriptTestMetadataRequiresComponent(CodeType type, StringType operations) { + super(); + this.type = type; + this.operations = operations; + } + + /** + * @return {@link #type} (The resource type that the FHIR server must support.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public CodeType getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTestMetadataRequiresComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeType(); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The resource type that the FHIR server must support.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public TestScriptTestMetadataRequiresComponent setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return The resource type that the FHIR server must support. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The resource type that the FHIR server must support. + */ + public TestScriptTestMetadataRequiresComponent setType(String value) { + if (this.type == null) + this.type = new CodeType(); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #operations} (The operations (comma-separated) that the FHIR server must support for the specified resource type. See TestOperationType.). This is the underlying object with id, value and extensions. The accessor "getOperations" gives direct access to the value + */ + public StringType getOperationsElement() { + if (this.operations == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTestMetadataRequiresComponent.operations"); + else if (Configuration.doAutoCreate()) + this.operations = new StringType(); // bb + return this.operations; + } + + public boolean hasOperationsElement() { + return this.operations != null && !this.operations.isEmpty(); + } + + public boolean hasOperations() { + return this.operations != null && !this.operations.isEmpty(); + } + + /** + * @param value {@link #operations} (The operations (comma-separated) that the FHIR server must support for the specified resource type. See TestOperationType.). This is the underlying object with id, value and extensions. The accessor "getOperations" gives direct access to the value + */ + public TestScriptTestMetadataRequiresComponent setOperationsElement(StringType value) { + this.operations = value; + return this; + } + + /** + * @return The operations (comma-separated) that the FHIR server must support for the specified resource type. See TestOperationType. + */ + public String getOperations() { + return this.operations == null ? null : this.operations.getValue(); + } + + /** + * @param value The operations (comma-separated) that the FHIR server must support for the specified resource type. See TestOperationType. + */ + public TestScriptTestMetadataRequiresComponent setOperations(String value) { + if (this.operations == null) + this.operations = new StringType(); + this.operations.setValue(value); + return this; + } + + /** + * @return {@link #destination} (Which server this requirement applies to.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value + */ + public IntegerType getDestinationElement() { + if (this.destination == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTestMetadataRequiresComponent.destination"); + else if (Configuration.doAutoCreate()) + this.destination = new IntegerType(); // bb + return this.destination; + } + + public boolean hasDestinationElement() { + return this.destination != null && !this.destination.isEmpty(); + } + + public boolean hasDestination() { + return this.destination != null && !this.destination.isEmpty(); + } + + /** + * @param value {@link #destination} (Which server this requirement applies to.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value + */ + public TestScriptTestMetadataRequiresComponent setDestinationElement(IntegerType value) { + this.destination = value; + return this; + } + + /** + * @return Which server this requirement applies to. + */ + public int getDestination() { + return this.destination == null || this.destination.isEmpty() ? 0 : this.destination.getValue(); + } + + /** + * @param value Which server this requirement applies to. + */ + public TestScriptTestMetadataRequiresComponent setDestination(int value) { + if (this.destination == null) + this.destination = new IntegerType(); + this.destination.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "The resource type that the FHIR server must support.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("operations", "string", "The operations (comma-separated) that the FHIR server must support for the specified resource type. See TestOperationType.", 0, java.lang.Integer.MAX_VALUE, operations)); + childrenList.add(new Property("destination", "integer", "Which server this requirement applies to.", 0, java.lang.Integer.MAX_VALUE, destination)); + } + + public TestScriptTestMetadataRequiresComponent copy() { + TestScriptTestMetadataRequiresComponent dst = new TestScriptTestMetadataRequiresComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.operations = operations == null ? null : operations.copy(); + dst.destination = destination == null ? null : destination.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptTestMetadataRequiresComponent)) + return false; + TestScriptTestMetadataRequiresComponent o = (TestScriptTestMetadataRequiresComponent) other; + return compareDeep(type, o.type, true) && compareDeep(operations, o.operations, true) && compareDeep(destination, o.destination, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptTestMetadataRequiresComponent)) + return false; + TestScriptTestMetadataRequiresComponent o = (TestScriptTestMetadataRequiresComponent) other; + return compareValues(type, o.type, true) && compareValues(operations, o.operations, true) && compareValues(destination, o.destination, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (operations == null || operations.isEmpty()) + && (destination == null || destination.isEmpty()); + } + + } + + @Block() + public static class TestScriptTestMetadataValidatesComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The resource type that the FHIR server must support. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Verified resource type", formalDefinition="The resource type that the FHIR server must support." ) + protected CodeType type; + + /** + * The operations (comma-separated) that the FHIR server must support for the specified resource type. See TestOperationType. + */ + @Child(name = "operations", type = {StringType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Verified operations", formalDefinition="The operations (comma-separated) that the FHIR server must support for the specified resource type. See TestOperationType." ) + protected StringType operations; + + /** + * Which server this validation applies to. + */ + @Child(name = "destination", type = {IntegerType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Which server this validation applies to", formalDefinition="Which server this validation applies to." ) + protected IntegerType destination; + + private static final long serialVersionUID = 753954308L; + + /* + * Constructor + */ + public TestScriptTestMetadataValidatesComponent() { + super(); + } + + /* + * Constructor + */ + public TestScriptTestMetadataValidatesComponent(CodeType type, StringType operations) { + super(); + this.type = type; + this.operations = operations; + } + + /** + * @return {@link #type} (The resource type that the FHIR server must support.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public CodeType getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTestMetadataValidatesComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeType(); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The resource type that the FHIR server must support.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public TestScriptTestMetadataValidatesComponent setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return The resource type that the FHIR server must support. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The resource type that the FHIR server must support. + */ + public TestScriptTestMetadataValidatesComponent setType(String value) { + if (this.type == null) + this.type = new CodeType(); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #operations} (The operations (comma-separated) that the FHIR server must support for the specified resource type. See TestOperationType.). This is the underlying object with id, value and extensions. The accessor "getOperations" gives direct access to the value + */ + public StringType getOperationsElement() { + if (this.operations == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTestMetadataValidatesComponent.operations"); + else if (Configuration.doAutoCreate()) + this.operations = new StringType(); // bb + return this.operations; + } + + public boolean hasOperationsElement() { + return this.operations != null && !this.operations.isEmpty(); + } + + public boolean hasOperations() { + return this.operations != null && !this.operations.isEmpty(); + } + + /** + * @param value {@link #operations} (The operations (comma-separated) that the FHIR server must support for the specified resource type. See TestOperationType.). This is the underlying object with id, value and extensions. The accessor "getOperations" gives direct access to the value + */ + public TestScriptTestMetadataValidatesComponent setOperationsElement(StringType value) { + this.operations = value; + return this; + } + + /** + * @return The operations (comma-separated) that the FHIR server must support for the specified resource type. See TestOperationType. + */ + public String getOperations() { + return this.operations == null ? null : this.operations.getValue(); + } + + /** + * @param value The operations (comma-separated) that the FHIR server must support for the specified resource type. See TestOperationType. + */ + public TestScriptTestMetadataValidatesComponent setOperations(String value) { + if (this.operations == null) + this.operations = new StringType(); + this.operations.setValue(value); + return this; + } + + /** + * @return {@link #destination} (Which server this validation applies to.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value + */ + public IntegerType getDestinationElement() { + if (this.destination == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTestMetadataValidatesComponent.destination"); + else if (Configuration.doAutoCreate()) + this.destination = new IntegerType(); // bb + return this.destination; + } + + public boolean hasDestinationElement() { + return this.destination != null && !this.destination.isEmpty(); + } + + public boolean hasDestination() { + return this.destination != null && !this.destination.isEmpty(); + } + + /** + * @param value {@link #destination} (Which server this validation applies to.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value + */ + public TestScriptTestMetadataValidatesComponent setDestinationElement(IntegerType value) { + this.destination = value; + return this; + } + + /** + * @return Which server this validation applies to. + */ + public int getDestination() { + return this.destination == null || this.destination.isEmpty() ? 0 : this.destination.getValue(); + } + + /** + * @param value Which server this validation applies to. + */ + public TestScriptTestMetadataValidatesComponent setDestination(int value) { + if (this.destination == null) + this.destination = new IntegerType(); + this.destination.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "The resource type that the FHIR server must support.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("operations", "string", "The operations (comma-separated) that the FHIR server must support for the specified resource type. See TestOperationType.", 0, java.lang.Integer.MAX_VALUE, operations)); + childrenList.add(new Property("destination", "integer", "Which server this validation applies to.", 0, java.lang.Integer.MAX_VALUE, destination)); + } + + public TestScriptTestMetadataValidatesComponent copy() { + TestScriptTestMetadataValidatesComponent dst = new TestScriptTestMetadataValidatesComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.operations = operations == null ? null : operations.copy(); + dst.destination = destination == null ? null : destination.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptTestMetadataValidatesComponent)) + return false; + TestScriptTestMetadataValidatesComponent o = (TestScriptTestMetadataValidatesComponent) other; + return compareDeep(type, o.type, true) && compareDeep(operations, o.operations, true) && compareDeep(destination, o.destination, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptTestMetadataValidatesComponent)) + return false; + TestScriptTestMetadataValidatesComponent o = (TestScriptTestMetadataValidatesComponent) other; + return compareValues(type, o.type, true) && compareValues(operations, o.operations, true) && compareValues(destination, o.destination, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (operations == null || operations.isEmpty()) + && (destination == null || destination.isEmpty()); + } + + } + + @Block() + public static class TestScriptTestOperationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning", formalDefinition="read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning." ) + protected Enumeration type; + + /** + * The internal id of the fixture used as the body of any operation.type that results in a PUT or POST. + */ + @Child(name = "source", type = {IdType.class}, order=2, min=0, max=1) + @Description(shortDefinition="The id of the fixture used as the body in a PUT or POST", formalDefinition="The internal id of the fixture used as the body of any operation.type that results in a PUT or POST." ) + protected IdType source; + + /** + * The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET. + */ + @Child(name = "target", type = {IdType.class}, order=3, min=0, max=1) + @Description(shortDefinition="The id of the fixture used as the target of a PUT or POST, or the id of the fixture used to store the results of a GET", formalDefinition="The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET." ) + protected IdType target; + + /** + * Which server to perform the operation on. + */ + @Child(name = "destination", type = {IntegerType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Which server to perform the operation on", formalDefinition="Which server to perform the operation on." ) + protected IntegerType destination; + + /** + * Arguments to an operation. + */ + @Child(name = "parameter", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Arguments to an operation", formalDefinition="Arguments to an operation." ) + protected List parameter; + + /** + * The fixture id (maybe new) to map to the response. + */ + @Child(name = "responseId", type = {IdType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Response id", formalDefinition="The fixture id (maybe new) to map to the response." ) + protected IdType responseId; + + /** + * The content-type or mime-type to use for RESTful operation. + */ + @Child(name = "contentType", type = {CodeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="xml | json", formalDefinition="The content-type or mime-type to use for RESTful operation." ) + protected Enumeration contentType; + + private static final long serialVersionUID = -1217888318L; + + /* + * Constructor + */ + public TestScriptTestOperationComponent() { + super(); + } + + /* + * Constructor + */ + public TestScriptTestOperationComponent(Enumeration type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTestOperationComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new TestOperationCodesEnumFactory()); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public TestScriptTestOperationComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning. + */ + public TestOperationCodes getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning. + */ + public TestScriptTestOperationComponent setType(TestOperationCodes value) { + if (this.type == null) + this.type = new Enumeration(new TestOperationCodesEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #source} (The internal id of the fixture used as the body of any operation.type that results in a PUT or POST.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value + */ + public IdType getSourceElement() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTestOperationComponent.source"); + else if (Configuration.doAutoCreate()) + this.source = new IdType(); // bb + return this.source; + } + + public boolean hasSourceElement() { + return this.source != null && !this.source.isEmpty(); + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (The internal id of the fixture used as the body of any operation.type that results in a PUT or POST.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value + */ + public TestScriptTestOperationComponent setSourceElement(IdType value) { + this.source = value; + return this; + } + + /** + * @return The internal id of the fixture used as the body of any operation.type that results in a PUT or POST. + */ + public String getSource() { + return this.source == null ? null : this.source.getValue(); + } + + /** + * @param value The internal id of the fixture used as the body of any operation.type that results in a PUT or POST. + */ + public TestScriptTestOperationComponent setSource(String value) { + if (Utilities.noString(value)) + this.source = null; + else { + if (this.source == null) + this.source = new IdType(); + this.source.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET.). This is the underlying object with id, value and extensions. The accessor "getTarget" gives direct access to the value + */ + public IdType getTargetElement() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTestOperationComponent.target"); + else if (Configuration.doAutoCreate()) + this.target = new IdType(); // bb + return this.target; + } + + public boolean hasTargetElement() { + return this.target != null && !this.target.isEmpty(); + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET.). This is the underlying object with id, value and extensions. The accessor "getTarget" gives direct access to the value + */ + public TestScriptTestOperationComponent setTargetElement(IdType value) { + this.target = value; + return this; + } + + /** + * @return The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET. + */ + public String getTarget() { + return this.target == null ? null : this.target.getValue(); + } + + /** + * @param value The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET. + */ + public TestScriptTestOperationComponent setTarget(String value) { + if (Utilities.noString(value)) + this.target = null; + else { + if (this.target == null) + this.target = new IdType(); + this.target.setValue(value); + } + return this; + } + + /** + * @return {@link #destination} (Which server to perform the operation on.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value + */ + public IntegerType getDestinationElement() { + if (this.destination == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTestOperationComponent.destination"); + else if (Configuration.doAutoCreate()) + this.destination = new IntegerType(); // bb + return this.destination; + } + + public boolean hasDestinationElement() { + return this.destination != null && !this.destination.isEmpty(); + } + + public boolean hasDestination() { + return this.destination != null && !this.destination.isEmpty(); + } + + /** + * @param value {@link #destination} (Which server to perform the operation on.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value + */ + public TestScriptTestOperationComponent setDestinationElement(IntegerType value) { + this.destination = value; + return this; + } + + /** + * @return Which server to perform the operation on. + */ + public int getDestination() { + return this.destination == null || this.destination.isEmpty() ? 0 : this.destination.getValue(); + } + + /** + * @param value Which server to perform the operation on. + */ + public TestScriptTestOperationComponent setDestination(int value) { + if (this.destination == null) + this.destination = new IntegerType(); + this.destination.setValue(value); + return this; + } + + /** + * @return {@link #parameter} (Arguments to an operation.) + */ + public List getParameter() { + if (this.parameter == null) + this.parameter = new ArrayList(); + return this.parameter; + } + + public boolean hasParameter() { + if (this.parameter == null) + return false; + for (StringType item : this.parameter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #parameter} (Arguments to an operation.) + */ + // syntactic sugar + public StringType addParameterElement() {//2 + StringType t = new StringType(); + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return t; + } + + /** + * @param value {@link #parameter} (Arguments to an operation.) + */ + public TestScriptTestOperationComponent addParameter(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return this; + } + + /** + * @param value {@link #parameter} (Arguments to an operation.) + */ + public boolean hasParameter(String value) { + if (this.parameter == null) + return false; + for (StringType v : this.parameter) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #responseId} (The fixture id (maybe new) to map to the response.). This is the underlying object with id, value and extensions. The accessor "getResponseId" gives direct access to the value + */ + public IdType getResponseIdElement() { + if (this.responseId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTestOperationComponent.responseId"); + else if (Configuration.doAutoCreate()) + this.responseId = new IdType(); // bb + return this.responseId; + } + + public boolean hasResponseIdElement() { + return this.responseId != null && !this.responseId.isEmpty(); + } + + public boolean hasResponseId() { + return this.responseId != null && !this.responseId.isEmpty(); + } + + /** + * @param value {@link #responseId} (The fixture id (maybe new) to map to the response.). This is the underlying object with id, value and extensions. The accessor "getResponseId" gives direct access to the value + */ + public TestScriptTestOperationComponent setResponseIdElement(IdType value) { + this.responseId = value; + return this; + } + + /** + * @return The fixture id (maybe new) to map to the response. + */ + public String getResponseId() { + return this.responseId == null ? null : this.responseId.getValue(); + } + + /** + * @param value The fixture id (maybe new) to map to the response. + */ + public TestScriptTestOperationComponent setResponseId(String value) { + if (Utilities.noString(value)) + this.responseId = null; + else { + if (this.responseId == null) + this.responseId = new IdType(); + this.responseId.setValue(value); + } + return this; + } + + /** + * @return {@link #contentType} (The content-type or mime-type to use for RESTful operation.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public Enumeration getContentTypeElement() { + if (this.contentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTestOperationComponent.contentType"); + else if (Configuration.doAutoCreate()) + this.contentType = new Enumeration(new ContentTypeEnumFactory()); // bb + return this.contentType; + } + + public boolean hasContentTypeElement() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + public boolean hasContentType() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + /** + * @param value {@link #contentType} (The content-type or mime-type to use for RESTful operation.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public TestScriptTestOperationComponent setContentTypeElement(Enumeration value) { + this.contentType = value; + return this; + } + + /** + * @return The content-type or mime-type to use for RESTful operation. + */ + public ContentType getContentType() { + return this.contentType == null ? null : this.contentType.getValue(); + } + + /** + * @param value The content-type or mime-type to use for RESTful operation. + */ + public TestScriptTestOperationComponent setContentType(ContentType value) { + if (value == null) + this.contentType = null; + else { + if (this.contentType == null) + this.contentType = new Enumeration(new ContentTypeEnumFactory()); + this.contentType.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("source", "id", "The internal id of the fixture used as the body of any operation.type that results in a PUT or POST.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("target", "id", "The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("destination", "integer", "Which server to perform the operation on.", 0, java.lang.Integer.MAX_VALUE, destination)); + childrenList.add(new Property("parameter", "string", "Arguments to an operation.", 0, java.lang.Integer.MAX_VALUE, parameter)); + childrenList.add(new Property("responseId", "id", "The fixture id (maybe new) to map to the response.", 0, java.lang.Integer.MAX_VALUE, responseId)); + childrenList.add(new Property("contentType", "code", "The content-type or mime-type to use for RESTful operation.", 0, java.lang.Integer.MAX_VALUE, contentType)); + } + + public TestScriptTestOperationComponent copy() { + TestScriptTestOperationComponent dst = new TestScriptTestOperationComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.source = source == null ? null : source.copy(); + dst.target = target == null ? null : target.copy(); + dst.destination = destination == null ? null : destination.copy(); + if (parameter != null) { + dst.parameter = new ArrayList(); + for (StringType i : parameter) + dst.parameter.add(i.copy()); + }; + dst.responseId = responseId == null ? null : responseId.copy(); + dst.contentType = contentType == null ? null : contentType.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptTestOperationComponent)) + return false; + TestScriptTestOperationComponent o = (TestScriptTestOperationComponent) other; + return compareDeep(type, o.type, true) && compareDeep(source, o.source, true) && compareDeep(target, o.target, true) + && compareDeep(destination, o.destination, true) && compareDeep(parameter, o.parameter, true) && compareDeep(responseId, o.responseId, true) + && compareDeep(contentType, o.contentType, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptTestOperationComponent)) + return false; + TestScriptTestOperationComponent o = (TestScriptTestOperationComponent) other; + return compareValues(type, o.type, true) && compareValues(source, o.source, true) && compareValues(target, o.target, true) + && compareValues(destination, o.destination, true) && compareValues(parameter, o.parameter, true) && compareValues(responseId, o.responseId, true) + && compareValues(contentType, o.contentType, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (source == null || source.isEmpty()) + && (target == null || target.isEmpty()) && (destination == null || destination.isEmpty()) + && (parameter == null || parameter.isEmpty()) && (responseId == null || responseId.isEmpty()) + && (contentType == null || contentType.isEmpty()); + } + + } + + @Block() + public static class TestScriptTeardownComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A teardown operation. + */ + @Child(name = "operation", type = {}, order=1, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A teardown operation", formalDefinition="A teardown operation." ) + protected List operation; + + private static final long serialVersionUID = -1832198026L; + + /* + * Constructor + */ + public TestScriptTeardownComponent() { + super(); + } + + /** + * @return {@link #operation} (A teardown operation.) + */ + public List getOperation() { + if (this.operation == null) + this.operation = new ArrayList(); + return this.operation; + } + + public boolean hasOperation() { + if (this.operation == null) + return false; + for (TestScriptTeardownOperationComponent item : this.operation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #operation} (A teardown operation.) + */ + // syntactic sugar + public TestScriptTeardownOperationComponent addOperation() { //3 + TestScriptTeardownOperationComponent t = new TestScriptTeardownOperationComponent(); + if (this.operation == null) + this.operation = new ArrayList(); + this.operation.add(t); + return t; + } + + // syntactic sugar + public TestScriptTeardownComponent addOperation(TestScriptTeardownOperationComponent t) { //3 + if (t == null) + return this; + if (this.operation == null) + this.operation = new ArrayList(); + this.operation.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("operation", "", "A teardown operation.", 0, java.lang.Integer.MAX_VALUE, operation)); + } + + public TestScriptTeardownComponent copy() { + TestScriptTeardownComponent dst = new TestScriptTeardownComponent(); + copyValues(dst); + if (operation != null) { + dst.operation = new ArrayList(); + for (TestScriptTeardownOperationComponent i : operation) + dst.operation.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptTeardownComponent)) + return false; + TestScriptTeardownComponent o = (TestScriptTeardownComponent) other; + return compareDeep(operation, o.operation, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptTeardownComponent)) + return false; + TestScriptTeardownComponent o = (TestScriptTeardownComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (operation == null || operation.isEmpty()); + } + + } + + @Block() + public static class TestScriptTeardownOperationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning", formalDefinition="read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning." ) + protected Enumeration type; + + /** + * The internal id of the fixture used as the body of any operation.type that results in a PUT or POST. + */ + @Child(name = "source", type = {IdType.class}, order=2, min=0, max=1) + @Description(shortDefinition="The id of the fixture used as the body in a PUT or POST", formalDefinition="The internal id of the fixture used as the body of any operation.type that results in a PUT or POST." ) + protected IdType source; + + /** + * The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET. + */ + @Child(name = "target", type = {IdType.class}, order=3, min=0, max=1) + @Description(shortDefinition="The id of the fixture used as the target of a PUT or POST, or the id of the fixture used to store the results of a GET", formalDefinition="The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET." ) + protected IdType target; + + /** + * Which server to perform the operation on. + */ + @Child(name = "destination", type = {IntegerType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Which server to perform the operation on", formalDefinition="Which server to perform the operation on." ) + protected IntegerType destination; + + /** + * Arguments to an operation. + */ + @Child(name = "parameter", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Arguments to an operation", formalDefinition="Arguments to an operation." ) + protected List parameter; + + /** + * The fixture id (maybe new) to map to the response. + */ + @Child(name = "responseId", type = {IdType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Response id", formalDefinition="The fixture id (maybe new) to map to the response." ) + protected IdType responseId; + + /** + * The content-type or mime-type to use for RESTful operation. + */ + @Child(name = "contentType", type = {CodeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="xml | json", formalDefinition="The content-type or mime-type to use for RESTful operation." ) + protected Enumeration contentType; + + private static final long serialVersionUID = -1217888318L; + + /* + * Constructor + */ + public TestScriptTeardownOperationComponent() { + super(); + } + + /* + * Constructor + */ + public TestScriptTeardownOperationComponent(Enumeration type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTeardownOperationComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new TestOperationCodesEnumFactory()); // bb + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public TestScriptTeardownOperationComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning. + */ + public TestOperationCodes getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning. + */ + public TestScriptTeardownOperationComponent setType(TestOperationCodes value) { + if (this.type == null) + this.type = new Enumeration(new TestOperationCodesEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #source} (The internal id of the fixture used as the body of any operation.type that results in a PUT or POST.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value + */ + public IdType getSourceElement() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTeardownOperationComponent.source"); + else if (Configuration.doAutoCreate()) + this.source = new IdType(); // bb + return this.source; + } + + public boolean hasSourceElement() { + return this.source != null && !this.source.isEmpty(); + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (The internal id of the fixture used as the body of any operation.type that results in a PUT or POST.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value + */ + public TestScriptTeardownOperationComponent setSourceElement(IdType value) { + this.source = value; + return this; + } + + /** + * @return The internal id of the fixture used as the body of any operation.type that results in a PUT or POST. + */ + public String getSource() { + return this.source == null ? null : this.source.getValue(); + } + + /** + * @param value The internal id of the fixture used as the body of any operation.type that results in a PUT or POST. + */ + public TestScriptTeardownOperationComponent setSource(String value) { + if (Utilities.noString(value)) + this.source = null; + else { + if (this.source == null) + this.source = new IdType(); + this.source.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET.). This is the underlying object with id, value and extensions. The accessor "getTarget" gives direct access to the value + */ + public IdType getTargetElement() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTeardownOperationComponent.target"); + else if (Configuration.doAutoCreate()) + this.target = new IdType(); // bb + return this.target; + } + + public boolean hasTargetElement() { + return this.target != null && !this.target.isEmpty(); + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET.). This is the underlying object with id, value and extensions. The accessor "getTarget" gives direct access to the value + */ + public TestScriptTeardownOperationComponent setTargetElement(IdType value) { + this.target = value; + return this; + } + + /** + * @return The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET. + */ + public String getTarget() { + return this.target == null ? null : this.target.getValue(); + } + + /** + * @param value The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET. + */ + public TestScriptTeardownOperationComponent setTarget(String value) { + if (Utilities.noString(value)) + this.target = null; + else { + if (this.target == null) + this.target = new IdType(); + this.target.setValue(value); + } + return this; + } + + /** + * @return {@link #destination} (Which server to perform the operation on.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value + */ + public IntegerType getDestinationElement() { + if (this.destination == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTeardownOperationComponent.destination"); + else if (Configuration.doAutoCreate()) + this.destination = new IntegerType(); // bb + return this.destination; + } + + public boolean hasDestinationElement() { + return this.destination != null && !this.destination.isEmpty(); + } + + public boolean hasDestination() { + return this.destination != null && !this.destination.isEmpty(); + } + + /** + * @param value {@link #destination} (Which server to perform the operation on.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value + */ + public TestScriptTeardownOperationComponent setDestinationElement(IntegerType value) { + this.destination = value; + return this; + } + + /** + * @return Which server to perform the operation on. + */ + public int getDestination() { + return this.destination == null || this.destination.isEmpty() ? 0 : this.destination.getValue(); + } + + /** + * @param value Which server to perform the operation on. + */ + public TestScriptTeardownOperationComponent setDestination(int value) { + if (this.destination == null) + this.destination = new IntegerType(); + this.destination.setValue(value); + return this; + } + + /** + * @return {@link #parameter} (Arguments to an operation.) + */ + public List getParameter() { + if (this.parameter == null) + this.parameter = new ArrayList(); + return this.parameter; + } + + public boolean hasParameter() { + if (this.parameter == null) + return false; + for (StringType item : this.parameter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #parameter} (Arguments to an operation.) + */ + // syntactic sugar + public StringType addParameterElement() {//2 + StringType t = new StringType(); + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return t; + } + + /** + * @param value {@link #parameter} (Arguments to an operation.) + */ + public TestScriptTeardownOperationComponent addParameter(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return this; + } + + /** + * @param value {@link #parameter} (Arguments to an operation.) + */ + public boolean hasParameter(String value) { + if (this.parameter == null) + return false; + for (StringType v : this.parameter) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #responseId} (The fixture id (maybe new) to map to the response.). This is the underlying object with id, value and extensions. The accessor "getResponseId" gives direct access to the value + */ + public IdType getResponseIdElement() { + if (this.responseId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTeardownOperationComponent.responseId"); + else if (Configuration.doAutoCreate()) + this.responseId = new IdType(); // bb + return this.responseId; + } + + public boolean hasResponseIdElement() { + return this.responseId != null && !this.responseId.isEmpty(); + } + + public boolean hasResponseId() { + return this.responseId != null && !this.responseId.isEmpty(); + } + + /** + * @param value {@link #responseId} (The fixture id (maybe new) to map to the response.). This is the underlying object with id, value and extensions. The accessor "getResponseId" gives direct access to the value + */ + public TestScriptTeardownOperationComponent setResponseIdElement(IdType value) { + this.responseId = value; + return this; + } + + /** + * @return The fixture id (maybe new) to map to the response. + */ + public String getResponseId() { + return this.responseId == null ? null : this.responseId.getValue(); + } + + /** + * @param value The fixture id (maybe new) to map to the response. + */ + public TestScriptTeardownOperationComponent setResponseId(String value) { + if (Utilities.noString(value)) + this.responseId = null; + else { + if (this.responseId == null) + this.responseId = new IdType(); + this.responseId.setValue(value); + } + return this; + } + + /** + * @return {@link #contentType} (The content-type or mime-type to use for RESTful operation.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public Enumeration getContentTypeElement() { + if (this.contentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTeardownOperationComponent.contentType"); + else if (Configuration.doAutoCreate()) + this.contentType = new Enumeration(new ContentTypeEnumFactory()); // bb + return this.contentType; + } + + public boolean hasContentTypeElement() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + public boolean hasContentType() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + /** + * @param value {@link #contentType} (The content-type or mime-type to use for RESTful operation.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public TestScriptTeardownOperationComponent setContentTypeElement(Enumeration value) { + this.contentType = value; + return this; + } + + /** + * @return The content-type or mime-type to use for RESTful operation. + */ + public ContentType getContentType() { + return this.contentType == null ? null : this.contentType.getValue(); + } + + /** + * @param value The content-type or mime-type to use for RESTful operation. + */ + public TestScriptTeardownOperationComponent setContentType(ContentType value) { + if (value == null) + this.contentType = null; + else { + if (this.contentType == null) + this.contentType = new Enumeration(new ContentTypeEnumFactory()); + this.contentType.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("source", "id", "The internal id of the fixture used as the body of any operation.type that results in a PUT or POST.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("target", "id", "The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("destination", "integer", "Which server to perform the operation on.", 0, java.lang.Integer.MAX_VALUE, destination)); + childrenList.add(new Property("parameter", "string", "Arguments to an operation.", 0, java.lang.Integer.MAX_VALUE, parameter)); + childrenList.add(new Property("responseId", "id", "The fixture id (maybe new) to map to the response.", 0, java.lang.Integer.MAX_VALUE, responseId)); + childrenList.add(new Property("contentType", "code", "The content-type or mime-type to use for RESTful operation.", 0, java.lang.Integer.MAX_VALUE, contentType)); + } + + public TestScriptTeardownOperationComponent copy() { + TestScriptTeardownOperationComponent dst = new TestScriptTeardownOperationComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.source = source == null ? null : source.copy(); + dst.target = target == null ? null : target.copy(); + dst.destination = destination == null ? null : destination.copy(); + if (parameter != null) { + dst.parameter = new ArrayList(); + for (StringType i : parameter) + dst.parameter.add(i.copy()); + }; + dst.responseId = responseId == null ? null : responseId.copy(); + dst.contentType = contentType == null ? null : contentType.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptTeardownOperationComponent)) + return false; + TestScriptTeardownOperationComponent o = (TestScriptTeardownOperationComponent) other; + return compareDeep(type, o.type, true) && compareDeep(source, o.source, true) && compareDeep(target, o.target, true) + && compareDeep(destination, o.destination, true) && compareDeep(parameter, o.parameter, true) && compareDeep(responseId, o.responseId, true) + && compareDeep(contentType, o.contentType, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptTeardownOperationComponent)) + return false; + TestScriptTeardownOperationComponent o = (TestScriptTeardownOperationComponent) other; + return compareValues(type, o.type, true) && compareValues(source, o.source, true) && compareValues(target, o.target, true) + && compareValues(destination, o.destination, true) && compareValues(parameter, o.parameter, true) && compareValues(responseId, o.responseId, true) + && compareValues(contentType, o.contentType, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (source == null || source.isEmpty()) + && (target == null || target.isEmpty()) && (destination == null || destination.isEmpty()) + && (parameter == null || parameter.isEmpty()) && (responseId == null || responseId.isEmpty()) + && (contentType == null || contentType.isEmpty()); + } + + } + + /** + * Name of the Test Script. + */ + @Child(name = "name", type = {StringType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Name", formalDefinition="Name of the Test Script." ) + protected StringType name; + + /** + * Description of the Test Script. + */ + @Child(name = "description", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Short description", formalDefinition="Description of the Test Script." ) + protected StringType description; + + /** + * If the tests apply to more than one FHIR server (e.g. cross-server interoperability tests) then multiserver=true. Defaults or missing values to false. + */ + @Child(name = "multiserver", type = {BooleanType.class}, order=2, min=0, max=1) + @Description(shortDefinition="If the tests apply to more than one FHIR server", formalDefinition="If the tests apply to more than one FHIR server (e.g. cross-server interoperability tests) then multiserver=true. Defaults or missing values to false." ) + protected BooleanType multiserver; + + /** + * Fixture in the test script - either by reference (uri) or embedded (Resource). All fixtures are required for the test script to execute. + */ + @Child(name = "fixture", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Fixture in the test script - either by reference (uri) or embedded (Resource)", formalDefinition="Fixture in the test script - either by reference (uri) or embedded (Resource). All fixtures are required for the test script to execute." ) + protected List fixture; + + /** + * A series of required setup operations before tests are executed. + */ + @Child(name = "setup", type = {}, order=4, min=0, max=1) + @Description(shortDefinition="A series of required setup operations before tests are executed", formalDefinition="A series of required setup operations before tests are executed." ) + protected TestScriptSetupComponent setup; + + /** + * A test in this script. + */ + @Child(name = "test", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A test in this script", formalDefinition="A test in this script." ) + protected List test; + + /** + * A series of operations required to clean up after the all the tests are executed (successfully or otherwise). + */ + @Child(name = "teardown", type = {}, order=6, min=0, max=1) + @Description(shortDefinition="A series of required clean up steps", formalDefinition="A series of operations required to clean up after the all the tests are executed (successfully or otherwise)." ) + protected TestScriptTeardownComponent teardown; + + private static final long serialVersionUID = 334757467L; + + /* + * Constructor + */ + public TestScript() { + super(); + } + + /** + * @return {@link #name} (Name of the Test Script.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScript.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (Name of the Test Script.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public TestScript setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Name of the Test Script. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Name of the Test Script. + */ + public TestScript setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (Description of the Test Script.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScript.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Description of the Test Script.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public TestScript setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Description of the Test Script. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Description of the Test Script. + */ + public TestScript setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #multiserver} (If the tests apply to more than one FHIR server (e.g. cross-server interoperability tests) then multiserver=true. Defaults or missing values to false.). This is the underlying object with id, value and extensions. The accessor "getMultiserver" gives direct access to the value + */ + public BooleanType getMultiserverElement() { + if (this.multiserver == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScript.multiserver"); + else if (Configuration.doAutoCreate()) + this.multiserver = new BooleanType(); // bb + return this.multiserver; + } + + public boolean hasMultiserverElement() { + return this.multiserver != null && !this.multiserver.isEmpty(); + } + + public boolean hasMultiserver() { + return this.multiserver != null && !this.multiserver.isEmpty(); + } + + /** + * @param value {@link #multiserver} (If the tests apply to more than one FHIR server (e.g. cross-server interoperability tests) then multiserver=true. Defaults or missing values to false.). This is the underlying object with id, value and extensions. The accessor "getMultiserver" gives direct access to the value + */ + public TestScript setMultiserverElement(BooleanType value) { + this.multiserver = value; + return this; + } + + /** + * @return If the tests apply to more than one FHIR server (e.g. cross-server interoperability tests) then multiserver=true. Defaults or missing values to false. + */ + public boolean getMultiserver() { + return this.multiserver == null || this.multiserver.isEmpty() ? false : this.multiserver.getValue(); + } + + /** + * @param value If the tests apply to more than one FHIR server (e.g. cross-server interoperability tests) then multiserver=true. Defaults or missing values to false. + */ + public TestScript setMultiserver(boolean value) { + if (this.multiserver == null) + this.multiserver = new BooleanType(); + this.multiserver.setValue(value); + return this; + } + + /** + * @return {@link #fixture} (Fixture in the test script - either by reference (uri) or embedded (Resource). All fixtures are required for the test script to execute.) + */ + public List getFixture() { + if (this.fixture == null) + this.fixture = new ArrayList(); + return this.fixture; + } + + public boolean hasFixture() { + if (this.fixture == null) + return false; + for (TestScriptFixtureComponent item : this.fixture) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #fixture} (Fixture in the test script - either by reference (uri) or embedded (Resource). All fixtures are required for the test script to execute.) + */ + // syntactic sugar + public TestScriptFixtureComponent addFixture() { //3 + TestScriptFixtureComponent t = new TestScriptFixtureComponent(); + if (this.fixture == null) + this.fixture = new ArrayList(); + this.fixture.add(t); + return t; + } + + // syntactic sugar + public TestScript addFixture(TestScriptFixtureComponent t) { //3 + if (t == null) + return this; + if (this.fixture == null) + this.fixture = new ArrayList(); + this.fixture.add(t); + return this; + } + + /** + * @return {@link #setup} (A series of required setup operations before tests are executed.) + */ + public TestScriptSetupComponent getSetup() { + if (this.setup == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScript.setup"); + else if (Configuration.doAutoCreate()) + this.setup = new TestScriptSetupComponent(); // cc + return this.setup; + } + + public boolean hasSetup() { + return this.setup != null && !this.setup.isEmpty(); + } + + /** + * @param value {@link #setup} (A series of required setup operations before tests are executed.) + */ + public TestScript setSetup(TestScriptSetupComponent value) { + this.setup = value; + return this; + } + + /** + * @return {@link #test} (A test in this script.) + */ + public List getTest() { + if (this.test == null) + this.test = new ArrayList(); + return this.test; + } + + public boolean hasTest() { + if (this.test == null) + return false; + for (TestScriptTestComponent item : this.test) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #test} (A test in this script.) + */ + // syntactic sugar + public TestScriptTestComponent addTest() { //3 + TestScriptTestComponent t = new TestScriptTestComponent(); + if (this.test == null) + this.test = new ArrayList(); + this.test.add(t); + return t; + } + + // syntactic sugar + public TestScript addTest(TestScriptTestComponent t) { //3 + if (t == null) + return this; + if (this.test == null) + this.test = new ArrayList(); + this.test.add(t); + return this; + } + + /** + * @return {@link #teardown} (A series of operations required to clean up after the all the tests are executed (successfully or otherwise).) + */ + public TestScriptTeardownComponent getTeardown() { + if (this.teardown == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScript.teardown"); + else if (Configuration.doAutoCreate()) + this.teardown = new TestScriptTeardownComponent(); // cc + return this.teardown; + } + + public boolean hasTeardown() { + return this.teardown != null && !this.teardown.isEmpty(); + } + + /** + * @param value {@link #teardown} (A series of operations required to clean up after the all the tests are executed (successfully or otherwise).) + */ + public TestScript setTeardown(TestScriptTeardownComponent value) { + this.teardown = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "Name of the Test Script.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("description", "string", "Description of the Test Script.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("multiserver", "boolean", "If the tests apply to more than one FHIR server (e.g. cross-server interoperability tests) then multiserver=true. Defaults or missing values to false.", 0, java.lang.Integer.MAX_VALUE, multiserver)); + childrenList.add(new Property("fixture", "", "Fixture in the test script - either by reference (uri) or embedded (Resource). All fixtures are required for the test script to execute.", 0, java.lang.Integer.MAX_VALUE, fixture)); + childrenList.add(new Property("setup", "", "A series of required setup operations before tests are executed.", 0, java.lang.Integer.MAX_VALUE, setup)); + childrenList.add(new Property("test", "", "A test in this script.", 0, java.lang.Integer.MAX_VALUE, test)); + childrenList.add(new Property("teardown", "", "A series of operations required to clean up after the all the tests are executed (successfully or otherwise).", 0, java.lang.Integer.MAX_VALUE, teardown)); + } + + public TestScript copy() { + TestScript dst = new TestScript(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.description = description == null ? null : description.copy(); + dst.multiserver = multiserver == null ? null : multiserver.copy(); + if (fixture != null) { + dst.fixture = new ArrayList(); + for (TestScriptFixtureComponent i : fixture) + dst.fixture.add(i.copy()); + }; + dst.setup = setup == null ? null : setup.copy(); + if (test != null) { + dst.test = new ArrayList(); + for (TestScriptTestComponent i : test) + dst.test.add(i.copy()); + }; + dst.teardown = teardown == null ? null : teardown.copy(); + return dst; + } + + protected TestScript typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScript)) + return false; + TestScript o = (TestScript) other; + return compareDeep(name, o.name, true) && compareDeep(description, o.description, true) && compareDeep(multiserver, o.multiserver, true) + && compareDeep(fixture, o.fixture, true) && compareDeep(setup, o.setup, true) && compareDeep(test, o.test, true) + && compareDeep(teardown, o.teardown, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScript)) + return false; + TestScript o = (TestScript) other; + return compareValues(name, o.name, true) && compareValues(description, o.description, true) && compareValues(multiserver, o.multiserver, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (description == null || description.isEmpty()) + && (multiserver == null || multiserver.isEmpty()) && (fixture == null || fixture.isEmpty()) + && (setup == null || setup.isEmpty()) && (test == null || test.isEmpty()) && (teardown == null || teardown.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.TestScript; + } + + @SearchParamDefinition(name="validates-operations", path="TestScript.test.metadata.validates.operations", description="Test that validates the server supports certain TestOpertionType operations.", type="string" ) + public static final String SP_VALIDATESOPERATIONS = "validates-operations"; + @SearchParamDefinition(name="validates-type", path="TestScript.test.metadata.validates.type", description="Test that validates the server supports a certain Resource type.", type="string" ) + public static final String SP_VALIDATESTYPE = "validates-type"; + @SearchParamDefinition(name="requires-type", path="TestScript.test.metadata.requires.type", description="Test that requires the server supports a certain Resource type.", type="string" ) + public static final String SP_REQUIRESTYPE = "requires-type"; + @SearchParamDefinition(name="name", path="TestScript.name", description="TestScript name", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="description", path="TestScript.description", description="TestScript description", type="string" ) + public static final String SP_DESCRIPTION = "description"; + @SearchParamDefinition(name="requires-operations", path="TestScript.test.metadata.requires.operations", description="Test that requires the server supports certain TestOpertionType operations.", type="string" ) + public static final String SP_REQUIRESOPERATIONS = "requires-operations"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/TimeType.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/TimeType.java index 7ad000cb0c7..0ab9c9d254f 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/TimeType.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/TimeType.java @@ -1,93 +1,72 @@ -/* -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; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import org.hl7.fhir.instance.model.annotations.DatatypeDef; - -/** - * Represents a Time datatype, per the FHIR specification. A time is a specification of hours and minutes (and optionally milliseconds), with NO date and NO timezone information attached. It is - * expressed as a string in the form HH:mm:ss[.SSSS] - */ -@DatatypeDef(name="time") -public class TimeType extends PrimitiveType { - - private static final long serialVersionUID = 3L; - - /** - * Constructor - */ - public TimeType() { - // nothing - } - - /** - * Constructor - */ - public TimeType(String theValue) { - setValue(theValue); - } - - @Override - protected String parse(String theValue) { - return theValue; - } - - @Override - protected String encode(String theValue) { - return theValue; - } - - @Override - public TimeType copy() { - return new TimeType(getValue()); - } - -} +/* +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; + +import org.hl7.fhir.instance.model.annotations.DatatypeDef; + +/** + * Represents a Time datatype, per the FHIR specification. A time is a specification of hours and minutes (and optionally milliseconds), with NO date and NO timezone information attached. It is + * expressed as a string in the form HH:mm:ss[.SSSS] + */ +@DatatypeDef(name="time") +public class TimeType extends PrimitiveType { + + private static final long serialVersionUID = 3L; + + /** + * Constructor + */ + public TimeType() { + // nothing + } + + /** + * Constructor + */ + public TimeType(String theValue) { + setValue(theValue); + } + + @Override + protected String parse(String theValue) { + return theValue; + } + + @Override + protected String encode(String theValue) { + return theValue; + } + + @Override + public TimeType copy() { + return new TimeType(getValue()); + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Timing.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Timing.java index b78d50b9e85..963457529c9 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Timing.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Timing.java @@ -1,1236 +1,1215 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import java.util.*; - -import java.math.*; -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; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds. - */ -@DatatypeDef(name="Timing") -public class Timing extends Type implements ICompositeType { - - public enum UnitsOfTime { - /** - * second. - */ - S, - /** - * minute. - */ - MIN, - /** - * hour. - */ - H, - /** - * day. - */ - D, - /** - * week. - */ - WK, - /** - * month. - */ - MO, - /** - * year. - */ - A, - /** - * added to help the parsers - */ - NULL; - public static UnitsOfTime fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("s".equals(codeString)) - return S; - if ("min".equals(codeString)) - return MIN; - if ("h".equals(codeString)) - return H; - if ("d".equals(codeString)) - return D; - if ("wk".equals(codeString)) - return WK; - if ("mo".equals(codeString)) - return MO; - if ("a".equals(codeString)) - return A; - throw new Exception("Unknown UnitsOfTime code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case S: return "s"; - case MIN: return "min"; - case H: return "h"; - case D: return "d"; - case WK: return "wk"; - case MO: return "mo"; - case A: return "a"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case S: return "http://unitsofmeasure.org"; - case MIN: return "http://unitsofmeasure.org"; - case H: return "http://unitsofmeasure.org"; - case D: return "http://unitsofmeasure.org"; - case WK: return "http://unitsofmeasure.org"; - case MO: return "http://unitsofmeasure.org"; - case A: return "http://unitsofmeasure.org"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case S: return "second."; - case MIN: return "minute."; - case H: return "hour."; - case D: return "day."; - case WK: return "week."; - case MO: return "month."; - case A: return "year."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case S: return "S"; - case MIN: return "Min"; - case H: return "H"; - case D: return "D"; - case WK: return "Wk"; - case MO: return "Mo"; - case A: return "A"; - default: return "?"; - } - } - } - - public static class UnitsOfTimeEnumFactory implements EnumFactory { - public UnitsOfTime fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("s".equals(codeString)) - return UnitsOfTime.S; - if ("min".equals(codeString)) - return UnitsOfTime.MIN; - if ("h".equals(codeString)) - return UnitsOfTime.H; - if ("d".equals(codeString)) - return UnitsOfTime.D; - if ("wk".equals(codeString)) - return UnitsOfTime.WK; - if ("mo".equals(codeString)) - return UnitsOfTime.MO; - if ("a".equals(codeString)) - return UnitsOfTime.A; - throw new IllegalArgumentException("Unknown UnitsOfTime code '"+codeString+"'"); - } - public String toCode(UnitsOfTime code) { - if (code == UnitsOfTime.S) - return "s"; - if (code == UnitsOfTime.MIN) - return "min"; - if (code == UnitsOfTime.H) - return "h"; - if (code == UnitsOfTime.D) - return "d"; - if (code == UnitsOfTime.WK) - return "wk"; - if (code == UnitsOfTime.MO) - return "mo"; - if (code == UnitsOfTime.A) - return "a"; - return "?"; - } - } - - public enum EventTiming { - /** - * event occurs [duration] before the hour of sleep (or trying to). - */ - HS, - /** - * event occurs [duration] after waking. - */ - WAKE, - /** - * event occurs at a meal (from the Latin cibus). - */ - C, - /** - * event occurs at breakfast (from the Latin cibus matutinus). - */ - CM, - /** - * event occurs at lunch (from the Latin cibus diurnus). - */ - CD, - /** - * event occurs at dinner (from the Latin ante cibus vespertinus). - */ - CV, - /** - * event occurs [duration] before a meal (from the Latin ante cibus). - */ - AC, - /** - * event occurs [duration] before breakfast (from the Latin ante cibus matutinus). - */ - ACM, - /** - * event occurs [duration] before lunch (from the Latin ante cibus diurnus). - */ - ACD, - /** - * event occurs [duration] before dinner (from the Latin ante cibus vespertinus). - */ - ACV, - /** - * event occurs [duration] after a meal (from the Latin post cibus). - */ - PC, - /** - * event occurs [duration] after breakfast (from the Latin post cibus matutinus). - */ - PCM, - /** - * event occurs [duration] after lunch (from the Latin post cibus diurnus). - */ - PCD, - /** - * event occurs [duration] after dinner (from the Latin post cibus vespertinus). - */ - PCV, - /** - * added to help the parsers - */ - NULL; - public static EventTiming fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("HS".equals(codeString)) - return HS; - if ("WAKE".equals(codeString)) - return WAKE; - if ("C".equals(codeString)) - return C; - if ("CM".equals(codeString)) - return CM; - if ("CD".equals(codeString)) - return CD; - if ("CV".equals(codeString)) - return CV; - if ("AC".equals(codeString)) - return AC; - if ("ACM".equals(codeString)) - return ACM; - if ("ACD".equals(codeString)) - return ACD; - if ("ACV".equals(codeString)) - return ACV; - if ("PC".equals(codeString)) - return PC; - if ("PCM".equals(codeString)) - return PCM; - if ("PCD".equals(codeString)) - return PCD; - if ("PCV".equals(codeString)) - return PCV; - throw new Exception("Unknown EventTiming code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case HS: return "HS"; - case WAKE: return "WAKE"; - case C: return "C"; - case CM: return "CM"; - case CD: return "CD"; - case CV: return "CV"; - case AC: return "AC"; - case ACM: return "ACM"; - case ACD: return "ACD"; - case ACV: return "ACV"; - case PC: return "PC"; - case PCM: return "PCM"; - case PCD: return "PCD"; - case PCV: return "PCV"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case HS: return "http://hl7.org/fhir/v3/TimingEvent"; - case WAKE: return "http://hl7.org/fhir/v3/TimingEvent"; - case C: return "http://hl7.org/fhir/v3/TimingEvent"; - case CM: return "http://hl7.org/fhir/v3/TimingEvent"; - case CD: return "http://hl7.org/fhir/v3/TimingEvent"; - case CV: return "http://hl7.org/fhir/v3/TimingEvent"; - case AC: return "http://hl7.org/fhir/v3/TimingEvent"; - case ACM: return "http://hl7.org/fhir/v3/TimingEvent"; - case ACD: return "http://hl7.org/fhir/v3/TimingEvent"; - case ACV: return "http://hl7.org/fhir/v3/TimingEvent"; - case PC: return "http://hl7.org/fhir/v3/TimingEvent"; - case PCM: return "http://hl7.org/fhir/v3/TimingEvent"; - case PCD: return "http://hl7.org/fhir/v3/TimingEvent"; - case PCV: return "http://hl7.org/fhir/v3/TimingEvent"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case HS: return "event occurs [duration] before the hour of sleep (or trying to)."; - case WAKE: return "event occurs [duration] after waking."; - case C: return "event occurs at a meal (from the Latin cibus)."; - case CM: return "event occurs at breakfast (from the Latin cibus matutinus)."; - case CD: return "event occurs at lunch (from the Latin cibus diurnus)."; - case CV: return "event occurs at dinner (from the Latin ante cibus vespertinus)."; - case AC: return "event occurs [duration] before a meal (from the Latin ante cibus)."; - case ACM: return "event occurs [duration] before breakfast (from the Latin ante cibus matutinus)."; - case ACD: return "event occurs [duration] before lunch (from the Latin ante cibus diurnus)."; - case ACV: return "event occurs [duration] before dinner (from the Latin ante cibus vespertinus)."; - case PC: return "event occurs [duration] after a meal (from the Latin post cibus)."; - case PCM: return "event occurs [duration] after breakfast (from the Latin post cibus matutinus)."; - case PCD: return "event occurs [duration] after lunch (from the Latin post cibus diurnus)."; - case PCV: return "event occurs [duration] after dinner (from the Latin post cibus vespertinus)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case HS: return "H S"; - case WAKE: return "W A K E"; - case C: return "C"; - case CM: return "C M"; - case CD: return "C D"; - case CV: return "C V"; - case AC: return "A C"; - case ACM: return "A C M"; - case ACD: return "A C D"; - case ACV: return "A C V"; - case PC: return "P C"; - case PCM: return "P C M"; - case PCD: return "P C D"; - case PCV: return "P C V"; - default: return "?"; - } - } - } - - public static class EventTimingEnumFactory implements EnumFactory { - public EventTiming fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("HS".equals(codeString)) - return EventTiming.HS; - if ("WAKE".equals(codeString)) - return EventTiming.WAKE; - if ("C".equals(codeString)) - return EventTiming.C; - if ("CM".equals(codeString)) - return EventTiming.CM; - if ("CD".equals(codeString)) - return EventTiming.CD; - if ("CV".equals(codeString)) - return EventTiming.CV; - if ("AC".equals(codeString)) - return EventTiming.AC; - if ("ACM".equals(codeString)) - return EventTiming.ACM; - if ("ACD".equals(codeString)) - return EventTiming.ACD; - if ("ACV".equals(codeString)) - return EventTiming.ACV; - if ("PC".equals(codeString)) - return EventTiming.PC; - if ("PCM".equals(codeString)) - return EventTiming.PCM; - if ("PCD".equals(codeString)) - return EventTiming.PCD; - if ("PCV".equals(codeString)) - return EventTiming.PCV; - throw new IllegalArgumentException("Unknown EventTiming code '"+codeString+"'"); - } - public String toCode(EventTiming code) { - if (code == EventTiming.HS) - return "HS"; - if (code == EventTiming.WAKE) - return "WAKE"; - if (code == EventTiming.C) - return "C"; - if (code == EventTiming.CM) - return "CM"; - if (code == EventTiming.CD) - return "CD"; - if (code == EventTiming.CV) - return "CV"; - if (code == EventTiming.AC) - return "AC"; - if (code == EventTiming.ACM) - return "ACM"; - if (code == EventTiming.ACD) - return "ACD"; - if (code == EventTiming.ACV) - return "ACV"; - if (code == EventTiming.PC) - return "PC"; - if (code == EventTiming.PCM) - return "PCM"; - if (code == EventTiming.PCD) - return "PCD"; - if (code == EventTiming.PCV) - return "PCV"; - return "?"; - } - } - - @Block() - public static class TimingRepeatComponent extends Element implements IBaseDatatypeElement { - /** - * Outer bounds for start and/or end limits of the timing schedule. - */ - @Child(name = "bounds", type = {Period.class}, order=1, min=0, max=1) - @Description(shortDefinition="Start and/or end limits", formalDefinition="Outer bounds for start and/or end limits of the timing schedule." ) - protected Period bounds; - - /** - * A total count of the desired number of repetitions. - */ - @Child(name = "count", type = {IntegerType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Number of times to repeat", formalDefinition="A total count of the desired number of repetitions." ) - protected IntegerType count; - - /** - * How long this thing happens for when it happens. - */ - @Child(name = "duration", type = {DecimalType.class}, order=3, min=0, max=1) - @Description(shortDefinition="How long when it happens", formalDefinition="How long this thing happens for when it happens." ) - protected DecimalType duration; - - /** - * The units of time for the duration, in UCUM units. - */ - @Child(name = "durationUnits", type = {CodeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="s | min | h | d | wk | mo | a - unit of time (UCUM)", formalDefinition="The units of time for the duration, in UCUM units." ) - protected Enumeration durationUnits; - - /** - * The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided). - */ - @Child(name = "frequency", type = {IntegerType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Event occurs frequency times per duration", formalDefinition="The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided)." ) - protected IntegerType frequency; - - /** - * If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range. - */ - @Child(name = "frequencyMax", type = {IntegerType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Event occurs frequency times per duration", formalDefinition="If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range." ) - protected IntegerType frequencyMax; - - /** - * Indicates the duration of time over which repetitions are to occur. E.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. - */ - @Child(name = "period", type = {DecimalType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Event occurs frequency times per period", formalDefinition="Indicates the duration of time over which repetitions are to occur. E.g. to express '3 times per day', 3 would be the frequency and '1 day' would be the period." ) - protected DecimalType period; - - /** - * If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. - */ - @Child(name = "periodMax", type = {DecimalType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Upper limit of period (3-4 hours)", formalDefinition="If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as 'do this once every 3-5 days." ) - protected DecimalType periodMax; - - /** - * The units of time for the period in UCUM units. - */ - @Child(name = "periodUnits", type = {CodeType.class}, order=9, min=0, max=1) - @Description(shortDefinition="s | min | h | d | wk | mo | a - unit of time (UCUM)", formalDefinition="The units of time for the period in UCUM units." ) - protected Enumeration periodUnits; - - /** - * A real world event that the occurrence of the event should be tied to. - */ - @Child(name = "when", type = {CodeType.class}, order=10, min=0, max=1) - @Description(shortDefinition="Regular life events the event is tied to", formalDefinition="A real world event that the occurrence of the event should be tied to." ) - protected Enumeration when; - - private static final long serialVersionUID = -960490812L; - - /* - * Constructor - */ - public TimingRepeatComponent() { - super(); - } - - /** - * @return {@link #bounds} (Outer bounds for start and/or end limits of the timing schedule.) - */ - public Period getBounds() { - if (this.bounds == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.bounds"); - else if (Configuration.doAutoCreate()) - this.bounds = new Period(); // cc - return this.bounds; - } - - public boolean hasBounds() { - return this.bounds != null && !this.bounds.isEmpty(); - } - - /** - * @param value {@link #bounds} (Outer bounds for start and/or end limits of the timing schedule.) - */ - public TimingRepeatComponent setBounds(Period value) { - this.bounds = value; - return this; - } - - /** - * @return {@link #count} (A total count of the desired number of repetitions.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value - */ - public IntegerType getCountElement() { - if (this.count == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.count"); - else if (Configuration.doAutoCreate()) - this.count = new IntegerType(); // bb - return this.count; - } - - public boolean hasCountElement() { - return this.count != null && !this.count.isEmpty(); - } - - public boolean hasCount() { - return this.count != null && !this.count.isEmpty(); - } - - /** - * @param value {@link #count} (A total count of the desired number of repetitions.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value - */ - public TimingRepeatComponent setCountElement(IntegerType value) { - this.count = value; - return this; - } - - /** - * @return A total count of the desired number of repetitions. - */ - public int getCount() { - return this.count == null || this.count.isEmpty() ? 0 : this.count.getValue(); - } - - /** - * @param value A total count of the desired number of repetitions. - */ - public TimingRepeatComponent setCount(int value) { - if (this.count == null) - this.count = new IntegerType(); - this.count.setValue(value); - return this; - } - - /** - * @return {@link #duration} (How long this thing happens for when it happens.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value - */ - public DecimalType getDurationElement() { - if (this.duration == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.duration"); - else if (Configuration.doAutoCreate()) - this.duration = new DecimalType(); // bb - return this.duration; - } - - public boolean hasDurationElement() { - return this.duration != null && !this.duration.isEmpty(); - } - - public boolean hasDuration() { - return this.duration != null && !this.duration.isEmpty(); - } - - /** - * @param value {@link #duration} (How long this thing happens for when it happens.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value - */ - public TimingRepeatComponent setDurationElement(DecimalType value) { - this.duration = value; - return this; - } - - /** - * @return How long this thing happens for when it happens. - */ - public BigDecimal getDuration() { - return this.duration == null ? null : this.duration.getValue(); - } - - /** - * @param value How long this thing happens for when it happens. - */ - public TimingRepeatComponent setDuration(BigDecimal value) { - if (value == null) - this.duration = null; - else { - if (this.duration == null) - this.duration = new DecimalType(); - this.duration.setValue(value); - } - return this; - } - - /** - * @return {@link #durationUnits} (The units of time for the duration, in UCUM units.). This is the underlying object with id, value and extensions. The accessor "getDurationUnits" gives direct access to the value - */ - public Enumeration getDurationUnitsElement() { - if (this.durationUnits == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.durationUnits"); - else if (Configuration.doAutoCreate()) - this.durationUnits = new Enumeration(new UnitsOfTimeEnumFactory()); // bb - return this.durationUnits; - } - - public boolean hasDurationUnitsElement() { - return this.durationUnits != null && !this.durationUnits.isEmpty(); - } - - public boolean hasDurationUnits() { - return this.durationUnits != null && !this.durationUnits.isEmpty(); - } - - /** - * @param value {@link #durationUnits} (The units of time for the duration, in UCUM units.). This is the underlying object with id, value and extensions. The accessor "getDurationUnits" gives direct access to the value - */ - public TimingRepeatComponent setDurationUnitsElement(Enumeration value) { - this.durationUnits = value; - return this; - } - - /** - * @return The units of time for the duration, in UCUM units. - */ - public UnitsOfTime getDurationUnits() { - return this.durationUnits == null ? null : this.durationUnits.getValue(); - } - - /** - * @param value The units of time for the duration, in UCUM units. - */ - public TimingRepeatComponent setDurationUnits(UnitsOfTime value) { - if (value == null) - this.durationUnits = null; - else { - if (this.durationUnits == null) - this.durationUnits = new Enumeration(new UnitsOfTimeEnumFactory()); - this.durationUnits.setValue(value); - } - return this; - } - - /** - * @return {@link #frequency} (The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided).). This is the underlying object with id, value and extensions. The accessor "getFrequency" gives direct access to the value - */ - public IntegerType getFrequencyElement() { - if (this.frequency == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.frequency"); - else if (Configuration.doAutoCreate()) - this.frequency = new IntegerType(); // bb - return this.frequency; - } - - public boolean hasFrequencyElement() { - return this.frequency != null && !this.frequency.isEmpty(); - } - - public boolean hasFrequency() { - return this.frequency != null && !this.frequency.isEmpty(); - } - - /** - * @param value {@link #frequency} (The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided).). This is the underlying object with id, value and extensions. The accessor "getFrequency" gives direct access to the value - */ - public TimingRepeatComponent setFrequencyElement(IntegerType value) { - this.frequency = value; - return this; - } - - /** - * @return The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided). - */ - public int getFrequency() { - return this.frequency == null || this.frequency.isEmpty() ? 0 : this.frequency.getValue(); - } - - /** - * @param value The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided). - */ - public TimingRepeatComponent setFrequency(int value) { - if (this.frequency == null) - this.frequency = new IntegerType(); - this.frequency.setValue(value); - return this; - } - - /** - * @return {@link #frequencyMax} (If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range.). This is the underlying object with id, value and extensions. The accessor "getFrequencyMax" gives direct access to the value - */ - public IntegerType getFrequencyMaxElement() { - if (this.frequencyMax == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.frequencyMax"); - else if (Configuration.doAutoCreate()) - this.frequencyMax = new IntegerType(); // bb - return this.frequencyMax; - } - - public boolean hasFrequencyMaxElement() { - return this.frequencyMax != null && !this.frequencyMax.isEmpty(); - } - - public boolean hasFrequencyMax() { - return this.frequencyMax != null && !this.frequencyMax.isEmpty(); - } - - /** - * @param value {@link #frequencyMax} (If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range.). This is the underlying object with id, value and extensions. The accessor "getFrequencyMax" gives direct access to the value - */ - public TimingRepeatComponent setFrequencyMaxElement(IntegerType value) { - this.frequencyMax = value; - return this; - } - - /** - * @return If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range. - */ - public int getFrequencyMax() { - return this.frequencyMax == null || this.frequencyMax.isEmpty() ? 0 : this.frequencyMax.getValue(); - } - - /** - * @param value If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range. - */ - public TimingRepeatComponent setFrequencyMax(int value) { - if (this.frequencyMax == null) - this.frequencyMax = new IntegerType(); - this.frequencyMax.setValue(value); - return this; - } - - /** - * @return {@link #period} (Indicates the duration of time over which repetitions are to occur. E.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value - */ - public DecimalType getPeriodElement() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new DecimalType(); // bb - return this.period; - } - - public boolean hasPeriodElement() { - return this.period != null && !this.period.isEmpty(); - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (Indicates the duration of time over which repetitions are to occur. E.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value - */ - public TimingRepeatComponent setPeriodElement(DecimalType value) { - this.period = value; - return this; - } - - /** - * @return Indicates the duration of time over which repetitions are to occur. E.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. - */ - public BigDecimal getPeriod() { - return this.period == null ? null : this.period.getValue(); - } - - /** - * @param value Indicates the duration of time over which repetitions are to occur. E.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. - */ - public TimingRepeatComponent setPeriod(BigDecimal value) { - if (value == null) - this.period = null; - else { - if (this.period == null) - this.period = new DecimalType(); - this.period.setValue(value); - } - return this; - } - - /** - * @return {@link #periodMax} (If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days.). This is the underlying object with id, value and extensions. The accessor "getPeriodMax" gives direct access to the value - */ - public DecimalType getPeriodMaxElement() { - if (this.periodMax == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.periodMax"); - else if (Configuration.doAutoCreate()) - this.periodMax = new DecimalType(); // bb - return this.periodMax; - } - - public boolean hasPeriodMaxElement() { - return this.periodMax != null && !this.periodMax.isEmpty(); - } - - public boolean hasPeriodMax() { - return this.periodMax != null && !this.periodMax.isEmpty(); - } - - /** - * @param value {@link #periodMax} (If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days.). This is the underlying object with id, value and extensions. The accessor "getPeriodMax" gives direct access to the value - */ - public TimingRepeatComponent setPeriodMaxElement(DecimalType value) { - this.periodMax = value; - return this; - } - - /** - * @return If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. - */ - public BigDecimal getPeriodMax() { - return this.periodMax == null ? null : this.periodMax.getValue(); - } - - /** - * @param value If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. - */ - public TimingRepeatComponent setPeriodMax(BigDecimal value) { - if (value == null) - this.periodMax = null; - else { - if (this.periodMax == null) - this.periodMax = new DecimalType(); - this.periodMax.setValue(value); - } - return this; - } - - /** - * @return {@link #periodUnits} (The units of time for the period in UCUM units.). This is the underlying object with id, value and extensions. The accessor "getPeriodUnits" gives direct access to the value - */ - public Enumeration getPeriodUnitsElement() { - if (this.periodUnits == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.periodUnits"); - else if (Configuration.doAutoCreate()) - this.periodUnits = new Enumeration(new UnitsOfTimeEnumFactory()); // bb - return this.periodUnits; - } - - public boolean hasPeriodUnitsElement() { - return this.periodUnits != null && !this.periodUnits.isEmpty(); - } - - public boolean hasPeriodUnits() { - return this.periodUnits != null && !this.periodUnits.isEmpty(); - } - - /** - * @param value {@link #periodUnits} (The units of time for the period in UCUM units.). This is the underlying object with id, value and extensions. The accessor "getPeriodUnits" gives direct access to the value - */ - public TimingRepeatComponent setPeriodUnitsElement(Enumeration value) { - this.periodUnits = value; - return this; - } - - /** - * @return The units of time for the period in UCUM units. - */ - public UnitsOfTime getPeriodUnits() { - return this.periodUnits == null ? null : this.periodUnits.getValue(); - } - - /** - * @param value The units of time for the period in UCUM units. - */ - public TimingRepeatComponent setPeriodUnits(UnitsOfTime value) { - if (value == null) - this.periodUnits = null; - else { - if (this.periodUnits == null) - this.periodUnits = new Enumeration(new UnitsOfTimeEnumFactory()); - this.periodUnits.setValue(value); - } - return this; - } - - /** - * @return {@link #when} (A real world event that the occurrence of the event should be tied to.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value - */ - public Enumeration getWhenElement() { - if (this.when == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.when"); - else if (Configuration.doAutoCreate()) - this.when = new Enumeration(new EventTimingEnumFactory()); // bb - return this.when; - } - - public boolean hasWhenElement() { - return this.when != null && !this.when.isEmpty(); - } - - public boolean hasWhen() { - return this.when != null && !this.when.isEmpty(); - } - - /** - * @param value {@link #when} (A real world event that the occurrence of the event should be tied to.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value - */ - public TimingRepeatComponent setWhenElement(Enumeration value) { - this.when = value; - return this; - } - - /** - * @return A real world event that the occurrence of the event should be tied to. - */ - public EventTiming getWhen() { - return this.when == null ? null : this.when.getValue(); - } - - /** - * @param value A real world event that the occurrence of the event should be tied to. - */ - public TimingRepeatComponent setWhen(EventTiming value) { - if (value == null) - this.when = null; - else { - if (this.when == null) - this.when = new Enumeration(new EventTimingEnumFactory()); - this.when.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("bounds", "Period", "Outer bounds for start and/or end limits of the timing schedule.", 0, java.lang.Integer.MAX_VALUE, bounds)); - childrenList.add(new Property("count", "integer", "A total count of the desired number of repetitions.", 0, java.lang.Integer.MAX_VALUE, count)); - childrenList.add(new Property("duration", "decimal", "How long this thing happens for when it happens.", 0, java.lang.Integer.MAX_VALUE, duration)); - childrenList.add(new Property("durationUnits", "code", "The units of time for the duration, in UCUM units.", 0, java.lang.Integer.MAX_VALUE, durationUnits)); - childrenList.add(new Property("frequency", "integer", "The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided).", 0, java.lang.Integer.MAX_VALUE, frequency)); - childrenList.add(new Property("frequencyMax", "integer", "If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range.", 0, java.lang.Integer.MAX_VALUE, frequencyMax)); - childrenList.add(new Property("period", "decimal", "Indicates the duration of time over which repetitions are to occur. E.g. to express '3 times per day', 3 would be the frequency and '1 day' would be the period.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("periodMax", "decimal", "If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as 'do this once every 3-5 days.", 0, java.lang.Integer.MAX_VALUE, periodMax)); - childrenList.add(new Property("periodUnits", "code", "The units of time for the period in UCUM units.", 0, java.lang.Integer.MAX_VALUE, periodUnits)); - childrenList.add(new Property("when", "code", "A real world event that the occurrence of the event should be tied to.", 0, java.lang.Integer.MAX_VALUE, when)); - } - - public TimingRepeatComponent copy() { - TimingRepeatComponent dst = new TimingRepeatComponent(); - copyValues(dst); - dst.bounds = bounds == null ? null : bounds.copy(); - dst.count = count == null ? null : count.copy(); - dst.duration = duration == null ? null : duration.copy(); - dst.durationUnits = durationUnits == null ? null : durationUnits.copy(); - dst.frequency = frequency == null ? null : frequency.copy(); - dst.frequencyMax = frequencyMax == null ? null : frequencyMax.copy(); - dst.period = period == null ? null : period.copy(); - dst.periodMax = periodMax == null ? null : periodMax.copy(); - dst.periodUnits = periodUnits == null ? null : periodUnits.copy(); - dst.when = when == null ? null : when.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TimingRepeatComponent)) - return false; - TimingRepeatComponent o = (TimingRepeatComponent) other; - return compareDeep(bounds, o.bounds, true) && compareDeep(count, o.count, true) && compareDeep(duration, o.duration, true) - && compareDeep(durationUnits, o.durationUnits, true) && compareDeep(frequency, o.frequency, true) - && compareDeep(frequencyMax, o.frequencyMax, true) && compareDeep(period, o.period, true) && compareDeep(periodMax, o.periodMax, true) - && compareDeep(periodUnits, o.periodUnits, true) && compareDeep(when, o.when, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TimingRepeatComponent)) - return false; - TimingRepeatComponent o = (TimingRepeatComponent) other; - return compareValues(count, o.count, true) && compareValues(duration, o.duration, true) && compareValues(durationUnits, o.durationUnits, true) - && compareValues(frequency, o.frequency, true) && compareValues(frequencyMax, o.frequencyMax, true) - && compareValues(period, o.period, true) && compareValues(periodMax, o.periodMax, true) && compareValues(periodUnits, o.periodUnits, true) - && compareValues(when, o.when, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (bounds == null || bounds.isEmpty()) && (count == null || count.isEmpty()) - && (duration == null || duration.isEmpty()) && (durationUnits == null || durationUnits.isEmpty()) - && (frequency == null || frequency.isEmpty()) && (frequencyMax == null || frequencyMax.isEmpty()) - && (period == null || period.isEmpty()) && (periodMax == null || periodMax.isEmpty()) && (periodUnits == null || periodUnits.isEmpty()) - && (when == null || when.isEmpty()); - } - - } - - /** - * Identifies specific times when the event occurs. - */ - @Child(name = "event", type = {DateTimeType.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="When the event occurs", formalDefinition="Identifies specific times when the event occurs." ) - protected List event; - - /** - * A set of rules that describe when the event should occur. - */ - @Child(name = "repeat", type = {}, order=1, min=0, max=1) - @Description(shortDefinition="When the event is to occur", formalDefinition="A set of rules that describe when the event should occur." ) - protected TimingRepeatComponent repeat; - - /** - * A code for the timing pattern. Some codes such as BID are uniquitious, but many instutions define their own additional codes. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="BID | TID | QID | AM | PM +", formalDefinition="A code for the timing pattern. Some codes such as BID are uniquitious, but many instutions define their own additional codes." ) - protected CodeableConcept code; - - private static final long serialVersionUID = 791565112L; - - /* - * Constructor - */ - public Timing() { - super(); - } - - /** - * @return {@link #event} (Identifies specific times when the event occurs.) - */ - public List getEvent() { - if (this.event == null) - this.event = new ArrayList(); - return this.event; - } - - public boolean hasEvent() { - if (this.event == null) - return false; - for (DateTimeType item : this.event) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #event} (Identifies specific times when the event occurs.) - */ - // syntactic sugar - public DateTimeType addEventElement() {//2 - DateTimeType t = new DateTimeType(); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return t; - } - - /** - * @param value {@link #event} (Identifies specific times when the event occurs.) - */ - public Timing addEvent(Date value) { //1 - DateTimeType t = new DateTimeType(); - t.setValue(value); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return this; - } - - /** - * @param value {@link #event} (Identifies specific times when the event occurs.) - */ - public boolean hasEvent(Date value) { - if (this.event == null) - return false; - for (DateTimeType v : this.event) - if (v.equals(value)) // dateTime - return true; - return false; - } - - /** - * @return {@link #repeat} (A set of rules that describe when the event should occur.) - */ - public TimingRepeatComponent getRepeat() { - if (this.repeat == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Timing.repeat"); - else if (Configuration.doAutoCreate()) - this.repeat = new TimingRepeatComponent(); // cc - return this.repeat; - } - - public boolean hasRepeat() { - return this.repeat != null && !this.repeat.isEmpty(); - } - - /** - * @param value {@link #repeat} (A set of rules that describe when the event should occur.) - */ - public Timing setRepeat(TimingRepeatComponent value) { - this.repeat = value; - return this; - } - - /** - * @return {@link #code} (A code for the timing pattern. Some codes such as BID are uniquitious, but many instutions define their own additional codes.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Timing.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A code for the timing pattern. Some codes such as BID are uniquitious, but many instutions define their own additional codes.) - */ - public Timing setCode(CodeableConcept value) { - this.code = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("event", "dateTime", "Identifies specific times when the event occurs.", 0, java.lang.Integer.MAX_VALUE, event)); - childrenList.add(new Property("repeat", "", "A set of rules that describe when the event should occur.", 0, java.lang.Integer.MAX_VALUE, repeat)); - childrenList.add(new Property("code", "CodeableConcept", "A code for the timing pattern. Some codes such as BID are uniquitious, but many instutions define their own additional codes.", 0, java.lang.Integer.MAX_VALUE, code)); - } - - public Timing copy() { - Timing dst = new Timing(); - copyValues(dst); - if (event != null) { - dst.event = new ArrayList(); - for (DateTimeType i : event) - dst.event.add(i.copy()); - }; - dst.repeat = repeat == null ? null : repeat.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - protected Timing typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Timing)) - return false; - Timing o = (Timing) other; - return compareDeep(event, o.event, true) && compareDeep(repeat, o.repeat, true) && compareDeep(code, o.code, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Timing)) - return false; - Timing o = (Timing) other; - return compareValues(event, o.event, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (event == null || event.isEmpty()) && (repeat == null || repeat.isEmpty()) - && (code == null || code.isEmpty()); - } - - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import java.util.*; + +import java.math.*; +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; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds. + */ +@DatatypeDef(name="Timing") +public class Timing extends Type implements ICompositeType { + + public enum UnitsOfTime { + /** + * second. + */ + S, + /** + * minute. + */ + MIN, + /** + * hour. + */ + H, + /** + * day. + */ + D, + /** + * week. + */ + WK, + /** + * month. + */ + MO, + /** + * year. + */ + A, + /** + * added to help the parsers + */ + NULL; + public static UnitsOfTime fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("s".equals(codeString)) + return S; + if ("min".equals(codeString)) + return MIN; + if ("h".equals(codeString)) + return H; + if ("d".equals(codeString)) + return D; + if ("wk".equals(codeString)) + return WK; + if ("mo".equals(codeString)) + return MO; + if ("a".equals(codeString)) + return A; + throw new Exception("Unknown UnitsOfTime code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case S: return "s"; + case MIN: return "min"; + case H: return "h"; + case D: return "d"; + case WK: return "wk"; + case MO: return "mo"; + case A: return "a"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case S: return "http://unitsofmeasure.org"; + case MIN: return "http://unitsofmeasure.org"; + case H: return "http://unitsofmeasure.org"; + case D: return "http://unitsofmeasure.org"; + case WK: return "http://unitsofmeasure.org"; + case MO: return "http://unitsofmeasure.org"; + case A: return "http://unitsofmeasure.org"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case S: return "second."; + case MIN: return "minute."; + case H: return "hour."; + case D: return "day."; + case WK: return "week."; + case MO: return "month."; + case A: return "year."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case S: return "S"; + case MIN: return "Min"; + case H: return "H"; + case D: return "D"; + case WK: return "Wk"; + case MO: return "Mo"; + case A: return "A"; + default: return "?"; + } + } + } + + public static class UnitsOfTimeEnumFactory implements EnumFactory { + public UnitsOfTime fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("s".equals(codeString)) + return UnitsOfTime.S; + if ("min".equals(codeString)) + return UnitsOfTime.MIN; + if ("h".equals(codeString)) + return UnitsOfTime.H; + if ("d".equals(codeString)) + return UnitsOfTime.D; + if ("wk".equals(codeString)) + return UnitsOfTime.WK; + if ("mo".equals(codeString)) + return UnitsOfTime.MO; + if ("a".equals(codeString)) + return UnitsOfTime.A; + throw new IllegalArgumentException("Unknown UnitsOfTime code '"+codeString+"'"); + } + public String toCode(UnitsOfTime code) { + if (code == UnitsOfTime.S) + return "s"; + if (code == UnitsOfTime.MIN) + return "min"; + if (code == UnitsOfTime.H) + return "h"; + if (code == UnitsOfTime.D) + return "d"; + if (code == UnitsOfTime.WK) + return "wk"; + if (code == UnitsOfTime.MO) + return "mo"; + if (code == UnitsOfTime.A) + return "a"; + return "?"; + } + } + + public enum EventTiming { + /** + * event occurs [duration] before the hour of sleep (or trying to). + */ + HS, + /** + * event occurs [duration] after waking. + */ + WAKE, + /** + * event occurs at a meal (from the Latin cibus). + */ + C, + /** + * event occurs at breakfast (from the Latin cibus matutinus). + */ + CM, + /** + * event occurs at lunch (from the Latin cibus diurnus). + */ + CD, + /** + * event occurs at dinner (from the Latin ante cibus vespertinus). + */ + CV, + /** + * event occurs [duration] before a meal (from the Latin ante cibus). + */ + AC, + /** + * event occurs [duration] before breakfast (from the Latin ante cibus matutinus). + */ + ACM, + /** + * event occurs [duration] before lunch (from the Latin ante cibus diurnus). + */ + ACD, + /** + * event occurs [duration] before dinner (from the Latin ante cibus vespertinus). + */ + ACV, + /** + * event occurs [duration] after a meal (from the Latin post cibus). + */ + PC, + /** + * event occurs [duration] after breakfast (from the Latin post cibus matutinus). + */ + PCM, + /** + * event occurs [duration] after lunch (from the Latin post cibus diurnus). + */ + PCD, + /** + * event occurs [duration] after dinner (from the Latin post cibus vespertinus). + */ + PCV, + /** + * added to help the parsers + */ + NULL; + public static EventTiming fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("HS".equals(codeString)) + return HS; + if ("WAKE".equals(codeString)) + return WAKE; + if ("C".equals(codeString)) + return C; + if ("CM".equals(codeString)) + return CM; + if ("CD".equals(codeString)) + return CD; + if ("CV".equals(codeString)) + return CV; + if ("AC".equals(codeString)) + return AC; + if ("ACM".equals(codeString)) + return ACM; + if ("ACD".equals(codeString)) + return ACD; + if ("ACV".equals(codeString)) + return ACV; + if ("PC".equals(codeString)) + return PC; + if ("PCM".equals(codeString)) + return PCM; + if ("PCD".equals(codeString)) + return PCD; + if ("PCV".equals(codeString)) + return PCV; + throw new Exception("Unknown EventTiming code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case HS: return "HS"; + case WAKE: return "WAKE"; + case C: return "C"; + case CM: return "CM"; + case CD: return "CD"; + case CV: return "CV"; + case AC: return "AC"; + case ACM: return "ACM"; + case ACD: return "ACD"; + case ACV: return "ACV"; + case PC: return "PC"; + case PCM: return "PCM"; + case PCD: return "PCD"; + case PCV: return "PCV"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case HS: return "http://hl7.org/fhir/v3/TimingEvent"; + case WAKE: return "http://hl7.org/fhir/v3/TimingEvent"; + case C: return "http://hl7.org/fhir/v3/TimingEvent"; + case CM: return "http://hl7.org/fhir/v3/TimingEvent"; + case CD: return "http://hl7.org/fhir/v3/TimingEvent"; + case CV: return "http://hl7.org/fhir/v3/TimingEvent"; + case AC: return "http://hl7.org/fhir/v3/TimingEvent"; + case ACM: return "http://hl7.org/fhir/v3/TimingEvent"; + case ACD: return "http://hl7.org/fhir/v3/TimingEvent"; + case ACV: return "http://hl7.org/fhir/v3/TimingEvent"; + case PC: return "http://hl7.org/fhir/v3/TimingEvent"; + case PCM: return "http://hl7.org/fhir/v3/TimingEvent"; + case PCD: return "http://hl7.org/fhir/v3/TimingEvent"; + case PCV: return "http://hl7.org/fhir/v3/TimingEvent"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case HS: return "event occurs [duration] before the hour of sleep (or trying to)."; + case WAKE: return "event occurs [duration] after waking."; + case C: return "event occurs at a meal (from the Latin cibus)."; + case CM: return "event occurs at breakfast (from the Latin cibus matutinus)."; + case CD: return "event occurs at lunch (from the Latin cibus diurnus)."; + case CV: return "event occurs at dinner (from the Latin ante cibus vespertinus)."; + case AC: return "event occurs [duration] before a meal (from the Latin ante cibus)."; + case ACM: return "event occurs [duration] before breakfast (from the Latin ante cibus matutinus)."; + case ACD: return "event occurs [duration] before lunch (from the Latin ante cibus diurnus)."; + case ACV: return "event occurs [duration] before dinner (from the Latin ante cibus vespertinus)."; + case PC: return "event occurs [duration] after a meal (from the Latin post cibus)."; + case PCM: return "event occurs [duration] after breakfast (from the Latin post cibus matutinus)."; + case PCD: return "event occurs [duration] after lunch (from the Latin post cibus diurnus)."; + case PCV: return "event occurs [duration] after dinner (from the Latin post cibus vespertinus)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case HS: return "H S"; + case WAKE: return "W A K E"; + case C: return "C"; + case CM: return "C M"; + case CD: return "C D"; + case CV: return "C V"; + case AC: return "A C"; + case ACM: return "A C M"; + case ACD: return "A C D"; + case ACV: return "A C V"; + case PC: return "P C"; + case PCM: return "P C M"; + case PCD: return "P C D"; + case PCV: return "P C V"; + default: return "?"; + } + } + } + + public static class EventTimingEnumFactory implements EnumFactory { + public EventTiming fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("HS".equals(codeString)) + return EventTiming.HS; + if ("WAKE".equals(codeString)) + return EventTiming.WAKE; + if ("C".equals(codeString)) + return EventTiming.C; + if ("CM".equals(codeString)) + return EventTiming.CM; + if ("CD".equals(codeString)) + return EventTiming.CD; + if ("CV".equals(codeString)) + return EventTiming.CV; + if ("AC".equals(codeString)) + return EventTiming.AC; + if ("ACM".equals(codeString)) + return EventTiming.ACM; + if ("ACD".equals(codeString)) + return EventTiming.ACD; + if ("ACV".equals(codeString)) + return EventTiming.ACV; + if ("PC".equals(codeString)) + return EventTiming.PC; + if ("PCM".equals(codeString)) + return EventTiming.PCM; + if ("PCD".equals(codeString)) + return EventTiming.PCD; + if ("PCV".equals(codeString)) + return EventTiming.PCV; + throw new IllegalArgumentException("Unknown EventTiming code '"+codeString+"'"); + } + public String toCode(EventTiming code) { + if (code == EventTiming.HS) + return "HS"; + if (code == EventTiming.WAKE) + return "WAKE"; + if (code == EventTiming.C) + return "C"; + if (code == EventTiming.CM) + return "CM"; + if (code == EventTiming.CD) + return "CD"; + if (code == EventTiming.CV) + return "CV"; + if (code == EventTiming.AC) + return "AC"; + if (code == EventTiming.ACM) + return "ACM"; + if (code == EventTiming.ACD) + return "ACD"; + if (code == EventTiming.ACV) + return "ACV"; + if (code == EventTiming.PC) + return "PC"; + if (code == EventTiming.PCM) + return "PCM"; + if (code == EventTiming.PCD) + return "PCD"; + if (code == EventTiming.PCV) + return "PCV"; + return "?"; + } + } + + @Block() + public static class TimingRepeatComponent extends Element implements IBaseDatatypeElement { + /** + * Outer bounds for start and/or end limits of the timing schedule. + */ + @Child(name = "bounds", type = {Period.class}, order=1, min=0, max=1) + @Description(shortDefinition="Start and/or end limits", formalDefinition="Outer bounds for start and/or end limits of the timing schedule." ) + protected Period bounds; + + /** + * A total count of the desired number of repetitions. + */ + @Child(name = "count", type = {IntegerType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Number of times to repeat", formalDefinition="A total count of the desired number of repetitions." ) + protected IntegerType count; + + /** + * How long this thing happens for when it happens. + */ + @Child(name = "duration", type = {DecimalType.class}, order=3, min=0, max=1) + @Description(shortDefinition="How long when it happens", formalDefinition="How long this thing happens for when it happens." ) + protected DecimalType duration; + + /** + * The units of time for the duration, in UCUM units. + */ + @Child(name = "durationUnits", type = {CodeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="s | min | h | d | wk | mo | a - unit of time (UCUM)", formalDefinition="The units of time for the duration, in UCUM units." ) + protected Enumeration durationUnits; + + /** + * The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided). + */ + @Child(name = "frequency", type = {IntegerType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Event occurs frequency times per duration", formalDefinition="The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided)." ) + protected IntegerType frequency; + + /** + * If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range. + */ + @Child(name = "frequencyMax", type = {IntegerType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Event occurs frequency times per duration", formalDefinition="If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range." ) + protected IntegerType frequencyMax; + + /** + * Indicates the duration of time over which repetitions are to occur. E.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. + */ + @Child(name = "period", type = {DecimalType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Event occurs frequency times per period", formalDefinition="Indicates the duration of time over which repetitions are to occur. E.g. to express '3 times per day', 3 would be the frequency and '1 day' would be the period." ) + protected DecimalType period; + + /** + * If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. + */ + @Child(name = "periodMax", type = {DecimalType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Upper limit of period (3-4 hours)", formalDefinition="If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as 'do this once every 3-5 days." ) + protected DecimalType periodMax; + + /** + * The units of time for the period in UCUM units. + */ + @Child(name = "periodUnits", type = {CodeType.class}, order=9, min=0, max=1) + @Description(shortDefinition="s | min | h | d | wk | mo | a - unit of time (UCUM)", formalDefinition="The units of time for the period in UCUM units." ) + protected Enumeration periodUnits; + + /** + * A real world event that the occurrence of the event should be tied to. + */ + @Child(name = "when", type = {CodeType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Regular life events the event is tied to", formalDefinition="A real world event that the occurrence of the event should be tied to." ) + protected Enumeration when; + + private static final long serialVersionUID = -960490812L; + + /* + * Constructor + */ + public TimingRepeatComponent() { + super(); + } + + /** + * @return {@link #bounds} (Outer bounds for start and/or end limits of the timing schedule.) + */ + public Period getBounds() { + if (this.bounds == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.bounds"); + else if (Configuration.doAutoCreate()) + this.bounds = new Period(); // cc + return this.bounds; + } + + public boolean hasBounds() { + return this.bounds != null && !this.bounds.isEmpty(); + } + + /** + * @param value {@link #bounds} (Outer bounds for start and/or end limits of the timing schedule.) + */ + public TimingRepeatComponent setBounds(Period value) { + this.bounds = value; + return this; + } + + /** + * @return {@link #count} (A total count of the desired number of repetitions.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value + */ + public IntegerType getCountElement() { + if (this.count == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.count"); + else if (Configuration.doAutoCreate()) + this.count = new IntegerType(); // bb + return this.count; + } + + public boolean hasCountElement() { + return this.count != null && !this.count.isEmpty(); + } + + public boolean hasCount() { + return this.count != null && !this.count.isEmpty(); + } + + /** + * @param value {@link #count} (A total count of the desired number of repetitions.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value + */ + public TimingRepeatComponent setCountElement(IntegerType value) { + this.count = value; + return this; + } + + /** + * @return A total count of the desired number of repetitions. + */ + public int getCount() { + return this.count == null || this.count.isEmpty() ? 0 : this.count.getValue(); + } + + /** + * @param value A total count of the desired number of repetitions. + */ + public TimingRepeatComponent setCount(int value) { + if (this.count == null) + this.count = new IntegerType(); + this.count.setValue(value); + return this; + } + + /** + * @return {@link #duration} (How long this thing happens for when it happens.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value + */ + public DecimalType getDurationElement() { + if (this.duration == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.duration"); + else if (Configuration.doAutoCreate()) + this.duration = new DecimalType(); // bb + return this.duration; + } + + public boolean hasDurationElement() { + return this.duration != null && !this.duration.isEmpty(); + } + + public boolean hasDuration() { + return this.duration != null && !this.duration.isEmpty(); + } + + /** + * @param value {@link #duration} (How long this thing happens for when it happens.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value + */ + public TimingRepeatComponent setDurationElement(DecimalType value) { + this.duration = value; + return this; + } + + /** + * @return How long this thing happens for when it happens. + */ + public BigDecimal getDuration() { + return this.duration == null ? null : this.duration.getValue(); + } + + /** + * @param value How long this thing happens for when it happens. + */ + public TimingRepeatComponent setDuration(BigDecimal value) { + if (value == null) + this.duration = null; + else { + if (this.duration == null) + this.duration = new DecimalType(); + this.duration.setValue(value); + } + return this; + } + + /** + * @return {@link #durationUnits} (The units of time for the duration, in UCUM units.). This is the underlying object with id, value and extensions. The accessor "getDurationUnits" gives direct access to the value + */ + public Enumeration getDurationUnitsElement() { + if (this.durationUnits == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.durationUnits"); + else if (Configuration.doAutoCreate()) + this.durationUnits = new Enumeration(new UnitsOfTimeEnumFactory()); // bb + return this.durationUnits; + } + + public boolean hasDurationUnitsElement() { + return this.durationUnits != null && !this.durationUnits.isEmpty(); + } + + public boolean hasDurationUnits() { + return this.durationUnits != null && !this.durationUnits.isEmpty(); + } + + /** + * @param value {@link #durationUnits} (The units of time for the duration, in UCUM units.). This is the underlying object with id, value and extensions. The accessor "getDurationUnits" gives direct access to the value + */ + public TimingRepeatComponent setDurationUnitsElement(Enumeration value) { + this.durationUnits = value; + return this; + } + + /** + * @return The units of time for the duration, in UCUM units. + */ + public UnitsOfTime getDurationUnits() { + return this.durationUnits == null ? null : this.durationUnits.getValue(); + } + + /** + * @param value The units of time for the duration, in UCUM units. + */ + public TimingRepeatComponent setDurationUnits(UnitsOfTime value) { + if (value == null) + this.durationUnits = null; + else { + if (this.durationUnits == null) + this.durationUnits = new Enumeration(new UnitsOfTimeEnumFactory()); + this.durationUnits.setValue(value); + } + return this; + } + + /** + * @return {@link #frequency} (The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided).). This is the underlying object with id, value and extensions. The accessor "getFrequency" gives direct access to the value + */ + public IntegerType getFrequencyElement() { + if (this.frequency == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.frequency"); + else if (Configuration.doAutoCreate()) + this.frequency = new IntegerType(); // bb + return this.frequency; + } + + public boolean hasFrequencyElement() { + return this.frequency != null && !this.frequency.isEmpty(); + } + + public boolean hasFrequency() { + return this.frequency != null && !this.frequency.isEmpty(); + } + + /** + * @param value {@link #frequency} (The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided).). This is the underlying object with id, value and extensions. The accessor "getFrequency" gives direct access to the value + */ + public TimingRepeatComponent setFrequencyElement(IntegerType value) { + this.frequency = value; + return this; + } + + /** + * @return The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided). + */ + public int getFrequency() { + return this.frequency == null || this.frequency.isEmpty() ? 0 : this.frequency.getValue(); + } + + /** + * @param value The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided). + */ + public TimingRepeatComponent setFrequency(int value) { + if (this.frequency == null) + this.frequency = new IntegerType(); + this.frequency.setValue(value); + return this; + } + + /** + * @return {@link #frequencyMax} (If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range.). This is the underlying object with id, value and extensions. The accessor "getFrequencyMax" gives direct access to the value + */ + public IntegerType getFrequencyMaxElement() { + if (this.frequencyMax == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.frequencyMax"); + else if (Configuration.doAutoCreate()) + this.frequencyMax = new IntegerType(); // bb + return this.frequencyMax; + } + + public boolean hasFrequencyMaxElement() { + return this.frequencyMax != null && !this.frequencyMax.isEmpty(); + } + + public boolean hasFrequencyMax() { + return this.frequencyMax != null && !this.frequencyMax.isEmpty(); + } + + /** + * @param value {@link #frequencyMax} (If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range.). This is the underlying object with id, value and extensions. The accessor "getFrequencyMax" gives direct access to the value + */ + public TimingRepeatComponent setFrequencyMaxElement(IntegerType value) { + this.frequencyMax = value; + return this; + } + + /** + * @return If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range. + */ + public int getFrequencyMax() { + return this.frequencyMax == null || this.frequencyMax.isEmpty() ? 0 : this.frequencyMax.getValue(); + } + + /** + * @param value If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range. + */ + public TimingRepeatComponent setFrequencyMax(int value) { + if (this.frequencyMax == null) + this.frequencyMax = new IntegerType(); + this.frequencyMax.setValue(value); + return this; + } + + /** + * @return {@link #period} (Indicates the duration of time over which repetitions are to occur. E.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value + */ + public DecimalType getPeriodElement() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new DecimalType(); // bb + return this.period; + } + + public boolean hasPeriodElement() { + return this.period != null && !this.period.isEmpty(); + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Indicates the duration of time over which repetitions are to occur. E.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value + */ + public TimingRepeatComponent setPeriodElement(DecimalType value) { + this.period = value; + return this; + } + + /** + * @return Indicates the duration of time over which repetitions are to occur. E.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. + */ + public BigDecimal getPeriod() { + return this.period == null ? null : this.period.getValue(); + } + + /** + * @param value Indicates the duration of time over which repetitions are to occur. E.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. + */ + public TimingRepeatComponent setPeriod(BigDecimal value) { + if (value == null) + this.period = null; + else { + if (this.period == null) + this.period = new DecimalType(); + this.period.setValue(value); + } + return this; + } + + /** + * @return {@link #periodMax} (If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days.). This is the underlying object with id, value and extensions. The accessor "getPeriodMax" gives direct access to the value + */ + public DecimalType getPeriodMaxElement() { + if (this.periodMax == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.periodMax"); + else if (Configuration.doAutoCreate()) + this.periodMax = new DecimalType(); // bb + return this.periodMax; + } + + public boolean hasPeriodMaxElement() { + return this.periodMax != null && !this.periodMax.isEmpty(); + } + + public boolean hasPeriodMax() { + return this.periodMax != null && !this.periodMax.isEmpty(); + } + + /** + * @param value {@link #periodMax} (If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days.). This is the underlying object with id, value and extensions. The accessor "getPeriodMax" gives direct access to the value + */ + public TimingRepeatComponent setPeriodMaxElement(DecimalType value) { + this.periodMax = value; + return this; + } + + /** + * @return If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. + */ + public BigDecimal getPeriodMax() { + return this.periodMax == null ? null : this.periodMax.getValue(); + } + + /** + * @param value If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. + */ + public TimingRepeatComponent setPeriodMax(BigDecimal value) { + if (value == null) + this.periodMax = null; + else { + if (this.periodMax == null) + this.periodMax = new DecimalType(); + this.periodMax.setValue(value); + } + return this; + } + + /** + * @return {@link #periodUnits} (The units of time for the period in UCUM units.). This is the underlying object with id, value and extensions. The accessor "getPeriodUnits" gives direct access to the value + */ + public Enumeration getPeriodUnitsElement() { + if (this.periodUnits == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.periodUnits"); + else if (Configuration.doAutoCreate()) + this.periodUnits = new Enumeration(new UnitsOfTimeEnumFactory()); // bb + return this.periodUnits; + } + + public boolean hasPeriodUnitsElement() { + return this.periodUnits != null && !this.periodUnits.isEmpty(); + } + + public boolean hasPeriodUnits() { + return this.periodUnits != null && !this.periodUnits.isEmpty(); + } + + /** + * @param value {@link #periodUnits} (The units of time for the period in UCUM units.). This is the underlying object with id, value and extensions. The accessor "getPeriodUnits" gives direct access to the value + */ + public TimingRepeatComponent setPeriodUnitsElement(Enumeration value) { + this.periodUnits = value; + return this; + } + + /** + * @return The units of time for the period in UCUM units. + */ + public UnitsOfTime getPeriodUnits() { + return this.periodUnits == null ? null : this.periodUnits.getValue(); + } + + /** + * @param value The units of time for the period in UCUM units. + */ + public TimingRepeatComponent setPeriodUnits(UnitsOfTime value) { + if (value == null) + this.periodUnits = null; + else { + if (this.periodUnits == null) + this.periodUnits = new Enumeration(new UnitsOfTimeEnumFactory()); + this.periodUnits.setValue(value); + } + return this; + } + + /** + * @return {@link #when} (A real world event that the occurrence of the event should be tied to.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value + */ + public Enumeration getWhenElement() { + if (this.when == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.when"); + else if (Configuration.doAutoCreate()) + this.when = new Enumeration(new EventTimingEnumFactory()); // bb + return this.when; + } + + public boolean hasWhenElement() { + return this.when != null && !this.when.isEmpty(); + } + + public boolean hasWhen() { + return this.when != null && !this.when.isEmpty(); + } + + /** + * @param value {@link #when} (A real world event that the occurrence of the event should be tied to.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value + */ + public TimingRepeatComponent setWhenElement(Enumeration value) { + this.when = value; + return this; + } + + /** + * @return A real world event that the occurrence of the event should be tied to. + */ + public EventTiming getWhen() { + return this.when == null ? null : this.when.getValue(); + } + + /** + * @param value A real world event that the occurrence of the event should be tied to. + */ + public TimingRepeatComponent setWhen(EventTiming value) { + if (value == null) + this.when = null; + else { + if (this.when == null) + this.when = new Enumeration(new EventTimingEnumFactory()); + this.when.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("bounds", "Period", "Outer bounds for start and/or end limits of the timing schedule.", 0, java.lang.Integer.MAX_VALUE, bounds)); + childrenList.add(new Property("count", "integer", "A total count of the desired number of repetitions.", 0, java.lang.Integer.MAX_VALUE, count)); + childrenList.add(new Property("duration", "decimal", "How long this thing happens for when it happens.", 0, java.lang.Integer.MAX_VALUE, duration)); + childrenList.add(new Property("durationUnits", "code", "The units of time for the duration, in UCUM units.", 0, java.lang.Integer.MAX_VALUE, durationUnits)); + childrenList.add(new Property("frequency", "integer", "The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided).", 0, java.lang.Integer.MAX_VALUE, frequency)); + childrenList.add(new Property("frequencyMax", "integer", "If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range.", 0, java.lang.Integer.MAX_VALUE, frequencyMax)); + childrenList.add(new Property("period", "decimal", "Indicates the duration of time over which repetitions are to occur. E.g. to express '3 times per day', 3 would be the frequency and '1 day' would be the period.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("periodMax", "decimal", "If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as 'do this once every 3-5 days.", 0, java.lang.Integer.MAX_VALUE, periodMax)); + childrenList.add(new Property("periodUnits", "code", "The units of time for the period in UCUM units.", 0, java.lang.Integer.MAX_VALUE, periodUnits)); + childrenList.add(new Property("when", "code", "A real world event that the occurrence of the event should be tied to.", 0, java.lang.Integer.MAX_VALUE, when)); + } + + public TimingRepeatComponent copy() { + TimingRepeatComponent dst = new TimingRepeatComponent(); + copyValues(dst); + dst.bounds = bounds == null ? null : bounds.copy(); + dst.count = count == null ? null : count.copy(); + dst.duration = duration == null ? null : duration.copy(); + dst.durationUnits = durationUnits == null ? null : durationUnits.copy(); + dst.frequency = frequency == null ? null : frequency.copy(); + dst.frequencyMax = frequencyMax == null ? null : frequencyMax.copy(); + dst.period = period == null ? null : period.copy(); + dst.periodMax = periodMax == null ? null : periodMax.copy(); + dst.periodUnits = periodUnits == null ? null : periodUnits.copy(); + dst.when = when == null ? null : when.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TimingRepeatComponent)) + return false; + TimingRepeatComponent o = (TimingRepeatComponent) other; + return compareDeep(bounds, o.bounds, true) && compareDeep(count, o.count, true) && compareDeep(duration, o.duration, true) + && compareDeep(durationUnits, o.durationUnits, true) && compareDeep(frequency, o.frequency, true) + && compareDeep(frequencyMax, o.frequencyMax, true) && compareDeep(period, o.period, true) && compareDeep(periodMax, o.periodMax, true) + && compareDeep(periodUnits, o.periodUnits, true) && compareDeep(when, o.when, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TimingRepeatComponent)) + return false; + TimingRepeatComponent o = (TimingRepeatComponent) other; + return compareValues(count, o.count, true) && compareValues(duration, o.duration, true) && compareValues(durationUnits, o.durationUnits, true) + && compareValues(frequency, o.frequency, true) && compareValues(frequencyMax, o.frequencyMax, true) + && compareValues(period, o.period, true) && compareValues(periodMax, o.periodMax, true) && compareValues(periodUnits, o.periodUnits, true) + && compareValues(when, o.when, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (bounds == null || bounds.isEmpty()) && (count == null || count.isEmpty()) + && (duration == null || duration.isEmpty()) && (durationUnits == null || durationUnits.isEmpty()) + && (frequency == null || frequency.isEmpty()) && (frequencyMax == null || frequencyMax.isEmpty()) + && (period == null || period.isEmpty()) && (periodMax == null || periodMax.isEmpty()) && (periodUnits == null || periodUnits.isEmpty()) + && (when == null || when.isEmpty()); + } + + } + + /** + * Identifies specific times when the event occurs. + */ + @Child(name = "event", type = {DateTimeType.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="When the event occurs", formalDefinition="Identifies specific times when the event occurs." ) + protected List event; + + /** + * A set of rules that describe when the event should occur. + */ + @Child(name = "repeat", type = {}, order=1, min=0, max=1) + @Description(shortDefinition="When the event is to occur", formalDefinition="A set of rules that describe when the event should occur." ) + protected TimingRepeatComponent repeat; + + /** + * A code for the timing pattern. Some codes such as BID are uniquitious, but many instutions define their own additional codes. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="BID | TID | QID | AM | PM +", formalDefinition="A code for the timing pattern. Some codes such as BID are uniquitious, but many instutions define their own additional codes." ) + protected CodeableConcept code; + + private static final long serialVersionUID = 791565112L; + + /* + * Constructor + */ + public Timing() { + super(); + } + + /** + * @return {@link #event} (Identifies specific times when the event occurs.) + */ + public List getEvent() { + if (this.event == null) + this.event = new ArrayList(); + return this.event; + } + + public boolean hasEvent() { + if (this.event == null) + return false; + for (DateTimeType item : this.event) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #event} (Identifies specific times when the event occurs.) + */ + // syntactic sugar + public DateTimeType addEventElement() {//2 + DateTimeType t = new DateTimeType(); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return t; + } + + /** + * @param value {@link #event} (Identifies specific times when the event occurs.) + */ + public Timing addEvent(Date value) { //1 + DateTimeType t = new DateTimeType(); + t.setValue(value); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return this; + } + + /** + * @param value {@link #event} (Identifies specific times when the event occurs.) + */ + public boolean hasEvent(Date value) { + if (this.event == null) + return false; + for (DateTimeType v : this.event) + if (v.equals(value)) // dateTime + return true; + return false; + } + + /** + * @return {@link #repeat} (A set of rules that describe when the event should occur.) + */ + public TimingRepeatComponent getRepeat() { + if (this.repeat == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Timing.repeat"); + else if (Configuration.doAutoCreate()) + this.repeat = new TimingRepeatComponent(); // cc + return this.repeat; + } + + public boolean hasRepeat() { + return this.repeat != null && !this.repeat.isEmpty(); + } + + /** + * @param value {@link #repeat} (A set of rules that describe when the event should occur.) + */ + public Timing setRepeat(TimingRepeatComponent value) { + this.repeat = value; + return this; + } + + /** + * @return {@link #code} (A code for the timing pattern. Some codes such as BID are uniquitious, but many instutions define their own additional codes.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Timing.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A code for the timing pattern. Some codes such as BID are uniquitious, but many instutions define their own additional codes.) + */ + public Timing setCode(CodeableConcept value) { + this.code = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("event", "dateTime", "Identifies specific times when the event occurs.", 0, java.lang.Integer.MAX_VALUE, event)); + childrenList.add(new Property("repeat", "", "A set of rules that describe when the event should occur.", 0, java.lang.Integer.MAX_VALUE, repeat)); + childrenList.add(new Property("code", "CodeableConcept", "A code for the timing pattern. Some codes such as BID are uniquitious, but many instutions define their own additional codes.", 0, java.lang.Integer.MAX_VALUE, code)); + } + + public Timing copy() { + Timing dst = new Timing(); + copyValues(dst); + if (event != null) { + dst.event = new ArrayList(); + for (DateTimeType i : event) + dst.event.add(i.copy()); + }; + dst.repeat = repeat == null ? null : repeat.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + protected Timing typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Timing)) + return false; + Timing o = (Timing) other; + return compareDeep(event, o.event, true) && compareDeep(repeat, o.repeat, true) && compareDeep(code, o.code, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Timing)) + return false; + Timing o = (Timing) other; + return compareValues(event, o.event, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (event == null || event.isEmpty()) && (repeat == null || repeat.isEmpty()) + && (code == null || code.isEmpty()); + } + + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Type.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Type.java index de2c30755d7..db7a44765cc 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Type.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/Type.java @@ -1,66 +1,45 @@ -/* -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; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import org.hl7.fhir.instance.model.api.IBaseDatatype; - -/** - * An element that is a type. Used when the element type in FHIR is a choice of more than one data type - */ -public abstract class Type extends Element implements IBaseDatatype { - - private static final long serialVersionUID = 4623040030733049991L; - - public Type copy() { - return typedCopy(); - } - - protected abstract Type typedCopy(); -} +/* +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; + +import org.hl7.fhir.instance.model.api.IBaseDatatype; + +/** + * An element that is a type. Used when the element type in FHIR is a choice of more than one data type + */ +public abstract class Type extends Element implements IBaseDatatype { + + private static final long serialVersionUID = 4623040030733049991L; + + public Type copy() { + return typedCopy(); + } + + protected abstract Type typedCopy(); +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/UnsignedIntType.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/UnsignedIntType.java index 24beca48260..47197a41058 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/UnsignedIntType.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/UnsignedIntType.java @@ -1,116 +1,95 @@ -/* -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; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import org.hl7.fhir.instance.model.annotations.DatatypeDef; - -/** - * Primitive type "integer" in FHIR: A signed 32-bit integer - */ -@DatatypeDef(name = "unsignedInt") -public class UnsignedIntType extends IntegerType { - - - /** - * - */ - private static final long serialVersionUID = -7991875974606711355L; - - /** - * Constructor - */ - public UnsignedIntType() { - // nothing - } - - /** - * Constructor - */ - public UnsignedIntType(int theInteger) { - setValue(theInteger); - } - - /** - * Constructor - * - * @param theIntegerAsString - * A string representation of an integer - * @throws IllegalArgumentException - * If the string is not a valid integer representation - */ - public UnsignedIntType(String theIntegerAsString) { - setValueAsString(theIntegerAsString); - } - - /** - * Constructor - * - * @param theValue The value - * @throws IllegalArgumentException If the value is too large to fit in a signed integer - */ - public UnsignedIntType(Long theValue) { - if (theValue < 0 || theValue > java.lang.Integer.MAX_VALUE) { - throw new IllegalArgumentException - (theValue + " cannot be cast to int without changing its value."); - } - if(theValue!=null) { - setValue((int)theValue.longValue()); - } - } - - @Override - public UnsignedIntType copy() { - return new UnsignedIntType(getValue()); - } - -} +/* +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; + +import org.hl7.fhir.instance.model.annotations.DatatypeDef; + +/** + * Primitive type "integer" in FHIR: A signed 32-bit integer + */ +@DatatypeDef(name = "unsignedInt") +public class UnsignedIntType extends IntegerType { + + + /** + * + */ + private static final long serialVersionUID = -7991875974606711355L; + + /** + * Constructor + */ + public UnsignedIntType() { + // nothing + } + + /** + * Constructor + */ + public UnsignedIntType(int theInteger) { + setValue(theInteger); + } + + /** + * Constructor + * + * @param theIntegerAsString + * A string representation of an integer + * @throws IllegalArgumentException + * If the string is not a valid integer representation + */ + public UnsignedIntType(String theIntegerAsString) { + setValueAsString(theIntegerAsString); + } + + /** + * Constructor + * + * @param theValue The value + * @throws IllegalArgumentException If the value is too large to fit in a signed integer + */ + public UnsignedIntType(Long theValue) { + if (theValue < 0 || theValue > java.lang.Integer.MAX_VALUE) { + throw new IllegalArgumentException + (theValue + " cannot be cast to int without changing its value."); + } + if(theValue!=null) { + setValue((int)theValue.longValue()); + } + } + + @Override + public UnsignedIntType copy() { + return new UnsignedIntType(getValue()); + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/UriType.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/UriType.java index 5f36373c145..d8dd929eb51 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/UriType.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/UriType.java @@ -1,179 +1,158 @@ -/* -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; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import java.net.URI; -import java.net.URISyntaxException; - -import org.apache.commons.lang3.StringUtils; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; - -/** - * Primitive type "uri" in FHIR: any valid URI. Sometimes constrained to be only an absolute URI, and sometimes constrained to be a literal reference - */ -@DatatypeDef(name = "uri") -public class UriType extends PrimitiveType { - - private static final long serialVersionUID = 3L; - - /** - * Constructor - */ - public UriType() { - // nothing - } - - /** - * Constructor - */ - public UriType(String theValue) { - setValueAsString(theValue); - } - - /** - * Constructor - */ - public UriType(URI theValue) { - setValue(theValue.toString()); - } - - @Override - public UriType copy() { - return new UriType(getValue()); - } - - @Override - protected String encode(String theValue) { - return theValue; - } - - /** - * Compares the given string to the string representation of this URI. In many cases it is preferable to use this - * instead of the standard {@link #equals(Object)} method, since that method returns false unless it is - * passed an instance of {@link UriType} - */ - public boolean equals(String theString) { - return StringUtils.equals(getValueAsString(), theString); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - - String normalize = normalize(getValue()); - result = prime * result + ((normalize == null) ? 0 : normalize.hashCode()); - - return result; - } - - private String normalize(String theValue) { - if (theValue == null) { - return null; - } - try { - URI retVal = new URI(getValue()).normalize(); - String urlString = retVal.toString(); - if (urlString.endsWith("/") && urlString.length() > 1) { - retVal = new URI(urlString.substring(0, urlString.length() - 1)); - } - return retVal.toASCIIString(); - } catch (URISyntaxException e) { - // ourLog.debug("Failed to normalize URL '{}', message was: {}", urlString, e.toString()); - return theValue; - } - } - - @Override - protected String parse(String theValue) { - return theValue; - } - - /** - * Creates a new OidType instance which uses the given OID as the content (and prepends "urn:oid:" to the OID string - * in the value of the newly created OidType, per the FHIR specification). - * - * @param theOid - * The OID to use (null is acceptable and will result in a UriDt instance with a - * null value) - * @return A new UriDt instance - */ - public static OidType fromOid(String theOid) { - if (theOid == null) { - return new OidType(); - } - return new OidType("urn:oid:" + theOid); - } - - @Override - public boolean equalsDeep(Base obj) { - if (!super.equalsDeep(obj)) - return false; - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - - UriType other = (UriType) obj; - if (getValue() == null && other.getValue() == null) { - return true; - } - if (getValue() == null || other.getValue() == null) { - return false; - } - - String normalize = normalize(getValue()); - String normalize2 = normalize(other.getValue()); - return normalize.equals(normalize2); - } - -} +/* +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; + +import java.net.URI; +import java.net.URISyntaxException; + +import org.apache.commons.lang3.StringUtils; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; + +/** + * Primitive type "uri" in FHIR: any valid URI. Sometimes constrained to be only an absolute URI, and sometimes constrained to be a literal reference + */ +@DatatypeDef(name = "uri") +public class UriType extends PrimitiveType { + + private static final long serialVersionUID = 3L; + + /** + * Constructor + */ + public UriType() { + // nothing + } + + /** + * Constructor + */ + public UriType(String theValue) { + setValueAsString(theValue); + } + + /** + * Constructor + */ + public UriType(URI theValue) { + setValue(theValue.toString()); + } + + @Override + public UriType copy() { + return new UriType(getValue()); + } + + @Override + protected String encode(String theValue) { + return theValue; + } + + /** + * Compares the given string to the string representation of this URI. In many cases it is preferable to use this + * instead of the standard {@link #equals(Object)} method, since that method returns false unless it is + * passed an instance of {@link UriType} + */ + public boolean equals(String theString) { + return StringUtils.equals(getValueAsString(), theString); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + + String normalize = normalize(getValue()); + result = prime * result + ((normalize == null) ? 0 : normalize.hashCode()); + + return result; + } + + private String normalize(String theValue) { + if (theValue == null) { + return null; + } + try { + URI retVal = new URI(getValue()).normalize(); + String urlString = retVal.toString(); + if (urlString.endsWith("/") && urlString.length() > 1) { + retVal = new URI(urlString.substring(0, urlString.length() - 1)); + } + return retVal.toASCIIString(); + } catch (URISyntaxException e) { + // ourLog.debug("Failed to normalize URL '{}', message was: {}", urlString, e.toString()); + return theValue; + } + } + + @Override + protected String parse(String theValue) { + return theValue; + } + + /** + * Creates a new OidType instance which uses the given OID as the content (and prepends "urn:oid:" to the OID string + * in the value of the newly created OidType, per the FHIR specification). + * + * @param theOid + * The OID to use (null is acceptable and will result in a UriDt instance with a + * null value) + * @return A new UriDt instance + */ + public static OidType fromOid(String theOid) { + if (theOid == null) { + return new OidType(); + } + return new OidType("urn:oid:" + theOid); + } + + @Override + public boolean equalsDeep(Base obj) { + if (!super.equalsDeep(obj)) + return false; + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + + UriType other = (UriType) obj; + if (getValue() == null && other.getValue() == null) { + return true; + } + if (getValue() == null || other.getValue() == null) { + return false; + } + + String normalize = normalize(getValue()); + String normalize2 = normalize(other.getValue()); + return normalize.equals(normalize2); + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/UuidType.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/UuidType.java index 44b742a0d70..2c00eae3ad6 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/UuidType.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/UuidType.java @@ -1,87 +1,66 @@ -/* -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; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -import java.net.URI; - -public class UuidType extends UriType { - - private static final long serialVersionUID = 3L; - - /** - * Constructor - */ - public UuidType() { - super(); - } - - /** - * Constructor - */ - public UuidType(String theValue) { - super(theValue); - } - - /** - * Constructor - */ - public UuidType(URI theValue) { - super(theValue); - } - - /** - * Constructor - */ - @Override - public UuidType copy() { - return new UuidType(getValue()); - } - -} +/* +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; + +import java.net.URI; + +public class UuidType extends UriType { + + private static final long serialVersionUID = 3L; + + /** + * Constructor + */ + public UuidType() { + super(); + } + + /** + * Constructor + */ + public UuidType(String theValue) { + super(theValue); + } + + /** + * Constructor + */ + public UuidType(URI theValue) { + super(theValue); + } + + /** + * Constructor + */ + @Override + public UuidType copy() { + return new UuidType(getValue()); + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ValueSet.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ValueSet.java index 427996a2610..7955eeef3d6 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ValueSet.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ValueSet.java @@ -1,4109 +1,4088 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import java.util.*; - -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.instance.model.Enumerations.*; -import org.hl7.fhir.instance.model.annotations.ResourceDef; -import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; -import org.hl7.fhir.instance.model.annotations.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * A value set specifies a set of codes drawn from one or more code systems. - */ -@ResourceDef(name="ValueSet", profile="http://hl7.org/fhir/Profile/ValueSet") -public class ValueSet extends DomainResource { - - public enum FilterOperator { - /** - * The specified property of the code equals the provided value. - */ - EQUAL, - /** - * Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself. - */ - ISA, - /** - * The specified property of the code does not have an is-a relationship with the provided value. - */ - ISNOTA, - /** - * The specified property of the code matches the regex specified in the provided value. - */ - REGEX, - /** - * The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list). - */ - IN, - /** - * The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list). - */ - NOTIN, - /** - * added to help the parsers - */ - NULL; - public static FilterOperator fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("=".equals(codeString)) - return EQUAL; - if ("is-a".equals(codeString)) - return ISA; - if ("is-not-a".equals(codeString)) - return ISNOTA; - if ("regex".equals(codeString)) - return REGEX; - if ("in".equals(codeString)) - return IN; - if ("not-in".equals(codeString)) - return NOTIN; - throw new Exception("Unknown FilterOperator code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case EQUAL: return "="; - case ISA: return "is-a"; - case ISNOTA: return "is-not-a"; - case REGEX: return "regex"; - case IN: return "in"; - case NOTIN: return "not-in"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case EQUAL: return ""; - case ISA: return ""; - case ISNOTA: return ""; - case REGEX: return ""; - case IN: return ""; - case NOTIN: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case EQUAL: return "The specified property of the code equals the provided value."; - case ISA: return "Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself."; - case ISNOTA: return "The specified property of the code does not have an is-a relationship with the provided value."; - case REGEX: return "The specified property of the code matches the regex specified in the provided value."; - case IN: return "The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list)."; - case NOTIN: return "The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case EQUAL: return " "; - case ISA: return "Is A"; - case ISNOTA: return "Is Not A"; - case REGEX: return "Regex"; - case IN: return "In"; - case NOTIN: return "Not In"; - default: return "?"; - } - } - } - - public static class FilterOperatorEnumFactory implements EnumFactory { - public FilterOperator fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("=".equals(codeString)) - return FilterOperator.EQUAL; - if ("is-a".equals(codeString)) - return FilterOperator.ISA; - if ("is-not-a".equals(codeString)) - return FilterOperator.ISNOTA; - if ("regex".equals(codeString)) - return FilterOperator.REGEX; - if ("in".equals(codeString)) - return FilterOperator.IN; - if ("not-in".equals(codeString)) - return FilterOperator.NOTIN; - throw new IllegalArgumentException("Unknown FilterOperator code '"+codeString+"'"); - } - public String toCode(FilterOperator code) { - if (code == FilterOperator.EQUAL) - return "="; - if (code == FilterOperator.ISA) - return "is-a"; - if (code == FilterOperator.ISNOTA) - return "is-not-a"; - if (code == FilterOperator.REGEX) - return "regex"; - if (code == FilterOperator.IN) - return "in"; - if (code == FilterOperator.NOTIN) - return "not-in"; - return "?"; - } - } - - @Block() - public static class ValueSetContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the value set. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Name of a individual to contact", formalDefinition="The name of an individual to contact regarding the value set." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /* - * Constructor - */ - public ValueSetContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ValueSetContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the value set. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the value set. - */ - public ValueSetContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public ValueSetContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the value set.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - public ValueSetContactComponent copy() { - ValueSetContactComponent dst = new ValueSetContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ValueSetContactComponent)) - return false; - ValueSetContactComponent o = (ValueSetContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ValueSetContactComponent)) - return false; - ValueSetContactComponent o = (ValueSetContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - } - - @Block() - public static class ValueSetDefineComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system. - */ - @Child(name = "system", type = {UriType.class}, order=1, min=1, max=1) - @Description(shortDefinition="URI to identify the code system", formalDefinition="An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system." ) - protected UriType system; - - /** - * The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Version of this system", formalDefinition="The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked." ) - protected StringType version; - - /** - * If code comparison is case sensitive when codes within this system are compared to each other. - */ - @Child(name = "caseSensitive", type = {BooleanType.class}, order=3, min=0, max=1) - @Description(shortDefinition="If code comparison is case sensitive", formalDefinition="If code comparison is case sensitive when codes within this system are compared to each other." ) - protected BooleanType caseSensitive; - - /** - * Concepts in the code system. - */ - @Child(name = "concept", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Concepts in the code system", formalDefinition="Concepts in the code system." ) - protected List concept; - - private static final long serialVersionUID = -1109401192L; - - /* - * Constructor - */ - public ValueSetDefineComponent() { - super(); - } - - /* - * Constructor - */ - public ValueSetDefineComponent(UriType system) { - super(); - this.system = system; - } - - /** - * @return {@link #system} (An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public UriType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetDefineComponent.system"); - else if (Configuration.doAutoCreate()) - this.system = new UriType(); // bb - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public ValueSetDefineComponent setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system. - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system. - */ - public ValueSetDefineComponent setSystem(String value) { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - return this; - } - - /** - * @return {@link #version} (The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked.). 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 ValueSetDefineComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ValueSetDefineComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked. - */ - public ValueSetDefineComponent 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 #caseSensitive} (If code comparison is case sensitive when codes within this system are compared to each other.). This is the underlying object with id, value and extensions. The accessor "getCaseSensitive" gives direct access to the value - */ - public BooleanType getCaseSensitiveElement() { - if (this.caseSensitive == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetDefineComponent.caseSensitive"); - else if (Configuration.doAutoCreate()) - this.caseSensitive = new BooleanType(); // bb - return this.caseSensitive; - } - - public boolean hasCaseSensitiveElement() { - return this.caseSensitive != null && !this.caseSensitive.isEmpty(); - } - - public boolean hasCaseSensitive() { - return this.caseSensitive != null && !this.caseSensitive.isEmpty(); - } - - /** - * @param value {@link #caseSensitive} (If code comparison is case sensitive when codes within this system are compared to each other.). This is the underlying object with id, value and extensions. The accessor "getCaseSensitive" gives direct access to the value - */ - public ValueSetDefineComponent setCaseSensitiveElement(BooleanType value) { - this.caseSensitive = value; - return this; - } - - /** - * @return If code comparison is case sensitive when codes within this system are compared to each other. - */ - public boolean getCaseSensitive() { - return this.caseSensitive == null || this.caseSensitive.isEmpty() ? false : this.caseSensitive.getValue(); - } - - /** - * @param value If code comparison is case sensitive when codes within this system are compared to each other. - */ - public ValueSetDefineComponent setCaseSensitive(boolean value) { - if (this.caseSensitive == null) - this.caseSensitive = new BooleanType(); - this.caseSensitive.setValue(value); - return this; - } - - /** - * @return {@link #concept} (Concepts in the code system.) - */ - public List getConcept() { - if (this.concept == null) - this.concept = new ArrayList(); - return this.concept; - } - - public boolean hasConcept() { - if (this.concept == null) - return false; - for (ConceptDefinitionComponent item : this.concept) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #concept} (Concepts in the code system.) - */ - // syntactic sugar - public ConceptDefinitionComponent addConcept() { //3 - ConceptDefinitionComponent t = new ConceptDefinitionComponent(); - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return t; - } - - // syntactic sugar - public ValueSetDefineComponent addConcept(ConceptDefinitionComponent t) { //3 - if (t == null) - return this; - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("system", "uri", "An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("version", "string", "The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("caseSensitive", "boolean", "If code comparison is case sensitive when codes within this system are compared to each other.", 0, java.lang.Integer.MAX_VALUE, caseSensitive)); - childrenList.add(new Property("concept", "", "Concepts in the code system.", 0, java.lang.Integer.MAX_VALUE, concept)); - } - - public ValueSetDefineComponent copy() { - ValueSetDefineComponent dst = new ValueSetDefineComponent(); - copyValues(dst); - dst.system = system == null ? null : system.copy(); - dst.version = version == null ? null : version.copy(); - dst.caseSensitive = caseSensitive == null ? null : caseSensitive.copy(); - if (concept != null) { - dst.concept = new ArrayList(); - for (ConceptDefinitionComponent i : concept) - dst.concept.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ValueSetDefineComponent)) - return false; - ValueSetDefineComponent o = (ValueSetDefineComponent) other; - return compareDeep(system, o.system, true) && compareDeep(version, o.version, true) && compareDeep(caseSensitive, o.caseSensitive, true) - && compareDeep(concept, o.concept, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ValueSetDefineComponent)) - return false; - ValueSetDefineComponent o = (ValueSetDefineComponent) other; - return compareValues(system, o.system, true) && compareValues(version, o.version, true) && compareValues(caseSensitive, o.caseSensitive, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) - && (caseSensitive == null || caseSensitive.isEmpty()) && (concept == null || concept.isEmpty()) - ; - } - - } - - @Block() - public static class ConceptDefinitionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code that identifies concept. - */ - @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Code that identifies concept", formalDefinition="Code that identifies concept." ) - protected CodeType code; - - /** - * If this code is not for use as a real concept. - */ - @Child(name = "abstract_", type = {BooleanType.class}, order=2, min=0, max=1) - @Description(shortDefinition="If this code is not for use as a real concept", formalDefinition="If this code is not for use as a real concept." ) - protected BooleanType abstract_; - - /** - * Text to Display to the user. - */ - @Child(name = "display", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Text to Display to the user", formalDefinition="Text to Display to the user." ) - protected StringType display; - - /** - * The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept. - */ - @Child(name = "definition", type = {StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Formal Definition", formalDefinition="The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept." ) - protected StringType definition; - - /** - * Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc. - */ - @Child(name = "designation", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Additional representations for the concept", formalDefinition="Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc." ) - protected List designation; - - /** - * Child Concepts (is-a / contains). - */ - @Child(name = "concept", type = {ConceptDefinitionComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Child Concepts (is-a / contains)", formalDefinition="Child Concepts (is-a / contains)." ) - protected List concept; - - private static final long serialVersionUID = -318560292L; - - /* - * Constructor - */ - public ConceptDefinitionComponent() { - super(); - } - - /* - * Constructor - */ - public ConceptDefinitionComponent(CodeType code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Code that identifies concept.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptDefinitionComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code that identifies concept.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public ConceptDefinitionComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return Code that identifies concept. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Code that identifies concept. - */ - public ConceptDefinitionComponent setCode(String value) { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #abstract_} (If this code is not for use as a real concept.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value - */ - public BooleanType getAbstractElement() { - if (this.abstract_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptDefinitionComponent.abstract_"); - else if (Configuration.doAutoCreate()) - this.abstract_ = new BooleanType(); // bb - return this.abstract_; - } - - public boolean hasAbstractElement() { - return this.abstract_ != null && !this.abstract_.isEmpty(); - } - - public boolean hasAbstract() { - return this.abstract_ != null && !this.abstract_.isEmpty(); - } - - /** - * @param value {@link #abstract_} (If this code is not for use as a real concept.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value - */ - public ConceptDefinitionComponent setAbstractElement(BooleanType value) { - this.abstract_ = value; - return this; - } - - /** - * @return If this code is not for use as a real concept. - */ - public boolean getAbstract() { - return this.abstract_ == null || this.abstract_.isEmpty() ? false : this.abstract_.getValue(); - } - - /** - * @param value If this code is not for use as a real concept. - */ - public ConceptDefinitionComponent setAbstract(boolean value) { - if (this.abstract_ == null) - this.abstract_ = new BooleanType(); - this.abstract_.setValue(value); - return this; - } - - /** - * @return {@link #display} (Text to Display to the user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptDefinitionComponent.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); // bb - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (Text to Display to the user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public ConceptDefinitionComponent setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return Text to Display to the user. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value Text to Display to the user. - */ - public ConceptDefinitionComponent setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - /** - * @return {@link #definition} (The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public StringType getDefinitionElement() { - if (this.definition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptDefinitionComponent.definition"); - else if (Configuration.doAutoCreate()) - this.definition = new StringType(); // bb - return this.definition; - } - - public boolean hasDefinitionElement() { - return this.definition != null && !this.definition.isEmpty(); - } - - public boolean hasDefinition() { - return this.definition != null && !this.definition.isEmpty(); - } - - /** - * @param value {@link #definition} (The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public ConceptDefinitionComponent setDefinitionElement(StringType value) { - this.definition = value; - return this; - } - - /** - * @return The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept. - */ - public String getDefinition() { - return this.definition == null ? null : this.definition.getValue(); - } - - /** - * @param value The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept. - */ - public ConceptDefinitionComponent setDefinition(String value) { - if (Utilities.noString(value)) - this.definition = null; - else { - if (this.definition == null) - this.definition = new StringType(); - this.definition.setValue(value); - } - return this; - } - - /** - * @return {@link #designation} (Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc.) - */ - public List getDesignation() { - if (this.designation == null) - this.designation = new ArrayList(); - return this.designation; - } - - public boolean hasDesignation() { - if (this.designation == null) - return false; - for (ConceptDefinitionDesignationComponent item : this.designation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #designation} (Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc.) - */ - // syntactic sugar - public ConceptDefinitionDesignationComponent addDesignation() { //3 - ConceptDefinitionDesignationComponent t = new ConceptDefinitionDesignationComponent(); - if (this.designation == null) - this.designation = new ArrayList(); - this.designation.add(t); - return t; - } - - // syntactic sugar - public ConceptDefinitionComponent addDesignation(ConceptDefinitionDesignationComponent t) { //3 - if (t == null) - return this; - if (this.designation == null) - this.designation = new ArrayList(); - this.designation.add(t); - return this; - } - - /** - * @return {@link #concept} (Child Concepts (is-a / contains).) - */ - public List getConcept() { - if (this.concept == null) - this.concept = new ArrayList(); - return this.concept; - } - - public boolean hasConcept() { - if (this.concept == null) - return false; - for (ConceptDefinitionComponent item : this.concept) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #concept} (Child Concepts (is-a / contains).) - */ - // syntactic sugar - public ConceptDefinitionComponent addConcept() { //3 - ConceptDefinitionComponent t = new ConceptDefinitionComponent(); - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return t; - } - - // syntactic sugar - public ConceptDefinitionComponent addConcept(ConceptDefinitionComponent t) { //3 - if (t == null) - return this; - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "Code that identifies concept.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("abstract", "boolean", "If this code is not for use as a real concept.", 0, java.lang.Integer.MAX_VALUE, abstract_)); - childrenList.add(new Property("display", "string", "Text to Display to the user.", 0, java.lang.Integer.MAX_VALUE, display)); - childrenList.add(new Property("definition", "string", "The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept.", 0, java.lang.Integer.MAX_VALUE, definition)); - childrenList.add(new Property("designation", "", "Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc.", 0, java.lang.Integer.MAX_VALUE, designation)); - childrenList.add(new Property("concept", "@ValueSet.define.concept", "Child Concepts (is-a / contains).", 0, java.lang.Integer.MAX_VALUE, concept)); - } - - public ConceptDefinitionComponent copy() { - ConceptDefinitionComponent dst = new ConceptDefinitionComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.abstract_ = abstract_ == null ? null : abstract_.copy(); - dst.display = display == null ? null : display.copy(); - dst.definition = definition == null ? null : definition.copy(); - if (designation != null) { - dst.designation = new ArrayList(); - for (ConceptDefinitionDesignationComponent i : designation) - dst.designation.add(i.copy()); - }; - if (concept != null) { - dst.concept = new ArrayList(); - for (ConceptDefinitionComponent i : concept) - dst.concept.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConceptDefinitionComponent)) - return false; - ConceptDefinitionComponent o = (ConceptDefinitionComponent) other; - return compareDeep(code, o.code, true) && compareDeep(abstract_, o.abstract_, true) && compareDeep(display, o.display, true) - && compareDeep(definition, o.definition, true) && compareDeep(designation, o.designation, true) - && compareDeep(concept, o.concept, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConceptDefinitionComponent)) - return false; - ConceptDefinitionComponent o = (ConceptDefinitionComponent) other; - return compareValues(code, o.code, true) && compareValues(abstract_, o.abstract_, true) && compareValues(display, o.display, true) - && compareValues(definition, o.definition, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (abstract_ == null || abstract_.isEmpty()) - && (display == null || display.isEmpty()) && (definition == null || definition.isEmpty()) - && (designation == null || designation.isEmpty()) && (concept == null || concept.isEmpty()) - ; - } - - } - - @Block() - public static class ConceptDefinitionDesignationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The language this designation is defined for. - */ - @Child(name = "language", type = {CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Language of the designation", formalDefinition="The language this designation is defined for." ) - protected CodeType language; - - /** - * A code that details how this designation would be used. - */ - @Child(name = "use", type = {Coding.class}, order=2, min=0, max=1) - @Description(shortDefinition="Details how this designation would be used", formalDefinition="A code that details how this designation would be used." ) - protected Coding use; - - /** - * The text value for this designation. - */ - @Child(name = "value", type = {StringType.class}, order=3, min=1, max=1) - @Description(shortDefinition="The text value for this designation", formalDefinition="The text value for this designation." ) - protected StringType value; - - private static final long serialVersionUID = 1515662414L; - - /* - * Constructor - */ - public ConceptDefinitionDesignationComponent() { - super(); - } - - /* - * Constructor - */ - public ConceptDefinitionDesignationComponent(StringType value) { - super(); - this.value = value; - } - - /** - * @return {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public CodeType getLanguageElement() { - if (this.language == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.language"); - else if (Configuration.doAutoCreate()) - this.language = new CodeType(); // bb - return this.language; - } - - public boolean hasLanguageElement() { - return this.language != null && !this.language.isEmpty(); - } - - public boolean hasLanguage() { - return this.language != null && !this.language.isEmpty(); - } - - /** - * @param value {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public ConceptDefinitionDesignationComponent setLanguageElement(CodeType value) { - this.language = value; - return this; - } - - /** - * @return The language this designation is defined for. - */ - public String getLanguage() { - return this.language == null ? null : this.language.getValue(); - } - - /** - * @param value The language this designation is defined for. - */ - public ConceptDefinitionDesignationComponent setLanguage(String value) { - if (Utilities.noString(value)) - this.language = null; - else { - if (this.language == null) - this.language = new CodeType(); - this.language.setValue(value); - } - return this; - } - - /** - * @return {@link #use} (A code that details how this designation would be used.) - */ - public Coding getUse() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.use"); - else if (Configuration.doAutoCreate()) - this.use = new Coding(); // cc - return this.use; - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (A code that details how this designation would be used.) - */ - public ConceptDefinitionDesignationComponent setUse(Coding value) { - this.use = value; - return this; - } - - /** - * @return {@link #value} (The text value for this designation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The text value for this designation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public ConceptDefinitionDesignationComponent setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The text value for this designation. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The text value for this designation. - */ - public ConceptDefinitionDesignationComponent setValue(String value) { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("language", "code", "The language this designation is defined for.", 0, java.lang.Integer.MAX_VALUE, language)); - childrenList.add(new Property("use", "Coding", "A code that details how this designation would be used.", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("value", "string", "The text value for this designation.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public ConceptDefinitionDesignationComponent copy() { - ConceptDefinitionDesignationComponent dst = new ConceptDefinitionDesignationComponent(); - copyValues(dst); - dst.language = language == null ? null : language.copy(); - dst.use = use == null ? null : use.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConceptDefinitionDesignationComponent)) - return false; - ConceptDefinitionDesignationComponent o = (ConceptDefinitionDesignationComponent) other; - return compareDeep(language, o.language, true) && compareDeep(use, o.use, true) && compareDeep(value, o.value, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConceptDefinitionDesignationComponent)) - return false; - ConceptDefinitionDesignationComponent o = (ConceptDefinitionDesignationComponent) other; - return compareValues(language, o.language, true) && compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (language == null || language.isEmpty()) && (use == null || use.isEmpty()) - && (value == null || value.isEmpty()); - } - - } - - @Block() - public static class ValueSetComposeComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri. - */ - @Child(name = "import_", type = {UriType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Import the contents of another value set", formalDefinition="Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri." ) - protected List import_; - - /** - * Include one or more codes from a code system. - */ - @Child(name = "include", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Include one or more codes from a code system", formalDefinition="Include one or more codes from a code system." ) - protected List include; - - /** - * Exclude one or more codes from the value set. - */ - @Child(name = "exclude", type = {ConceptSetComponent.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Explicitly exclude codes", formalDefinition="Exclude one or more codes from the value set." ) - protected List exclude; - - private static final long serialVersionUID = -703166694L; - - /* - * Constructor - */ - public ValueSetComposeComponent() { - super(); - } - - /** - * @return {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.) - */ - public List getImport() { - if (this.import_ == null) - this.import_ = new ArrayList(); - return this.import_; - } - - public boolean hasImport() { - if (this.import_ == null) - return false; - for (UriType item : this.import_) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.) - */ - // syntactic sugar - public UriType addImportElement() {//2 - UriType t = new UriType(); - if (this.import_ == null) - this.import_ = new ArrayList(); - this.import_.add(t); - return t; - } - - /** - * @param value {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.) - */ - public ValueSetComposeComponent addImport(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.import_ == null) - this.import_ = new ArrayList(); - this.import_.add(t); - return this; - } - - /** - * @param value {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.) - */ - public boolean hasImport(String value) { - if (this.import_ == null) - return false; - for (UriType v : this.import_) - if (v.equals(value)) // uri - return true; - return false; - } - - /** - * @return {@link #include} (Include one or more codes from a code system.) - */ - public List getInclude() { - if (this.include == null) - this.include = new ArrayList(); - return this.include; - } - - public boolean hasInclude() { - if (this.include == null) - return false; - for (ConceptSetComponent item : this.include) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #include} (Include one or more codes from a code system.) - */ - // syntactic sugar - public ConceptSetComponent addInclude() { //3 - ConceptSetComponent t = new ConceptSetComponent(); - if (this.include == null) - this.include = new ArrayList(); - this.include.add(t); - return t; - } - - // syntactic sugar - public ValueSetComposeComponent addInclude(ConceptSetComponent t) { //3 - if (t == null) - return this; - if (this.include == null) - this.include = new ArrayList(); - this.include.add(t); - return this; - } - - /** - * @return {@link #exclude} (Exclude one or more codes from the value set.) - */ - public List getExclude() { - if (this.exclude == null) - this.exclude = new ArrayList(); - return this.exclude; - } - - public boolean hasExclude() { - if (this.exclude == null) - return false; - for (ConceptSetComponent item : this.exclude) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #exclude} (Exclude one or more codes from the value set.) - */ - // syntactic sugar - public ConceptSetComponent addExclude() { //3 - ConceptSetComponent t = new ConceptSetComponent(); - if (this.exclude == null) - this.exclude = new ArrayList(); - this.exclude.add(t); - return t; - } - - // syntactic sugar - public ValueSetComposeComponent addExclude(ConceptSetComponent t) { //3 - if (t == null) - return this; - if (this.exclude == null) - this.exclude = new ArrayList(); - this.exclude.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("import", "uri", "Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.", 0, java.lang.Integer.MAX_VALUE, import_)); - childrenList.add(new Property("include", "", "Include one or more codes from a code system.", 0, java.lang.Integer.MAX_VALUE, include)); - childrenList.add(new Property("exclude", "@ValueSet.compose.include", "Exclude one or more codes from the value set.", 0, java.lang.Integer.MAX_VALUE, exclude)); - } - - public ValueSetComposeComponent copy() { - ValueSetComposeComponent dst = new ValueSetComposeComponent(); - copyValues(dst); - if (import_ != null) { - dst.import_ = new ArrayList(); - for (UriType i : import_) - dst.import_.add(i.copy()); - }; - if (include != null) { - dst.include = new ArrayList(); - for (ConceptSetComponent i : include) - dst.include.add(i.copy()); - }; - if (exclude != null) { - dst.exclude = new ArrayList(); - for (ConceptSetComponent i : exclude) - dst.exclude.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ValueSetComposeComponent)) - return false; - ValueSetComposeComponent o = (ValueSetComposeComponent) other; - return compareDeep(import_, o.import_, true) && compareDeep(include, o.include, true) && compareDeep(exclude, o.exclude, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ValueSetComposeComponent)) - return false; - ValueSetComposeComponent o = (ValueSetComposeComponent) other; - return compareValues(import_, o.import_, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (import_ == null || import_.isEmpty()) && (include == null || include.isEmpty()) - && (exclude == null || exclude.isEmpty()); - } - - } - - @Block() - public static class ConceptSetComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An absolute URI which is the code system from which the selected codes come from. - */ - @Child(name = "system", type = {UriType.class}, order=1, min=1, max=1) - @Description(shortDefinition="The system the codes come from", formalDefinition="An absolute URI which is the code system from which the selected codes come from." ) - protected UriType system; - - /** - * The version of the code system that the codes are selected from. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Specific version of the code system referred to", formalDefinition="The version of the code system that the codes are selected from." ) - protected StringType version; - - /** - * Specifies a concept to be included or excluded. - */ - @Child(name = "concept", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A concept defined in the system", formalDefinition="Specifies a concept to be included or excluded." ) - protected List concept; - - /** - * Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true. - */ - @Child(name = "filter", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Select codes/concepts by their properties (including relationships)", formalDefinition="Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true." ) - protected List filter; - - private static final long serialVersionUID = -196054471L; - - /* - * Constructor - */ - public ConceptSetComponent() { - super(); - } - - /* - * Constructor - */ - public ConceptSetComponent(UriType system) { - super(); - this.system = system; - } - - /** - * @return {@link #system} (An absolute URI which is the code system from which the selected codes come from.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public UriType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptSetComponent.system"); - else if (Configuration.doAutoCreate()) - this.system = new UriType(); // bb - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (An absolute URI which is the code system from which the selected codes come from.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public ConceptSetComponent setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return An absolute URI which is the code system from which the selected codes come from. - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value An absolute URI which is the code system from which the selected codes come from. - */ - public ConceptSetComponent setSystem(String value) { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - return this; - } - - /** - * @return {@link #version} (The version of the code system that the codes are selected from.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptSetComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version of the code system that the codes are selected from.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ConceptSetComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version of the code system that the codes are selected from. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version of the code system that the codes are selected from. - */ - public ConceptSetComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #concept} (Specifies a concept to be included or excluded.) - */ - public List getConcept() { - if (this.concept == null) - this.concept = new ArrayList(); - return this.concept; - } - - public boolean hasConcept() { - if (this.concept == null) - return false; - for (ConceptReferenceComponent item : this.concept) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #concept} (Specifies a concept to be included or excluded.) - */ - // syntactic sugar - public ConceptReferenceComponent addConcept() { //3 - ConceptReferenceComponent t = new ConceptReferenceComponent(); - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return t; - } - - // syntactic sugar - public ConceptSetComponent addConcept(ConceptReferenceComponent t) { //3 - if (t == null) - return this; - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return this; - } - - /** - * @return {@link #filter} (Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.) - */ - public List getFilter() { - if (this.filter == null) - this.filter = new ArrayList(); - return this.filter; - } - - public boolean hasFilter() { - if (this.filter == null) - return false; - for (ConceptSetFilterComponent item : this.filter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #filter} (Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.) - */ - // syntactic sugar - public ConceptSetFilterComponent addFilter() { //3 - ConceptSetFilterComponent t = new ConceptSetFilterComponent(); - if (this.filter == null) - this.filter = new ArrayList(); - this.filter.add(t); - return t; - } - - // syntactic sugar - public ConceptSetComponent addFilter(ConceptSetFilterComponent t) { //3 - if (t == null) - return this; - if (this.filter == null) - this.filter = new ArrayList(); - this.filter.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("system", "uri", "An absolute URI which is the code system from which the selected codes come from.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("version", "string", "The version of the code system that the codes are selected from.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("concept", "", "Specifies a concept to be included or excluded.", 0, java.lang.Integer.MAX_VALUE, concept)); - childrenList.add(new Property("filter", "", "Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.", 0, java.lang.Integer.MAX_VALUE, filter)); - } - - public ConceptSetComponent copy() { - ConceptSetComponent dst = new ConceptSetComponent(); - copyValues(dst); - dst.system = system == null ? null : system.copy(); - dst.version = version == null ? null : version.copy(); - if (concept != null) { - dst.concept = new ArrayList(); - for (ConceptReferenceComponent i : concept) - dst.concept.add(i.copy()); - }; - if (filter != null) { - dst.filter = new ArrayList(); - for (ConceptSetFilterComponent i : filter) - dst.filter.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConceptSetComponent)) - return false; - ConceptSetComponent o = (ConceptSetComponent) other; - return compareDeep(system, o.system, true) && compareDeep(version, o.version, true) && compareDeep(concept, o.concept, true) - && compareDeep(filter, o.filter, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConceptSetComponent)) - return false; - ConceptSetComponent o = (ConceptSetComponent) other; - return compareValues(system, o.system, true) && compareValues(version, o.version, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) - && (concept == null || concept.isEmpty()) && (filter == null || filter.isEmpty()); - } - - } - - @Block() - public static class ConceptReferenceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Specifies a code for the concept to be included or excluded. - */ - @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Code or expression from system", formalDefinition="Specifies a code for the concept to be included or excluded." ) - protected CodeType code; - - /** - * The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system. - */ - @Child(name = "display", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Test to display for this code for this value set", formalDefinition="The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system." ) - protected StringType display; - - /** - * Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc. - */ - @Child(name = "designation", type = {ConceptDefinitionDesignationComponent.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Additional representations for this valueset", formalDefinition="Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc." ) - protected List designation; - - private static final long serialVersionUID = -1513912691L; - - /* - * Constructor - */ - public ConceptReferenceComponent() { - super(); - } - - /* - * Constructor - */ - public ConceptReferenceComponent(CodeType code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Specifies a code for the concept to be included or excluded.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptReferenceComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Specifies a code for the concept to be included or excluded.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public ConceptReferenceComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return Specifies a code for the concept to be included or excluded. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Specifies a code for the concept to be included or excluded. - */ - public ConceptReferenceComponent setCode(String value) { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #display} (The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptReferenceComponent.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); // bb - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public ConceptReferenceComponent setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system. - */ - public ConceptReferenceComponent setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - /** - * @return {@link #designation} (Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc.) - */ - public List getDesignation() { - if (this.designation == null) - this.designation = new ArrayList(); - return this.designation; - } - - public boolean hasDesignation() { - if (this.designation == null) - return false; - for (ConceptDefinitionDesignationComponent item : this.designation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #designation} (Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc.) - */ - // syntactic sugar - public ConceptDefinitionDesignationComponent addDesignation() { //3 - ConceptDefinitionDesignationComponent t = new ConceptDefinitionDesignationComponent(); - if (this.designation == null) - this.designation = new ArrayList(); - this.designation.add(t); - return t; - } - - // syntactic sugar - public ConceptReferenceComponent addDesignation(ConceptDefinitionDesignationComponent t) { //3 - if (t == null) - return this; - if (this.designation == null) - this.designation = new ArrayList(); - this.designation.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "Specifies a code for the concept to be included or excluded.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("display", "string", "The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.", 0, java.lang.Integer.MAX_VALUE, display)); - childrenList.add(new Property("designation", "@ValueSet.define.concept.designation", "Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc.", 0, java.lang.Integer.MAX_VALUE, designation)); - } - - public ConceptReferenceComponent copy() { - ConceptReferenceComponent dst = new ConceptReferenceComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.display = display == null ? null : display.copy(); - if (designation != null) { - dst.designation = new ArrayList(); - for (ConceptDefinitionDesignationComponent i : designation) - dst.designation.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConceptReferenceComponent)) - return false; - ConceptReferenceComponent o = (ConceptReferenceComponent) other; - return compareDeep(code, o.code, true) && compareDeep(display, o.display, true) && compareDeep(designation, o.designation, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConceptReferenceComponent)) - return false; - ConceptReferenceComponent o = (ConceptReferenceComponent) other; - return compareValues(code, o.code, true) && compareValues(display, o.display, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (display == null || display.isEmpty()) - && (designation == null || designation.isEmpty()); - } - - } - - @Block() - public static class ConceptSetFilterComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A code that identifies a property defined in the code system. - */ - @Child(name = "property", type = {CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="A property defined by the code system", formalDefinition="A code that identifies a property defined in the code system." ) - protected CodeType property; - - /** - * The kind of operation to perform as a part of the filter criteria. - */ - @Child(name = "op", type = {CodeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="= | is-a | is-not-a | regex | in | not-in", formalDefinition="The kind of operation to perform as a part of the filter criteria." ) - protected Enumeration op; - - /** - * The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value. - */ - @Child(name = "value", type = {CodeType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Code from the system, or regex criteria", formalDefinition="The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value." ) - protected CodeType value; - - private static final long serialVersionUID = 1985515000L; - - /* - * Constructor - */ - public ConceptSetFilterComponent() { - super(); - } - - /* - * Constructor - */ - public ConceptSetFilterComponent(CodeType property, Enumeration op, CodeType value) { - super(); - this.property = property; - this.op = op; - this.value = value; - } - - /** - * @return {@link #property} (A code that identifies a property defined in the code system.). This is the underlying object with id, value and extensions. The accessor "getProperty" gives direct access to the value - */ - public CodeType getPropertyElement() { - if (this.property == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptSetFilterComponent.property"); - else if (Configuration.doAutoCreate()) - this.property = new CodeType(); // bb - return this.property; - } - - public boolean hasPropertyElement() { - return this.property != null && !this.property.isEmpty(); - } - - public boolean hasProperty() { - return this.property != null && !this.property.isEmpty(); - } - - /** - * @param value {@link #property} (A code that identifies a property defined in the code system.). This is the underlying object with id, value and extensions. The accessor "getProperty" gives direct access to the value - */ - public ConceptSetFilterComponent setPropertyElement(CodeType value) { - this.property = value; - return this; - } - - /** - * @return A code that identifies a property defined in the code system. - */ - public String getProperty() { - return this.property == null ? null : this.property.getValue(); - } - - /** - * @param value A code that identifies a property defined in the code system. - */ - public ConceptSetFilterComponent setProperty(String value) { - if (this.property == null) - this.property = new CodeType(); - this.property.setValue(value); - return this; - } - - /** - * @return {@link #op} (The kind of operation to perform as a part of the filter criteria.). This is the underlying object with id, value and extensions. The accessor "getOp" gives direct access to the value - */ - public Enumeration getOpElement() { - if (this.op == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptSetFilterComponent.op"); - else if (Configuration.doAutoCreate()) - this.op = new Enumeration(new FilterOperatorEnumFactory()); // bb - return this.op; - } - - public boolean hasOpElement() { - return this.op != null && !this.op.isEmpty(); - } - - public boolean hasOp() { - return this.op != null && !this.op.isEmpty(); - } - - /** - * @param value {@link #op} (The kind of operation to perform as a part of the filter criteria.). This is the underlying object with id, value and extensions. The accessor "getOp" gives direct access to the value - */ - public ConceptSetFilterComponent setOpElement(Enumeration value) { - this.op = value; - return this; - } - - /** - * @return The kind of operation to perform as a part of the filter criteria. - */ - public FilterOperator getOp() { - return this.op == null ? null : this.op.getValue(); - } - - /** - * @param value The kind of operation to perform as a part of the filter criteria. - */ - public ConceptSetFilterComponent setOp(FilterOperator value) { - if (this.op == null) - this.op = new Enumeration(new FilterOperatorEnumFactory()); - this.op.setValue(value); - return this; - } - - /** - * @return {@link #value} (The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public CodeType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptSetFilterComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new CodeType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public ConceptSetFilterComponent setValueElement(CodeType value) { - this.value = value; - return this; - } - - /** - * @return The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value. - */ - public ConceptSetFilterComponent setValue(String value) { - if (this.value == null) - this.value = new CodeType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("property", "code", "A code that identifies a property defined in the code system.", 0, java.lang.Integer.MAX_VALUE, property)); - childrenList.add(new Property("op", "code", "The kind of operation to perform as a part of the filter criteria.", 0, java.lang.Integer.MAX_VALUE, op)); - childrenList.add(new Property("value", "code", "The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public ConceptSetFilterComponent copy() { - ConceptSetFilterComponent dst = new ConceptSetFilterComponent(); - copyValues(dst); - dst.property = property == null ? null : property.copy(); - dst.op = op == null ? null : op.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConceptSetFilterComponent)) - return false; - ConceptSetFilterComponent o = (ConceptSetFilterComponent) other; - return compareDeep(property, o.property, true) && compareDeep(op, o.op, true) && compareDeep(value, o.value, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConceptSetFilterComponent)) - return false; - ConceptSetFilterComponent o = (ConceptSetFilterComponent) other; - return compareValues(property, o.property, true) && compareValues(op, o.op, true) && compareValues(value, o.value, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (property == null || property.isEmpty()) && (op == null || op.isEmpty()) - && (value == null || value.isEmpty()); - } - - } - - @Block() - public static class ValueSetExpansionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so. - */ - @Child(name = "identifier", type = {UriType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Uniquely identifies this expansion", formalDefinition="An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so." ) - protected UriType identifier; - - /** - * The time at which the expansion was produced by the expanding system. - */ - @Child(name = "timestamp", type = {DateTimeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Time valueset expansion happened", formalDefinition="The time at which the expansion was produced by the expanding system." ) - protected DateTimeType timestamp; - - /** - * A Parameter that controlled the expansion process. These paameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion. - */ - @Child(name = "parameter", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Parameter that controlled the expansion process", formalDefinition="A Parameter that controlled the expansion process. These paameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion." ) - protected List parameter; - - /** - * The codes that are contained in the value set expansion. - */ - @Child(name = "contains", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Codes in the value set", formalDefinition="The codes that are contained in the value set expansion." ) - protected List contains; - - private static final long serialVersionUID = 148339098L; - - /* - * Constructor - */ - public ValueSetExpansionComponent() { - super(); - } - - /* - * Constructor - */ - public ValueSetExpansionComponent(UriType identifier, DateTimeType timestamp) { - super(); - this.identifier = identifier; - this.timestamp = timestamp; - } - - /** - * @return {@link #identifier} (An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public UriType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new UriType(); // bb - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public ValueSetExpansionComponent setIdentifierElement(UriType value) { - this.identifier = value; - return this; - } - - /** - * @return An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so. - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so. - */ - public ValueSetExpansionComponent setIdentifier(String value) { - if (this.identifier == null) - this.identifier = new UriType(); - this.identifier.setValue(value); - return this; - } - - /** - * @return {@link #timestamp} (The time at which the expansion was produced by the expanding system.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value - */ - public DateTimeType getTimestampElement() { - if (this.timestamp == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionComponent.timestamp"); - else if (Configuration.doAutoCreate()) - this.timestamp = new DateTimeType(); // bb - return this.timestamp; - } - - public boolean hasTimestampElement() { - return this.timestamp != null && !this.timestamp.isEmpty(); - } - - public boolean hasTimestamp() { - return this.timestamp != null && !this.timestamp.isEmpty(); - } - - /** - * @param value {@link #timestamp} (The time at which the expansion was produced by the expanding system.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value - */ - public ValueSetExpansionComponent setTimestampElement(DateTimeType value) { - this.timestamp = value; - return this; - } - - /** - * @return The time at which the expansion was produced by the expanding system. - */ - public Date getTimestamp() { - return this.timestamp == null ? null : this.timestamp.getValue(); - } - - /** - * @param value The time at which the expansion was produced by the expanding system. - */ - public ValueSetExpansionComponent setTimestamp(Date value) { - if (this.timestamp == null) - this.timestamp = new DateTimeType(); - this.timestamp.setValue(value); - return this; - } - - /** - * @return {@link #parameter} (A Parameter that controlled the expansion process. These paameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion.) - */ - public List getParameter() { - if (this.parameter == null) - this.parameter = new ArrayList(); - return this.parameter; - } - - public boolean hasParameter() { - if (this.parameter == null) - return false; - for (ValueSetExpansionParameterComponent item : this.parameter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #parameter} (A Parameter that controlled the expansion process. These paameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion.) - */ - // syntactic sugar - public ValueSetExpansionParameterComponent addParameter() { //3 - ValueSetExpansionParameterComponent t = new ValueSetExpansionParameterComponent(); - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return t; - } - - // syntactic sugar - public ValueSetExpansionComponent addParameter(ValueSetExpansionParameterComponent t) { //3 - if (t == null) - return this; - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return this; - } - - /** - * @return {@link #contains} (The codes that are contained in the value set expansion.) - */ - public List getContains() { - if (this.contains == null) - this.contains = new ArrayList(); - return this.contains; - } - - public boolean hasContains() { - if (this.contains == null) - return false; - for (ValueSetExpansionContainsComponent item : this.contains) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contains} (The codes that are contained in the value set expansion.) - */ - // syntactic sugar - public ValueSetExpansionContainsComponent addContains() { //3 - ValueSetExpansionContainsComponent t = new ValueSetExpansionContainsComponent(); - if (this.contains == null) - this.contains = new ArrayList(); - this.contains.add(t); - return t; - } - - // syntactic sugar - public ValueSetExpansionComponent addContains(ValueSetExpansionContainsComponent t) { //3 - if (t == null) - return this; - if (this.contains == null) - this.contains = new ArrayList(); - this.contains.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "uri", "An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("timestamp", "dateTime", "The time at which the expansion was produced by the expanding system.", 0, java.lang.Integer.MAX_VALUE, timestamp)); - childrenList.add(new Property("parameter", "", "A Parameter that controlled the expansion process. These paameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion.", 0, java.lang.Integer.MAX_VALUE, parameter)); - childrenList.add(new Property("contains", "", "The codes that are contained in the value set expansion.", 0, java.lang.Integer.MAX_VALUE, contains)); - } - - public ValueSetExpansionComponent copy() { - ValueSetExpansionComponent dst = new ValueSetExpansionComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.timestamp = timestamp == null ? null : timestamp.copy(); - if (parameter != null) { - dst.parameter = new ArrayList(); - for (ValueSetExpansionParameterComponent i : parameter) - dst.parameter.add(i.copy()); - }; - if (contains != null) { - dst.contains = new ArrayList(); - for (ValueSetExpansionContainsComponent i : contains) - dst.contains.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ValueSetExpansionComponent)) - return false; - ValueSetExpansionComponent o = (ValueSetExpansionComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(timestamp, o.timestamp, true) - && compareDeep(parameter, o.parameter, true) && compareDeep(contains, o.contains, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ValueSetExpansionComponent)) - return false; - ValueSetExpansionComponent o = (ValueSetExpansionComponent) other; - return compareValues(identifier, o.identifier, true) && compareValues(timestamp, o.timestamp, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (timestamp == null || timestamp.isEmpty()) - && (parameter == null || parameter.isEmpty()) && (contains == null || contains.isEmpty()) - ; - } - - } - - @Block() - public static class ValueSetExpansionParameterComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of the parameter. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Name as assigned by server", formalDefinition="The name of the parameter." ) - protected StringType name; - - /** - * The value of the parameter. - */ - @Child(name = "value", type = {StringType.class, BooleanType.class, IntegerType.class, DecimalType.class, UriType.class, CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Value of the parameter", formalDefinition="The value of the parameter." ) - protected Type value; - - private static final long serialVersionUID = 1172641169L; - - /* - * Constructor - */ - public ValueSetExpansionParameterComponent() { - super(); - } - - /* - * Constructor - */ - public ValueSetExpansionParameterComponent(StringType name) { - super(); - this.name = name; - } - - /** - * @return {@link #name} (The name of the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionParameterComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ValueSetExpansionParameterComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of the parameter. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of the parameter. - */ - public ValueSetExpansionParameterComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #value} (The value of the parameter.) - */ - public Type getValue() { - return this.value; - } - - /** - * @return {@link #value} (The value of the parameter.) - */ - public StringType getValueStringType() throws Exception { - if (!(this.value instanceof StringType)) - throw new Exception("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (StringType) this.value; - } - - /** - * @return {@link #value} (The value of the parameter.) - */ - public BooleanType getValueBooleanType() throws Exception { - if (!(this.value instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (BooleanType) this.value; - } - - /** - * @return {@link #value} (The value of the parameter.) - */ - public IntegerType getValueIntegerType() throws Exception { - if (!(this.value instanceof IntegerType)) - throw new Exception("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (IntegerType) this.value; - } - - /** - * @return {@link #value} (The value of the parameter.) - */ - public DecimalType getValueDecimalType() throws Exception { - if (!(this.value instanceof DecimalType)) - throw new Exception("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (DecimalType) this.value; - } - - /** - * @return {@link #value} (The value of the parameter.) - */ - public UriType getValueUriType() throws Exception { - if (!(this.value instanceof UriType)) - throw new Exception("Type mismatch: the type UriType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (UriType) this.value; - } - - /** - * @return {@link #value} (The value of the parameter.) - */ - public CodeType getValueCodeType() throws Exception { - if (!(this.value instanceof CodeType)) - throw new Exception("Type mismatch: the type CodeType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (CodeType) this.value; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value of the parameter.) - */ - public ValueSetExpansionParameterComponent setValue(Type value) { - this.value = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of the parameter.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("value[x]", "string|boolean|integer|decimal|uri|code", "The value of the parameter.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public ValueSetExpansionParameterComponent copy() { - ValueSetExpansionParameterComponent dst = new ValueSetExpansionParameterComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ValueSetExpansionParameterComponent)) - return false; - ValueSetExpansionParameterComponent o = (ValueSetExpansionParameterComponent) other; - return compareDeep(name, o.name, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ValueSetExpansionParameterComponent)) - return false; - ValueSetExpansionParameterComponent o = (ValueSetExpansionParameterComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - } - - @Block() - public static class ValueSetExpansionContainsComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An absolute URI which is the code system in which the code for this item in the expansion is defined. - */ - @Child(name = "system", type = {UriType.class}, order=1, min=0, max=1) - @Description(shortDefinition="System value for the code", formalDefinition="An absolute URI which is the code system in which the code for this item in the expansion is defined." ) - protected UriType system; - - /** - * If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. - */ - @Child(name = "abstract_", type = {BooleanType.class}, order=2, min=0, max=1) - @Description(shortDefinition="If user cannot select this entry", formalDefinition="If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value." ) - protected BooleanType abstract_; - - /** - * The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence. - */ - @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Version in which this code / display is defined", formalDefinition="The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence." ) - protected StringType version; - - /** - * Code - if blank, this is not a choosable code. - */ - @Child(name = "code", type = {CodeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Code - if blank, this is not a choosable code", formalDefinition="Code - if blank, this is not a choosable code." ) - protected CodeType code; - - /** - * User display for the concept. - */ - @Child(name = "display", type = {StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="User display for the concept", formalDefinition="User display for the concept." ) - protected StringType display; - - /** - * Codes contained in this concept. - */ - @Child(name = "contains", type = {ValueSetExpansionContainsComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Codes contained in this concept", formalDefinition="Codes contained in this concept." ) - protected List contains; - - private static final long serialVersionUID = -2038349483L; - - /* - * Constructor - */ - public ValueSetExpansionContainsComponent() { - super(); - } - - /** - * @return {@link #system} (An absolute URI which is the code system in which the code for this item in the expansion is defined.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public UriType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.system"); - else if (Configuration.doAutoCreate()) - this.system = new UriType(); // bb - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (An absolute URI which is the code system in which the code for this item in the expansion is defined.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public ValueSetExpansionContainsComponent setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return An absolute URI which is the code system in which the code for this item in the expansion is defined. - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value An absolute URI which is the code system in which the code for this item in the expansion is defined. - */ - public ValueSetExpansionContainsComponent setSystem(String value) { - if (Utilities.noString(value)) - this.system = null; - else { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - } - return this; - } - - /** - * @return {@link #abstract_} (If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value - */ - public BooleanType getAbstractElement() { - if (this.abstract_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.abstract_"); - else if (Configuration.doAutoCreate()) - this.abstract_ = new BooleanType(); // bb - return this.abstract_; - } - - public boolean hasAbstractElement() { - return this.abstract_ != null && !this.abstract_.isEmpty(); - } - - public boolean hasAbstract() { - return this.abstract_ != null && !this.abstract_.isEmpty(); - } - - /** - * @param value {@link #abstract_} (If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value - */ - public ValueSetExpansionContainsComponent setAbstractElement(BooleanType value) { - this.abstract_ = value; - return this; - } - - /** - * @return If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. - */ - public boolean getAbstract() { - return this.abstract_ == null || this.abstract_.isEmpty() ? false : this.abstract_.getValue(); - } - - /** - * @param value If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. - */ - public ValueSetExpansionContainsComponent setAbstract(boolean value) { - if (this.abstract_ == null) - this.abstract_ = new BooleanType(); - this.abstract_.setValue(value); - return this; - } - - /** - * @return {@link #version} (The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ValueSetExpansionContainsComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence. - */ - public ValueSetExpansionContainsComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (Code - if blank, this is not a choosable code.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code - if blank, this is not a choosable code.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public ValueSetExpansionContainsComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return Code - if blank, this is not a choosable code. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Code - if blank, this is not a choosable code. - */ - public ValueSetExpansionContainsComponent setCode(String value) { - if (Utilities.noString(value)) - this.code = null; - else { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - } - return this; - } - - /** - * @return {@link #display} (User display for the concept.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); // bb - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (User display for the concept.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public ValueSetExpansionContainsComponent setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return User display for the concept. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value User display for the concept. - */ - public ValueSetExpansionContainsComponent setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - /** - * @return {@link #contains} (Codes contained in this concept.) - */ - public List getContains() { - if (this.contains == null) - this.contains = new ArrayList(); - return this.contains; - } - - public boolean hasContains() { - if (this.contains == null) - return false; - for (ValueSetExpansionContainsComponent item : this.contains) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contains} (Codes contained in this concept.) - */ - // syntactic sugar - public ValueSetExpansionContainsComponent addContains() { //3 - ValueSetExpansionContainsComponent t = new ValueSetExpansionContainsComponent(); - if (this.contains == null) - this.contains = new ArrayList(); - this.contains.add(t); - return t; - } - - // syntactic sugar - public ValueSetExpansionContainsComponent addContains(ValueSetExpansionContainsComponent t) { //3 - if (t == null) - return this; - if (this.contains == null) - this.contains = new ArrayList(); - this.contains.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("system", "uri", "An absolute URI which is the code system in which the code for this item in the expansion is defined.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("abstract", "boolean", "If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.", 0, java.lang.Integer.MAX_VALUE, abstract_)); - childrenList.add(new Property("version", "string", "The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("code", "code", "Code - if blank, this is not a choosable code.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("display", "string", "User display for the concept.", 0, java.lang.Integer.MAX_VALUE, display)); - childrenList.add(new Property("contains", "@ValueSet.expansion.contains", "Codes contained in this concept.", 0, java.lang.Integer.MAX_VALUE, contains)); - } - - public ValueSetExpansionContainsComponent copy() { - ValueSetExpansionContainsComponent dst = new ValueSetExpansionContainsComponent(); - copyValues(dst); - dst.system = system == null ? null : system.copy(); - dst.abstract_ = abstract_ == null ? null : abstract_.copy(); - dst.version = version == null ? null : version.copy(); - dst.code = code == null ? null : code.copy(); - dst.display = display == null ? null : display.copy(); - if (contains != null) { - dst.contains = new ArrayList(); - for (ValueSetExpansionContainsComponent i : contains) - dst.contains.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ValueSetExpansionContainsComponent)) - return false; - ValueSetExpansionContainsComponent o = (ValueSetExpansionContainsComponent) other; - return compareDeep(system, o.system, true) && compareDeep(abstract_, o.abstract_, true) && compareDeep(version, o.version, true) - && compareDeep(code, o.code, true) && compareDeep(display, o.display, true) && compareDeep(contains, o.contains, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ValueSetExpansionContainsComponent)) - return false; - ValueSetExpansionContainsComponent o = (ValueSetExpansionContainsComponent) other; - return compareValues(system, o.system, true) && compareValues(abstract_, o.abstract_, true) && compareValues(version, o.version, true) - && compareValues(code, o.code, true) && compareValues(display, o.display, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (system == null || system.isEmpty()) && (abstract_ == null || abstract_.isEmpty()) - && (version == null || version.isEmpty()) && (code == null || code.isEmpty()) && (display == null || display.isEmpty()) - && (contains == null || contains.isEmpty()); - } - - } - - /** - * An absolute uri that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). - */ - @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Globally unique logical id for value set", formalDefinition="An absolute uri that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:)." ) - protected UriType url; - - /** - * Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) - @Description(shortDefinition="Additional identifier for the value set (v2 / CDA)", formalDefinition="Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance." ) - protected Identifier identifier; - - /** - * Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Logical id for this version of the value set", formalDefinition="Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) - protected StringType version; - - /** - * A free text natural language name describing the value set. - */ - @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Informal name for this value set", formalDefinition="A free text natural language name describing the value set." ) - protected StringType name; - - /** - * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions. - */ - @Child(name = "useContext", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions." ) - protected List useContext; - - /** - * If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change. - */ - @Child(name = "immutable", type = {BooleanType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Indicates whether or not any change to the content logical definition may occur", formalDefinition="If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change." ) - protected BooleanType immutable; - - /** - * The name of the individual or organization that published the value set. - */ - @Child(name = "publisher", type = {StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the value set." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set. - */ - @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Human language description of the value set", formalDefinition="A free text natural language description of the use of the value set - reason for definition, 'the semantic space' to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set." ) - protected StringType description; - - /** - * Explains why this value set is needed and why it's been constrained as it has. - */ - @Child(name = "requirements", type = {StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Why is this needed?", formalDefinition="Explains why this value set is needed and why it's been constrained as it has." ) - protected StringType requirements; - - /** - * A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set. - */ - @Child(name = "copyright", type = {StringType.class}, order=10, min=0, max=1) - @Description(shortDefinition="Use and/or Publishing restrictions", formalDefinition="A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set." ) - protected StringType copyright; - - /** - * The status of the value set. - */ - @Child(name = "status", type = {CodeType.class}, order=11, min=1, max=1) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the value set." ) - protected Enumeration status; - - /** - * This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name = "experimental", type = {BooleanType.class}, order=12, min=0, max=1) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * Whether this is intended to be used with an extensible binding or not. - */ - @Child(name = "extensible", type = {BooleanType.class}, order=13, min=0, max=1) - @Description(shortDefinition="Whether this is intended to be used with an extensible binding", formalDefinition="Whether this is intended to be used with an extensible binding or not." ) - protected BooleanType extensible; - - /** - * The date that the value set status was last changed. - */ - @Child(name = "date", type = {DateTimeType.class}, order=14, min=0, max=1) - @Description(shortDefinition="Date for given status", formalDefinition="The date that the value set status was last changed." ) - protected DateTimeType date; - - /** - * If a Locked Date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value sets as of the Locked Date. - */ - @Child(name = "lockedDate", type = {DateType.class}, order=15, min=0, max=1) - @Description(shortDefinition="Fixed date for all referenced code systems and value sets", formalDefinition="If a Locked Date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value sets as of the Locked Date." ) - protected DateType lockedDate; - - /** - * A definition of an code system, inlined into the value set. - */ - @Child(name = "define", type = {}, order=16, min=0, max=1) - @Description(shortDefinition="When value set defines its own codes", formalDefinition="A definition of an code system, inlined into the value set." ) - protected ValueSetDefineComponent define; - - /** - * When value set includes codes from elsewhere. - */ - @Child(name = "compose", type = {}, order=17, min=0, max=1) - @Description(shortDefinition="When value set includes codes from elsewhere", formalDefinition="When value set includes codes from elsewhere." ) - protected ValueSetComposeComponent compose; - - /** - * A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed. - */ - @Child(name = "expansion", type = {}, order=18, min=0, max=1) - @Description(shortDefinition="Used when the value set is 'expanded'", formalDefinition="A value set can also be 'expanded', where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed." ) - protected ValueSetExpansionComponent expansion; - - private static final long serialVersionUID = 121117080L; - - /* - * Constructor - */ - public ValueSet() { - super(); - } - - /* - * Constructor - */ - public ValueSet(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #url} (An absolute uri that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute uri that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public ValueSet setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute uri that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute uri that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). - */ - public ValueSet setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #identifier} (Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance.) - */ - public ValueSet setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #version} (Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ValueSet setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public ValueSet setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A free text natural language name describing the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A free text natural language name describing the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ValueSet setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name describing the value set. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name describing the value set. - */ - public ValueSet setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions.) - */ - public List getUseContext() { - if (this.useContext == null) - this.useContext = new ArrayList(); - return this.useContext; - } - - public boolean hasUseContext() { - if (this.useContext == null) - return false; - for (CodeableConcept item : this.useContext) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions.) - */ - // syntactic sugar - public CodeableConcept addUseContext() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return t; - } - - // syntactic sugar - public ValueSet addUseContext(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return this; - } - - /** - * @return {@link #immutable} (If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change.). This is the underlying object with id, value and extensions. The accessor "getImmutable" gives direct access to the value - */ - public BooleanType getImmutableElement() { - if (this.immutable == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.immutable"); - else if (Configuration.doAutoCreate()) - this.immutable = new BooleanType(); // bb - return this.immutable; - } - - public boolean hasImmutableElement() { - return this.immutable != null && !this.immutable.isEmpty(); - } - - public boolean hasImmutable() { - return this.immutable != null && !this.immutable.isEmpty(); - } - - /** - * @param value {@link #immutable} (If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change.). This is the underlying object with id, value and extensions. The accessor "getImmutable" gives direct access to the value - */ - public ValueSet setImmutableElement(BooleanType value) { - this.immutable = value; - return this; - } - - /** - * @return If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change. - */ - public boolean getImmutable() { - return this.immutable == null || this.immutable.isEmpty() ? false : this.immutable.getValue(); - } - - /** - * @param value If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change. - */ - public ValueSet setImmutable(boolean value) { - if (this.immutable == null) - this.immutable = new BooleanType(); - this.immutable.setValue(value); - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the value set.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the value set.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public ValueSet setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the value set. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the value set. - */ - public ValueSet setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (ValueSetContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public ValueSetContactComponent addContact() { //3 - ValueSetContactComponent t = new ValueSetContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public ValueSet addContact(ValueSetContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #description} (A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ValueSet setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set. - */ - public ValueSet setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #requirements} (Explains why this value set is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); // bb - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (Explains why this value set is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public ValueSet setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return Explains why this value set is needed and why it's been constrained as it has. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value Explains why this value set is needed and why it's been constrained as it has. - */ - public ValueSet setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #copyright} (A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public StringType getCopyrightElement() { - if (this.copyright == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.copyright"); - else if (Configuration.doAutoCreate()) - this.copyright = new StringType(); // bb - return this.copyright; - } - - public boolean hasCopyrightElement() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - public boolean hasCopyright() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - /** - * @param value {@link #copyright} (A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public ValueSet setCopyrightElement(StringType value) { - this.copyright = value; - return this; - } - - /** - * @return A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set. - */ - public String getCopyright() { - return this.copyright == null ? null : this.copyright.getValue(); - } - - /** - * @param value A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set. - */ - public ValueSet setCopyright(String value) { - if (Utilities.noString(value)) - this.copyright = null; - else { - if (this.copyright == null) - this.copyright = new StringType(); - this.copyright.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of the value set.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the value set.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public ValueSet setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the value set. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the value set. - */ - public ValueSet setStatus(ConformanceResourceStatus value) { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #experimental} (This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); // bb - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public ValueSet setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); - } - - /** - * @param value This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public ValueSet setExperimental(boolean value) { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - return this; - } - - /** - * @return {@link #extensible} (Whether this is intended to be used with an extensible binding or not.). This is the underlying object with id, value and extensions. The accessor "getExtensible" gives direct access to the value - */ - public BooleanType getExtensibleElement() { - if (this.extensible == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.extensible"); - else if (Configuration.doAutoCreate()) - this.extensible = new BooleanType(); // bb - return this.extensible; - } - - public boolean hasExtensibleElement() { - return this.extensible != null && !this.extensible.isEmpty(); - } - - public boolean hasExtensible() { - return this.extensible != null && !this.extensible.isEmpty(); - } - - /** - * @param value {@link #extensible} (Whether this is intended to be used with an extensible binding or not.). This is the underlying object with id, value and extensions. The accessor "getExtensible" gives direct access to the value - */ - public ValueSet setExtensibleElement(BooleanType value) { - this.extensible = value; - return this; - } - - /** - * @return Whether this is intended to be used with an extensible binding or not. - */ - public boolean getExtensible() { - return this.extensible == null || this.extensible.isEmpty() ? false : this.extensible.getValue(); - } - - /** - * @param value Whether this is intended to be used with an extensible binding or not. - */ - public ValueSet setExtensible(boolean value) { - if (this.extensible == null) - this.extensible = new BooleanType(); - this.extensible.setValue(value); - return this; - } - - /** - * @return {@link #date} (The date that the value set status was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date that the value set status was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ValueSet setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date that the value set status was last changed. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date that the value set status was last changed. - */ - public ValueSet setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #lockedDate} (If a Locked Date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value sets as of the Locked Date.). This is the underlying object with id, value and extensions. The accessor "getLockedDate" gives direct access to the value - */ - public DateType getLockedDateElement() { - if (this.lockedDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.lockedDate"); - else if (Configuration.doAutoCreate()) - this.lockedDate = new DateType(); // bb - return this.lockedDate; - } - - public boolean hasLockedDateElement() { - return this.lockedDate != null && !this.lockedDate.isEmpty(); - } - - public boolean hasLockedDate() { - return this.lockedDate != null && !this.lockedDate.isEmpty(); - } - - /** - * @param value {@link #lockedDate} (If a Locked Date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value sets as of the Locked Date.). This is the underlying object with id, value and extensions. The accessor "getLockedDate" gives direct access to the value - */ - public ValueSet setLockedDateElement(DateType value) { - this.lockedDate = value; - return this; - } - - /** - * @return If a Locked Date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value sets as of the Locked Date. - */ - public Date getLockedDate() { - return this.lockedDate == null ? null : this.lockedDate.getValue(); - } - - /** - * @param value If a Locked Date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value sets as of the Locked Date. - */ - public ValueSet setLockedDate(Date value) { - if (value == null) - this.lockedDate = null; - else { - if (this.lockedDate == null) - this.lockedDate = new DateType(); - this.lockedDate.setValue(value); - } - return this; - } - - /** - * @return {@link #define} (A definition of an code system, inlined into the value set.) - */ - public ValueSetDefineComponent getDefine() { - if (this.define == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.define"); - else if (Configuration.doAutoCreate()) - this.define = new ValueSetDefineComponent(); // cc - return this.define; - } - - public boolean hasDefine() { - return this.define != null && !this.define.isEmpty(); - } - - /** - * @param value {@link #define} (A definition of an code system, inlined into the value set.) - */ - public ValueSet setDefine(ValueSetDefineComponent value) { - this.define = value; - return this; - } - - /** - * @return {@link #compose} (When value set includes codes from elsewhere.) - */ - public ValueSetComposeComponent getCompose() { - if (this.compose == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.compose"); - else if (Configuration.doAutoCreate()) - this.compose = new ValueSetComposeComponent(); // cc - return this.compose; - } - - public boolean hasCompose() { - return this.compose != null && !this.compose.isEmpty(); - } - - /** - * @param value {@link #compose} (When value set includes codes from elsewhere.) - */ - public ValueSet setCompose(ValueSetComposeComponent value) { - this.compose = value; - return this; - } - - /** - * @return {@link #expansion} (A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.) - */ - public ValueSetExpansionComponent getExpansion() { - if (this.expansion == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.expansion"); - else if (Configuration.doAutoCreate()) - this.expansion = new ValueSetExpansionComponent(); // cc - return this.expansion; - } - - public boolean hasExpansion() { - return this.expansion != null && !this.expansion.isEmpty(); - } - - /** - * @param value {@link #expansion} (A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.) - */ - public ValueSet setExpansion(ValueSetExpansionComponent value) { - this.expansion = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute uri that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("name", "string", "A free text natural language name describing the value set.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions.", 0, java.lang.Integer.MAX_VALUE, useContext)); - childrenList.add(new Property("immutable", "boolean", "If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change.", 0, java.lang.Integer.MAX_VALUE, immutable)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the value set.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("description", "string", "A free text natural language description of the use of the value set - reason for definition, 'the semantic space' to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("requirements", "string", "Explains why this value set is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("copyright", "string", "A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set.", 0, java.lang.Integer.MAX_VALUE, copyright)); - childrenList.add(new Property("status", "code", "The status of the value set.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("extensible", "boolean", "Whether this is intended to be used with an extensible binding or not.", 0, java.lang.Integer.MAX_VALUE, extensible)); - childrenList.add(new Property("date", "dateTime", "The date that the value set status was last changed.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("lockedDate", "date", "If a Locked Date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value sets as of the Locked Date.", 0, java.lang.Integer.MAX_VALUE, lockedDate)); - childrenList.add(new Property("define", "", "A definition of an code system, inlined into the value set.", 0, java.lang.Integer.MAX_VALUE, define)); - childrenList.add(new Property("compose", "", "When value set includes codes from elsewhere.", 0, java.lang.Integer.MAX_VALUE, compose)); - childrenList.add(new Property("expansion", "", "A value set can also be 'expanded', where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.", 0, java.lang.Integer.MAX_VALUE, expansion)); - } - - public ValueSet copy() { - ValueSet dst = new ValueSet(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.version = version == null ? null : version.copy(); - dst.name = name == null ? null : name.copy(); - if (useContext != null) { - dst.useContext = new ArrayList(); - for (CodeableConcept i : useContext) - dst.useContext.add(i.copy()); - }; - dst.immutable = immutable == null ? null : immutable.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (ValueSetContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - dst.requirements = requirements == null ? null : requirements.copy(); - dst.copyright = copyright == null ? null : copyright.copy(); - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.extensible = extensible == null ? null : extensible.copy(); - dst.date = date == null ? null : date.copy(); - dst.lockedDate = lockedDate == null ? null : lockedDate.copy(); - dst.define = define == null ? null : define.copy(); - dst.compose = compose == null ? null : compose.copy(); - dst.expansion = expansion == null ? null : expansion.copy(); - return dst; - } - - protected ValueSet typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ValueSet)) - return false; - ValueSet o = (ValueSet) other; - return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) - && compareDeep(name, o.name, true) && compareDeep(useContext, o.useContext, true) && compareDeep(immutable, o.immutable, true) - && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(description, o.description, true) - && compareDeep(requirements, o.requirements, true) && compareDeep(copyright, o.copyright, true) - && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) && compareDeep(extensible, o.extensible, true) - && compareDeep(date, o.date, true) && compareDeep(lockedDate, o.lockedDate, true) && compareDeep(define, o.define, true) - && compareDeep(compose, o.compose, true) && compareDeep(expansion, o.expansion, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ValueSet)) - return false; - ValueSet o = (ValueSet) other; - return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) - && compareValues(immutable, o.immutable, true) && compareValues(publisher, o.publisher, true) && compareValues(description, o.description, true) - && compareValues(requirements, o.requirements, true) && compareValues(copyright, o.copyright, true) - && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(extensible, o.extensible, true) - && compareValues(date, o.date, true) && compareValues(lockedDate, o.lockedDate, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (useContext == null || useContext.isEmpty()) - && (immutable == null || immutable.isEmpty()) && (publisher == null || publisher.isEmpty()) - && (contact == null || contact.isEmpty()) && (description == null || description.isEmpty()) - && (requirements == null || requirements.isEmpty()) && (copyright == null || copyright.isEmpty()) - && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) - && (extensible == null || extensible.isEmpty()) && (date == null || date.isEmpty()) && (lockedDate == null || lockedDate.isEmpty()) - && (define == null || define.isEmpty()) && (compose == null || compose.isEmpty()) && (expansion == null || expansion.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ValueSet; - } - - @SearchParamDefinition(name="system", path="ValueSet.define.system", description="The system for any codes defined by this value set", type="uri" ) - public static final String SP_SYSTEM = "system"; - @SearchParamDefinition(name="expansion", path="ValueSet.expansion.identifier", description="Uniquely identifies this expansion", type="uri" ) - public static final String SP_EXPANSION = "expansion"; - @SearchParamDefinition(name="status", path="ValueSet.status", description="The status of the value set", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="description", path="ValueSet.description", description="Text search in the description of the value set", type="string" ) - public static final String SP_DESCRIPTION = "description"; - @SearchParamDefinition(name="name", path="ValueSet.name", description="The name of the value set", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="context", path="ValueSet.useContext", description="A use context assigned to the value set", type="token" ) - public static final String SP_CONTEXT = "context"; - @SearchParamDefinition(name="code", path="ValueSet.define.concept.code", description="A code defined in the value set", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="date", path="ValueSet.date", description="The value set publication date", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="identifier", path="ValueSet.identifier", description="The identifier for the value set", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="reference", path="ValueSet.compose.include.system", description="A code system included or excluded in the value set or an imported value set", type="uri" ) - public static final String SP_REFERENCE = "reference"; - @SearchParamDefinition(name="url", path="ValueSet.url", description="The logical url for the value set", type="uri" ) - public static final String SP_URL = "url"; - @SearchParamDefinition(name="publisher", path="ValueSet.publisher", description="Name of the publisher of the value set", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - @SearchParamDefinition(name="version", path="ValueSet.version", description="The version identifier of the value set", type="token" ) - public static final String SP_VERSION = "version"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import java.util.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.Enumerations.*; +import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * A value set specifies a set of codes drawn from one or more code systems. + */ +@ResourceDef(name="ValueSet", profile="http://hl7.org/fhir/Profile/ValueSet") +public class ValueSet extends DomainResource { + + public enum FilterOperator { + /** + * The specified property of the code equals the provided value. + */ + EQUAL, + /** + * Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself. + */ + ISA, + /** + * The specified property of the code does not have an is-a relationship with the provided value. + */ + ISNOTA, + /** + * The specified property of the code matches the regex specified in the provided value. + */ + REGEX, + /** + * The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list). + */ + IN, + /** + * The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list). + */ + NOTIN, + /** + * added to help the parsers + */ + NULL; + public static FilterOperator fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("=".equals(codeString)) + return EQUAL; + if ("is-a".equals(codeString)) + return ISA; + if ("is-not-a".equals(codeString)) + return ISNOTA; + if ("regex".equals(codeString)) + return REGEX; + if ("in".equals(codeString)) + return IN; + if ("not-in".equals(codeString)) + return NOTIN; + throw new Exception("Unknown FilterOperator code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case EQUAL: return "="; + case ISA: return "is-a"; + case ISNOTA: return "is-not-a"; + case REGEX: return "regex"; + case IN: return "in"; + case NOTIN: return "not-in"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case EQUAL: return ""; + case ISA: return ""; + case ISNOTA: return ""; + case REGEX: return ""; + case IN: return ""; + case NOTIN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case EQUAL: return "The specified property of the code equals the provided value."; + case ISA: return "Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself."; + case ISNOTA: return "The specified property of the code does not have an is-a relationship with the provided value."; + case REGEX: return "The specified property of the code matches the regex specified in the provided value."; + case IN: return "The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list)."; + case NOTIN: return "The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case EQUAL: return " "; + case ISA: return "Is A"; + case ISNOTA: return "Is Not A"; + case REGEX: return "Regex"; + case IN: return "In"; + case NOTIN: return "Not In"; + default: return "?"; + } + } + } + + public static class FilterOperatorEnumFactory implements EnumFactory { + public FilterOperator fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("=".equals(codeString)) + return FilterOperator.EQUAL; + if ("is-a".equals(codeString)) + return FilterOperator.ISA; + if ("is-not-a".equals(codeString)) + return FilterOperator.ISNOTA; + if ("regex".equals(codeString)) + return FilterOperator.REGEX; + if ("in".equals(codeString)) + return FilterOperator.IN; + if ("not-in".equals(codeString)) + return FilterOperator.NOTIN; + throw new IllegalArgumentException("Unknown FilterOperator code '"+codeString+"'"); + } + public String toCode(FilterOperator code) { + if (code == FilterOperator.EQUAL) + return "="; + if (code == FilterOperator.ISA) + return "is-a"; + if (code == FilterOperator.ISNOTA) + return "is-not-a"; + if (code == FilterOperator.REGEX) + return "regex"; + if (code == FilterOperator.IN) + return "in"; + if (code == FilterOperator.NOTIN) + return "not-in"; + return "?"; + } + } + + @Block() + public static class ValueSetContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the value set. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Name of a individual to contact", formalDefinition="The name of an individual to contact regarding the value set." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /* + * Constructor + */ + public ValueSetContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The name of an individual to contact regarding the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ValueSetContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the value set. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the value set. + */ + public ValueSetContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public ValueSetContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the value set.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + public ValueSetContactComponent copy() { + ValueSetContactComponent dst = new ValueSetContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ValueSetContactComponent)) + return false; + ValueSetContactComponent o = (ValueSetContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ValueSetContactComponent)) + return false; + ValueSetContactComponent o = (ValueSetContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + } + + @Block() + public static class ValueSetDefineComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system. + */ + @Child(name = "system", type = {UriType.class}, order=1, min=1, max=1) + @Description(shortDefinition="URI to identify the code system", formalDefinition="An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system." ) + protected UriType system; + + /** + * The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Version of this system", formalDefinition="The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked." ) + protected StringType version; + + /** + * If code comparison is case sensitive when codes within this system are compared to each other. + */ + @Child(name = "caseSensitive", type = {BooleanType.class}, order=3, min=0, max=1) + @Description(shortDefinition="If code comparison is case sensitive", formalDefinition="If code comparison is case sensitive when codes within this system are compared to each other." ) + protected BooleanType caseSensitive; + + /** + * Concepts in the code system. + */ + @Child(name = "concept", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Concepts in the code system", formalDefinition="Concepts in the code system." ) + protected List concept; + + private static final long serialVersionUID = -1109401192L; + + /* + * Constructor + */ + public ValueSetDefineComponent() { + super(); + } + + /* + * Constructor + */ + public ValueSetDefineComponent(UriType system) { + super(); + this.system = system; + } + + /** + * @return {@link #system} (An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public UriType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetDefineComponent.system"); + else if (Configuration.doAutoCreate()) + this.system = new UriType(); // bb + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public ValueSetDefineComponent setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system. + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system. + */ + public ValueSetDefineComponent setSystem(String value) { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + return this; + } + + /** + * @return {@link #version} (The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked.). 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 ValueSetDefineComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ValueSetDefineComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked. + */ + public ValueSetDefineComponent 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 #caseSensitive} (If code comparison is case sensitive when codes within this system are compared to each other.). This is the underlying object with id, value and extensions. The accessor "getCaseSensitive" gives direct access to the value + */ + public BooleanType getCaseSensitiveElement() { + if (this.caseSensitive == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetDefineComponent.caseSensitive"); + else if (Configuration.doAutoCreate()) + this.caseSensitive = new BooleanType(); // bb + return this.caseSensitive; + } + + public boolean hasCaseSensitiveElement() { + return this.caseSensitive != null && !this.caseSensitive.isEmpty(); + } + + public boolean hasCaseSensitive() { + return this.caseSensitive != null && !this.caseSensitive.isEmpty(); + } + + /** + * @param value {@link #caseSensitive} (If code comparison is case sensitive when codes within this system are compared to each other.). This is the underlying object with id, value and extensions. The accessor "getCaseSensitive" gives direct access to the value + */ + public ValueSetDefineComponent setCaseSensitiveElement(BooleanType value) { + this.caseSensitive = value; + return this; + } + + /** + * @return If code comparison is case sensitive when codes within this system are compared to each other. + */ + public boolean getCaseSensitive() { + return this.caseSensitive == null || this.caseSensitive.isEmpty() ? false : this.caseSensitive.getValue(); + } + + /** + * @param value If code comparison is case sensitive when codes within this system are compared to each other. + */ + public ValueSetDefineComponent setCaseSensitive(boolean value) { + if (this.caseSensitive == null) + this.caseSensitive = new BooleanType(); + this.caseSensitive.setValue(value); + return this; + } + + /** + * @return {@link #concept} (Concepts in the code system.) + */ + public List getConcept() { + if (this.concept == null) + this.concept = new ArrayList(); + return this.concept; + } + + public boolean hasConcept() { + if (this.concept == null) + return false; + for (ConceptDefinitionComponent item : this.concept) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concept} (Concepts in the code system.) + */ + // syntactic sugar + public ConceptDefinitionComponent addConcept() { //3 + ConceptDefinitionComponent t = new ConceptDefinitionComponent(); + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return t; + } + + // syntactic sugar + public ValueSetDefineComponent addConcept(ConceptDefinitionComponent t) { //3 + if (t == null) + return this; + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("system", "uri", "An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("version", "string", "The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("caseSensitive", "boolean", "If code comparison is case sensitive when codes within this system are compared to each other.", 0, java.lang.Integer.MAX_VALUE, caseSensitive)); + childrenList.add(new Property("concept", "", "Concepts in the code system.", 0, java.lang.Integer.MAX_VALUE, concept)); + } + + public ValueSetDefineComponent copy() { + ValueSetDefineComponent dst = new ValueSetDefineComponent(); + copyValues(dst); + dst.system = system == null ? null : system.copy(); + dst.version = version == null ? null : version.copy(); + dst.caseSensitive = caseSensitive == null ? null : caseSensitive.copy(); + if (concept != null) { + dst.concept = new ArrayList(); + for (ConceptDefinitionComponent i : concept) + dst.concept.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ValueSetDefineComponent)) + return false; + ValueSetDefineComponent o = (ValueSetDefineComponent) other; + return compareDeep(system, o.system, true) && compareDeep(version, o.version, true) && compareDeep(caseSensitive, o.caseSensitive, true) + && compareDeep(concept, o.concept, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ValueSetDefineComponent)) + return false; + ValueSetDefineComponent o = (ValueSetDefineComponent) other; + return compareValues(system, o.system, true) && compareValues(version, o.version, true) && compareValues(caseSensitive, o.caseSensitive, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) + && (caseSensitive == null || caseSensitive.isEmpty()) && (concept == null || concept.isEmpty()) + ; + } + + } + + @Block() + public static class ConceptDefinitionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code that identifies concept. + */ + @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Code that identifies concept", formalDefinition="Code that identifies concept." ) + protected CodeType code; + + /** + * If this code is not for use as a real concept. + */ + @Child(name = "abstract_", type = {BooleanType.class}, order=2, min=0, max=1) + @Description(shortDefinition="If this code is not for use as a real concept", formalDefinition="If this code is not for use as a real concept." ) + protected BooleanType abstract_; + + /** + * Text to Display to the user. + */ + @Child(name = "display", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Text to Display to the user", formalDefinition="Text to Display to the user." ) + protected StringType display; + + /** + * The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept. + */ + @Child(name = "definition", type = {StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Formal Definition", formalDefinition="The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept." ) + protected StringType definition; + + /** + * Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc. + */ + @Child(name = "designation", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional representations for the concept", formalDefinition="Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc." ) + protected List designation; + + /** + * Child Concepts (is-a / contains). + */ + @Child(name = "concept", type = {ConceptDefinitionComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Child Concepts (is-a / contains)", formalDefinition="Child Concepts (is-a / contains)." ) + protected List concept; + + private static final long serialVersionUID = -318560292L; + + /* + * Constructor + */ + public ConceptDefinitionComponent() { + super(); + } + + /* + * Constructor + */ + public ConceptDefinitionComponent(CodeType code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Code that identifies concept.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptDefinitionComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code that identifies concept.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public ConceptDefinitionComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return Code that identifies concept. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Code that identifies concept. + */ + public ConceptDefinitionComponent setCode(String value) { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #abstract_} (If this code is not for use as a real concept.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value + */ + public BooleanType getAbstractElement() { + if (this.abstract_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptDefinitionComponent.abstract_"); + else if (Configuration.doAutoCreate()) + this.abstract_ = new BooleanType(); // bb + return this.abstract_; + } + + public boolean hasAbstractElement() { + return this.abstract_ != null && !this.abstract_.isEmpty(); + } + + public boolean hasAbstract() { + return this.abstract_ != null && !this.abstract_.isEmpty(); + } + + /** + * @param value {@link #abstract_} (If this code is not for use as a real concept.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value + */ + public ConceptDefinitionComponent setAbstractElement(BooleanType value) { + this.abstract_ = value; + return this; + } + + /** + * @return If this code is not for use as a real concept. + */ + public boolean getAbstract() { + return this.abstract_ == null || this.abstract_.isEmpty() ? false : this.abstract_.getValue(); + } + + /** + * @param value If this code is not for use as a real concept. + */ + public ConceptDefinitionComponent setAbstract(boolean value) { + if (this.abstract_ == null) + this.abstract_ = new BooleanType(); + this.abstract_.setValue(value); + return this; + } + + /** + * @return {@link #display} (Text to Display to the user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptDefinitionComponent.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); // bb + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (Text to Display to the user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public ConceptDefinitionComponent setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return Text to Display to the user. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value Text to Display to the user. + */ + public ConceptDefinitionComponent setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + /** + * @return {@link #definition} (The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public StringType getDefinitionElement() { + if (this.definition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptDefinitionComponent.definition"); + else if (Configuration.doAutoCreate()) + this.definition = new StringType(); // bb + return this.definition; + } + + public boolean hasDefinitionElement() { + return this.definition != null && !this.definition.isEmpty(); + } + + public boolean hasDefinition() { + return this.definition != null && !this.definition.isEmpty(); + } + + /** + * @param value {@link #definition} (The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public ConceptDefinitionComponent setDefinitionElement(StringType value) { + this.definition = value; + return this; + } + + /** + * @return The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept. + */ + public String getDefinition() { + return this.definition == null ? null : this.definition.getValue(); + } + + /** + * @param value The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept. + */ + public ConceptDefinitionComponent setDefinition(String value) { + if (Utilities.noString(value)) + this.definition = null; + else { + if (this.definition == null) + this.definition = new StringType(); + this.definition.setValue(value); + } + return this; + } + + /** + * @return {@link #designation} (Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc.) + */ + public List getDesignation() { + if (this.designation == null) + this.designation = new ArrayList(); + return this.designation; + } + + public boolean hasDesignation() { + if (this.designation == null) + return false; + for (ConceptDefinitionDesignationComponent item : this.designation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #designation} (Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc.) + */ + // syntactic sugar + public ConceptDefinitionDesignationComponent addDesignation() { //3 + ConceptDefinitionDesignationComponent t = new ConceptDefinitionDesignationComponent(); + if (this.designation == null) + this.designation = new ArrayList(); + this.designation.add(t); + return t; + } + + // syntactic sugar + public ConceptDefinitionComponent addDesignation(ConceptDefinitionDesignationComponent t) { //3 + if (t == null) + return this; + if (this.designation == null) + this.designation = new ArrayList(); + this.designation.add(t); + return this; + } + + /** + * @return {@link #concept} (Child Concepts (is-a / contains).) + */ + public List getConcept() { + if (this.concept == null) + this.concept = new ArrayList(); + return this.concept; + } + + public boolean hasConcept() { + if (this.concept == null) + return false; + for (ConceptDefinitionComponent item : this.concept) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concept} (Child Concepts (is-a / contains).) + */ + // syntactic sugar + public ConceptDefinitionComponent addConcept() { //3 + ConceptDefinitionComponent t = new ConceptDefinitionComponent(); + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return t; + } + + // syntactic sugar + public ConceptDefinitionComponent addConcept(ConceptDefinitionComponent t) { //3 + if (t == null) + return this; + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "Code that identifies concept.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("abstract", "boolean", "If this code is not for use as a real concept.", 0, java.lang.Integer.MAX_VALUE, abstract_)); + childrenList.add(new Property("display", "string", "Text to Display to the user.", 0, java.lang.Integer.MAX_VALUE, display)); + childrenList.add(new Property("definition", "string", "The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept.", 0, java.lang.Integer.MAX_VALUE, definition)); + childrenList.add(new Property("designation", "", "Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc.", 0, java.lang.Integer.MAX_VALUE, designation)); + childrenList.add(new Property("concept", "@ValueSet.define.concept", "Child Concepts (is-a / contains).", 0, java.lang.Integer.MAX_VALUE, concept)); + } + + public ConceptDefinitionComponent copy() { + ConceptDefinitionComponent dst = new ConceptDefinitionComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.abstract_ = abstract_ == null ? null : abstract_.copy(); + dst.display = display == null ? null : display.copy(); + dst.definition = definition == null ? null : definition.copy(); + if (designation != null) { + dst.designation = new ArrayList(); + for (ConceptDefinitionDesignationComponent i : designation) + dst.designation.add(i.copy()); + }; + if (concept != null) { + dst.concept = new ArrayList(); + for (ConceptDefinitionComponent i : concept) + dst.concept.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConceptDefinitionComponent)) + return false; + ConceptDefinitionComponent o = (ConceptDefinitionComponent) other; + return compareDeep(code, o.code, true) && compareDeep(abstract_, o.abstract_, true) && compareDeep(display, o.display, true) + && compareDeep(definition, o.definition, true) && compareDeep(designation, o.designation, true) + && compareDeep(concept, o.concept, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConceptDefinitionComponent)) + return false; + ConceptDefinitionComponent o = (ConceptDefinitionComponent) other; + return compareValues(code, o.code, true) && compareValues(abstract_, o.abstract_, true) && compareValues(display, o.display, true) + && compareValues(definition, o.definition, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (abstract_ == null || abstract_.isEmpty()) + && (display == null || display.isEmpty()) && (definition == null || definition.isEmpty()) + && (designation == null || designation.isEmpty()) && (concept == null || concept.isEmpty()) + ; + } + + } + + @Block() + public static class ConceptDefinitionDesignationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The language this designation is defined for. + */ + @Child(name = "language", type = {CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Language of the designation", formalDefinition="The language this designation is defined for." ) + protected CodeType language; + + /** + * A code that details how this designation would be used. + */ + @Child(name = "use", type = {Coding.class}, order=2, min=0, max=1) + @Description(shortDefinition="Details how this designation would be used", formalDefinition="A code that details how this designation would be used." ) + protected Coding use; + + /** + * The text value for this designation. + */ + @Child(name = "value", type = {StringType.class}, order=3, min=1, max=1) + @Description(shortDefinition="The text value for this designation", formalDefinition="The text value for this designation." ) + protected StringType value; + + private static final long serialVersionUID = 1515662414L; + + /* + * Constructor + */ + public ConceptDefinitionDesignationComponent() { + super(); + } + + /* + * Constructor + */ + public ConceptDefinitionDesignationComponent(StringType value) { + super(); + this.value = value; + } + + /** + * @return {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public CodeType getLanguageElement() { + if (this.language == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.language"); + else if (Configuration.doAutoCreate()) + this.language = new CodeType(); // bb + return this.language; + } + + public boolean hasLanguageElement() { + return this.language != null && !this.language.isEmpty(); + } + + public boolean hasLanguage() { + return this.language != null && !this.language.isEmpty(); + } + + /** + * @param value {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public ConceptDefinitionDesignationComponent setLanguageElement(CodeType value) { + this.language = value; + return this; + } + + /** + * @return The language this designation is defined for. + */ + public String getLanguage() { + return this.language == null ? null : this.language.getValue(); + } + + /** + * @param value The language this designation is defined for. + */ + public ConceptDefinitionDesignationComponent setLanguage(String value) { + if (Utilities.noString(value)) + this.language = null; + else { + if (this.language == null) + this.language = new CodeType(); + this.language.setValue(value); + } + return this; + } + + /** + * @return {@link #use} (A code that details how this designation would be used.) + */ + public Coding getUse() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.use"); + else if (Configuration.doAutoCreate()) + this.use = new Coding(); // cc + return this.use; + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (A code that details how this designation would be used.) + */ + public ConceptDefinitionDesignationComponent setUse(Coding value) { + this.use = value; + return this; + } + + /** + * @return {@link #value} (The text value for this designation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The text value for this designation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public ConceptDefinitionDesignationComponent setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The text value for this designation. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The text value for this designation. + */ + public ConceptDefinitionDesignationComponent setValue(String value) { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("language", "code", "The language this designation is defined for.", 0, java.lang.Integer.MAX_VALUE, language)); + childrenList.add(new Property("use", "Coding", "A code that details how this designation would be used.", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("value", "string", "The text value for this designation.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public ConceptDefinitionDesignationComponent copy() { + ConceptDefinitionDesignationComponent dst = new ConceptDefinitionDesignationComponent(); + copyValues(dst); + dst.language = language == null ? null : language.copy(); + dst.use = use == null ? null : use.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConceptDefinitionDesignationComponent)) + return false; + ConceptDefinitionDesignationComponent o = (ConceptDefinitionDesignationComponent) other; + return compareDeep(language, o.language, true) && compareDeep(use, o.use, true) && compareDeep(value, o.value, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConceptDefinitionDesignationComponent)) + return false; + ConceptDefinitionDesignationComponent o = (ConceptDefinitionDesignationComponent) other; + return compareValues(language, o.language, true) && compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (language == null || language.isEmpty()) && (use == null || use.isEmpty()) + && (value == null || value.isEmpty()); + } + + } + + @Block() + public static class ValueSetComposeComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri. + */ + @Child(name = "import_", type = {UriType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Import the contents of another value set", formalDefinition="Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri." ) + protected List import_; + + /** + * Include one or more codes from a code system. + */ + @Child(name = "include", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Include one or more codes from a code system", formalDefinition="Include one or more codes from a code system." ) + protected List include; + + /** + * Exclude one or more codes from the value set. + */ + @Child(name = "exclude", type = {ConceptSetComponent.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Explicitly exclude codes", formalDefinition="Exclude one or more codes from the value set." ) + protected List exclude; + + private static final long serialVersionUID = -703166694L; + + /* + * Constructor + */ + public ValueSetComposeComponent() { + super(); + } + + /** + * @return {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.) + */ + public List getImport() { + if (this.import_ == null) + this.import_ = new ArrayList(); + return this.import_; + } + + public boolean hasImport() { + if (this.import_ == null) + return false; + for (UriType item : this.import_) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.) + */ + // syntactic sugar + public UriType addImportElement() {//2 + UriType t = new UriType(); + if (this.import_ == null) + this.import_ = new ArrayList(); + this.import_.add(t); + return t; + } + + /** + * @param value {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.) + */ + public ValueSetComposeComponent addImport(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.import_ == null) + this.import_ = new ArrayList(); + this.import_.add(t); + return this; + } + + /** + * @param value {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.) + */ + public boolean hasImport(String value) { + if (this.import_ == null) + return false; + for (UriType v : this.import_) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #include} (Include one or more codes from a code system.) + */ + public List getInclude() { + if (this.include == null) + this.include = new ArrayList(); + return this.include; + } + + public boolean hasInclude() { + if (this.include == null) + return false; + for (ConceptSetComponent item : this.include) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #include} (Include one or more codes from a code system.) + */ + // syntactic sugar + public ConceptSetComponent addInclude() { //3 + ConceptSetComponent t = new ConceptSetComponent(); + if (this.include == null) + this.include = new ArrayList(); + this.include.add(t); + return t; + } + + // syntactic sugar + public ValueSetComposeComponent addInclude(ConceptSetComponent t) { //3 + if (t == null) + return this; + if (this.include == null) + this.include = new ArrayList(); + this.include.add(t); + return this; + } + + /** + * @return {@link #exclude} (Exclude one or more codes from the value set.) + */ + public List getExclude() { + if (this.exclude == null) + this.exclude = new ArrayList(); + return this.exclude; + } + + public boolean hasExclude() { + if (this.exclude == null) + return false; + for (ConceptSetComponent item : this.exclude) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #exclude} (Exclude one or more codes from the value set.) + */ + // syntactic sugar + public ConceptSetComponent addExclude() { //3 + ConceptSetComponent t = new ConceptSetComponent(); + if (this.exclude == null) + this.exclude = new ArrayList(); + this.exclude.add(t); + return t; + } + + // syntactic sugar + public ValueSetComposeComponent addExclude(ConceptSetComponent t) { //3 + if (t == null) + return this; + if (this.exclude == null) + this.exclude = new ArrayList(); + this.exclude.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("import", "uri", "Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.", 0, java.lang.Integer.MAX_VALUE, import_)); + childrenList.add(new Property("include", "", "Include one or more codes from a code system.", 0, java.lang.Integer.MAX_VALUE, include)); + childrenList.add(new Property("exclude", "@ValueSet.compose.include", "Exclude one or more codes from the value set.", 0, java.lang.Integer.MAX_VALUE, exclude)); + } + + public ValueSetComposeComponent copy() { + ValueSetComposeComponent dst = new ValueSetComposeComponent(); + copyValues(dst); + if (import_ != null) { + dst.import_ = new ArrayList(); + for (UriType i : import_) + dst.import_.add(i.copy()); + }; + if (include != null) { + dst.include = new ArrayList(); + for (ConceptSetComponent i : include) + dst.include.add(i.copy()); + }; + if (exclude != null) { + dst.exclude = new ArrayList(); + for (ConceptSetComponent i : exclude) + dst.exclude.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ValueSetComposeComponent)) + return false; + ValueSetComposeComponent o = (ValueSetComposeComponent) other; + return compareDeep(import_, o.import_, true) && compareDeep(include, o.include, true) && compareDeep(exclude, o.exclude, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ValueSetComposeComponent)) + return false; + ValueSetComposeComponent o = (ValueSetComposeComponent) other; + return compareValues(import_, o.import_, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (import_ == null || import_.isEmpty()) && (include == null || include.isEmpty()) + && (exclude == null || exclude.isEmpty()); + } + + } + + @Block() + public static class ConceptSetComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An absolute URI which is the code system from which the selected codes come from. + */ + @Child(name = "system", type = {UriType.class}, order=1, min=1, max=1) + @Description(shortDefinition="The system the codes come from", formalDefinition="An absolute URI which is the code system from which the selected codes come from." ) + protected UriType system; + + /** + * The version of the code system that the codes are selected from. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Specific version of the code system referred to", formalDefinition="The version of the code system that the codes are selected from." ) + protected StringType version; + + /** + * Specifies a concept to be included or excluded. + */ + @Child(name = "concept", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A concept defined in the system", formalDefinition="Specifies a concept to be included or excluded." ) + protected List concept; + + /** + * Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true. + */ + @Child(name = "filter", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Select codes/concepts by their properties (including relationships)", formalDefinition="Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true." ) + protected List filter; + + private static final long serialVersionUID = -196054471L; + + /* + * Constructor + */ + public ConceptSetComponent() { + super(); + } + + /* + * Constructor + */ + public ConceptSetComponent(UriType system) { + super(); + this.system = system; + } + + /** + * @return {@link #system} (An absolute URI which is the code system from which the selected codes come from.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public UriType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptSetComponent.system"); + else if (Configuration.doAutoCreate()) + this.system = new UriType(); // bb + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (An absolute URI which is the code system from which the selected codes come from.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public ConceptSetComponent setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return An absolute URI which is the code system from which the selected codes come from. + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value An absolute URI which is the code system from which the selected codes come from. + */ + public ConceptSetComponent setSystem(String value) { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + return this; + } + + /** + * @return {@link #version} (The version of the code system that the codes are selected from.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptSetComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version of the code system that the codes are selected from.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ConceptSetComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version of the code system that the codes are selected from. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version of the code system that the codes are selected from. + */ + public ConceptSetComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #concept} (Specifies a concept to be included or excluded.) + */ + public List getConcept() { + if (this.concept == null) + this.concept = new ArrayList(); + return this.concept; + } + + public boolean hasConcept() { + if (this.concept == null) + return false; + for (ConceptReferenceComponent item : this.concept) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concept} (Specifies a concept to be included or excluded.) + */ + // syntactic sugar + public ConceptReferenceComponent addConcept() { //3 + ConceptReferenceComponent t = new ConceptReferenceComponent(); + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return t; + } + + // syntactic sugar + public ConceptSetComponent addConcept(ConceptReferenceComponent t) { //3 + if (t == null) + return this; + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return this; + } + + /** + * @return {@link #filter} (Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.) + */ + public List getFilter() { + if (this.filter == null) + this.filter = new ArrayList(); + return this.filter; + } + + public boolean hasFilter() { + if (this.filter == null) + return false; + for (ConceptSetFilterComponent item : this.filter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #filter} (Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.) + */ + // syntactic sugar + public ConceptSetFilterComponent addFilter() { //3 + ConceptSetFilterComponent t = new ConceptSetFilterComponent(); + if (this.filter == null) + this.filter = new ArrayList(); + this.filter.add(t); + return t; + } + + // syntactic sugar + public ConceptSetComponent addFilter(ConceptSetFilterComponent t) { //3 + if (t == null) + return this; + if (this.filter == null) + this.filter = new ArrayList(); + this.filter.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("system", "uri", "An absolute URI which is the code system from which the selected codes come from.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("version", "string", "The version of the code system that the codes are selected from.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("concept", "", "Specifies a concept to be included or excluded.", 0, java.lang.Integer.MAX_VALUE, concept)); + childrenList.add(new Property("filter", "", "Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.", 0, java.lang.Integer.MAX_VALUE, filter)); + } + + public ConceptSetComponent copy() { + ConceptSetComponent dst = new ConceptSetComponent(); + copyValues(dst); + dst.system = system == null ? null : system.copy(); + dst.version = version == null ? null : version.copy(); + if (concept != null) { + dst.concept = new ArrayList(); + for (ConceptReferenceComponent i : concept) + dst.concept.add(i.copy()); + }; + if (filter != null) { + dst.filter = new ArrayList(); + for (ConceptSetFilterComponent i : filter) + dst.filter.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConceptSetComponent)) + return false; + ConceptSetComponent o = (ConceptSetComponent) other; + return compareDeep(system, o.system, true) && compareDeep(version, o.version, true) && compareDeep(concept, o.concept, true) + && compareDeep(filter, o.filter, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConceptSetComponent)) + return false; + ConceptSetComponent o = (ConceptSetComponent) other; + return compareValues(system, o.system, true) && compareValues(version, o.version, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) + && (concept == null || concept.isEmpty()) && (filter == null || filter.isEmpty()); + } + + } + + @Block() + public static class ConceptReferenceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Specifies a code for the concept to be included or excluded. + */ + @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Code or expression from system", formalDefinition="Specifies a code for the concept to be included or excluded." ) + protected CodeType code; + + /** + * The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system. + */ + @Child(name = "display", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Test to display for this code for this value set", formalDefinition="The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system." ) + protected StringType display; + + /** + * Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc. + */ + @Child(name = "designation", type = {ConceptDefinitionDesignationComponent.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional representations for this valueset", formalDefinition="Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc." ) + protected List designation; + + private static final long serialVersionUID = -1513912691L; + + /* + * Constructor + */ + public ConceptReferenceComponent() { + super(); + } + + /* + * Constructor + */ + public ConceptReferenceComponent(CodeType code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Specifies a code for the concept to be included or excluded.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptReferenceComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Specifies a code for the concept to be included or excluded.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public ConceptReferenceComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return Specifies a code for the concept to be included or excluded. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Specifies a code for the concept to be included or excluded. + */ + public ConceptReferenceComponent setCode(String value) { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #display} (The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptReferenceComponent.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); // bb + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public ConceptReferenceComponent setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system. + */ + public ConceptReferenceComponent setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + /** + * @return {@link #designation} (Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc.) + */ + public List getDesignation() { + if (this.designation == null) + this.designation = new ArrayList(); + return this.designation; + } + + public boolean hasDesignation() { + if (this.designation == null) + return false; + for (ConceptDefinitionDesignationComponent item : this.designation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #designation} (Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc.) + */ + // syntactic sugar + public ConceptDefinitionDesignationComponent addDesignation() { //3 + ConceptDefinitionDesignationComponent t = new ConceptDefinitionDesignationComponent(); + if (this.designation == null) + this.designation = new ArrayList(); + this.designation.add(t); + return t; + } + + // syntactic sugar + public ConceptReferenceComponent addDesignation(ConceptDefinitionDesignationComponent t) { //3 + if (t == null) + return this; + if (this.designation == null) + this.designation = new ArrayList(); + this.designation.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "Specifies a code for the concept to be included or excluded.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("display", "string", "The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.", 0, java.lang.Integer.MAX_VALUE, display)); + childrenList.add(new Property("designation", "@ValueSet.define.concept.designation", "Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc.", 0, java.lang.Integer.MAX_VALUE, designation)); + } + + public ConceptReferenceComponent copy() { + ConceptReferenceComponent dst = new ConceptReferenceComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.display = display == null ? null : display.copy(); + if (designation != null) { + dst.designation = new ArrayList(); + for (ConceptDefinitionDesignationComponent i : designation) + dst.designation.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConceptReferenceComponent)) + return false; + ConceptReferenceComponent o = (ConceptReferenceComponent) other; + return compareDeep(code, o.code, true) && compareDeep(display, o.display, true) && compareDeep(designation, o.designation, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConceptReferenceComponent)) + return false; + ConceptReferenceComponent o = (ConceptReferenceComponent) other; + return compareValues(code, o.code, true) && compareValues(display, o.display, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (display == null || display.isEmpty()) + && (designation == null || designation.isEmpty()); + } + + } + + @Block() + public static class ConceptSetFilterComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A code that identifies a property defined in the code system. + */ + @Child(name = "property", type = {CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="A property defined by the code system", formalDefinition="A code that identifies a property defined in the code system." ) + protected CodeType property; + + /** + * The kind of operation to perform as a part of the filter criteria. + */ + @Child(name = "op", type = {CodeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="= | is-a | is-not-a | regex | in | not-in", formalDefinition="The kind of operation to perform as a part of the filter criteria." ) + protected Enumeration op; + + /** + * The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value. + */ + @Child(name = "value", type = {CodeType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Code from the system, or regex criteria", formalDefinition="The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value." ) + protected CodeType value; + + private static final long serialVersionUID = 1985515000L; + + /* + * Constructor + */ + public ConceptSetFilterComponent() { + super(); + } + + /* + * Constructor + */ + public ConceptSetFilterComponent(CodeType property, Enumeration op, CodeType value) { + super(); + this.property = property; + this.op = op; + this.value = value; + } + + /** + * @return {@link #property} (A code that identifies a property defined in the code system.). This is the underlying object with id, value and extensions. The accessor "getProperty" gives direct access to the value + */ + public CodeType getPropertyElement() { + if (this.property == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptSetFilterComponent.property"); + else if (Configuration.doAutoCreate()) + this.property = new CodeType(); // bb + return this.property; + } + + public boolean hasPropertyElement() { + return this.property != null && !this.property.isEmpty(); + } + + public boolean hasProperty() { + return this.property != null && !this.property.isEmpty(); + } + + /** + * @param value {@link #property} (A code that identifies a property defined in the code system.). This is the underlying object with id, value and extensions. The accessor "getProperty" gives direct access to the value + */ + public ConceptSetFilterComponent setPropertyElement(CodeType value) { + this.property = value; + return this; + } + + /** + * @return A code that identifies a property defined in the code system. + */ + public String getProperty() { + return this.property == null ? null : this.property.getValue(); + } + + /** + * @param value A code that identifies a property defined in the code system. + */ + public ConceptSetFilterComponent setProperty(String value) { + if (this.property == null) + this.property = new CodeType(); + this.property.setValue(value); + return this; + } + + /** + * @return {@link #op} (The kind of operation to perform as a part of the filter criteria.). This is the underlying object with id, value and extensions. The accessor "getOp" gives direct access to the value + */ + public Enumeration getOpElement() { + if (this.op == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptSetFilterComponent.op"); + else if (Configuration.doAutoCreate()) + this.op = new Enumeration(new FilterOperatorEnumFactory()); // bb + return this.op; + } + + public boolean hasOpElement() { + return this.op != null && !this.op.isEmpty(); + } + + public boolean hasOp() { + return this.op != null && !this.op.isEmpty(); + } + + /** + * @param value {@link #op} (The kind of operation to perform as a part of the filter criteria.). This is the underlying object with id, value and extensions. The accessor "getOp" gives direct access to the value + */ + public ConceptSetFilterComponent setOpElement(Enumeration value) { + this.op = value; + return this; + } + + /** + * @return The kind of operation to perform as a part of the filter criteria. + */ + public FilterOperator getOp() { + return this.op == null ? null : this.op.getValue(); + } + + /** + * @param value The kind of operation to perform as a part of the filter criteria. + */ + public ConceptSetFilterComponent setOp(FilterOperator value) { + if (this.op == null) + this.op = new Enumeration(new FilterOperatorEnumFactory()); + this.op.setValue(value); + return this; + } + + /** + * @return {@link #value} (The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public CodeType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptSetFilterComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new CodeType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public ConceptSetFilterComponent setValueElement(CodeType value) { + this.value = value; + return this; + } + + /** + * @return The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value. + */ + public ConceptSetFilterComponent setValue(String value) { + if (this.value == null) + this.value = new CodeType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("property", "code", "A code that identifies a property defined in the code system.", 0, java.lang.Integer.MAX_VALUE, property)); + childrenList.add(new Property("op", "code", "The kind of operation to perform as a part of the filter criteria.", 0, java.lang.Integer.MAX_VALUE, op)); + childrenList.add(new Property("value", "code", "The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public ConceptSetFilterComponent copy() { + ConceptSetFilterComponent dst = new ConceptSetFilterComponent(); + copyValues(dst); + dst.property = property == null ? null : property.copy(); + dst.op = op == null ? null : op.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConceptSetFilterComponent)) + return false; + ConceptSetFilterComponent o = (ConceptSetFilterComponent) other; + return compareDeep(property, o.property, true) && compareDeep(op, o.op, true) && compareDeep(value, o.value, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConceptSetFilterComponent)) + return false; + ConceptSetFilterComponent o = (ConceptSetFilterComponent) other; + return compareValues(property, o.property, true) && compareValues(op, o.op, true) && compareValues(value, o.value, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (property == null || property.isEmpty()) && (op == null || op.isEmpty()) + && (value == null || value.isEmpty()); + } + + } + + @Block() + public static class ValueSetExpansionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so. + */ + @Child(name = "identifier", type = {UriType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Uniquely identifies this expansion", formalDefinition="An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so." ) + protected UriType identifier; + + /** + * The time at which the expansion was produced by the expanding system. + */ + @Child(name = "timestamp", type = {DateTimeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Time valueset expansion happened", formalDefinition="The time at which the expansion was produced by the expanding system." ) + protected DateTimeType timestamp; + + /** + * A Parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion. + */ + @Child(name = "parameter", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Parameter that controlled the expansion process", formalDefinition="A Parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion." ) + protected List parameter; + + /** + * The codes that are contained in the value set expansion. + */ + @Child(name = "contains", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Codes in the value set", formalDefinition="The codes that are contained in the value set expansion." ) + protected List contains; + + private static final long serialVersionUID = 148339098L; + + /* + * Constructor + */ + public ValueSetExpansionComponent() { + super(); + } + + /* + * Constructor + */ + public ValueSetExpansionComponent(UriType identifier, DateTimeType timestamp) { + super(); + this.identifier = identifier; + this.timestamp = timestamp; + } + + /** + * @return {@link #identifier} (An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public UriType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new UriType(); // bb + return this.identifier; + } + + public boolean hasIdentifierElement() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public ValueSetExpansionComponent setIdentifierElement(UriType value) { + this.identifier = value; + return this; + } + + /** + * @return An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so. + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so. + */ + public ValueSetExpansionComponent setIdentifier(String value) { + if (this.identifier == null) + this.identifier = new UriType(); + this.identifier.setValue(value); + return this; + } + + /** + * @return {@link #timestamp} (The time at which the expansion was produced by the expanding system.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value + */ + public DateTimeType getTimestampElement() { + if (this.timestamp == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionComponent.timestamp"); + else if (Configuration.doAutoCreate()) + this.timestamp = new DateTimeType(); // bb + return this.timestamp; + } + + public boolean hasTimestampElement() { + return this.timestamp != null && !this.timestamp.isEmpty(); + } + + public boolean hasTimestamp() { + return this.timestamp != null && !this.timestamp.isEmpty(); + } + + /** + * @param value {@link #timestamp} (The time at which the expansion was produced by the expanding system.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value + */ + public ValueSetExpansionComponent setTimestampElement(DateTimeType value) { + this.timestamp = value; + return this; + } + + /** + * @return The time at which the expansion was produced by the expanding system. + */ + public Date getTimestamp() { + return this.timestamp == null ? null : this.timestamp.getValue(); + } + + /** + * @param value The time at which the expansion was produced by the expanding system. + */ + public ValueSetExpansionComponent setTimestamp(Date value) { + if (this.timestamp == null) + this.timestamp = new DateTimeType(); + this.timestamp.setValue(value); + return this; + } + + /** + * @return {@link #parameter} (A Parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion.) + */ + public List getParameter() { + if (this.parameter == null) + this.parameter = new ArrayList(); + return this.parameter; + } + + public boolean hasParameter() { + if (this.parameter == null) + return false; + for (ValueSetExpansionParameterComponent item : this.parameter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #parameter} (A Parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion.) + */ + // syntactic sugar + public ValueSetExpansionParameterComponent addParameter() { //3 + ValueSetExpansionParameterComponent t = new ValueSetExpansionParameterComponent(); + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return t; + } + + // syntactic sugar + public ValueSetExpansionComponent addParameter(ValueSetExpansionParameterComponent t) { //3 + if (t == null) + return this; + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return this; + } + + /** + * @return {@link #contains} (The codes that are contained in the value set expansion.) + */ + public List getContains() { + if (this.contains == null) + this.contains = new ArrayList(); + return this.contains; + } + + public boolean hasContains() { + if (this.contains == null) + return false; + for (ValueSetExpansionContainsComponent item : this.contains) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contains} (The codes that are contained in the value set expansion.) + */ + // syntactic sugar + public ValueSetExpansionContainsComponent addContains() { //3 + ValueSetExpansionContainsComponent t = new ValueSetExpansionContainsComponent(); + if (this.contains == null) + this.contains = new ArrayList(); + this.contains.add(t); + return t; + } + + // syntactic sugar + public ValueSetExpansionComponent addContains(ValueSetExpansionContainsComponent t) { //3 + if (t == null) + return this; + if (this.contains == null) + this.contains = new ArrayList(); + this.contains.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "uri", "An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("timestamp", "dateTime", "The time at which the expansion was produced by the expanding system.", 0, java.lang.Integer.MAX_VALUE, timestamp)); + childrenList.add(new Property("parameter", "", "A Parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion.", 0, java.lang.Integer.MAX_VALUE, parameter)); + childrenList.add(new Property("contains", "", "The codes that are contained in the value set expansion.", 0, java.lang.Integer.MAX_VALUE, contains)); + } + + public ValueSetExpansionComponent copy() { + ValueSetExpansionComponent dst = new ValueSetExpansionComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.timestamp = timestamp == null ? null : timestamp.copy(); + if (parameter != null) { + dst.parameter = new ArrayList(); + for (ValueSetExpansionParameterComponent i : parameter) + dst.parameter.add(i.copy()); + }; + if (contains != null) { + dst.contains = new ArrayList(); + for (ValueSetExpansionContainsComponent i : contains) + dst.contains.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ValueSetExpansionComponent)) + return false; + ValueSetExpansionComponent o = (ValueSetExpansionComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(timestamp, o.timestamp, true) + && compareDeep(parameter, o.parameter, true) && compareDeep(contains, o.contains, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ValueSetExpansionComponent)) + return false; + ValueSetExpansionComponent o = (ValueSetExpansionComponent) other; + return compareValues(identifier, o.identifier, true) && compareValues(timestamp, o.timestamp, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (timestamp == null || timestamp.isEmpty()) + && (parameter == null || parameter.isEmpty()) && (contains == null || contains.isEmpty()) + ; + } + + } + + @Block() + public static class ValueSetExpansionParameterComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of the parameter. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Name as assigned by server", formalDefinition="The name of the parameter." ) + protected StringType name; + + /** + * The value of the parameter. + */ + @Child(name = "value", type = {StringType.class, BooleanType.class, IntegerType.class, DecimalType.class, UriType.class, CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Value of the parameter", formalDefinition="The value of the parameter." ) + protected Type value; + + private static final long serialVersionUID = 1172641169L; + + /* + * Constructor + */ + public ValueSetExpansionParameterComponent() { + super(); + } + + /* + * Constructor + */ + public ValueSetExpansionParameterComponent(StringType name) { + super(); + this.name = name; + } + + /** + * @return {@link #name} (The name of the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionParameterComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The name of the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ValueSetExpansionParameterComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of the parameter. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of the parameter. + */ + public ValueSetExpansionParameterComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #value} (The value of the parameter.) + */ + public Type getValue() { + return this.value; + } + + /** + * @return {@link #value} (The value of the parameter.) + */ + public StringType getValueStringType() throws Exception { + if (!(this.value instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (StringType) this.value; + } + + /** + * @return {@link #value} (The value of the parameter.) + */ + public BooleanType getValueBooleanType() throws Exception { + if (!(this.value instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (BooleanType) this.value; + } + + /** + * @return {@link #value} (The value of the parameter.) + */ + public IntegerType getValueIntegerType() throws Exception { + if (!(this.value instanceof IntegerType)) + throw new Exception("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (IntegerType) this.value; + } + + /** + * @return {@link #value} (The value of the parameter.) + */ + public DecimalType getValueDecimalType() throws Exception { + if (!(this.value instanceof DecimalType)) + throw new Exception("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (DecimalType) this.value; + } + + /** + * @return {@link #value} (The value of the parameter.) + */ + public UriType getValueUriType() throws Exception { + if (!(this.value instanceof UriType)) + throw new Exception("Type mismatch: the type UriType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (UriType) this.value; + } + + /** + * @return {@link #value} (The value of the parameter.) + */ + public CodeType getValueCodeType() throws Exception { + if (!(this.value instanceof CodeType)) + throw new Exception("Type mismatch: the type CodeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (CodeType) this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value of the parameter.) + */ + public ValueSetExpansionParameterComponent setValue(Type value) { + this.value = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of the parameter.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("value[x]", "string|boolean|integer|decimal|uri|code", "The value of the parameter.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public ValueSetExpansionParameterComponent copy() { + ValueSetExpansionParameterComponent dst = new ValueSetExpansionParameterComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ValueSetExpansionParameterComponent)) + return false; + ValueSetExpansionParameterComponent o = (ValueSetExpansionParameterComponent) other; + return compareDeep(name, o.name, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ValueSetExpansionParameterComponent)) + return false; + ValueSetExpansionParameterComponent o = (ValueSetExpansionParameterComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + } + + @Block() + public static class ValueSetExpansionContainsComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An absolute URI which is the code system in which the code for this item in the expansion is defined. + */ + @Child(name = "system", type = {UriType.class}, order=1, min=0, max=1) + @Description(shortDefinition="System value for the code", formalDefinition="An absolute URI which is the code system in which the code for this item in the expansion is defined." ) + protected UriType system; + + /** + * If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. + */ + @Child(name = "abstract_", type = {BooleanType.class}, order=2, min=0, max=1) + @Description(shortDefinition="If user cannot select this entry", formalDefinition="If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value." ) + protected BooleanType abstract_; + + /** + * The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence. + */ + @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Version in which this code / display is defined", formalDefinition="The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence." ) + protected StringType version; + + /** + * Code - if blank, this is not a choosable code. + */ + @Child(name = "code", type = {CodeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Code - if blank, this is not a choosable code", formalDefinition="Code - if blank, this is not a choosable code." ) + protected CodeType code; + + /** + * User display for the concept. + */ + @Child(name = "display", type = {StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="User display for the concept", formalDefinition="User display for the concept." ) + protected StringType display; + + /** + * Codes contained in this concept. + */ + @Child(name = "contains", type = {ValueSetExpansionContainsComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Codes contained in this concept", formalDefinition="Codes contained in this concept." ) + protected List contains; + + private static final long serialVersionUID = -2038349483L; + + /* + * Constructor + */ + public ValueSetExpansionContainsComponent() { + super(); + } + + /** + * @return {@link #system} (An absolute URI which is the code system in which the code for this item in the expansion is defined.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public UriType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.system"); + else if (Configuration.doAutoCreate()) + this.system = new UriType(); // bb + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (An absolute URI which is the code system in which the code for this item in the expansion is defined.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public ValueSetExpansionContainsComponent setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return An absolute URI which is the code system in which the code for this item in the expansion is defined. + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value An absolute URI which is the code system in which the code for this item in the expansion is defined. + */ + public ValueSetExpansionContainsComponent setSystem(String value) { + if (Utilities.noString(value)) + this.system = null; + else { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + } + return this; + } + + /** + * @return {@link #abstract_} (If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value + */ + public BooleanType getAbstractElement() { + if (this.abstract_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.abstract_"); + else if (Configuration.doAutoCreate()) + this.abstract_ = new BooleanType(); // bb + return this.abstract_; + } + + public boolean hasAbstractElement() { + return this.abstract_ != null && !this.abstract_.isEmpty(); + } + + public boolean hasAbstract() { + return this.abstract_ != null && !this.abstract_.isEmpty(); + } + + /** + * @param value {@link #abstract_} (If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value + */ + public ValueSetExpansionContainsComponent setAbstractElement(BooleanType value) { + this.abstract_ = value; + return this; + } + + /** + * @return If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. + */ + public boolean getAbstract() { + return this.abstract_ == null || this.abstract_.isEmpty() ? false : this.abstract_.getValue(); + } + + /** + * @param value If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. + */ + public ValueSetExpansionContainsComponent setAbstract(boolean value) { + if (this.abstract_ == null) + this.abstract_ = new BooleanType(); + this.abstract_.setValue(value); + return this; + } + + /** + * @return {@link #version} (The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ValueSetExpansionContainsComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence. + */ + public ValueSetExpansionContainsComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (Code - if blank, this is not a choosable code.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code - if blank, this is not a choosable code.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public ValueSetExpansionContainsComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return Code - if blank, this is not a choosable code. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Code - if blank, this is not a choosable code. + */ + public ValueSetExpansionContainsComponent setCode(String value) { + if (Utilities.noString(value)) + this.code = null; + else { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + } + return this; + } + + /** + * @return {@link #display} (User display for the concept.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); // bb + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (User display for the concept.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public ValueSetExpansionContainsComponent setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return User display for the concept. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value User display for the concept. + */ + public ValueSetExpansionContainsComponent setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + /** + * @return {@link #contains} (Codes contained in this concept.) + */ + public List getContains() { + if (this.contains == null) + this.contains = new ArrayList(); + return this.contains; + } + + public boolean hasContains() { + if (this.contains == null) + return false; + for (ValueSetExpansionContainsComponent item : this.contains) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contains} (Codes contained in this concept.) + */ + // syntactic sugar + public ValueSetExpansionContainsComponent addContains() { //3 + ValueSetExpansionContainsComponent t = new ValueSetExpansionContainsComponent(); + if (this.contains == null) + this.contains = new ArrayList(); + this.contains.add(t); + return t; + } + + // syntactic sugar + public ValueSetExpansionContainsComponent addContains(ValueSetExpansionContainsComponent t) { //3 + if (t == null) + return this; + if (this.contains == null) + this.contains = new ArrayList(); + this.contains.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("system", "uri", "An absolute URI which is the code system in which the code for this item in the expansion is defined.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("abstract", "boolean", "If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.", 0, java.lang.Integer.MAX_VALUE, abstract_)); + childrenList.add(new Property("version", "string", "The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("code", "code", "Code - if blank, this is not a choosable code.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("display", "string", "User display for the concept.", 0, java.lang.Integer.MAX_VALUE, display)); + childrenList.add(new Property("contains", "@ValueSet.expansion.contains", "Codes contained in this concept.", 0, java.lang.Integer.MAX_VALUE, contains)); + } + + public ValueSetExpansionContainsComponent copy() { + ValueSetExpansionContainsComponent dst = new ValueSetExpansionContainsComponent(); + copyValues(dst); + dst.system = system == null ? null : system.copy(); + dst.abstract_ = abstract_ == null ? null : abstract_.copy(); + dst.version = version == null ? null : version.copy(); + dst.code = code == null ? null : code.copy(); + dst.display = display == null ? null : display.copy(); + if (contains != null) { + dst.contains = new ArrayList(); + for (ValueSetExpansionContainsComponent i : contains) + dst.contains.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ValueSetExpansionContainsComponent)) + return false; + ValueSetExpansionContainsComponent o = (ValueSetExpansionContainsComponent) other; + return compareDeep(system, o.system, true) && compareDeep(abstract_, o.abstract_, true) && compareDeep(version, o.version, true) + && compareDeep(code, o.code, true) && compareDeep(display, o.display, true) && compareDeep(contains, o.contains, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ValueSetExpansionContainsComponent)) + return false; + ValueSetExpansionContainsComponent o = (ValueSetExpansionContainsComponent) other; + return compareValues(system, o.system, true) && compareValues(abstract_, o.abstract_, true) && compareValues(version, o.version, true) + && compareValues(code, o.code, true) && compareValues(display, o.display, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (system == null || system.isEmpty()) && (abstract_ == null || abstract_.isEmpty()) + && (version == null || version.isEmpty()) && (code == null || code.isEmpty()) && (display == null || display.isEmpty()) + && (contains == null || contains.isEmpty()); + } + + } + + /** + * An absolute uri that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). + */ + @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Globally unique logical id for value set", formalDefinition="An absolute uri that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:)." ) + protected UriType url; + + /** + * Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1) + @Description(shortDefinition="Additional identifier for the value set (v2 / CDA)", formalDefinition="Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance." ) + protected Identifier identifier; + + /** + * Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Logical id for this version of the value set", formalDefinition="Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) + protected StringType version; + + /** + * A free text natural language name describing the value set. + */ + @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Informal name for this value set", formalDefinition="A free text natural language name describing the value set." ) + protected StringType name; + + /** + * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions. + */ + @Child(name = "useContext", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions." ) + protected List useContext; + + /** + * If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change. + */ + @Child(name = "immutable", type = {BooleanType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Indicates whether or not any change to the content logical definition may occur", formalDefinition="If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change." ) + protected BooleanType immutable; + + /** + * The name of the individual or organization that published the value set. + */ + @Child(name = "publisher", type = {StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the value set." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set. + */ + @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Human language description of the value set", formalDefinition="A free text natural language description of the use of the value set - reason for definition, 'the semantic space' to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set." ) + protected StringType description; + + /** + * Explains why this value set is needed and why it's been constrained as it has. + */ + @Child(name = "requirements", type = {StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Why is this needed?", formalDefinition="Explains why this value set is needed and why it's been constrained as it has." ) + protected StringType requirements; + + /** + * A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set. + */ + @Child(name = "copyright", type = {StringType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Use and/or Publishing restrictions", formalDefinition="A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set." ) + protected StringType copyright; + + /** + * The status of the value set. + */ + @Child(name = "status", type = {CodeType.class}, order=11, min=1, max=1) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the value set." ) + protected Enumeration status; + + /** + * This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name = "experimental", type = {BooleanType.class}, order=12, min=0, max=1) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * Whether this is intended to be used with an extensible binding or not. + */ + @Child(name = "extensible", type = {BooleanType.class}, order=13, min=0, max=1) + @Description(shortDefinition="Whether this is intended to be used with an extensible binding", formalDefinition="Whether this is intended to be used with an extensible binding or not." ) + protected BooleanType extensible; + + /** + * The date that the value set status was last changed. + */ + @Child(name = "date", type = {DateTimeType.class}, order=14, min=0, max=1) + @Description(shortDefinition="Date for given status", formalDefinition="The date that the value set status was last changed." ) + protected DateTimeType date; + + /** + * If a Locked Date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value sets as of the Locked Date. + */ + @Child(name = "lockedDate", type = {DateType.class}, order=15, min=0, max=1) + @Description(shortDefinition="Fixed date for all referenced code systems and value sets", formalDefinition="If a Locked Date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value sets as of the Locked Date." ) + protected DateType lockedDate; + + /** + * A definition of an code system, inlined into the value set. + */ + @Child(name = "define", type = {}, order=16, min=0, max=1) + @Description(shortDefinition="When value set defines its own codes", formalDefinition="A definition of an code system, inlined into the value set." ) + protected ValueSetDefineComponent define; + + /** + * When value set includes codes from elsewhere. + */ + @Child(name = "compose", type = {}, order=17, min=0, max=1) + @Description(shortDefinition="When value set includes codes from elsewhere", formalDefinition="When value set includes codes from elsewhere." ) + protected ValueSetComposeComponent compose; + + /** + * A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed. + */ + @Child(name = "expansion", type = {}, order=18, min=0, max=1) + @Description(shortDefinition="Used when the value set is 'expanded'", formalDefinition="A value set can also be 'expanded', where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed." ) + protected ValueSetExpansionComponent expansion; + + private static final long serialVersionUID = 121117080L; + + /* + * Constructor + */ + public ValueSet() { + super(); + } + + /* + * Constructor + */ + public ValueSet(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #url} (An absolute uri that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute uri that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public ValueSet setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute uri that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute uri that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). + */ + public ValueSet setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #identifier} (Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance.) + */ + public ValueSet setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #version} (Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ValueSet setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public ValueSet setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A free text natural language name describing the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A free text natural language name describing the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ValueSet setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name describing the value set. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name describing the value set. + */ + public ValueSet setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions.) + */ + public List getUseContext() { + if (this.useContext == null) + this.useContext = new ArrayList(); + return this.useContext; + } + + public boolean hasUseContext() { + if (this.useContext == null) + return false; + for (CodeableConcept item : this.useContext) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions.) + */ + // syntactic sugar + public CodeableConcept addUseContext() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return t; + } + + // syntactic sugar + public ValueSet addUseContext(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return this; + } + + /** + * @return {@link #immutable} (If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change.). This is the underlying object with id, value and extensions. The accessor "getImmutable" gives direct access to the value + */ + public BooleanType getImmutableElement() { + if (this.immutable == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.immutable"); + else if (Configuration.doAutoCreate()) + this.immutable = new BooleanType(); // bb + return this.immutable; + } + + public boolean hasImmutableElement() { + return this.immutable != null && !this.immutable.isEmpty(); + } + + public boolean hasImmutable() { + return this.immutable != null && !this.immutable.isEmpty(); + } + + /** + * @param value {@link #immutable} (If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change.). This is the underlying object with id, value and extensions. The accessor "getImmutable" gives direct access to the value + */ + public ValueSet setImmutableElement(BooleanType value) { + this.immutable = value; + return this; + } + + /** + * @return If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change. + */ + public boolean getImmutable() { + return this.immutable == null || this.immutable.isEmpty() ? false : this.immutable.getValue(); + } + + /** + * @param value If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change. + */ + public ValueSet setImmutable(boolean value) { + if (this.immutable == null) + this.immutable = new BooleanType(); + this.immutable.setValue(value); + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the value set.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the value set.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public ValueSet setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the value set. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the value set. + */ + public ValueSet setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (ValueSetContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public ValueSetContactComponent addContact() { //3 + ValueSetContactComponent t = new ValueSetContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public ValueSet addContact(ValueSetContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #description} (A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ValueSet setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set. + */ + public ValueSet setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #requirements} (Explains why this value set is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); // bb + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (Explains why this value set is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public ValueSet setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return Explains why this value set is needed and why it's been constrained as it has. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value Explains why this value set is needed and why it's been constrained as it has. + */ + public ValueSet setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #copyright} (A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public StringType getCopyrightElement() { + if (this.copyright == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.copyright"); + else if (Configuration.doAutoCreate()) + this.copyright = new StringType(); // bb + return this.copyright; + } + + public boolean hasCopyrightElement() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + public boolean hasCopyright() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + /** + * @param value {@link #copyright} (A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public ValueSet setCopyrightElement(StringType value) { + this.copyright = value; + return this; + } + + /** + * @return A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set. + */ + public String getCopyright() { + return this.copyright == null ? null : this.copyright.getValue(); + } + + /** + * @param value A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set. + */ + public ValueSet setCopyright(String value) { + if (Utilities.noString(value)) + this.copyright = null; + else { + if (this.copyright == null) + this.copyright = new StringType(); + this.copyright.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of the value set.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status of the value set.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public ValueSet setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the value set. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the value set. + */ + public ValueSet setStatus(ConformanceResourceStatus value) { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #experimental} (This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public ValueSet setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public ValueSet setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #extensible} (Whether this is intended to be used with an extensible binding or not.). This is the underlying object with id, value and extensions. The accessor "getExtensible" gives direct access to the value + */ + public BooleanType getExtensibleElement() { + if (this.extensible == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.extensible"); + else if (Configuration.doAutoCreate()) + this.extensible = new BooleanType(); // bb + return this.extensible; + } + + public boolean hasExtensibleElement() { + return this.extensible != null && !this.extensible.isEmpty(); + } + + public boolean hasExtensible() { + return this.extensible != null && !this.extensible.isEmpty(); + } + + /** + * @param value {@link #extensible} (Whether this is intended to be used with an extensible binding or not.). This is the underlying object with id, value and extensions. The accessor "getExtensible" gives direct access to the value + */ + public ValueSet setExtensibleElement(BooleanType value) { + this.extensible = value; + return this; + } + + /** + * @return Whether this is intended to be used with an extensible binding or not. + */ + public boolean getExtensible() { + return this.extensible == null || this.extensible.isEmpty() ? false : this.extensible.getValue(); + } + + /** + * @param value Whether this is intended to be used with an extensible binding or not. + */ + public ValueSet setExtensible(boolean value) { + if (this.extensible == null) + this.extensible = new BooleanType(); + this.extensible.setValue(value); + return this; + } + + /** + * @return {@link #date} (The date that the value set status was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date that the value set status was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ValueSet setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date that the value set status was last changed. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date that the value set status was last changed. + */ + public ValueSet setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #lockedDate} (If a Locked Date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value sets as of the Locked Date.). This is the underlying object with id, value and extensions. The accessor "getLockedDate" gives direct access to the value + */ + public DateType getLockedDateElement() { + if (this.lockedDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.lockedDate"); + else if (Configuration.doAutoCreate()) + this.lockedDate = new DateType(); // bb + return this.lockedDate; + } + + public boolean hasLockedDateElement() { + return this.lockedDate != null && !this.lockedDate.isEmpty(); + } + + public boolean hasLockedDate() { + return this.lockedDate != null && !this.lockedDate.isEmpty(); + } + + /** + * @param value {@link #lockedDate} (If a Locked Date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value sets as of the Locked Date.). This is the underlying object with id, value and extensions. The accessor "getLockedDate" gives direct access to the value + */ + public ValueSet setLockedDateElement(DateType value) { + this.lockedDate = value; + return this; + } + + /** + * @return If a Locked Date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value sets as of the Locked Date. + */ + public Date getLockedDate() { + return this.lockedDate == null ? null : this.lockedDate.getValue(); + } + + /** + * @param value If a Locked Date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value sets as of the Locked Date. + */ + public ValueSet setLockedDate(Date value) { + if (value == null) + this.lockedDate = null; + else { + if (this.lockedDate == null) + this.lockedDate = new DateType(); + this.lockedDate.setValue(value); + } + return this; + } + + /** + * @return {@link #define} (A definition of an code system, inlined into the value set.) + */ + public ValueSetDefineComponent getDefine() { + if (this.define == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.define"); + else if (Configuration.doAutoCreate()) + this.define = new ValueSetDefineComponent(); // cc + return this.define; + } + + public boolean hasDefine() { + return this.define != null && !this.define.isEmpty(); + } + + /** + * @param value {@link #define} (A definition of an code system, inlined into the value set.) + */ + public ValueSet setDefine(ValueSetDefineComponent value) { + this.define = value; + return this; + } + + /** + * @return {@link #compose} (When value set includes codes from elsewhere.) + */ + public ValueSetComposeComponent getCompose() { + if (this.compose == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.compose"); + else if (Configuration.doAutoCreate()) + this.compose = new ValueSetComposeComponent(); // cc + return this.compose; + } + + public boolean hasCompose() { + return this.compose != null && !this.compose.isEmpty(); + } + + /** + * @param value {@link #compose} (When value set includes codes from elsewhere.) + */ + public ValueSet setCompose(ValueSetComposeComponent value) { + this.compose = value; + return this; + } + + /** + * @return {@link #expansion} (A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.) + */ + public ValueSetExpansionComponent getExpansion() { + if (this.expansion == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.expansion"); + else if (Configuration.doAutoCreate()) + this.expansion = new ValueSetExpansionComponent(); // cc + return this.expansion; + } + + public boolean hasExpansion() { + return this.expansion != null && !this.expansion.isEmpty(); + } + + /** + * @param value {@link #expansion} (A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.) + */ + public ValueSet setExpansion(ValueSetExpansionComponent value) { + this.expansion = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute uri that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:).", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "A free text natural language name describing the value set.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions.", 0, java.lang.Integer.MAX_VALUE, useContext)); + childrenList.add(new Property("immutable", "boolean", "If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change.", 0, java.lang.Integer.MAX_VALUE, immutable)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the value set.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("description", "string", "A free text natural language description of the use of the value set - reason for definition, 'the semantic space' to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("requirements", "string", "Explains why this value set is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("copyright", "string", "A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set.", 0, java.lang.Integer.MAX_VALUE, copyright)); + childrenList.add(new Property("status", "code", "The status of the value set.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("extensible", "boolean", "Whether this is intended to be used with an extensible binding or not.", 0, java.lang.Integer.MAX_VALUE, extensible)); + childrenList.add(new Property("date", "dateTime", "The date that the value set status was last changed.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("lockedDate", "date", "If a Locked Date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value sets as of the Locked Date.", 0, java.lang.Integer.MAX_VALUE, lockedDate)); + childrenList.add(new Property("define", "", "A definition of an code system, inlined into the value set.", 0, java.lang.Integer.MAX_VALUE, define)); + childrenList.add(new Property("compose", "", "When value set includes codes from elsewhere.", 0, java.lang.Integer.MAX_VALUE, compose)); + childrenList.add(new Property("expansion", "", "A value set can also be 'expanded', where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.", 0, java.lang.Integer.MAX_VALUE, expansion)); + } + + public ValueSet copy() { + ValueSet dst = new ValueSet(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + if (useContext != null) { + dst.useContext = new ArrayList(); + for (CodeableConcept i : useContext) + dst.useContext.add(i.copy()); + }; + dst.immutable = immutable == null ? null : immutable.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (ValueSetContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + dst.requirements = requirements == null ? null : requirements.copy(); + dst.copyright = copyright == null ? null : copyright.copy(); + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.extensible = extensible == null ? null : extensible.copy(); + dst.date = date == null ? null : date.copy(); + dst.lockedDate = lockedDate == null ? null : lockedDate.copy(); + dst.define = define == null ? null : define.copy(); + dst.compose = compose == null ? null : compose.copy(); + dst.expansion = expansion == null ? null : expansion.copy(); + return dst; + } + + protected ValueSet typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ValueSet)) + return false; + ValueSet o = (ValueSet) other; + return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) + && compareDeep(name, o.name, true) && compareDeep(useContext, o.useContext, true) && compareDeep(immutable, o.immutable, true) + && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(description, o.description, true) + && compareDeep(requirements, o.requirements, true) && compareDeep(copyright, o.copyright, true) + && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) && compareDeep(extensible, o.extensible, true) + && compareDeep(date, o.date, true) && compareDeep(lockedDate, o.lockedDate, true) && compareDeep(define, o.define, true) + && compareDeep(compose, o.compose, true) && compareDeep(expansion, o.expansion, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ValueSet)) + return false; + ValueSet o = (ValueSet) other; + return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) + && compareValues(immutable, o.immutable, true) && compareValues(publisher, o.publisher, true) && compareValues(description, o.description, true) + && compareValues(requirements, o.requirements, true) && compareValues(copyright, o.copyright, true) + && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(extensible, o.extensible, true) + && compareValues(date, o.date, true) && compareValues(lockedDate, o.lockedDate, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (useContext == null || useContext.isEmpty()) + && (immutable == null || immutable.isEmpty()) && (publisher == null || publisher.isEmpty()) + && (contact == null || contact.isEmpty()) && (description == null || description.isEmpty()) + && (requirements == null || requirements.isEmpty()) && (copyright == null || copyright.isEmpty()) + && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) + && (extensible == null || extensible.isEmpty()) && (date == null || date.isEmpty()) && (lockedDate == null || lockedDate.isEmpty()) + && (define == null || define.isEmpty()) && (compose == null || compose.isEmpty()) && (expansion == null || expansion.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ValueSet; + } + + @SearchParamDefinition(name="date", path="ValueSet.date", description="The value set publication date", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="ValueSet.identifier", description="The identifier for the value set", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="code", path="ValueSet.define.concept.code", description="A code defined in the value set", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="description", path="ValueSet.description", description="Text search in the description of the value set", type="string" ) + public static final String SP_DESCRIPTION = "description"; + @SearchParamDefinition(name="version", path="ValueSet.version", description="The version identifier of the value set", type="token" ) + public static final String SP_VERSION = "version"; + @SearchParamDefinition(name="url", path="ValueSet.url", description="The logical url for the value set", type="uri" ) + public static final String SP_URL = "url"; + @SearchParamDefinition(name="expansion", path="ValueSet.expansion.identifier", description="Uniquely identifies this expansion", type="uri" ) + public static final String SP_EXPANSION = "expansion"; + @SearchParamDefinition(name="reference", path="ValueSet.compose.include.system", description="A code system included or excluded in the value set or an imported value set", type="uri" ) + public static final String SP_REFERENCE = "reference"; + @SearchParamDefinition(name="system", path="ValueSet.define.system", description="The system for any codes defined by this value set", type="uri" ) + public static final String SP_SYSTEM = "system"; + @SearchParamDefinition(name="name", path="ValueSet.name", description="The name of the value set", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="context", path="ValueSet.useContext", description="A use context assigned to the value set", type="token" ) + public static final String SP_CONTEXT = "context"; + @SearchParamDefinition(name="publisher", path="ValueSet.publisher", description="Name of the publisher of the value set", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + @SearchParamDefinition(name="status", path="ValueSet.status", description="The status of the value set", type="token" ) + public static final String SP_STATUS = "status"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/VisionPrescription.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/VisionPrescription.java index 371a8fe9882..c6f09892745 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/VisionPrescription.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/VisionPrescription.java @@ -1,1581 +1,1560 @@ -package org.hl7.fhir.instance.model; - -/* - * #%L - * HAPI FHIR Structures - HL7.org DSTU2 - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - - -/* - 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 Tue, May 5, 2015 16:13-0400 for FHIR v0.5.0 - -import java.util.*; - -import java.math.*; -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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.api.*; -/** - * An authorization for the supply of glasses and/or contact lenses to a patient. - */ -@ResourceDef(name="VisionPrescription", profile="http://hl7.org/fhir/Profile/VisionPrescription") -public class VisionPrescription extends DomainResource { - - public enum EyeCodes { - /** - * right eye. - */ - RIGHT, - /** - * left eye. - */ - LEFT, - /** - * added to help the parsers - */ - NULL; - public static EyeCodes fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("right".equals(codeString)) - return RIGHT; - if ("left".equals(codeString)) - return LEFT; - throw new Exception("Unknown EyeCodes code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case RIGHT: return "right"; - case LEFT: return "left"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case RIGHT: return ""; - case LEFT: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case RIGHT: return "right eye."; - case LEFT: return "left eye."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case RIGHT: return "Right"; - case LEFT: return "Left"; - default: return "?"; - } - } - } - - public static class EyeCodesEnumFactory implements EnumFactory { - public EyeCodes fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("right".equals(codeString)) - return EyeCodes.RIGHT; - if ("left".equals(codeString)) - return EyeCodes.LEFT; - throw new IllegalArgumentException("Unknown EyeCodes code '"+codeString+"'"); - } - public String toCode(EyeCodes code) { - if (code == EyeCodes.RIGHT) - return "right"; - if (code == EyeCodes.LEFT) - return "left"; - return "?"; - } - } - - public enum BaseCodes { - /** - * top. - */ - UP, - /** - * bottom. - */ - DOWN, - /** - * inner edge. - */ - IN, - /** - * outer edge. - */ - OUT, - /** - * added to help the parsers - */ - NULL; - public static BaseCodes fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("up".equals(codeString)) - return UP; - if ("down".equals(codeString)) - return DOWN; - if ("in".equals(codeString)) - return IN; - if ("out".equals(codeString)) - return OUT; - throw new Exception("Unknown BaseCodes code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case UP: return "up"; - case DOWN: return "down"; - case IN: return "in"; - case OUT: return "out"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case UP: return ""; - case DOWN: return ""; - case IN: return ""; - case OUT: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case UP: return "top."; - case DOWN: return "bottom."; - case IN: return "inner edge."; - case OUT: return "outer edge."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case UP: return "Up"; - case DOWN: return "Down"; - case IN: return "In"; - case OUT: return "Out"; - default: return "?"; - } - } - } - - public static class BaseCodesEnumFactory implements EnumFactory { - public BaseCodes fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("up".equals(codeString)) - return BaseCodes.UP; - if ("down".equals(codeString)) - return BaseCodes.DOWN; - if ("in".equals(codeString)) - return BaseCodes.IN; - if ("out".equals(codeString)) - return BaseCodes.OUT; - throw new IllegalArgumentException("Unknown BaseCodes code '"+codeString+"'"); - } - public String toCode(BaseCodes code) { - if (code == BaseCodes.UP) - return "up"; - if (code == BaseCodes.DOWN) - return "down"; - if (code == BaseCodes.IN) - return "in"; - if (code == BaseCodes.OUT) - return "out"; - return "?"; - } - } - - @Block() - public static class VisionPrescriptionDispenseComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifies the type of Vision correction product which is required for the patient. - */ - @Child(name = "product", type = {Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Product to be supplied", formalDefinition="Identifies the type of Vision correction product which is required for the patient." ) - protected Coding product; - - /** - * The eye for which the lens applies. - */ - @Child(name = "eye", type = {CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="right | left", formalDefinition="The eye for which the lens applies." ) - protected Enumeration eye; - - /** - * Lens power measured in diopters (0.25 units). - */ - @Child(name = "sphere", type = {DecimalType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Lens sphere", formalDefinition="Lens power measured in diopters (0.25 units)." ) - protected DecimalType sphere; - - /** - * Power adjustment for astigmatism measured in diopters (0.25 units). - */ - @Child(name = "cylinder", type = {DecimalType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Lens cylinder", formalDefinition="Power adjustment for astigmatism measured in diopters (0.25 units)." ) - protected DecimalType cylinder; - - /** - * Adjustment for astigmatism measured in integer degrees. - */ - @Child(name = "axis", type = {IntegerType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Lens axis", formalDefinition="Adjustment for astigmatism measured in integer degrees." ) - protected IntegerType axis; - - /** - * Amount of prism to compensate for eye alignment in fractional units. - */ - @Child(name = "prism", type = {DecimalType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Lens prism", formalDefinition="Amount of prism to compensate for eye alignment in fractional units." ) - protected DecimalType prism; - - /** - * The relative base, or reference lens edge, for the prism. - */ - @Child(name = "base", type = {CodeType.class}, order=7, min=0, max=1) - @Description(shortDefinition="up | down | in | out", formalDefinition="The relative base, or reference lens edge, for the prism." ) - protected Enumeration base; - - /** - * Power adjustment for multifocal lenses measured in diopters (0.25 units). - */ - @Child(name = "add", type = {DecimalType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Lens add", formalDefinition="Power adjustment for multifocal lenses measured in diopters (0.25 units)." ) - protected DecimalType add; - - /** - * Contact lens power measured in diopters (0.25 units). - */ - @Child(name = "power", type = {DecimalType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Contact Lens power", formalDefinition="Contact lens power measured in diopters (0.25 units)." ) - protected DecimalType power; - - /** - * Back Curvature measured in millimeters. - */ - @Child(name = "backCurve", type = {DecimalType.class}, order=10, min=0, max=1) - @Description(shortDefinition="Contact lens back curvature", formalDefinition="Back Curvature measured in millimeters." ) - protected DecimalType backCurve; - - /** - * Contact lens diameter measured in millimeters. - */ - @Child(name = "diameter", type = {DecimalType.class}, order=11, min=0, max=1) - @Description(shortDefinition="Contact Lens diameter", formalDefinition="Contact lens diameter measured in millimeters." ) - protected DecimalType diameter; - - /** - * The recommended maximum wear period for the lens. - */ - @Child(name = "duration", type = {Quantity.class}, order=12, min=0, max=1) - @Description(shortDefinition="Lens wear duration", formalDefinition="The recommended maximum wear period for the lens." ) - protected Quantity duration; - - /** - * Special color or pattern. - */ - @Child(name = "color", type = {StringType.class}, order=13, min=0, max=1) - @Description(shortDefinition="Lens add", formalDefinition="Special color or pattern." ) - protected StringType color; - - /** - * Brand recommendations or restrictions. - */ - @Child(name = "brand", type = {StringType.class}, order=14, min=0, max=1) - @Description(shortDefinition="Lens add", formalDefinition="Brand recommendations or restrictions." ) - protected StringType brand; - - /** - * Notes for special requirements such as coatings and lens materials. - */ - @Child(name = "notes", type = {StringType.class}, order=15, min=0, max=1) - @Description(shortDefinition="Notes for coatings", formalDefinition="Notes for special requirements such as coatings and lens materials." ) - protected StringType notes; - - private static final long serialVersionUID = 548964753L; - - /* - * Constructor - */ - public VisionPrescriptionDispenseComponent() { - super(); - } - - /* - * Constructor - */ - public VisionPrescriptionDispenseComponent(Coding product) { - super(); - this.product = product; - } - - /** - * @return {@link #product} (Identifies the type of Vision correction product which is required for the patient.) - */ - public Coding getProduct() { - if (this.product == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.product"); - else if (Configuration.doAutoCreate()) - this.product = new Coding(); // cc - return this.product; - } - - public boolean hasProduct() { - return this.product != null && !this.product.isEmpty(); - } - - /** - * @param value {@link #product} (Identifies the type of Vision correction product which is required for the patient.) - */ - public VisionPrescriptionDispenseComponent setProduct(Coding value) { - this.product = value; - return this; - } - - /** - * @return {@link #eye} (The eye for which the lens applies.). This is the underlying object with id, value and extensions. The accessor "getEye" gives direct access to the value - */ - public Enumeration getEyeElement() { - if (this.eye == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.eye"); - else if (Configuration.doAutoCreate()) - this.eye = new Enumeration(new EyeCodesEnumFactory()); // bb - return this.eye; - } - - public boolean hasEyeElement() { - return this.eye != null && !this.eye.isEmpty(); - } - - public boolean hasEye() { - return this.eye != null && !this.eye.isEmpty(); - } - - /** - * @param value {@link #eye} (The eye for which the lens applies.). This is the underlying object with id, value and extensions. The accessor "getEye" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setEyeElement(Enumeration value) { - this.eye = value; - return this; - } - - /** - * @return The eye for which the lens applies. - */ - public EyeCodes getEye() { - return this.eye == null ? null : this.eye.getValue(); - } - - /** - * @param value The eye for which the lens applies. - */ - public VisionPrescriptionDispenseComponent setEye(EyeCodes value) { - if (value == null) - this.eye = null; - else { - if (this.eye == null) - this.eye = new Enumeration(new EyeCodesEnumFactory()); - this.eye.setValue(value); - } - return this; - } - - /** - * @return {@link #sphere} (Lens power measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getSphere" gives direct access to the value - */ - public DecimalType getSphereElement() { - if (this.sphere == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.sphere"); - else if (Configuration.doAutoCreate()) - this.sphere = new DecimalType(); // bb - return this.sphere; - } - - public boolean hasSphereElement() { - return this.sphere != null && !this.sphere.isEmpty(); - } - - public boolean hasSphere() { - return this.sphere != null && !this.sphere.isEmpty(); - } - - /** - * @param value {@link #sphere} (Lens power measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getSphere" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setSphereElement(DecimalType value) { - this.sphere = value; - return this; - } - - /** - * @return Lens power measured in diopters (0.25 units). - */ - public BigDecimal getSphere() { - return this.sphere == null ? null : this.sphere.getValue(); - } - - /** - * @param value Lens power measured in diopters (0.25 units). - */ - public VisionPrescriptionDispenseComponent setSphere(BigDecimal value) { - if (value == null) - this.sphere = null; - else { - if (this.sphere == null) - this.sphere = new DecimalType(); - this.sphere.setValue(value); - } - return this; - } - - /** - * @return {@link #cylinder} (Power adjustment for astigmatism measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getCylinder" gives direct access to the value - */ - public DecimalType getCylinderElement() { - if (this.cylinder == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.cylinder"); - else if (Configuration.doAutoCreate()) - this.cylinder = new DecimalType(); // bb - return this.cylinder; - } - - public boolean hasCylinderElement() { - return this.cylinder != null && !this.cylinder.isEmpty(); - } - - public boolean hasCylinder() { - return this.cylinder != null && !this.cylinder.isEmpty(); - } - - /** - * @param value {@link #cylinder} (Power adjustment for astigmatism measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getCylinder" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setCylinderElement(DecimalType value) { - this.cylinder = value; - return this; - } - - /** - * @return Power adjustment for astigmatism measured in diopters (0.25 units). - */ - public BigDecimal getCylinder() { - return this.cylinder == null ? null : this.cylinder.getValue(); - } - - /** - * @param value Power adjustment for astigmatism measured in diopters (0.25 units). - */ - public VisionPrescriptionDispenseComponent setCylinder(BigDecimal value) { - if (value == null) - this.cylinder = null; - else { - if (this.cylinder == null) - this.cylinder = new DecimalType(); - this.cylinder.setValue(value); - } - return this; - } - - /** - * @return {@link #axis} (Adjustment for astigmatism measured in integer degrees.). This is the underlying object with id, value and extensions. The accessor "getAxis" gives direct access to the value - */ - public IntegerType getAxisElement() { - if (this.axis == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.axis"); - else if (Configuration.doAutoCreate()) - this.axis = new IntegerType(); // bb - return this.axis; - } - - public boolean hasAxisElement() { - return this.axis != null && !this.axis.isEmpty(); - } - - public boolean hasAxis() { - return this.axis != null && !this.axis.isEmpty(); - } - - /** - * @param value {@link #axis} (Adjustment for astigmatism measured in integer degrees.). This is the underlying object with id, value and extensions. The accessor "getAxis" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setAxisElement(IntegerType value) { - this.axis = value; - return this; - } - - /** - * @return Adjustment for astigmatism measured in integer degrees. - */ - public int getAxis() { - return this.axis == null || this.axis.isEmpty() ? 0 : this.axis.getValue(); - } - - /** - * @param value Adjustment for astigmatism measured in integer degrees. - */ - public VisionPrescriptionDispenseComponent setAxis(int value) { - if (this.axis == null) - this.axis = new IntegerType(); - this.axis.setValue(value); - return this; - } - - /** - * @return {@link #prism} (Amount of prism to compensate for eye alignment in fractional units.). This is the underlying object with id, value and extensions. The accessor "getPrism" gives direct access to the value - */ - public DecimalType getPrismElement() { - if (this.prism == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.prism"); - else if (Configuration.doAutoCreate()) - this.prism = new DecimalType(); // bb - return this.prism; - } - - public boolean hasPrismElement() { - return this.prism != null && !this.prism.isEmpty(); - } - - public boolean hasPrism() { - return this.prism != null && !this.prism.isEmpty(); - } - - /** - * @param value {@link #prism} (Amount of prism to compensate for eye alignment in fractional units.). This is the underlying object with id, value and extensions. The accessor "getPrism" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setPrismElement(DecimalType value) { - this.prism = value; - return this; - } - - /** - * @return Amount of prism to compensate for eye alignment in fractional units. - */ - public BigDecimal getPrism() { - return this.prism == null ? null : this.prism.getValue(); - } - - /** - * @param value Amount of prism to compensate for eye alignment in fractional units. - */ - public VisionPrescriptionDispenseComponent setPrism(BigDecimal value) { - if (value == null) - this.prism = null; - else { - if (this.prism == null) - this.prism = new DecimalType(); - this.prism.setValue(value); - } - return this; - } - - /** - * @return {@link #base} (The relative base, or reference lens edge, for the prism.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public Enumeration getBaseElement() { - if (this.base == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.base"); - else if (Configuration.doAutoCreate()) - this.base = new Enumeration(new BaseCodesEnumFactory()); // bb - return this.base; - } - - public boolean hasBaseElement() { - return this.base != null && !this.base.isEmpty(); - } - - public boolean hasBase() { - return this.base != null && !this.base.isEmpty(); - } - - /** - * @param value {@link #base} (The relative base, or reference lens edge, for the prism.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setBaseElement(Enumeration value) { - this.base = value; - return this; - } - - /** - * @return The relative base, or reference lens edge, for the prism. - */ - public BaseCodes getBase() { - return this.base == null ? null : this.base.getValue(); - } - - /** - * @param value The relative base, or reference lens edge, for the prism. - */ - public VisionPrescriptionDispenseComponent setBase(BaseCodes value) { - if (value == null) - this.base = null; - else { - if (this.base == null) - this.base = new Enumeration(new BaseCodesEnumFactory()); - this.base.setValue(value); - } - return this; - } - - /** - * @return {@link #add} (Power adjustment for multifocal lenses measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getAdd" gives direct access to the value - */ - public DecimalType getAddElement() { - if (this.add == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.add"); - else if (Configuration.doAutoCreate()) - this.add = new DecimalType(); // bb - return this.add; - } - - public boolean hasAddElement() { - return this.add != null && !this.add.isEmpty(); - } - - public boolean hasAdd() { - return this.add != null && !this.add.isEmpty(); - } - - /** - * @param value {@link #add} (Power adjustment for multifocal lenses measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getAdd" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setAddElement(DecimalType value) { - this.add = value; - return this; - } - - /** - * @return Power adjustment for multifocal lenses measured in diopters (0.25 units). - */ - public BigDecimal getAdd() { - return this.add == null ? null : this.add.getValue(); - } - - /** - * @param value Power adjustment for multifocal lenses measured in diopters (0.25 units). - */ - public VisionPrescriptionDispenseComponent setAdd(BigDecimal value) { - if (value == null) - this.add = null; - else { - if (this.add == null) - this.add = new DecimalType(); - this.add.setValue(value); - } - return this; - } - - /** - * @return {@link #power} (Contact lens power measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getPower" gives direct access to the value - */ - public DecimalType getPowerElement() { - if (this.power == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.power"); - else if (Configuration.doAutoCreate()) - this.power = new DecimalType(); // bb - return this.power; - } - - public boolean hasPowerElement() { - return this.power != null && !this.power.isEmpty(); - } - - public boolean hasPower() { - return this.power != null && !this.power.isEmpty(); - } - - /** - * @param value {@link #power} (Contact lens power measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getPower" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setPowerElement(DecimalType value) { - this.power = value; - return this; - } - - /** - * @return Contact lens power measured in diopters (0.25 units). - */ - public BigDecimal getPower() { - return this.power == null ? null : this.power.getValue(); - } - - /** - * @param value Contact lens power measured in diopters (0.25 units). - */ - public VisionPrescriptionDispenseComponent setPower(BigDecimal value) { - if (value == null) - this.power = null; - else { - if (this.power == null) - this.power = new DecimalType(); - this.power.setValue(value); - } - return this; - } - - /** - * @return {@link #backCurve} (Back Curvature measured in millimeters.). This is the underlying object with id, value and extensions. The accessor "getBackCurve" gives direct access to the value - */ - public DecimalType getBackCurveElement() { - if (this.backCurve == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.backCurve"); - else if (Configuration.doAutoCreate()) - this.backCurve = new DecimalType(); // bb - return this.backCurve; - } - - public boolean hasBackCurveElement() { - return this.backCurve != null && !this.backCurve.isEmpty(); - } - - public boolean hasBackCurve() { - return this.backCurve != null && !this.backCurve.isEmpty(); - } - - /** - * @param value {@link #backCurve} (Back Curvature measured in millimeters.). This is the underlying object with id, value and extensions. The accessor "getBackCurve" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setBackCurveElement(DecimalType value) { - this.backCurve = value; - return this; - } - - /** - * @return Back Curvature measured in millimeters. - */ - public BigDecimal getBackCurve() { - return this.backCurve == null ? null : this.backCurve.getValue(); - } - - /** - * @param value Back Curvature measured in millimeters. - */ - public VisionPrescriptionDispenseComponent setBackCurve(BigDecimal value) { - if (value == null) - this.backCurve = null; - else { - if (this.backCurve == null) - this.backCurve = new DecimalType(); - this.backCurve.setValue(value); - } - return this; - } - - /** - * @return {@link #diameter} (Contact lens diameter measured in millimeters.). This is the underlying object with id, value and extensions. The accessor "getDiameter" gives direct access to the value - */ - public DecimalType getDiameterElement() { - if (this.diameter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.diameter"); - else if (Configuration.doAutoCreate()) - this.diameter = new DecimalType(); // bb - return this.diameter; - } - - public boolean hasDiameterElement() { - return this.diameter != null && !this.diameter.isEmpty(); - } - - public boolean hasDiameter() { - return this.diameter != null && !this.diameter.isEmpty(); - } - - /** - * @param value {@link #diameter} (Contact lens diameter measured in millimeters.). This is the underlying object with id, value and extensions. The accessor "getDiameter" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setDiameterElement(DecimalType value) { - this.diameter = value; - return this; - } - - /** - * @return Contact lens diameter measured in millimeters. - */ - public BigDecimal getDiameter() { - return this.diameter == null ? null : this.diameter.getValue(); - } - - /** - * @param value Contact lens diameter measured in millimeters. - */ - public VisionPrescriptionDispenseComponent setDiameter(BigDecimal value) { - if (value == null) - this.diameter = null; - else { - if (this.diameter == null) - this.diameter = new DecimalType(); - this.diameter.setValue(value); - } - return this; - } - - /** - * @return {@link #duration} (The recommended maximum wear period for the lens.) - */ - public Quantity getDuration() { - if (this.duration == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.duration"); - else if (Configuration.doAutoCreate()) - this.duration = new Quantity(); // cc - return this.duration; - } - - public boolean hasDuration() { - return this.duration != null && !this.duration.isEmpty(); - } - - /** - * @param value {@link #duration} (The recommended maximum wear period for the lens.) - */ - public VisionPrescriptionDispenseComponent setDuration(Quantity value) { - this.duration = value; - return this; - } - - /** - * @return {@link #color} (Special color or pattern.). This is the underlying object with id, value and extensions. The accessor "getColor" gives direct access to the value - */ - public StringType getColorElement() { - if (this.color == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.color"); - else if (Configuration.doAutoCreate()) - this.color = new StringType(); // bb - return this.color; - } - - public boolean hasColorElement() { - return this.color != null && !this.color.isEmpty(); - } - - public boolean hasColor() { - return this.color != null && !this.color.isEmpty(); - } - - /** - * @param value {@link #color} (Special color or pattern.). This is the underlying object with id, value and extensions. The accessor "getColor" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setColorElement(StringType value) { - this.color = value; - return this; - } - - /** - * @return Special color or pattern. - */ - public String getColor() { - return this.color == null ? null : this.color.getValue(); - } - - /** - * @param value Special color or pattern. - */ - public VisionPrescriptionDispenseComponent setColor(String value) { - if (Utilities.noString(value)) - this.color = null; - else { - if (this.color == null) - this.color = new StringType(); - this.color.setValue(value); - } - return this; - } - - /** - * @return {@link #brand} (Brand recommendations or restrictions.). This is the underlying object with id, value and extensions. The accessor "getBrand" gives direct access to the value - */ - public StringType getBrandElement() { - if (this.brand == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.brand"); - else if (Configuration.doAutoCreate()) - this.brand = new StringType(); // bb - return this.brand; - } - - public boolean hasBrandElement() { - return this.brand != null && !this.brand.isEmpty(); - } - - public boolean hasBrand() { - return this.brand != null && !this.brand.isEmpty(); - } - - /** - * @param value {@link #brand} (Brand recommendations or restrictions.). This is the underlying object with id, value and extensions. The accessor "getBrand" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setBrandElement(StringType value) { - this.brand = value; - return this; - } - - /** - * @return Brand recommendations or restrictions. - */ - public String getBrand() { - return this.brand == null ? null : this.brand.getValue(); - } - - /** - * @param value Brand recommendations or restrictions. - */ - public VisionPrescriptionDispenseComponent setBrand(String value) { - if (Utilities.noString(value)) - this.brand = null; - else { - if (this.brand == null) - this.brand = new StringType(); - this.brand.setValue(value); - } - return this; - } - - /** - * @return {@link #notes} (Notes for special requirements such as coatings and lens materials.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public StringType getNotesElement() { - if (this.notes == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.notes"); - else if (Configuration.doAutoCreate()) - this.notes = new StringType(); // bb - return this.notes; - } - - public boolean hasNotesElement() { - return this.notes != null && !this.notes.isEmpty(); - } - - public boolean hasNotes() { - return this.notes != null && !this.notes.isEmpty(); - } - - /** - * @param value {@link #notes} (Notes for special requirements such as coatings and lens materials.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setNotesElement(StringType value) { - this.notes = value; - return this; - } - - /** - * @return Notes for special requirements such as coatings and lens materials. - */ - public String getNotes() { - return this.notes == null ? null : this.notes.getValue(); - } - - /** - * @param value Notes for special requirements such as coatings and lens materials. - */ - public VisionPrescriptionDispenseComponent setNotes(String value) { - if (Utilities.noString(value)) - this.notes = null; - else { - if (this.notes == null) - this.notes = new StringType(); - this.notes.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("product", "Coding", "Identifies the type of Vision correction product which is required for the patient.", 0, java.lang.Integer.MAX_VALUE, product)); - childrenList.add(new Property("eye", "code", "The eye for which the lens applies.", 0, java.lang.Integer.MAX_VALUE, eye)); - childrenList.add(new Property("sphere", "decimal", "Lens power measured in diopters (0.25 units).", 0, java.lang.Integer.MAX_VALUE, sphere)); - childrenList.add(new Property("cylinder", "decimal", "Power adjustment for astigmatism measured in diopters (0.25 units).", 0, java.lang.Integer.MAX_VALUE, cylinder)); - childrenList.add(new Property("axis", "integer", "Adjustment for astigmatism measured in integer degrees.", 0, java.lang.Integer.MAX_VALUE, axis)); - childrenList.add(new Property("prism", "decimal", "Amount of prism to compensate for eye alignment in fractional units.", 0, java.lang.Integer.MAX_VALUE, prism)); - childrenList.add(new Property("base", "code", "The relative base, or reference lens edge, for the prism.", 0, java.lang.Integer.MAX_VALUE, base)); - childrenList.add(new Property("add", "decimal", "Power adjustment for multifocal lenses measured in diopters (0.25 units).", 0, java.lang.Integer.MAX_VALUE, add)); - childrenList.add(new Property("power", "decimal", "Contact lens power measured in diopters (0.25 units).", 0, java.lang.Integer.MAX_VALUE, power)); - childrenList.add(new Property("backCurve", "decimal", "Back Curvature measured in millimeters.", 0, java.lang.Integer.MAX_VALUE, backCurve)); - childrenList.add(new Property("diameter", "decimal", "Contact lens diameter measured in millimeters.", 0, java.lang.Integer.MAX_VALUE, diameter)); - childrenList.add(new Property("duration", "Quantity", "The recommended maximum wear period for the lens.", 0, java.lang.Integer.MAX_VALUE, duration)); - childrenList.add(new Property("color", "string", "Special color or pattern.", 0, java.lang.Integer.MAX_VALUE, color)); - childrenList.add(new Property("brand", "string", "Brand recommendations or restrictions.", 0, java.lang.Integer.MAX_VALUE, brand)); - childrenList.add(new Property("notes", "string", "Notes for special requirements such as coatings and lens materials.", 0, java.lang.Integer.MAX_VALUE, notes)); - } - - public VisionPrescriptionDispenseComponent copy() { - VisionPrescriptionDispenseComponent dst = new VisionPrescriptionDispenseComponent(); - copyValues(dst); - dst.product = product == null ? null : product.copy(); - dst.eye = eye == null ? null : eye.copy(); - dst.sphere = sphere == null ? null : sphere.copy(); - dst.cylinder = cylinder == null ? null : cylinder.copy(); - dst.axis = axis == null ? null : axis.copy(); - dst.prism = prism == null ? null : prism.copy(); - dst.base = base == null ? null : base.copy(); - dst.add = add == null ? null : add.copy(); - dst.power = power == null ? null : power.copy(); - dst.backCurve = backCurve == null ? null : backCurve.copy(); - dst.diameter = diameter == null ? null : diameter.copy(); - dst.duration = duration == null ? null : duration.copy(); - dst.color = color == null ? null : color.copy(); - dst.brand = brand == null ? null : brand.copy(); - dst.notes = notes == null ? null : notes.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof VisionPrescriptionDispenseComponent)) - return false; - VisionPrescriptionDispenseComponent o = (VisionPrescriptionDispenseComponent) other; - return compareDeep(product, o.product, true) && compareDeep(eye, o.eye, true) && compareDeep(sphere, o.sphere, true) - && compareDeep(cylinder, o.cylinder, true) && compareDeep(axis, o.axis, true) && compareDeep(prism, o.prism, true) - && compareDeep(base, o.base, true) && compareDeep(add, o.add, true) && compareDeep(power, o.power, true) - && compareDeep(backCurve, o.backCurve, true) && compareDeep(diameter, o.diameter, true) && compareDeep(duration, o.duration, true) - && compareDeep(color, o.color, true) && compareDeep(brand, o.brand, true) && compareDeep(notes, o.notes, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof VisionPrescriptionDispenseComponent)) - return false; - VisionPrescriptionDispenseComponent o = (VisionPrescriptionDispenseComponent) other; - return compareValues(eye, o.eye, true) && compareValues(sphere, o.sphere, true) && compareValues(cylinder, o.cylinder, true) - && compareValues(axis, o.axis, true) && compareValues(prism, o.prism, true) && compareValues(base, o.base, true) - && compareValues(add, o.add, true) && compareValues(power, o.power, true) && compareValues(backCurve, o.backCurve, true) - && compareValues(diameter, o.diameter, true) && compareValues(color, o.color, true) && compareValues(brand, o.brand, true) - && compareValues(notes, o.notes, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (product == null || product.isEmpty()) && (eye == null || eye.isEmpty()) - && (sphere == null || sphere.isEmpty()) && (cylinder == null || cylinder.isEmpty()) && (axis == null || axis.isEmpty()) - && (prism == null || prism.isEmpty()) && (base == null || base.isEmpty()) && (add == null || add.isEmpty()) - && (power == null || power.isEmpty()) && (backCurve == null || backCurve.isEmpty()) && (diameter == null || diameter.isEmpty()) - && (duration == null || duration.isEmpty()) && (color == null || color.isEmpty()) && (brand == null || brand.isEmpty()) - && (notes == null || notes.isEmpty()); - } - - } - - /** - * Business identifier which may be used by other parties to reference or identify the prescription. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business identifier", formalDefinition="Business identifier which may be used by other parties to reference or identify the prescription." ) - protected List identifier; - - /** - * The date (and perhaps time) when the prescription was written. - */ - @Child(name = "dateWritten", type = {DateTimeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="When prescription was authorized", formalDefinition="The date (and perhaps time) when the prescription was written." ) - protected DateTimeType dateWritten; - - /** - * A link to a resource representing the person to whom the Vision products will be supplied. - */ - @Child(name = "patient", type = {Patient.class}, order=2, min=0, max=1) - @Description(shortDefinition="Who prescription is for", formalDefinition="A link to a resource representing the person to whom the Vision products will be supplied." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (A link to a resource representing the person to whom the Vision products will be supplied.) - */ - protected Patient patientTarget; - - /** - * The healthcare professional responsible for authorizing the prescription. - */ - @Child(name = "prescriber", type = {Practitioner.class}, order=3, min=0, max=1) - @Description(shortDefinition="Who authorizes the Vision product", formalDefinition="The healthcare professional responsible for authorizing the prescription." ) - protected Reference prescriber; - - /** - * The actual object that is the target of the reference (The healthcare professional responsible for authorizing the prescription.) - */ - protected Practitioner prescriberTarget; - - /** - * A link to a resource that identifies the particular occurrence of contact between patient and health care provider. - */ - @Child(name = "encounter", type = {Encounter.class}, order=4, min=0, max=1) - @Description(shortDefinition="Created during encounter / admission / stay", formalDefinition="A link to a resource that identifies the particular occurrence of contact between patient and health care provider." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - protected Encounter encounterTarget; - - /** - * Can be the reason or the indication for writing the prescription. - */ - @Child(name = "reason", type = {CodeableConcept.class, Condition.class}, order=5, min=0, max=1) - @Description(shortDefinition="Reason or indication for writing the prescription", formalDefinition="Can be the reason or the indication for writing the prescription." ) - protected Type reason; - - /** - * Deals with details of the dispense part of the supply specification. - */ - @Child(name = "dispense", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Vision supply authorization", formalDefinition="Deals with details of the dispense part of the supply specification." ) - protected List dispense; - - private static final long serialVersionUID = -1108276057L; - - /* - * Constructor - */ - public VisionPrescription() { - super(); - } - - /** - * @return {@link #identifier} (Business identifier which may be used by other parties to reference or identify the prescription.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Business identifier which may be used by other parties to reference or identify the prescription.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public VisionPrescription addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value - */ - public DateTimeType getDateWrittenElement() { - if (this.dateWritten == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescription.dateWritten"); - else if (Configuration.doAutoCreate()) - this.dateWritten = new DateTimeType(); // bb - return this.dateWritten; - } - - public boolean hasDateWrittenElement() { - return this.dateWritten != null && !this.dateWritten.isEmpty(); - } - - public boolean hasDateWritten() { - return this.dateWritten != null && !this.dateWritten.isEmpty(); - } - - /** - * @param value {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value - */ - public VisionPrescription setDateWrittenElement(DateTimeType value) { - this.dateWritten = value; - return this; - } - - /** - * @return The date (and perhaps time) when the prescription was written. - */ - public Date getDateWritten() { - return this.dateWritten == null ? null : this.dateWritten.getValue(); - } - - /** - * @param value The date (and perhaps time) when the prescription was written. - */ - public VisionPrescription setDateWritten(Date value) { - if (value == null) - this.dateWritten = null; - else { - if (this.dateWritten == null) - this.dateWritten = new DateTimeType(); - this.dateWritten.setValue(value); - } - return this; - } - - /** - * @return {@link #patient} (A link to a resource representing the person to whom the Vision products will be supplied.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescription.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (A link to a resource representing the person to whom the Vision products will be supplied.) - */ - public VisionPrescription setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person to whom the Vision products will be supplied.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescription.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person to whom the Vision products will be supplied.) - */ - public VisionPrescription setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.) - */ - public Reference getPrescriber() { - if (this.prescriber == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescription.prescriber"); - else if (Configuration.doAutoCreate()) - this.prescriber = new Reference(); // cc - return this.prescriber; - } - - public boolean hasPrescriber() { - return this.prescriber != null && !this.prescriber.isEmpty(); - } - - /** - * @param value {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.) - */ - public VisionPrescription setPrescriber(Reference value) { - this.prescriber = value; - return this; - } - - /** - * @return {@link #prescriber} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The healthcare professional responsible for authorizing the prescription.) - */ - public Practitioner getPrescriberTarget() { - if (this.prescriberTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescription.prescriber"); - else if (Configuration.doAutoCreate()) - this.prescriberTarget = new Practitioner(); // aa - return this.prescriberTarget; - } - - /** - * @param value {@link #prescriber} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The healthcare professional responsible for authorizing the prescription.) - */ - public VisionPrescription setPrescriberTarget(Practitioner value) { - this.prescriberTarget = value; - return this; - } - - /** - * @return {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescription.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public VisionPrescription setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescription.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public VisionPrescription setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) - */ - public Type getReason() { - return this.reason; - } - - /** - * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) - */ - public CodeableConcept getReasonCodeableConcept() throws Exception { - if (!(this.reason instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (CodeableConcept) this.reason; - } - - /** - * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) - */ - public Reference getReasonReference() throws Exception { - if (!(this.reason instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (Reference) this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Can be the reason or the indication for writing the prescription.) - */ - public VisionPrescription setReason(Type value) { - this.reason = value; - return this; - } - - /** - * @return {@link #dispense} (Deals with details of the dispense part of the supply specification.) - */ - public List getDispense() { - if (this.dispense == null) - this.dispense = new ArrayList(); - return this.dispense; - } - - public boolean hasDispense() { - if (this.dispense == null) - return false; - for (VisionPrescriptionDispenseComponent item : this.dispense) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dispense} (Deals with details of the dispense part of the supply specification.) - */ - // syntactic sugar - public VisionPrescriptionDispenseComponent addDispense() { //3 - VisionPrescriptionDispenseComponent t = new VisionPrescriptionDispenseComponent(); - if (this.dispense == null) - this.dispense = new ArrayList(); - this.dispense.add(t); - return t; - } - - // syntactic sugar - public VisionPrescription addDispense(VisionPrescriptionDispenseComponent t) { //3 - if (t == null) - return this; - if (this.dispense == null) - this.dispense = new ArrayList(); - this.dispense.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Business identifier which may be used by other parties to reference or identify the prescription.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("dateWritten", "dateTime", "The date (and perhaps time) when the prescription was written.", 0, java.lang.Integer.MAX_VALUE, dateWritten)); - childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person to whom the Vision products will be supplied.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("prescriber", "Reference(Practitioner)", "The healthcare professional responsible for authorizing the prescription.", 0, java.lang.Integer.MAX_VALUE, prescriber)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "A link to a resource that identifies the particular occurrence of contact between patient and health care provider.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Condition)", "Can be the reason or the indication for writing the prescription.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("dispense", "", "Deals with details of the dispense part of the supply specification.", 0, java.lang.Integer.MAX_VALUE, dispense)); - } - - public VisionPrescription copy() { - VisionPrescription dst = new VisionPrescription(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.dateWritten = dateWritten == null ? null : dateWritten.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.prescriber = prescriber == null ? null : prescriber.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.reason = reason == null ? null : reason.copy(); - if (dispense != null) { - dst.dispense = new ArrayList(); - for (VisionPrescriptionDispenseComponent i : dispense) - dst.dispense.add(i.copy()); - }; - return dst; - } - - protected VisionPrescription typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof VisionPrescription)) - return false; - VisionPrescription o = (VisionPrescription) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(dateWritten, o.dateWritten, true) - && compareDeep(patient, o.patient, true) && compareDeep(prescriber, o.prescriber, true) && compareDeep(encounter, o.encounter, true) - && compareDeep(reason, o.reason, true) && compareDeep(dispense, o.dispense, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof VisionPrescription)) - return false; - VisionPrescription o = (VisionPrescription) other; - return compareValues(dateWritten, o.dateWritten, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (dateWritten == null || dateWritten.isEmpty()) - && (patient == null || patient.isEmpty()) && (prescriber == null || prescriber.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (reason == null || reason.isEmpty()) && (dispense == null || dispense.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.VisionPrescription; - } - - @SearchParamDefinition(name="datewritten", path="VisionPrescription.dateWritten", description="Return prescriptions written on this date", type="date" ) - public static final String SP_DATEWRITTEN = "datewritten"; - @SearchParamDefinition(name="patient", path="VisionPrescription.patient", description="The identity of a patient to list dispenses for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="prescriber", path="VisionPrescription.prescriber", description="Who authorizes the Vision product", type="reference" ) - public static final String SP_PRESCRIBER = "prescriber"; - @SearchParamDefinition(name="encounter", path="VisionPrescription.encounter", description="Return prescriptions with this encounter identity", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - @SearchParamDefinition(name="identifier", path="VisionPrescription.identifier", description="Return prescriptions with this external identity", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Fri, May 22, 2015 17:15-0400 for FHIR v0.5.0 + +import java.util.*; + +import java.math.*; +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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.api.*; +/** + * An authorization for the supply of glasses and/or contact lenses to a patient. + */ +@ResourceDef(name="VisionPrescription", profile="http://hl7.org/fhir/Profile/VisionPrescription") +public class VisionPrescription extends DomainResource { + + public enum EyeCodes { + /** + * right eye. + */ + RIGHT, + /** + * left eye. + */ + LEFT, + /** + * added to help the parsers + */ + NULL; + public static EyeCodes fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("right".equals(codeString)) + return RIGHT; + if ("left".equals(codeString)) + return LEFT; + throw new Exception("Unknown EyeCodes code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case RIGHT: return "right"; + case LEFT: return "left"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case RIGHT: return ""; + case LEFT: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case RIGHT: return "right eye."; + case LEFT: return "left eye."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case RIGHT: return "Right"; + case LEFT: return "Left"; + default: return "?"; + } + } + } + + public static class EyeCodesEnumFactory implements EnumFactory { + public EyeCodes fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("right".equals(codeString)) + return EyeCodes.RIGHT; + if ("left".equals(codeString)) + return EyeCodes.LEFT; + throw new IllegalArgumentException("Unknown EyeCodes code '"+codeString+"'"); + } + public String toCode(EyeCodes code) { + if (code == EyeCodes.RIGHT) + return "right"; + if (code == EyeCodes.LEFT) + return "left"; + return "?"; + } + } + + public enum BaseCodes { + /** + * top. + */ + UP, + /** + * bottom. + */ + DOWN, + /** + * inner edge. + */ + IN, + /** + * outer edge. + */ + OUT, + /** + * added to help the parsers + */ + NULL; + public static BaseCodes fromCode(String codeString) throws Exception { + if (codeString == null || "".equals(codeString)) + return null; + if ("up".equals(codeString)) + return UP; + if ("down".equals(codeString)) + return DOWN; + if ("in".equals(codeString)) + return IN; + if ("out".equals(codeString)) + return OUT; + throw new Exception("Unknown BaseCodes code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case UP: return "up"; + case DOWN: return "down"; + case IN: return "in"; + case OUT: return "out"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case UP: return ""; + case DOWN: return ""; + case IN: return ""; + case OUT: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case UP: return "top."; + case DOWN: return "bottom."; + case IN: return "inner edge."; + case OUT: return "outer edge."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case UP: return "Up"; + case DOWN: return "Down"; + case IN: return "In"; + case OUT: return "Out"; + default: return "?"; + } + } + } + + public static class BaseCodesEnumFactory implements EnumFactory { + public BaseCodes fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("up".equals(codeString)) + return BaseCodes.UP; + if ("down".equals(codeString)) + return BaseCodes.DOWN; + if ("in".equals(codeString)) + return BaseCodes.IN; + if ("out".equals(codeString)) + return BaseCodes.OUT; + throw new IllegalArgumentException("Unknown BaseCodes code '"+codeString+"'"); + } + public String toCode(BaseCodes code) { + if (code == BaseCodes.UP) + return "up"; + if (code == BaseCodes.DOWN) + return "down"; + if (code == BaseCodes.IN) + return "in"; + if (code == BaseCodes.OUT) + return "out"; + return "?"; + } + } + + @Block() + public static class VisionPrescriptionDispenseComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifies the type of Vision correction product which is required for the patient. + */ + @Child(name = "product", type = {Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Product to be supplied", formalDefinition="Identifies the type of Vision correction product which is required for the patient." ) + protected Coding product; + + /** + * The eye for which the lens applies. + */ + @Child(name = "eye", type = {CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="right | left", formalDefinition="The eye for which the lens applies." ) + protected Enumeration eye; + + /** + * Lens power measured in diopters (0.25 units). + */ + @Child(name = "sphere", type = {DecimalType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Lens sphere", formalDefinition="Lens power measured in diopters (0.25 units)." ) + protected DecimalType sphere; + + /** + * Power adjustment for astigmatism measured in diopters (0.25 units). + */ + @Child(name = "cylinder", type = {DecimalType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Lens cylinder", formalDefinition="Power adjustment for astigmatism measured in diopters (0.25 units)." ) + protected DecimalType cylinder; + + /** + * Adjustment for astigmatism measured in integer degrees. + */ + @Child(name = "axis", type = {IntegerType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Lens axis", formalDefinition="Adjustment for astigmatism measured in integer degrees." ) + protected IntegerType axis; + + /** + * Amount of prism to compensate for eye alignment in fractional units. + */ + @Child(name = "prism", type = {DecimalType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Lens prism", formalDefinition="Amount of prism to compensate for eye alignment in fractional units." ) + protected DecimalType prism; + + /** + * The relative base, or reference lens edge, for the prism. + */ + @Child(name = "base", type = {CodeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="up | down | in | out", formalDefinition="The relative base, or reference lens edge, for the prism." ) + protected Enumeration base; + + /** + * Power adjustment for multifocal lenses measured in diopters (0.25 units). + */ + @Child(name = "add", type = {DecimalType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Lens add", formalDefinition="Power adjustment for multifocal lenses measured in diopters (0.25 units)." ) + protected DecimalType add; + + /** + * Contact lens power measured in diopters (0.25 units). + */ + @Child(name = "power", type = {DecimalType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Contact Lens power", formalDefinition="Contact lens power measured in diopters (0.25 units)." ) + protected DecimalType power; + + /** + * Back Curvature measured in millimeters. + */ + @Child(name = "backCurve", type = {DecimalType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Contact lens back curvature", formalDefinition="Back Curvature measured in millimeters." ) + protected DecimalType backCurve; + + /** + * Contact lens diameter measured in millimeters. + */ + @Child(name = "diameter", type = {DecimalType.class}, order=11, min=0, max=1) + @Description(shortDefinition="Contact Lens diameter", formalDefinition="Contact lens diameter measured in millimeters." ) + protected DecimalType diameter; + + /** + * The recommended maximum wear period for the lens. + */ + @Child(name = "duration", type = {Quantity.class}, order=12, min=0, max=1) + @Description(shortDefinition="Lens wear duration", formalDefinition="The recommended maximum wear period for the lens." ) + protected Quantity duration; + + /** + * Special color or pattern. + */ + @Child(name = "color", type = {StringType.class}, order=13, min=0, max=1) + @Description(shortDefinition="Lens add", formalDefinition="Special color or pattern." ) + protected StringType color; + + /** + * Brand recommendations or restrictions. + */ + @Child(name = "brand", type = {StringType.class}, order=14, min=0, max=1) + @Description(shortDefinition="Lens add", formalDefinition="Brand recommendations or restrictions." ) + protected StringType brand; + + /** + * Notes for special requirements such as coatings and lens materials. + */ + @Child(name = "notes", type = {StringType.class}, order=15, min=0, max=1) + @Description(shortDefinition="Notes for coatings", formalDefinition="Notes for special requirements such as coatings and lens materials." ) + protected StringType notes; + + private static final long serialVersionUID = 548964753L; + + /* + * Constructor + */ + public VisionPrescriptionDispenseComponent() { + super(); + } + + /* + * Constructor + */ + public VisionPrescriptionDispenseComponent(Coding product) { + super(); + this.product = product; + } + + /** + * @return {@link #product} (Identifies the type of Vision correction product which is required for the patient.) + */ + public Coding getProduct() { + if (this.product == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.product"); + else if (Configuration.doAutoCreate()) + this.product = new Coding(); // cc + return this.product; + } + + public boolean hasProduct() { + return this.product != null && !this.product.isEmpty(); + } + + /** + * @param value {@link #product} (Identifies the type of Vision correction product which is required for the patient.) + */ + public VisionPrescriptionDispenseComponent setProduct(Coding value) { + this.product = value; + return this; + } + + /** + * @return {@link #eye} (The eye for which the lens applies.). This is the underlying object with id, value and extensions. The accessor "getEye" gives direct access to the value + */ + public Enumeration getEyeElement() { + if (this.eye == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.eye"); + else if (Configuration.doAutoCreate()) + this.eye = new Enumeration(new EyeCodesEnumFactory()); // bb + return this.eye; + } + + public boolean hasEyeElement() { + return this.eye != null && !this.eye.isEmpty(); + } + + public boolean hasEye() { + return this.eye != null && !this.eye.isEmpty(); + } + + /** + * @param value {@link #eye} (The eye for which the lens applies.). This is the underlying object with id, value and extensions. The accessor "getEye" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setEyeElement(Enumeration value) { + this.eye = value; + return this; + } + + /** + * @return The eye for which the lens applies. + */ + public EyeCodes getEye() { + return this.eye == null ? null : this.eye.getValue(); + } + + /** + * @param value The eye for which the lens applies. + */ + public VisionPrescriptionDispenseComponent setEye(EyeCodes value) { + if (value == null) + this.eye = null; + else { + if (this.eye == null) + this.eye = new Enumeration(new EyeCodesEnumFactory()); + this.eye.setValue(value); + } + return this; + } + + /** + * @return {@link #sphere} (Lens power measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getSphere" gives direct access to the value + */ + public DecimalType getSphereElement() { + if (this.sphere == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.sphere"); + else if (Configuration.doAutoCreate()) + this.sphere = new DecimalType(); // bb + return this.sphere; + } + + public boolean hasSphereElement() { + return this.sphere != null && !this.sphere.isEmpty(); + } + + public boolean hasSphere() { + return this.sphere != null && !this.sphere.isEmpty(); + } + + /** + * @param value {@link #sphere} (Lens power measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getSphere" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setSphereElement(DecimalType value) { + this.sphere = value; + return this; + } + + /** + * @return Lens power measured in diopters (0.25 units). + */ + public BigDecimal getSphere() { + return this.sphere == null ? null : this.sphere.getValue(); + } + + /** + * @param value Lens power measured in diopters (0.25 units). + */ + public VisionPrescriptionDispenseComponent setSphere(BigDecimal value) { + if (value == null) + this.sphere = null; + else { + if (this.sphere == null) + this.sphere = new DecimalType(); + this.sphere.setValue(value); + } + return this; + } + + /** + * @return {@link #cylinder} (Power adjustment for astigmatism measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getCylinder" gives direct access to the value + */ + public DecimalType getCylinderElement() { + if (this.cylinder == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.cylinder"); + else if (Configuration.doAutoCreate()) + this.cylinder = new DecimalType(); // bb + return this.cylinder; + } + + public boolean hasCylinderElement() { + return this.cylinder != null && !this.cylinder.isEmpty(); + } + + public boolean hasCylinder() { + return this.cylinder != null && !this.cylinder.isEmpty(); + } + + /** + * @param value {@link #cylinder} (Power adjustment for astigmatism measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getCylinder" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setCylinderElement(DecimalType value) { + this.cylinder = value; + return this; + } + + /** + * @return Power adjustment for astigmatism measured in diopters (0.25 units). + */ + public BigDecimal getCylinder() { + return this.cylinder == null ? null : this.cylinder.getValue(); + } + + /** + * @param value Power adjustment for astigmatism measured in diopters (0.25 units). + */ + public VisionPrescriptionDispenseComponent setCylinder(BigDecimal value) { + if (value == null) + this.cylinder = null; + else { + if (this.cylinder == null) + this.cylinder = new DecimalType(); + this.cylinder.setValue(value); + } + return this; + } + + /** + * @return {@link #axis} (Adjustment for astigmatism measured in integer degrees.). This is the underlying object with id, value and extensions. The accessor "getAxis" gives direct access to the value + */ + public IntegerType getAxisElement() { + if (this.axis == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.axis"); + else if (Configuration.doAutoCreate()) + this.axis = new IntegerType(); // bb + return this.axis; + } + + public boolean hasAxisElement() { + return this.axis != null && !this.axis.isEmpty(); + } + + public boolean hasAxis() { + return this.axis != null && !this.axis.isEmpty(); + } + + /** + * @param value {@link #axis} (Adjustment for astigmatism measured in integer degrees.). This is the underlying object with id, value and extensions. The accessor "getAxis" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setAxisElement(IntegerType value) { + this.axis = value; + return this; + } + + /** + * @return Adjustment for astigmatism measured in integer degrees. + */ + public int getAxis() { + return this.axis == null || this.axis.isEmpty() ? 0 : this.axis.getValue(); + } + + /** + * @param value Adjustment for astigmatism measured in integer degrees. + */ + public VisionPrescriptionDispenseComponent setAxis(int value) { + if (this.axis == null) + this.axis = new IntegerType(); + this.axis.setValue(value); + return this; + } + + /** + * @return {@link #prism} (Amount of prism to compensate for eye alignment in fractional units.). This is the underlying object with id, value and extensions. The accessor "getPrism" gives direct access to the value + */ + public DecimalType getPrismElement() { + if (this.prism == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.prism"); + else if (Configuration.doAutoCreate()) + this.prism = new DecimalType(); // bb + return this.prism; + } + + public boolean hasPrismElement() { + return this.prism != null && !this.prism.isEmpty(); + } + + public boolean hasPrism() { + return this.prism != null && !this.prism.isEmpty(); + } + + /** + * @param value {@link #prism} (Amount of prism to compensate for eye alignment in fractional units.). This is the underlying object with id, value and extensions. The accessor "getPrism" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setPrismElement(DecimalType value) { + this.prism = value; + return this; + } + + /** + * @return Amount of prism to compensate for eye alignment in fractional units. + */ + public BigDecimal getPrism() { + return this.prism == null ? null : this.prism.getValue(); + } + + /** + * @param value Amount of prism to compensate for eye alignment in fractional units. + */ + public VisionPrescriptionDispenseComponent setPrism(BigDecimal value) { + if (value == null) + this.prism = null; + else { + if (this.prism == null) + this.prism = new DecimalType(); + this.prism.setValue(value); + } + return this; + } + + /** + * @return {@link #base} (The relative base, or reference lens edge, for the prism.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public Enumeration getBaseElement() { + if (this.base == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.base"); + else if (Configuration.doAutoCreate()) + this.base = new Enumeration(new BaseCodesEnumFactory()); // bb + return this.base; + } + + public boolean hasBaseElement() { + return this.base != null && !this.base.isEmpty(); + } + + public boolean hasBase() { + return this.base != null && !this.base.isEmpty(); + } + + /** + * @param value {@link #base} (The relative base, or reference lens edge, for the prism.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setBaseElement(Enumeration value) { + this.base = value; + return this; + } + + /** + * @return The relative base, or reference lens edge, for the prism. + */ + public BaseCodes getBase() { + return this.base == null ? null : this.base.getValue(); + } + + /** + * @param value The relative base, or reference lens edge, for the prism. + */ + public VisionPrescriptionDispenseComponent setBase(BaseCodes value) { + if (value == null) + this.base = null; + else { + if (this.base == null) + this.base = new Enumeration(new BaseCodesEnumFactory()); + this.base.setValue(value); + } + return this; + } + + /** + * @return {@link #add} (Power adjustment for multifocal lenses measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getAdd" gives direct access to the value + */ + public DecimalType getAddElement() { + if (this.add == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.add"); + else if (Configuration.doAutoCreate()) + this.add = new DecimalType(); // bb + return this.add; + } + + public boolean hasAddElement() { + return this.add != null && !this.add.isEmpty(); + } + + public boolean hasAdd() { + return this.add != null && !this.add.isEmpty(); + } + + /** + * @param value {@link #add} (Power adjustment for multifocal lenses measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getAdd" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setAddElement(DecimalType value) { + this.add = value; + return this; + } + + /** + * @return Power adjustment for multifocal lenses measured in diopters (0.25 units). + */ + public BigDecimal getAdd() { + return this.add == null ? null : this.add.getValue(); + } + + /** + * @param value Power adjustment for multifocal lenses measured in diopters (0.25 units). + */ + public VisionPrescriptionDispenseComponent setAdd(BigDecimal value) { + if (value == null) + this.add = null; + else { + if (this.add == null) + this.add = new DecimalType(); + this.add.setValue(value); + } + return this; + } + + /** + * @return {@link #power} (Contact lens power measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getPower" gives direct access to the value + */ + public DecimalType getPowerElement() { + if (this.power == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.power"); + else if (Configuration.doAutoCreate()) + this.power = new DecimalType(); // bb + return this.power; + } + + public boolean hasPowerElement() { + return this.power != null && !this.power.isEmpty(); + } + + public boolean hasPower() { + return this.power != null && !this.power.isEmpty(); + } + + /** + * @param value {@link #power} (Contact lens power measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getPower" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setPowerElement(DecimalType value) { + this.power = value; + return this; + } + + /** + * @return Contact lens power measured in diopters (0.25 units). + */ + public BigDecimal getPower() { + return this.power == null ? null : this.power.getValue(); + } + + /** + * @param value Contact lens power measured in diopters (0.25 units). + */ + public VisionPrescriptionDispenseComponent setPower(BigDecimal value) { + if (value == null) + this.power = null; + else { + if (this.power == null) + this.power = new DecimalType(); + this.power.setValue(value); + } + return this; + } + + /** + * @return {@link #backCurve} (Back Curvature measured in millimeters.). This is the underlying object with id, value and extensions. The accessor "getBackCurve" gives direct access to the value + */ + public DecimalType getBackCurveElement() { + if (this.backCurve == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.backCurve"); + else if (Configuration.doAutoCreate()) + this.backCurve = new DecimalType(); // bb + return this.backCurve; + } + + public boolean hasBackCurveElement() { + return this.backCurve != null && !this.backCurve.isEmpty(); + } + + public boolean hasBackCurve() { + return this.backCurve != null && !this.backCurve.isEmpty(); + } + + /** + * @param value {@link #backCurve} (Back Curvature measured in millimeters.). This is the underlying object with id, value and extensions. The accessor "getBackCurve" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setBackCurveElement(DecimalType value) { + this.backCurve = value; + return this; + } + + /** + * @return Back Curvature measured in millimeters. + */ + public BigDecimal getBackCurve() { + return this.backCurve == null ? null : this.backCurve.getValue(); + } + + /** + * @param value Back Curvature measured in millimeters. + */ + public VisionPrescriptionDispenseComponent setBackCurve(BigDecimal value) { + if (value == null) + this.backCurve = null; + else { + if (this.backCurve == null) + this.backCurve = new DecimalType(); + this.backCurve.setValue(value); + } + return this; + } + + /** + * @return {@link #diameter} (Contact lens diameter measured in millimeters.). This is the underlying object with id, value and extensions. The accessor "getDiameter" gives direct access to the value + */ + public DecimalType getDiameterElement() { + if (this.diameter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.diameter"); + else if (Configuration.doAutoCreate()) + this.diameter = new DecimalType(); // bb + return this.diameter; + } + + public boolean hasDiameterElement() { + return this.diameter != null && !this.diameter.isEmpty(); + } + + public boolean hasDiameter() { + return this.diameter != null && !this.diameter.isEmpty(); + } + + /** + * @param value {@link #diameter} (Contact lens diameter measured in millimeters.). This is the underlying object with id, value and extensions. The accessor "getDiameter" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setDiameterElement(DecimalType value) { + this.diameter = value; + return this; + } + + /** + * @return Contact lens diameter measured in millimeters. + */ + public BigDecimal getDiameter() { + return this.diameter == null ? null : this.diameter.getValue(); + } + + /** + * @param value Contact lens diameter measured in millimeters. + */ + public VisionPrescriptionDispenseComponent setDiameter(BigDecimal value) { + if (value == null) + this.diameter = null; + else { + if (this.diameter == null) + this.diameter = new DecimalType(); + this.diameter.setValue(value); + } + return this; + } + + /** + * @return {@link #duration} (The recommended maximum wear period for the lens.) + */ + public Quantity getDuration() { + if (this.duration == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.duration"); + else if (Configuration.doAutoCreate()) + this.duration = new Quantity(); // cc + return this.duration; + } + + public boolean hasDuration() { + return this.duration != null && !this.duration.isEmpty(); + } + + /** + * @param value {@link #duration} (The recommended maximum wear period for the lens.) + */ + public VisionPrescriptionDispenseComponent setDuration(Quantity value) { + this.duration = value; + return this; + } + + /** + * @return {@link #color} (Special color or pattern.). This is the underlying object with id, value and extensions. The accessor "getColor" gives direct access to the value + */ + public StringType getColorElement() { + if (this.color == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.color"); + else if (Configuration.doAutoCreate()) + this.color = new StringType(); // bb + return this.color; + } + + public boolean hasColorElement() { + return this.color != null && !this.color.isEmpty(); + } + + public boolean hasColor() { + return this.color != null && !this.color.isEmpty(); + } + + /** + * @param value {@link #color} (Special color or pattern.). This is the underlying object with id, value and extensions. The accessor "getColor" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setColorElement(StringType value) { + this.color = value; + return this; + } + + /** + * @return Special color or pattern. + */ + public String getColor() { + return this.color == null ? null : this.color.getValue(); + } + + /** + * @param value Special color or pattern. + */ + public VisionPrescriptionDispenseComponent setColor(String value) { + if (Utilities.noString(value)) + this.color = null; + else { + if (this.color == null) + this.color = new StringType(); + this.color.setValue(value); + } + return this; + } + + /** + * @return {@link #brand} (Brand recommendations or restrictions.). This is the underlying object with id, value and extensions. The accessor "getBrand" gives direct access to the value + */ + public StringType getBrandElement() { + if (this.brand == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.brand"); + else if (Configuration.doAutoCreate()) + this.brand = new StringType(); // bb + return this.brand; + } + + public boolean hasBrandElement() { + return this.brand != null && !this.brand.isEmpty(); + } + + public boolean hasBrand() { + return this.brand != null && !this.brand.isEmpty(); + } + + /** + * @param value {@link #brand} (Brand recommendations or restrictions.). This is the underlying object with id, value and extensions. The accessor "getBrand" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setBrandElement(StringType value) { + this.brand = value; + return this; + } + + /** + * @return Brand recommendations or restrictions. + */ + public String getBrand() { + return this.brand == null ? null : this.brand.getValue(); + } + + /** + * @param value Brand recommendations or restrictions. + */ + public VisionPrescriptionDispenseComponent setBrand(String value) { + if (Utilities.noString(value)) + this.brand = null; + else { + if (this.brand == null) + this.brand = new StringType(); + this.brand.setValue(value); + } + return this; + } + + /** + * @return {@link #notes} (Notes for special requirements such as coatings and lens materials.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public StringType getNotesElement() { + if (this.notes == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.notes"); + else if (Configuration.doAutoCreate()) + this.notes = new StringType(); // bb + return this.notes; + } + + public boolean hasNotesElement() { + return this.notes != null && !this.notes.isEmpty(); + } + + public boolean hasNotes() { + return this.notes != null && !this.notes.isEmpty(); + } + + /** + * @param value {@link #notes} (Notes for special requirements such as coatings and lens materials.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setNotesElement(StringType value) { + this.notes = value; + return this; + } + + /** + * @return Notes for special requirements such as coatings and lens materials. + */ + public String getNotes() { + return this.notes == null ? null : this.notes.getValue(); + } + + /** + * @param value Notes for special requirements such as coatings and lens materials. + */ + public VisionPrescriptionDispenseComponent setNotes(String value) { + if (Utilities.noString(value)) + this.notes = null; + else { + if (this.notes == null) + this.notes = new StringType(); + this.notes.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("product", "Coding", "Identifies the type of Vision correction product which is required for the patient.", 0, java.lang.Integer.MAX_VALUE, product)); + childrenList.add(new Property("eye", "code", "The eye for which the lens applies.", 0, java.lang.Integer.MAX_VALUE, eye)); + childrenList.add(new Property("sphere", "decimal", "Lens power measured in diopters (0.25 units).", 0, java.lang.Integer.MAX_VALUE, sphere)); + childrenList.add(new Property("cylinder", "decimal", "Power adjustment for astigmatism measured in diopters (0.25 units).", 0, java.lang.Integer.MAX_VALUE, cylinder)); + childrenList.add(new Property("axis", "integer", "Adjustment for astigmatism measured in integer degrees.", 0, java.lang.Integer.MAX_VALUE, axis)); + childrenList.add(new Property("prism", "decimal", "Amount of prism to compensate for eye alignment in fractional units.", 0, java.lang.Integer.MAX_VALUE, prism)); + childrenList.add(new Property("base", "code", "The relative base, or reference lens edge, for the prism.", 0, java.lang.Integer.MAX_VALUE, base)); + childrenList.add(new Property("add", "decimal", "Power adjustment for multifocal lenses measured in diopters (0.25 units).", 0, java.lang.Integer.MAX_VALUE, add)); + childrenList.add(new Property("power", "decimal", "Contact lens power measured in diopters (0.25 units).", 0, java.lang.Integer.MAX_VALUE, power)); + childrenList.add(new Property("backCurve", "decimal", "Back Curvature measured in millimeters.", 0, java.lang.Integer.MAX_VALUE, backCurve)); + childrenList.add(new Property("diameter", "decimal", "Contact lens diameter measured in millimeters.", 0, java.lang.Integer.MAX_VALUE, diameter)); + childrenList.add(new Property("duration", "Quantity", "The recommended maximum wear period for the lens.", 0, java.lang.Integer.MAX_VALUE, duration)); + childrenList.add(new Property("color", "string", "Special color or pattern.", 0, java.lang.Integer.MAX_VALUE, color)); + childrenList.add(new Property("brand", "string", "Brand recommendations or restrictions.", 0, java.lang.Integer.MAX_VALUE, brand)); + childrenList.add(new Property("notes", "string", "Notes for special requirements such as coatings and lens materials.", 0, java.lang.Integer.MAX_VALUE, notes)); + } + + public VisionPrescriptionDispenseComponent copy() { + VisionPrescriptionDispenseComponent dst = new VisionPrescriptionDispenseComponent(); + copyValues(dst); + dst.product = product == null ? null : product.copy(); + dst.eye = eye == null ? null : eye.copy(); + dst.sphere = sphere == null ? null : sphere.copy(); + dst.cylinder = cylinder == null ? null : cylinder.copy(); + dst.axis = axis == null ? null : axis.copy(); + dst.prism = prism == null ? null : prism.copy(); + dst.base = base == null ? null : base.copy(); + dst.add = add == null ? null : add.copy(); + dst.power = power == null ? null : power.copy(); + dst.backCurve = backCurve == null ? null : backCurve.copy(); + dst.diameter = diameter == null ? null : diameter.copy(); + dst.duration = duration == null ? null : duration.copy(); + dst.color = color == null ? null : color.copy(); + dst.brand = brand == null ? null : brand.copy(); + dst.notes = notes == null ? null : notes.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof VisionPrescriptionDispenseComponent)) + return false; + VisionPrescriptionDispenseComponent o = (VisionPrescriptionDispenseComponent) other; + return compareDeep(product, o.product, true) && compareDeep(eye, o.eye, true) && compareDeep(sphere, o.sphere, true) + && compareDeep(cylinder, o.cylinder, true) && compareDeep(axis, o.axis, true) && compareDeep(prism, o.prism, true) + && compareDeep(base, o.base, true) && compareDeep(add, o.add, true) && compareDeep(power, o.power, true) + && compareDeep(backCurve, o.backCurve, true) && compareDeep(diameter, o.diameter, true) && compareDeep(duration, o.duration, true) + && compareDeep(color, o.color, true) && compareDeep(brand, o.brand, true) && compareDeep(notes, o.notes, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof VisionPrescriptionDispenseComponent)) + return false; + VisionPrescriptionDispenseComponent o = (VisionPrescriptionDispenseComponent) other; + return compareValues(eye, o.eye, true) && compareValues(sphere, o.sphere, true) && compareValues(cylinder, o.cylinder, true) + && compareValues(axis, o.axis, true) && compareValues(prism, o.prism, true) && compareValues(base, o.base, true) + && compareValues(add, o.add, true) && compareValues(power, o.power, true) && compareValues(backCurve, o.backCurve, true) + && compareValues(diameter, o.diameter, true) && compareValues(color, o.color, true) && compareValues(brand, o.brand, true) + && compareValues(notes, o.notes, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (product == null || product.isEmpty()) && (eye == null || eye.isEmpty()) + && (sphere == null || sphere.isEmpty()) && (cylinder == null || cylinder.isEmpty()) && (axis == null || axis.isEmpty()) + && (prism == null || prism.isEmpty()) && (base == null || base.isEmpty()) && (add == null || add.isEmpty()) + && (power == null || power.isEmpty()) && (backCurve == null || backCurve.isEmpty()) && (diameter == null || diameter.isEmpty()) + && (duration == null || duration.isEmpty()) && (color == null || color.isEmpty()) && (brand == null || brand.isEmpty()) + && (notes == null || notes.isEmpty()); + } + + } + + /** + * Business identifier which may be used by other parties to reference or identify the prescription. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business identifier", formalDefinition="Business identifier which may be used by other parties to reference or identify the prescription." ) + protected List identifier; + + /** + * The date (and perhaps time) when the prescription was written. + */ + @Child(name = "dateWritten", type = {DateTimeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="When prescription was authorized", formalDefinition="The date (and perhaps time) when the prescription was written." ) + protected DateTimeType dateWritten; + + /** + * A link to a resource representing the person to whom the Vision products will be supplied. + */ + @Child(name = "patient", type = {Patient.class}, order=2, min=0, max=1) + @Description(shortDefinition="Who prescription is for", formalDefinition="A link to a resource representing the person to whom the Vision products will be supplied." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (A link to a resource representing the person to whom the Vision products will be supplied.) + */ + protected Patient patientTarget; + + /** + * The healthcare professional responsible for authorizing the prescription. + */ + @Child(name = "prescriber", type = {Practitioner.class}, order=3, min=0, max=1) + @Description(shortDefinition="Who authorizes the Vision product", formalDefinition="The healthcare professional responsible for authorizing the prescription." ) + protected Reference prescriber; + + /** + * The actual object that is the target of the reference (The healthcare professional responsible for authorizing the prescription.) + */ + protected Practitioner prescriberTarget; + + /** + * A link to a resource that identifies the particular occurrence of contact between patient and health care provider. + */ + @Child(name = "encounter", type = {Encounter.class}, order=4, min=0, max=1) + @Description(shortDefinition="Created during encounter / admission / stay", formalDefinition="A link to a resource that identifies the particular occurrence of contact between patient and health care provider." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + protected Encounter encounterTarget; + + /** + * Can be the reason or the indication for writing the prescription. + */ + @Child(name = "reason", type = {CodeableConcept.class, Condition.class}, order=5, min=0, max=1) + @Description(shortDefinition="Reason or indication for writing the prescription", formalDefinition="Can be the reason or the indication for writing the prescription." ) + protected Type reason; + + /** + * Deals with details of the dispense part of the supply specification. + */ + @Child(name = "dispense", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Vision supply authorization", formalDefinition="Deals with details of the dispense part of the supply specification." ) + protected List dispense; + + private static final long serialVersionUID = -1108276057L; + + /* + * Constructor + */ + public VisionPrescription() { + super(); + } + + /** + * @return {@link #identifier} (Business identifier which may be used by other parties to reference or identify the prescription.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Business identifier which may be used by other parties to reference or identify the prescription.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public VisionPrescription addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value + */ + public DateTimeType getDateWrittenElement() { + if (this.dateWritten == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescription.dateWritten"); + else if (Configuration.doAutoCreate()) + this.dateWritten = new DateTimeType(); // bb + return this.dateWritten; + } + + public boolean hasDateWrittenElement() { + return this.dateWritten != null && !this.dateWritten.isEmpty(); + } + + public boolean hasDateWritten() { + return this.dateWritten != null && !this.dateWritten.isEmpty(); + } + + /** + * @param value {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value + */ + public VisionPrescription setDateWrittenElement(DateTimeType value) { + this.dateWritten = value; + return this; + } + + /** + * @return The date (and perhaps time) when the prescription was written. + */ + public Date getDateWritten() { + return this.dateWritten == null ? null : this.dateWritten.getValue(); + } + + /** + * @param value The date (and perhaps time) when the prescription was written. + */ + public VisionPrescription setDateWritten(Date value) { + if (value == null) + this.dateWritten = null; + else { + if (this.dateWritten == null) + this.dateWritten = new DateTimeType(); + this.dateWritten.setValue(value); + } + return this; + } + + /** + * @return {@link #patient} (A link to a resource representing the person to whom the Vision products will be supplied.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescription.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (A link to a resource representing the person to whom the Vision products will be supplied.) + */ + public VisionPrescription setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person to whom the Vision products will be supplied.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescription.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person to whom the Vision products will be supplied.) + */ + public VisionPrescription setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.) + */ + public Reference getPrescriber() { + if (this.prescriber == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescription.prescriber"); + else if (Configuration.doAutoCreate()) + this.prescriber = new Reference(); // cc + return this.prescriber; + } + + public boolean hasPrescriber() { + return this.prescriber != null && !this.prescriber.isEmpty(); + } + + /** + * @param value {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.) + */ + public VisionPrescription setPrescriber(Reference value) { + this.prescriber = value; + return this; + } + + /** + * @return {@link #prescriber} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The healthcare professional responsible for authorizing the prescription.) + */ + public Practitioner getPrescriberTarget() { + if (this.prescriberTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescription.prescriber"); + else if (Configuration.doAutoCreate()) + this.prescriberTarget = new Practitioner(); // aa + return this.prescriberTarget; + } + + /** + * @param value {@link #prescriber} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The healthcare professional responsible for authorizing the prescription.) + */ + public VisionPrescription setPrescriberTarget(Practitioner value) { + this.prescriberTarget = value; + return this; + } + + /** + * @return {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescription.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public VisionPrescription setEncounter(Reference value) { + this.encounter = value; + return this; + } + + /** + * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescription.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + return this.encounterTarget; + } + + /** + * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public VisionPrescription setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) + */ + public Type getReason() { + return this.reason; + } + + /** + * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) + */ + public CodeableConcept getReasonCodeableConcept() throws Exception { + if (!(this.reason instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (CodeableConcept) this.reason; + } + + /** + * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) + */ + public Reference getReasonReference() throws Exception { + if (!(this.reason instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (Reference) this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Can be the reason or the indication for writing the prescription.) + */ + public VisionPrescription setReason(Type value) { + this.reason = value; + return this; + } + + /** + * @return {@link #dispense} (Deals with details of the dispense part of the supply specification.) + */ + public List getDispense() { + if (this.dispense == null) + this.dispense = new ArrayList(); + return this.dispense; + } + + public boolean hasDispense() { + if (this.dispense == null) + return false; + for (VisionPrescriptionDispenseComponent item : this.dispense) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dispense} (Deals with details of the dispense part of the supply specification.) + */ + // syntactic sugar + public VisionPrescriptionDispenseComponent addDispense() { //3 + VisionPrescriptionDispenseComponent t = new VisionPrescriptionDispenseComponent(); + if (this.dispense == null) + this.dispense = new ArrayList(); + this.dispense.add(t); + return t; + } + + // syntactic sugar + public VisionPrescription addDispense(VisionPrescriptionDispenseComponent t) { //3 + if (t == null) + return this; + if (this.dispense == null) + this.dispense = new ArrayList(); + this.dispense.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Business identifier which may be used by other parties to reference or identify the prescription.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("dateWritten", "dateTime", "The date (and perhaps time) when the prescription was written.", 0, java.lang.Integer.MAX_VALUE, dateWritten)); + childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person to whom the Vision products will be supplied.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("prescriber", "Reference(Practitioner)", "The healthcare professional responsible for authorizing the prescription.", 0, java.lang.Integer.MAX_VALUE, prescriber)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "A link to a resource that identifies the particular occurrence of contact between patient and health care provider.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Condition)", "Can be the reason or the indication for writing the prescription.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("dispense", "", "Deals with details of the dispense part of the supply specification.", 0, java.lang.Integer.MAX_VALUE, dispense)); + } + + public VisionPrescription copy() { + VisionPrescription dst = new VisionPrescription(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.dateWritten = dateWritten == null ? null : dateWritten.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.prescriber = prescriber == null ? null : prescriber.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.reason = reason == null ? null : reason.copy(); + if (dispense != null) { + dst.dispense = new ArrayList(); + for (VisionPrescriptionDispenseComponent i : dispense) + dst.dispense.add(i.copy()); + }; + return dst; + } + + protected VisionPrescription typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof VisionPrescription)) + return false; + VisionPrescription o = (VisionPrescription) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(dateWritten, o.dateWritten, true) + && compareDeep(patient, o.patient, true) && compareDeep(prescriber, o.prescriber, true) && compareDeep(encounter, o.encounter, true) + && compareDeep(reason, o.reason, true) && compareDeep(dispense, o.dispense, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof VisionPrescription)) + return false; + VisionPrescription o = (VisionPrescription) other; + return compareValues(dateWritten, o.dateWritten, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (dateWritten == null || dateWritten.isEmpty()) + && (patient == null || patient.isEmpty()) && (prescriber == null || prescriber.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (reason == null || reason.isEmpty()) && (dispense == null || dispense.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.VisionPrescription; + } + + @SearchParamDefinition(name="prescriber", path="VisionPrescription.prescriber", description="Who authorizes the Vision product", type="reference" ) + public static final String SP_PRESCRIBER = "prescriber"; + @SearchParamDefinition(name="identifier", path="VisionPrescription.identifier", description="Return prescriptions with this external identity", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="patient", path="VisionPrescription.patient", description="The identity of a patient to list dispenses for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="datewritten", path="VisionPrescription.dateWritten", description="Return prescriptions written on this date", type="date" ) + public static final String SP_DATEWRITTEN = "datewritten"; + @SearchParamDefinition(name="encounter", path="VisionPrescription.encounter", description="Return prescriptions with this encounter identity", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + +} + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/model/ModelInheritanceTest.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/model/ModelInheritanceTest.java index 9ab9bfba397..ef23ef3251b 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/model/ModelInheritanceTest.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/model/ModelInheritanceTest.java @@ -57,7 +57,7 @@ import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.instance.model.api.IBaseMetaType; import org.hl7.fhir.instance.model.api.INarrative; import org.hl7.fhir.instance.model.api.IPrimitiveType; -import org.hl7.fhir.instance.model.api.IRefImplResource; +import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.utilities.xhtml.XhtmlNode; import org.junit.Test; @@ -252,7 +252,7 @@ public class ModelInheritanceTest { @Test public void testResource() { - assertTrue(IRefImplResource.class.isAssignableFrom(Resource.class)); + assertTrue(IAnyResource.class.isAssignableFrom(Resource.class)); } @Test diff --git a/sync_ri.sh b/sync_ri.sh new file mode 100644 index 00000000000..61fc1322f5c --- /dev/null +++ b/sync_ri.sh @@ -0,0 +1 @@ +cp ~/workspace/fhirbuild/trunk/build/implementations/java/org.hl7.fhir.instance/src/org/hl7/fhir/instance/model/*.java hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/